@stll/folio-core 0.45.0 → 0.47.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 (451) hide show
  1. package/dist/ai-edits/apply.js +85 -43
  2. package/dist/ai-edits/headless.js +2 -2
  3. package/dist/ai-edits/read.d.ts +1 -0
  4. package/dist/ai-edits/read.js +1 -0
  5. package/dist/ai-edits/snapshot.js +32 -27
  6. package/dist/ai-edits/table-cell-mutations.js +15 -7
  7. package/dist/ai-edits/table-geometry.js +21 -18
  8. package/dist/ai-edits/table-template.js +2 -2
  9. package/dist/compare/compare.js +2 -5
  10. package/dist/compare/content-alignment.js +108 -12
  11. package/dist/compare/content-types.d.ts +8 -2
  12. package/dist/compare/content.js +2 -11
  13. package/dist/compare/plan.js +7 -4
  14. package/dist/compare/scenario.js +2 -5
  15. package/dist/compare/section-boundary-properties.js +1 -2
  16. package/dist/compare/types.d.ts +9 -1
  17. package/dist/compare/types.js +12 -1
  18. package/dist/compat/eigenpal.d.ts +2 -1
  19. package/dist/compat/eigenpal.js +2 -1
  20. package/dist/content-controls/checkboxDisplay.d.ts +17 -0
  21. package/dist/content-controls/checkboxDisplay.js +46 -0
  22. package/dist/content-controls/findContentControls.js +3 -1
  23. package/dist/content-controls/mutateContentControls.js +57 -43
  24. package/dist/controller/contentControlWidgetController.d.ts +1 -0
  25. package/dist/controller/contentControlWidgetController.js +3 -0
  26. package/dist/controller/hiddenEditorApi.js +3 -1
  27. package/dist/controller/hiddenEditorManager.d.ts +1 -1
  28. package/dist/controller/hiddenEditorManager.js +6 -3
  29. package/dist/controller/layoutPipeline.js +8 -3
  30. package/dist/display-list/build/buildDisplayList.js +20 -1
  31. package/dist/display-list/build/imagePrimitives.d.ts +4 -4
  32. package/dist/display-list/build/imagePrimitives.js +38 -18
  33. package/dist/display-list/build/pageBorderPrimitives.js +2 -1
  34. package/dist/display-list/build/paragraphPrimitives.js +113 -14
  35. package/dist/display-list/build/previewPrimitives.d.ts +10 -0
  36. package/dist/display-list/build/previewPrimitives.js +89 -0
  37. package/dist/display-list/build/strokes.d.ts +177 -8
  38. package/dist/display-list/build/strokes.js +167 -47
  39. package/dist/display-list/build/tablePrimitives.js +4 -2
  40. package/dist/display-list/build/textBoxPrimitives.js +6 -4
  41. package/dist/display-list/build/textDecorations.d.ts +15 -1
  42. package/dist/display-list/build/textDecorations.js +15 -1
  43. package/dist/display-list/dom/renderDisplayListToDom.js +11 -21
  44. package/dist/display-list/primitives.d.ts +13 -2
  45. package/dist/display-list/primitives.js +36 -1
  46. package/dist/display-list/types.d.ts +17 -0
  47. package/dist/document-operations.js +2 -1
  48. package/dist/docx/attributeRemainder.d.ts +76 -0
  49. package/dist/docx/attributeRemainder.js +111 -0
  50. package/dist/docx/blockContentParser.d.ts +3 -1
  51. package/dist/docx/blockContentParser.js +102 -106
  52. package/dist/docx/blockPlainText.d.ts +3 -4
  53. package/dist/docx/blockPlainText.js +3 -0
  54. package/dist/docx/borderParser.js +26 -11
  55. package/dist/docx/builtInStyles.d.ts +8 -16
  56. package/dist/docx/builtInStyles.js +54 -17
  57. package/dist/docx/commentAnchorIndex.d.ts +30 -0
  58. package/dist/docx/commentAnchorIndex.js +50 -0
  59. package/dist/docx/commentParser.d.ts +1 -1
  60. package/dist/docx/commentParser.js +56 -39
  61. package/dist/docx/commentRangeIntegrity.d.ts +16 -1
  62. package/dist/docx/commentRangeIntegrity.js +42 -1
  63. package/dist/docx/commentRangeJoin.d.ts +9 -0
  64. package/dist/docx/commentRangeJoin.js +33 -0
  65. package/dist/docx/commentReferenceCompletion.d.ts +9 -0
  66. package/dist/docx/commentReferenceCompletion.js +47 -0
  67. package/dist/docx/commentReferenceNormalization.js +3 -1
  68. package/dist/docx/commentReplyMarkers.js +11 -19
  69. package/dist/docx/compatibility.js +56 -41
  70. package/dist/docx/containerChildren.d.ts +208 -0
  71. package/dist/docx/containerChildren.gen.d.ts +43 -0
  72. package/dist/docx/containerChildren.gen.js +263 -0
  73. package/dist/docx/containerChildren.js +153 -0
  74. package/dist/docx/diagramPreview.d.ts +14 -2
  75. package/dist/docx/diagramPreview.js +81 -169
  76. package/dist/docx/documentParser.d.ts +1 -1
  77. package/dist/docx/documentParser.js +7 -4
  78. package/dist/docx/drawingAnchor.d.ts +87 -0
  79. package/dist/docx/drawingAnchor.js +201 -0
  80. package/dist/docx/drawingUtils.d.ts +43 -38
  81. package/dist/docx/drawingUtils.js +205 -118
  82. package/dist/docx/ensureParaIds.js +17 -7
  83. package/dist/docx/fieldParser.d.ts +1 -1
  84. package/dist/docx/fieldParser.js +4 -4
  85. package/dist/docx/fieldState.d.ts +26 -0
  86. package/dist/docx/fieldState.js +53 -0
  87. package/dist/docx/fontTableParser.js +102 -41
  88. package/dist/docx/footnoteParser.d.ts +1 -1
  89. package/dist/docx/footnoteParser.js +10 -6
  90. package/dist/docx/graphicFrameLocks.d.ts +16 -4
  91. package/dist/docx/graphicFrameLocks.js +19 -6
  92. package/dist/docx/groupDrawingParser.js +4 -3
  93. package/dist/docx/headerFooterParser.js +1 -1
  94. package/dist/docx/headerFooterReferenceNormalization.js +1 -0
  95. package/dist/docx/hyperlinkParser.d.ts +66 -9
  96. package/dist/docx/hyperlinkParser.js +153 -26
  97. package/dist/docx/imageParser.js +160 -115
  98. package/dist/docx/index.d.ts +2 -1
  99. package/dist/docx/index.js +2 -1
  100. package/dist/docx/inlineContentRemovals.d.ts +28 -0
  101. package/dist/docx/inlineContentRemovals.js +46 -0
  102. package/dist/docx/inlineWrapperContent.d.ts +166 -0
  103. package/dist/docx/inlineWrapperContent.js +165 -0
  104. package/dist/docx/inlineWrapperParser.d.ts +11 -0
  105. package/dist/docx/inlineWrapperParser.js +60 -0
  106. package/dist/docx/nonVisualDrawingProps.d.ts +5 -13
  107. package/dist/docx/normalizeBaseDirection.js +12 -1
  108. package/dist/docx/numberingParser.d.ts +25 -2
  109. package/dist/docx/numberingParser.js +264 -361
  110. package/dist/docx/numberingReference.d.ts +9 -16
  111. package/dist/docx/numberingReference.js +17 -16
  112. package/dist/docx/numberingReferenceNormalization.js +7 -7
  113. package/dist/docx/ooxmlCounterFormatter.d.ts +1 -1
  114. package/dist/docx/ooxmlCounterFormatter.js +4 -1
  115. package/dist/docx/paraIdAttribute.d.ts +111 -0
  116. package/dist/docx/paraIdAttribute.js +142 -0
  117. package/dist/docx/paragraphParser.d.ts +10 -25
  118. package/dist/docx/paragraphParser.js +421 -496
  119. package/dist/docx/paragraphProperties.d.ts +23 -0
  120. package/dist/docx/paragraphProperties.js +279 -0
  121. package/dist/docx/paragraphPropertySource.js +7 -1
  122. package/dist/docx/paragraphTextBoxEnrichment.d.ts +3 -2
  123. package/dist/docx/paragraphTextBoxEnrichment.js +20 -59
  124. package/dist/docx/paragraphTraversal.d.ts +14 -10
  125. package/dist/docx/paragraphTraversal.js +53 -52
  126. package/dist/docx/parseWarningMessage.js +5 -1
  127. package/dist/docx/parserEnums.d.ts +6 -8
  128. package/dist/docx/parserEnums.js +4 -6
  129. package/dist/docx/preservedRunContent.d.ts +32 -0
  130. package/dist/docx/preservedRunContent.js +96 -0
  131. package/dist/docx/previewBudget.d.ts +44 -23
  132. package/dist/docx/previewBudget.js +61 -30
  133. package/dist/docx/propertyElementAttributes.d.ts +178 -0
  134. package/dist/docx/propertyElementAttributes.js +114 -0
  135. package/dist/docx/renderedPageBreakNormalization.js +4 -6
  136. package/dist/docx/rezip.d.ts +28 -2
  137. package/dist/docx/rezip.js +152 -27
  138. package/dist/docx/runConsolidator.d.ts +42 -2
  139. package/dist/docx/runConsolidator.js +60 -6
  140. package/dist/docx/runParser.d.ts +55 -19
  141. package/dist/docx/runParser.js +394 -306
  142. package/dist/docx/runPayload.d.ts +5 -0
  143. package/dist/docx/runPayload.js +4 -0
  144. package/dist/docx/sdtProperties.d.ts +39 -5
  145. package/dist/docx/sdtProperties.js +205 -84
  146. package/dist/docx/sdtPropertiesPatch.d.ts +5 -9
  147. package/dist/docx/sdtPropertiesPatch.js +68 -112
  148. package/dist/docx/sectionParser.d.ts +1 -2
  149. package/dist/docx/sectionParser.js +241 -238
  150. package/dist/docx/selectiveSave.js +3 -2
  151. package/dist/docx/selectiveXmlPatch.d.ts +66 -3
  152. package/dist/docx/selectiveXmlPatch.js +276 -133
  153. package/dist/docx/serializer/blockSdtSerializer.js +2 -96
  154. package/dist/docx/serializer/borderSerializer.d.ts +5 -5
  155. package/dist/docx/serializer/borderSerializer.js +12 -10
  156. package/dist/docx/serializer/commentSerializer.js +5 -7
  157. package/dist/docx/serializer/documentSerializer.js +11 -11
  158. package/dist/docx/serializer/fontTableSerializer.js +31 -3
  159. package/dist/docx/serializer/headerFooterSerializer.js +10 -9
  160. package/dist/docx/serializer/markupRangeAttributes.d.ts +9 -1
  161. package/dist/docx/serializer/markupRangeAttributes.js +9 -1
  162. package/dist/docx/serializer/noteSerializer.js +11 -8
  163. package/dist/docx/serializer/numberingSerializer.d.ts +1 -6
  164. package/dist/docx/serializer/numberingSerializer.js +81 -79
  165. package/dist/docx/serializer/paragraphSerializer.d.ts +1 -9
  166. package/dist/docx/serializer/paragraphSerializer.js +156 -236
  167. package/dist/docx/serializer/runSerializer.d.ts +1 -5
  168. package/dist/docx/serializer/runSerializer.js +134 -75
  169. package/dist/docx/serializer/sdtPropertiesSerializer.d.ts +26 -0
  170. package/dist/docx/serializer/sdtPropertiesSerializer.js +111 -0
  171. package/dist/docx/serializer/sectionPropertiesSerializer.js +42 -49
  172. package/dist/docx/serializer/settingsSerializer.js +6 -4
  173. package/dist/docx/serializer/stylesSerializer.js +8 -11
  174. package/dist/docx/serializer/tableSerializer.js +283 -105
  175. package/dist/docx/serializer/textFormattingSerializer.d.ts +28 -4
  176. package/dist/docx/serializer/textFormattingSerializer.js +111 -101
  177. package/dist/docx/serializer/xmlUtils.d.ts +1 -1
  178. package/dist/docx/serializer/xmlUtils.js +1 -1
  179. package/dist/docx/server/createBilingualDocument.js +20 -16
  180. package/dist/docx/server/materializeYjsDocx.d.ts +1 -1
  181. package/dist/docx/server/materializeYjsDocx.js +9 -1
  182. package/dist/docx/server/migrateYjsAttrSchema.d.ts +55 -0
  183. package/dist/docx/server/migrateYjsAttrSchema.js +95 -0
  184. package/dist/docx/settingsParser.js +7 -4
  185. package/dist/docx/shadingParser.d.ts +2 -1
  186. package/dist/docx/shadingParser.js +43 -7
  187. package/dist/docx/shapeParser.js +13 -8
  188. package/dist/docx/strictNames.d.ts +11 -0
  189. package/dist/docx/strictNames.gen.d.ts +45 -0
  190. package/dist/docx/strictNames.gen.js +50 -0
  191. package/dist/docx/strictNames.js +43 -0
  192. package/dist/docx/strictValueEncodings.gen.js +133 -131
  193. package/dist/docx/styleParser.js +17 -349
  194. package/dist/docx/tableParser.d.ts +11 -2
  195. package/dist/docx/tableParser.js +665 -220
  196. package/dist/docx/textBoxParser.d.ts +28 -3
  197. package/dist/docx/textBoxParser.js +69 -9
  198. package/dist/docx/themeColorAttribute.d.ts +13 -0
  199. package/dist/docx/themeColorAttribute.js +24 -0
  200. package/dist/docx/trackedMoveRangeNormalization.js +2 -1
  201. package/dist/docx/unzip.js +5 -4
  202. package/dist/docx/vmlImageParser.d.ts +30 -5
  203. package/dist/docx/vmlImageParser.js +91 -32
  204. package/dist/docx/vmlPreview.js +2 -2
  205. package/dist/docx/wrapPolygon.d.ts +30 -0
  206. package/dist/docx/wrapPolygon.js +70 -0
  207. package/dist/docx/xmlEncoding.d.ts +5 -0
  208. package/dist/docx/xmlEncoding.js +12 -0
  209. package/dist/docx/xmlParser.d.ts +23 -1
  210. package/dist/docx/xmlParser.js +31 -2
  211. package/dist/fonts/embeddedFonts.js +3 -3
  212. package/dist/headless-layout.js +12 -1
  213. package/dist/i18n/messages/catalogs.gen.d.ts +68 -0
  214. package/dist/i18n/messages/catalogs.gen.js +102 -34
  215. package/dist/i18n/messages/messages.gen.d.ts +4 -0
  216. package/dist/index.d.ts +2 -1
  217. package/dist/index.js +2 -1
  218. package/dist/internal/headlessRevisionResolution.js +9 -0
  219. package/dist/internal/pageBreakRunSourceDescendantIndex.js +7 -2
  220. package/dist/internal/paragraphFormattingSerialization.d.ts +20 -9
  221. package/dist/internal/paragraphFormattingSerialization.js +118 -83
  222. package/dist/layout-bridge/convert/footnoteLayout.d.ts +1 -0
  223. package/dist/layout-bridge/convert/footnoteLayout.js +1 -0
  224. package/dist/layout-bridge/convert/headerFooterLayout.d.ts +1 -0
  225. package/dist/layout-bridge/convert/headerFooterLayout.js +2 -0
  226. package/dist/layout-bridge/convert/toFlowBlocks.d.ts +17 -12
  227. package/dist/layout-bridge/convert/toFlowBlocks.js +267 -101
  228. package/dist/layout-engine/index.d.ts +2 -2
  229. package/dist/layout-engine/index.js +53 -17
  230. package/dist/layout-engine/measure/measureBlocks.d.ts +3 -0
  231. package/dist/layout-engine/measure/measureBlocks.js +6 -10
  232. package/dist/layout-engine/measure/tableCellFloating.d.ts +2 -0
  233. package/dist/layout-engine/measure/tableCellFloating.js +2 -0
  234. package/dist/layout-engine/measure/tableCellGrid.js +2 -1
  235. package/dist/layout-engine/measure/tableFragmentBorderGeometry.js +2 -1
  236. package/dist/layout-engine/measure/tableInlinePlacement.js +2 -5
  237. package/dist/layout-engine/paragraphSequence.js +3 -2
  238. package/dist/layout-engine/renderedBreakReconciliation.js +2 -1
  239. package/dist/layout-engine/section-breaks.d.ts +49 -2
  240. package/dist/layout-engine/section-breaks.js +55 -4
  241. package/dist/layout-engine/types.d.ts +69 -17
  242. package/dist/layout-engine/types.js +16 -1
  243. package/dist/layout-painter/borderStroke.d.ts +18 -4
  244. package/dist/layout-painter/renderImage.d.ts +5 -1
  245. package/dist/layout-painter/renderImage.js +10 -3
  246. package/dist/layout-painter/renderPage.d.ts +2 -0
  247. package/dist/layout-painter/renderPage.js +10 -4
  248. package/dist/layout-painter/renderParagraph.d.ts +14 -1
  249. package/dist/layout-painter/renderParagraph.js +34 -28
  250. package/dist/layout-painter/renderTable.d.ts +4 -1
  251. package/dist/layout-painter/renderTable.js +22 -22
  252. package/dist/layout-painter/renderTextBox.js +5 -3
  253. package/dist/managers/autoSaveCodec.d.ts +9 -1
  254. package/dist/managers/autoSaveCodec.js +12 -4
  255. package/dist/markdown/renderBlock.js +3 -0
  256. package/dist/markdown/renderRuns.d.ts +1 -1
  257. package/dist/markdown/renderRuns.js +34 -6
  258. package/dist/markdown/renderTable.js +24 -6
  259. package/dist/markdown/trailers.js +4 -1
  260. package/dist/model.d.ts +3 -3
  261. package/dist/model.js +2 -2
  262. package/dist/paged-layout/sectionBlockWidths.d.ts +3 -0
  263. package/dist/paged-layout/sectionBlockWidths.js +26 -4
  264. package/dist/pdf/images.js +142 -6
  265. package/dist/prosemirror/attrs/index.d.ts +34 -5
  266. package/dist/prosemirror/attrs/index.js +639 -48
  267. package/dist/prosemirror/authoredTransformAttrs.d.ts +28 -0
  268. package/dist/prosemirror/authoredTransformAttrs.js +64 -0
  269. package/dist/prosemirror/bookmarkBoundaryAttrs.d.ts +9 -1
  270. package/dist/prosemirror/bookmarkBoundaryAttrs.js +22 -3
  271. package/dist/prosemirror/commands/comments.js +68 -53
  272. package/dist/prosemirror/commands/contentControls.js +33 -20
  273. package/dist/prosemirror/commands/image.d.ts +10 -3
  274. package/dist/prosemirror/commands/image.js +46 -29
  275. package/dist/prosemirror/commands/pageBreak.js +1 -1
  276. package/dist/prosemirror/commands/paragraph.d.ts +2 -1
  277. package/dist/prosemirror/commands/propertyChangeScope.d.ts +12 -4
  278. package/dist/prosemirror/commands/propertyChangeScope.js +22 -4
  279. package/dist/prosemirror/commands/sectionBreak.d.ts +33 -1
  280. package/dist/prosemirror/commands/sectionBreak.js +187 -11
  281. package/dist/prosemirror/commentReferenceAttrs.d.ts +8 -0
  282. package/dist/prosemirror/commentReferenceAttrs.js +33 -0
  283. package/dist/prosemirror/commentReferenceIntegrity.d.ts +47 -0
  284. package/dist/prosemirror/commentReferenceIntegrity.js +43 -0
  285. package/dist/prosemirror/conversion/fromProseDoc.d.ts +17 -12
  286. package/dist/prosemirror/conversion/fromProseDoc.js +553 -207
  287. package/dist/prosemirror/conversion/index.d.ts +2 -2
  288. package/dist/prosemirror/conversion/preservedSinkCarriers.d.ts +39 -0
  289. package/dist/prosemirror/conversion/preservedSinkCarriers.js +19 -0
  290. package/dist/prosemirror/conversion/runShadingMark.js +14 -1
  291. package/dist/prosemirror/conversion/sdtAttrs.d.ts +10 -1
  292. package/dist/prosemirror/conversion/sdtAttrs.js +19 -5
  293. package/dist/prosemirror/conversion/toProseDoc.d.ts +7 -9
  294. package/dist/prosemirror/conversion/toProseDoc.js +801 -411
  295. package/dist/prosemirror/emptyRangeAnchor.d.ts +53 -0
  296. package/dist/prosemirror/emptyRangeAnchor.js +158 -0
  297. package/dist/prosemirror/extensions/StarterKit.js +14 -58
  298. package/dist/prosemirror/extensions/core/DocExtension.js +1 -1
  299. package/dist/prosemirror/extensions/core/ParagraphExtension.js +21 -16
  300. package/dist/prosemirror/extensions/features/BaseKeymapExtension.js +48 -29
  301. package/dist/prosemirror/extensions/features/EmptyParagraphFormatExtension.js +3 -1
  302. package/dist/prosemirror/extensions/features/ImagePasteExtension.js +5 -3
  303. package/dist/prosemirror/extensions/features/ListExtension.js +43 -24
  304. package/dist/prosemirror/extensions/features/ParaIdAllocatorExtension.js +1 -0
  305. package/dist/prosemirror/extensions/features/ParagraphChangeTrackerExtension.js +4 -3
  306. package/dist/prosemirror/extensions/features/PasteCleanupExtension.d.ts +3 -3
  307. package/dist/prosemirror/extensions/features/PasteCleanupExtension.js +5 -5
  308. package/dist/prosemirror/extensions/features/pasteCleanup.d.ts +3 -1
  309. package/dist/prosemirror/extensions/features/pasteCleanup.js +56 -2
  310. package/dist/prosemirror/extensions/features/pastedHeadingStyles.js +5 -4
  311. package/dist/prosemirror/extensions/markRegistry.d.ts +65 -0
  312. package/dist/prosemirror/extensions/markRegistry.js +138 -0
  313. package/dist/prosemirror/extensions/marks/InlineWrapperExtension.d.ts +18 -0
  314. package/dist/prosemirror/extensions/marks/InlineWrapperExtension.js +77 -0
  315. package/dist/prosemirror/extensions/marks/RunIdentityExtension.d.ts +26 -0
  316. package/dist/prosemirror/extensions/marks/RunIdentityExtension.js +134 -0
  317. package/dist/prosemirror/extensions/marks/TrackedChangeExtensions.js +2 -1
  318. package/dist/prosemirror/extensions/marks/UnderlineExtension.js +12 -18
  319. package/dist/prosemirror/extensions/marks/markUtils.d.ts +2 -1
  320. package/dist/prosemirror/extensions/marks/markUtils.js +49 -5
  321. package/dist/prosemirror/extensions/nodes/BlockBookmarkBoundaryExtension.d.ts +29 -0
  322. package/dist/prosemirror/extensions/nodes/BlockBookmarkBoundaryExtension.js +46 -0
  323. package/dist/prosemirror/extensions/nodes/BlockSdtExtension.d.ts +4 -3
  324. package/dist/prosemirror/extensions/nodes/BlockSdtExtension.js +18 -13
  325. package/dist/prosemirror/extensions/nodes/BookmarkBoundaryExtension.js +28 -53
  326. package/dist/prosemirror/extensions/nodes/CommentReferenceExtension.d.ts +11 -0
  327. package/dist/prosemirror/extensions/nodes/CommentReferenceExtension.js +97 -0
  328. package/dist/prosemirror/extensions/nodes/FieldExtension.js +9 -7
  329. package/dist/prosemirror/extensions/nodes/ImageExtension.js +24 -1
  330. package/dist/prosemirror/extensions/nodes/MoveRangeBoundaryExtension.d.ts +11 -0
  331. package/dist/prosemirror/extensions/nodes/MoveRangeBoundaryExtension.js +43 -0
  332. package/dist/prosemirror/extensions/nodes/PreservedBlockExtension.d.ts +32 -0
  333. package/dist/prosemirror/extensions/nodes/PreservedBlockExtension.js +67 -0
  334. package/dist/prosemirror/extensions/nodes/PreservedXmlExtension.d.ts +16 -0
  335. package/dist/prosemirror/extensions/nodes/PreservedXmlExtension.js +60 -0
  336. package/dist/prosemirror/extensions/nodes/RangeAnchorExtension.d.ts +13 -0
  337. package/dist/prosemirror/extensions/nodes/RangeAnchorExtension.js +65 -0
  338. package/dist/prosemirror/extensions/nodes/SdtExtension.d.ts +3 -1
  339. package/dist/prosemirror/extensions/nodes/SdtExtension.js +22 -16
  340. package/dist/prosemirror/extensions/nodes/ShapeExtension.js +7 -0
  341. package/dist/prosemirror/extensions/nodes/TableExtension.js +142 -123
  342. package/dist/prosemirror/extensions/nodes/TextBoxExtension.js +9 -1
  343. package/dist/prosemirror/extensions/nodes/bookmarkBoundaryDom.d.ts +23 -0
  344. package/dist/prosemirror/extensions/nodes/bookmarkBoundaryDom.js +57 -0
  345. package/dist/prosemirror/extensions/types.d.ts +12 -3
  346. package/dist/prosemirror/index.d.ts +4 -2
  347. package/dist/prosemirror/index.js +2 -1
  348. package/dist/prosemirror/inlineWrapperStack.d.ts +39 -0
  349. package/dist/prosemirror/inlineWrapperStack.js +92 -0
  350. package/dist/prosemirror/listMarker.d.ts +2 -2
  351. package/dist/prosemirror/listMarker.js +7 -8
  352. package/dist/prosemirror/listRenderingAttrs.js +11 -1
  353. package/dist/prosemirror/listState.d.ts +62 -0
  354. package/dist/prosemirror/listState.js +49 -0
  355. package/dist/prosemirror/moveRangeBoundaryAttrs.d.ts +13 -0
  356. package/dist/prosemirror/moveRangeBoundaryAttrs.js +114 -0
  357. package/dist/prosemirror/numberedRefFields.js +4 -4
  358. package/dist/prosemirror/numberingAttr.d.ts +55 -0
  359. package/dist/prosemirror/numberingAttr.js +74 -0
  360. package/dist/prosemirror/outlineLevelAttr.d.ts +29 -0
  361. package/dist/prosemirror/outlineLevelAttr.js +42 -0
  362. package/dist/prosemirror/pageBreakRunProjection.d.ts +17 -7
  363. package/dist/prosemirror/pageBreakRunProjection.js +19 -9
  364. package/dist/prosemirror/paragraphFormattingProvenance.d.ts +9 -0
  365. package/dist/prosemirror/paragraphFormattingProvenance.js +4 -1
  366. package/dist/prosemirror/plugins/selectionTracker.d.ts +3 -6
  367. package/dist/prosemirror/plugins/selectionTracker.js +3 -10
  368. package/dist/prosemirror/rangeAnchorAttrs.d.ts +14 -0
  369. package/dist/prosemirror/rangeAnchorAttrs.js +101 -0
  370. package/dist/prosemirror/replacedAnnotations.d.ts +59 -0
  371. package/dist/prosemirror/replacedAnnotations.js +183 -0
  372. package/dist/prosemirror/revisionCarriers.d.ts +86 -2
  373. package/dist/prosemirror/revisionCarriers.js +86 -60
  374. package/dist/prosemirror/runFormattingInlineCarriers.d.ts +5 -1
  375. package/dist/prosemirror/runFormattingInlineCarriers.js +7 -1
  376. package/dist/prosemirror/runIdentity.d.ts +28 -0
  377. package/dist/prosemirror/runIdentity.js +36 -0
  378. package/dist/prosemirror/runStyleFormatting.js +1 -1
  379. package/dist/prosemirror/schema/index.d.ts +3 -3
  380. package/dist/prosemirror/schema/marks.d.ts +47 -4
  381. package/dist/prosemirror/schema/nodes.d.ts +309 -26
  382. package/dist/prosemirror/schema/nodes.js +16 -1
  383. package/dist/prosemirror/sectionCarrier.d.ts +37 -0
  384. package/dist/prosemirror/sectionCarrier.js +40 -0
  385. package/dist/prosemirror/selectionState.d.ts +3 -0
  386. package/dist/prosemirror/selectionState.js +4 -1
  387. package/dist/prosemirror/styles/resolvedStyleAttrs.d.ts +5 -4
  388. package/dist/prosemirror/styles/resolvedStyleAttrs.js +15 -13
  389. package/dist/prosemirror/tableResize.js +5 -6
  390. package/dist/prosemirror/trackedRunInlineAtoms.d.ts +4 -0
  391. package/dist/prosemirror/trackedRunInlineAtoms.js +4 -0
  392. package/dist/prosemirror/utils/extractTrackedChanges.d.ts +10 -11
  393. package/dist/prosemirror/utils/extractTrackedChanges.js +109 -92
  394. package/dist/prosemirror/validation.js +31 -6
  395. package/dist/prosemirror/yjsDocumentMetadata.d.ts +73 -0
  396. package/dist/prosemirror/yjsDocumentMetadata.js +592 -0
  397. package/dist/prosemirror/zeroWidthAnchors.js +6 -0
  398. package/dist/render-dom/commentAnchorAttributes.d.ts +37 -0
  399. package/dist/render-dom/commentAnchorAttributes.js +54 -0
  400. package/dist/server.d.ts +3 -1
  401. package/dist/server.js +3 -1
  402. package/dist/style-sets/extract.js +4 -4
  403. package/dist/style-sets/stellaStyle.js +36 -23
  404. package/dist/types/colors.d.ts +2 -2
  405. package/dist/types/content.d.ts +2 -2
  406. package/dist/types/documentEnumValues.d.ts +53 -26
  407. package/dist/types/documentEnumValues.js +72 -174
  408. package/dist/types/formatting.d.ts +2 -2
  409. package/dist/types/index.d.ts +9 -2
  410. package/dist/utils/borderCss.d.ts +246 -0
  411. package/dist/utils/borderCss.js +325 -0
  412. package/dist/utils/clipboard.d.ts +9 -1
  413. package/dist/utils/clipboard.js +27 -1
  414. package/dist/utils/colorResolver.d.ts +4 -3
  415. package/dist/utils/colorResolver.js +45 -76
  416. package/dist/utils/createDocument.js +24 -6
  417. package/dist/utils/findReplace.js +52 -10
  418. package/dist/utils/formatToStyle.d.ts +84 -2
  419. package/dist/utils/formatToStyle.js +133 -52
  420. package/dist/utils/headingCollector.js +3 -2
  421. package/dist/utils/imageLuminance.d.ts +15 -0
  422. package/dist/utils/imageLuminance.js +32 -0
  423. package/dist/utils/mergeDocumentContent.js +12 -20
  424. package/dist/utils/paragraphFormattingMerge.js +27 -6
  425. package/dist/utils/replaceText.js +1 -0
  426. package/dist/utils/tableOperations.d.ts +5 -3
  427. package/dist/utils/tableOperations.js +14 -1
  428. package/dist/utils/tablePlacement.d.ts +7 -0
  429. package/dist/utils/tablePlacement.js +14 -0
  430. package/dist/utils/textDirectionFlow.d.ts +15 -0
  431. package/dist/utils/textDirectionFlow.js +38 -0
  432. package/dist/utils/textFormattingMerge.js +16 -4
  433. package/package.json +10 -10
  434. package/dist/ai-edits/__fixtures__/paragraphs.d.ts +0 -17
  435. package/dist/ai-edits/__fixtures__/paragraphs.js +0 -33
  436. package/dist/compare/__fixtures__/body-sequence.d.ts +0 -119
  437. package/dist/compare/__fixtures__/body-sequence.js +0 -225
  438. package/dist/compare/__fixtures__/nested-table.d.ts +0 -16
  439. package/dist/compare/__fixtures__/nested-table.js +0 -50
  440. package/dist/compare/__fixtures__/numbered-list.d.ts +0 -34
  441. package/dist/compare/__fixtures__/numbered-list.js +0 -85
  442. package/dist/docx/blockRangeMarkers.d.ts +0 -36
  443. package/dist/docx/blockRangeMarkers.js +0 -59
  444. package/dist/docx/bookmarkPlacement.d.ts +0 -9
  445. package/dist/docx/bookmarkPlacement.js +0 -50
  446. package/dist/fonts/embeddedFontTable.d.ts +0 -45
  447. package/dist/fonts/embeddedFontTable.js +0 -80
  448. package/dist/prosemirror/extensions/marks/PageBreakRunOwnerExtension.d.ts +0 -13
  449. package/dist/prosemirror/extensions/marks/PageBreakRunOwnerExtension.js +0 -39
  450. package/dist/prosemirror/yjsParagraphSourceContract.d.ts +0 -9
  451. package/dist/prosemirror/yjsParagraphSourceContract.js +0 -26
