@a3s-lab/office 0.29.0 → 0.31.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 (61) hide show
  1. package/README.md +117 -3
  2. package/dist/{0~7043.js → 0~4808.js} +347 -2
  3. package/dist/0~5050.js +10 -1
  4. package/dist/{0~5093.js → 0~7240.js} +465 -55
  5. package/dist/0~document-editor.js +1694 -187
  6. package/dist/0~spreadsheet-editor.js +183 -34
  7. package/dist/0~work-docx-export.js +507 -31
  8. package/dist/0~work-docx-import.js +41 -7
  9. package/dist/0~work-office-diagnostics.js +146 -5
  10. package/dist/1544.js +13 -1
  11. package/dist/4104.js +29 -6
  12. package/dist/4121.js +2340 -1
  13. package/dist/6282.js +1072 -1148
  14. package/dist/internal/features/work/editors/document-command-catalog.d.ts +45 -0
  15. package/dist/internal/features/work/editors/document-dom-selection.d.ts +7 -0
  16. package/dist/internal/features/work/editors/document-editor-support.d.ts +1 -0
  17. package/dist/internal/features/work/editors/document-font-dialog-model.d.ts +5 -2
  18. package/dist/internal/features/work/editors/document-font-dialog-run-shading-model.d.ts +23 -0
  19. package/dist/internal/features/work/editors/document-font-dialog-run-shading-section.d.ts +8 -0
  20. package/dist/internal/features/work/editors/document-index-dialog.d.ts +10 -0
  21. package/dist/internal/features/work/editors/document-index-entry-dialog.d.ts +10 -0
  22. package/dist/internal/features/work/editors/document-page-chrome-ribbon.d.ts +2 -1
  23. package/dist/internal/features/work/editors/document-proofing-dialog-model.d.ts +22 -0
  24. package/dist/internal/features/work/editors/document-proofing-dialog.d.ts +7 -0
  25. package/dist/internal/features/work/editors/document-references-ribbon.d.ts +19 -0
  26. package/dist/internal/features/work/editors/document-table-of-contents-dialog.d.ts +10 -0
  27. package/dist/internal/features/work/editors/document-toolbar.d.ts +6 -1
  28. package/dist/internal/features/work/editors/spreadsheet-data-validation.d.ts +7 -1
  29. package/dist/internal/features/work/editors/use-document-insert-commands.d.ts +5 -0
  30. package/dist/internal/features/work/work-document-character-formatting.d.ts +8 -0
  31. package/dist/internal/features/work/work-document-format-changes.d.ts +6 -0
  32. package/dist/internal/features/work/work-document-highlight.d.ts +9 -0
  33. package/dist/internal/features/work/work-document-index-fields.d.ts +19 -0
  34. package/dist/internal/features/work/work-document-index-nodes.d.ts +32 -0
  35. package/dist/internal/features/work/work-document-index.d.ts +63 -0
  36. package/dist/internal/features/work/work-document-outline.d.ts +1 -0
  37. package/dist/internal/features/work/work-document-paragraph-shading.d.ts +6 -0
  38. package/dist/internal/features/work/work-document-proofing.d.ts +19 -0
  39. package/dist/internal/features/work/work-document-run-shading.d.ts +12 -0
  40. package/dist/internal/features/work/work-document-table-of-contents-node.d.ts +18 -0
  41. package/dist/internal/features/work/work-document-table-of-contents.d.ts +51 -0
  42. package/dist/internal/features/work/work-document-word-line-metrics.d.ts +3 -0
  43. package/dist/internal/features/work/work-docx-field-instructions.d.ts +1 -1
  44. package/dist/internal/features/work/work-docx-import.d.ts +5 -1
  45. package/dist/internal/features/work/work-docx-index-export.d.ts +14 -0
  46. package/dist/internal/features/work/work-docx-index-import.d.ts +23 -0
  47. package/dist/internal/features/work/work-docx-proofing-diagnostics.d.ts +3 -0
  48. package/dist/internal/features/work/work-docx-proofing.d.ts +38 -0
  49. package/dist/internal/features/work/work-docx-run-formatting-import.d.ts +7 -0
  50. package/dist/internal/features/work/work-docx-run-shading-diagnostics.d.ts +3 -0
  51. package/dist/internal/features/work/work-docx-run-shading-export.d.ts +17 -0
  52. package/dist/internal/features/work/work-docx-run-shading.d.ts +20 -0
  53. package/dist/internal/features/work/work-docx-table-of-contents-export.d.ts +11 -0
  54. package/dist/internal/features/work/work-docx-table-of-contents-import.d.ts +15 -0
  55. package/dist/internal/features/work/work-spreadsheet-data-validation.d.ts +7 -0
  56. package/dist/internal/features/work/work-types.d.ts +9 -0
  57. package/dist/internal/kernel/office-kernel-protocol.d.ts +1 -0
  58. package/dist/office-kernel.wasm +0 -0
  59. package/dist/styles.css +607 -4
  60. package/docs/latest/en/browser-editor-architecture.md +64 -1
  61. package/package.json +15 -2
