@a3s-lab/office 0.3.0 → 0.4.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 (262) hide show
  1. package/COLLABORATION_ROADMAP.md +426 -0
  2. package/README.md +635 -9
  3. package/dist/0~1403.js +1 -1
  4. package/dist/0~2805.js +1279 -0
  5. package/dist/{0~use-office-draft.js → 0~345.js} +30 -1
  6. package/dist/0~3539.js +1 -1
  7. package/dist/0~3557.js +1 -1
  8. package/dist/0~3635.js +1 -1
  9. package/dist/0~4595.js +7 -2
  10. package/dist/0~4980.js +154 -0
  11. package/dist/{0~9512.js → 0~6090.js} +539 -3
  12. package/dist/0~7048.js +92 -66
  13. package/dist/0~7614.js +2 -1
  14. package/dist/0~7754.js +5653 -0
  15. package/dist/0~9445.js +1 -1
  16. package/dist/0~document-editor.js +1815 -1553
  17. package/dist/0~markdown-editor.js +250 -44
  18. package/dist/0~pdf-viewer.js +1016 -24
  19. package/dist/0~presentation-editor.js +179 -8
  20. package/dist/0~spreadsheet-editor.js +3371 -578
  21. package/dist/0~work-docx-export.js +6801 -658
  22. package/dist/0~work-docx-import.js +1388 -795
  23. package/dist/0~work-office-diagnostics.js +524 -30
  24. package/dist/0~work-pptx-export.js +2 -1
  25. package/dist/0~work-pptx-import.js +1 -2
  26. package/dist/0~work-presentation-charts.js +1 -1
  27. package/dist/2591.js +197 -0
  28. package/dist/3818.js +1090 -0
  29. package/dist/4104.js +970 -60
  30. package/dist/432.js +171 -14
  31. package/dist/4476.js +2008 -0
  32. package/dist/4560.js +674 -0
  33. package/dist/4650.js +70 -0
  34. package/dist/{1134.js → 5184.js} +183 -1
  35. package/dist/6489.js +18 -18
  36. package/dist/7060.js +132 -0
  37. package/dist/8715.js +2 -136
  38. package/dist/8928.js +16778 -0
  39. package/dist/9787.js +209 -0
  40. package/dist/core.d.ts +29 -9
  41. package/dist/core.js +10 -2
  42. package/dist/index.js +13 -3
  43. package/dist/internal/collaboration/office-collaboration-flat-json.d.ts +13 -0
  44. package/dist/internal/collaboration/office-collaboration-json.d.ts +4 -0
  45. package/dist/internal/collaboration/office-collaboration-presence.d.ts +86 -0
  46. package/dist/internal/collaboration/office-collaboration-transport.d.ts +42 -0
  47. package/dist/internal/collaboration/office-collaboration.d.ts +85 -0
  48. package/dist/internal/collaboration/office-document-collaboration-bibliography.d.ts +7 -0
  49. package/dist/internal/collaboration/office-document-collaboration-claims.d.ts +9 -0
  50. package/dist/internal/collaboration/office-document-collaboration-comments.d.ts +7 -0
  51. package/dist/internal/collaboration/office-document-collaboration-sidecar-utils.d.ts +27 -0
  52. package/dist/internal/collaboration/office-document-collaboration-sidecars.d.ts +16 -0
  53. package/dist/internal/collaboration/office-document-collaboration.d.ts +45 -0
  54. package/dist/internal/collaboration/office-markdown-collaboration.d.ts +31 -0
  55. package/dist/internal/collaboration/office-pdf-collaboration-claims.d.ts +4 -0
  56. package/dist/internal/collaboration/office-pdf-collaboration-conflicts.d.ts +2 -0
  57. package/dist/internal/collaboration/office-pdf-collaboration-model.d.ts +26 -0
  58. package/dist/internal/collaboration/office-pdf-collaboration-records.d.ts +21 -0
  59. package/dist/internal/collaboration/office-pdf-collaboration-types.d.ts +91 -0
  60. package/dist/internal/collaboration/office-pdf-collaboration-validation.d.ts +4 -0
  61. package/dist/internal/collaboration/office-pdf-collaboration.d.ts +35 -0
  62. package/dist/internal/collaboration/office-presentation-collaboration-model.d.ts +25 -0
  63. package/dist/internal/collaboration/office-presentation-collaboration-records.d.ts +22 -0
  64. package/dist/internal/collaboration/office-presentation-collaboration-validation.d.ts +4 -0
  65. package/dist/internal/collaboration/office-presentation-collaboration.d.ts +32 -0
  66. package/dist/internal/collaboration/office-spreadsheet-collaboration-cells.d.ts +13 -0
  67. package/dist/internal/collaboration/office-spreadsheet-collaboration-claims.d.ts +4 -0
  68. package/dist/internal/collaboration/office-spreadsheet-collaboration-conflicts.d.ts +2 -0
  69. package/dist/internal/collaboration/office-spreadsheet-collaboration-flat-json.d.ts +10 -0
  70. package/dist/internal/collaboration/office-spreadsheet-collaboration-model.d.ts +31 -0
  71. package/dist/internal/collaboration/office-spreadsheet-collaboration-records.d.ts +17 -0
  72. package/dist/internal/collaboration/office-spreadsheet-collaboration-validation.d.ts +4 -0
  73. package/dist/internal/collaboration/office-spreadsheet-collaboration.d.ts +32 -0
  74. package/dist/internal/features/work/components/work-document-page-border.d.ts +6 -0
  75. package/dist/internal/features/work/editors/document-command-catalog.d.ts +9 -0
  76. package/dist/internal/features/work/editors/document-editor-focus.d.ts +1 -1
  77. package/dist/internal/features/work/editors/document-editor.d.ts +7 -1
  78. package/dist/internal/features/work/editors/document-external-content.d.ts +14 -0
  79. package/dist/internal/features/work/editors/document-page-stack.d.ts +10 -1
  80. package/dist/internal/features/work/editors/document-page-thumbnail.d.ts +2 -0
  81. package/dist/internal/features/work/editors/document-pagination-run-coordinator.d.ts +26 -0
  82. package/dist/internal/features/work/editors/document-picture-properties-dialog-model.d.ts +20 -1
  83. package/dist/internal/features/work/editors/document-table-properties-dialog-model.d.ts +4 -1
  84. package/dist/internal/features/work/editors/document-toolbar.d.ts +8 -1
  85. package/dist/internal/features/work/editors/markdown-editor-focus.d.ts +1 -1
  86. package/dist/internal/features/work/editors/markdown-editor.d.ts +5 -1
  87. package/dist/internal/features/work/editors/markdown-toolbar.d.ts +2 -1
  88. package/dist/internal/features/work/editors/office-collaboration-participants.d.ts +3 -0
  89. package/dist/internal/features/work/editors/office-collaboration-presence-context.d.ts +17 -0
  90. package/dist/internal/features/work/editors/office-collaboration-presence-ui.d.ts +25 -0
  91. package/dist/internal/features/work/editors/office-editor-focus-handoff.d.ts +27 -0
  92. package/dist/internal/features/work/editors/pdf-annotation-controller.d.ts +5 -0
  93. package/dist/internal/features/work/editors/pdf-collaboration-presence.d.ts +3 -0
  94. package/dist/internal/features/work/editors/pdf-collaboration-projection.d.ts +10 -0
  95. package/dist/internal/features/work/editors/pdf-evidence-contract.d.ts +36 -0
  96. package/dist/internal/features/work/editors/pdf-evidence-overlay.d.ts +37 -0
  97. package/dist/internal/features/work/editors/pdf-toolbar.d.ts +2 -1
  98. package/dist/internal/features/work/editors/pdf-viewer-controller.d.ts +7 -1
  99. package/dist/internal/features/work/editors/pdf-viewer.d.ts +11 -1
  100. package/dist/internal/features/work/editors/presentation-collaboration-presence.d.ts +5 -0
  101. package/dist/internal/features/work/editors/presentation-editor-focus.d.ts +3 -2
  102. package/dist/internal/features/work/editors/presentation-editor-types.d.ts +3 -0
  103. package/dist/internal/features/work/editors/presentation-editor.d.ts +1 -1
  104. package/dist/internal/features/work/editors/spreadsheet-auto-filter.d.ts +9 -0
  105. package/dist/internal/features/work/editors/spreadsheet-cell-clear.d.ts +3 -0
  106. package/dist/internal/features/work/editors/spreadsheet-cell-merge.d.ts +12 -0
  107. package/dist/internal/features/work/editors/spreadsheet-clipboard-shortcuts.d.ts +3 -7
  108. package/dist/internal/features/work/editors/spreadsheet-collaboration-presence.d.ts +9 -0
  109. package/dist/internal/features/work/editors/spreadsheet-command-catalog.d.ts +464 -0
  110. package/dist/internal/features/work/editors/spreadsheet-command-controller.d.ts +45 -9
  111. package/dist/internal/features/work/editors/spreadsheet-context-menu.d.ts +2 -0
  112. package/dist/internal/features/work/editors/spreadsheet-editor-ribbon.d.ts +9 -28
  113. package/dist/internal/features/work/editors/spreadsheet-editor.d.ts +8 -2
  114. package/dist/internal/features/work/editors/spreadsheet-format-painter.d.ts +27 -0
  115. package/dist/internal/features/work/editors/spreadsheet-freeze-panes.d.ts +14 -0
  116. package/dist/internal/features/work/editors/use-document-insert-commands.d.ts +3 -2
  117. package/dist/internal/features/work/editors/use-document-pagination.d.ts +6 -1
  118. package/dist/internal/features/work/editors/use-document-review-conflicts.d.ts +28 -0
  119. package/dist/internal/features/work/editors/use-spreadsheet-auto-filter.d.ts +21 -0
  120. package/dist/internal/features/work/editors/use-spreadsheet-collaboration.d.ts +27 -0
  121. package/dist/internal/features/work/editors/use-spreadsheet-format-painter.d.ts +18 -0
  122. package/dist/internal/features/work/work-document-bookmark-references.d.ts +37 -0
  123. package/dist/internal/features/work/work-document-bookmarks.d.ts +29 -0
  124. package/dist/internal/features/work/work-document-caption-nodes.d.ts +4 -1
  125. package/dist/internal/features/work/work-document-comments.d.ts +1 -1
  126. package/dist/internal/features/work/work-document-equations.d.ts +513 -0
  127. package/dist/internal/features/work/work-document-extensions.d.ts +1 -0
  128. package/dist/internal/features/work/work-document-field-identity.d.ts +2 -0
  129. package/dist/internal/features/work/work-document-field-node.d.ts +2 -2
  130. package/dist/internal/features/work/work-document-fields.d.ts +7 -0
  131. package/dist/internal/features/work/work-document-image-identity.d.ts +30 -0
  132. package/dist/internal/features/work/work-document-image-layout.d.ts +46 -1
  133. package/dist/internal/features/work/work-document-image-wrap-contour.d.ts +16 -0
  134. package/dist/internal/features/work/work-document-incremental-layout.d.ts +2 -2
  135. package/dist/internal/features/work/work-document-model-codec.d.ts +4 -1
  136. package/dist/internal/features/work/work-document-note-integrity.d.ts +2 -0
  137. package/dist/internal/features/work/work-document-page-borders.d.ts +25 -0
  138. package/dist/internal/features/work/work-document-page-capture.d.ts +8 -0
  139. package/dist/internal/features/work/work-document-page-frames.d.ts +15 -0
  140. package/dist/internal/features/work/work-document-page-margins.d.ts +56 -0
  141. package/dist/internal/features/work/work-document-page-size.d.ts +47 -0
  142. package/dist/internal/features/work/work-document-pagination-measurement.d.ts +1 -2
  143. package/dist/internal/features/work/work-document-pagination-types.d.ts +7 -2
  144. package/dist/internal/features/work/work-document-pagination.d.ts +2 -2
  145. package/dist/internal/features/work/work-document-paragraph-borders.d.ts +32 -0
  146. package/dist/internal/features/work/work-document-paragraph-identity.d.ts +26 -0
  147. package/dist/internal/features/work/work-document-paragraph-shading.d.ts +18 -0
  148. package/dist/internal/features/work/work-document-review-conflicts.d.ts +35 -0
  149. package/dist/internal/features/work/work-document-section.d.ts +4 -0
  150. package/dist/internal/features/work/work-document-snapshot.d.ts +19 -0
  151. package/dist/internal/features/work/work-document-source.d.ts +23 -0
  152. package/dist/internal/features/work/work-document-table-column-widths.d.ts +7 -0
  153. package/dist/internal/features/work/work-document-table-property-changes.d.ts +3 -0
  154. package/dist/internal/features/work/work-document-table-row-identity.d.ts +15 -0
  155. package/dist/internal/features/work/work-document-table-sizing.d.ts +3 -0
  156. package/dist/internal/features/work/work-document-text-layout.d.ts +3 -1
  157. package/dist/internal/features/work/work-document-word-line-metrics.d.ts +2 -0
  158. package/dist/internal/features/work/work-docx-bookmark-diagnostics.d.ts +3 -0
  159. package/dist/internal/features/work/work-docx-bookmark-import.d.ts +24 -0
  160. package/dist/internal/features/work/work-docx-bookmarks.d.ts +17 -0
  161. package/dist/internal/features/work/work-docx-comment-durable-id-preservation.d.ts +2 -0
  162. package/dist/internal/features/work/work-docx-comment-export.d.ts +3 -0
  163. package/dist/internal/features/work/work-docx-comment-metadata.d.ts +2 -0
  164. package/dist/internal/features/work/work-docx-drawing-extension-preservation.d.ts +4 -0
  165. package/dist/internal/features/work/work-docx-equation-diagnostics.d.ts +3 -0
  166. package/dist/internal/features/work/work-docx-equation-export.d.ts +14 -0
  167. package/dist/internal/features/work/work-docx-equation-import.d.ts +30 -0
  168. package/dist/internal/features/work/work-docx-equation-story.d.ts +9 -0
  169. package/dist/internal/features/work/work-docx-export-formatting.d.ts +3 -1
  170. package/dist/internal/features/work/work-docx-export-image.d.ts +5 -1
  171. package/dist/internal/features/work/work-docx-export.d.ts +1 -1
  172. package/dist/internal/features/work/work-docx-field-instructions.d.ts +8 -0
  173. package/dist/internal/features/work/work-docx-font-table-preservation.d.ts +3 -0
  174. package/dist/internal/features/work/work-docx-ignorable-extension-preservation.d.ts +15 -0
  175. package/dist/internal/features/work/work-docx-image-crop.d.ts +12 -0
  176. package/dist/internal/features/work/work-docx-image-identity.d.ts +17 -0
  177. package/dist/internal/features/work/work-docx-image-layer.d.ts +12 -0
  178. package/dist/internal/features/work/work-docx-image-layout-import.d.ts +14 -2
  179. package/dist/internal/features/work/work-docx-image-wrap.d.ts +15 -0
  180. package/dist/internal/features/work/work-docx-import.d.ts +13 -3
  181. package/dist/internal/features/work/work-docx-list-export.d.ts +18 -0
  182. package/dist/internal/features/work/work-docx-list-import.d.ts +14 -0
  183. package/dist/internal/features/work/work-docx-note-comment-content-control-block-preservation.d.ts +18 -0
  184. package/dist/internal/features/work/work-docx-note-comment-content-control-model.d.ts +47 -0
  185. package/dist/internal/features/work/work-docx-note-comment-content-control-preservation.d.ts +4 -0
  186. package/dist/internal/features/work/work-docx-note-comment-content-control-properties.d.ts +17 -0
  187. package/dist/internal/features/work/work-docx-note-comment-content-control-table-model.d.ts +17 -0
  188. package/dist/internal/features/work/work-docx-note-comment-content-control-xml.d.ts +14 -0
  189. package/dist/internal/features/work/work-docx-note-comment-extension-preservation.d.ts +2 -0
  190. package/dist/internal/features/work/work-docx-note-comment-hyperlink-content.d.ts +40 -0
  191. package/dist/internal/features/work/work-docx-note-comment-hyperlink-preservation.d.ts +5 -0
  192. package/dist/internal/features/work/work-docx-note-comment-hyperlink-relationships.d.ts +35 -0
  193. package/dist/internal/features/work/work-docx-note-comment-identity.d.ts +15 -0
  194. package/dist/internal/features/work/work-docx-note-comment-run-preservation.d.ts +4 -0
  195. package/dist/internal/features/work/work-docx-note-comment-run-properties.d.ts +2 -0
  196. package/dist/internal/features/work/work-docx-note-image-import.d.ts +12 -0
  197. package/dist/internal/features/work/work-docx-note-image-relationships.d.ts +1 -0
  198. package/dist/internal/features/work/work-docx-numbering-extension-preservation.d.ts +6 -0
  199. package/dist/internal/features/work/work-docx-numbering.d.ts +1 -0
  200. package/dist/internal/features/work/work-docx-page-borders-diagnostics.d.ts +3 -0
  201. package/dist/internal/features/work/work-docx-page-borders-import.d.ts +10 -0
  202. package/dist/internal/features/work/work-docx-page-margins-diagnostics.d.ts +3 -0
  203. package/dist/internal/features/work/work-docx-page-margins-import.d.ts +18 -0
  204. package/dist/internal/features/work/work-docx-page-size-diagnostics.d.ts +2 -0
  205. package/dist/internal/features/work/work-docx-page-size-import.d.ts +17 -0
  206. package/dist/internal/features/work/work-docx-paragraph-borders-diagnostics.d.ts +3 -0
  207. package/dist/internal/features/work/work-docx-paragraph-borders-export.d.ts +18 -0
  208. package/dist/internal/features/work/work-docx-paragraph-borders-import.d.ts +24 -0
  209. package/dist/internal/features/work/work-docx-paragraph-default-collapsed.d.ts +19 -0
  210. package/dist/internal/features/work/work-docx-paragraph-extension-preservation.d.ts +2 -0
  211. package/dist/internal/features/work/work-docx-paragraph-identity-import.d.ts +10 -0
  212. package/dist/internal/features/work/work-docx-paragraph-identity.d.ts +18 -0
  213. package/dist/internal/features/work/work-docx-paragraph-pagination-import.d.ts +6 -1
  214. package/dist/internal/features/work/work-docx-paragraph-shading-diagnostics.d.ts +3 -0
  215. package/dist/internal/features/work/work-docx-paragraph-shading-export.d.ts +5 -0
  216. package/dist/internal/features/work/work-docx-paragraph-shading-import.d.ts +18 -0
  217. package/dist/internal/features/work/work-docx-run-formatting-import.d.ts +3 -0
  218. package/dist/internal/features/work/work-docx-settings-preservation.d.ts +10 -0
  219. package/dist/internal/features/work/work-docx-settings-xml.d.ts +16 -0
  220. package/dist/internal/features/work/work-docx-style-extension-preservation.d.ts +2 -0
  221. package/dist/internal/features/work/work-docx-table-cell-export.d.ts +2 -1
  222. package/dist/internal/features/work/work-docx-table-cell-import.d.ts +3 -0
  223. package/dist/internal/features/work/work-docx-table-extension-preservation.d.ts +2 -0
  224. package/dist/internal/features/work/work-docx-table-row-import.d.ts +2 -0
  225. package/dist/internal/features/work/work-docx-table-sizing-import.d.ts +1 -0
  226. package/dist/internal/features/work/work-docx-theme-reference.d.ts +23 -0
  227. package/dist/internal/features/work/work-docx-theme.d.ts +4 -1
  228. package/dist/internal/features/work/work-docx-twips.d.ts +12 -0
  229. package/dist/internal/features/work/work-file-contract.d.ts +1 -0
  230. package/dist/internal/features/work/work-file-io.d.ts +1 -1
  231. package/dist/internal/features/work/work-markdown-extensions.d.ts +4 -1
  232. package/dist/internal/features/work/work-ooxml-package-preservation.d.ts +12 -0
  233. package/dist/internal/features/work/work-ooxml-package-security.d.ts +6 -0
  234. package/dist/internal/features/work/work-ooxml-relationship-preservation.d.ts +10 -0
  235. package/dist/internal/features/work/work-ooxml-xml.d.ts +2 -0
  236. package/dist/internal/features/work/work-pdf-export.d.ts +10 -0
  237. package/dist/internal/features/work/work-repository.d.ts +2 -0
  238. package/dist/internal/features/work/work-types.d.ts +15 -2
  239. package/dist/internal/kernel/office-kernel-client-types.d.ts +1 -0
  240. package/dist/internal/kernel/office-kernel-protocol.d.ts +7 -0
  241. package/dist/internal/kernel/office-kernel-version.d.ts +1 -1
  242. package/dist/office-kernel.wasm +0 -0
  243. package/dist/office-kernel.worker.js +93 -41
  244. package/dist/react.d.ts +18 -12
  245. package/dist/react.js +1 -1
  246. package/dist/styles.css +1153 -14
  247. package/dist/vue.d.ts +48 -5
  248. package/dist/vue.js +42 -3
  249. package/dist/web-component.d.ts +24 -2
  250. package/dist/web-component.js +101 -2
  251. package/docs/latest/en/browser-editor-architecture.md +231 -49
  252. package/package.json +19 -4
  253. package/dist/0~152.js +0 -94
  254. package/dist/0~2582.js +0 -485
  255. package/dist/0~4750.js +0 -939
  256. package/dist/0~5861.js +0 -596
  257. package/dist/0~work-document-extensions.js +0 -3045
  258. package/dist/0~work-document-model-codec.js +0 -42
  259. package/dist/0~work-docx-bibliography.js +0 -347
  260. package/dist/0~work-docx-page-color.js +0 -42
  261. package/dist/2881.js +0 -1455
  262. package/dist/8728.js +0 -723