@@ -1,8 +1,11 @@
1
1
  import { HIGHLIGHT_COLOR_VALUES } from "../../types/documentEnumValues.js";
2
2
  import { isValidHexColor } from "../../utils/colorResolver.js";
3
3
  import { roundHorizontalScalePercentForSerialization } from "../../utils/horizontalScale.js";
4
+ import { serializePreservedAttributes } from "../attributeRemainder.js";
4
5
  import { intAttr } from "./xmlUtils.js";
5
- import { escapeXmlAttribute } from "@stll/docx-core";
6
+ import { escapeXmlAttribute, serializeOnOffElement } from "@stll/docx-core";
7
+ import { themeColorToken } from "@stll/docx-core/model";
8
+ import { serializeSequenceChildren } from "@stll/docx-core/schema";
6
9
  //#region src/docx/serializer/textFormattingSerializer.ts
7
10
  const VALID_HIGHLIGHT_COLORS = new Set(HIGHLIGHT_COLOR_VALUES);
8
11
  /**
@@ -14,7 +17,7 @@ function serializeColorElement(color) {
14
17
  const attrs = [];
15
18
  if (auto) attrs.push("w:val=\"auto\"");
16
19
  else if (rgb && isValidHexColor(rgb)) attrs.push(`w:val="${escapeXmlAttribute(rgb)}"`);
17
- if (themeColor) attrs.push(`w:themeColor="${escapeXmlAttribute(themeColor)}"`);
20
+ if (themeColor) attrs.push(`w:themeColor="${escapeXmlAttribute(themeColorToken(themeColor))}"`);
18
21
  if (themeTint) attrs.push(`w:themeTint="${escapeXmlAttribute(themeTint)}"`);
19
22
  if (themeShade) attrs.push(`w:themeShade="${escapeXmlAttribute(themeShade)}"`);
20
23
  return attrs.length === 0 ? "" : `<w:color ${attrs.join(" ")}/>`;
@@ -24,122 +27,129 @@ function serializeColorElement(color) {
24
27
  */