@@ -94,7 +94,36 @@ model:
94
94
  instructionless structures keep their rendered result as text and emit a
95
95
  structural compatibility warning instead of being flattened into a false
96
96
  editable field. Native export writes live simple fields and requests a Word
97
- field update on open. Page Layout keeps direct margin, orientation, paper,
97
+ field update on open. Table of Contents is a separate block atom because its
98
+ native field spans cached paragraphs. It reads semantic headings and native
99
+ outline-level paragraphs only from the shared outline collector, reads page
100
+ numbers only from the pagination field resolver, and stores bounded options
101
+ plus at most 512 cached entries. Included outline items without a native
102
+ paragraph identity receive one in the insert/update transaction, so a block
103
+ insertion cannot invalidate its own targets. One
104
+ References dialog owns insert and selected-block customization; explicit
105
+ refresh updates every TOC in one transaction. DOCX export emits a real
106
+ `w:sdt`/`TOC` field, patches native leader and alignment semantics, and adds
107
+ stable heading bookmarks. Import accepts only the lossless common switch
108
+ subset and removes the complete content control before Mammoth conversion,
109
+ then restores one typed block after paragraph identities are applied. Each
110
+ imported TOC matches its cached rows independently, so repeated TOCs can
111
+ target the same heading.
112
+ Native indexes use a separate inline `documentIndexEntry` atom and block
113
+ `documentIndex` atom. The inline node owns stable identity plus primary,
114
+ secondary, cross-reference, and page-emphasis intent; the block owns only
115
+ bounded options, generated rows, and truncation state. One collector walks
116
+ the canonical TipTap document, obtains pages from the existing field-context
117
+ resolver, groups normalized terms, and merges same-page markers while
118
+ retaining every target ID. Mark/edit and block insert/customize/refresh each
119
+ dispatch one transaction. DOCX export maps inline atoms to native
120
+ `w:fldSimple` `XE` fields, writes an `INDEX` content control through an
121
+ isolated marker collector/patcher, and emits cached `Index1`/`Index2` rows.
122
+ Import marks supported XE boundaries and removes supported INDEX controls
123
+ before Mammoth conversion, then reconstructs typed atoms and reconnects
124
+ cached page rows to matching marker identities. Unsupported switches and
125
+ malformed structures remain on the field diagnostic path.
126
+ Page Layout keeps direct margin, orientation, paper,
98
127
  and equal-column presets in the ribbon; custom margins and advanced columns
99
128
  open the corresponding controlled Page Setup tab instead of duplicating a
100
129
  second settings model. References separates footnotes, captions, citations
@@ -721,6 +750,40 @@ written. This keeps direct/style inheritance and prior `w:rPrChange` values
721
750
  exact while treating browser and PDF line-style paint as a bounded visual
722
751
  approximation.
723
752
 