@@ -52,7 +52,40 @@ model:
52
52
  copy-format shortcuts. Cross-surface paste retains compatible marks and
53
53
  paragraph attributes while falling back from unsupported heading nodes.
54
54
  Writer orders Insert commands as Pages, Table, Illustrations, Links, Header
55
- and Footer, and Text. Page Layout keeps direct margin, orientation, paper,
55
+ and Footer, and Text. The Links group creates paired body-bookmark
56
+ boundaries around a selection or caret, keeps copy identity separate, and
57
+ represents internal destinations as `#name` marks with an explicit
58
+ missing-target class. The References target picker also exposes those body
59
+ bookmarks alongside captions; bookmark cross-reference atoms retain target
60
+ identity, source instruction, live display text, and a missing-target state.
61
+ DOCX import/export maps the boundaries to native
62
+ `w:bookmarkStart`/`w:bookmarkEnd` ranges, bookmark cross-references to `REF`
63
+ fields, and internal links to `w:anchor` rather than relationship-backed
64
+ external hyperlinks. Footnote and endnote reference atoms share a
65
+ transaction-normalized graph with their editable definitions. References
66
+ retain identity through moves, copied references clone definition content
67
+ under a new identity, deletions remove the complete pair, and one appended
68
+ transaction keeps undo and redo atomic. Each note kind numbers independently
69
+ in reference order; new or reconstructed footnote definitions use the
70
+ reference section and newly inserted endnotes use the final section. The
71
+ structured HTML parser
72
+ gives note markers precedence over generic superscript so native DOCX notes
73
+ survive repeated import and export. The Insert Text group creates atomic
74
+ `PAGE`, `NUMPAGES`, `SECTION`,
75
+ `SECTIONPAGES`, `DATE`, and `TIME` fields. A position resolver maps every
76
+ field to its measured Worker/WASM layout block, physical page descriptor,
77
+ owning section, and the set of physical pages occupied by that section, so
78
+ continuous sections sharing one page retain truthful section-page counts.
79
+ Pagination-driven numeric refreshes do not add undo history and deliberately
80
+ leave clock fields unchanged; the scoped F9 command refreshes date and time
81
+ too, as one history action. A transaction-mapped identity plugin lets moved
82
+ fields keep their IDs while copied atoms receive fresh, redo-stable IDs.
83
+ DOCX import atomizes only complete, non-nested inline `w:fldSimple` or
84
+ complex fields. Nested, incomplete, cross-paragraph, deleted, and
85
+ instructionless structures keep their rendered result as text and emit a
86
+ structural compatibility warning instead of being flattened into a false
87
+ editable field. Native export writes live simple fields and requests a Word
88
+ field update on open. Page Layout keeps direct margin, orientation, paper,
56
89
  and equal-column presets in the ribbon; custom margins and advanced columns
