@a3s-lab/office 0.10.0 → 0.12.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.
Files changed (47) hide show
  1. package/COLLABORATION_ROADMAP.md +22 -12
  2. package/README.md +40 -15
  3. package/dist/{0~4705.js → 0~5093.js} +959 -10
  4. package/dist/0~document-editor.js +1 -0
  5. package/dist/0~spreadsheet-editor.js +189 -104
  6. package/dist/0~work-docx-export.js +225 -6
  7. package/dist/0~work-docx-import.js +26 -755
  8. package/dist/0~work-office-diagnostics.js +12 -8
  9. package/dist/0~work-pptx-import.js +2 -2
  10. package/dist/4104.js +330 -122
  11. package/dist/4476.js +82 -65
  12. package/dist/8715.js +41 -3
  13. package/dist/8928.js +448 -137
  14. package/dist/9356.js +126 -8
  15. package/dist/core.d.ts +1 -0
  16. package/dist/internal/features/work/editors/spreadsheet-editor-support.d.ts +1 -0
  17. package/dist/internal/features/work/editors/use-spreadsheet-collaboration.d.ts +2 -1
  18. package/dist/internal/features/work/spreadsheet-sparse.d.ts +5 -0
  19. package/dist/internal/features/work/work-document-file-io.d.ts +2 -1
  20. package/dist/internal/features/work/work-document-format-change-tracking.d.ts +1 -1
  21. package/dist/internal/features/work/work-document-paragraph-format-change-tracking.d.ts +7 -0
  22. package/dist/internal/features/work/work-document-paragraph-format-changes.d.ts +8 -0
  23. package/dist/internal/features/work/work-docx-import.d.ts +5 -2
  24. package/dist/internal/features/work/work-docx-paragraph-alignment-import.d.ts +1 -0
  25. package/dist/internal/features/work/work-docx-paragraph-borders-import.d.ts +1 -0
  26. package/dist/internal/features/work/work-docx-paragraph-direction-import.d.ts +1 -0
  27. package/dist/internal/features/work/work-docx-paragraph-format-change-export.d.ts +13 -0
  28. package/dist/internal/features/work/work-docx-paragraph-format-change-import.d.ts +17 -0
  29. package/dist/internal/features/work/work-docx-paragraph-indent-import.d.ts +1 -0
  30. package/dist/internal/features/work/work-docx-paragraph-pagination-import.d.ts +1 -0
  31. package/dist/internal/features/work/work-docx-paragraph-shading-import.d.ts +1 -0
  32. package/dist/internal/features/work/work-docx-paragraph-spacing-import.d.ts +1 -0
  33. package/dist/internal/features/work/work-docx-tab-stop-import.d.ts +1 -0
  34. package/dist/internal/features/work/work-file-data.d.ts +7 -1
  35. package/dist/internal/features/work/work-file-import.d.ts +28 -0
  36. package/dist/internal/features/work/work-file-io.d.ts +2 -1
  37. package/dist/internal/features/work/work-markdown-file-io.d.ts +2 -1
  38. package/dist/internal/features/work/work-office-diagnostics.d.ts +3 -2
  39. package/dist/internal/features/work/work-pptx-import.d.ts +1 -1
  40. package/dist/internal/features/work/work-presentation-file-io.d.ts +2 -1
  41. package/dist/internal/features/work/work-spreadsheet-protection.d.ts +2 -0
  42. package/dist/internal/features/work/work-types.d.ts +23 -1
  43. package/dist/internal/features/work/work-xlsx-interop.d.ts +4 -14
  44. package/dist/office-kernel.wasm +0 -0
  45. package/dist/styles.css +8 -0
  46. package/docs/latest/en/browser-editor-architecture.md +18 -0
  47. package/package.json +10 -4
@@ -110,17 +110,17 @@ Redis/NATS fan-out plus a distributed writer/lock policy.
110
110
 
111
111
  Status: browser collaboration foundation, participant roster, remote
112
112
  selection/caret projection, participant navigation, durable review-only
113
- comment and suggestion modes, character-formatting revisions, immutable
114
- decision audit, and native text/options/bounded structural
113
+ comment and suggestion modes, character- and paragraph-formatting revisions,
114
+ immutable decision audit, and native text/options/bounded structural
115
115
  paragraph/comment/suggestion mutations implemented; rich native mutation
116
116
  parity remains pending.
117
117
 
118
118
  - TipTap is bound to `document.content` through
119
119
  `@tiptap/extension-collaboration`; StarterKit undo/redo is disabled and the
120
120
  collaboration binding owns local history.