25
28
  function serializeShading(shading) {
26
29
  if (!shading) return "";
27
- const { pattern, color, fill } = shading;
30
+ const { pattern, color, fill, preservedAttributes } = shading;
28
31
  const attrs = [];
29
32
  if (pattern) attrs.push(`w:val="${escapeXmlAttribute(pattern)}"`);
30
33
  else attrs.push("w:val=\"clear\"");
31
34
  if (color) {
32
- const { rgb, auto, themeColor: _themeColor, themeTint: _themeTint, themeShade: _themeShade } = color;
35
+ const { rgb, auto, themeColor, themeTint, themeShade } = color;
33
36
  if (rgb && isValidHexColor(rgb)) attrs.push(`w:color="${escapeXmlAttribute(rgb)}"`);
34
37
  else if (auto) attrs.push("w:color=\"auto\"");
38
+ if (themeColor) attrs.push(`w:themeColor="${escapeXmlAttribute(themeColorToken(themeColor))}"`);
39
+ if (themeTint) attrs.push(`w:themeTint="${escapeXmlAttribute(themeTint)}"`);
40
+ if (themeShade) attrs.push(`w:themeShade="${escapeXmlAttribute(themeShade)}"`);
35
41
  }
36
42
  if (fill) {
37
43
  const { rgb, auto, themeColor, themeTint, themeShade } = fill;
38
44
  if (rgb && isValidHexColor(rgb)) attrs.push(`w:fill="${escapeXmlAttribute(rgb)}"`);
39
45
  else if (auto) attrs.push("w:fill=\"auto\"");
40
- if (themeColor) attrs.push(`w:themeFill="${escapeXmlAttribute(themeColor)}"`);
46
+ if (themeColor) attrs.push(`w:themeFill="${escapeXmlAttribute(themeColorToken(themeColor))}"`);
41
47
  if (themeTint) attrs.push(`w:themeFillTint="${escapeXmlAttribute(themeTint)}"`);
42
48
  if (themeShade) attrs.push(`w:themeFillShade="${escapeXmlAttribute(themeShade)}"`);
43
49
  }
44
- return attrs.length === 0 ? "" : `<w:shd ${attrs.join(" ")}/>`;
50
+ const written = serializePreservedAttributes(attrs, preservedAttributes);
51
+ return written.length === 0 ? "" : `<w:shd ${written.join(" ")}/>`;
45
52
  }
