@a3s-lab/office 0.2.2 → 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 (277) hide show
  1. package/COLLABORATION_ROADMAP.md +426 -0
  2. package/README.md +649 -10
  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 +123 -12
  10. package/dist/0~4980.js +154 -0
  11. package/dist/0~5050.js +124 -113
  12. package/dist/{0~9512.js → 0~6090.js} +540 -3
  13. package/dist/0~7048.js +92 -66
  14. package/dist/0~7614.js +2 -1
  15. package/dist/0~7754.js +5653 -0
  16. package/dist/0~9445.js +1 -1
  17. package/dist/0~document-editor.js +4992 -3323
  18. package/dist/0~markdown-editor.js +250 -44
  19. package/dist/0~pdf-viewer.js +1016 -24
  20. package/dist/0~presentation-editor.js +179 -8
  21. package/dist/0~spreadsheet-editor.js +3371 -578
  22. package/dist/0~work-docx-export.js +6801 -658
  23. package/dist/0~work-docx-import.js +1388 -795
  24. package/dist/0~work-office-diagnostics.js +524 -30
  25. package/dist/0~work-pptx-export.js +2 -1
  26. package/dist/0~work-pptx-import.js +1 -2
  27. package/dist/0~work-presentation-charts.js +1 -1
  28. package/dist/2591.js +197 -0
  29. package/dist/3818.js +1090 -0
  30. package/dist/4104.js +970 -60
  31. package/dist/432.js +171 -14
  32. package/dist/4476.js +2008 -0
  33. package/dist/4560.js +674 -0
  34. package/dist/4650.js +70 -0
  35. package/dist/{1134.js → 5184.js} +183 -1
  36. package/dist/6489.js +18 -18
  37. package/dist/7060.js +132 -0
  38. package/dist/8715.js +2 -136
  39. package/dist/8928.js +16778 -0
  40. package/dist/9787.js +209 -0
  41. package/dist/core.d.ts +29 -9
  42. package/dist/core.js +10 -2
  43. package/dist/index.js +13 -3
  44. package/dist/internal/collaboration/office-collaboration-flat-json.d.ts +13 -0
  45. package/dist/internal/collaboration/office-collaboration-json.d.ts +4 -0
  46. package/dist/internal/collaboration/office-collaboration-presence.d.ts +86 -0
  47. package/dist/internal/collaboration/office-collaboration-transport.d.ts +42 -0
  48. package/dist/internal/collaboration/office-collaboration.d.ts +85 -0
  49. package/dist/internal/collaboration/office-document-collaboration-bibliography.d.ts +7 -0
  50. package/dist/internal/collaboration/office-document-collaboration-claims.d.ts +9 -0
  51. package/dist/internal/collaboration/office-document-collaboration-comments.d.ts +7 -0
  52. package/dist/internal/collaboration/office-document-collaboration-sidecar-utils.d.ts +27 -0
  53. package/dist/internal/collaboration/office-document-collaboration-sidecars.d.ts +16 -0
  54. package/dist/internal/collaboration/office-document-collaboration.d.ts +45 -0
  55. package/dist/internal/collaboration/office-markdown-collaboration.d.ts +31 -0
  56. package/dist/internal/collaboration/office-pdf-collaboration-claims.d.ts +4 -0
  57. package/dist/internal/collaboration/office-pdf-collaboration-conflicts.d.ts +2 -0
  58. package/dist/internal/collaboration/office-pdf-collaboration-model.d.ts +26 -0
  59. package/dist/internal/collaboration/office-pdf-collaboration-records.d.ts +21 -0
  60. package/dist/internal/collaboration/office-pdf-collaboration-types.d.ts +91 -0
  61. package/dist/internal/collaboration/office-pdf-collaboration-validation.d.ts +4 -0
  62. package/dist/internal/collaboration/office-pdf-collaboration.d.ts +35 -0
  63. package/dist/internal/collaboration/office-presentation-collaboration-model.d.ts +25 -0
  64. package/dist/internal/collaboration/office-presentation-collaboration-records.d.ts +22 -0
  65. package/dist/internal/collaboration/office-presentation-collaboration-validation.d.ts +4 -0
  66. package/dist/internal/collaboration/office-presentation-collaboration.d.ts +32 -0
  67. package/dist/internal/collaboration/office-spreadsheet-collaboration-cells.d.ts +13 -0
  68. package/dist/internal/collaboration/office-spreadsheet-collaboration-claims.d.ts +4 -0
  69. package/dist/internal/collaboration/office-spreadsheet-collaboration-conflicts.d.ts +2 -0
  70. package/dist/internal/collaboration/office-spreadsheet-collaboration-flat-json.d.ts +10 -0
  71. package/dist/internal/collaboration/office-spreadsheet-collaboration-model.d.ts +31 -0
  72. package/dist/internal/collaboration/office-spreadsheet-collaboration-records.d.ts +17 -0
  73. package/dist/internal/collaboration/office-spreadsheet-collaboration-validation.d.ts +4 -0
  74. package/dist/internal/collaboration/office-spreadsheet-collaboration.d.ts +32 -0
  75. package/dist/internal/design-system/primitives/navigation/tabs.d.ts +3 -1
  76. package/dist/internal/features/work/components/work-document-page-border.d.ts +6 -0
  77. package/dist/internal/features/work/editors/document-command-catalog.d.ts +536 -0
  78. package/dist/internal/features/work/editors/document-editor-focus.d.ts +1 -1
  79. package/dist/internal/features/work/editors/document-editor-support.d.ts +7 -3
  80. package/dist/internal/features/work/editors/document-editor.d.ts +8 -2
  81. package/dist/internal/features/work/editors/document-external-content.d.ts +14 -0
  82. package/dist/internal/features/work/editors/document-format-clipboard.d.ts +6 -0
  83. package/dist/internal/features/work/editors/document-format-tools.d.ts +4 -0
  84. package/dist/internal/features/work/editors/document-layout-panel.d.ts +4 -1
  85. package/dist/internal/features/work/editors/document-page-chrome-wps-shortcuts.d.ts +2 -0
  86. package/dist/internal/features/work/editors/document-page-layout-ribbon.d.ts +14 -0
  87. package/dist/internal/features/work/editors/document-page-stack.d.ts +10 -1
  88. package/dist/internal/features/work/editors/document-page-thumbnail.d.ts +2 -0
  89. package/dist/internal/features/work/editors/document-pagination-run-coordinator.d.ts +26 -0
  90. package/dist/internal/features/work/editors/document-picture-properties-dialog-model.d.ts +20 -1
  91. package/dist/internal/features/work/editors/document-review-navigation.d.ts +9 -0
  92. package/dist/internal/features/work/editors/document-statistics-dialog.d.ts +7 -0
  93. package/dist/internal/features/work/editors/document-status-bar.d.ts +2 -1
  94. package/dist/internal/features/work/editors/document-table-properties-dialog-model.d.ts +4 -1
  95. package/dist/internal/features/work/editors/document-toolbar.d.ts +19 -42
  96. package/dist/internal/features/work/editors/document-wps-shortcuts.d.ts +12 -0
  97. package/dist/internal/features/work/editors/document-zoom.d.ts +17 -0
  98. package/dist/internal/features/work/editors/markdown-editor-focus.d.ts +1 -1
  99. package/dist/internal/features/work/editors/markdown-editor.d.ts +5 -1
  100. package/dist/internal/features/work/editors/markdown-toolbar.d.ts +2 -1
  101. package/dist/internal/features/work/editors/office-collaboration-participants.d.ts +3 -0
  102. package/dist/internal/features/work/editors/office-collaboration-presence-context.d.ts +17 -0
  103. package/dist/internal/features/work/editors/office-collaboration-presence-ui.d.ts +25 -0
  104. package/dist/internal/features/work/editors/office-editor-focus-handoff.d.ts +27 -0
  105. package/dist/internal/features/work/editors/pdf-annotation-controller.d.ts +5 -0
  106. package/dist/internal/features/work/editors/pdf-collaboration-presence.d.ts +3 -0
  107. package/dist/internal/features/work/editors/pdf-collaboration-projection.d.ts +10 -0
  108. package/dist/internal/features/work/editors/pdf-evidence-contract.d.ts +36 -0
  109. package/dist/internal/features/work/editors/pdf-evidence-overlay.d.ts +37 -0
  110. package/dist/internal/features/work/editors/pdf-toolbar.d.ts +2 -1
  111. package/dist/internal/features/work/editors/pdf-viewer-controller.d.ts +7 -1
  112. package/dist/internal/features/work/editors/pdf-viewer.d.ts +11 -1
  113. package/dist/internal/features/work/editors/presentation-collaboration-presence.d.ts +5 -0
  114. package/dist/internal/features/work/editors/presentation-editor-focus.d.ts +3 -2
  115. package/dist/internal/features/work/editors/presentation-editor-types.d.ts +3 -0
  116. package/dist/internal/features/work/editors/presentation-editor.d.ts +1 -1
  117. package/dist/internal/features/work/editors/spreadsheet-auto-filter.d.ts +9 -0
  118. package/dist/internal/features/work/editors/spreadsheet-cell-clear.d.ts +3 -0
  119. package/dist/internal/features/work/editors/spreadsheet-cell-merge.d.ts +12 -0
  120. package/dist/internal/features/work/editors/spreadsheet-clipboard-shortcuts.d.ts +3 -7
  121. package/dist/internal/features/work/editors/spreadsheet-collaboration-presence.d.ts +9 -0
  122. package/dist/internal/features/work/editors/spreadsheet-command-catalog.d.ts +464 -0
  123. package/dist/internal/features/work/editors/spreadsheet-command-controller.d.ts +45 -9
  124. package/dist/internal/features/work/editors/spreadsheet-context-menu.d.ts +2 -0
  125. package/dist/internal/features/work/editors/spreadsheet-editor-ribbon.d.ts +9 -28
  126. package/dist/internal/features/work/editors/spreadsheet-editor.d.ts +8 -2
  127. package/dist/internal/features/work/editors/spreadsheet-format-painter.d.ts +27 -0
  128. package/dist/internal/features/work/editors/spreadsheet-freeze-panes.d.ts +14 -0
  129. package/dist/internal/features/work/editors/use-document-insert-commands.d.ts +3 -2
  130. package/dist/internal/features/work/editors/use-document-pagination.d.ts +6 -1
  131. package/dist/internal/features/work/editors/use-document-review-conflicts.d.ts +28 -0
  132. package/dist/internal/features/work/editors/use-spreadsheet-auto-filter.d.ts +21 -0
  133. package/dist/internal/features/work/editors/use-spreadsheet-collaboration.d.ts +27 -0
  134. package/dist/internal/features/work/editors/use-spreadsheet-format-painter.d.ts +18 -0
  135. package/dist/internal/features/work/editors/work-office-chrome.d.ts +22 -3
  136. package/dist/internal/features/work/editors/work-office-ribbon-overflow.d.ts +2 -0
  137. package/dist/internal/features/work/work-document-bookmark-references.d.ts +37 -0
  138. package/dist/internal/features/work/work-document-bookmarks.d.ts +29 -0
  139. package/dist/internal/features/work/work-document-caption-nodes.d.ts +4 -1
  140. package/dist/internal/features/work/work-document-comments.d.ts +1 -1
  141. package/dist/internal/features/work/work-document-equations.d.ts +513 -0
  142. package/dist/internal/features/work/work-document-extensions.d.ts +1 -0
  143. package/dist/internal/features/work/work-document-field-identity.d.ts +2 -0
  144. package/dist/internal/features/work/work-document-field-node.d.ts +2 -2
  145. package/dist/internal/features/work/work-document-fields.d.ts +7 -0
  146. package/dist/internal/features/work/work-document-image-identity.d.ts +30 -0
  147. package/dist/internal/features/work/work-document-image-layout.d.ts +46 -1
  148. package/dist/internal/features/work/work-document-image-wrap-contour.d.ts +16 -0
  149. package/dist/internal/features/work/work-document-incremental-layout.d.ts +2 -2
  150. package/dist/internal/features/work/work-document-model-codec.d.ts +4 -1
  151. package/dist/internal/features/work/work-document-note-integrity.d.ts +2 -0
  152. package/dist/internal/features/work/work-document-page-borders.d.ts +25 -0
  153. package/dist/internal/features/work/work-document-page-capture.d.ts +8 -0
  154. package/dist/internal/features/work/work-document-page-frames.d.ts +15 -0
  155. package/dist/internal/features/work/work-document-page-margins.d.ts +56 -0
  156. package/dist/internal/features/work/work-document-page-size.d.ts +47 -0
  157. package/dist/internal/features/work/work-document-pagination-measurement.d.ts +1 -2
  158. package/dist/internal/features/work/work-document-pagination-types.d.ts +7 -2
  159. package/dist/internal/features/work/work-document-pagination.d.ts +2 -2
  160. package/dist/internal/features/work/work-document-paragraph-borders.d.ts +32 -0
  161. package/dist/internal/features/work/work-document-paragraph-identity.d.ts +26 -0
  162. package/dist/internal/features/work/work-document-paragraph-shading.d.ts +18 -0
  163. package/dist/internal/features/work/work-document-review-conflicts.d.ts +35 -0
  164. package/dist/internal/features/work/work-document-section.d.ts +4 -0
  165. package/dist/internal/features/work/work-document-snapshot.d.ts +19 -0
  166. package/dist/internal/features/work/work-document-source.d.ts +23 -0
  167. package/dist/internal/features/work/work-document-table-column-widths.d.ts +7 -0
  168. package/dist/internal/features/work/work-document-table-property-changes.d.ts +3 -0
  169. package/dist/internal/features/work/work-document-table-row-identity.d.ts +15 -0
  170. package/dist/internal/features/work/work-document-table-sizing.d.ts +3 -0
  171. package/dist/internal/features/work/work-document-text-layout.d.ts +3 -1
  172. package/dist/internal/features/work/work-document-word-line-metrics.d.ts +2 -0
  173. package/dist/internal/features/work/work-docx-bookmark-diagnostics.d.ts +3 -0
  174. package/dist/internal/features/work/work-docx-bookmark-import.d.ts +24 -0
  175. package/dist/internal/features/work/work-docx-bookmarks.d.ts +17 -0
  176. package/dist/internal/features/work/work-docx-comment-durable-id-preservation.d.ts +2 -0
  177. package/dist/internal/features/work/work-docx-comment-export.d.ts +3 -0
  178. package/dist/internal/features/work/work-docx-comment-metadata.d.ts +2 -0
  179. package/dist/internal/features/work/work-docx-drawing-extension-preservation.d.ts +4 -0
  180. package/dist/internal/features/work/work-docx-equation-diagnostics.d.ts +3 -0
  181. package/dist/internal/features/work/work-docx-equation-export.d.ts +14 -0
  182. package/dist/internal/features/work/work-docx-equation-import.d.ts +30 -0
  183. package/dist/internal/features/work/work-docx-equation-story.d.ts +9 -0
  184. package/dist/internal/features/work/work-docx-export-formatting.d.ts +3 -1
  185. package/dist/internal/features/work/work-docx-export-image.d.ts +5 -1
  186. package/dist/internal/features/work/work-docx-export.d.ts +1 -1
  187. package/dist/internal/features/work/work-docx-field-instructions.d.ts +8 -0
  188. package/dist/internal/features/work/work-docx-font-table-preservation.d.ts +3 -0
  189. package/dist/internal/features/work/work-docx-ignorable-extension-preservation.d.ts +15 -0
  190. package/dist/internal/features/work/work-docx-image-crop.d.ts +12 -0
  191. package/dist/internal/features/work/work-docx-image-identity.d.ts +17 -0
  192. package/dist/internal/features/work/work-docx-image-layer.d.ts +12 -0
  193. package/dist/internal/features/work/work-docx-image-layout-import.d.ts +14 -2
  194. package/dist/internal/features/work/work-docx-image-wrap.d.ts +15 -0
  195. package/dist/internal/features/work/work-docx-import.d.ts +13 -3
  196. package/dist/internal/features/work/work-docx-list-export.d.ts +18 -0
  197. package/dist/internal/features/work/work-docx-list-import.d.ts +14 -0
  198. package/dist/internal/features/work/work-docx-note-comment-content-control-block-preservation.d.ts +18 -0
  199. package/dist/internal/features/work/work-docx-note-comment-content-control-model.d.ts +47 -0
  200. package/dist/internal/features/work/work-docx-note-comment-content-control-preservation.d.ts +4 -0
  201. package/dist/internal/features/work/work-docx-note-comment-content-control-properties.d.ts +17 -0
  202. package/dist/internal/features/work/work-docx-note-comment-content-control-table-model.d.ts +17 -0
  203. package/dist/internal/features/work/work-docx-note-comment-content-control-xml.d.ts +14 -0
  204. package/dist/internal/features/work/work-docx-note-comment-extension-preservation.d.ts +2 -0
  205. package/dist/internal/features/work/work-docx-note-comment-hyperlink-content.d.ts +40 -0
  206. package/dist/internal/features/work/work-docx-note-comment-hyperlink-preservation.d.ts +5 -0
  207. package/dist/internal/features/work/work-docx-note-comment-hyperlink-relationships.d.ts +35 -0
  208. package/dist/internal/features/work/work-docx-note-comment-identity.d.ts +15 -0
  209. package/dist/internal/features/work/work-docx-note-comment-run-preservation.d.ts +4 -0
  210. package/dist/internal/features/work/work-docx-note-comment-run-properties.d.ts +2 -0
  211. package/dist/internal/features/work/work-docx-note-image-import.d.ts +12 -0
  212. package/dist/internal/features/work/work-docx-note-image-relationships.d.ts +1 -0
  213. package/dist/internal/features/work/work-docx-numbering-extension-preservation.d.ts +6 -0
  214. package/dist/internal/features/work/work-docx-numbering.d.ts +1 -0
  215. package/dist/internal/features/work/work-docx-page-borders-diagnostics.d.ts +3 -0
  216. package/dist/internal/features/work/work-docx-page-borders-import.d.ts +10 -0
  217. package/dist/internal/features/work/work-docx-page-margins-diagnostics.d.ts +3 -0
  218. package/dist/internal/features/work/work-docx-page-margins-import.d.ts +18 -0
  219. package/dist/internal/features/work/work-docx-page-size-diagnostics.d.ts +2 -0
  220. package/dist/internal/features/work/work-docx-page-size-import.d.ts +17 -0
  221. package/dist/internal/features/work/work-docx-paragraph-borders-diagnostics.d.ts +3 -0
  222. package/dist/internal/features/work/work-docx-paragraph-borders-export.d.ts +18 -0
  223. package/dist/internal/features/work/work-docx-paragraph-borders-import.d.ts +24 -0
  224. package/dist/internal/features/work/work-docx-paragraph-default-collapsed.d.ts +19 -0
  225. package/dist/internal/features/work/work-docx-paragraph-extension-preservation.d.ts +2 -0
  226. package/dist/internal/features/work/work-docx-paragraph-identity-import.d.ts +10 -0
  227. package/dist/internal/features/work/work-docx-paragraph-identity.d.ts +18 -0
  228. package/dist/internal/features/work/work-docx-paragraph-pagination-import.d.ts +6 -1
  229. package/dist/internal/features/work/work-docx-paragraph-shading-diagnostics.d.ts +3 -0
  230. package/dist/internal/features/work/work-docx-paragraph-shading-export.d.ts +5 -0
  231. package/dist/internal/features/work/work-docx-paragraph-shading-import.d.ts +18 -0
  232. package/dist/internal/features/work/work-docx-run-formatting-import.d.ts +3 -0
  233. package/dist/internal/features/work/work-docx-settings-preservation.d.ts +10 -0
  234. package/dist/internal/features/work/work-docx-settings-xml.d.ts +16 -0
  235. package/dist/internal/features/work/work-docx-style-extension-preservation.d.ts +2 -0
  236. package/dist/internal/features/work/work-docx-table-cell-export.d.ts +2 -1
  237. package/dist/internal/features/work/work-docx-table-cell-import.d.ts +3 -0
  238. package/dist/internal/features/work/work-docx-table-extension-preservation.d.ts +2 -0
  239. package/dist/internal/features/work/work-docx-table-row-import.d.ts +2 -0
  240. package/dist/internal/features/work/work-docx-table-sizing-import.d.ts +1 -0
  241. package/dist/internal/features/work/work-docx-theme-reference.d.ts +23 -0
  242. package/dist/internal/features/work/work-docx-theme.d.ts +4 -1
  243. package/dist/internal/features/work/work-docx-twips.d.ts +12 -0
  244. package/dist/internal/features/work/work-file-contract.d.ts +1 -0
  245. package/dist/internal/features/work/work-file-io.d.ts +1 -1
  246. package/dist/internal/features/work/work-markdown-extensions.d.ts +4 -1
  247. package/dist/internal/features/work/work-ooxml-package-preservation.d.ts +12 -0
  248. package/dist/internal/features/work/work-ooxml-package-security.d.ts +6 -0
  249. package/dist/internal/features/work/work-ooxml-relationship-preservation.d.ts +10 -0
  250. package/dist/internal/features/work/work-ooxml-xml.d.ts +2 -0
  251. package/dist/internal/features/work/work-pdf-export.d.ts +10 -0
  252. package/dist/internal/features/work/work-repository.d.ts +2 -0
  253. package/dist/internal/features/work/work-types.d.ts +15 -2
  254. package/dist/internal/kernel/office-kernel-client-types.d.ts +1 -0
  255. package/dist/internal/kernel/office-kernel-protocol.d.ts +7 -0
  256. package/dist/internal/kernel/office-kernel-version.d.ts +1 -1
  257. package/dist/office-kernel.wasm +0 -0
  258. package/dist/office-kernel.worker.js +93 -41
  259. package/dist/react.d.ts +18 -12
  260. package/dist/react.js +1 -1
  261. package/dist/styles.css +1367 -16
  262. package/dist/vue.d.ts +48 -5
  263. package/dist/vue.js +42 -3
  264. package/dist/web-component.d.ts +24 -2
  265. package/dist/web-component.js +101 -2
  266. package/docs/latest/en/browser-editor-architecture.md +262 -47
  267. package/package.json +29 -4
  268. package/dist/0~152.js +0 -94
  269. package/dist/0~2582.js +0 -485
  270. package/dist/0~4750.js +0 -939
  271. package/dist/0~5861.js +0 -596
  272. package/dist/0~work-document-extensions.js +0 -3045
  273. package/dist/0~work-document-model-codec.js +0 -42
  274. package/dist/0~work-docx-bibliography.js +0 -347
  275. package/dist/0~work-docx-page-color.js +0 -42
  276. package/dist/2881.js +0 -1455
  277. package/dist/8728.js +0 -723
