@ai-matrx/office 0.8.30 → 0.8.32

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,10 +1,21 @@
1
1
  # Changelog
2
2
 
3
- ## 0.8.30
3
+ ## 0.8.32
4
4
 
5
5
  UNVERIFIED: this release has no Unreleased entry and the source comparison could not be made (the caller supplied no source comparison). Whether source changed is unknown; consumer action is unknown.
6
6
  Check the package's gitHead on npm against this version's gitHead: `git diff <previous gitHead> <this gitHead> -- apps/shared/office/src`.
7
7
 
8
+ ## 0.8.30
9
+
10
+ SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
11
+ so they may include breaking API changes. Consumer action is UNKNOWN: read the diff before upgrading.
12
+ Diff: `git diff acce3dd470 149d6b9267 -- apps/shared/office/src`
13
+
14
+ Changed shipped source files (3):
15
+ - `apps/shared/office/src/docs/document-model.ts`
16
+ - `apps/shared/office/src/sheets/comment-anchors.ts`
17
+ - `apps/shared/office/src/univer/collab/sheets-ot/univer-port.ts`
18
+
8
19
  ## 0.8.29
9
20
 
10
21
  SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
@@ -101,9 +112,9 @@ Changed shipped source files (2):
101
112
  - **Docs state hash: plugin resources by content, zoom never.** The browser editor (full docs preset) writes one `resources` entry per plugin on every save (`"[]"`, `""`, `{"links":[]}`, `{"data":{},"order":[]}`) and `settings.zoomRatio`; a stored row and a headless load have neither, so live seats still refused a restore after 0.8.18. The canonical form now parses each resource, drops empty ones, sorts by name, and drops the zoom. Forcing case: the live row and what the browser held after loading it (red on 0.8.18, green). Consumer action: none.
102
113
 
103
114
  ## 0.8.18
104
- ### C7a restore hash, stale checkpoints, collaborator colours
115
+ ### C7a restore hash, stale checkpoints, collaborator colors
105
116
 
106
- - **Docs co-editing: one canonical state hash, before and after Univer loads it (C7a follow-up).** `canonicalDocsSnapshot` now first brings a snapshot to the form every seat holds after loading it (`asLoadedDocsSnapshot`: deterministic ids, `sanitizeUniverDocSnapshot`, Univer's own `DocumentDataModel` defaults) and drops `sectionId` like `paragraphId`. A History restore of a document not open in this tab hashed the raw row while every open seat hashed what Univer held, so both seats refused it (`checkpoint_hash at rev 10`) and kept the old text; now the two agree (corpus + real History versions, through a real Univer load and save). Docs rooms: a keystroke the session refused while reloading puts the seat back on the room's document instead of staying on that seat alone; collaborator colours by join order (`claimCollaboratorColor` from data). `sanitizeUniverDocSnapshot` takes `{ quiet }`. Consumer action: none (no live room predates this hash; every existing room is on a trashed test document).
117
+ - **Docs co-editing: one canonical state hash, before and after Univer loads it (C7a follow-up).** `canonicalDocsSnapshot` now first brings a snapshot to the form every seat holds after loading it (`asLoadedDocsSnapshot`: deterministic ids, `sanitizeUniverDocSnapshot`, Univer's own `DocumentDataModel` defaults) and drops `sectionId` like `paragraphId`. A History restore of a document not open in this tab hashed the raw row while every open seat hashed what Univer held, so both seats refused it (`checkpoint_hash at rev 10`) and kept the old text; now the two agree (corpus + real History versions, through a real Univer load and save). Docs rooms: a keystroke the session refused while reloading puts the seat back on the room's document instead of staying on that seat alone; collaborator colors by join order (`claimCollaboratorColor` from data). `sanitizeUniverDocSnapshot` takes `{ quiet }`. Consumer action: none (no live room predates this hash; every existing room is on a trashed test document).
107
118
 
108
119
  ## 0.8.17
109
120
 
@@ -152,6 +163,7 @@ Changed shipped source files (8):
152
163
 
153
164
  ### Unreleased
154
165
 
166
+ - **US spelling: the British spelling of "color" no longer exists in this package (Arman, 2026-10-21).** Every label, template string, comment, identifier, CSS class/variable and test name that spelled it the British way now says color. Guard: `design-system/src/us-spelling.test.ts` scans all of `apps/` for the word. Consumer action: none for imports; if you matched on a British-spelled identifier, class or CSS variable from this package, use the `color` spelling; update the package.
155
167
  - **Sheets co-editing on the ordered log (C6).** `@ai-matrx/office/univer/collab` adds the Sheets room: `openSheetsOtRoom` (the C2 session over the C5a/C5b group transform, saves at a quiet point with a matching hash, restore through `collab_replace`, undo items rebased over every remote op), `univerSheetsOtPort` (capture: onlyLocal/fromCollab filtered, grouped by outermost command with a try/finally depth guard on both execute paths, params allowlist, completeCellContent, exact merge removals, style objects never ids, whole-style overrides restated as merges, annotateFormulas, inverses from the applied params against a pre-state copy; a barrier or unknown id is `not_shared` and rolls the seat back), `sheetsStateHash` / `canonicalSheet` (merges as a set, defined names by id; the transform fuzz now hashes through it), and `startWorkbookOtRoom` / `workbookUsesOrderedRoom` (the `udt_workbook_snapshots` store, the C1 doors, presence). A remote row/column insert, remove or move carries this seat's selection along and never leaves it past the sheet's edge (the port's `selections` option; a stale whole-row selection after a peer's column delete crashed the editor in the live run). Remote applies run with `{ fromCollab: true }` only (not `onlyLocal`): Univer's formula engine skips onlyLocal value writes, so a peer's formula showed blank on every other seat in the live run. Flip is per room exactly like Docs. Consumer action: matrx-frontend's WorkbookEditor opens it when the workbook's room exists or `collab.ot_rooms` says so (shipped with this release); every other consumer: none.
156
168
 
157
169
  - **`Workbook` and `DocumentRow` carry `test_expires_at` / `test_run_id`** — the `workbench.udt_workbooks` / `udt_documents` rows gained these test-fixture columns; the hand-written types now match the generated row again (matrx-frontend `features/data-tables/office-types-agree.ts`). Consumer action: none (a literal building one of these rows must add the two fields, `null` for real records).
@@ -632,7 +632,8 @@ registerRangedResource({
632
632
  }),
633
633
  removeOf: (sheet, key) => ({ id: "sheet.mutation.delete-conditional-rule", params: { subUnitId: sheet, cfId: key, derived: true } }),
634
634
  hasFormula: (m) => CF_FORMULA(cfRule(m)),
635
- orderedAdds: true
635
+ orderedAdds: true,
636
+ setsOverwrite: true
636
637
  });