57
90
  open the corresponding controlled Page Setup tab instead of duplicating a
58
91
  second settings model. References separates footnotes, captions, citations
@@ -62,7 +95,50 @@ model:
62
95
  display controls and calculates One Page and Page Width zoom from the live
63
96
  page metrics and scroll viewport. Picture, Table, and Header and Footer tabs
64
97
  carry explicit contextual semantics and disappear with their selection. The
65
- labelled status surface provides arrow-key traversal across view and zoom
98
+ Spreadsheet shell now uses the same responsive ribbon contract with its own
99
+ command catalog and workbook semantics. It keeps the WPS tab order, places
100
+ Conditional Formatting under Home and Styles, exposes real sorting under
101
+ Data, and owns F9 workbook recalculation in the root-scoped keyboard
102
+ controller. Paste, Cut, and Copy live in the first Home group; both button
103
+ clicks and WPS shortcuts cross one clipboard command port before using the
104
+ permission-resilient browser/local clipboard implementation. Format Painter
105
+ uses a dedicated format-pattern model and React session hook behind another
106
+ typed command port. It captures owned native style attributes only, expands
107
+ or tiles the pattern across same-sheet or cross-sheet targets, guards both
108
+ sides at 50,000 cells, suppresses repeated engine callbacks for the same
109
+ target, and emits one `batchCallApis` update per application. One-shot and
110
+ double-click locked state therefore stay outside the ribbon, while the
111
+ ribbon exposes pressed status and Escape cancellation without copying cell
112
+ values or workbook structure. AutoFilter follows the same boundary: a pure
113
+ workbook model derives a finite current region or accepts an explicit
114
+ multi-row range, a React hook owns controlled enable/disable state, and a
115
+ typed command port connects the Data ribbon plus `Cmd/Ctrl+Shift+L` and
116
+ `Alt+ArrowDown`. The Fortune adapter only exposes the header trigger and
117
+ value menu, adding dialog, checkbox, focus-restoration, and keyboard
118
+ semantics without making vendor DOM text the command contract. Freeze Panes
119
+ also stays controlled: a pure model translates the current WPS cell into
120
+ rows above and columns left or applies top-row and first-column presets, a
121
+ typed View command performs one immutable workbook update, and the native
122
+ Fortune/XLSX frozen-pane model remains the render and serialization
123
+ boundary. Its menu owns Arrow, Home, End, Enter, Escape, pressed state, and
124
+ focus restoration without introducing a parallel vendor toolbar. Home and
125
+ Cells now exposes the existing typed structure commands through one Rows and
126
+ Columns menu: insert and delete availability comes from the live selection,
127
+ execution stays in the workbook command port, and successful actions return
128
+ focus to the grid instead of introducing ribbon-local mutations. Home and
129
+ Alignment owns cell merging through a split control whose primary action and
130
+ `Ctrl+M` execute Merge and Center. Merge Cells, Merge Across, Unmerge Cells,
131
+ and Unmerge and Fill use the same typed command path, derive availability
132
+ from the selection and native Fortune merge ranges, and emit one
133
+ `batchCallApis` transaction per user intent. Home and Editing owns one Clear
134
+ disclosure for All, Formats, Contents, Comments, and Hyperlinks. Delete and
135
+ Backspace share the Contents command; all five modes transform the live
136
+ sheet immutably, retain merge geometry, preserve cell state outside the
137
+ selected mode, and emit one controlled workbook batch. The
138
+ catalog is the source of truth for labels, locations, and shortcut metadata;
139
+ typed command ports remain the source of truth for execution and
140
+ availability. The labelled status surface provides arrow-key traversal
141
+ across view and zoom
66
142
  controls; compact Web widths remove secondary section, proofing, citation,
67
143
  and save items in stages while retaining physical-page and zoom feedback.
68
144
  2. Each editor owns its selection model and exposes typed commands to the
@@ -99,7 +175,7 @@ localized labels and viewport heuristics never decide behavior.
99
175
  | Task pane | Find and replace, page setup, citation sources, and revision review | Mutually exclusive at the right edge of the document workspace. It shares width with the page above 900 px, overlays the page below 900 px, and becomes workspace-wide below 520 px. Escape and the visible close action follow the same guarded close path. |
100
176
  | Review rail | Anchored comments and comment drafts | Sits beside the paper and connects each thread to its text range. Below 620 px it becomes a bounded review drawer, removes connector lines, and lays cards in document order instead of using absolute placement. |
101
177
  | Anchored popover | Table size, paragraph spacing, paragraph pagination, colors, and select options | Portaled to the body but positioned from the invoking control. It flips vertically, clamps to a 16 px viewport margin, updates on nested scroll and resize, focuses its first field when it behaves like a small dialog, and returns focus to the trigger on Escape. A dirty numeric field consumes the first Escape to discard only its local draft; a clean field lets the next Escape close the surface without a blur commit. |
102
- | Modal dialog | Captions, cross-references, links, image descriptions, notices, and confirmations | Centered in the viewport with bounded height and an independently scrolling body. The body-level portal makes every non-dialog body child inert. Focus stays inside, destructive confirmations initially focus the safe action, and closing returns to the actual invoker unless the completed command deliberately restores the editor. |
178
+ | Modal dialog | Bookmarks, captions, cross-references, links, image descriptions, notices, and confirmations | Centered in the viewport with bounded height and an independently scrolling body. The body-level portal makes every non-dialog body child inert. Focus stays inside, destructive confirmations initially focus the safe action, and closing returns to the actual invoker unless the completed command deliberately restores the editor. |
103
179
 