@@ -16,9 +16,14 @@ export interface OfficeKernelPageMetrics {
16
16
  footerHeight: number;
17
17
  pageGap: number;
18
18
  }
19
+ export interface OfficeKernelPageStyle {
20
+ id: string;
21
+ page: OfficeKernelPageMetrics;
22
+ }
19
23
  export interface OfficeKernelLayoutBlock {
20
24
  id: string;
21
25
  height: number;
26
+ pageStyleId?: string;
22
27
  breakBefore?: boolean;
23
28
  breakAfter?: boolean;
24
29
  keepTogether?: boolean;
@@ -38,6 +43,7 @@ export interface OfficeKernelLayoutRequest {
38
43
  documentRevision: number;
39
44
  startPageIndex: number;
40
45
  page: OfficeKernelPageMetrics;
46
+ pageStyles?: OfficeKernelPageStyle[];
41
47
  blocks: OfficeKernelLayoutBlock[];
42
48
  }
43
49
  export interface OfficeKernelLayoutPlacement {
@@ -48,6 +54,7 @@ export interface OfficeKernelLayoutPlacement {
48
54
  }
49
55
  export interface OfficeKernelLayoutPage {
50
56
  index: number;
57
+ page: OfficeKernelPageMetrics;
51
58
  usedHeight: number;
52
59
  availableHeight: number;
53
60
  placements: OfficeKernelLayoutPlacement[];
@@ -1 +1 @@
1
- export declare const OFFICE_KERNEL_PROTOCOL_VERSION: 15;
1
+ export declare const OFFICE_KERNEL_PROTOCOL_VERSION: 16;
Binary file
@@ -13052,29 +13052,36 @@
13052
13052
  })();
13053
13053
  (()=>{
13054
13054
  const MAX_LAYOUT_BLOCKS = 10000;
13055
+ const MAX_LAYOUT_PAGE_STYLES = MAX_LAYOUT_BLOCKS;
13055
13056
  const MAX_LAYOUT_EXTENT = 1000000;
13056
13057
  const MAX_LAYOUT_PAGE_INDEX = 1000000;
13057
13058
  function layoutOfficeDocumentInJavaScript(request) {
13058
13059
  validateLayoutRequest(request);
13059
- const availableHeight = Math.max(1, request.page.height - request.page.marginTop - request.page.marginBottom);
13060
+ const pageStyles = new Map((request.pageStyles ?? []).map(({ id, page })=>[
13061
+ id,
13062
+ page
13063
+ ]));
13064
+ const firstPage = pageMetricsForBlock(request.blocks[0], request.page, pageStyles);
13060
13065
  const pages = [
13061
- emptyPage(request.startPageIndex, availableHeight)
13066
+ emptyPage(request.startPageIndex, firstPage)
13062
13067
  ];
13063
13068
  let index = 0;
13064
13069
  while(index < request.blocks.length){
13065
13070
  const block = request.blocks[index];
13071
+ const page = pageMetricsForBlock(block, request.page, pageStyles);
13072
+ ensurePageMetrics(pages, page);
13066
13073
  if (void 0 !== block.flowCount) {
13067
13074
  const end = index + block.flowCount;
13068
- layoutFlow(request.blocks.slice(index, end), request.blocks.slice(end), pages, availableHeight, end < request.blocks.length);
13075
+ layoutFlow(request.blocks.slice(index, end), request.blocks.slice(end), pages, page, request.page, pageStyles, end < request.blocks.length);
13069
13076
  index = end;
13070
13077
  } else {
13071
- layoutSingleBlock(block, request.blocks.slice(index + 1), pages, availableHeight, index + 1 < request.blocks.length);
13078
+ layoutSingleBlock(block, request.blocks.slice(index + 1), pages, page, request.page, pageStyles, index + 1 < request.blocks.length);
13072
13079
  index += 1;
13073
13080
  }
13074
13081
  }
13075
13082
  if (pages.length > 1 && pages.at(-1)?.placements.length === 0) pages.pop();
13076
13083
  return {
13077
- protocol: 15,
13084
+ protocol: 16,
13078
13085
  kind: 'layoutResult',
13079
13086
  requestId: request.requestId,
13080
13087
  revision: request.revision,
@@ -13082,66 +13089,76 @@
13082
13089
  startPageIndex: request.startPageIndex,
13083
13090
  engine: "javascript",
13084
13091
  pages,
13085
- breaks: layoutBreaks(pages, request)
13092
+ breaks: layoutBreaks(pages)
13086
13093
  };
13087
13094
  }
13088
13095
  function validateLayoutRequest(request) {
13089
- if (15 !== request.protocol) throw kernelError('office.kernel.protocol_unsupported', `Office kernel protocol ${request.protocol} is unsupported.`);
13096
+ if (16 !== request.protocol) throw kernelError('office.kernel.protocol_unsupported', `Office kernel protocol ${request.protocol} is unsupported.`);
13090
13097
  if ('layout' !== request.kind) throw kernelError('office.kernel.request_kind_invalid', 'The Office kernel only accepts layout requests at this boundary.');
13091
13098
  if (!Number.isSafeInteger(request.requestId) || request.requestId < 0 || !Number.isSafeInteger(request.revision) || request.revision < 0 || !Number.isSafeInteger(request.documentRevision) || request.documentRevision < 0 || !Number.isSafeInteger(request.startPageIndex) || request.startPageIndex < 0) throw kernelError('office.kernel.revision_invalid', 'Request, layout, and document revisions must be non-negative safe integers.');
13092
13099
  if (request.startPageIndex > MAX_LAYOUT_PAGE_INDEX) throw kernelError('office.kernel.page_index_invalid', `startPageIndex may not exceed ${MAX_LAYOUT_PAGE_INDEX}.`);
13093
13100
  if (request.blocks.length > MAX_LAYOUT_BLOCKS) throw kernelError('office.kernel.block_limit_exceeded', `A layout request may contain at most ${MAX_LAYOUT_BLOCKS} blocks.`);
13094
- for (const [name, value] of Object.entries(request.page))validateExtent(`page.${name}`, value);
13095
- if (request.page.width <= request.page.marginLeft + request.page.marginRight) throw kernelError('office.kernel.page_width_invalid', 'Page width must be greater than its horizontal margins.');
13096
- if (request.page.height <= request.page.marginTop + request.page.marginBottom) throw kernelError('office.kernel.page_height_invalid', 'Page height must leave a positive body area.');
13101
+ validatePageMetrics('page', request.page);
13102
+ const pageStyles = request.pageStyles ?? [];
13103
+ if (pageStyles.length > MAX_LAYOUT_PAGE_STYLES) throw kernelError('office.kernel.page_style_limit_exceeded', `A layout request may contain at most ${MAX_LAYOUT_PAGE_STYLES} page styles.`);
13104
+ const pageStyleIds = new Set();
13105
+ for (const style of pageStyles){
13106
+ if (!style.id.trim() || style.id.length > 256) throw kernelError('office.kernel.page_style_id_invalid', 'Every page style requires a non-empty ID of at most 256 bytes.');
13107
+ if (pageStyleIds.has(style.id)) throw kernelError('office.kernel.page_style_id_duplicate', `Page style ID '${style.id}' is duplicated.`);
13108
+ pageStyleIds.add(style.id);
13109
+ validatePageMetrics(`pageStyles.${style.id}.page`, style.page);
13110
+ }
13097
13111
  const blockIds = new Set();
13098
13112
  for (const block of request.blocks){
13099
13113
  if (!block.id.trim() || block.id.length > 256) throw kernelError('office.kernel.block_id_invalid', 'Every layout block requires a non-empty ID of at most 256 bytes.');
13100
13114
  if (blockIds.has(block.id)) throw kernelError('office.kernel.block_id_duplicate', `Layout block ID '${block.id}' is duplicated.`);
13101
13115
  blockIds.add(block.id);
13116
+ if (void 0 !== block.pageStyleId && (!block.pageStyleId.trim() || block.pageStyleId.length > 256 || !pageStyleIds.has(block.pageStyleId))) throw kernelError('office.kernel.page_style_reference_invalid', `Layout block '${block.id}' references an unknown page style.`);
13102
13117
  validateExtent('block.height', block.height);
13103
13118
  validateFlowMetadata(block);
13104
13119
  }
13105
13120
  validateFlowSequences(request.blocks);
13106
13121
  }
13107
- function layoutSingleBlock(block, next, pages, availableHeight, hasMoreBlocks) {
13122
+ function layoutSingleBlock(block, next, pages, page, defaultPage, pageStyles, hasMoreBlocks) {
13123
+ const availableHeight = pageBodyHeight(page);
13108
13124
  let current = pages.at(-1);
13109
13125
  let currentHasContent = current.placements.length > 0;
13110
13126
  if (block.breakBefore && currentHasContent) {
13111
- current = emptyPage(nextPageIndex(pages), availableHeight);
13127
+ current = emptyPage(nextPageIndex(pages), page);
13112
13128
  pages.push(current);
13113
13129
  currentHasContent = false;
13114
13130
  }
13115
13131
  const remaining = Math.max(0, availableHeight - current.usedHeight);
13116
- const nextHeight = nextBlockPreviewHeight(next);
13132
+ const nextHeight = nextBlockPreviewHeight(next, page, defaultPage, pageStyles);
13117
13133
  const groupedHeight = block.height + (block.keepWithNext ? nextHeight : 0);
13118
13134
  const shouldAdvance = currentHasContent && (block.height > remaining || (block.keepTogether || block.keepWithNext) && groupedHeight <= availableHeight && groupedHeight > remaining);
13119
13135
  if (shouldAdvance) {
13120
- current = emptyPage(nextPageIndex(pages), availableHeight);
13136
+ current = emptyPage(nextPageIndex(pages), page);
13121
13137
  pages.push(current);
13122
13138
  }
13123
13139
  placeFragment(block, current, availableHeight);
13124
- if (block.breakAfter && hasMoreBlocks) pages.push(emptyPage(nextPageIndex(pages), availableHeight));
13140
+ if (block.breakAfter && hasMoreBlocks) pages.push(emptyPage(nextPageIndex(pages), page));
13125
13141
  }
13126
- function layoutFlow(blocks, next, pages, availableHeight, hasMoreBlocks) {
13142
+ function layoutFlow(blocks, next, pages, page, defaultPage, pageStyles, hasMoreBlocks) {
13143
+ const availableHeight = pageBodyHeight(page);
13127
13144
  const first = blocks[0];
13128
13145
  const last = blocks.at(-1);
13129
- if (first.breakBefore && pages.at(-1)?.placements.length) pages.push(emptyPage(nextPageIndex(pages), availableHeight));
13146
+ if (first.breakBefore && pages.at(-1)?.placements.length) pages.push(emptyPage(nextPageIndex(pages), page));
13130
13147
  const totalHeight = fragmentHeight(blocks, 0, blocks.length);
13131
- const nextHeight = last.keepWithNext ? nextBlockPreviewHeight(next) : 0;
13148
+ const nextHeight = last.keepWithNext ? nextBlockPreviewHeight(next, page, defaultPage, pageStyles) : 0;
13132
13149
  let current = pages.at(-1);
13133
13150
  const repeatHeaderCount = first.repeatHeaderCount ?? 0;
13134
13151
  const repeatHeaderHeight = first.repeatHeaderHeight ?? 0;
13135
13152
  const groupedHeight = totalHeight + nextHeight;
13136
13153
  if (first.keepTogether && current.placements.length && groupedHeight <= availableHeight && groupedHeight > Math.max(0, availableHeight - current.usedHeight)) {
13137
- current = emptyPage(nextPageIndex(pages), availableHeight);
13154
+ current = emptyPage(nextPageIndex(pages), page);
13138
13155
  pages.push(current);
13139
13156
  }
13140
13157
  if (repeatHeaderCount > 0 && repeatHeaderCount < blocks.length) {
13141
13158
  const leadingHeight = fragmentHeight(blocks, 0, repeatHeaderCount + 1);
13142
13159
  const remainingHeight = Math.max(0, availableHeight - current.usedHeight);
13143
13160
  if (current.placements.length > 0 && leadingHeight <= availableHeight && leadingHeight > remainingHeight) {
13144
- current = emptyPage(nextPageIndex(pages), availableHeight);
13161
+ current = emptyPage(nextPageIndex(pages), page);
13145
13162
  pages.push(current);
13146
13163
  }
13147
13164
  }
@@ -13155,7 +13172,7 @@
13155
13172
  const remainingFragments = blocks.length - cursor;
13156
13173
  const remainingFlowHeight = fragmentHeight(blocks, cursor, blocks.length);
13157
13174
  if (nextHeight > 0 && currentHasContent && remainingFlowHeight <= remainingHeight && remainingFlowHeight + nextHeight > remainingHeight && remainingFlowHeight + nextHeight <= availableHeight) {
13158
- pages.push(emptyPage(nextPageIndex(pages), availableHeight));
13175
+ pages.push(emptyPage(nextPageIndex(pages), page));
13159
13176
  continue;
13160
13177
  }
13161
13178
  let fitting = fragmentsFitting(blocks, cursor, blocks.length, remainingHeight);
@@ -13166,7 +13183,7 @@
13166
13183
  }
13167
13184
  if (0 === fitting) {
13168
13185
  if (currentHasContent) {
13169
- pages.push(emptyPage(nextPageIndex(pages), availableHeight));
13186
+ pages.push(emptyPage(nextPageIndex(pages), page));
13170
13187
  continue;
13171
13188
  }
13172
13189
  fitting = 1;
@@ -13174,19 +13191,20 @@
13174
13191
  if (remainingFragments > minimum) fitting = Math.min(fitting, remainingFragments - minimum);
13175
13192
  const minimumHere = Math.min(minimum, remainingFragments);
13176
13193
  if (fitting < minimumHere && currentHasContent) {
13177
- pages.push(emptyPage(nextPageIndex(pages), availableHeight));
13194
+ pages.push(emptyPage(nextPageIndex(pages), page));
13178
13195
  continue;
13179
13196
  }
13180
13197
  fitting = Math.max(1, fitting);
13181
13198
  placeFragments(blocks, cursor, cursor + fitting, current, availableHeight);
13182
13199
  cursor += fitting;
13183
- if (cursor < blocks.length) pages.push(emptyPage(nextPageIndex(pages), availableHeight));
13200
+ if (cursor < blocks.length) pages.push(emptyPage(nextPageIndex(pages), page));
13184
13201
  }
13185
- if (last.breakAfter && hasMoreBlocks) pages.push(emptyPage(nextPageIndex(pages), availableHeight));
13202
+ if (last.breakAfter && hasMoreBlocks) pages.push(emptyPage(nextPageIndex(pages), page));
13186
13203
  }
13187
- function nextBlockPreviewHeight(blocks) {
13204
+ function nextBlockPreviewHeight(blocks, currentPage, defaultPage, pageStyles) {
13188
13205
  const first = blocks[0];
13189
13206
  if (!first || first.breakBefore) return 0;
13207
+ if (!pageMetricsEqual(currentPage, pageMetricsForBlock(first, defaultPage, pageStyles))) return 0;
13190
13208
  const count = Math.min(2, first.flowCount ?? 1);
13191
13209
  return fragmentHeight(blocks, 0, count);
13192
13210
  }
@@ -13259,25 +13277,28 @@
13259
13277
  const flow = blocks.slice(index, index + count);
13260
13278
  if (flow.length !== count) throw kernelError('office.kernel.flow_sequence_invalid', 'A layout flow must contain its declared number of fragments.');
13261
13279
  flow.forEach((fragment, flowIndex)=>{
13262
- if (fragment.flowId !== block.flowId || fragment.flowIndex !== flowIndex || fragment.flowCount !== count || fragment.minimumFragmentsPerPage !== block.minimumFragmentsPerPage || fragment.repeatHeaderCount !== repeatHeaderCount || fragment.repeatHeaderHeight !== repeatHeaderHeight) throw kernelError('office.kernel.flow_sequence_invalid', 'Layout flow fragments must be consecutive and consistently indexed.');
13280
+ if (fragment.flowId !== block.flowId || fragment.flowIndex !== flowIndex || fragment.flowCount !== count || fragment.minimumFragmentsPerPage !== block.minimumFragmentsPerPage || fragment.repeatHeaderCount !== repeatHeaderCount || fragment.repeatHeaderHeight !== repeatHeaderHeight || fragment.pageStyleId !== block.pageStyleId) throw kernelError('office.kernel.flow_sequence_invalid', 'Layout flow fragments must be consecutive and consistently indexed.');
13263
13281
  if (flowIndex > 0 && fragment.breakBefore) throw kernelError('office.kernel.flow_break_invalid', 'Only the first flow fragment may request breakBefore.');
13264
13282
  if (flowIndex + 1 < count && fragment.breakAfter) throw kernelError('office.kernel.flow_break_invalid', 'Only the last flow fragment may request breakAfter.');
13265
13283
  });
13266
13284
  index += count;
13267
13285
  }
13268
13286
  }
13269
- function emptyPage(index, availableHeight) {
13287
+ function emptyPage(index, page) {
13270
13288
  return {
13271
13289
  index,
13290
+ page: {
13291
+ ...page
13292
+ },
13272
13293
  usedHeight: 0,
13273
- availableHeight,
13294
+ availableHeight: pageBodyHeight(page),
13274
13295
  placements: []
13275
13296
  };
13276
13297
  }
13277
13298
  function nextPageIndex(pages) {
13278
13299
  return (pages.at(-1)?.index ?? -1) + 1;
13279
13300
  }
13280
- function layoutBreaks(pages, request) {
13301
+ function layoutBreaks(pages) {
13281
13302
  return pages.slice(1).flatMap((page, localIndex)=>{
13282
13303
  const beforeBlockId = page.placements[0]?.blockId;
13283
13304
  const previous = pages[localIndex];
@@ -13288,11 +13309,37 @@
13288
13309
  beforeBlockId,
13289
13310
  pageIndex: page.index,
13290
13311
  remainingBodyHeight,
13291
- spacerHeight: remainingBodyHeight + request.page.marginBottom + request.page.pageGap + request.page.marginTop
13312
+ spacerHeight: remainingBodyHeight + previous.page.marginBottom + previous.page.pageGap + page.page.marginTop
13292
13313
  }
13293
13314
  ];
13294
13315
  });
13295
13316
  }
13317
+ function ensurePageMetrics(pages, page) {
13318
+ const current = pages.at(-1);
13319
+ if (pageMetricsEqual(current.page, page)) return;
13320
+ if (0 === current.placements.length && 0 === current.usedHeight) {
13321
+ current.page = {
13322
+ ...page
13323
+ };
13324
+ current.availableHeight = pageBodyHeight(page);
13325
+ return;
13326
+ }
13327
+ pages.push(emptyPage(nextPageIndex(pages), page));
13328
+ }
13329
+ function pageMetricsForBlock(block, defaultPage, pageStyles) {
13330
+ return block?.pageStyleId ? pageStyles.get(block.pageStyleId) ?? defaultPage : defaultPage;
13331
+ }
13332
+ function pageBodyHeight(page) {
13333
+ return Math.max(1, page.height - page.marginTop - page.marginBottom);
13334
+ }
13335
+ function pageMetricsEqual(left, right) {
13336
+ return left.width === right.width && left.height === right.height && left.marginTop === right.marginTop && left.marginRight === right.marginRight && left.marginBottom === right.marginBottom && left.marginLeft === right.marginLeft && left.headerHeight === right.headerHeight && left.footerHeight === right.footerHeight && left.pageGap === right.pageGap;
13337
+ }
13338
+ function validatePageMetrics(name, page) {
13339
+ for (const [property, value] of Object.entries(page))validateExtent(`${name}.${property}`, value);
13340
+ if (page.width <= page.marginLeft + page.marginRight) throw kernelError('office.kernel.page_width_invalid', 'Page width must be greater than its horizontal margins.');
13341
+ if (page.height <= page.marginTop + page.marginBottom) throw kernelError('office.kernel.page_height_invalid', 'Page height must leave a positive body area.');
13342
+ }
13296
13343
  function validateExtent(name, value) {
13297
13344
  if (!Number.isFinite(value) || value < 0 || value > MAX_LAYOUT_EXTENT) throw kernelError('office.kernel.extent_invalid', `${name} must be a finite non-negative number.`);
13298
13345
  }
@@ -13314,7 +13361,7 @@
13314
13361
  guides: []
13315
13362
  } : snapPresentationElement(request.elements, operation.movingElementId, operation.mode, operation.thresholdX, operation.thresholdY);
13316
13363
  return {
13317
- protocol: 15,
13364
+ protocol: 16,
13318
13365
  kind: 'presentationGeometryResult',
13319
13366
  requestId: request.requestId,
13320
13367
  revision: request.revision,
@@ -13462,7 +13509,7 @@
13462
13509
  return Math.min(Math.max(value, 0), Math.max(0, maximum));
13463
13510
  }
13464
13511
  function validatePresentationGeometryRequest(request) {
13465
- if (15 !== request.protocol) throw office_kernel_presentation_fallback_kernelError('office.kernel.protocol_unsupported', `Office kernel protocol ${request.protocol} is unsupported.`);
13512
+ if (16 !== request.protocol) throw office_kernel_presentation_fallback_kernelError('office.kernel.protocol_unsupported', `Office kernel protocol ${request.protocol} is unsupported.`);
13466
13513
  if ('presentationGeometry' !== request.kind) throw office_kernel_presentation_fallback_kernelError('office.kernel.request_kind_invalid', 'The presentation geometry kernel received an invalid request kind.');
13467
13514
  for (const [name, value] of [
13468
13515
  [
@@ -13853,7 +13900,7 @@
13853
13900
  const MAX_SPREADSHEET_IDENTIFIER_BYTES = 256;
13854
13901
  const MAX_UNSIGNED_32_BIT_INTEGER = 4294967295;
13855
13902
  function validateSpreadsheetCalculationRequest(request) {
13856
- if (15 !== request.protocol) throw office_kernel_spreadsheet_fallback_validation_kernelError('office.kernel.protocol_unsupported', `Office kernel protocol ${request.protocol} is unsupported.`);
13903
+ if (16 !== request.protocol) throw office_kernel_spreadsheet_fallback_validation_kernelError('office.kernel.protocol_unsupported', `Office kernel protocol ${request.protocol} is unsupported.`);
13857
13904
  if ('spreadsheetCalculation' !== request.kind) throw office_kernel_spreadsheet_fallback_validation_kernelError('office.kernel.request_kind_invalid', 'The Spreadsheet kernel only accepts calculation requests.');
13858
13905
  if (!unsigned32BitInteger(request.requestId) || !unsigned32BitInteger(request.revision) || !nonNegativeSafeInteger(request.documentRevision)) throw office_kernel_spreadsheet_fallback_validation_kernelError('office.kernel.revision_invalid', 'Request, calculation, and document revisions must be non-negative safe integers.');
13859
13906
  if (request.sheets.length > MAX_SPREADSHEET_SHEETS) throw office_kernel_spreadsheet_fallback_validation_kernelError('office.kernel.spreadsheet.sheet_limit_exceeded', `A Spreadsheet calculation request may contain at most ${MAX_SPREADSHEET_SHEETS} sheets.`);
@@ -14016,7 +14063,7 @@
14016
14063
  ] : [];
14017
14064
  });
14018
14065
  return {
14019
- protocol: 15,
14066
+ protocol: 16,
14020
14067
  kind: 'spreadsheetCalculationResult',
14021
14068
  requestId: this.request.requestId,
14022
14069
  revision: this.request.revision,
@@ -14313,7 +14360,7 @@
14313
14360
  }
14314
14361
  function layoutOfficeTextInJavaScript(request) {
14315
14362
  return {
14316
- protocol: 15,
14363
+ protocol: 16,
14317
14364
  kind: 'textLayoutResult',
14318
14365
  requestId: request.requestId,
14319
14366
  revision: request.revision,
@@ -14326,7 +14373,7 @@
14326
14373
  function isOfficeKernelResponse(value) {
14327
14374
  if (!value || 'object' != typeof value) return false;
14328
14375
  const candidate = value;
14329
- if (15 !== candidate.protocol || 'layoutResult' !== candidate.kind && 'presentationGeometryResult' !== candidate.kind && 'spreadsheetCalculationResult' !== candidate.kind && 'spreadsheetSessionCalculationResult' !== candidate.kind && 'textLayoutResult' !== candidate.kind && 'error' !== candidate.kind) return false;
14376
+ if (16 !== candidate.protocol || 'layoutResult' !== candidate.kind && 'presentationGeometryResult' !== candidate.kind && 'spreadsheetCalculationResult' !== candidate.kind && 'spreadsheetSessionCalculationResult' !== candidate.kind && 'textLayoutResult' !== candidate.kind && 'error' !== candidate.kind) return false;
14330
14377
  if (!isNonNegativeInteger(candidate.requestId) || !isNonNegativeInteger(candidate.revision) || !isNonNegativeInteger(candidate.documentRevision) || 'wasm' !== candidate.engine && "javascript" !== candidate.engine) return false;
14331
14378
  if ('error' === candidate.kind) {
14332
14379
  const error = candidate.error;
@@ -14372,7 +14419,12 @@
14372
14419
  function isLayoutPage(value) {
14373
14420
  if (!value || 'object' != typeof value) return false;
14374
14421
  const page = value;
14375
- return isNonNegativeInteger(page.index) && isNonNegativeNumber(page.usedHeight) && isNonNegativeNumber(page.availableHeight) && Array.isArray(page.placements) && page.placements.every(isLayoutPlacement);
14422
+ return isNonNegativeInteger(page.index) && isPageMetrics(page.page) && isNonNegativeNumber(page.usedHeight) && isNonNegativeNumber(page.availableHeight) && Array.isArray(page.placements) && page.placements.every(isLayoutPlacement);
14423
+ }
14424
+ function isPageMetrics(value) {
14425
+ if (!value || 'object' != typeof value) return false;
14426
+ const page = value;
14427
+ return isPositiveNumber(page.width) && isPositiveNumber(page.height) && isNonNegativeNumber(page.marginTop) && isNonNegativeNumber(page.marginRight) && isNonNegativeNumber(page.marginBottom) && isNonNegativeNumber(page.marginLeft) && isNonNegativeNumber(page.headerHeight) && isNonNegativeNumber(page.footerHeight) && isNonNegativeNumber(page.pageGap) && Number(page.width) > Number(page.marginLeft) + Number(page.marginRight) && Number(page.height) > Number(page.marginTop) + Number(page.marginBottom);
14376
14428
  }
14377
14429
  function isLayoutPlacement(value) {
14378
14430
  if (!value || 'object' != typeof value) return false;
@@ -14441,7 +14493,7 @@
14441
14493
  response = wasm ? layoutWithWasm(wasm, request) : layoutOfficeDocumentInJavaScript(request);
14442
14494
  } catch (error) {
14443
14495
  response = {
14444
- protocol: 15,
14496
+ protocol: 16,
14445
14497
  kind: 'error',
14446
14498
  requestId: request.requestId,
14447
14499
  revision: request.revision,
@@ -14530,7 +14582,7 @@
14530
14582
  source = await WebAssembly.instantiate(await response.arrayBuffer(), {});
14531
14583
  }
14532
14584
  const exports = source.instance.exports;
14533
- if (!(exports.memory instanceof WebAssembly.Memory) || 15 !== exports.office_kernel_abi_version() || 'function' != typeof exports.office_kernel_presentation_geometry || 'function' != typeof exports.office_kernel_register_font || 'function' != typeof exports.office_kernel_spreadsheet_calculation || 'function' != typeof exports.office_kernel_spreadsheet_session_calculation || 'function' != typeof exports.office_kernel_text_layout) throw new Error('Office kernel WebAssembly ABI is incompatible.');
14585
+ if (!(exports.memory instanceof WebAssembly.Memory) || 16 !== exports.office_kernel_abi_version() || 'function' != typeof exports.office_kernel_presentation_geometry || 'function' != typeof exports.office_kernel_register_font || 'function' != typeof exports.office_kernel_spreadsheet_calculation || 'function' != typeof exports.office_kernel_spreadsheet_session_calculation || 'function' != typeof exports.office_kernel_text_layout) throw new Error('Office kernel WebAssembly ABI is incompatible.');
14534
14586
  return exports;
14535
14587
  }
14536
14588
  function registerFontWithWasm(wasm, id, data) {
@@ -14589,7 +14641,7 @@
14589
14641
  }
14590
14642
  function errorResponse(request, error) {
14591
14643
  return {
14592
- protocol: 15,
14644
+ protocol: 16,
14593
14645
  kind: 'error',
14594
14646
  requestId: request.requestId,
14595
14647
  revision: request.revision,
package/dist/react.d.ts CHANGED
@@ -1,6 +1,8 @@
1
+ import type { WorkOfficeCollaborationPresence } from './internal/collaboration/office-collaboration-presence';
1
2
  import type { DocumentEditorProps as InternalDocumentEditorProps } from './internal/features/work/editors/document-editor';
2
3
  import type { MarkdownEditorProps as InternalMarkdownEditorProps } from './internal/features/work/editors/markdown-editor';
3
4
  import type { PdfViewerProps as InternalPdfViewerProps } from './internal/features/work/editors/pdf-viewer';
5
+ export { PDF_EVIDENCE_COORDINATE_BASIS, type PdfEvidenceBounds, type PdfEvidenceOverlay, type PdfEvidencePage, type PdfEvidenceRegion, type PdfEvidenceRegionLocation, } from './internal/features/work/editors/pdf-evidence-contract';
4
6
  import type { PresentationEditorProps as InternalPresentationEditorProps } from './internal/features/work/editors/presentation-editor';
5
7
  import type { SpreadsheetEditorProps as InternalSpreadsheetEditorProps } from './internal/features/work/editors/spreadsheet-editor';
6
8
  import type { WorkOfficeFileAction } from './internal/features/work/editors/work-office-chrome';
@@ -27,25 +29,29 @@ export interface DocumentLayoutFont {
27
29
  style?: 'normal' | 'italic';
28
30
  }
29
31
  export declare const defaultDocumentLayoutFonts: readonly DocumentLayoutFont[];
30
- export type { WorkOfficeFileAction as OfficeFileAction };
31
- export type { OfficeSurfaceProps, OfficeTheme };
32
- export interface DocumentEditorProps extends Omit<InternalDocumentEditorProps, 'layoutFonts' | 'preview'>, OfficeSurfaceProps {
32
+ export type { OfficeSurfaceProps, OfficeTheme, WorkOfficeFileAction as OfficeFileAction, };
33
+ interface OfficeCollaborationSurfaceProps {
34
+ /** Host-owned Awareness projection paired with the editor collaboration session. */
35
+ presence?: WorkOfficeCollaborationPresence;
36
+ }
37
+ export interface DocumentEditorProps extends Omit<InternalDocumentEditorProps, 'defaultRibbonCollapsed' | 'layoutFonts' | 'preview'>, OfficeSurfaceProps, OfficeCollaborationSurfaceProps {
33
38
  preview?: boolean;
39
+ defaultRibbonCollapsed?: boolean;
34
40
  layoutFonts?: readonly DocumentLayoutFont[];
35
41
  }
36
- export declare function DocumentEditor({ className, kernelWasmUrl, layoutFonts, preview, style, theme, ...editorProps }: DocumentEditorProps): import("react").JSX.Element;
37
- export interface MarkdownEditorProps extends Omit<InternalMarkdownEditorProps, 'preview'>, OfficeSurfaceProps {
42
+ export declare function DocumentEditor({ className, defaultRibbonCollapsed, kernelWasmUrl, layoutFonts, presence, preview, style, theme, ...editorProps }: DocumentEditorProps): import("react").JSX.Element;
43
+ export interface MarkdownEditorProps extends Omit<InternalMarkdownEditorProps, 'preview'>, OfficeSurfaceProps, OfficeCollaborationSurfaceProps {
38
44
  preview?: boolean;
39
45
  }
40
- export declare function MarkdownEditor({ className, preview, style, theme, ...editorProps }: MarkdownEditorProps): import("react").JSX.Element;
41
- export interface SpreadsheetEditorProps extends Omit<InternalSpreadsheetEditorProps, 'preview'>, OfficeSurfaceProps {
46
+ export declare function MarkdownEditor({ className, presence, preview, style, theme, ...editorProps }: MarkdownEditorProps): import("react").JSX.Element;
47
+ export interface SpreadsheetEditorProps extends Omit<InternalSpreadsheetEditorProps, 'preview'>, OfficeSurfaceProps, OfficeCollaborationSurfaceProps {
42
48
  preview?: boolean;
43
49
  }
44
- export declare function SpreadsheetEditor({ className, kernelWasmUrl, preview, style, theme, ...editorProps }: SpreadsheetEditorProps): import("react").JSX.Element;
45
- export interface PresentationEditorProps extends Omit<InternalPresentationEditorProps, 'preview'>, OfficeSurfaceProps {
50
+ export declare function SpreadsheetEditor({ className, kernelWasmUrl, presence, preview, style, theme, ...editorProps }: SpreadsheetEditorProps): import("react").JSX.Element;
51
+ export interface PresentationEditorProps extends Omit<InternalPresentationEditorProps, 'preview'>, OfficeSurfaceProps, OfficeCollaborationSurfaceProps {
46
52
  preview?: boolean;
47
53
  }
48
- export declare function PresentationEditor({ className, kernelWasmUrl, preview, style, theme, ...editorProps }: PresentationEditorProps): import("react").JSX.Element;
49
- export interface PdfViewerProps extends InternalPdfViewerProps, OfficeSurfaceProps {
54
+ export declare function PresentationEditor({ className, kernelWasmUrl, presence, preview, style, theme, ...editorProps }: PresentationEditorProps): import("react").JSX.Element;
55
+ export interface PdfViewerProps extends InternalPdfViewerProps, OfficeSurfaceProps, OfficeCollaborationSurfaceProps {
50
56
  }
51
- export declare function PdfViewer({ className, style, theme, wasmUrl, ...viewerProps }: PdfViewerProps): import("react").JSX.Element;
57
+ export declare function PdfViewer({ className, presence, style, theme, wasmUrl, ...viewerProps }: PdfViewerProps): import("react").JSX.Element;
package/dist/react.js CHANGED
@@ -1 +1 @@
1
- export { DocumentEditor, MarkdownEditor, PdfViewer, PresentationEditor, SpreadsheetEditor, defaultDocumentArabicLayoutFontUrl, defaultDocumentHebrewLayoutFontUrl, defaultDocumentLatinLayoutFontUrl, defaultDocumentLayoutFontUrl, defaultDocumentLayoutFonts, defaultOfficeKernelWasmUrl, defaultPdfiumWasmUrl, preloadOfficeEditor } from "./432.js";
1
+ export { DocumentEditor, MarkdownEditor, PDF_EVIDENCE_COORDINATE_BASIS, PdfViewer, PresentationEditor, SpreadsheetEditor, defaultDocumentArabicLayoutFontUrl, defaultDocumentHebrewLayoutFontUrl, defaultDocumentLatinLayoutFontUrl, defaultDocumentLayoutFontUrl, defaultDocumentLayoutFonts, defaultOfficeKernelWasmUrl, defaultPdfiumWasmUrl, preloadOfficeEditor } from "./432.js";