637
638
  var DV = { add: "data-validation.mutation.addRule", update: "data-validation.mutation.updateRule", remove: "data-validation.mutation.removeRule" };
638
639
  var DV_RANGE = 1;
@@ -1864,6 +1865,24 @@ function transformMutation(x, y, side) {
1864
1865
  return ok2([x]);
1865
1866
  }
1866
1867
  var blocked = (p) => !Array.isArray(p);
1868
+ function compactDerivedSets(ops) {
1869
+ if (ops.length < 2) return ops;
1870
+ const later = /* @__PURE__ */ new Set();
1871
+ const out = [];
1872
+ for (let i = ops.length - 1; i >= 0; i--) {
1873
+ const m = ops[i];
1874
+ const spec = rangedSpecOf(m.id);
1875
+ if (spec?.setsOverwrite && spec.ids[m.id] === "set") {
1876
+ const at = (k, facet2) => `${spec.family}|${sheetOf(m)}|${k}|${facet2}`;
1877
+ const facet = spec.facet?.(m) ?? "all";
1878
+ const keys = spec.keys(m);
1879
+ if (isDerived(m) && keys.every((k) => later.has(at(k, facet)) || later.has(at(k, "all")))) continue;
1880
+ for (const k of keys) later.add(at(k, facet));
1881
+ }
1882
+ out.push(m);
1883
+ }
1884
+ return out.length === ops.length ? ops : out.reverse();
1885
+ }
1867
1886
  function tSeq(xs, ys, side, acc) {
1868
1887
  if (xs.length === 0 || ys.length === 0) return [xs, ys];
1869
1888
  if (xs.length === 1 && ys.length === 1) {
@@ -1887,33 +1906,17 @@ function tSeq(xs, ys, side, acc) {
1887
1906
  }
1888
1907
  const r = tSeq(curX, [y], side, acc);
1889
1908
  if (blocked(r)) return r;
1890
- curX = r[0];
1909
+ curX = r[0].length > 1 ? compactDerivedSets(r[0]) : r[0];
1891
1910
  for (const m of r[1]) nextY.push(m);
1892
1911
  }
1893
1912
  for (const m of curX) outX.push(m);
1894
- curY = nextY;
1913
+ curY = compactDerivedSets(nextY);
1895
1914
  }
1896
- return [outX, curY];
1897
- }
1898
- function tSeqOld(xs, ys, side, acc) {
1899
- if (xs.length === 0 || ys.length === 0) return [xs, ys];
1900
- if (xs.length === 1 && ys.length === 1) return tSeq(xs, ys, side, acc);
1901
- if (xs.length > 1) {
1902
- const first2 = tSeqOld([xs[0]], ys, side, acc);
1903
- if (blocked(first2)) return first2;
1904
- const rest2 = tSeqOld(xs.slice(1), first2[1], side, acc);
1905
- if (blocked(rest2)) return rest2;
1906
- return [[...first2[0], ...rest2[0]], rest2[1]];
1907
- }
1908
- const first = tSeqOld(xs, [ys[0]], side, acc);
1909
- if (blocked(first)) return first;
1910
- const rest = tSeqOld(first[0], ys.slice(1), side, acc);
1911
- if (blocked(rest)) return rest;
1912
- return [rest[0], [...first[1], ...rest[1]]];
1915
+ return [compactDerivedSets(outX), curY];
1913
1916
  }
1914
1917
  function transformGroup(x, y, side) {
1915
1918
  const acc = { lost: [], dropped: [] };
1916
- const r = (process.env.OLD_TSEQ ? tSeqOld : tSeq)([...x], [...y], side, acc);
1919
+ const r = tSeq([...x], [...y], side, acc);
1917
1920
  if (blocked(r)) return r;
1918
1921
  return { op: r[0], lost: [...new Set(acc.lost)], dropped: [...new Set(acc.dropped)] };
1919
1922
  }