121
- - Section/page OOXML state, comment anchors, and text or character-formatting
122
- tracked-change marks converge in the ProseMirror fragment. Document-level
123
- page color, tracking mode,
121
+ - Section/page OOXML state, comment anchors, text tracked-change marks, and
122
+ character-formatting marks or paragraph-formatting node revisions converge
123
+ in the ProseMirror fragment. Document-level page color, tracking mode,
124
124
  comment threads/replies, and bibliography sources use conflict-local typed
125
125
  roots instead of a serialized document blob.
126
126
  - React, Vue, and Web Component adapters accept the same initialized session.
@@ -174,6 +174,14 @@ parity remains pending.
174
174
  bold, italic, underline, strike, sub/superscript, font, size, color,
175
175
  highlight, and grid marks without changing text. Supported DOCX
176
176
  `w:rPrChange` records import into the same model and export natively.
177
+ - Paragraph-formatting commands create one shared `paragraph-formatting`
178
+ identity across every affected paragraph or heading and retain the complete
179
+ canonical old-property snapshot on each node. Accept keeps current paragraph
180
+ properties; reject atomically restores alignment, direction, indentation,
181
+ spacing and line rules, pagination controls, contextual spacing, outline
182
+ level, tab stops, borders, shading, and collapsed state without changing
183
+ text. Supported strict or transitional DOCX `w:pPrChange` records use the
184
+ same model and export natively.
177
185
  - Rust, CLI, MCP, and A3S Code expose `document-comment-create`,
178
186
  `document-comment-reply`, `document-comment-set-resolved`,
179
187
  `document-comment-delete`, `document-suggestion-create`, and
@@ -191,19 +199,21 @@ parity remains pending.
191
199
  content, structure, options, non-suggestion formatting, authorship, order,
192
200
  claims, anchors, foreign deletion, or foreign suggestion changes fail before
193
201
  the durable store changes.
194
- - Native Yrs validation admits only the bounded formatting-change schema,
195
- preserves it across restart and duplicate/reordered delivery, exposes
196
- `formatting` in immutable decision projections, and makes `suggest` updates
197
- retain existing formatting revisions byte-semantically. Formatting is a
198
- Document change kind, not a native insertion/deletion suggestion kind; the
199
- current closed `document-suggestion-*` mutations remain text-only.
202
+ - Native Yrs validation admits only the bounded character- and
203
+ paragraph-formatting schemas, preserves them across restart and
204
+ duplicate/reordered delivery, exposes `formatting` and
205
+ `paragraph-formatting` in immutable decision projections, and makes
206
+ `suggest` updates retain existing formatting revisions byte-semantically.
207
+ Formatting revisions are Document change kinds, not native
208
+ insertion/deletion suggestion kinds; the current closed
209
+ `document-suggestion-*` mutations remain text-only.
200
210
 
201
211
  Remaining:
202
212
 
203
213
  - Prove concurrent full-table, list-restructure, section, comment, and revision
204
214
  workflows, plus DOCX import/export after merged edits.
205
215
  - Expand native convergence from bounded paragraph edits to complete table,
206
- list, and section operations, comments, and tracked revisions.
216
+ list, and section operations, comments, and the remaining tracked revisions.
207
217
 
208
218
  Exit criterion: two browsers and one native client converge on document
209
219
  content and review state; local undo never removes a remote change; a DOCX
package/README.md CHANGED
@@ -48,9 +48,9 @@ workflows, and a separate Rust automation plane.
48
48
  participants and remote locations, plus browser, CLI, MCP, and A3S Code peers.
49
49
  Document reviewers can submit attributed insertions, deletions, and
50
50
  replacements without directly changing canonical text. Editors can also
51
- track character-formatting revisions, accept the new formatting or restore
52
- the exact prior marks, and retain either result in the immutable shared
53
- decision audit.
51
+ track character- and paragraph-formatting revisions, accept the new
52
+ formatting or restore the exact prior marks/properties, and retain either
53
+ result in the immutable shared decision audit.
54
54
  - **Automate deterministically** through the native CLI, standard MCP server,
55
55
  or packaged Office Skill.
56
56
 
@@ -150,8 +150,9 @@ The images below are committed visual-regression baselines from the real
150
150
  Presentation scene-element and z-order, and PDF annotation, form-value, and
151
151
  review changes, including attributable Document selection comments, replies,
152
152
  text suggestions, and atomic final decisions, retain browser/native actor
153
- attribution, validate browser-created formatting revisions and their audit
154
- records, and checkpoint without replacing a whole Office file.
153
+ attribution, validate browser-created character- and paragraph-formatting
154
+ revisions and their audit records, and checkpoint without replacing a whole
155
+ Office file.
155
156
 
156
157
  ## Real-time collaboration
157
158
 
@@ -174,13 +175,13 @@ deletions, and replacements while canonical text, structure, formatting,
174
175
  options, comments, and other actors' suggestions remain protected. An `edit`