104
180
  Task panes preserve editing context instead of behaving like navigation.
105
181
  Closing a pane returns focus to the body editor. Switching away from a dirty
@@ -190,9 +266,9 @@ focus restoration.
190
266
 
191
267
  | Product | Implemented browser surface | Implemented kernel boundary | Next fidelity gate |
192
268
  | --- | --- | --- | --- |
193
- | Document | One TipTap/ProseMirror body tree retained across editing and read-only preview, controlled TipTap header/footer surfaces with direct paper-margin editing and a contextual ribbon, one typography and page-chrome baseline across editing, preview, and PDF surfaces, a persistent typed heading-navigation pane with active-selection tracking, filtering and collapsible keyboard traversal, host-owned selected-text menus with full document context and range-mapped async commands, responsive and keyboard-operated paragraph-style and list galleries, typed bullet and numbering commands with restart/continue/start controls, typed physical-page and section-page descriptors, repeated first/default/even page chrome, a versioned structured model with an HTML compatibility representation, prefix-reused visual-line measurement and pages, page decorations, page-aware horizontal and vertical rulers for page margins, paragraph indents and typed tab stops, structured list-item pagination, explicit paragraph and list-item direction, compact spacing and pagination controls, typed inline/square/top-and-bottom image layout, imported style-inherited paragraph properties, structured inline tabs, and theme-aware run font/size/color/background import | Worker plus resumable Rust/WASM flow pagination and Rustybuzz shaping across CSS-matched registered text runs; the same live result remains mounted in read-only preview and is consumed by bounded browser PDF capture, including eligible list paragraphs, Unicode bidi level segmentation, ordered per-grapheme font fallback, packaged Latin/CJK/Arabic/Hebrew faces, and structured left-to-right tabs, with explicit DOM and JavaScript fallbacks for text affected by supported floats | Language-complete font substitution, complete Word style and numbering coverage, locale-complete and bidirectional tabs, arbitrary floating-object offsets and layering, complex table flow, searchable/vector PDF output, and loss-preserving OOXML package state |
269
+ | Document | One TipTap/ProseMirror body tree retained across editing and read-only preview, controlled TipTap header/footer surfaces with direct paper-margin editing and a contextual ribbon, one typography and page-chrome baseline across editing, preview, and PDF surfaces, a persistent typed heading-navigation pane with active-selection tracking, filtering and collapsible keyboard traversal, host-owned selected-text menus with full document context and range-mapped async commands, responsive and keyboard-operated paragraph-style and list galleries, typed bullet and numbering commands with restart/continue/start controls, typed physical-page and section-page descriptors, repeated first/default/even page chrome, a versioned structured model with an HTML compatibility representation, prefix-reused visual-line measurement and pages, page decorations, page-aware horizontal and vertical rulers for page margins, paragraph indents and typed tab stops, structured list-item pagination, explicit paragraph and list-item direction, compact spacing and pagination controls, typed inline/square/tight/through/top-and-bottom/no-wrap image layout and floating-image drawing layers, imported style-inherited paragraph properties, structured inline tabs, and theme-aware run font/size/color/background import | Worker plus resumable Rust/WASM flow pagination and Rustybuzz shaping across CSS-matched registered text runs; the same live result remains mounted in read-only preview and is consumed by bounded browser PDF capture, including eligible list paragraphs, Unicode bidi level segmentation, ordered per-grapheme font fallback, packaged Latin/CJK/Arabic/Hebrew faces, and structured left-to-right tabs, with explicit DOM and JavaScript fallbacks for text affected by supported floats | Language-complete font substitution, complete Word style and numbering coverage, locale-complete and bidirectional tabs, arbitrary floating-object geometry and non-image drawing layers, complex table flow, searchable/vector PDF output, and loss-preserving OOXML package state |
194
270
  | Markdown | TipTap visual editing with a resizable source-and-preview split view by default, source-aware ribbon formatting and shortcuts, bounded source-native history with coalesced typing and selection restoration, host-defined selection menus across both editing surfaces, GFM tables, strikethrough, autolinks and nested task lists, controlled source state, coalesced preview rebuilds, proportional pane scrolling, keyboard-adjustable pane sizing, a flat measure-bounded reading surface, optional visual or source-only views, and a full-workspace Source/Preview switch on phones | No kernel required for normal editing | CommonMark differential fixtures, multi-megabyte profiling, and an off-main-thread parser boundary when measurements justify it |
195
- | Spreadsheet | Fortune Sheet grid integrated with the shared Office shell, shared grid/formula/footer visual tokens and one spreadsheet accent across selection, sheet tabs, menus, and zoom, an A3S-owned accessible single-row workbook footer for creation, activation, rename, duplicate, color, hide, reorder, delete, selection status, and zoom, a resize-observed worksheet viewport that keeps the active tab and its touch action visible across desktop, compact, and phone-width changes, one cell/worksheet context-menu surface whose displayed accelerators remain executable while the menu owns focus, Arrow/Home/End tab navigation plus Shift+F10 and native context-menu access, typed editing and calculation command ports, A3S-owned deterministic Arrow, Enter, Tab, Home, PageUp/PageDown, extended-selection, row, column, and all-cells keyboard commands, selection-preserving focus restoration across controlled workbook remounts and F2/Escape editing transitions, Cmd/Ctrl formatting, undo/redo, clear, a permission-resilient editor-local clipboard fallback, Shift+F11 sheet creation, and Ctrl/Cmd+PageUp/PageDown sheet-navigation shortcuts, direct font-family, horizontal/vertical-alignment, text-wrap, general/number/percent, and decimal-place controls backed by native cell-style keys, live count/sum/average selection summaries, operation-driven sparse-workbook projection, guarded controlled-value remounts that reject stale engine callbacks, and no-history result patches with cell-scoped Fortune fallback | Versioned, cancellable Worker/Rust-WASM calculation sessions using the shared bounded Rust formula parser, retained formula ASTs, incremental forward/reverse dependency graphs, dirty-subgraph recalculation, cross-sheet references, and a dynamically loaded JavaScript fallback | A3S-owned virtual grid, moving replacement projection off the main thread, broader Excel formula semantics, A3S-owned custom number-format evaluation, and print layout |
271
+ | Spreadsheet | Fortune Sheet grid integrated with the shared Office shell, a WPS-oriented command catalog and tab order, quick-access Undo and Redo, a priority-aware adaptive and collapsible ribbon with temporary tab expansion, Home and Styles Conditional Formatting, Home and Cells row/column insertion and deletion through the shared typed structure commands, Home and Alignment Merge and Center plus Merge Cells, Merge Across, Unmerge Cells, and Unmerge and Fill through one native-model-backed controlled batch per intent and the WPS `Ctrl+M` shortcut, Home and Editing Clear All, Formats, Contents, Comments, and Hyperlinks with Delete/Backspace mapped to content-only clearing and merge geometry retained, Data sorting and AutoFilter with bounded current-region discovery, controlled filter state, WPS toggle and header-menu shortcuts, and accessible vendor menu semantics, View and Window Freeze Panes with WPS current-cell, top-row, first-column, and unfreeze patterns backed by controlled state and native XLSX frozen panes, Formulas and F9 workbook recalculation, an executable Home clipboard group with permission-resilient Paste, Cut, and Copy plus a WPS-style one-shot and locked Format Painter for bounded cross-sheet native-style patterns, shared grid/formula/footer visual tokens and one spreadsheet accent across selection, sheet tabs, menus, and zoom, an A3S-owned accessible single-row workbook footer for creation, activation, rename, duplicate, color, hide, reorder, delete, selection status, and zoom, a resize-observed worksheet viewport that keeps the active tab and its touch action visible across desktop, compact, and phone-width changes, one cell/worksheet context-menu surface whose displayed accelerators remain executable while the menu owns focus, Arrow/Home/End tab navigation plus Shift+F10 and native context-menu access, typed editing and calculation command ports, A3S-owned deterministic Arrow, Enter, Tab, Home, PageUp/PageDown, extended-selection, row, column, and all-cells keyboard commands, selection-preserving focus restoration across controlled workbook remounts and F2/Escape editing transitions, Cmd/Ctrl formatting, undo/redo, clear, a permission-resilient editor-local clipboard fallback, Shift+F11 sheet creation, and Ctrl/Cmd+PageUp/PageDown sheet-navigation shortcuts, direct font-family, horizontal/vertical-alignment, text-wrap, general/number/percent, and decimal-place controls backed by native cell-style keys, live count/sum/average selection summaries, operation-driven sparse-workbook projection, guarded controlled-value remounts that reject stale engine callbacks, and no-history result patches with cell-scoped Fortune fallback | Versioned, cancellable Worker/Rust-WASM calculation sessions using the shared bounded Rust formula parser, retained formula ASTs, incremental forward/reverse dependency graphs, dirty-subgraph recalculation, cross-sheet references, and a dynamically loaded JavaScript fallback | A3S-owned virtual grid, moving replacement projection off the main thread, broader Excel formula semantics, A3S-owned custom number-format evaluation, and print layout |
196
272
  | Presentation | Scene canvas with ordered typed multi-selection, persistent nested browser groups, native PPTX group-node export, exact keyboard-accessible table-dimension insertion, native slide/object context actions with optional AI actions, a separate object/content editing state, one on-demand TipTap instance, collective move/scale/nudge/clipboard/delete/layer commands, selection-bound alignment and distribution, typed group/ungroup commands, one typed dispatcher for ribbon commands, editor-scoped shortcuts with post-command selection focus, direct beginning/current-slide playback with fullscreen fallback, frame-coalesced transactional move/resize previews that commit once on pointer release, two-level thumbnail node and scene windowing, and a phone stage that top-aligns the primary canvas while retaining one readable slide indicator beside view and zoom controls | Revisioned, cancellable Worker/Rust-WASM slide-relative alignment and object-set snapping with typed visual guides and a JavaScript fallback | Arbitrary rotated or reflected PPTX group transforms, connectors, theme resolution, text fitting, kernel-owned thumbnail layout, and slide serialization |