753
+ Native character shading follows a separate paint-only TextStyle path. The
754
+ closed `w:shd` model accepts every schema pattern, independent direct,
755
+ automatic, or resolved-theme foreground/background channels, tint and shade,
756
+ and explicit `nil`. Property sources are resolved from document defaults,
757
+ paragraph and character styles, conditional table styles, and direct run
758
+ properties in native precedence order. Invalid direct leaves normalize to
759
+ `nil`, so stale inherited paint cannot reappear.
760
+
761
+ The canonical mark stores bounded JSON in `data-office-run-shading`; CSS
762
+ projects solid, line, cross, and percentage masks with cloned fragments. These
763
+ declarations do not alter advances, so shading remains Worker/WASM eligible.
764
+ Native highlight is retained as an independent mark and paints above shading.
765
+ Export allocates a collision-checked temporary fill only on generated text
766
+ runs, patches it to the exact `w:shd` attributes across editable stories, and
767
+ then writes exact prior values into `w:rPrChange`.
768
+
769
+ Native proofing metadata follows a separate semantic TextStyle path. A closed
770
+ `w:lang` model retains Latin `w:val`, East Asian `w:eastAsia`, and bidi `w:bidi` slots
771
+ plus explicit `w:noProof` true or false state across style resolution and every
772
+ editable story. The canonical DOM mark uses bounded JSON in
773
+ `data-office-proofing-languages` and an explicit Boolean in
774
+ `data-office-no-proof`; derived `lang` and `spellcheck` attributes are display
775
+ and browser-proofing projections, not replacement source state. Duplicate,
776
+ misplaced, nested, text-bearing, extra-attribute, namespace-spoofed, invalid-tag,
777
+ or invalid on/off leaves fail closed and emit compatibility diagnostics.
778
+
779
+ The text-layout collector resolves the effective inherited `lang` for each DOM
780
+ run, validates the same bounded tag grammar, and includes it in the run-style
781
+ coalescing key. The optional protocol field is backward compatible: missing
782
+ language keeps existing shaping, while a valid value is validated again in
783
+ Rust and set on the RustyBuzz `UnicodeBuffer` before segment-property guessing
784
+ and shaping. This makes language-sensitive glyph selection deterministic
785
+ without coupling pagination to a browser dictionary or host grammar service.
786
+
724
787
  Tables, images, code blocks, and other complex content use explicit
725
788
  format-specific measurement. Top-level tables are row flows; eligible rows can
726
789
  additionally expose synchronized direct-cell block fragments. Ordered and bullet
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a3s-lab/office",
3
- "version": "0.29.0",
3
+ "version": "0.31.0",
4
4
  "description": "Open-source collaborative browser editors for documents, Markdown, spreadsheets, presentations, and PDFs.",