175
176
  participant accepts or rejects a proposal and appends the final actor-attributed
176
177
  decision to the immutable `document.change-decisions` audit trail. The A3S Boot
177
- service also persists `edit`-mode character-formatting revisions and validates
178
- their bounded prior-format snapshot before broadcast. Accept keeps the new
179
- bold, italic, underline, strike, vertical position, font, size, color, or
180
- highlight; reject restores the prior direct marks without deleting the text.
181
- Authenticated `suggest` updates must preserve those formatting revisions and
182
- cannot rewrite their identity or snapshot. `suggest` on non-Document formats
183
- remains receive-only.
178
+ service also persists `edit`-mode character- and paragraph-formatting revisions
179
+ and validates their bounded prior-format snapshots before broadcast. Character
180
+ decisions keep or restore direct marks. Paragraph decisions keep or restore
181
+ alignment, direction, indentation, spacing, pagination, outline, tab stops,
182
+ borders, shading, and collapsed state without deleting text. Authenticated
183
+ `suggest` updates must preserve both revision kinds and cannot rewrite their
184
+ identity or snapshot. `suggest` on non-Document formats remains receive-only.
184
185
  See the bilingual [real-time collaboration guide](https://a3s-lab.github.io/Office/docs/components/collaboration.html)
185
186
  for React, Vue, Web Component, reconnect, security, and native-agent setup.
186
187
  The repository also ships a runnable
@@ -203,8 +204,9 @@ bun run playground
203
204
 
204
205
  Then open the local URL printed by the development server. For a zero-install
205
206
  tour, use the [live Playground](https://a3s-lab.github.io/Office/).
206
- Choose **体验格式修订**, open **审阅**, then **查看修订(1)** to inspect the
207
- Formatting card and exercise accept or reject semantics.
207
+ Choose **体验格式修订**, open **审阅**, then **查看修订(2)** to inspect the
208
+ independent Formatting and Paragraph Formatting cards and exercise accept or
209
+ reject semantics.
208
210
 
209
211
  ### Embed a controlled React editor
210
212
 
@@ -576,11 +578,32 @@ import {
576
578
  importOfficeFile,
577
579
  } from '@a3s-lab/office/core';
578
580
 
579
- const imported = await importOfficeFile(file);
581
+ const controller = new AbortController();
582
+ const imported = await importOfficeFile(file, {
583
+ signal: controller.signal,
584
+ onProgress: ({ stage, progress }) => {
585
+ console.info(stage, `${Math.round(progress * 100)}%`);
586
+ },
587
+ });
580
588
  const output = await createArtifactBlob(imported);
581
589
  const blankDeck = createArtifact('blank-presentation');
582
590
  ```
583
591
 
592
+ Import progress advances monotonically through `reading`, `parsing`,
593
+ `analyzing`, and `finalizing`. Calling `controller.abort()` rejects with an
594
+ `AbortError`; large reads and parser checkpoints yield so a host can keep the
595
+ progress and Cancel controls responsive.
596
+
597
+ Spreadsheet import and export preserve sparse worksheets up to the XLSX limit
598
+ of 1,048,576 rows by 16,384 columns. The logical `data.length`, `row`, and
599
+ `column` dimensions can be large while only populated indexes are materialized.
600
+ Virtual scrolling never emits `onChange`, and editing a far blank row creates
601
+ only that row. Data-validation regions remain compact in
602
+ `dataValidationRanges`; direct `dataVerification` entries take precedence.
603
+ Protection ranges, passwordless editable ranges, and conditional formatting
604
+ also remain compact and round-trip through native XLSX records without
605
+ allocating every covered cell.
606
+
584
607
  Use `downloadArtifact` to start a browser download or
585
608
  `createArtifactBlob` when your application owns upload and persistence.
586
609
  Imported DOCX artifacts are source-backed: safe source-only OPC parts,
@@ -1336,6 +1359,8 @@ without hard-coded return URLs.
1336
1359
 
1337
1360
  - [Live Playground](https://a3s-lab.github.io/Office/)
1338
1361
  - [Documentation center](https://a3s-lab.github.io/Office/docs/)
1362
+ - [A3S Office 0.12.0 documentation](https://a3s-lab.github.io/Office/docs/0.12.0/)
1363
+ - [A3S Office 0.11.0 documentation](https://a3s-lab.github.io/Office/docs/0.11.0/)
1339
1364
  - [A3S Office 0.10.0 documentation](https://a3s-lab.github.io/Office/docs/0.10.0/)
1340
1365
  - [A3S Office 0.9.2 documentation](https://a3s-lab.github.io/Office/docs/0.9.2/)
1341
1366
  - [A3S Office 0.9.1 documentation](https://a3s-lab.github.io/Office/docs/0.9.1/)