53
+ const numberTag = (name, value) => value === void 0 ? "" : `<w:${name} w:val="${intAttr(value)}"/>`;
54
+ const serializeFontFamily = (fontFamily) => {
55
+ if (!fontFamily) return "";
56
+ const { ascii, hAnsi, eastAsia, cs: complexScript, hint, asciiTheme, hAnsiTheme, eastAsiaTheme, csTheme } = fontFamily;
57
+ const attrs = [];
58
+ if (ascii) attrs.push(`w:ascii="${escapeXmlAttribute(ascii)}"`);
59
+ if (hAnsi) attrs.push(`w:hAnsi="${escapeXmlAttribute(hAnsi)}"`);
60
+ if (eastAsia) attrs.push(`w:eastAsia="${escapeXmlAttribute(eastAsia)}"`);
61
+ if (complexScript) attrs.push(`w:cs="${escapeXmlAttribute(complexScript)}"`);
62
+ if (hint) attrs.push(`w:hint="${escapeXmlAttribute(hint)}"`);
63
+ if (asciiTheme) attrs.push(`w:asciiTheme="${escapeXmlAttribute(asciiTheme)}"`);
64
+ if (hAnsiTheme) attrs.push(`w:hAnsiTheme="${escapeXmlAttribute(hAnsiTheme)}"`);
65
+ if (eastAsiaTheme) attrs.push(`w:eastAsiaTheme="${escapeXmlAttribute(eastAsiaTheme)}"`);
66
+ if (csTheme) attrs.push(`w:cstheme="${escapeXmlAttribute(csTheme)}"`);
67
+ return attrs.length === 0 ? "" : `<w:rFonts ${attrs.join(" ")}/>`;
68
+ };
69
+ const serializeUnderline = (underline) => {
70
+ if (!underline) return "";
71
+ const { style, color } = underline;
72
+ const attrs = [`w:val="${style}"`];
73
+ if (color) {
74
+ const { rgb, themeColor, themeTint, themeShade, auto: _auto } = color;
75
+ if (rgb && isValidHexColor(rgb)) attrs.push(`w:color="${escapeXmlAttribute(rgb)}"`);
76
+ if (themeColor) attrs.push(`w:themeColor="${escapeXmlAttribute(themeColorToken(themeColor))}"`);
77
+ if (themeTint) attrs.push(`w:themeTint="${escapeXmlAttribute(themeTint)}"`);
78
+ if (themeShade) attrs.push(`w:themeShade="${escapeXmlAttribute(themeShade)}"`);
79
+ }
80
+ return `<w:u ${attrs.join(" ")}/>`;
81
+ };
82
+ const serializeLanguage = (language) => {
83
+ if (!language) return "";
84
+ const { val, eastAsia, bidi } = language;
85
+ const attrs = [];
86
+ if (val) attrs.push(`w:val="${escapeXmlAttribute(val)}"`);
87
+ if (eastAsia) attrs.push(`w:eastAsia="${escapeXmlAttribute(eastAsia)}"`);
88
+ if (bidi) attrs.push(`w:bidi="${escapeXmlAttribute(bidi)}"`);
89
+ return attrs.length === 0 ? "" : `<w:lang ${attrs.join(" ")}/>`;
90
+ };
46
91
  /**
47
- * Serialize text formatting properties to w:rPr XML
92
+ * The single `w:rPr` writer.
93
+ *
94
+ * A run, the paragraph mark, a style, a numbering level and the snapshot
95
+ * inside either kind of `w:rPrChange` all write their run properties through
96
+ * here, so none of them can grow its own order or its own idea of which
97
+ * children exist. `EG_RPrBase` is an `xsd:choice` referenced
98
+ * `maxOccurs="unbounded"`, so a `w:rPr` in any order is valid and the order
99
+ * below is a canonical form rather than a validity rule: it is the one Word
100
+ * writes, and writing it from the generated declared-child list is what stops
101
+ * two of folio's serializers from disagreeing. The restatement is what
102
+ * drifted, and it is why folio wrote `w:vanish` before `w:noProof` while the
103
+ * schema declares the reverse.
104
+ *
105
+ * @param owned children a sibling record holds; see {@link OwnedRunPropertyChild}
48
106
  */