5
5
  "keywords": [
6
6
  "office",
@@ -88,9 +88,12 @@
88
88
  "playground:typecheck": "tsc --noEmit -p playground/tsconfig.json",
89
89
  "playground:visual": "playwright test --config playwright.config.ts",
90
90
  "playground:visual:document-emphasis": "playwright test visual-tests/document-emphasis.functional.spec.ts --config playwright.config.ts",
91
+ "playground:visual:document-index": "playwright test visual-tests/document-index.functional.spec.ts --config playwright.config.ts",
91
92
  "playground:visual:document-hidden-text": "playwright test visual-tests/document-hidden-text.functional.spec.ts --config playwright.config.ts",
92
93
  "playground:visual:document-legacy-text-effects": "playwright test visual-tests/document-legacy-text-effects.functional.spec.ts --config playwright.config.ts",
94
+ "playground:visual:document-proofing-languages": "playwright test visual-tests/document-proofing-languages.functional.spec.ts --config playwright.config.ts",
93
95
  "playground:visual:document-run-border": "playwright test visual-tests/document-run-border.functional.spec.ts --config playwright.config.ts",
96
+ "playground:visual:document-run-shading": "playwright test visual-tests/document-run-shading.functional.spec.ts --config playwright.config.ts",
94
97
  "playground:visual:document-kerning": "playwright test visual-tests/document-kerning.functional.spec.ts --config playwright.config.ts",
95
98
  "playground:visual:document-character-scale": "playwright test visual-tests/document-character-scale.functional.spec.ts --config playwright.config.ts",
96
99
  "playground:visual:document-character-position": "playwright test visual-tests/document-character-position.functional.spec.ts --config playwright.config.ts",
@@ -132,6 +135,8 @@
132
135
  "test:e2e:initial-focus:check": "a3s-test check tests/e2e/office-editor-initial-focus.acl --json",
133
136
  "test:e2e:docs": "a3s-test run tests/e2e/office-docs-navigation.acl --json",
134
137
  "test:e2e:docs:check": "a3s-test check tests/e2e/office-docs-navigation.acl --json",
138
+ "test:e2e:latest-capabilities": "A3S_TEST_SUITE=tests/e2e/latest-capabilities-discoverability.acl bash scripts/run-a3s-test-web-gate.sh",
139
+ "test:e2e:latest-capabilities:check": "a3s-test check tests/e2e/latest-capabilities-discoverability.acl --json",
135
140
  "test:e2e:collaboration-participants": "a3s-test run tests/e2e/collaboration-participants.acl --json",
136
141
  "test:e2e:collaboration-participants:check": "a3s-test check tests/e2e/collaboration-participants.acl --json",
137
142
  "test:e2e:collaboration-playground": "a3s-test run tests/e2e/collaboration-playground-entry.acl --json",
@@ -176,7 +181,7 @@
176
181
  "test:e2e:spreadsheet-gradient-fill:check": "a3s-test check tests/e2e/spreadsheet-gradient-fill.acl --json",
177
182
  "test:e2e:spreadsheet-go-to": "a3s-test run tests/e2e/spreadsheet-go-to.acl --json",
178
183
  "test:e2e:spreadsheet-go-to:check": "a3s-test check tests/e2e/spreadsheet-go-to.acl --json",
179
- "test:e2e:spreadsheet-data-validation": "a3s-test run tests/e2e/spreadsheet-data-validation.acl --json",
184
+ "test:e2e:spreadsheet-data-validation": "A3S_TEST_SUITE=tests/e2e/spreadsheet-data-validation.acl bash scripts/run-a3s-test-web-gate.sh",
180
185
  "test:e2e:spreadsheet-data-validation:check": "a3s-test check tests/e2e/spreadsheet-data-validation.acl --json",
181
186
  "test:e2e:spreadsheet-diagonal-borders": "a3s-test run tests/e2e/spreadsheet-diagonal-borders.acl --json",
182
187
  "test:e2e:spreadsheet-diagonal-borders:check": "a3s-test check tests/e2e/spreadsheet-diagonal-borders.acl --json",
@@ -202,8 +207,16 @@
202
207
  "test:e2e:writer-hidden-text:check": "a3s-test check tests/e2e/word-hidden-text.acl --json",
203
208
  "test:e2e:writer-legacy-text-effects": "A3S_TEST_SUITE=tests/e2e/word-legacy-text-effects.acl bash scripts/run-a3s-test-web-gate.sh",
204
209
  "test:e2e:writer-legacy-text-effects:check": "a3s-test check tests/e2e/word-legacy-text-effects.acl --json",
210
+ "test:e2e:writer-proofing-languages": "A3S_TEST_SUITE=tests/e2e/word-proofing-languages.acl bash scripts/run-a3s-test-web-gate.sh",
211
+ "test:e2e:writer-proofing-languages:check": "a3s-test check tests/e2e/word-proofing-languages.acl --json",
212
+ "test:e2e:writer-table-of-contents": "A3S_TEST_SUITE=tests/e2e/word-table-of-contents.acl bash scripts/run-a3s-test-web-gate.sh",
213
+ "test:e2e:writer-table-of-contents:check": "a3s-test check tests/e2e/word-table-of-contents.acl --json",
214
+ "test:e2e:writer-document-index": "A3S_TEST_SUITE=tests/e2e/word-document-index.acl bash scripts/run-a3s-test-web-gate.sh",
215
+ "test:e2e:writer-document-index:check": "a3s-test check tests/e2e/word-document-index.acl --json",
205
216
  "test:e2e:writer-run-border": "A3S_TEST_SUITE=tests/e2e/word-run-border.acl bash scripts/run-a3s-test-web-gate.sh",
206
217
  "test:e2e:writer-run-border:check": "a3s-test check tests/e2e/word-run-border.acl --json",
218
+ "test:e2e:writer-run-shading": "A3S_TEST_SUITE=tests/e2e/word-run-shading.acl bash scripts/run-a3s-test-web-gate.sh",
219
+ "test:e2e:writer-run-shading:check": "a3s-test check tests/e2e/word-run-shading.acl --json",
207
220
  "test:e2e:writer-kerning": "A3S_TEST_SUITE=tests/e2e/word-kerning.acl bash scripts/run-a3s-test-web-gate.sh",
208
221
  "test:e2e:writer-kerning:check": "a3s-test check tests/e2e/word-kerning.acl --json",
209
222
  "test:e2e:writer-character-scale": "A3S_TEST_SUITE=tests/e2e/word-character-scale.acl bash scripts/run-a3s-test-web-gate.sh",