197
273
  | PDF | PDFium-backed page rendering with an A3S-owned responsive toolbar, a scrollable page-thumbnail rail with active-page synchronization and bounded bitmap/DOM windowing, a focus-contained phone page drawer, and typed capability controllers for navigation, zoom, search, basic annotations, annotation color, opacity, compatible stroke-width defaults and selection updates, history, and save; page and search drafts cancel without accidental commands, shortcuts remain scoped to the PDF root, and compact widths retain page status while exposing search-result traversal, navigation, zoom, and history through the keyboard-operated overflow menu | PDFium WebAssembly | Forms, redaction review, page organization, and reopen fixtures |
198
274
 
@@ -224,12 +300,13 @@ mode changes editability, accessible role, command chrome, and contextual
224
300
  interactions without replacing the ProseMirror DOM or clearing its measured
225
301
  blocks, shaped runs, page descriptors, and automatic-break decorations. Page
226
302
  headers and footers are visual overlays inside the configured top and bottom
227
- margins. Kernel protocol 15 therefore computes body height from page height
303
+ margins. Kernel protocol 16 therefore computes body height from page height
228
304
  minus physical margins only; page-chrome heights position repeated overlays
229
305
  and do not subtract the same space again. Browser PDF export locates the ready
230
306
  surface through the host's stable artifact ID, clones its ProseMirror DOM once,
231
307
  removes editing-only state, and crops exact physical pages from bounded capture
232
- batches. Explicit descriptor pages remain a fallback for surfaces without a
308
+ batches when their geometry is uniform or from exact per-page viewports when
309
+ it differs. Explicit descriptor pages remain a fallback for surfaces without a
233
310
  registered live document.
234
311
 
235
312
  The Word navigation pane uses that same capture boundary for real physical-page
@@ -429,20 +506,48 @@ Document image nodes carry typed layout, alignment, wrap-distance, alternative
429
506
  text, size, and per-image aspect-ratio-lock attributes. The contextual Picture
430
507
  ribbon keeps fast layout actions and opens one responsive Picture Properties
431
508
  dialog for centimeter width and height, aspect-ratio locking, wrapping,
432
- alignment, text distance, and alternative text. Applying the complete draft
509
+ alignment, text distance, signed horizontal and vertical offsets, their column,
510
+ paragraph, margin, or page reference frames, four-edge percentage cropping,
511
+ relative drawing order, behind-text placement, overlap and cell-layout policy,
512
+ anchor locking, and alternative text. Applying the complete draft
433
513
  updates only changed attributes in one separated TipTap history entry; cancel
434
514
  and Escape preserve the node and return focus to the exact invoker. Dimensions
435
515
  that were only projected into rounded centimeter fields retain their exact
436
516
  imported pixel values when untouched. Inline images stay in normal flow;
437
- supported left- or right-aligned square images use browser floats, and
438
- top-and-bottom images clear surrounding text. Paragraphs following a square
439
- float remain on the DOM visual-line path because the available line width
440
- changes while the float is active. The paginator reserves and observes the
441
- image block height, then sends the measured text fragments to the same
442
- Worker/Rust-WASM page-layout protocol. Supported square and top-and-bottom
443
- metadata round-trips through DOCX `wp:anchor`. Arbitrary offsets, crop geometry,
444
- contour wrapping, z-order, and drawing-layer relationships are not represented
445
- yet.
517
+ supported left- or right-aligned square images use browser floats, tight and
518
+ through images additionally project their DrawingML polygon through CSS
519
+ `shape-outside`, top-and-bottom images clear surrounding text, and no-wrap
520
+ images use absolute placement so body text does not reserve their rendered
521
+ height. A one-pixel pagination anchor keeps each free-floating image attached to
522
+ its document position, while `behindDoc` determines whether it paints behind or
523
+ in front of text. Paragraphs
524
+ following any supported side-wrapped float remain on the DOM visual-line path
525
+ because the available line width changes while the float is active. The
526
+ paginator reserves and observes the rendered height of flow-affecting images,
527
+ uses only the anchor height for no-wrap images, then sends the measured text
528
+ fragments to the same Worker/Rust-WASM page-layout protocol. Square,
529
+ tight, through, top-and-bottom, and no-wrap metadata round-trips through DOCX
530
+ `wp:anchor`; tight and through anchors preserve their wrap side, edited flag,
531
+ and ordered `wrapPolygon` vertices. Aligned anchors remain aligned,
532
+ while precise offsets preserve `positionH` and `positionV` reference frames
533
+ through edit, preview, and regenerated DOCX. Four-edge crop geometry remains
534
+ typed in the controlled model and round-trips as DrawingML `a:srcRect` for
535
+ inline and floating pictures. Supported floating pictures also preserve
536
+ drawing-layer relationships through unsigned `relativeHeight`,
537
+ `behindDoc`, `allowOverlap`, `layoutInCell`, and `locked` anchor attributes.
538
+ The browser maps the unsigned drawing order into bounded foreground and
539
+ behind-text stacking ranges while retaining the exact OOXML value for export.
540
+ Each image node also owns one normalized eight-hex-digit object identity plus
541
+ its DOCX drawing-property, anchor, and edit identifiers. A ProseMirror
542
+ transaction normalizer gives a pasted copy a fresh complete identity while a
543
+ move, cut-and-paste, deletion followed by undo, and redo retain the surviving
544
+ object's identity. Existing nodes and newly inserted images are normalized at
545
+ the editor boundary, and duplicates prioritize the mapped pre-transaction
546
+ object even when a copy is inserted before it. DOCX import retains
547
+ `wp:docPr@id`, `wp14:anchorId`, and a conforming `wp14:editId`. Export keeps the
548
+ drawing-property and anchor identity stable independently of regenerated media
549
+ relationship IDs, retains an untouched edit identifier, and advances the edit
550
+ identifier when the image itself is changed or moved.
446
551
 
447
552
  The page-layout panel mounts two bounded TipTap surfaces for the active
448
553
  header/footer variant. Pagination joins each kernel page placement to typed
@@ -567,10 +672,10 @@ font metric; imported tables no longer receive editor-only block margins. The
567
672
  Windows parity workflow exports the same fixture through WPS, captures both
568
673
  794 by 1123 CSS-pixel pages, and rejects page-size, landmark, or bounded pixel
569
674
  differences. Language-complete font substitution, variable font axes, the
570
- remaining character and table style properties, arbitrary floating-object
571
- offsets, cropping, contour wrapping and layering, row-internal table splitting
572
- inside a single long paragraph or complex merged-cell flow, nested tables,
573
- footnote balancing, multi-column flow, and mixed-size sections require the
675
+ remaining character and table style properties, non-image floating-object
676
+ layering, row-internal table splitting
677
+ inside a single long paragraph, footnote balancing, multi-column flow, and
678
+ mixed-size sections require the
574
679
  later layout stages below.
575
680
 
576
681
  Top-level tables now enter pagination as row flows. DOM measurement supplies
@@ -585,8 +690,11 @@ page, split at synchronized boundaries between direct cell blocks. One
585
690
  non-editable widget per cell aligns the page gap and paints a clipped slice of
586
691
  the same measured header overlay. The leading cell alone extends the paper-gap
587
692
  paint across the page margins. `cantSplit` rows and a single indivisible long
588
- paragraph remain atomic and may overflow; nested tables and complex merged-cell
589
- flows require a later fragmentation model.
693
+ paragraph remain atomic and may overflow. Nested tables contribute their own
694
+ row boundaries to the containing cell's synchronized fragment plan. A
695
+ `rowspan` cell is projected through every covered physical row with clipped,
696
+ contiguous document ranges; page breaks before continuation rows render inside
697
+ the spanning cell instead of inserting a conflicting synthetic table row.
590
698
 
591
699
  Table creation is selection-safe: a non-empty text selection is preserved and
592
700
  the chosen table is inserted after its containing block instead of replacing
@@ -596,7 +704,8 @@ Design owns keyboard-operated style presets, the header row, multi-cell
596
704
  shading, and a reusable border pen with whole-selection, outside, inside, side,
597
705
  inside-horizontal, and inside-vertical targets. Layout owns row and column
598
706
  insertion or deletion, cell merge and split, horizontal and vertical alignment, repeated headers,
599
- atomic rows, centimeter-based column width and row height fields, equal row and
707
+ atomic rows, percentage- or centimeter-based column width and centimeter-based
708
+ row height fields, equal row and
600
709
  column distribution, content/window autofit, table alignment, four-edge cell
601
710
  margins, and table deletion. Physical
602
711
  column widths remain coherent across merged cells through ProseMirror's table
@@ -619,7 +728,9 @@ areas.
619
728
  DOCX tables independently round-trip `tblGrid`, `tcW`, `tblLayout`, `tblW`,
620
729
  `jc`, `tblInd`, `tblCellMar`, `tcMar`, and `trHeight`; numeric fiftieth-percent
621
730
  and string percentage widths keep their actual size instead of collapsing to a
622
- full-width table. Window/content autofit remains responsive in the browser.
731
+ full-width table. Per-column percentage preferences are editable and export as
732
+ `tcW`, including merged cells, while `tblGrid` pixels remain browser layout
733
+ fallbacks. Window/content autofit remains responsive in the browser.
623
734
  Independent top, right, bottom, and left cell-border attributes
624
735
  render identically in edit and preview, export as independent `w:tcBorders`,
625
736
  and reopen without being flattened. Explicit table-level outer and inside
@@ -634,17 +745,19 @@ order. Their cell fills, per-edge borders, run emphasis, fonts, and colors, plus
634
745
  paragraph alignment, direction, indents, spacing and line rules, pagination
635
746
  rules, and tab stops enter the marker pipeline after paragraph styles and before
636
747
  direct paragraph, character-style, or run formatting. Direct table and cell
637
- properties remain higher-priority layers for cell presentation. Theme-derived
638
- conditional presentation is materialized as stable RGB for editing, preview,
639
- and regenerated DOCX output.
748
+ properties remain higher-priority layers for cell presentation. Nested tables
749
+ retain independent geometry and formatting through the same marker and export
750
+ paths, and target the innermost active table during editing. Theme-derived
751
+ presentation resolves to stable RGB for editing and preview, while untouched
752
+ run colors, run shading, cell fills, and per-edge borders retain semantic theme
753
+ references on regenerated DOCX output. Explicit color edits export direct RGB.
640
754
  The real styled-table fixture exercises a centered 62.5% table, table margins,