49
- function serializeTextFormatting(input) {
50
- if (!input) return "";
51
- const { bold, boldCs, italic, italicCs, underline, strike, doubleStrike, vertAlign, smallCaps, allCaps, hidden, noProof, color, highlight, shading, fontSize, fontSizeCs, fontFamily, language, spacing, position, scale, kerning, effect, emphasisMark, emboss, imprint, outline, shadow, rtl, cs, styleId } = input;
52
- const parts = [];
53
- if (styleId) parts.push(`<w:rStyle w:val="${escapeXmlAttribute(styleId)}"/>`);
54
- if (fontFamily) {
55
- const { ascii, hAnsi, eastAsia, cs: complexScript, hint, asciiTheme, hAnsiTheme, eastAsiaTheme, csTheme } = fontFamily;
56
- const fontAttrs = [];
57
- if (ascii) fontAttrs.push(`w:ascii="${escapeXmlAttribute(ascii)}"`);
58
- if (hAnsi) fontAttrs.push(`w:hAnsi="${escapeXmlAttribute(hAnsi)}"`);
59
- if (eastAsia) fontAttrs.push(`w:eastAsia="${escapeXmlAttribute(eastAsia)}"`);
60
- if (complexScript) fontAttrs.push(`w:cs="${escapeXmlAttribute(complexScript)}"`);
61
- if (hint) fontAttrs.push(`w:hint="${escapeXmlAttribute(hint)}"`);
62
- if (asciiTheme) fontAttrs.push(`w:asciiTheme="${escapeXmlAttribute(asciiTheme)}"`);
63
- if (hAnsiTheme) fontAttrs.push(`w:hAnsiTheme="${escapeXmlAttribute(hAnsiTheme)}"`);
64
- if (eastAsiaTheme) fontAttrs.push(`w:eastAsiaTheme="${escapeXmlAttribute(eastAsiaTheme)}"`);
65
- if (csTheme) fontAttrs.push(`w:cstheme="${escapeXmlAttribute(csTheme)}"`);
66
- if (fontAttrs.length > 0) parts.push(`<w:rFonts ${fontAttrs.join(" ")}/>`);
67
- }
68
- if (bold === true) parts.push("<w:b/>");
69
- else if (bold === false) parts.push("<w:b w:val=\"0\"/>");
70
- if (boldCs === true) parts.push("<w:bCs/>");
71
- else if (boldCs === false) parts.push("<w:bCs w:val=\"0\"/>");
72
- if (italic === true) parts.push("<w:i/>");
73
- else if (italic === false) parts.push("<w:i w:val=\"0\"/>");
74
- if (italicCs === true) parts.push("<w:iCs/>");
75
- else if (italicCs === false) parts.push("<w:iCs w:val=\"0\"/>");
76
- if (allCaps === true) parts.push("<w:caps/>");
77
- else if (allCaps === false) parts.push("<w:caps w:val=\"0\"/>");
78
- if (smallCaps === true) parts.push("<w:smallCaps/>");
79
- else if (smallCaps === false) parts.push("<w:smallCaps w:val=\"0\"/>");
80
- if (strike === true) parts.push("<w:strike/>");
81
- else if (strike === false) parts.push("<w:strike w:val=\"0\"/>");
82
- if (doubleStrike === true) parts.push("<w:dstrike/>");
83
- else if (doubleStrike === false) parts.push("<w:dstrike w:val=\"0\"/>");
84
- if (outline === true) parts.push("<w:outline/>");
85
- else if (outline === false) parts.push("<w:outline w:val=\"0\"/>");
86
- if (shadow === true) parts.push("<w:shadow/>");
87
- else if (shadow === false) parts.push("<w:shadow w:val=\"0\"/>");
88
- if (emboss === true) parts.push("<w:emboss/>");
89
- else if (emboss === false) parts.push("<w:emboss w:val=\"0\"/>");
90
- if (imprint === true) parts.push("<w:imprint/>");
91
- else if (imprint === false) parts.push("<w:imprint w:val=\"0\"/>");
92
- if (hidden === true) parts.push("<w:vanish/>");
93
- else if (hidden === false) parts.push("<w:vanish w:val=\"0\"/>");
94
- if (noProof === true) parts.push("<w:noProof/>");
95
- else if (noProof === false) parts.push("<w:noProof w:val=\"0\"/>");
96
- const colorXml = serializeColorElement(color);
97
- if (colorXml) parts.push(colorXml);
98
- if (spacing !== void 0) parts.push(`<w:spacing w:val="${intAttr(spacing)}"/>`);
99
- const horizontalScale = roundHorizontalScalePercentForSerialization(scale);
100
- if (horizontalScale !== void 0) parts.push(`<w:w w:val="${intAttr(horizontalScale)}"/>`);
101
- if (kerning !== void 0) parts.push(`<w:kern w:val="${intAttr(kerning)}"/>`);
102
- if (position !== void 0) parts.push(`<w:position w:val="${intAttr(position)}"/>`);
103
- if (fontSize !== void 0) parts.push(`<w:sz w:val="${intAttr(fontSize)}"/>`);
104
- if (fontSizeCs !== void 0) parts.push(`<w:szCs w:val="${intAttr(fontSizeCs)}"/>`);
105
- let customHighlightShadingXml = "";
106
- if (highlight) {
107
- if (VALID_HIGHLIGHT_COLORS.has(highlight)) parts.push(`<w:highlight w:val="${highlight}"/>`);
108
- else if (!shading) {
109
- const hex = highlight.replace(/^#/u, "");
110
- if (/^[0-9a-fA-F]{6}$/u.test(hex)) customHighlightShadingXml = `<w:shd w:val="clear" w:color="auto" w:fill="${hex}"/>`;
111
- }
112
- }
113
- if (underline) {
114
- const { style, color: underlineColor } = underline;
115
- const uAttrs = [`w:val="${style}"`];
116
- if (underlineColor) {
117
- const { rgb, themeColor, themeTint, themeShade, auto: _auto } = underlineColor;
118
- if (rgb && isValidHexColor(rgb)) uAttrs.push(`w:color="${escapeXmlAttribute(rgb)}"`);
119
- if (themeColor) uAttrs.push(`w:themeColor="${escapeXmlAttribute(themeColor)}"`);
120
- if (themeTint) uAttrs.push(`w:themeTint="${escapeXmlAttribute(themeTint)}"`);
121
- if (themeShade) uAttrs.push(`w:themeShade="${escapeXmlAttribute(themeShade)}"`);
122
- }
123
- parts.push(`<w:u ${uAttrs.join(" ")}/>`);
124
- }
125
- if (effect) parts.push(`<w:effect w:val="${effect}"/>`);
126
- const shadingXml = serializeShading(shading) || customHighlightShadingXml;
127
- if (shadingXml) parts.push(shadingXml);
128
- if (vertAlign) parts.push(`<w:vertAlign w:val="${vertAlign}"/>`);
129
- if (rtl === true) parts.push("<w:rtl/>");
130
- else if (rtl === false) parts.push("<w:rtl w:val=\"0\"/>");
131
- if (cs === true) parts.push("<w:cs/>");
132
- else if (cs === false) parts.push("<w:cs w:val=\"0\"/>");
133
- if (emphasisMark) parts.push(`<w:em w:val="${emphasisMark}"/>`);
134
- if (language) {
135
- const { val, eastAsia, bidi } = language;
136
- const languageAttrs = [];
137
- if (val) languageAttrs.push(`w:val="${escapeXmlAttribute(val)}"`);
138
- if (eastAsia) languageAttrs.push(`w:eastAsia="${escapeXmlAttribute(eastAsia)}"`);
139
- if (bidi) languageAttrs.push(`w:bidi="${escapeXmlAttribute(bidi)}"`);
140
- if (languageAttrs.length > 0) parts.push(`<w:lang ${languageAttrs.join(" ")}/>`);
141
- }
142
- return parts.length === 0 ? "" : `<w:rPr>${parts.join("")}</w:rPr>`;
107
+ function serializeTextFormatting(input, owned = []) {
108
+ const { bold, boldCs, italic, italicCs, underline, strike, doubleStrike, vertAlign, smallCaps, allCaps, hidden, noProof, color, highlight, shading, fontSize, fontSizeCs, fontFamily, language, spacing, position, scale, kerning, effect, emphasisMark, emboss, imprint, outline, shadow, rtl, cs, styleId, preserved } = input ?? {};
109
+ const namedHighlight = highlight && VALID_HIGHLIGHT_COLORS.has(highlight) ? highlight : void 0;
110
+ const customHighlightHex = highlight && !namedHighlight && !shading ? highlight.replace(/^#/u, "") : "";
111
+ const customHighlightShadingXml = /^[0-9a-fA-F]{6}$/u.test(customHighlightHex) ? `<w:shd w:val="clear" w:color="auto" w:fill="${customHighlightHex}"/>` : "";
112
+ const parts = serializeSequenceChildren({
113
+ container: "run-properties",
114
+ modelled: [
115
+ ...owned,
116
+ ["rStyle", styleId ? `<w:rStyle w:val="${escapeXmlAttribute(styleId)}"/>` : ""],
117
+ ["rFonts", serializeFontFamily(fontFamily)],
118
+ ["b", serializeOnOffElement(bold, "b")],
119
+ ["bCs", serializeOnOffElement(boldCs, "bCs")],
120
+ ["i", serializeOnOffElement(italic, "i")],
121
+ ["iCs", serializeOnOffElement(italicCs, "iCs")],
122
+ ["caps", serializeOnOffElement(allCaps, "caps")],
123
+ ["smallCaps", serializeOnOffElement(smallCaps, "smallCaps")],
124
+ ["strike", serializeOnOffElement(strike, "strike")],
125
+ ["dstrike", serializeOnOffElement(doubleStrike, "dstrike")],
126
+ ["outline", serializeOnOffElement(outline, "outline")],
127
+ ["shadow", serializeOnOffElement(shadow, "shadow")],
128
+ ["emboss", serializeOnOffElement(emboss, "emboss")],
129
+ ["imprint", serializeOnOffElement(imprint, "imprint")],
130
+ ["noProof", serializeOnOffElement(noProof, "noProof")],
131
+ ["vanish", serializeOnOffElement(hidden, "vanish")],
132
+ ["color", serializeColorElement(color)],
133
+ ["spacing", numberTag("spacing", spacing)],
134
+ ["w", numberTag("w", roundHorizontalScalePercentForSerialization(scale))],
135
+ ["kern", numberTag("kern", kerning)],
136
+ ["position", numberTag("position", position)],
137
+ ["sz", numberTag("sz", fontSize)],
138
+ ["szCs", numberTag("szCs", fontSizeCs)],
139
+ ["highlight", namedHighlight ? `<w:highlight w:val="${namedHighlight}"/>` : ""],
140
+ ["u", serializeUnderline(underline)],
141
+ ["effect", effect ? `<w:effect w:val="${effect}"/>` : ""],
142
+ ["shd", serializeShading(shading) || customHighlightShadingXml],
143
+ ["vertAlign", vertAlign ? `<w:vertAlign w:val="${vertAlign}"/>` : ""],
144
+ ["rtl", serializeOnOffElement(rtl, "rtl")],
145
+ ["cs", serializeOnOffElement(cs, "cs")],
146
+ ["em", emphasisMark ? `<w:em w:val="${emphasisMark}"/>` : ""],
147
+ ["lang", serializeLanguage(language)]
148
+ ],
149
+ preserved
150
+ });
151
+ if (parts.length === 0) return input !== void 0 && Object.keys(input).length === 0 ? "<w:rPr/>" : "";
152
+ return `<w:rPr>${parts.join("")}</w:rPr>`;
143
153
  }
144
154
  //#endregion
145
155
  export { serializeShading, serializeTextFormatting };
@@ -18,7 +18,7 @@ declare function intAttr(value: number | undefined | null): string;
18
18
  /**
19
19
  * Verify that `xml` parses to exactly one root element named `expectedLocalName`
20
20
  * (namespace prefix ignored). Used to gate raw XML snapshots — e.g. an SDT's
21
- * `rawPropertiesXml`/`rawEndPropertiesXml` — before splicing them verbatim
21
+ * `rawEndPropertiesXml` — before splicing it verbatim
22
22
  * into a serialized document. Those snapshots are normally produced by our
23
23
  * own parser, but they can also arrive from an untrusted surface (a
24
24
  * programmatically constructed node, a collaboration payload); a value that
@@ -22,7 +22,7 @@ function intAttr(value) {
22
22
  /**
23
23
  * Verify that `xml` parses to exactly one root element named `expectedLocalName`
24
24
  * (namespace prefix ignored). Used to gate raw XML snapshots — e.g. an SDT's
25
- * `rawPropertiesXml`/`rawEndPropertiesXml` — before splicing them verbatim
25
+ * `rawEndPropertiesXml` — before splicing it verbatim
26
26
  * into a serialized document. Those snapshots are normally produced by our
27
27
  * own parser, but they can also arrive from an untrusted surface (a
28
28
  * programmatically constructed node, a collaboration payload); a value that
@@ -1,6 +1,6 @@
1
1
  import { deterministicHexId } from "../../utils/hexId.js";
2
2
  import { createBuiltInStyleIndex, resolveHeadingLevel } from "../builtInStyles.js";
3
- import { isNumberingReference } from "../numberingReference.js";
3
+ import { mergeParagraphNumbering, paragraphNumberingReference, paragraphNumberingReferenceId } from "../numberingReference.js";
4
4
  import { getParagraphText } from "../paragraphParser.js";
5
5
  import { cloneParagraphWithoutPropertySource } from "../paragraphPropertySource.js";
6
6
  import { getRunText } from "../runParser.js";
@@ -203,6 +203,7 @@ const flattenBlocks = (content) => {
203
203
  out.push(block);
204
204
  return;
205
205
  }
206
+ if (block.type !== "blockSdt") return;
206
207
  for (const child of block.content) visit(child);
207
208
  };
208
209
  for (const block of content) visit(block);
@@ -246,22 +247,24 @@ const classifyParagraph = (paragraph, styleById, builtInStyles) => {
246
247
  if (effectiveNumPr(paragraph, styleById) !== void 0) return "listItem";
247
248
  return "paragraph";
248
249
  };
249
- /** The numbering a paragraph renders with: direct `numPr`, else the style chain's. */
250
+ /** The numbering a paragraph renders with after style and direct tiers fold. */
250
251
  const effectiveNumPr = (paragraph, styleById) => {
251
- const direct = paragraph.formatting?.numPr;
252
- if (direct?.numId !== void 0) return isNumberingReference(direct.numId) ? direct : void 0;
253
252
  const styleId = paragraph.formatting?.styleId;
254
- return styleId ? styleNumPr(styleById.get(styleId), styleById) : void 0;
253
+ const effective = mergeParagraphNumbering(styleId ? styleNumPr(styleById.get(styleId), styleById) : void 0, paragraph.formatting?.numPr);
254
+ return effective?.kind === "reference" ? effective : void 0;
255
255
  };
256
256
  const styleNumPr = (style, styleById) => {
257
257
  const seen = /* @__PURE__ */ new Set();
258
+ const chain = [];
258
259
  let current = style;
259
260
  while (current && !seen.has(current.styleId)) {
260
261
  seen.add(current.styleId);
261
- const numPr = current.pPr?.numPr;
262
- if (numPr?.numId !== void 0) return isNumberingReference(numPr.numId) ? numPr : void 0;
262
+ if (current.pPr?.numPr !== void 0) chain.push(current.pPr.numPr);
263
263
  current = current.basedOn ? styleById.get(current.basedOn) : void 0;
264
264
  }
265
+ let effective;
266
+ for (const stated of chain.toReversed()) effective = mergeParagraphNumbering(effective, stated);
267
+ return effective?.kind === "reference" ? effective : void 0;
265
268
  };
266
269
  const createNumberingCloner = ({ numbering, styleById, warnings }) => {
267
270
  const abstractNums = numbering?.abstractNums ?? [];
@@ -300,7 +303,7 @@ const createNumberingCloner = ({ numbering, styleById, warnings }) => {
300
303
  let current = abstract;
301
304
  while (current.numStyleLink && !seen.has(current.abstractNumId)) {
302
305
  seen.add(current.abstractNumId);
303
- const linkedNumId = styleById.get(current.numStyleLink)?.pPr?.numPr?.numId;
306
+ const linkedNumId = paragraphNumberingReferenceId(styleById.get(current.numStyleLink)?.pPr?.numPr);
304
307
  const linkedNum = linkedNumId === void 0 ? void 0 : numById.get(linkedNumId);
305
308
  const linkedAbstract = linkedNum ? abstractById.get(linkedNum.abstractNumId) : void 0;
306
309
  if (!linkedAbstract) {
@@ -354,7 +357,7 @@ const createStyleCloner = ({ styleById, suffix, cloner }) => {
354
357
  const style = styleById.get(styleId);
355
358
  if (!style || style.type !== "paragraph") return styleId;
356
359
  const numPr = styleNumPr(style, styleById);
357
- if (numPr?.numId === void 0) return styleId;
360
+ if (numPr === void 0) return styleId;
358
361
  const cloneId = `${styleId}-${suffix}`;
359
362
  if (styleById.has(cloneId)) return cloneId;
360
363
  const clone = {
@@ -365,10 +368,10 @@ const createStyleCloner = ({ styleById, suffix, cloner }) => {
365
368
  default: false,
366
369
  pPr: {
367
370
  ...style.pPr,
368
- numPr: {
369
- ...numPr,
370
- numId: cloner.cloneNumId(numPr.numId)
371
- }
371
+ numPr: paragraphNumberingReference({
372
+ numId: cloner.cloneNumId(numPr.numId),
373
+ ilvl: numPr.ilvl
374
+ })
372
375
  }
373
376
  };
374
377
  clones.set(styleId, clone);
@@ -388,11 +391,11 @@ const cloneParagraphForTarget = (paragraph, targetParaId, styleCloner, cloner, b
388
391
  const nextFormatting = formatting && {
389
392
  ...formatting,
390
393
  ...formatting.styleId !== void 0 && { styleId: styleCloner.styleIdFor(formatting.styleId) },
391
- ...formatting.numPr !== void 0 && isNumberingReference(formatting.numPr.numId) && { numPr: {
394
+ ...formatting.numPr?.kind === "reference" && { numPr: {
392
395
  ...formatting.numPr,
393
396
  numId: cloner.cloneNumId(formatting.numPr.numId)
394
397
  } },
395
- ...formatting.numPrFromStyle !== void 0 && isNumberingReference(formatting.numPrFromStyle.numId) && { numPrFromStyle: {
398
+ ...formatting.numPrFromStyle?.kind === "reference" && { numPrFromStyle: {
396
399
  ...formatting.numPrFromStyle,
397
400
  numId: cloner.cloneNumId(formatting.numPrFromStyle.numId)
398
401
  } }
@@ -462,7 +465,7 @@ const remapListRendering = (rendering, cloner) => {
462
465
  const collectTableParagraphs = (table) => {
463
466
  const out = [];
464
467
  for (const row of table.rows) for (const cell of row.cells) for (const item of cell.content) if (item.type === "paragraph") out.push(item);
465
- else out.push(...collectTableParagraphs(item));
468
+ else if (item.type === "table") out.push(...collectTableParagraphs(item));
466
469
  return out;
467
470
  };
468
471
  const cloneTableForTarget = ({ table, editableParagraphIds, paraIds, styleCloner, cloner, bookmarkIds }) => {
@@ -475,6 +478,7 @@ const cloneTableForTarget = ({ table, editableParagraphIds, paraIds, styleCloner
475
478
  ...structuredClone(cell),
476
479
  content: cell.content.map((item) => {
477
480
  if (item.type === "table") return cloneTable(item);
481
+ if (item.type !== "paragraph") return structuredClone(item);
478
482
  const targetParaId = paraIds.mint(item.paraId);
479
483
  const copy = cloneParagraphForTarget(item, targetParaId, styleCloner, cloner, bookmarkIds);
480
484
  if (isTranslatableParagraph(item, editableParagraphIds)) paragraphs.push({
@@ -4,7 +4,7 @@ declare const FOLIO_YJS_PROSEMIRROR_FRAGMENT_NAME = "prosemirror";
4
4
  /** Maximum accepted size of a complete Yjs collaboration state update. */
5
5
  declare const FOLIO_YJS_UPDATE_MAX_BYTES: number;
6
6
  /** Stable failure codes returned by server-side Yjs-to-DOCX materialization. */
7
- declare const FOLIO_YJS_DOCX_MATERIALIZATION_ERROR_CODES: readonly ["empty_update", "invalid_update", "missing_document", "source_mismatch", "update_too_large"];
7
+ declare const FOLIO_YJS_DOCX_MATERIALIZATION_ERROR_CODES: readonly ["empty_update", "invalid_update", "missing_document", "source_mismatch", "stale_attr_schema", "update_too_large"];
8
8
  /** Failure code for a rejected Yjs-to-DOCX materialization request. */
9
9
  type FolioYjsDocxMaterializationErrorCode = (typeof FOLIO_YJS_DOCX_MATERIALIZATION_ERROR_CODES)[number];
10
10
  declare const FolioYjsDocxMaterializationError_base: import("better-result").TaggedErrorClass<"FolioYjsDocxMaterializationError">;
@@ -1,6 +1,6 @@
1
1
  import { fromProseDoc } from "../../prosemirror/conversion/fromProseDoc.js";
2
2
  import { schema } from "../../prosemirror/schema/index.js";
3
- import { readYjsParagraphSourceContract, withParagraphSourceContract } from "../../prosemirror/yjsParagraphSourceContract.js";
3
+ import { applyAttrSchemaMigrations, readYjsAttrSchemaVersion, readYjsParagraphSourceContract, withParagraphSourceContract } from "../../prosemirror/yjsDocumentMetadata.js";
4
4
  import { ParagraphPropertySourceValidationError } from "../paragraphPropertySource.js";
5
5
  import { parseDocx } from "../parser.js";
6
6
  import { repackDocx } from "../rezip.js";
@@ -18,6 +18,7 @@ const FOLIO_YJS_DOCX_MATERIALIZATION_ERROR_CODES = [
18
18
  "invalid_update",
19
19
  "missing_document",
20
20
  "source_mismatch",
21
+ "stale_attr_schema",
21
22
  "update_too_large"
22
23
  ];
23
24
  /** Typed failure raised when a collaboration snapshot cannot be materialized. */
@@ -40,6 +41,13 @@ const readProseMirrorDocument = (yjsUpdate) => {
40
41
  code: "missing_document",
41
42
  message: "Yjs update does not contain a Folio document."
42
43
  });
44
+ const attrSchemaVersion = readYjsAttrSchemaVersion(ydoc);
45
+ if (attrSchemaVersion.isErr()) throw new FolioYjsDocxMaterializationError({
46
+ cause: attrSchemaVersion.error,
47
+ code: "stale_attr_schema",
48
+ message: attrSchemaVersion.error.message
49
+ });
50
+ applyAttrSchemaMigrations(ydoc, fragment, attrSchemaVersion.value);
43
51
  const contract = readYjsParagraphSourceContract(ydoc);
44
52
  if (!contract) throw new FolioYjsDocxMaterializationError({
45
53
  code: "source_mismatch",
@@ -0,0 +1,55 @@
1
+ import { FolioYjsAttrSchemaVersion } from "../../prosemirror/yjsDocumentMetadata.js";
2
+ import { Result } from "better-result";
3
+ //#region src/docx/server/migrateYjsAttrSchema.d.ts
4
+ /** Stable failure codes returned by an offline snapshot migration. */
5
+ declare const FOLIO_YJS_SNAPSHOT_MIGRATION_ERROR_CODES: readonly ["invalid_update", "unsupported_version", "update_too_large"];
6
+ /** Failure code for a snapshot that could not be migrated. */
7
+ type FolioYjsSnapshotMigrationErrorCode = (typeof FOLIO_YJS_SNAPSHOT_MIGRATION_ERROR_CODES)[number];
8
+ declare const FolioYjsSnapshotMigrationError_base: import("better-result").TaggedErrorClass<"FolioYjsSnapshotMigrationError">;
9
+ /** Typed failure raised when a collaboration snapshot cannot be migrated. */
10
+ declare class FolioYjsSnapshotMigrationError extends FolioYjsSnapshotMigrationError_base<{
11
+ code: FolioYjsSnapshotMigrationErrorCode;
12
+ message: string;
13
+ cause?: unknown;
14
+ }> {}
15
+ /** What an offline migration did to one snapshot. */
16
+ type FolioYjsSnapshotMigrationResult = {
17
+ /** The complete state update to store in place of the input. */
18
+ update: Uint8Array;
19
+ /** The attr-schema version the input was written under. */
20
+ fromVersion: FolioYjsAttrSchemaVersion;
21
+ /** The attr-schema version the output carries. */
22
+ toVersion: FolioYjsAttrSchemaVersion;
23
+ /** Paragraphs whose attrs the migration rewrote. */
24
+ paragraphsRewritten: number;
25
+ };
26
+ /**
27
+ * Carry a stored collaboration snapshot forward to the attr schema this build
28
+ * writes, without a ProseMirror schema and without rebuilding a single node.
29
+ *
30
+ * A Yjs XML element's attributes are ordinary CRDT map entries holding JSON, so
31
+ * {@link applyAttrSchemaMigrations} rewrites values in the fragment directly.
32
+ * Nothing here can trip y-prosemirror's node rebuild, which deletes an element
33
+ * it fails to construct. The function is pure and offline: no network, no
34
+ * DOCX, no editor.
35
+ *
36
+ * A snapshot already at the current version is returned byte for byte, so a
37
+ * host may run this over its whole corpus repeatedly.
38
+ *
39
+ * **The contract a reseed must respect.** This function never reseeds and never
40
+ * touches the paragraph-source contract: it preserves whichever source binding
41
+ * the snapshot already carries. A reseed does the opposite, and Folio holds it
42
+ * to one rule: *the DOCX handed to the seeding editor must be the same bytes
43
+ * the host will later pass to `materializeYjsDocx` as that room's source*.
44
+ * The contract is a digest of those bytes, so seeding from one document while
45
+ * recording another as the room's source makes every later save fail with
46
+ * `source_mismatch`. The reverse mistake is worse and Folio cannot see it: a
47
+ * host that reseeds from the document a room was *created* from, rather than
48
+ * from the latest content it published, produces a perfectly well-formed
49
+ * snapshot whose collaborative history has been replaced by an older document.
50
+ * Rebind the recorded source in the same statement that clears the seed, or do
51
+ * not clear it.
52
+ */
53
+ declare const migrateFolioYjsSnapshot: (update: Uint8Array) => Result<FolioYjsSnapshotMigrationResult, FolioYjsSnapshotMigrationError>;
54
+ //#endregion
55
+ export { FOLIO_YJS_SNAPSHOT_MIGRATION_ERROR_CODES, FolioYjsSnapshotMigrationError, FolioYjsSnapshotMigrationErrorCode, FolioYjsSnapshotMigrationResult, migrateFolioYjsSnapshot };
@@ -0,0 +1,95 @@
1
+ import { applyAttrSchemaMigrations, readYjsAttrSchemaVersion } from "../../prosemirror/yjsDocumentMetadata.js";
2
+ import { FOLIO_YJS_PROSEMIRROR_FRAGMENT_NAME } from "./materializeYjsDocx.js";
3
+ import { Result, TaggedError } from "better-result";
4
+ import * as Y from "yjs";
5
+ //#region src/docx/server/migrateYjsAttrSchema.ts
6
+ /** Stable failure codes returned by an offline snapshot migration. */
7
+ const FOLIO_YJS_SNAPSHOT_MIGRATION_ERROR_CODES = [
8
+ "invalid_update",
9
+ "unsupported_version",
10
+ "update_too_large"
11
+ ];
12
+ /** Typed failure raised when a collaboration snapshot cannot be migrated. */
13
+ var FolioYjsSnapshotMigrationError = class extends TaggedError("FolioYjsSnapshotMigrationError") {};
14
+ /**
15
+ * Carry a stored collaboration snapshot forward to the attr schema this build
16
+ * writes, without a ProseMirror schema and without rebuilding a single node.
17
+ *
18
+ * A Yjs XML element's attributes are ordinary CRDT map entries holding JSON, so
19
+ * {@link applyAttrSchemaMigrations} rewrites values in the fragment directly.
20
+ * Nothing here can trip y-prosemirror's node rebuild, which deletes an element
21
+ * it fails to construct. The function is pure and offline: no network, no
22
+ * DOCX, no editor.
23
+ *
24
+ * A snapshot already at the current version is returned byte for byte, so a
25
+ * host may run this over its whole corpus repeatedly.
26
+ *
27
+ * **The contract a reseed must respect.** This function never reseeds and never
28
+ * touches the paragraph-source contract: it preserves whichever source binding
29
+ * the snapshot already carries. A reseed does the opposite, and Folio holds it
30
+ * to one rule: *the DOCX handed to the seeding editor must be the same bytes
31
+ * the host will later pass to `materializeYjsDocx` as that room's source*.
32
+ * The contract is a digest of those bytes, so seeding from one document while
33
+ * recording another as the room's source makes every later save fail with
34
+ * `source_mismatch`. The reverse mistake is worse and Folio cannot see it: a
35
+ * host that reseeds from the document a room was *created* from, rather than
36
+ * from the latest content it published, produces a perfectly well-formed
37
+ * snapshot whose collaborative history has been replaced by an older document.
38
+ * Rebind the recorded source in the same statement that clears the seed, or do
39
+ * not clear it.
40
+ */
41
+ const migrateFolioYjsSnapshot = (update) => {
42
+ if (update.byteLength === 0) return Result.err(new FolioYjsSnapshotMigrationError({
43
+ code: "invalid_update",
44
+ message: "Cannot migrate an empty Yjs update."
45
+ }));
46
+ if (update.byteLength > 10485760) return Result.err(new FolioYjsSnapshotMigrationError({
47
+ code: "update_too_large",
48
+ message: "Yjs update exceeds the snapshot migration limit."
49
+ }));
50
+ const ydoc = new Y.Doc();
51
+ const applied = Result.try({
52
+ try: () => {
53
+ Y.applyUpdate(ydoc, update);
54
+ },
55
+ catch: (cause) => new FolioYjsSnapshotMigrationError({
56
+ cause,
57
+ code: "invalid_update",
58
+ message: "Yjs update is not a valid Folio collaboration snapshot."
59
+ })
60
+ });
61
+ if (applied.isErr()) {
62
+ ydoc.destroy();
63
+ return Result.err(applied.error);
64
+ }
65
+ const read = readYjsAttrSchemaVersion(ydoc);
66
+ if (read.isErr()) {
67
+ ydoc.destroy();
68
+ return Result.err(new FolioYjsSnapshotMigrationError({
69
+ cause: read.error,
70
+ code: "unsupported_version",
71
+ message: read.error.message
72
+ }));
73
+ }
74
+ const fromVersion = read.value;
75
+ if (fromVersion === 11) {
76
+ ydoc.destroy();
77
+ return Result.ok({
78
+ fromVersion,
79
+ paragraphsRewritten: 0,
80
+ toVersion: 11,
81
+ update
82
+ });
83
+ }
84
+ const paragraphsRewritten = applyAttrSchemaMigrations(ydoc, ydoc.getXmlFragment(FOLIO_YJS_PROSEMIRROR_FRAGMENT_NAME), fromVersion);
85
+ const migrated = Y.encodeStateAsUpdate(ydoc);
86
+ ydoc.destroy();
87
+ return Result.ok({
88
+ fromVersion,
89
+ paragraphsRewritten,
90
+ toVersion: 11,
91
+ update: migrated
92
+ });
93
+ };
94
+ //#endregion
95
+ export { FOLIO_YJS_SNAPSHOT_MIGRATION_ERROR_CODES, FolioYjsSnapshotMigrationError, migrateFolioYjsSnapshot };
@@ -28,11 +28,14 @@ function parseSettings(xml) {
28
28
  const settings = { defaultTabStop: parseDefaultTabStop(root) };
29
29
  const wordprocessingFlag = (localName) => {
30
30
  const element = findChildByNamespaceUri(root, WORDPROCESSINGML_NAMESPACE_URIS, localName);
31
- return element !== null && parseBooleanElement(element);
31
+ return element === null ? void 0 : parseBooleanElement(element);
32
32
  };
33
- if (wordprocessingFlag("evenAndOddHeaders")) settings.evenAndOddHeaders = true;
34
- if (wordprocessingFlag("mirrorMargins")) settings.mirrorMargins = true;
35
- if (wordprocessingFlag("updateFields")) settings.updateFields = true;
33
+ const evenAndOddHeaders = wordprocessingFlag("evenAndOddHeaders");
34
+ if (evenAndOddHeaders !== void 0) settings.evenAndOddHeaders = evenAndOddHeaders;
35
+ const mirrorMargins = wordprocessingFlag("mirrorMargins");
36
+ if (mirrorMargins !== void 0) settings.mirrorMargins = mirrorMargins;
37
+ const updateFields = wordprocessingFlag("updateFields");
38
+ if (updateFields !== void 0) settings.updateFields = updateFields;
36
39
  const themeFontLangEl = root ? findChild(root, "w", "themeFontLang") : null;
37
40
  const eastAsiaLang = themeFontLangEl ? getAttribute(themeFontLangEl, "w", "eastAsia") || void 0 : void 0;
38
41
  const bidiLang = themeFontLangEl ? getAttribute(themeFontLangEl, "w", "bidi") || void 0 : void 0;
@@ -1,6 +1,7 @@
1
1
  import { document_d_exports } from "../types/document.js";
2
+ import { ParseContext } from "./parseContext.js";
2
3
  import { XmlElement } from "./xmlParser.js";
3
4
  //#region src/docx/shadingParser.d.ts
4
- declare function parseShading(shd: XmlElement | null): document_d_exports.ShadingProperties | undefined;
5
+ declare function parseShading(shd: XmlElement | null, context?: ParseContext): document_d_exports.ShadingProperties | undefined;
5
6
  //#endregion
6
7
  export { parseShading };