641
755
  a first-cell margin override, and matching edit/preview geometry through A3S
642
756
  Test.
643
757
  Command availability comes from the ProseMirror table state, so actions that
644
- cannot apply to the current selection remain disabled. Loss-preserving semantic
645
- theme references, less-common conditional paragraph properties outside the
646
- supported layout set, percentage-width column authoring, nested-table editing,
647
- and complex merged-cell conditional flow remain explicit fidelity gaps.
758
+ cannot apply to the current selection remain disabled. Less-common conditional
759
+ paragraph properties outside the supported layout set remain explicit fidelity
760
+ gaps.
648
761
 
649
762
  Paragraph tab stops are typed node attributes with normalized positions,
650
763
  left/center/right/decimal alignment, and leader styles. A leaf
@@ -731,6 +844,14 @@ text validation, UTF-16 offset mapping, shaping, and their tests live in
731
844
  focused modules. This keeps the fallback and WASM paths independently
732
845
  testable without duplicating their public protocol.
733
846
 
847
+ Layout requests carry a bounded, deduplicated page-style table and let each
848
+ measured block reference its section geometry. A geometry transition opens a
849
+ new physical page in both the JavaScript fallback and Rust/WASM kernel, and
850
+ each result page owns its exact metrics. The live page stack, navigation
851
+ thumbnail capture, and PDF capture all consume those result metrics, including
852
+ mixed custom sizes and orientations, instead of projecting the active
853
+ section's dimensions across the document.
854
+
734
855
  The npm package emits `office-kernel.worker.js`, `office-kernel.wasm`, and
735
856
  default Noto Sans, Noto Sans Hans, Noto Naskh Arabic, and Noto Sans Hebrew
736
857
  regular faces beside the public JavaScript entries. Hosts may override the
@@ -769,15 +890,76 @@ controlled value. Document-level page color remains outside the ProseMirror
769
890
  tree, is updated through the same controlled value, and is preserved by DOCX
770
891
  import/export and the browser PDF render surface.
771
892
 
772
- This is a transitional persistence boundary, not loss-preserving OOXML yet.
773
- DOCX still converts through Mammoth, but DOCX, HTML, and text imports create the
774
- structured model immediately through the same extension schema used by the
775
- editor. DOCX export materializes synchronized HTML from the structured model
776
- before OOXML generation, so a stale HTML cache cannot override model changes.
777
- Preview retains the mounted structured editor tree, and live browser PDF export
778
- captures that same paginated surface; compatibility HTML remains an
779
- import/export boundary. Unsupported OOXML package parts are not yet represented
780
- by the model.
893
+ `encodeDocumentSnapshot` and `decodeDocumentSnapshot` expose that complete
894
+ controlled value through the public Core entry point. The v1
895
+ `a3s.office.document.snapshot` envelope is deterministic bounded JSON and uses
896
+ the
897
+ `application/vnd.a3s.office.document-snapshot+json;version=1` media type. It
898
+ requires a synchronized structured model and retains every JSON-defined field,
899
+ including layout, review, comment, and bibliography state. A different schema
900
+ or version, malformed or oversized JSON, cyclic runtime input, and stale model
901
+ fingerprints fail closed. This is the persistence and transport boundary for
902
+ hosts that need exact browser/agent revision snapshots; they must not substitute
903
+ a lossy HTML-to-Markdown conversion.
904
+
905
+ This is a transitional persistence boundary, not fully loss-preserving OOXML
906
+ yet. DOCX still converts through Mammoth, but DOCX, HTML, and text imports
907
+ create the structured model immediately through the same extension schema used
908
+ by the editor. DOCX export materializes synchronized HTML from the structured
909
+ model before OOXML generation, so a stale HTML cache cannot override model
910
+ changes. Preview retains the mounted structured editor tree, and live browser
911
+ PDF export captures that same paginated surface; compatibility HTML remains an
912
+ import/export boundary.
913
+
914
+ The first package-state slice retains the original DOCX Blob by artifact ID.
915
+ After the generated core package is complete, safe source-only OPC parts are
916
+ copied byte-for-byte and their content-type declarations and relationships are
917
+ reconnected with collision-free IDs. The generated core parts remain
918
+ authoritative. Digital signatures, which are invalid after editing, plus VBA,
919
+ ActiveX, and custom-ribbon content are not propagated into the macro-free DOCX.
920
+ If a persisted artifact has lost its registered source Blob, export fails
921
+ closed. A persisted SHA-256 fingerprint also prevents a different DOCX from
922
+ being re-registered under the same artifact ID. Unknown attributes, elements,
923
+ and `mc:AlternateContent` branches are now selectively merged inside
924
+ `word/settings.xml`: only passive ignorable markup that is relationship-free,
925
+ structurally valid, and non-conflicting with generated Word settings survives.
926
+ Strict and transitional UTF-8/UTF-16 sources share this path. The package graph
927
+ also retains source font-table metadata and source-only internal obfuscated-font
928
+ payloads, then rewrites their references to collision-free relationship IDs.
929
+ External fonts, mismatched relationship or content types, duplicate identities,
930
+ and source payload paths that collide with generated parts are disconnected.
931
+ This preserves embedded fonts for native DOCX consumers without loading those
932
+ binaries into the browser editor, preview, or PDF renderer. Passive,
933
+ relationship-free extension trees at the roots and uniquely matched nodes of
934
+ `word/styles.xml` and `word/numbering.xml` are also retained. Styles match by
935
+ type plus style ID. Imported abstract-numbering, concrete-numbering, and level
936
+ metadata follows regenerated IDs. Duplicate, source-only, malformed, and
937
+ ambiguous one-to-many mappings fail closed, and generated Word semantics remain
938
+ authoritative. Relationship-free passive extensions from non-OOXML ignorable
939
+ namespaces also follow uniquely matched picture drawings in regenerated
940
+ document, header, and footer parts. The identity is the normalized anchor plus
941
+ drawing-property ID; header and footer imports retain both through sanitized
942
+ editable HTML. Strict/transitional UTF-8/UTF-16 sources share the same path.
943
+ Source-only or duplicate drawings, relationship-bound content,
944
+ Microsoft/OOXML semantic namespaces, and ambiguous identities fail closed,
945
+ while generated geometry and media win. The paragraph-identity slice preserves
946
+ the same class of passive extension on uniquely matched, unchanged paragraphs
947
+ and their paragraph properties. Native `w14:paraId` plus `w14:textId` survives
948
+ sanitized body and page-chrome HTML. Text edits rotate `textId`, formatting-only
949
+ edits and moves retain it, and copies or splits receive new paragraph IDs.
950
+ Changed text versions, duplicate identities, relationship-bound content, and
951
+ Microsoft/OOXML semantic branches fail closed; generated paragraph semantics
952
+ remain authoritative. The table-identity slice applies the same policy to
953
+ `w:tbl`, `w:tr`, and `w:tc` plus their property nodes. Rows carry native
954
+ `w14:paraId` and `w14:textId` through body and page-chrome HTML. Tables match by
955
+ their ordered directly owned row IDs, while cells match by their owning row and
956
+ directly owned paragraph IDs. Text or structural edits rotate a row version;
957
+ formatting-only edits and moves retain it, and copies receive independent IDs.
958
+ Nested DOM row and cell collections are filtered to their closest owning table
959
+ or row. Missing, duplicate, cross-kind, relationship-bound, or semantic
960
+ identities fail closed, and generated table geometry remains authoritative.
961
+ Unknown run, note, comment, and other inline markup remains the next
962
+ loss-preservation boundary.
781
963
 
782
964
  Migration to browser-native OOXML is staged:
783
965
 
@@ -830,12 +1012,12 @@ bundle regression.
830
1012
  - Extend the current horizontal and vertical page rulers with bidirectional and
831
1013
  locale-complete tab behavior, plus complete style, numbering, and theme
832
1014
  inheritance beyond the implemented paragraph slices.
833
- - Complete row-internal splitting for single indivisible paragraphs and
834
- complex merged-cell flows, and add nested tables, full floating-object
835
- geometry beyond the supported square/top-and-bottom image anchors, footnote
836
- balancing, columns, and mixed page sections. Row-flow pagination, direct-cell
837
- block splitting, repeating headers, and the initial image-wrapping slice are
838
- already implemented.
1015
+ - Complete row-internal splitting for single indivisible paragraphs and full
1016
+ floating-object geometry beyond the supported wrap, precise-anchor, and
1017
+ image-layer subset, plus footnote balancing and columns. Row-flow
1018
+ pagination, direct-cell and nested-row splitting, merged-cell continuations,
1019
+ repeating headers, and the current image-wrapping slice are already
1020
+ implemented.
839
1021
  - Keep pagination results as mapped ProseMirror decorations so reflow never
840
1022
  corrupts selection or undo history.
841
1023
 
@@ -1038,8 +1220,8 @@ repeatable fixtures. The targets below are release gates, not current claims:
1038
1220
  - WebAssembly performs no network or filesystem access.
1039
1221
  - Worker failure is recoverable and does not block typing.
1040
1222
  - Automatic pagination transactions are excluded from editor history.
1041
- - Multi-column and mixed-page-layout documents currently retain explicit-break
1042
- behavior until their layout protocols are implemented.
1223
+ - Multi-column documents currently retain explicit-break behavior until their
1224
+ layout protocol is implemented.
1043
1225
 
1044
1226
  ## Verification
1045
1227
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a3s-lab/office",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Open-source browser editors for documents, Markdown, spreadsheets, presentations, and PDFs.",
5
5
  "keywords": [
6
6
  "office",
@@ -51,6 +51,7 @@
51
51
  "files": [
52
52
  "dist",
53
53
  "docs/latest/en/browser-editor-architecture.md",
54
+ "COLLABORATION_ROADMAP.md",
54
55
  "README.md",
55
56
  "LICENSE",
56
57
  "THIRD_PARTY_NOTICES.md"
@@ -83,15 +84,24 @@
83
84
  "playground:preview": "rsbuild preview --config playground/rsbuild.config.ts --host 127.0.0.1 --port 4175 --strict-port",
84
85
  "playground:typecheck": "tsc --noEmit -p playground/tsconfig.json",
85
86
  "playground:visual": "playwright test --config playwright.config.ts",
87
+ "playground:visual:spreadsheet-ribbon": "playwright test visual-tests/spreadsheet-ribbon.functional.spec.ts --config playwright.config.ts",
86
88
  "playground:visual:update": "playwright test --config playwright.config.ts --update-snapshots",
87
89
  "test": "rstest",
88
- "test:e2e": "bun run test:e2e:fixtures && a3s-test run tests/e2e/word-page-color.acl --json && a3s-test run tests/e2e/word-page-setup-phone.acl --json && a3s-test run tests/e2e/word-paragraph-layout-phone.acl --json && a3s-test run tests/e2e/word-list-formatting-phone.acl --json && a3s-test run tests/e2e/word-comments-drawer.acl --json && a3s-test run tests/e2e/word-comment-windowing.acl --json && a3s-test run tests/e2e/word-citations-phone.acl --json && a3s-test run tests/e2e/word-navigation-search.acl --json && a3s-test run tests/e2e/word-navigation-windowing.acl --json && a3s-test run tests/e2e/word-find-replace-phone.acl --json && a3s-test run tests/e2e/word-page-navigation.acl --json && a3s-test run tests/e2e/word-page-windowing.acl --json && a3s-test run tests/e2e/word-ai-question.acl --json && a3s-test run tests/e2e/word-picture-insert.acl --json && a3s-test run tests/e2e/word-picture-alt-text-phone.acl --json && a3s-test run tests/e2e/word-track-changes-phone.acl --json && a3s-test run tests/e2e/word-revision-windowing.acl --json && a3s-test run tests/e2e/word-table-phone.acl --json && a3s-test run tests/e2e/word-table-borders.acl --json && a3s-test run tests/e2e/word-theme-table.acl --json && a3s-test run tests/e2e/word-styled-table.acl --json && a3s-test run tests/e2e/word-multi-page-table.acl --json && a3s-test run tests/e2e/word-cross-reference-phone.acl --json && a3s-test run tests/e2e/spreadsheet-phone-rename.acl --json && a3s-test run tests/e2e/spreadsheet-phone-find.acl --json && a3s-test run tests/e2e/spreadsheet-phone-context-menu.acl --json && a3s-test run tests/e2e/spreadsheet-phone-task-pane.acl --json && a3s-test run tests/e2e/presentation-cut-paste-focus.acl --json && a3s-test run tests/e2e/presentation-presenter-view.acl --json && a3s-test run tests/e2e/presentation-phone-chart-pane.acl --json && a3s-test run tests/e2e/presentation-phone-comments.acl --json && a3s-test run tests/e2e/pdf-thumbnail-keyboard.acl --json && a3s-test run tests/e2e/pdf-page-drawer-phone.acl --json && a3s-test run tests/e2e/markdown-phone-modes.acl --json && a3s-test run tests/e2e/office-sidebar-breakpoint.acl --json && a3s-test run tests/e2e/office-docs-navigation.acl --json",
89
- "test:e2e:check": "bun run test:e2e:fixtures && a3s-test check tests/e2e/word-page-color.acl --json && a3s-test check tests/e2e/word-page-setup-phone.acl --json && a3s-test check tests/e2e/word-paragraph-layout-phone.acl --json && a3s-test check tests/e2e/word-list-formatting-phone.acl --json && a3s-test check tests/e2e/word-comments-drawer.acl --json && a3s-test check tests/e2e/word-comment-windowing.acl --json && a3s-test check tests/e2e/word-citations-phone.acl --json && a3s-test check tests/e2e/word-navigation-search.acl --json && a3s-test check tests/e2e/word-navigation-windowing.acl --json && a3s-test check tests/e2e/word-find-replace-phone.acl --json && a3s-test check tests/e2e/word-page-navigation.acl --json && a3s-test check tests/e2e/word-page-windowing.acl --json && a3s-test check tests/e2e/word-ai-question.acl --json && a3s-test check tests/e2e/word-picture-insert.acl --json && a3s-test check tests/e2e/word-picture-alt-text-phone.acl --json && a3s-test check tests/e2e/word-track-changes-phone.acl --json && a3s-test check tests/e2e/word-revision-windowing.acl --json && a3s-test check tests/e2e/word-table-phone.acl --json && a3s-test check tests/e2e/word-table-borders.acl --json && a3s-test check tests/e2e/word-theme-table.acl --json && a3s-test check tests/e2e/word-styled-table.acl --json && a3s-test check tests/e2e/word-multi-page-table.acl --json && a3s-test check tests/e2e/word-cross-reference-phone.acl --json && a3s-test check tests/e2e/spreadsheet-phone-rename.acl --json && a3s-test check tests/e2e/spreadsheet-phone-find.acl --json && a3s-test check tests/e2e/spreadsheet-phone-context-menu.acl --json && a3s-test check tests/e2e/spreadsheet-phone-task-pane.acl --json && a3s-test check tests/e2e/presentation-cut-paste-focus.acl --json && a3s-test check tests/e2e/presentation-presenter-view.acl --json && a3s-test check tests/e2e/presentation-phone-chart-pane.acl --json && a3s-test check tests/e2e/presentation-phone-comments.acl --json && a3s-test check tests/e2e/pdf-thumbnail-keyboard.acl --json && a3s-test check tests/e2e/pdf-page-drawer-phone.acl --json && a3s-test check tests/e2e/markdown-phone-modes.acl --json && a3s-test check tests/e2e/office-sidebar-breakpoint.acl --json && a3s-test check tests/e2e/office-docs-navigation.acl --json",
90
+ "test:e2e": "bun run test:e2e:fixtures && a3s-test run tests/e2e/word-page-color.acl --json && a3s-test run tests/e2e/word-page-setup-phone.acl --json && a3s-test run tests/e2e/word-paragraph-layout-phone.acl --json && a3s-test run tests/e2e/word-list-formatting-phone.acl --json && a3s-test run tests/e2e/word-font-picker-phone.acl --json && a3s-test run tests/e2e/word-comments-drawer.acl --json && a3s-test run tests/e2e/word-comment-windowing.acl --json && a3s-test run tests/e2e/word-citations-phone.acl --json && a3s-test run tests/e2e/word-navigation-search.acl --json && a3s-test run tests/e2e/word-navigation-windowing.acl --json && a3s-test run tests/e2e/word-find-replace-phone.acl --json && a3s-test run tests/e2e/word-page-navigation.acl --json && a3s-test run tests/e2e/word-page-windowing.acl --json && a3s-test run tests/e2e/word-ai-question.acl --json && a3s-test run tests/e2e/word-picture-insert.acl --json && a3s-test run tests/e2e/word-picture-alt-text-phone.acl --json && a3s-test run tests/e2e/word-track-changes-phone.acl --json && a3s-test run tests/e2e/word-review-conflict-phone.acl --json && a3s-test run tests/e2e/word-revision-windowing.acl --json && a3s-test run tests/e2e/word-table-phone.acl --json && a3s-test run tests/e2e/word-table-borders.acl --json && a3s-test run tests/e2e/word-theme-table.acl --json && a3s-test run tests/e2e/word-styled-table.acl --json && a3s-test run tests/e2e/word-multi-page-table.acl --json && a3s-test run tests/e2e/word-cross-reference-phone.acl --json && a3s-test run tests/e2e/word-bookmark-links-phone.acl --json && a3s-test run tests/e2e/word-notes-phone.acl --json && a3s-test run tests/e2e/word-fields-phone.acl --json && a3s-test run tests/e2e/spreadsheet-phone-rename.acl --json && a3s-test run tests/e2e/spreadsheet-phone-find.acl --json && a3s-test run tests/e2e/spreadsheet-phone-context-menu.acl --json && a3s-test run tests/e2e/spreadsheet-phone-task-pane.acl --json && a3s-test run tests/e2e/presentation-cut-paste-focus.acl --json && a3s-test run tests/e2e/presentation-presenter-view.acl --json && a3s-test run tests/e2e/presentation-phone-chart-pane.acl --json && a3s-test run tests/e2e/presentation-phone-comments.acl --json && a3s-test run tests/e2e/pdf-thumbnail-keyboard.acl --json && a3s-test run tests/e2e/pdf-page-drawer-phone.acl --json && a3s-test run tests/e2e/markdown-phone-modes.acl --json && a3s-test run tests/e2e/office-sidebar-breakpoint.acl --json && a3s-test run tests/e2e/office-docs-navigation.acl --json && a3s-test run tests/e2e/collaboration-participants.acl --json && a3s-test run tests/e2e/collaboration-pdf-annotations.acl --json",
91
+ "test:e2e:check": "bun run test:e2e:fixtures && a3s-test check tests/e2e/word-page-color.acl --json && a3s-test check tests/e2e/word-page-setup-phone.acl --json && a3s-test check tests/e2e/word-paragraph-layout-phone.acl --json && a3s-test check tests/e2e/word-list-formatting-phone.acl --json && a3s-test check tests/e2e/word-font-picker-phone.acl --json && a3s-test check tests/e2e/word-comments-drawer.acl --json && a3s-test check tests/e2e/word-comment-windowing.acl --json && a3s-test check tests/e2e/word-citations-phone.acl --json && a3s-test check tests/e2e/word-navigation-search.acl --json && a3s-test check tests/e2e/word-navigation-windowing.acl --json && a3s-test check tests/e2e/word-find-replace-phone.acl --json && a3s-test check tests/e2e/word-page-navigation.acl --json && a3s-test check tests/e2e/word-page-windowing.acl --json && a3s-test check tests/e2e/word-ai-question.acl --json && a3s-test check tests/e2e/word-picture-insert.acl --json && a3s-test check tests/e2e/word-picture-alt-text-phone.acl --json && a3s-test check tests/e2e/word-track-changes-phone.acl --json && a3s-test check tests/e2e/word-review-conflict-phone.acl --json && a3s-test check tests/e2e/word-revision-windowing.acl --json && a3s-test check tests/e2e/word-table-phone.acl --json && a3s-test check tests/e2e/word-table-borders.acl --json && a3s-test check tests/e2e/word-theme-table.acl --json && a3s-test check tests/e2e/word-styled-table.acl --json && a3s-test check tests/e2e/word-multi-page-table.acl --json && a3s-test check tests/e2e/word-cross-reference-phone.acl --json && a3s-test check tests/e2e/word-bookmark-links-phone.acl --json && a3s-test check tests/e2e/word-notes-phone.acl --json && a3s-test check tests/e2e/word-fields-phone.acl --json && a3s-test check tests/e2e/spreadsheet-phone-rename.acl --json && a3s-test check tests/e2e/spreadsheet-phone-find.acl --json && a3s-test check tests/e2e/spreadsheet-phone-context-menu.acl --json && a3s-test check tests/e2e/spreadsheet-phone-task-pane.acl --json && a3s-test check tests/e2e/presentation-cut-paste-focus.acl --json && a3s-test check tests/e2e/presentation-presenter-view.acl --json && a3s-test check tests/e2e/presentation-phone-chart-pane.acl --json && a3s-test check tests/e2e/presentation-phone-comments.acl --json && a3s-test check tests/e2e/pdf-thumbnail-keyboard.acl --json && a3s-test check tests/e2e/pdf-page-drawer-phone.acl --json && a3s-test check tests/e2e/markdown-phone-modes.acl --json && a3s-test check tests/e2e/office-sidebar-breakpoint.acl --json && a3s-test check tests/e2e/office-docs-navigation.acl --json && a3s-test check tests/e2e/collaboration-participants.acl --json && a3s-test check tests/e2e/collaboration-pdf-annotations.acl --json",
90
92
  "test:e2e:fixtures": "bun scripts/create-e2e-fixtures.ts",
93
+ "test:e2e:initial-focus": "a3s-test run tests/e2e/office-editor-initial-focus.acl --json",
94
+ "test:e2e:initial-focus:check": "a3s-test check tests/e2e/office-editor-initial-focus.acl --json",
95
+ "test:e2e:collaboration-participants": "a3s-test run tests/e2e/collaboration-participants.acl --json",
96
+ "test:e2e:collaboration-participants:check": "a3s-test check tests/e2e/collaboration-participants.acl --json",
97
+ "test:e2e:collaboration-pdf-annotations": "a3s-test run tests/e2e/collaboration-pdf-annotations.acl --json",
98
+ "test:e2e:collaboration-pdf-annotations:check": "a3s-test check tests/e2e/collaboration-pdf-annotations.acl --json",
91
99
  "test:e2e:wps-layout": "bun run test:e2e:fixtures && a3s-test run tests/e2e/word-wps-layout-parity.acl --json && a3s-test run tests/e2e/word-wps-font-grid-parity.acl --json",
92
100
  "test:e2e:wps-layout:check": "bun run test:e2e:fixtures && a3s-test check tests/e2e/word-wps-layout-parity.acl --json && a3s-test check tests/e2e/word-wps-font-grid-parity.acl --json",
93
101
  "test:e2e:writer-ribbon": "a3s-test run tests/e2e/word-ribbon-collapse.acl --json",
94
102
  "test:e2e:writer-ribbon:check": "a3s-test check tests/e2e/word-ribbon-collapse.acl --json",
103
+ "test:e2e:spreadsheet-ribbon": "a3s-test run tests/e2e/spreadsheet-ribbon-alignment.acl --json",
104
+ "test:e2e:spreadsheet-ribbon:check": "a3s-test check tests/e2e/spreadsheet-ribbon-alignment.acl --json",
95
105
  "test:e2e:writer-shortcuts": "a3s-test run tests/e2e/word-wps-shortcuts.acl --json",
96
106
  "test:e2e:writer-shortcuts:check": "a3s-test check tests/e2e/word-wps-shortcuts.acl --json",
97
107
  "test:e2e:writer-layout": "a3s-test run tests/e2e/word-insert-page-layout.acl --json",
@@ -115,6 +125,8 @@
115
125
  "@fortune-sheet/formula-parser": "0.2.13",
116
126
  "@fortune-sheet/react": "^1.0.4",
117
127
  "@tiptap/core": "3.28.0",
128
+ "@tiptap/extension-collaboration": "3.28.0",
129
+ "@tiptap/extension-collaboration-caret": "3.28.0",
118
130
  "@tiptap/extension-color": "3.28.0",
119
131
  "@tiptap/extension-highlight": "3.28.0",
120
132
  "@tiptap/extension-image": "3.28.0",
@@ -130,6 +142,7 @@
130
142
  "@tiptap/pm": "3.28.0",
131
143
  "@tiptap/react": "3.28.0",
132
144
  "@tiptap/starter-kit": "3.28.0",
145
+ "@tiptap/y-tiptap": "3.0.8",
133
146
  "docx": "^9.7.1",
134
147
  "html2canvas": "^1.4.1",
135
148
  "jspdf": "^3.0.3",
@@ -137,7 +150,9 @@
137
150
  "lucide-react": "^0.544.0",
138
151
  "mammoth": "^1.12.0",
139
152
  "pptxgenjs": "^4.0.1",
140
- "xlsx": "^0.18.5"
153
+ "xlsx": "^0.18.5",
154
+ "y-protocols": "1.0.7",
155
+ "yjs": "13.6.32"
141
156
  },
142
157
  "peerDependencies": {
143
158
  "react": ">=18.2.0 <20",
package/dist/0~152.js DELETED
@@ -1,94 +0,0 @@
1
- import { descendants, attribute } from "./8715.js";
2
- function docxCaptionSequenceKind(instruction) {
3
- const identifier = /^\s*SEQ\s+([^\s\\]+)/i.exec(instruction)?.[1]?.toLowerCase();
4
- if (!identifier) return null;
5
- if ('table' === identifier || '表' === identifier) return 'table';
6
- if ('figure' === identifier || 'fig' === identifier || '图' === identifier) return 'figure';
7
- return null;
8
- }
9
- function docxCaptionReferenceTarget(instruction) {
10
- return /^\s*REF\s+([^\s\\]+)/i.exec(instruction)?.[1] ?? null;
11
- }
12
- function docxCaptionBookmark(paragraph, field) {
13
- const bookmarks = descendants(paragraph, 'bookmarkStart').filter((bookmark)=>!/^_(?:GoBack|Toc)/i.test(attribute(bookmark, 'name') ?? ''));
14
- const enclosing = bookmarks.filter((bookmark)=>bookmarkContains(paragraph, bookmark, field));
15
- if (enclosing.length) return enclosing.at(-1);
16
- return bookmarks.filter((bookmark)=>precedes(bookmark, field.start)).at(-1) ?? bookmarks[0];
17
- }
18
- function bookmarkContains(paragraph, start, field) {
19
- const id = attribute(start, 'id');
20
- if (!id) return false;
21
- const end = descendants(paragraph, 'bookmarkEnd').find((bookmark)=>attribute(bookmark, 'id') === id);
22
- return Boolean(end && precedes(start, field.start) && precedes(field.end, end));
23
- }
24
- function precedes(candidate, target) {
25
- return Boolean(candidate.compareDocumentPosition(target) & Node.DOCUMENT_POSITION_FOLLOWING);
26
- }
27
- function docxFieldInstructions(root) {
28
- return docxFieldOccurrences(root).map((field)=>field.instruction);
29
- }
30
- function docxFieldOccurrences(root) {
31
- const fields = descendants(root, 'fldSimple').map((field)=>({
32
- instruction: attribute(field, 'instr') ?? '',
33
- start: field,
34
- end: field
35
- }));
36
- const stack = [];
37
- for (const element of Array.from(root.querySelectorAll('*'))){
38
- if ('fldChar' === element.localName) {
39
- const fieldType = attribute(element, 'fldCharType');
40
- if ('begin' === fieldType) stack.push({
41
- instruction: '',
42
- start: element
43
- });
44
- else if ('end' === fieldType && stack.length) {
45
- const field = stack.pop();
46
- if (field) fields.push({
47
- ...field,
48
- end: element
49
- });
50
- }
51
- continue;
52
- }
53
- if ('instrText' === element.localName && stack.length) stack[stack.length - 1].instruction += element.textContent ?? '';
54
- else if ('instrText' === element.localName) fields.push({
55
- instruction: element.textContent ?? '',
56
- start: element,
57
- end: element
58
- });
59
- }
60
- fields.push(...stack.map((field)=>({
61
- ...field,
62
- end: field.start
63
- })));
64
- return fields.map((field)=>({
65
- ...field,
66
- instruction: field.instruction.trim()
67
- })).filter((field)=>Boolean(field.instruction));
68
- }
69
- function docxFieldResultText(field) {
70
- if ('fldSimple' === field.start.localName) return descendants(field.start, 't').map((element)=>element.textContent ?? '').join('');
71
- const root = closestAncestor(field.start, 'p') ?? field.start.ownerDocument?.documentElement;
72
- if (!root) return '';
73
- let inside = false;
74
- let separated = false;
75
- const values = [];
76
- for (const element of Array.from(root.querySelectorAll('*'))){
77
- if (element === field.start) inside = true;
78
- if (inside) {
79
- if ('fldChar' === element.localName && 'separate' === attribute(element, 'fldCharType')) separated = true;
80
- else if (separated && ('t' === element.localName || 'delText' === element.localName)) values.push(element.textContent ?? '');
81
- if (element === field.end) break;
82
- }
83
- }
84
- return values.join('');
85
- }
86
- function closestAncestor(element, localName) {
87
- let current = element;
88
- while(current){
89
- if (current.localName === localName) return current;
90
- current = current.parentElement;
91
- }
92
- return null;
93
- }
94
- export { docxCaptionBookmark, docxCaptionReferenceTarget, docxCaptionSequenceKind, docxFieldInstructions, docxFieldOccurrences, docxFieldResultText };