diff --git a/api/classes/charts.ChartDataPatch.html b/api/classes/charts.ChartDataPatch.html
index 4ac146fd76..691b016eda 100644
--- a/api/classes/charts.ChartDataPatch.html
+++ b/api/classes/charts.ChartDataPatch.html
@@ -45,7 +45,7 @@ placeholder in the document's text is left as it is.
diff --git a/api/classes/index.AbstractNumbering.html b/api/classes/index.AbstractNumbering.html
index acf8a8f5fa..aedd7d5caf 100644
--- a/api/classes/index.AbstractNumbering.html
+++ b/api/classes/index.AbstractNumbering.html
@@ -35,7 +35,7 @@ Each abstract definition can contain up to 9 levels.
diff --git a/api/classes/index.Body.html b/api/classes/index.Body.html
index 6a83321666..1dae4b4e53 100644
--- a/api/classes/index.Body.html
+++ b/api/classes/index.Body.html
@@ -37,7 +37,7 @@ section. The last section's properties are stored as a direct child of the body
diff --git a/api/classes/index.Bookmark.html b/api/classes/index.Bookmark.html
index 39defe9f8f..bb7fcbb01d 100644
--- a/api/classes/index.Bookmark.html
+++ b/api/classes/index.Bookmark.html
@@ -31,7 +31,7 @@ of a start marker, content, and an end marker.
diff --git a/api/classes/index.BookmarkEnd.html b/api/classes/index.BookmarkEnd.html
index d7db674f5f..c56f17c8e9 100644
--- a/api/classes/index.BookmarkEnd.html
+++ b/api/classes/index.BookmarkEnd.html
@@ -35,7 +35,7 @@ taken from bookmarkUniqueNumericId (see BookmarkStart)
diff --git a/api/classes/index.BookmarkStart.html b/api/classes/index.BookmarkStart.html
index 8e0c29f4c2..0f3a19c411 100644
--- a/api/classes/index.BookmarkStart.html
+++ b/api/classes/index.BookmarkStart.html
@@ -37,7 +37,7 @@ same as a Bookmark's.
diff --git a/api/classes/index.CellMerge.html b/api/classes/index.CellMerge.html
index b98e2c8ab4..6006fdb5c0 100644
--- a/api/classes/index.CellMerge.html
+++ b/api/classes/index.CellMerge.html
@@ -31,7 +31,7 @@ the intermediate object format used by the xml serialization library.
diff --git a/api/classes/index.CellMergeAttributes.html b/api/classes/index.CellMergeAttributes.html
index 51fa249da2..cfa3dad739 100644
--- a/api/classes/index.CellMergeAttributes.html
+++ b/api/classes/index.CellMergeAttributes.html
@@ -30,7 +30,7 @@ can define an xmlKeys map to specify the transformation.
diff --git a/api/classes/index.CheckBoxSymbolElement.html b/api/classes/index.CheckBoxSymbolElement.html
index a422827ab1..b1ec254289 100644
--- a/api/classes/index.CheckBoxSymbolElement.html
+++ b/api/classes/index.CheckBoxSymbolElement.html
@@ -33,7 +33,7 @@ specifying the Unicode character and font to render.
diff --git a/api/classes/index.CheckBoxUtil.html b/api/classes/index.CheckBoxUtil.html
index aa0893cffd..e4b1d7b29b 100644
--- a/api/classes/index.CheckBoxUtil.html
+++ b/api/classes/index.CheckBoxUtil.html
@@ -33,7 +33,7 @@ including its checked state and the symbols used for checked and unchecked state
diff --git a/api/classes/index.CommentRangeEnd.html b/api/classes/index.CommentRangeEnd.html
index 41bdd7f1cb..5bba1b0993 100644
--- a/api/classes/index.CommentRangeEnd.html
+++ b/api/classes/index.CommentRangeEnd.html
@@ -36,7 +36,7 @@ Must be paired with a CommentRangeStart with the same ID.
diff --git a/api/classes/index.CommentRangeStart.html b/api/classes/index.CommentRangeStart.html
index 5147530c53..a07501f560 100644
--- a/api/classes/index.CommentRangeStart.html
+++ b/api/classes/index.CommentRangeStart.html
@@ -36,7 +36,7 @@ Must be paired with a CommentRangeEnd with the same ID.
diff --git a/api/classes/index.CommentReference.html b/api/classes/index.CommentReference.html
index e1575d33c5..2aadc569b2 100644
--- a/api/classes/index.CommentReference.html
+++ b/api/classes/index.CommentReference.html
@@ -36,7 +36,7 @@ It should be placed after the CommentRangeEnd element.
diff --git a/api/classes/index.Comments.html b/api/classes/index.Comments.html
index 1ddaa8b04b..bbf4dc85a7 100644
--- a/api/classes/index.Comments.html
+++ b/api/classes/index.Comments.html
@@ -35,7 +35,7 @@ threading is activated and thread data is generated for commentsExtended.xml.
diff --git a/api/classes/index.CommentsIds.html b/api/classes/index.CommentsIds.html
index 8f03bf13e0..01aff8b03d 100644
--- a/api/classes/index.CommentsIds.html
+++ b/api/classes/index.CommentsIds.html
@@ -27,7 +27,7 @@ to a stable w16cid:durableId preserved by Word across edits.
diff --git a/api/classes/index.ConcreteHyperlink.html b/api/classes/index.ConcreteHyperlink.html
index cf088121af..bd6c2f41e1 100644
--- a/api/classes/index.ConcreteHyperlink.html
+++ b/api/classes/index.ConcreteHyperlink.html
@@ -30,7 +30,7 @@ Use InternalHyperlink or ExternalHyperlink for creating hyperlinks in documents.
diff --git a/api/classes/index.DeletedTableCell.html b/api/classes/index.DeletedTableCell.html
index 78e8fefdb9..bc33bf36e4 100644
--- a/api/classes/index.DeletedTableCell.html
+++ b/api/classes/index.DeletedTableCell.html
@@ -31,7 +31,7 @@ the intermediate object format used by the xml serialization library.
diff --git a/api/classes/index.DeletedTableRow.html b/api/classes/index.DeletedTableRow.html
index 6266581877..3b80d58a1f 100644
--- a/api/classes/index.DeletedTableRow.html
+++ b/api/classes/index.DeletedTableRow.html
@@ -31,7 +31,7 @@ the intermediate object format used by the xml serialization library.
diff --git a/api/classes/index.DocumentDefaults.html b/api/classes/index.DocumentDefaults.html
index 84b5057303..580d405780 100644
--- a/api/classes/index.DocumentDefaults.html
+++ b/api/classes/index.DocumentDefaults.html
@@ -34,7 +34,7 @@ paragraphs and runs in a document unless overridden by a style or direct formatt
diff --git a/api/classes/index.DrawingPatch.html b/api/classes/index.DrawingPatch.html
index 896c9226b7..aa1247af90 100644
--- a/api/classes/index.DrawingPatch.html
+++ b/api/classes/index.DrawingPatch.html
@@ -27,7 +27,7 @@ is one: it replaces the data of a chart made in Word.
diff --git a/api/classes/index.EndnoteIdReference.html b/api/classes/index.EndnoteIdReference.html
index d1956e90f3..ad86000e57 100644
--- a/api/classes/index.EndnoteIdReference.html
+++ b/api/classes/index.EndnoteIdReference.html
@@ -31,7 +31,7 @@ the intermediate object format used by the xml serialization library.
diff --git a/api/classes/index.EndnoteReferenceRunAttributes.html b/api/classes/index.EndnoteReferenceRunAttributes.html
index 9291135ba5..a2c98918ad 100644
--- a/api/classes/index.EndnoteReferenceRunAttributes.html
+++ b/api/classes/index.EndnoteReferenceRunAttributes.html
@@ -30,7 +30,7 @@ can define an xmlKeys map to specify the transformation.
diff --git a/api/classes/index.Endnotes.html b/api/classes/index.Endnotes.html
index 2011f2ef60..96e9ccc379 100644
--- a/api/classes/index.Endnotes.html
+++ b/api/classes/index.Endnotes.html
@@ -31,7 +31,7 @@ the intermediate object format used by the xml serialization library.
diff --git a/api/classes/index.ExternalHyperlink.html b/api/classes/index.ExternalHyperlink.html
index b745ebd969..247351cac8 100644
--- a/api/classes/index.ExternalHyperlink.html
+++ b/api/classes/index.ExternalHyperlink.html
@@ -37,7 +37,7 @@ is converted to a ConcreteHyperlink with the relationship ID.
diff --git a/api/classes/index.FileChild.html b/api/classes/index.FileChild.html
index 77ea98d465..4b8448862f 100644
--- a/api/classes/index.FileChild.html
+++ b/api/classes/index.FileChild.html
@@ -28,7 +28,7 @@ to the document body. Examples include Paragraph and Table.
diff --git a/api/classes/index.FootNotes.html b/api/classes/index.FootNotes.html
index 5be35a1f4c..8d4473603c 100644
--- a/api/classes/index.FootNotes.html
+++ b/api/classes/index.FootNotes.html
@@ -36,7 +36,7 @@ line used when footnotes continue across pages.
diff --git a/api/classes/index.FooterWrapper.html b/api/classes/index.FooterWrapper.html
index 6c3d332aed..6fefd62ca4 100644
--- a/api/classes/index.FooterWrapper.html
+++ b/api/classes/index.FooterWrapper.html
@@ -29,7 +29,7 @@ Each section can have multiple footers for different page types.
diff --git a/api/classes/index.FootnoteReference.html b/api/classes/index.FootnoteReference.html
index 9464cef7e8..e2c2581b2c 100644
--- a/api/classes/index.FootnoteReference.html
+++ b/api/classes/index.FootnoteReference.html
@@ -27,7 +27,7 @@ and the footnote content by using a unique identifier.
diff --git a/api/classes/index.GridSpan.html b/api/classes/index.GridSpan.html
index acb800d7f8..1469a1d9d8 100644
--- a/api/classes/index.GridSpan.html
+++ b/api/classes/index.GridSpan.html
@@ -34,7 +34,7 @@ in the table grid. This is used to merge cells horizontally (column span).
diff --git a/api/classes/index.HeaderWrapper.html b/api/classes/index.HeaderWrapper.html
index 4f9697e618..2bf3dc5a7c 100644
--- a/api/classes/index.HeaderWrapper.html
+++ b/api/classes/index.HeaderWrapper.html
@@ -29,7 +29,7 @@ Each section can have multiple headers for different page types.
diff --git a/api/classes/index.HpsMeasureElement.html b/api/classes/index.HpsMeasureElement.html
index 5d244359da..fd1417a60b 100644
--- a/api/classes/index.HpsMeasureElement.html
+++ b/api/classes/index.HpsMeasureElement.html
@@ -33,7 +33,7 @@ Values can be specified as numbers (interpreted as half-points) or with explicit
diff --git a/api/classes/index.IgnoreIfEmptyXmlComponent.html b/api/classes/index.IgnoreIfEmptyXmlComponent.html
index e0ce420113..972ee38fc2 100644
--- a/api/classes/index.IgnoreIfEmptyXmlComponent.html
+++ b/api/classes/index.IgnoreIfEmptyXmlComponent.html
@@ -39,7 +39,7 @@ to be excluded from the output.
diff --git a/api/classes/index.ImageRun.html b/api/classes/index.ImageRun.html
index 8e7be215c7..522b3d7e3b 100644
--- a/api/classes/index.ImageRun.html
+++ b/api/classes/index.ImageRun.html
@@ -33,7 +33,7 @@ including JPG, PNG, GIF, BMP, and SVG. Optionally wraps the run in
diff --git a/api/classes/index.ImportedXmlComponent.html b/api/classes/index.ImportedXmlComponent.html
index c5c3fa67e6..0ee6e08cbb 100644
--- a/api/classes/index.ImportedXmlComponent.html
+++ b/api/classes/index.ImportedXmlComponent.html
@@ -30,7 +30,7 @@ templates or when you need to include pre-existing XML fragments.
diff --git a/api/classes/index.InitializableXmlComponent.html b/api/classes/index.InitializableXmlComponent.html
index 4ec298f40b..a207fc595d 100644
--- a/api/classes/index.InitializableXmlComponent.html
+++ b/api/classes/index.InitializableXmlComponent.html
@@ -30,7 +30,7 @@ create a new component that shares or extends the children of an existing compon
diff --git a/api/classes/index.InsertedTableCell.html b/api/classes/index.InsertedTableCell.html
index 996c7f7112..36e9c5448b 100644
--- a/api/classes/index.InsertedTableCell.html
+++ b/api/classes/index.InsertedTableCell.html
@@ -31,7 +31,7 @@ the intermediate object format used by the xml serialization library.
diff --git a/api/classes/index.InsertedTableRow.html b/api/classes/index.InsertedTableRow.html
index d3928da384..14bdd3cd4d 100644
--- a/api/classes/index.InsertedTableRow.html
+++ b/api/classes/index.InsertedTableRow.html
@@ -31,7 +31,7 @@ the intermediate object format used by the xml serialization library.
diff --git a/api/classes/index.InsertedTextRun.html b/api/classes/index.InsertedTextRun.html
index 9d9cb6641a..c33a884857 100644
--- a/api/classes/index.InsertedTextRun.html
+++ b/api/classes/index.InsertedTextRun.html
@@ -37,7 +37,7 @@ made the insertion and when.
diff --git a/api/classes/index.InternalHyperlink.html b/api/classes/index.InternalHyperlink.html
index af11988ddf..36295c1a70 100644
--- a/api/classes/index.InternalHyperlink.html
+++ b/api/classes/index.InternalHyperlink.html
@@ -36,7 +36,7 @@ The bookmark must exist in the document for the hyperlink to function.
diff --git a/api/classes/index.LastRenderedPageBreak.html b/api/classes/index.LastRenderedPageBreak.html
index 0e532bc2a8..cff9cc6ad8 100644
--- a/api/classes/index.LastRenderedPageBreak.html
+++ b/api/classes/index.LastRenderedPageBreak.html
@@ -23,7 +23,7 @@ This is typically generated by Word and not created manually.
diff --git a/api/classes/index.MathDegree.html b/api/classes/index.MathDegree.html
index e1710b2e69..5cecec739e 100644
--- a/api/classes/index.MathDegree.html
+++ b/api/classes/index.MathDegree.html
@@ -28,7 +28,7 @@ For square roots, this element is typically hidden.
diff --git a/api/classes/index.MathFunctionName.html b/api/classes/index.MathFunctionName.html
index 7a3599240e..74c9e358bf 100644
--- a/api/classes/index.MathFunctionName.html
+++ b/api/classes/index.MathFunctionName.html
@@ -28,7 +28,7 @@ that appears before the function argument.
diff --git a/api/classes/index.MathFunctionProperties.html b/api/classes/index.MathFunctionProperties.html
index 1d2df2c96e..f11605f194 100644
--- a/api/classes/index.MathFunctionProperties.html
+++ b/api/classes/index.MathFunctionProperties.html
@@ -28,7 +28,7 @@ such as function name alignment and spacing.
diff --git a/api/classes/index.MathLimitUpper.html b/api/classes/index.MathLimitUpper.html
index 848d8dbccd..bfd7cf77ff 100644
--- a/api/classes/index.MathLimitUpper.html
+++ b/api/classes/index.MathLimitUpper.html
@@ -36,7 +36,7 @@ commonly used for mathematical notation like lim with conditions above.
diff --git a/api/classes/index.MathPreSubSuperScript.html b/api/classes/index.MathPreSubSuperScript.html
index 55742957bf..5fa4a4f3e8 100644
--- a/api/classes/index.MathPreSubSuperScript.html
+++ b/api/classes/index.MathPreSubSuperScript.html
@@ -36,7 +36,7 @@ positioned before (to the left of) the base, commonly used in tensor notation.
diff --git a/api/classes/index.MathRadicalProperties.html b/api/classes/index.MathRadicalProperties.html
index 2c2bd58a41..0c3953cfef 100644
--- a/api/classes/index.MathRadicalProperties.html
+++ b/api/classes/index.MathRadicalProperties.html
@@ -28,7 +28,7 @@ such as whether to hide the degree (for square roots).
diff --git a/api/classes/index.MathRun.html b/api/classes/index.MathRun.html
index 34bf0e73de..cad88b31e2 100644
--- a/api/classes/index.MathRun.html
+++ b/api/classes/index.MathRun.html
@@ -36,7 +36,7 @@ similar to how Run contains text in regular paragraphs.
diff --git a/api/classes/index.MathSubSuperScript.html b/api/classes/index.MathSubSuperScript.html
index 85ccf5cada..fe59f89a6e 100644
--- a/api/classes/index.MathSubSuperScript.html
+++ b/api/classes/index.MathSubSuperScript.html
@@ -36,7 +36,7 @@ commonly used for tensor notation or indexed variables with exponents.
diff --git a/api/classes/index.Media.html b/api/classes/index.Media.html
index cec09f1922..268cf9637e 100644
--- a/api/classes/index.Media.html
+++ b/api/classes/index.Media.html
@@ -24,7 +24,7 @@ is stored with a unique key for retrieval.
diff --git a/api/classes/index.NextAttributeComponent.html b/api/classes/index.NextAttributeComponent.html
index a2df1c03e3..d1b0a3834d 100644
--- a/api/classes/index.NextAttributeComponent.html
+++ b/api/classes/index.NextAttributeComponent.html
@@ -34,7 +34,7 @@ This gives more control but is more verbose than XmlAttributeComponent.
diff --git a/api/classes/index.OnOffElement.html b/api/classes/index.OnOffElement.html
index 702fdc2440..b3e91d27c7 100644
--- a/api/classes/index.OnOffElement.html
+++ b/api/classes/index.OnOffElement.html
@@ -34,7 +34,7 @@ it is explicitly disabled. When the value is true, the attribute is often omitte
diff --git a/api/classes/index.Packer.html b/api/classes/index.Packer.html
index 96a885fccf..18d3082d3c 100644
--- a/api/classes/index.Packer.html
+++ b/api/classes/index.Packer.html
@@ -26,7 +26,7 @@ of the document structure into OOXML format and compression into a .docx ZIP arc
diff --git a/api/classes/index.PageBorders.html b/api/classes/index.PageBorders.html
index bfdede8db0..21219bcab8 100644
--- a/api/classes/index.PageBorders.html
+++ b/api/classes/index.PageBorders.html
@@ -34,7 +34,7 @@ including which pages display the borders and how they are positioned.
diff --git a/api/classes/index.PageTextDirection.html b/api/classes/index.PageTextDirection.html
index b46959167b..c2d775e8c8 100644
--- a/api/classes/index.PageTextDirection.html
+++ b/api/classes/index.PageTextDirection.html
@@ -30,7 +30,7 @@ for all pages in a section.
diff --git a/api/classes/index.Paragraph.html b/api/classes/index.Paragraph.html
index 0b1c9a83a7..8c62925ec0 100644
--- a/api/classes/index.Paragraph.html
+++ b/api/classes/index.Paragraph.html
@@ -36,7 +36,7 @@ various inline elements such as text runs, images, hyperlinks, and bookmarks.
diff --git a/api/classes/index.ParagraphPropertiesChange.html b/api/classes/index.ParagraphPropertiesChange.html
index 04d94af5cf..a9fbe361f4 100644
--- a/api/classes/index.ParagraphPropertiesChange.html
+++ b/api/classes/index.ParagraphPropertiesChange.html
@@ -31,7 +31,7 @@ the intermediate object format used by the xml serialization library.
diff --git a/api/classes/index.ParagraphPropertiesDefaults.html b/api/classes/index.ParagraphPropertiesDefaults.html
index a92e2bfbb0..420a709481 100644
--- a/api/classes/index.ParagraphPropertiesDefaults.html
+++ b/api/classes/index.ParagraphPropertiesDefaults.html
@@ -34,7 +34,7 @@ to all paragraphs in the document unless overridden.
diff --git a/api/classes/index.PositionalTab.html b/api/classes/index.PositionalTab.html
index d38a46bd41..7d3fe86559 100644
--- a/api/classes/index.PositionalTab.html
+++ b/api/classes/index.PositionalTab.html
@@ -37,7 +37,7 @@ an exact alignment and position within the paragraph.
diff --git a/api/classes/index.RunPropertiesDefaults.html b/api/classes/index.RunPropertiesDefaults.html
index 21bdd1a94e..5d7fc5ab7d 100644
--- a/api/classes/index.RunPropertiesDefaults.html
+++ b/api/classes/index.RunPropertiesDefaults.html
@@ -34,7 +34,7 @@ to all text runs in the document unless overridden by styles or direct formattin
diff --git a/api/classes/index.SectionProperties.html b/api/classes/index.SectionProperties.html
index d10fd82e82..cd24a46926 100644
--- a/api/classes/index.SectionProperties.html
+++ b/api/classes/index.SectionProperties.html
@@ -35,7 +35,7 @@ A document can contain multiple sections with different properties.
diff --git a/api/classes/index.SectionPropertiesChange.html b/api/classes/index.SectionPropertiesChange.html
index 9512e6d190..301e1c2822 100644
--- a/api/classes/index.SectionPropertiesChange.html
+++ b/api/classes/index.SectionPropertiesChange.html
@@ -31,7 +31,7 @@ the intermediate object format used by the xml serialization library.
diff --git a/api/classes/index.SimpleField.html b/api/classes/index.SimpleField.html
index cef4e22d47..19f01ab0d4 100644
--- a/api/classes/index.SimpleField.html
+++ b/api/classes/index.SimpleField.html
@@ -40,7 +40,7 @@ Simple fields are typically used for fields that don't require complex nesting.<
diff --git a/api/classes/index.SimpleMailMergeField.html b/api/classes/index.SimpleMailMergeField.html
index 182d04ffca..012a5e139f 100644
--- a/api/classes/index.SimpleMailMergeField.html
+++ b/api/classes/index.SimpleMailMergeField.html
@@ -30,7 +30,7 @@ It creates a MERGEFIELD that will be populated with data during mail merge.
diff --git a/api/classes/index.StringContainer.html b/api/classes/index.StringContainer.html
index 715a5b7c1f..d8c9f848ef 100644
--- a/api/classes/index.StringContainer.html
+++ b/api/classes/index.StringContainer.html
@@ -30,7 +30,7 @@ rather than an attribute.
diff --git a/api/classes/index.StringEnumValueElement.html b/api/classes/index.StringEnumValueElement.html
index 0d950e3ff1..797cee8578 100644
--- a/api/classes/index.StringEnumValueElement.html
+++ b/api/classes/index.StringEnumValueElement.html
@@ -33,7 +33,7 @@ type parameter to enforce type safety for enum values.
diff --git a/api/classes/index.StyleForParagraph.html b/api/classes/index.StyleForParagraph.html
index 584a6cdd53..9770917751 100644
--- a/api/classes/index.StyleForParagraph.html
+++ b/api/classes/index.StyleForParagraph.html
@@ -35,7 +35,7 @@ run-level properties (font, size, color) for text within the paragraph.
diff --git a/api/classes/index.StyleLevel.html b/api/classes/index.StyleLevel.html
index 9fab685671..1eac82c7f3 100644
--- a/api/classes/index.StyleLevel.html
+++ b/api/classes/index.StyleLevel.html
@@ -20,7 +20,7 @@ custom styles to be included in the table of contents at specific levels.
diff --git a/api/classes/index.Styles.html b/api/classes/index.Styles.html
index 68574fda65..0a8d27d86b 100644
--- a/api/classes/index.Styles.html
+++ b/api/classes/index.Styles.html
@@ -35,7 +35,7 @@ a way to define consistent formatting across a document.
diff --git a/api/classes/index.TDirection.html b/api/classes/index.TDirection.html
index fe93dfb79e..e4cc006356 100644
--- a/api/classes/index.TDirection.html
+++ b/api/classes/index.TDirection.html
@@ -34,7 +34,7 @@ useful for creating rotated text or supporting different writing systems.
diff --git a/api/classes/index.Table.html b/api/classes/index.Table.html
index 749acf1826..47742b79a7 100644
--- a/api/classes/index.Table.html
+++ b/api/classes/index.Table.html
@@ -36,7 +36,7 @@ Tables are used to organize content into a grid structure.
diff --git a/api/classes/index.TableCellBorders.html b/api/classes/index.TableCellBorders.html
index ca920168b7..2ef4af7e67 100644
--- a/api/classes/index.TableCellBorders.html
+++ b/api/classes/index.TableCellBorders.html
@@ -34,7 +34,7 @@ can be configured independently with different styles, colors, and widths.
diff --git a/api/classes/index.TableRow.html b/api/classes/index.TableRow.html
index d7b474ed9c..b6dd7020fe 100644
--- a/api/classes/index.TableRow.html
+++ b/api/classes/index.TableRow.html
@@ -36,7 +36,7 @@ one or more table cells that hold the actual content.
diff --git a/api/classes/index.TableRowProperties.html b/api/classes/index.TableRowProperties.html
index 10401088cf..befb068633 100644
--- a/api/classes/index.TableRowProperties.html
+++ b/api/classes/index.TableRowProperties.html
@@ -30,7 +30,7 @@ whether it can split across pages, and whether it's a header row.
diff --git a/api/classes/index.TableRowPropertiesChange.html b/api/classes/index.TableRowPropertiesChange.html
index 74edaaf9cf..423cd06858 100644
--- a/api/classes/index.TableRowPropertiesChange.html
+++ b/api/classes/index.TableRowPropertiesChange.html
@@ -31,7 +31,7 @@ the intermediate object format used by the xml serialization library.
diff --git a/api/classes/index.VerticalMerge.html b/api/classes/index.VerticalMerge.html
index b5d904b8e5..b002c18280 100644
--- a/api/classes/index.VerticalMerge.html
+++ b/api/classes/index.VerticalMerge.html
@@ -35,7 +35,7 @@ This is used to create row spans in tables.
diff --git a/api/classes/index.WpsShapeRun.html b/api/classes/index.WpsShapeRun.html
index 784ba297cc..2c1cf1f10c 100644
--- a/api/classes/index.WpsShapeRun.html
+++ b/api/classes/index.WpsShapeRun.html
@@ -28,7 +28,7 @@ options for fills, lines, effects and text layout, and can be any of the preset
diff --git a/api/classes/index.XmlAttributeComponent.html b/api/classes/index.XmlAttributeComponent.html
index 6838f80b0c..f6f68b52d5 100644
--- a/api/classes/index.XmlAttributeComponent.html
+++ b/api/classes/index.XmlAttributeComponent.html
@@ -41,7 +41,7 @@ can define an xmlKeys map to specify the transformation.
diff --git a/api/classes/index.XmlComponent.html b/api/classes/index.XmlComponent.html
index 322be1a826..69ffec10b3 100644
--- a/api/classes/index.XmlComponent.html
+++ b/api/classes/index.XmlComponent.html
@@ -129,7 +129,7 @@ the intermediate object format used by the xml serialization library.
diff --git a/api/classes/math.MathBrackets.html b/api/classes/math.MathBrackets.html
index 2e06ac5a6a..2769393767 100644
--- a/api/classes/math.MathBrackets.html
+++ b/api/classes/math.MathBrackets.html
@@ -29,7 +29,7 @@ with what they hold.
diff --git a/api/classes/math.MathLargeOperator.html b/api/classes/math.MathLargeOperator.html
index 15d77af463..4fb7801634 100644
--- a/api/classes/math.MathLargeOperator.html
+++ b/api/classes/math.MathLargeOperator.html
@@ -28,7 +28,7 @@ it applies to. MathSum and MathIntegral are two of the
diff --git a/api/classes/math.MathMatrix.html b/api/classes/math.MathMatrix.html
index 27658950e1..17f04fafc1 100644
--- a/api/classes/math.MathMatrix.html
+++ b/api/classes/math.MathMatrix.html
@@ -30,7 +30,7 @@ and Pages centre every column.
diff --git a/api/classes/math.MathPhantom.html b/api/classes/math.MathPhantom.html
index 4cc4560484..2785e5dab2 100644
--- a/api/classes/math.MathPhantom.html
+++ b/api/classes/math.MathPhantom.html
@@ -28,7 +28,7 @@ line things up with it. Or math that is seen but takes up no room, or less, as <
diff --git a/api/classes/shapes.ShapeCanvasRun.html b/api/classes/shapes.ShapeCanvasRun.html
index 258d28a7fb..d7ab4b4d1d 100644
--- a/api/classes/shapes.ShapeCanvasRun.html
+++ b/api/classes/shapes.ShapeCanvasRun.html
@@ -35,7 +35,7 @@ written in mc:AlternateContent, with the group as its fallback, unl
diff --git a/api/classes/shapes.ShapeGroupRun.html b/api/classes/shapes.ShapeGroupRun.html
index 5f599eacf8..0c07ff0193 100644
--- a/api/classes/shapes.ShapeGroupRun.html
+++ b/api/classes/shapes.ShapeGroupRun.html
@@ -35,7 +35,7 @@ when shapes are moved on a
diff --git a/api/classes/shapes.ShapeRun.html b/api/classes/shapes.ShapeRun.html
index 1f6da02a15..482a930311 100644
--- a/api/classes/shapes.ShapeRun.html
+++ b/api/classes/shapes.ShapeRun.html
@@ -33,7 +33,7 @@ and arrowheads, and text inside it. It sits inline with text unless floati
diff --git a/api/classes/watermarks.ImageWatermark.html b/api/classes/watermarks.ImageWatermark.html
index d796882db4..d317eb2fad 100644
--- a/api/classes/watermarks.ImageWatermark.html
+++ b/api/classes/watermarks.ImageWatermark.html
@@ -46,7 +46,7 @@ way as an ImageRun.
diff --git a/api/classes/watermarks.TextWatermark.html b/api/classes/watermarks.TextWatermark.html
index 97b7cd043e..dfc74b90f6 100644
--- a/api/classes/watermarks.TextWatermark.html
+++ b/api/classes/watermarks.TextWatermark.html
@@ -44,7 +44,7 @@ recognizes it and can remove or replace it through that command.
\n option - causes the field result to be the paragraph number without trailing periods. No information about prior numbered levels is displayed unless it is included as part of the current level.
diff --git a/api/functions/index.convertToXmlComponent.html b/api/functions/index.convertToXmlComponent.html
index 512b8a895c..d92ba8fdf3 100644
--- a/api/functions/index.convertToXmlComponent.html
+++ b/api/functions/index.convertToXmlComponent.html
@@ -36,7 +36,7 @@ of the original XML.
diff --git a/api/functions/index.createEmphasisMark.html b/api/functions/index.createEmphasisMark.html
index 7169d8efc3..a06a7bc327 100644
--- a/api/functions/index.createEmphasisMark.html
+++ b/api/functions/index.createEmphasisMark.html
@@ -37,7 +37,7 @@ text to emphasize it. This is commonly used in East Asian typography.
diff --git a/api/functions/index.createFrameProperties.html b/api/functions/index.createFrameProperties.html
index 455b625b92..afd2f5b968 100644
--- a/api/functions/index.createFrameProperties.html
+++ b/api/functions/index.createFrameProperties.html
@@ -41,7 +41,7 @@ drop cap effects and various text wrapping options.
diff --git a/api/functions/index.createHorizontalPosition.html b/api/functions/index.createHorizontalPosition.html
index cb5f0f1f63..7eba33e939 100644
--- a/api/functions/index.createHorizontalPosition.html
+++ b/api/functions/index.createHorizontalPosition.html
@@ -40,7 +40,7 @@ object relative to a base element (page, margin, column, etc.).
diff --git a/api/functions/index.createMathAccentCharacter.html b/api/functions/index.createMathAccentCharacter.html
index 9e30dd84a3..0b5be71b92 100644
--- a/api/functions/index.createMathAccentCharacter.html
+++ b/api/functions/index.createMathAccentCharacter.html
@@ -31,7 +31,7 @@ such as summation (∑), integral (∫), or product (∏) symbols.
diff --git a/api/functions/index.createMathNAryProperties.html b/api/functions/index.createMathNAryProperties.html
index 44f106c08d..247438fa90 100644
--- a/api/functions/index.createMathNAryProperties.html
+++ b/api/functions/index.createMathNAryProperties.html
@@ -31,7 +31,7 @@ and integrals, including the operator character and limit positioning.
diff --git a/api/functions/index.createMathSubScriptElement.html b/api/functions/index.createMathSubScriptElement.html
index 73ed10fff1..f2a98879af 100644
--- a/api/functions/index.createMathSubScriptElement.html
+++ b/api/functions/index.createMathSubScriptElement.html
@@ -31,7 +31,7 @@ script objects, and other structures that support subscripts.
diff --git a/api/functions/index.createMathSuperScriptElement.html b/api/functions/index.createMathSuperScriptElement.html
index 4469093730..1a1c5e3a44 100644
--- a/api/functions/index.createMathSuperScriptElement.html
+++ b/api/functions/index.createMathSuperScriptElement.html
@@ -31,7 +31,7 @@ script objects, and other structures that support superscripts.
diff --git a/api/functions/index.createPageNumberType.html b/api/functions/index.createPageNumberType.html
index 4ec62d9807..7f643a8d8d 100644
--- a/api/functions/index.createPageNumberType.html
+++ b/api/functions/index.createPageNumberType.html
@@ -37,7 +37,7 @@ for all pages in a section.
diff --git a/api/functions/index.createSectionType.html b/api/functions/index.createSectionType.html
index 08bc00c88d..5c43f1bd43 100644
--- a/api/functions/index.createSectionType.html
+++ b/api/functions/index.createSectionType.html
@@ -37,7 +37,7 @@ where the new section begins relative to the previous section.
diff --git a/api/functions/index.createTableFloatProperties.html b/api/functions/index.createTableFloatProperties.html
index f9efd9f2b7..1f461f1b8e 100644
--- a/api/functions/index.createTableFloatProperties.html
+++ b/api/functions/index.createTableFloatProperties.html
@@ -38,7 +38,7 @@ The overlap option isn't part of it: the table properties write it as w:tblOverl
diff --git a/api/functions/index.createTableLook.html b/api/functions/index.createTableLook.html
index 44612d1392..87891057b6 100644
--- a/api/functions/index.createTableLook.html
+++ b/api/functions/index.createTableLook.html
@@ -34,7 +34,7 @@ styles to apply special formatting to specific regions of the table.
diff --git a/api/functions/index.createTableRowHeight.html b/api/functions/index.createTableRowHeight.html
index 646ad26523..9415237a7f 100644
--- a/api/functions/index.createTableRowHeight.html
+++ b/api/functions/index.createTableRowHeight.html
@@ -38,7 +38,7 @@ determining how the height should be applied.
diff --git a/api/functions/index.createWrapNone.html b/api/functions/index.createWrapNone.html
index f322ba2bd1..63fd48c778 100644
--- a/api/functions/index.createWrapNone.html
+++ b/api/functions/index.createWrapNone.html
@@ -23,7 +23,7 @@ without wrapping around it.
diff --git a/api/functions/index.createWrapSquare.html b/api/functions/index.createWrapSquare.html
index c9ad5e9b26..8046d271f5 100644
--- a/api/functions/index.createWrapSquare.html
+++ b/api/functions/index.createWrapSquare.html
@@ -32,7 +32,7 @@ of the drawing on the specified side(s).
diff --git a/api/functions/index.createWrapThrough.html b/api/functions/index.createWrapThrough.html
index 7601c84494..db5ab8eb70 100644
--- a/api/functions/index.createWrapThrough.html
+++ b/api/functions/index.createWrapThrough.html
@@ -36,7 +36,7 @@ fills any open space inside the drawing, such as the middle of a ring.
diff --git a/api/functions/index.createWrapTight.html b/api/functions/index.createWrapTight.html
index 2acf88fb06..335a779ec7 100644
--- a/api/functions/index.createWrapTight.html
+++ b/api/functions/index.createWrapTight.html
@@ -36,7 +36,7 @@ of the drawing rather than its rectangular bounding box.
diff --git a/api/functions/index.dateTimeValue.html b/api/functions/index.dateTimeValue.html
index ff3d7a0b10..2ff66c6a75 100644
--- a/api/functions/index.dateTimeValue.html
+++ b/api/functions/index.dateTimeValue.html
@@ -36,7 +36,7 @@ This matches the xsd:dateTime format required by OOXML.
diff --git a/api/functions/index.fillPageNumbers.html b/api/functions/index.fillPageNumbers.html
index 6c6df80dfe..074b0daa82 100644
--- a/api/functions/index.fillPageNumbers.html
+++ b/api/functions/index.fillPageNumbers.html
@@ -29,7 +29,7 @@ numbers were worked out. The estimate is kept for the document's headers and foo
diff --git a/api/functions/index.fillPartPageNumbers.html b/api/functions/index.fillPartPageNumbers.html
index 27ef26d647..f2cabcb066 100644
--- a/api/functions/index.fillPartPageNumbers.html
+++ b/api/functions/index.fillPartPageNumbers.html
@@ -35,7 +35,7 @@ are left as they are
diff --git a/api/functions/index.fillSequenceNumbers.html b/api/functions/index.fillSequenceNumbers.html
index c6e0297118..e3fc7c015f 100644
--- a/api/functions/index.fillSequenceNumbers.html
+++ b/api/functions/index.fillSequenceNumbers.html
@@ -27,7 +27,7 @@ tables of contents are filled in from its headings, as Word leaves a heading's S
diff --git a/api/functions/index.hpsMeasureValue.html b/api/functions/index.hpsMeasureValue.html
index e8336b029e..55cb3234c6 100644
--- a/api/functions/index.hpsMeasureValue.html
+++ b/api/functions/index.hpsMeasureValue.html
@@ -36,7 +36,7 @@ HPS (half-points) are commonly used for font sizes.
diff --git a/api/functions/index.patchDocument.html b/api/functions/index.patchDocument.html
index 6ff1518694..34d1c814ba 100644
--- a/api/functions/index.patchDocument.html
+++ b/api/functions/index.patchDocument.html
@@ -42,7 +42,7 @@ the original document structure and optionally the original formatting.
diff --git a/api/functions/index.universalMeasureToTwips.html b/api/functions/index.universalMeasureToTwips.html
index bca052b560..013754bda8 100644
--- a/api/functions/index.universalMeasureToTwips.html
+++ b/api/functions/index.universalMeasureToTwips.html
@@ -35,7 +35,7 @@ Strings are converted according to their unit suffix.
diff --git a/api/functions/layout.estimatePageNumbersWith.html b/api/functions/layout.estimatePageNumbersWith.html
index 30cc681bbd..4253193853 100644
--- a/api/functions/layout.estimatePageNumbersWith.html
+++ b/api/functions/layout.estimatePageNumbersWith.html
@@ -32,7 +32,7 @@ options say. Give what it returns to a document as its pageNumbers,
diff --git a/api/functions/layout.layoutDocument.html b/api/functions/layout.layoutDocument.html
index b6a8bcf22f..5364acb895 100644
--- a/api/functions/layout.layoutDocument.html
+++ b/api/functions/layout.layoutDocument.html
@@ -37,7 +37,7 @@ text box, it stops, and gives the pages up to there, with why in stoppedAt
diff --git a/api/functions/layout.measureWithPretext.html b/api/functions/layout.measureWithPretext.html
index 7b8e9de093..7e78588919 100644
--- a/api/functions/layout.measureWithPretext.html
+++ b/api/functions/layout.measureWithPretext.html
@@ -40,7 +40,7 @@ measures text in another, and Pretext keeps the widths it measured.
diff --git a/api/functions/math.latexToMath.html b/api/functions/math.latexToMath.html
index 5d80a68460..42c591c41c 100644
--- a/api/functions/math.latexToMath.html
+++ b/api/functions/math.latexToMath.html
@@ -44,7 +44,7 @@ cases and aligned equations, with \tag for their numbers. The math
diff --git a/api/interfaces/index.IXmlableObject.html b/api/interfaces/index.IXmlableObject.html
index e3189414ad..d05554d25d 100644
--- a/api/interfaces/index.IXmlableObject.html
+++ b/api/interfaces/index.IXmlableObject.html
@@ -31,7 +31,7 @@ to generate the final XML output. Objects typically have a structure like:
diff --git a/api/types/charts.BarChartBaseOptions.html b/api/types/charts.BarChartBaseOptions.html
index 342d6bc7b0..d5893168ce 100644
--- a/api/types/charts.BarChartBaseOptions.html
+++ b/api/types/charts.BarChartBaseOptions.html
@@ -31,7 +31,7 @@ Default is Office's: -27 for column charts and 0 for bar charts. Stacked bars al
@@ -49,14 +49,14 @@ bar, line or area chart spaces them by date
Sales. 2025: Jan 10, Feb 20.", and none for a decorative chart. An empty description removes it
+
diff --git a/api/types/charts.CategoryChartOptions.html b/api/types/charts.CategoryChartOptions.html
index f23c8642b7..466723a8f1 100644
--- a/api/types/charts.CategoryChartOptions.html
+++ b/api/types/charts.CategoryChartOptions.html
@@ -59,7 +59,7 @@ in years, are labelled in rows, the groups below their categories
diff --git a/api/types/charts.ChartAxisCrossing.html b/api/types/charts.ChartAxisCrossing.html
index 3947d0b1ee..3d41156760 100644
--- a/api/types/charts.ChartAxisCrossing.html
+++ b/api/types/charts.ChartAxisCrossing.html
@@ -20,7 +20,7 @@ the value is the category's number, from 1, or when the categories are dates, a
diff --git a/api/types/charts.ChartAxisGroup.html b/api/types/charts.ChartAxisGroup.html
index 54e8a83769..c4fc8f17a4 100644
--- a/api/types/charts.ChartAxisGroup.html
+++ b/api/types/charts.ChartAxisGroup.html
@@ -19,7 +19,7 @@ chart's are along the bottom and the top.
diff --git a/api/types/charts.ChartCategoryGroup.html b/api/types/charts.ChartCategoryGroup.html
index a2528f52e9..7c6993a04c 100644
--- a/api/types/charts.ChartCategoryGroup.html
+++ b/api/types/charts.ChartCategoryGroup.html
@@ -20,7 +20,7 @@ categories, or groups of its own, such as the months of each quarter of each yea
@@ -67,21 +67,21 @@ a point, and where they fit best on a pie. A chart's position is for the series
another way keep Office's, unless their own labels give one
diff --git a/api/types/charts.ChartDataPatchOptions.html b/api/types/charts.ChartDataPatchOptions.html
index cfca7c0102..cd589ec2c9 100644
--- a/api/types/charts.ChartDataPatchOptions.html
+++ b/api/types/charts.ChartDataPatchOptions.html
@@ -19,7 +19,7 @@ series' points, or for a stock chart its prices.
diff --git a/api/types/charts.ChartErrorBarsAmount.html b/api/types/charts.ChartErrorBarsAmount.html
index a032b663f1..1d0640903d 100644
--- a/api/types/charts.ChartErrorBarsAmount.html
+++ b/api/types/charts.ChartErrorBarsAmount.html
@@ -64,7 +64,7 @@ deviations, or the standard error.
diff --git a/api/types/charts.ChartLineDash.html b/api/types/charts.ChartLineDash.html
index d69d22a4bc..92d9781a06 100644
--- a/api/types/charts.ChartLineDash.html
+++ b/api/types/charts.ChartLineDash.html
@@ -19,7 +19,7 @@ and so on.
diff --git a/api/types/charts.ChartPointLabel.html b/api/types/charts.ChartPointLabel.html
index eb7678f545..837abecaf9 100644
--- a/api/types/charts.ChartPointLabel.html
+++ b/api/types/charts.ChartPointLabel.html
@@ -19,7 +19,7 @@ format and its font. Anything left out is as the series' labels have it.
diff --git a/api/types/charts.ChartTrendline.html b/api/types/charts.ChartTrendline.html
index eee7d3da23..4705801016 100644
--- a/api/types/charts.ChartTrendline.html
+++ b/api/types/charts.ChartTrendline.html
@@ -20,7 +20,7 @@ forecast. It is drawn as a dotted line in the series' colour, and has an entry i
@@ -57,7 +57,7 @@ forecast. It is drawn as a dotted line in the series' colour, and has an entry i
along the x axis. Default is 0. Not for moving averages
@@ -73,35 +73,35 @@ the x axis. Default is 0. Not for moving averages
linear, exponential and polynomial trendlines, and above 0 for exponential ones
+
diff --git a/api/types/charts.ChartValueAxis.html b/api/types/charts.ChartValueAxis.html
index 1273eb0592..6e05963248 100644
--- a/api/types/charts.ChartValueAxis.html
+++ b/api/types/charts.ChartValueAxis.html
@@ -43,7 +43,7 @@ of 0 or less can't be shown. Default is a linear scale
diff --git a/api/types/charts.ComboChartSeriesType.html b/api/types/charts.ComboChartSeriesType.html
index bbf9b97252..e0929f2b5f 100644
--- a/api/types/charts.ComboChartSeriesType.html
+++ b/api/types/charts.ComboChartSeriesType.html
@@ -19,7 +19,7 @@ or an area. A chart with series of more than one type is Word's "Combo"
@@ -59,14 +59,14 @@ with undefined, takes the next of the theme's accent colours
one for each slice in the order of the categories, where undefined leaves a slice in. Default is 0
+
diff --git a/api/types/charts.SplitPieChartBaseOptions.html b/api/types/charts.SplitPieChartBaseOptions.html
index 207eec1865..e94def2862 100644
--- a/api/types/charts.SplitPieChartBaseOptions.html
+++ b/api/types/charts.SplitPieChartBaseOptions.html
@@ -42,7 +42,7 @@ second pie or a stacked bar, joined to the slice of the pie that stands for them
diff --git a/api/types/index.AttributePayload.html b/api/types/index.AttributePayload.html
index 1cf7f286fd..1a309dc9b1 100644
--- a/api/types/index.AttributePayload.html
+++ b/api/types/index.AttributePayload.html
@@ -21,7 +21,7 @@ control over attribute name mapping.
Specifies the additional length, in EMUs, which shall be added to the bottom edge of the DrawingML object to determine its actual bottom edge including effects.
Specifies the additional length, in EMUs, which shall be added to the left edge of the DrawingML object to determine its actual left edge including effects.
Specifies the additional length, in EMUs, which shall be added to the right edge of the DrawingML object to determine its actual right edge including effects.
Specifies the additional length, in EMUs, which shall be added to the top edge of the DrawingML object to determine its actual top edge including effects.
@@ -57,7 +57,7 @@ name. The page references to a bookmark that isn't in it are left blank.
in headers and footers only on its pages, show. Those of a section whose number is undefined are left blank.
+
diff --git a/api/types/index.GraphicMediaData.html b/api/types/index.GraphicMediaData.html
index d3308b7019..1aaae857ac 100644
--- a/api/types/index.GraphicMediaData.html
+++ b/api/types/index.GraphicMediaData.html
@@ -25,7 +25,7 @@ graphic it is. This is how docx/shapes writes its shapes.
diff --git a/api/types/index.IContext.html b/api/types/index.IContext.html
index 92df5c6f54..9f6a63c1db 100644
--- a/api/types/index.IContext.html
+++ b/api/types/index.IContext.html
@@ -18,7 +18,7 @@ during the conversion of components to XML.
diff --git a/api/types/index.ICropOptions.html b/api/types/index.ICropOptions.html
index dd38d2976c..326de07158 100644
--- a/api/types/index.ICropOptions.html
+++ b/api/types/index.ICropOptions.html
@@ -19,7 +19,7 @@ side of the image.
The grid can define a grid which snaps all East Asian characters to grid positions, but leaves Latin text with its default spacing; a grid which adds the specified character pitch to each character on each row; or a grid which affects only the line pitch for the current section.
Specifies that the paragraph (or at least part of it) should be rendered on the same page as the next paragraph when possible. If multiple paragraphs are to be kept together but they exceed a page, then the set of paragraphs begin on a new page and page breaks are used thereafter as needed.
diff --git a/api/types/index.IRunOptions.html b/api/types/index.IRunOptions.html
index be1b7838d0..a49a9489b0 100644
--- a/api/types/index.IRunOptions.html
+++ b/api/types/index.IRunOptions.html
@@ -21,7 +21,7 @@ The children property can contain various inline content elements.
diff --git a/api/types/index.IRunStylePropertiesOptions.html b/api/types/index.IRunStylePropertiesOptions.html
index a5ece3cc70..b86c364f11 100644
--- a/api/types/index.IRunStylePropertiesOptions.html
+++ b/api/types/index.IRunStylePropertiesOptions.html
@@ -19,7 +19,7 @@ including font, size, bold, italic, underline, color, and other character format
@@ -140,117 +140,117 @@ including font, size, bold, italic, underline, color, and other character format
highlights all the run's text. docx used to write it as w:highlightCs, which is in no schema.
diff --git a/api/types/index.ITableCellBorders.html b/api/types/index.ITableCellBorders.html
index 8db385542b..a5a9e2157a 100644
--- a/api/types/index.ITableCellBorders.html
+++ b/api/types/index.ITableCellBorders.html
@@ -22,7 +22,7 @@ can be specified for top, bottom, left, right, start, and end edges.
@@ -46,7 +46,7 @@ If relativeHorizontalPosition is also specified, then the absoluteHorizontalPosi
If the attribute is omitted, the value is assumed to be zero.
@@ -57,7 +57,7 @@ If relativeVerticalPosition is also specified, then the absoluteVerticalPosition
If the attribute is omitted, the value is assumed to be zero.
@@ -65,7 +65,7 @@ If the attribute is omitted, the value is assumed to be zero.
below the table. The value is in twentieths of a point. If omitted, the value is assumed to be zero.
+
@@ -85,7 +85,7 @@ If omitted, the value is assumed to be page.
to the left of the table. The value is in twentieths of a point. If omitted, the value is assumed to be zero.
+
@@ -121,7 +121,7 @@ inline - the table should be vertically aligned in line with the surrounding tex
top - the table should be vertically aligned to the top edge of the anchor
+
@@ -129,7 +129,7 @@ top - the table should be vertically aligned to the top edge of the anchor
to the right of the table. The value is in twentieths of a point. If omitted, the value is assumed to be zero.
+
@@ -137,7 +137,7 @@ to the right of the table. The value is in twentieths of a point. If omitted, th
above the table. The value is in twentieths of a point. If omitted, the value is assumed to be zero.
+
@@ -88,7 +88,7 @@ When true, horizontal banding (alternating row colors) is disabled.
When false or undefined, horizontal banding is enabled if defined in the table style.
+
@@ -97,7 +97,7 @@ When true, vertical banding (alternating column colors) is disabled.
When false or undefined, vertical banding is enabled if defined in the table style.
+
diff --git a/api/types/index.ITableOfContentsOptions.html b/api/types/index.ITableOfContentsOptions.html
index 4cf9113c2b..c2109c1f72 100644
--- a/api/types/index.ITableOfContentsOptions.html
+++ b/api/types/index.ITableOfContentsOptions.html
@@ -23,7 +23,7 @@ Options correspond to field switches in the TOC field code.
@@ -59,7 +59,7 @@ The identifier designated by text in this switch's field-argument corresponds to
Use captionLabelIncludingNumbers (\c) to build a table of captions with labels and numbers.
@@ -85,7 +85,7 @@ the bookmark named by text in this switch's field-argument.
that separate an entry and its page number. The default is a tab with leader dots.
+
@@ -96,21 +96,21 @@ to the style with a style ID of HeadingX (e.g. 1 corresponds to Heading1).
If no heading range is specified, all heading levels used in the document are listed.
+
@@ -119,21 +119,21 @@ Page numbers are omitted from all levels unless a range of entry levels is speci
text in this switch's field-argument. A range is specified as for \l.
+
@@ -168,7 +168,7 @@ with each doublet being a comma-separated set of style name and table of content
text in this switch's field-argument (which is typically a letter).
+
@@ -178,14 +178,14 @@ where startLevel and endLevel are integers, and startLevel has a value equal-to
TC fields that assign entries to lower levels are skipped.
+
@@ -76,64 +76,64 @@ parent cell) when the document is packed, so the table renders the same in every
consumer. Supply explicit values to take full control of the grid.
diff --git a/api/types/index.IThemeColorsOptions.html b/api/types/index.IThemeColorsOptions.html
index aa2ab12cd5..d2f6ecb341 100644
--- a/api/types/index.IThemeColorsOptions.html
+++ b/api/types/index.IThemeColorsOptions.html
@@ -21,7 +21,7 @@ when the theme's colors change. The colors not given are Office's.
diff --git a/api/types/index.IXmlAttribute.html b/api/types/index.IXmlAttribute.html
index 476f6a1e0c..2f80bcc744 100644
--- a/api/types/index.IXmlAttribute.html
+++ b/api/types/index.IXmlAttribute.html
@@ -17,7 +17,7 @@
numbers, or booleans, which will be converted to strings in the final XML.
diff --git a/api/types/index.MathRunStyle.html b/api/types/index.MathRunStyle.html
index 5d0ba9266e..5004f84692 100644
--- a/api/types/index.MathRunStyle.html
+++ b/api/types/index.MathRunStyle.html
@@ -23,7 +23,7 @@
alphabet other than roman is plain unless given a style, as LaTeX draws its alphabets upright.
diff --git a/api/types/index.OutputByType.html b/api/types/index.OutputByType.html
index cf78f4be58..2383878f40 100644
--- a/api/types/index.OutputByType.html
+++ b/api/types/index.OutputByType.html
@@ -24,7 +24,7 @@ format determines the return type. Based on JSZip's output types.
diff --git a/api/types/index.PageNumberEstimator.html b/api/types/index.PageNumberEstimator.html
index cb02f8d465..f4ff93dcbc 100644
--- a/api/types/index.PageNumberEstimator.html
+++ b/api/types/index.PageNumberEstimator.html
@@ -38,7 +38,7 @@ page counts can be written with it.
diff --git a/api/types/index.ParagraphChild.html b/api/types/index.ParagraphChild.html
index cc4860042e..4e7ed9d991 100644
--- a/api/types/index.ParagraphChild.html
+++ b/api/types/index.ParagraphChild.html
@@ -17,7 +17,7 @@ This union type represents all valid inline content elements that can appear
within a paragraph in WordprocessingML.
diff --git a/api/types/index.RelationshipType.html b/api/types/index.RelationshipType.html
index 2247e94335..0af5dd9a1a 100644
--- a/api/types/index.RelationshipType.html
+++ b/api/types/index.RelationshipType.html
@@ -17,7 +17,7 @@
Each type corresponds to a specific kind of document component or resource.
diff --git a/api/types/index.TableRowsPatch.html b/api/types/index.TableRowsPatch.html
index 1b976ca3c8..22b1b3ea8b 100644
--- a/api/types/index.TableRowsPatch.html
+++ b/api/types/index.TableRowsPatch.html
@@ -32,7 +32,7 @@ none. The other patches are applied after the rows are repeated, so a placeholde
@@ -55,14 +55,14 @@ A field's patch can repeat rows of a table in the copy in turn, whose fields are
repeated for each part, with its item's fields, and an item without parts has no row
diff --git a/api/types/index.TemplatePageNumberEstimator.html b/api/types/index.TemplatePageNumberEstimator.html
index 7edf7ecd43..0c068b1b26 100644
--- a/api/types/index.TemplatePageNumberEstimator.html
+++ b/api/types/index.TemplatePageNumberEstimator.html
@@ -33,7 +33,7 @@ pages, are written with it.
Specifies the height of the containing block of the shape. Default is 0. It is specified in CSS units or, for elements in a group, in the coordinate system of the parent element.
Specifies the position of the left of the containing block of the shape relative to the element left of it in the flow of the page. Default is 0. It is specified in CSS units or, for elements in a group, in the coordinate system of the parent element. This property shall not be used for shapes anchored inline.
Specifies the position of the bottom of the containing block of the shape relative to the shape anchor. Default is 0. It is specified in CSS units or, for elements in a group, in the coordinate system of the parent element.
Specifies the position of the left of the containing block of the shape relative to the shape anchor. Default is 0. It is specified in CSS units or, for elements in a group, in the coordinate system of the parent element.
Specifies the position of the right of the containing block of the shape relative to the shape anchor. Default is 0. It is specified in CSS units or, for elements in a group, in the coordinate system of the parent element.
Specifies the position of the top of the containing block of the shape relative to the shape anchor. Default is 0. It is specified in CSS units or, for elements in a group, in the coordinate system of the parent element.
Specifies the type of positioning used to place an element. Default is static. When the element is contained inside a group, this property must be absolute.
Specifies relative horizontal position data for objects in WordprocessingML documents. This modifies the mso-position-horizontal property. Default is text.
Specifies relative vertical position data for objects in WordprocessingML documents. This modifies the mso-position-vertical property. Default is text.
Specifies the position of the top of the containing block of the shape relative to the element above it in the flow of the page. Default is 0. It is specified in CSS units or, for elements in a group, in the coordinate system of the parent element. This property shall not be used for shapes anchored inline.
Specifies the width of the containing block of the shape. Default is 0. It is specified in CSS units or, for elements in a group, in the coordinate system of the parent element.
Specifies the distance from the bottom of the shape to the text that wraps around it. Default is 0 pt. Note that this property is different from the CSS margin property, which changes the origin of the shape to include the margin areas. This property does not change the origin.
Specifies the distance from the left side of the shape to the text that wraps around it. Default is 0 pt. Note that this property is different from the CSS margin property, which changes the origin of the shape to include the margin areas. This property does not change the origin.
Specifies the distance from the right side of the shape to the text that wraps around it. Default is 0 pt. Note that this property is different from the CSS margin property, which changes the origin of the shape to include the margin areas. This property does not change the origin.
Specifies the distance from the top of the shape to the text that wraps around it. Default is 0 pt. Note that this property is different from the CSS margin property, which changes the origin of the shape to include the margin areas. This property does not change the origin.
Specifies whether the wrap coordinates were customized by the user. If the wrap coordinates are generated by an editor, this property is true; otherwise they were customized by a user. Default is false.
@@ -43,7 +43,7 @@ it. Italic text in a font without an italic file is measured with the upright on
a font's file has no glyph for, as Word draws it in another font
diff --git a/api/types/layout.MeasureWidth.html b/api/types/layout.MeasureWidth.html
index 964c14521b..6ca2f36d12 100644
--- a/api/types/layout.MeasureWidth.html
+++ b/api/types/layout.MeasureWidth.html
@@ -33,7 +33,7 @@ between characters and the width of scaled text, which the document's formatting
diff --git a/api/types/shapes.ConnectorEnd.html b/api/types/shapes.ConnectorEnd.html
index dbd4438281..b83c00c29d 100644
--- a/api/types/shapes.ConnectorEnd.html
+++ b/api/types/shapes.ConnectorEnd.html
@@ -38,7 +38,7 @@ bottom-left corner. On a shape without connection points, the connector ends at
diff --git a/api/types/shapes.CustomShapeGeometry.html b/api/types/shapes.CustomShapeGeometry.html
index 4d149509a3..f8057d4541 100644
--- a/api/types/shapes.CustomShapeGeometry.html
+++ b/api/types/shapes.CustomShapeGeometry.html
@@ -50,7 +50,7 @@ fill the shape. Later paths are drawn over earlier ones
diff --git a/api/types/shapes.CustomShapePath.html b/api/types/shapes.CustomShapePath.html
index 3e09f39f6b..58b393fe1c 100644
--- a/api/types/shapes.CustomShapePath.html
+++ b/api/types/shapes.CustomShapePath.html
@@ -20,7 +20,7 @@ own, so paths can overlap without cutting holes in each other.
diff --git a/api/types/shapes.CustomShapePathFill.html b/api/types/shapes.CustomShapePathFill.html
index c7a1977c25..dae6013cb9 100644
--- a/api/types/shapes.CustomShapePathFill.html
+++ b/api/types/shapes.CustomShapePathFill.html
@@ -19,7 +19,7 @@ fill made lighter or darker, as Word's preset shapes shade the top of a cube or
diff --git a/api/types/shapes.IShapeCanvasOptions.html b/api/types/shapes.IShapeCanvasOptions.html
index 77ab4e9932..2c222b795f 100644
--- a/api/types/shapes.IShapeCanvasOptions.html
+++ b/api/types/shapes.IShapeCanvasOptions.html
@@ -64,7 +64,7 @@ The shapes are not scaled.
diff --git a/api/types/shapes.IShapeConnectorOptions.html b/api/types/shapes.IShapeConnectorOptions.html
index 100e53c447..c2c67e2b57 100644
--- a/api/types/shapes.IShapeConnectorOptions.html
+++ b/api/types/shapes.IShapeConnectorOptions.html
@@ -23,7 +23,7 @@ or several connectors join the same two shapes, their ends are spread out along
@@ -64,21 +64,21 @@ or several connectors join the same two shapes, their ends are spread out along
shape, so Word doesn't move it when the connector moves
diff --git a/api/types/shapes.IShapeGroupChildOptions.html b/api/types/shapes.IShapeGroupChildOptions.html
index daa8db17c9..16a9985b62 100644
--- a/api/types/shapes.IShapeGroupChildOptions.html
+++ b/api/types/shapes.IShapeGroupChildOptions.html
@@ -20,7 +20,7 @@ in pixels, unless a layout places it, and id names it
diff --git a/api/types/shapes.IShapeGroupOptions.html b/api/types/shapes.IShapeGroupOptions.html
index cd66fa7e70..c068b4565e 100644
--- a/api/types/shapes.IShapeGroupOptions.html
+++ b/api/types/shapes.IShapeGroupOptions.html
@@ -50,7 +50,7 @@ the box around the children. A different size scales every shape in the group.
diff --git a/api/types/shapes.IShapeNestedGroupOptions.html b/api/types/shapes.IShapeNestedGroupOptions.html
index a4a1f34ce8..e63bf3b34e 100644
--- a/api/types/shapes.IShapeNestedGroupOptions.html
+++ b/api/types/shapes.IShapeNestedGroupOptions.html
@@ -47,7 +47,7 @@ box around the children, and a different size scales every child
diff --git a/api/types/shapes.IShapeOptions.html b/api/types/shapes.IShapeOptions.html
index 105482efc9..49d87078bd 100644
--- a/api/types/shapes.IShapeOptions.html
+++ b/api/types/shapes.IShapeOptions.html
@@ -23,7 +23,7 @@ or startAngle and endAngle for a "pie"
diff --git a/api/types/shapes.PresetShapeAdjustments.html b/api/types/shapes.PresetShapeAdjustments.html
index ccc3747a3c..cd9b865bf5 100644
--- a/api/types/shapes.PresetShapeAdjustments.html
+++ b/api/types/shapes.PresetShapeAdjustments.html
@@ -21,7 +21,7 @@ allows, so a value that is too large acts like the largest allowed value.
diff --git a/api/types/shapes.ShapeAdjustments.html b/api/types/shapes.ShapeAdjustments.html
index b67ff0e2c0..332b4e1cdb 100644
--- a/api/types/shapes.ShapeAdjustments.html
+++ b/api/types/shapes.ShapeAdjustments.html
@@ -23,7 +23,7 @@ It is never for shapes without handles, which take no adjustments.<
diff --git a/api/types/shapes.ShapeFlowLayout.html b/api/types/shapes.ShapeFlowLayout.html
index d99364b58d..d6b9e3ba3e 100644
--- a/api/types/shapes.ShapeFlowLayout.html
+++ b/api/types/shapes.ShapeFlowLayout.html
@@ -20,7 +20,7 @@ that connect to it, and the shapes on each level are ordered so connectors cross
@@ -52,26 +52,26 @@ with a lane goes in the band of that name, and shapes without one g
across the direction the flow runs in, each with a header at the start of the flow
diff --git a/api/types/shapes.ShapeHorizontalPosition.html b/api/types/shapes.ShapeHorizontalPosition.html
index 444b1a3075..9b149a9c76 100644
--- a/api/types/shapes.ShapeHorizontalPosition.html
+++ b/api/types/shapes.ShapeHorizontalPosition.html
@@ -26,7 +26,7 @@ a base of the page, the space between its margins, or one of its margins
diff --git a/api/types/shapes.ShapeLayout.html b/api/types/shapes.ShapeLayout.html
index 5d2f0fdcc0..43a0ac6a7b 100644
--- a/api/types/shapes.ShapeLayout.html
+++ b/api/types/shapes.ShapeLayout.html
@@ -20,7 +20,7 @@ layout, which is placed around them. Connectors are routed after the shapes are
diff --git a/api/types/shapes.ShapeSize.html b/api/types/shapes.ShapeSize.html
index 5c4f4d449d..4ae89caa91 100644
--- a/api/types/shapes.ShapeSize.html
+++ b/api/types/shapes.ShapeSize.html
@@ -19,7 +19,7 @@ percentage of the space between the page's margins, or of what floating.si
diff --git a/api/types/shapes.ShapeTextWarp.html b/api/types/shapes.ShapeTextWarp.html
index 9232ab414a..9823f9c480 100644
--- a/api/types/shapes.ShapeTextWarp.html
+++ b/api/types/shapes.ShapeTextWarp.html
@@ -19,7 +19,7 @@ The ...Filled arches, circle and button spread the text over the wh
diff --git a/api/types/shapes.ShapeThemeColor.html b/api/types/shapes.ShapeThemeColor.html
index 8c7236a18e..186c017aaf 100644
--- a/api/types/shapes.ShapeThemeColor.html
+++ b/api/types/shapes.ShapeThemeColor.html
@@ -20,7 +20,7 @@ same as docx's ThemeColor, which text, borders and sha
diff --git a/api/types/shapes.ShapeTransformation.html b/api/types/shapes.ShapeTransformation.html
index ab2c0fad21..857f87b2d5 100644
--- a/api/types/shapes.ShapeTransformation.html
+++ b/api/types/shapes.ShapeTransformation.html
@@ -30,7 +30,7 @@ between the margins for a floating shape, such as "100%"<
diff --git a/api/types/shapes.ShapeTreeLayout.html b/api/types/shapes.ShapeTreeLayout.html
index 6475af1b5b..5a35f56987 100644
--- a/api/types/shapes.ShapeTreeLayout.html
+++ b/api/types/shapes.ShapeTreeLayout.html
@@ -20,7 +20,7 @@ children are placed side by side below their parent, which is centred over them.
diff --git a/api/types/shapes.ShapeVerticalPosition.html b/api/types/shapes.ShapeVerticalPosition.html
index 11918755d6..3d2f7962d2 100644
--- a/api/types/shapes.ShapeVerticalPosition.html
+++ b/api/types/shapes.ShapeVerticalPosition.html
@@ -26,7 +26,7 @@ a base of the page, the space between its margins, or one of its margins
diff --git a/api/variables/index.CharacterSet.html b/api/variables/index.CharacterSet.html
index cc88383159..28fd2861eb 100644
--- a/api/variables/index.CharacterSet.html
+++ b/api/variables/index.CharacterSet.html
@@ -60,7 +60,7 @@ Maps character set names to their hexadecimal identifiers.
diff --git a/api/variables/index.DocumentAttributeNamespaces.html b/api/variables/index.DocumentAttributeNamespaces.html
index 495b3ced57..6d61fe3f52 100644
--- a/api/variables/index.DocumentAttributeNamespaces.html
+++ b/api/variables/index.DocumentAttributeNamespaces.html
@@ -94,7 +94,7 @@ in a document, including WordprocessingML, DrawingML, VML, and others.
When this value is set, the input specified via the user interface may be restricted to the number of lines per page and characters per line, with the consumer or producer translating this information based on the current font data to get the resulting line and character pitch values
diff --git a/api/variables/index.DropCapType.html b/api/variables/index.DropCapType.html
index f102c03c34..40f89312d6 100644
--- a/api/variables/index.DropCapType.html
+++ b/api/variables/index.DropCapType.html
@@ -32,7 +32,7 @@ beginning of a paragraph. This enum defines how the drop cap should be positione
diff --git a/api/variables/index.EMPTY_OBJECT.html b/api/variables/index.EMPTY_OBJECT.html
index f7094f8057..08abcb78ad 100644
--- a/api/variables/index.EMPTY_OBJECT.html
+++ b/api/variables/index.EMPTY_OBJECT.html
@@ -20,7 +20,7 @@ has no children or attributes.
diff --git a/api/variables/index.EmphasisMarkType.html b/api/variables/index.EmphasisMarkType.html
index 9b90b04c71..6f8bcadb41 100644
--- a/api/variables/index.EmphasisMarkType.html
+++ b/api/variables/index.EmphasisMarkType.html
@@ -31,7 +31,7 @@ Emphasis marks are commonly used in East Asian typography.
Specifies that this header or footer shall appear on the first page in this section. The appearance of this header or footer is contingent on the setting of the titlePg element (§2.10.6).
diff --git a/api/variables/index.LevelFormat.html b/api/variables/index.LevelFormat.html
index 114a66afc2..2d14795687 100644
--- a/api/variables/index.LevelFormat.html
+++ b/api/variables/index.LevelFormat.html
@@ -281,7 +281,7 @@ decimal, roman numerals, letters, and various international formats.
diff --git a/api/variables/index.PageTextDirectionType.html b/api/variables/index.PageTextDirectionType.html
index cab6e917d7..fa1b5faf28 100644
--- a/api/variables/index.PageTextDirectionType.html
+++ b/api/variables/index.PageTextDirectionType.html
@@ -28,7 +28,7 @@ vertically (top-to-bottom), commonly used for East Asian languages.
Top-to-bottom, right-to-left (vertical East Asian text flow)
diff --git a/api/variables/index.ShadingType.html b/api/variables/index.ShadingType.html
index 908f81e794..cf076cfa65 100644
--- a/api/variables/index.ShadingType.html
+++ b/api/variables/index.ShadingType.html
@@ -103,7 +103,7 @@ color and the pattern color.
diff --git a/api/variables/index.TextEffect.html b/api/variables/index.TextEffect.html
index b911cf24cf..a6db4034a9 100644
--- a/api/variables/index.TextEffect.html
+++ b/api/variables/index.TextEffect.html
@@ -56,7 +56,7 @@ these effects are deprecated and may not be supported by all applications.
diff --git a/api/variables/index.VerticalAlign.html b/api/variables/index.VerticalAlign.html
index ed960a02e1..35379ea37f 100644
--- a/api/variables/index.VerticalAlign.html
+++ b/api/variables/index.VerticalAlign.html
@@ -32,7 +32,7 @@ backward-compatibility and will be removed in the next major release.
diff --git a/api/variables/index.VerticalAlignTable.html b/api/variables/index.VerticalAlignTable.html
index 753fdfe32d..0d3cdc3db9 100644
--- a/api/variables/index.VerticalAlignTable.html
+++ b/api/variables/index.VerticalAlignTable.html
@@ -28,7 +28,7 @@ are valid according to ECMA-376 (§17.18.87 ST_VerticalJc within <w:tcP
diff --git a/api/variables/index.VerticalMergeType.html b/api/variables/index.VerticalMergeType.html
index 19dbc99693..6512449579 100644
--- a/api/variables/index.VerticalMergeType.html
+++ b/api/variables/index.VerticalMergeType.html
@@ -29,7 +29,7 @@ This cell continues a vertical merge started by a cell above it.
This cell begins a new vertical merge region.
diff --git a/api/variables/index.bookmarkUniqueNumericId.html b/api/variables/index.bookmarkUniqueNumericId.html
index 62b79d97e5..355195b802 100644
--- a/api/variables/index.bookmarkUniqueNumericId.html
+++ b/api/variables/index.bookmarkUniqueNumericId.html
@@ -27,7 +27,7 @@ than a generator per instance.
diff --git a/api/variables/index.docPropertiesUniqueNumericId.html b/api/variables/index.docPropertiesUniqueNumericId.html
index cc7d2be4fc..095c842aef 100644
--- a/api/variables/index.docPropertiesUniqueNumericId.html
+++ b/api/variables/index.docPropertiesUniqueNumericId.html
@@ -28,7 +28,7 @@ one counter rather than a generator per instance.
diff --git a/api/variables/layout.estimatePageNumbers.html b/api/variables/layout.estimatePageNumbers.html
index c6ac1548bb..1708865e80 100644
--- a/api/variables/layout.estimatePageNumbers.html
+++ b/api/variables/layout.estimatePageNumbers.html
@@ -40,7 +40,7 @@ asking to update the fields, unless the document has updateFields o
diff --git a/live-examples/lib/layout.iife.js b/live-examples/lib/layout.iife.js
index 5c85672352..14589d963b 100644
--- a/live-examples/lib/layout.iife.js
+++ b/live-examples/lib/layout.iife.js
@@ -801,6 +801,29 @@ var docxLayout = (function(exports) {
};
};
/**
+ * Reads what a table style (`w:style` of type "table") gives its tables beyond paragraph and run formatting: the margins
+ * of their cells, its table, row and cell properties, and the parts of its formatting for some of their cells.
+ */
+ var readTableStyle = (children, themeFonts) => {
+ const tableProperties = childrenOf(find(children, "w:tblPr"));
+ return {
+ cellMargins: readCellMargins(find(tableProperties, "w:tblCellMar")),
+ tableProperties,
+ rowProperties: childrenOf(find(children, "w:trPr")),
+ cellProperties: childrenOf(find(children, "w:tcPr")),
+ conditional: new Map(children.filter((child) => "w:tblStylePr" in child).map((child) => {
+ const parts = childrenOf(child["w:tblStylePr"]);
+ return [String(attributesOf(child["w:tblStylePr"])["w:type"]), {
+ run: readRunFormat(find(parts, "w:rPr"), themeFonts),
+ paragraph: readParagraphFormat(find(parts, "w:pPr")),
+ tableProperties: childrenOf(find(parts, "w:tblPr")),
+ rowProperties: childrenOf(find(parts, "w:trPr")),
+ cellProperties: childrenOf(find(parts, "w:tcPr"))
+ }];
+ }))
+ };
+ };
+ /**
* Reads the document's defaults and styles from its styles part (`w:styles`), once it is formatted, with the fonts of
* its theme.
*/
@@ -824,7 +847,7 @@ var docxLayout = (function(exports) {
}) }), {}, {
run: readRunFormat(find(children, "w:rPr"), themeFonts),
paragraph: readParagraphFormat(find(children, "w:pPr"))
- }, attributes["w:type"] === "table" ? { cellMargins: readCellMargins(find(childrenOf(find(children, "w:tblPr")), "w:tblCellMar")) } : {})
+ }, attributes["w:type"] === "table" ? readTableStyle(children, themeFonts) : {})
};
}).filter((style) => style.id !== void 0);
const defaultStyle = (type) => {
@@ -1848,21 +1871,26 @@ var docxLayout = (function(exports) {
*/
var fitColumns = (table, available, measure) => {
var _tableWidth$width;
- const { fit, widen, rows } = table;
+ const { fit, widen, rows, indent = 0 } = table;
if (!fit && !widen) return table;
+ if (fit && rows.some(({ cells }) => cells.some(({ vertical }) => vertical))) return _objectSpread2(_objectSpread2({}, table), {}, { unsupported: "text that runs up or down a cell of a table sized to its text" });
const content = measureCells(table, measure);
+ const spaced = table.cellSpacing !== void 0;
if (widen) {
- if (!rows.some(({ cells }) => cells.some((cell) => content.get(cell).min > cell.ownWidth))) return table;
- if (widen.acrossColumns) return _objectSpread2(_objectSpread2({}, table), {}, { unsupported: "a word longer than its cell in a table with cells merged across columns" });
+ const tooLong = rows.flatMap(({ cells }) => cells.filter((cell) => content.get(cell).min > cell.ownWidth));
+ if (tooLong.length === 0 && !spaced) return table;
+ if (tooLong.length > 0 && widen.acrossColumns) return _objectSpread2(_objectSpread2({}, table), {}, { unsupported: "a word longer than its cell in a table with cells merged across columns" });
+ if (tooLong.length > 0 && spaced) return _objectSpread2(_objectSpread2({}, table), {}, { unsupported: "a long word in a table with space between its cells" });
+ if (tooLong.some(({ vertical }) => vertical)) return _objectSpread2(_objectSpread2({}, table), {}, { unsupported: "a long word in text that runs up or down a table cell" });
}
const { columns, unsettled } = sizeColumns(table, content);
const total = sum$1(columns.map(({ width }) => width));
const tableWidth = fit !== null && fit !== void 0 ? fit : widen;
const target = (_tableWidth$width = tableWidth.width) !== null && _tableWidth$width !== void 0 ? _tableWidth$width : tableWidth.share === void 0 ? void 0 : tableWidth.share * available;
- const room = target !== null && target !== void 0 ? target : available;
+ const room = target !== null && target !== void 0 ? target : available - indent;
if (widen) {
if (sum$1(columns.map(({ min }) => min)) > room) return _objectSpread2(_objectSpread2({}, table), {}, { unsupported: "a word longer than its table can make room for" });
- if (target !== void 0 && total < target) return _objectSpread2(_objectSpread2({}, table), {}, { unsupported: "a long word in a table wider than its cells" });
+ if (target !== void 0 && total < target) return _objectSpread2(_objectSpread2({}, table), {}, { unsupported: spaced ? "space between the cells of a table wider than its cells" : "a long word in a table wider than its cells" });
}
if (unsettled.includes("always") || unsettled.length > 0 && total > room) return _objectSpread2(_objectSpread2({}, table), {}, { unsupported: "a long word in cells merged across columns" });
const given = columns.filter((column) => column.given);
@@ -2608,9 +2636,29 @@ var docxLayout = (function(exports) {
const outer = withOuterSpace ? ((_parts$0$before = (_parts$ = parts[0]) === null || _parts$ === void 0 ? void 0 : _parts$.before) !== null && _parts$0$before !== void 0 ? _parts$0$before : 0) + ((_parts$after = (_parts = parts[parts.length - 1]) === null || _parts === void 0 ? void 0 : _parts.after) !== null && _parts$after !== void 0 ? _parts$after : 0) : 0;
return sum(parts.map(({ height, before }, index) => height + (index === 0 ? 0 : between(parts[index - 1].after, before)))) + outer;
};
- const cellHeight = (cell) => cell.marginTop + stackHeight(cell.blocks, cell.width, true) + cell.marginBottom;
+ /**
+ * The blocks of a cell that take room: all of them, but an empty paragraph that ends a cell whose mark takes none
+ * (`w:hideMark`), as in Word (`word-watertight-tables.docx` TB7)
+ */
+ const blocksWithRoom = ({ blocks: stack, hideMark }) => {
+ const last = stack[stack.length - 1];
+ const empty = (last === null || last === void 0 ? void 0 : last.type) === "paragraph" && last.items.every(({ type }) => type === "marker");
+ return hideMark && empty ? stack.slice(0, -1) : stack;
+ };
+ /**
+ * How tall a cell's text makes its row. Text that runs up or down a cell makes it as tall as a line of its paragraph
+ * mark, whatever its size, as Word breaks the text into lines as long as the row is tall (`word-watertight-tables.docx`
+ * TB6, `word-table-formats.docx` VT1, `word-table-formats2.docx` VT5 to VT7)
+ */
+ const contentHeight = (cell) => {
+ if (!cell.vertical) return stackHeight(blocksWithRoom(cell), cell.width, true);
+ const [first] = cell.blocks;
+ return linesHeight(measureParagraph(_objectSpread2(_objectSpread2({}, first), {}, { items: [] }), cell.width, void 0, void 0, true).lines);
+ };
+ /** How tall a cell makes its row with its own margins, as a cell merged down rows does */
+ const cellHeight = (cell) => cell.marginTop + contentHeight(cell) + cell.marginBottom;
/** The cells merged down several rows of a table: the row each starts in, its last row, and the height its text needs */
- const mergesOf = ({ rows }) => rows.flatMap(({ cells }, first) => cells.filter(({ verticalMerge }) => verticalMerge === "restart").map((cell) => {
+ const mergesOf = ({ rows }) => rows.flatMap(({ cells }, first) => cells.filter(({ verticalMerge, vertical }) => verticalMerge === "restart" && !vertical).map((cell) => {
const span = rows.slice(first + 1).findIndex((row) => {
var _row$cells$find;
return ((_row$cells$find = row.cells.find((other) => other.column === cell.column)) === null || _row$cells$find === void 0 ? void 0 : _row$cells$find.verticalMerge) !== "continue";
@@ -2622,13 +2670,15 @@ var docxLayout = (function(exports) {
};
}));
/**
- * The height of each row of a table: its tallest cell, with the cell's margins, or the row's own height, and its
- * borders. Cells merged down several rows make the last of them taller when their text needs more room.
+ * The height of each row of a table: its tallest cell's text, with the largest of its cells' margins, or the row's own
+ * height, and its borders. Cells merged down several rows make the last of them taller when their text needs more room.
*/
const rowHeights = (table, merges = mergesOf(table)) => {
const { rows } = table;
const heights = rows.map(({ cells, height, borderTop, borderBottom }) => {
- const natural = Math.max(0, ...cells.filter(({ verticalMerge }) => verticalMerge === void 0).map(cellHeight));
+ const own = cells.filter(({ verticalMerge }) => verticalMerge === void 0);
+ const largest = (lengths) => Math.max(0, ...lengths);
+ const natural = own.length === 0 ? 0 : largest(own.map(({ marginTop }) => marginTop)) + largest(own.map(contentHeight)) + largest(own.map(({ marginBottom }) => marginBottom));
return (height === void 0 ? natural : height.rule === "exact" ? height.value : Math.max(height.value, natural)) + borderTop + borderBottom;
});
return merges.reduce((current, { first, last, height }) => {
@@ -3251,6 +3301,41 @@ var docxLayout = (function(exports) {
if (reserved() > areaOf(pageNotes, void 0, continued) + TOLERANCE) stopOnPage("a footnote in columns that moves its reference to the next page");
};
/**
+ * Whether Word keeps a table row with the next: when the first paragraph of its first cell is kept with the next
+ * (`word-watertight-tables.docx` TB5, `word-table-formats.docx` KR1). Its other paragraphs don't keep it (KR2)
+ */
+ const keptWithNext = ({ cells }) => {
+ var _cells$0$blocks, _cells$;
+ const [first] = (_cells$0$blocks = (_cells$ = cells[0]) === null || _cells$ === void 0 ? void 0 : _cells$.blocks) !== null && _cells$0$blocks !== void 0 ? _cells$0$blocks : [];
+ return (first === null || first === void 0 ? void 0 : first.type) === "paragraph" && first.format.keepNext === true;
+ };
+ /**
+ * The last of the rows of a table from one (`index`) that are kept together, because each but the last is kept with
+ * the next. The row itself when it isn't kept with the next, or is the table's last
+ */
+ const keptRowsEnd = ({ rows }, index) => {
+ let end = index;
+ while (end < rows.length - 1 && keptWithNext(rows[end])) end++;
+ return end;
+ };
+ /**
+ * The largest margins above and below of a row's cells, which Word puts around every cell's text in the row
+ * (`word-table-formats2.docx` MG1 to MG4)
+ */
+ const rowMarginsOf = ({ cells }) => Math.max(0, ...cells.map(({ marginTop }) => marginTop)) + Math.max(0, ...cells.map(({ marginBottom }) => marginBottom));
+ /**
+ * The least of a row that goes on a page when it breaks across pages after the rows kept with it, as the paragraphs
+ * kept with the next keep the next paragraph's first lines: in each cell, its first paragraph's first lines, all of them
+ * when it is kept together or widow control keeps them together, with the row's margins around them
+ */
+ const leastPartOf = (row) => row.borderTop + rowMarginsOf(row) + Math.max(0, ...row.cells.filter(({ vertical }) => !vertical).map((cell) => {
+ const [first, second] = blocksWithRoom(cell);
+ if (first === void 0 || first.type === "table") return first === void 0 ? 0 : sum(rowHeights(sizedToPlace(first, cell.width)));
+ const { lines, spaceBefore, spaceAfter: after, keepLines, widowControl } = measureParagraph(first, cell.width, void 0, second, true);
+ const count = keepLines || widowControl && lines.length <= 3 ? lines.length : widowControl ? 2 : 1;
+ return spaceBefore + linesHeight(lines.slice(0, count)) + (count >= lines.length ? after : 0);
+ }));
+ /**
* Whether a table row could break across pages between the lines of its cells: one not kept whole, with more than a
* line in a cell
*/
@@ -3563,10 +3648,11 @@ var docxLayout = (function(exports) {
*
* @param breakBorder - The border below the row on a page where the table breaks: the table's bottom border, which the
* last row has counted already
+ * @param table - Whether the table has space between its cells, and whether the row before is kept with this one
*/
- const splitRow = (row, rowIndex, height, breakBorder, startTablePage) => {
- let parts = row.cells.map((cell) => cell.blocks.map((block, index) => ({
- paragraph: block.type === "paragraph" ? measureParagraph(block, cell.width, cell.blocks[index - 1], cell.blocks[index + 1], true) : _objectSpread2(_objectSpread2({}, UNBROKEN), {}, { lines: [{
+ const splitRow = (row, rowIndex, height, breakBorder, startTablePage, table) => {
+ let parts = row.cells.map((cell) => (cell.vertical ? [] : blocksWithRoom(cell)).map((block, index, stack) => ({
+ paragraph: block.type === "paragraph" ? measureParagraph(block, cell.width, stack[index - 1], stack[index + 1], true) : _objectSpread2(_objectSpread2({}, UNBROKEN), {}, { lines: [{
height: sum(rowHeights(sizedToPlace(block, cell.width))),
markers: markersOf(block),
text: "",
@@ -3575,10 +3661,12 @@ var docxLayout = (function(exports) {
from: 0
})));
let isFirstPart = true;
+ const roomless = row.cells.flatMap((cell) => (cell.vertical ? cell.blocks : cell.blocks.slice(blocksWithRoom(cell).length)).flatMap(markersOf));
+ if (notesIn(roomless).length > 0) throw new Unsupported("a footnote in text that runs up or down a table cell");
const borders = row.borderTop + row.borderBottom;
- const margins = (cell) => row.cells[cell].marginTop + row.cells[cell].marginBottom;
+ const rowMargins = rowMarginsOf(row);
/** How tall the cells' parts make the row's, with their margins */
- const tallestOf = (cells) => Math.max(...cells.map((part, cell) => margins(cell) + part.height));
+ const tallestOf = (cells) => Math.max(...cells.map((part) => rowMargins + part.height));
const notesOf = (cells) => notesIn(cells.flatMap(({ lines }) => lines.flatMap(({ markers }) => markers)));
const placesAny = (cells) => cells.some(({ lines }) => lines.length > 0);
/** The room for the row's part on the page, above footnotes that take this much more room */
@@ -3593,13 +3681,13 @@ var docxLayout = (function(exports) {
*/
const partOnPage = (left, isFirst) => {
/** Each cell's part in a room for the row's, or the part given for one of them (`cut`) */
- const fill = (room, cut) => left.map((paragraphs, cell) => cell === (cut === null || cut === void 0 ? void 0 : cut.cell) ? cut.part : fillCell(paragraphs, room - margins(cell), isFirst));
+ const fill = (room, cut) => left.map((paragraphs, cell) => cell === (cut === null || cut === void 0 ? void 0 : cut.cell) ? cut.part : fillCell(paragraphs, room - rowMargins, isFirst));
const whole = fill(roomAbove(0));
let cutAt = roomAbove(0);
let filled = whole;
while (placesAny(filled) && !fitsWith(filled, leastNoteRoom(notesOf(filled)))) {
if (section().columns.length > 1) stopAtPartOfFootnote([], notesOf(filled), roomAbove(0) - tallestOf(filled));
- cutAt = Math.max(...filled.map((part, cell) => part.lines.length > 0 ? margins(cell) + part.height : 0)) - 2 * TOLERANCE;
+ cutAt = Math.max(...filled.map((part) => part.lines.length > 0 ? rowMargins + part.height : 0)) - 2 * TOLERANCE;
filled = fill(cutAt);
}
const continues = placesAny(filled) && !fitsWith(filled, moreNoteRoom(notesOf(filled)));
@@ -3607,9 +3695,9 @@ var docxLayout = (function(exports) {
const name = notesOf(filled)[notesOf(filled).length - 1];
const cell = filled.findLastIndex(({ lines }) => lines.some(({ markers }) => markers.includes(name)));
const reference = filled[cell].lines.findIndex(({ markers }) => markers.includes(name)) + 1;
- let part = fillCell(left[cell], cutAt - margins(cell), isFirst, reference);
- for (let limit = reference + 1; part.lines.length < reference; limit++) part = fillCell(left[cell], cutAt - margins(cell), isFirst, limit);
- filled = fill(margins(cell) + part.height, {
+ let part = fillCell(left[cell], cutAt - rowMargins, isFirst, reference);
+ for (let limit = reference + 1; part.lines.length < reference; limit++) part = fillCell(left[cell], cutAt - rowMargins, isFirst, limit);
+ filled = fill(rowMargins + part.height, {
cell,
part
});
@@ -3619,7 +3707,7 @@ var docxLayout = (function(exports) {
if (!fitsWith(whole, moreNoteRoom(notesOf(whole)))) {
const referring = whole.flatMap((part, cell) => notesOf([part]).length > 0 ? [cell] : []);
const heldRoom = continues ? tallestOf(filled) : roomAbove(noteRoom);
- const heldBack = (part, cell) => referring.some((other) => other !== cell) && fillCell(left[cell], heldRoom - margins(cell), isFirst).fits > part.lines.length;
+ const heldBack = (part, cell) => referring.some((other) => other !== cell) && fillCell(left[cell], heldRoom - rowMargins, isFirst).fits > part.lines.length;
if (filled.some(heldBack)) throw new Unsupported("a footnote in a table row beside a cell whose lines it holds back");
}
return {
@@ -3637,14 +3725,17 @@ var docxLayout = (function(exports) {
if (placesLines && !isLastPart) {
if (row.cells.some(({ verticalMerge }) => verticalMerge !== void 0)) throw new Unsupported("a table row with merged cells across pages");
if (row.cells.some((cell) => cell.blocks.some(({ type }) => type === "table"))) throw new Unsupported("a table in a table row across pages");
+ if (row.cells.some(({ vertical }) => vertical)) throw new Unsupported("text that runs up or down a table cell across pages");
+ if (table.spaced) throw new Unsupported("a table row with space between its cells across pages");
}
const fitsWhole = !isFirstPart || position + height + breakBorder <= linesBottom() + TOLERANCE;
if ((!placesLines || !fitsWhole) && !placedInColumn && continued === void 0) {
stopIfBalancing();
throw new Unsupported(fitsWhole && notesOf(whole).length > 0 ? "a table row and its footnote taller than a page" : "a table row taller than a page");
}
+ if (!placesLines && isFirstPart && table.kept) throw new Unsupported("a table row kept with the next before a row that moves to the next page");
if (placesLines) {
- mark(filled.flatMap(({ lines }) => lines.flatMap(({ markers }) => markers)));
+ mark([...filled.flatMap(({ lines }) => lines.flatMap(({ markers }) => markers)), ...roomless]);
const rowPart = isLastPart ? (isFirstPart ? height - borders : tallestOf(filled)) + borders : tallestOf(filled) + borders + breakBorder;
placeRow(rowIndex, position, rowPart);
position += rowPart;
@@ -3692,15 +3783,54 @@ var docxLayout = (function(exports) {
*/
const rowStays = (height, notes) => position + height <= linesBottom(leastNoteRoom(notes)) + TOLERANCE;
const markersIn = (row) => row.cells.flatMap((cell) => cell.blocks.flatMap(markersOf));
+ /**
+ * What the table's last row is kept with when it is kept with the next: the first lines of the paragraph after the
+ * table, or what keeps with them, as for a paragraph kept with the next, when it is in the same section
+ */
+ const afterTable = () => {
+ const next = blocks[blockIndex + 1];
+ return next === void 0 || next.section !== blocks[blockIndex].section ? {
+ height: 0,
+ notes: []
+ } : keptHeight(blockIndex + 1, section().columns[column]);
+ };
+ let brokenUntil = -1;
+ /**
+ * Moves the rows kept with the next from one (`index`) to the next page or column, with what they are kept with, when
+ * they don't fit on this one with it, as Word keeps them (`word-watertight-tables.docx` TB5): the next row, or the
+ * first lines of the paragraph after the table when the last row is kept with the next (`word-table-formats.docx`
+ * KR3, KR4), or, where the next row breaks across pages, as much of it as must go on the page with them (KR7). Rows
+ * that don't fit on a page of their own break across pages where it ends, as Word breaks them (KR5)
+ */
+ const placeKeptRows = (index) => {
+ var _following$notes, _table$rows$end$break;
+ const end = keptRowsEnd(table, index);
+ const last = table.rows.length - 1;
+ const keptPastTable = end === last && keptWithNext(table.rows[last]);
+ if (end === index && !keptPastTable || index <= brokenUntil) return;
+ const following = keptPastTable ? afterTable() : void 0;
+ const kept = table.rows.slice(index, end + 1);
+ const keptNotes = [...notesIn(kept.flatMap(markersIn)), ...(_following$notes = following === null || following === void 0 ? void 0 : following.notes) !== null && _following$notes !== void 0 ? _following$notes : []];
+ const together = sum(heights.slice(index, end + 1)) + (end < last ? (_table$rows$end$break = table.rows[end].breakBorder) !== null && _table$rows$end$break !== void 0 ? _table$rows$end$break : bottomBorder : 0);
+ const fitsHere = () => {
+ var _following$height, _table$rows$end$break2;
+ return rowStays(together + ((_following$height = following === null || following === void 0 ? void 0 : following.height) !== null && _following$height !== void 0 ? _following$height : 0), keptNotes) || !keptPastTable && canSplit(table.rows[end]) && rowStays(sum(heights.slice(index, end)) + leastPartOf(table.rows[end]) + ((_table$rows$end$break2 = table.rows[end].breakBorder) !== null && _table$rows$end$break2 !== void 0 ? _table$rows$end$break2 : bottomBorder), keptNotes);
+ };
+ if (fitsHere()) return;
+ if (placedInColumn || continued !== void 0) startTablePage(index);
+ if (!fitsHere()) brokenUntil = end;
+ };
const bottomBorder = (_table$rows$borderBot = (_table$rows = table.rows[table.rows.length - 1]) === null || _table$rows === void 0 ? void 0 : _table$rows.borderBottom) !== null && _table$rows$borderBot !== void 0 ? _table$rows$borderBot : 0;
for (const [index, row] of table.rows.entries()) {
- var _row$height3;
- const breakBorder = index < table.rows.length - 1 ? bottomBorder : 0;
+ var _row$breakBorder, _row$height3;
+ const breakBorder = index < table.rows.length - 1 ? (_row$breakBorder = row.breakBorder) !== null && _row$breakBorder !== void 0 ? _row$breakBorder : bottomBorder : 0;
const height = heights[index];
const roomNeeded = height + breakBorder;
const markers = markersIn(row);
const notes = notesIn(markers);
const keptWhole = row.cantSplit || ((_row$height3 = row.height) === null || _row$height3 === void 0 ? void 0 : _row$height3.rule) === "exact";
+ if (table.cellSpacing !== void 0 && row.breakBorder === void 0 && !rowFits(roomNeeded, notes)) throw new Unsupported("a table with space between its cells and borders across pages");
+ placeKeptRows(index);
while (keptWhole && !rowStays(roomNeeded, notes) && (placedInColumn || continued !== void 0)) {
if (section().columns.length > 1) stopAtPartOfFootnote([], notes, linesBottom() - position - roomNeeded);
startTablePage(index);
@@ -3711,7 +3841,10 @@ var docxLayout = (function(exports) {
if (rows.length > 1 && !rowFits(sum(heights.slice(index, index + rows.length)), notesIn(rows.flatMap(markersIn)))) throw new Unsupported("a table row with merged cells across pages");
}
if (!rowFits(roomNeeded, notes) && !keptWhole) {
- splitRow(row, index, height, breakBorder, () => startTablePage(index));
+ splitRow(row, index, height, breakBorder, () => startTablePage(index), {
+ spaced: table.cellSpacing !== void 0,
+ kept: index > brokenUntil && index > 0 && keptWithNext(table.rows[index - 1])
+ });
continue;
}
if (!rowStays(roomNeeded, notes)) {
@@ -3753,12 +3886,11 @@ var docxLayout = (function(exports) {
keptWith: "nothing"
};
if (anchor.type === "table") {
- var _rowHeights$;
- const [firstRow] = anchor.rows;
const sized = anchor.unsupported ? anchor : fitted(anchor, width);
+ const rows = sized.unsupported ? [] : sized.rows.slice(0, keptRowsEnd(sized, 0) + 1);
return {
- height: keptLines + lastAfter + (sized.unsupported ? 0 : (_rowHeights$ = rowHeights(sized)[0]) !== null && _rowHeights$ !== void 0 ? _rowHeights$ : 0),
- notes: [...keptNotes, ...notesIn(firstRow ? firstRow.cells.flatMap((cell) => cell.blocks.flatMap(markersOf)) : [])],
+ height: keptLines + lastAfter + sum(sized.unsupported ? [] : rowHeights(sized).slice(0, rows.length)),
+ notes: [...keptNotes, ...notesIn(rows.flatMap(({ cells }) => cells.flatMap((cell) => cell.blocks.flatMap(markersOf))))],
kept: keptNotes,
keptWith: "part"
};
@@ -4023,6 +4155,359 @@ var docxLayout = (function(exports) {
measureLineHeight
});
//#endregion
+ //#region src/layout/table-formats.ts
+ /**
+ * Reads the formatting of a table that changes how its rows and cells are laid out, beyond their widths: its borders and
+ * its cells', the space between its cells, and which parts of its table style apply to each cell.
+ *
+ * @module
+ */
+ var EIGHTHS_PER_POINT$1 = 8;
+ var NONE = {
+ style: "none",
+ width: 0
+ };
+ /**
+ * The room a border of each style takes from what is beside it, in points, from its width, as Word's PDFs showed it at
+ * half a point, 1.5 points and 3 points (`word-table-formats.docx` and `word-table-formats2.docx` BS, `word-rules.docx`
+ * P5): a line its width, a double line three times it, a triple five times it, and lines with gaps between them their
+ * thick line's width, or twice or three times it, and 1.5, 2.25 or 3 points more. A double wave and a stroked dash-dot
+ * line take 5.25 and 3 points whatever their width
+ */
+ var ROOMS = _objectSpread2(_objectSpread2({}, Object.fromEntries([
+ "single",
+ "thick",
+ "dotted",
+ "dashed",
+ "dotDash",
+ "dotDotDash",
+ "dashSmallGap",
+ "outset",
+ "inset"
+ ].map((style) => [style, (width) => width]))), {}, {
+ double: (width) => 3 * width,
+ triple: (width) => 5 * width,
+ thinThickSmallGap: (width) => width + 1.5,
+ thickThinSmallGap: (width) => width + 1.5,
+ thinThickThinSmallGap: (width) => width + 3,
+ thinThickMediumGap: (width) => 2 * width,
+ thickThinMediumGap: (width) => 2 * width,
+ thinThickThinMediumGap: (width) => 3 * width,
+ thinThickLargeGap: (width) => width + 2.25,
+ thickThinLargeGap: (width) => width + 2.25,
+ thinThickThinLargeGap: (width) => 2 * width + 3,
+ doubleWave: () => 5.25,
+ dashDotStroked: () => 3
+ });
+ /**
+ * The room borders of the styles whose room doesn't follow from their width take, in points, by their width: only at
+ * the widths Word's PDFs have shown them at
+ */
+ var ROOMS_BY_WIDTH = {
+ wave: {
+ .5: 3,
+ 1.5: 3.75,
+ 3: 3
+ },
+ threeDEmboss: {
+ .5: 2,
+ 1.5: 3,
+ 3: 6
+ },
+ threeDEngrave: {
+ .5: 2,
+ 1.5: 3,
+ 3: 6
+ }
+ };
+ /** Reads a border (`w:top` and the others, in `w:tblBorders` and `w:tcBorders`) */
+ var readBorder = (element) => {
+ var _attributes$wVal, _numberOf, _numberOf2;
+ const attributes = attributesOf(element);
+ const style = String((_attributes$wVal = attributes["w:val"]) !== null && _attributes$wVal !== void 0 ? _attributes$wVal : "none");
+ const width = ((_numberOf = numberOf(attributes["w:sz"])) !== null && _numberOf !== void 0 ? _numberOf : 0) / EIGHTHS_PER_POINT$1;
+ const space = (_numberOf2 = numberOf(attributes["w:space"])) !== null && _numberOf2 !== void 0 ? _numberOf2 : 0;
+ return style === "nil" || style === "none" || width === 0 ? NONE : _objectSpread2({
+ style,
+ width
+ }, space > 0 ? { space } : {});
+ };
+ var SIDES = [
+ ["top", ["w:top"]],
+ ["bottom", ["w:bottom"]],
+ ["left", ["w:start", "w:left"]],
+ ["right", ["w:end", "w:right"]],
+ ["insideH", ["w:insideH"]],
+ ["insideV", ["w:insideV"]]
+ ];
+ /**
+ * Reads the borders of a table (`w:tblBorders`) or a cell (`w:tcBorders`): those it gives, by their side. A cell's start
+ * and end are its left and right, as they are in text that runs left to right.
+ */
+ var readBorderSet = (element) => {
+ const children = childrenOf(element);
+ return Object.fromEntries(SIDES.flatMap(([side, names]) => {
+ const given = names.map((name) => find(children, name)).find((border) => border !== void 0);
+ return given === void 0 ? [] : [[side, readBorder(given)]];
+ }));
+ };
+ /** Whether a border is drawn */
+ var isDrawn = (border) => border !== void 0 && border.style !== "none";
+ /**
+ * The room a border takes from what is beside it, in points: its line's room and the space between it and the text,
+ * which Word adds to it (BS31). Undefined for a style or width whose room Word's PDFs haven't shown.
+ */
+ var roomOf = (border) => {
+ var _ROOMS$style, _ROOMS$style2, _ROOMS_BY_WIDTH$style;
+ if (!isDrawn(border)) return 0;
+ const { style, width, space = 0 } = border;
+ const room = (_ROOMS$style = (_ROOMS$style2 = ROOMS[style]) === null || _ROOMS$style2 === void 0 ? void 0 : _ROOMS$style2.call(ROOMS, width)) !== null && _ROOMS$style !== void 0 ? _ROOMS$style : (_ROOMS_BY_WIDTH$style = ROOMS_BY_WIDTH[style]) === null || _ROOMS_BY_WIDTH$style === void 0 ? void 0 : _ROOMS_BY_WIDTH$style[width];
+ return room === void 0 ? void 0 : room + space;
+ };
+ /**
+ * The border Word draws where two cells meet: the one there is, when the other is none, and the wider of two of the same
+ * style, as in Word (`word-table-formats.docx` BC2 to BC5). Undefined where Word's choice isn't known: between two of
+ * different styles.
+ */
+ var borderBetween = (one, other) => {
+ if (!isDrawn(one) || !isDrawn(other)) return isDrawn(one) ? one : other;
+ if (one.style !== other.style) return;
+ return one.width >= other.width ? one : other;
+ };
+ /** The room a border takes, or why it isn't known: one Word's choice of isn't known is undefined */
+ var roomOrWhy = (border) => {
+ var _roomOf;
+ return border === void 0 ? "table cell borders of different styles that meet" : (_roomOf = roomOf(border)) !== null && _roomOf !== void 0 ? _roomOf : "a table border in a style not yet followed";
+ };
+ /** The wider of two borders' rooms, or why one isn't known */
+ var wider = (one, other) => typeof one === "string" ? one : typeof other === "string" ? other : Math.max(one, other);
+ /** The widest room of borders, or why it isn't known */
+ var widest = (borders) => borders.reduce((room, border) => wider(room, roomOrWhy(border)), 0);
+ /**
+ * The room the borders of a table's rows take, in points. Each cell's side has its own border, or else the table's
+ * there, and where two cells meet Word draws one of their borders (`borderBetween`). Each row is as much taller as the
+ * widest of its cells' borders (`word-table-formats.docx` BC1). A cell merged down from the row above has none between
+ * them. Where a table breaks across pages, Word draws below the last row on the page its cells' bottom borders, or the
+ * table's (BB1 and BB2, `word-line-heights.docx` T1). Why, where Word's choice or a border's room isn't known.
+ */
+ var rowBorders = (rows, table) => {
+ var _table$insideH, _all$find;
+ const covering = (cells, column) => cells.find((cell) => {
+ var _cell$span;
+ return cell.column <= column && column < cell.column + ((_cell$span = cell.span) !== null && _cell$span !== void 0 ? _cell$span : 1);
+ });
+ const insideH = (_table$insideH = table.insideH) !== null && _table$insideH !== void 0 ? _table$insideH : NONE;
+ const boundary = (index) => {
+ var _rows$index, _rows;
+ const below = (_rows$index = rows[index]) !== null && _rows$index !== void 0 ? _rows$index : [];
+ const above = (_rows = rows[index - 1]) !== null && _rows !== void 0 ? _rows : [];
+ const bottomOf = (cell) => {
+ var _cell$borders$bottom, _table$bottom;
+ return (_cell$borders$bottom = cell.borders.bottom) !== null && _cell$borders$bottom !== void 0 ? _cell$borders$bottom : index === rows.length ? (_table$bottom = table.bottom) !== null && _table$bottom !== void 0 ? _table$bottom : NONE : insideH;
+ };
+ const topOf = (cell) => {
+ var _cell$borders$top, _table$top;
+ return (_cell$borders$top = cell.borders.top) !== null && _cell$borders$top !== void 0 ? _cell$borders$top : index === 0 ? (_table$top = table.top) !== null && _table$top !== void 0 ? _table$top : NONE : insideH;
+ };
+ const fromBelow = below.reduce((room, cell) => {
+ if (cell.verticalMerge === "continue") return room;
+ const over = covering(above, cell.column);
+ return wider(room, roomOrWhy(over === void 0 ? topOf(cell) : borderBetween(bottomOf(over), topOf(cell))));
+ }, 0);
+ return above.reduce((room, cell) => covering(below, cell.column) === void 0 ? wider(room, roomOrWhy(bottomOf(cell))) : room, fromBelow);
+ };
+ const all = Array.from({ length: rows.length + 1 }, (_, index) => boundary(index));
+ const breaks = rows.map((cells) => cells.reduce((room, cell) => {
+ var _ref, _cell$borders$bottom2;
+ return wider(room, roomOrWhy((_ref = (_cell$borders$bottom2 = cell.borders.bottom) !== null && _cell$borders$bottom2 !== void 0 ? _cell$borders$bottom2 : table.bottom) !== null && _ref !== void 0 ? _ref : NONE));
+ }, 0));
+ const unsupported = (_all$find = all.find((room) => typeof room === "string")) !== null && _all$find !== void 0 ? _all$find : breaks.find((room) => typeof room === "string");
+ return unsupported !== null && unsupported !== void 0 ? unsupported : {
+ tops: all.slice(0, -1),
+ bottom: all[all.length - 1],
+ breaks
+ };
+ };
+ /**
+ * The room the borders left and right of each cell of a row take, in points: its own, or the table's at the table's
+ * edges and between its cells, and where two cells meet the one Word draws (`borderBetween`). Why, where Word's choice
+ * or a border's room isn't known.
+ */
+ var sideBorders = (cells, table) => {
+ var _table$insideV;
+ if (cells.length === 0) return [];
+ const insideV = (_table$insideV = table.insideV) !== null && _table$insideV !== void 0 ? _table$insideV : NONE;
+ const leftOf = (index) => {
+ var _cells$index$borders$, _table$left;
+ return (_cells$index$borders$ = cells[index].borders.left) !== null && _cells$index$borders$ !== void 0 ? _cells$index$borders$ : index === 0 ? (_table$left = table.left) !== null && _table$left !== void 0 ? _table$left : NONE : insideV;
+ };
+ const rightOf = (index) => {
+ var _cells$index$borders$2, _table$right;
+ return (_cells$index$borders$2 = cells[index].borders.right) !== null && _cells$index$borders$2 !== void 0 ? _cells$index$borders$2 : index === cells.length - 1 ? (_table$right = table.right) !== null && _table$right !== void 0 ? _table$right : NONE : insideV;
+ };
+ const rooms = Array.from({ length: cells.length + 1 }, (_, index) => index === 0 ? leftOf(0) : index === cells.length ? rightOf(index - 1) : borderBetween(rightOf(index - 1), leftOf(index))).map(roomOrWhy);
+ const unsupported = rooms.find((room) => typeof room === "string");
+ return unsupported !== null && unsupported !== void 0 ? unsupported : cells.map((_, index) => ({
+ left: rooms[index],
+ right: rooms[index + 1]
+ }));
+ };
+ /**
+ * The space between a table's cells (`w:tblCellSpacing`), in points: none when it isn't given, or is `nil`. Undefined
+ * when it is a share of the table's width, which Word's PDFs haven't shown.
+ */
+ var readCellSpacing = (element) => {
+ var _pointsOf;
+ if (element === void 0) return 0;
+ const { "w:w": value, "w:type": type = "dxa" } = attributesOf(element);
+ if (type === "nil") return 0;
+ return type === "dxa" ? Math.max(0, (_pointsOf = pointsOf(value, 20)) !== null && _pointsOf !== void 0 ? _pointsOf : 0) : void 0;
+ };
+ var LOOK_BITS = {
+ firstRow: 32,
+ lastRow: 64,
+ firstColumn: 128,
+ lastColumn: 256,
+ noHBand: 512,
+ noVBand: 1024
+ };
+ /**
+ * Reads which parts of its table style a table turns on (`w:tblLook`), from its attributes, as Word 2010 and later write
+ * them, or from the bits of `w:val`, as Word 2007 writes them. Undefined when the table doesn't say.
+ */
+ var readTableLook = (element) => {
+ var _attributes$wVal2;
+ if (element === void 0) return;
+ const attributes = attributesOf(element);
+ const bits = Number.parseInt(String((_attributes$wVal2 = attributes["w:val"]) !== null && _attributes$wVal2 !== void 0 ? _attributes$wVal2 : "0"), 16) || 0;
+ const on = (name) => {
+ const value = attributes[`w:${name}`];
+ return value === void 0 ? Math.floor(bits / LOOK_BITS[name]) % 2 === 1 : !isOff(value);
+ };
+ return {
+ firstRow: on("firstRow"),
+ lastRow: on("lastRow"),
+ firstColumn: on("firstColumn"),
+ lastColumn: on("lastColumn"),
+ rowBands: !on("noHBand"),
+ columnBands: !on("noVBand")
+ };
+ };
+ /**
+ * The parts of a table style that apply to a cell (`w:tblStylePr`), by its position in the table, the parts the table
+ * turns on, and the sizes of its style's bands, in the order they apply, each over those before, as Word applies them
+ * (`word-table-formats.docx` CF1 to CF6). Word applies bands only of a style that gives their size, and counts them from
+ * the first row and column that aren't the first row or column it applies. It doesn't apply `wholeTable`.
+ */
+ var conditionalTypesOf = ({ row, rows, cell, cells }, look, bands) => {
+ const firstRow = look.firstRow && row === 0;
+ const lastRow = look.lastRow && row === rows - 1;
+ const firstColumn = look.firstColumn && cell === 0;
+ const lastColumn = look.lastColumn && cell === cells - 1;
+ const bandOf = (on, size, index, edge) => on && size !== void 0 && size > 0 && !edge ? Math.floor(index / size) % 2 : void 0;
+ const rowBand = bandOf(look.rowBands, bands.rows, row - (look.firstRow ? 1 : 0), firstRow || lastRow);
+ const columnBand = bandOf(look.columnBands, bands.columns, cell - (look.firstColumn ? 1 : 0), firstColumn || lastColumn);
+ return [
+ ...rowBand === void 0 ? [] : [rowBand === 0 ? "band1Horz" : "band2Horz"],
+ ...columnBand === void 0 ? [] : [columnBand === 0 ? "band1Vert" : "band2Vert"],
+ ...firstColumn ? ["firstCol"] : [],
+ ...lastColumn ? ["lastCol"] : [],
+ ...firstRow ? ["firstRow"] : [],
+ ...lastRow ? ["lastRow"] : [],
+ ...firstRow && lastColumn ? ["neCell"] : [],
+ ...firstRow && firstColumn ? ["nwCell"] : [],
+ ...lastRow && lastColumn ? ["seCell"] : [],
+ ...lastRow && firstColumn ? ["swCell"] : []
+ ];
+ };
+ /**
+ * The room around the text of a table's rows and cells: its borders and its cells' (`rowBorders`, `sideBorders`), and
+ * the space between its cells.
+ *
+ * Without space between cells, a cell's text is as far in from its left and right edges as its margin, or half the
+ * border there when that is more, as in Word (`word-table-formats.docx` BC7 to BC9, `word-table-formats2.docx` BC10 and
+ * BC11).
+ *
+ * With space between cells, each cell has borders of its own, its own or else the table's: the table's top above the
+ * first row, its bottom below the last, and its inside borders between them; and the table has its own around them. Each
+ * row has its space above and below its cells' borders, and the table its space inside its own borders (CS1 to CS4,
+ * CS13). Where the table breaks across pages, the row on the page keeps the space below it, and the next page's starts
+ * with the space above it (CS12). Across, the space is around each cell and inside the table's edges, as margins are
+ * (`word-watertight-tables.docx` TB4, `word-table-formats.docx` CS5 to CS8, `word-table-formats2.docx` CS9, CS10, CS14).
+ */
+ var tableGeometry = (rows, table) => {
+ var _borders$top, _borders$bottom;
+ const { borders, spacing } = table;
+ if (spacing === 0) {
+ const vertical = rowBorders(rows.map(({ cells }) => cells), borders);
+ if (typeof vertical === "string") return vertical;
+ const across = rows.map(({ cells }) => sideBorders(cells, borders));
+ const unsupported = across.find((sides) => typeof sides === "string");
+ if (unsupported !== void 0) return unsupported;
+ return rows.map(({ cells }, index) => ({
+ borderTop: vertical.tops[index],
+ borderBottom: index === rows.length - 1 ? vertical.bottom : 0,
+ breakBorder: vertical.breaks[index],
+ cells: cells.map(({ margins, gridWidth }, cell) => {
+ const sides = across[index][cell];
+ const left = Math.max(margins.left, sides.left / 2);
+ const right = Math.max(margins.right, sides.right / 2);
+ return {
+ left,
+ right,
+ width: gridWidth - left - right
+ };
+ })
+ }));
+ }
+ const cellBorders = rows.flatMap(({ cells }) => cells.map((cell) => cell.borders));
+ if ([
+ borders.left,
+ borders.right,
+ borders.insideV,
+ ...cellBorders.flatMap((set) => [set.left, set.right])
+ ].some(isDrawn)) return "space between table cells beside borders left or right of them";
+ const last = rows.length - 1;
+ const rooms = rows.map(({ cells }, index) => ({
+ tops: widest(cells.map((cell) => {
+ var _ref2, _cell$borders$top2;
+ return (_ref2 = (_cell$borders$top2 = cell.borders.top) !== null && _cell$borders$top2 !== void 0 ? _cell$borders$top2 : index === 0 ? borders.top : borders.insideH) !== null && _ref2 !== void 0 ? _ref2 : NONE;
+ })),
+ bottoms: widest(cells.map((cell) => {
+ var _ref3, _cell$borders$bottom3;
+ return (_ref3 = (_cell$borders$bottom3 = cell.borders.bottom) !== null && _cell$borders$bottom3 !== void 0 ? _cell$borders$bottom3 : index === last ? borders.bottom : borders.insideH) !== null && _ref3 !== void 0 ? _ref3 : NONE;
+ }))
+ }));
+ const [top, bottom] = [widest([(_borders$top = borders.top) !== null && _borders$top !== void 0 ? _borders$top : NONE]), widest([(_borders$bottom = borders.bottom) !== null && _borders$bottom !== void 0 ? _borders$bottom : NONE])];
+ const unknown = [
+ top,
+ bottom,
+ ...rooms.flatMap(({ tops, bottoms }) => [tops, bottoms])
+ ].find((room) => typeof room === "string");
+ if (unknown !== void 0) return unknown;
+ const bordered = [
+ borders.top,
+ borders.bottom,
+ borders.insideH,
+ ...cellBorders.flatMap((set) => [set.top, set.bottom])
+ ].some(isDrawn);
+ return rows.map(({ cells, spacing: own }, index) => {
+ const { tops, bottoms } = rooms[index];
+ return _objectSpread2(_objectSpread2({
+ borderTop: tops + own + (index === 0 ? spacing + top : 0),
+ borderBottom: bottoms + own + (index === last ? spacing + bottom : 0)
+ }, bordered ? {} : { breakBorder: 0 }), {}, { cells: cells.map(({ margins, gridWidth }, cell) => {
+ const left = margins.left + own + (cell === 0 ? spacing : 0);
+ const right = margins.right + own + (cell === cells.length - 1 ? spacing : 0);
+ return {
+ left,
+ right,
+ width: gridWidth - left - right
+ };
+ }) });
+ });
+ };
+ //#endregion
//#region \0@oxc-project+runtime@0.150.0/helpers/esm/objectWithoutPropertiesLoose.js
function _objectWithoutPropertiesLoose(r, e) {
if (null == r) return {};
@@ -4047,6 +4532,11 @@ var docxLayout = (function(exports) {
//#endregion
//#region src/layout/read-document.ts
var _excluded = ["text"];
+ var _excluded2 = [
+ "borders",
+ "margins",
+ "gridWidth"
+ ];
var DEFAULT_SECTION = {
pageWidth: 612,
pageHeight: 792,
@@ -4534,13 +5024,13 @@ var docxLayout = (function(exports) {
/**
* Reads a paragraph (`w:p`), in the formatting of its styles, and of its table's style when it is in a table.
*/
- var readParagraph = (element, reader, tableStyle) => {
+ var readParagraph = (element, reader, tableFormats = []) => {
var _valueOf3, _exec2, _styleChain$slice$0$n, _styleChain$slice$, _ref5, _unknownLengthIn;
const { styles } = reader;
const children = contentOf$2(element);
const properties = childrenOf(find(children.filter(isObject), "w:pPr"));
const style = (_valueOf3 = valueOf(properties, "w:pStyle")) !== null && _valueOf3 !== void 0 ? _valueOf3 : styles.defaultParagraphStyle;
- const paragraphStyles = [...styleChain(styles, tableStyle, "table"), ...styleChain(styles, style, "paragraph")];
+ const paragraphStyles = [...tableFormats, ...styleChain(styles, style, "paragraph")];
const paragraphRun = combine([styles.run, ...paragraphStyles.map(({ run }) => run)]);
const list = readListNumber(properties, style, paragraphRun, reader);
const headingLevel = (_exec2 = /^heading ([1-9])$/i.exec((_styleChain$slice$0$n = (_styleChain$slice$ = styleChain(styles, style, "paragraph").slice(-1)[0]) === null || _styleChain$slice$ === void 0 ? void 0 : _styleChain$slice$.name) !== null && _styleChain$slice$0$n !== void 0 ? _styleChain$slice$0$n : "")) === null || _exec2 === void 0 ? void 0 : _exec2[1];
@@ -4570,22 +5060,38 @@ var docxLayout = (function(exports) {
markFont
}, list.list ? { list: list.list } : {}), typeof borders === "object" ? { borders } : {}), {}, { style }, headingLevel === void 0 ? {} : { heading: _objectSpread2({ level: Number(headingLevel) }, withoutUndefined({ chapter: list.from === "style" ? list.chapter : void 0 })) }), typeof items === "string" || unsupported ? { unsupported: typeof items === "string" ? items : unsupported } : {});
};
- var borderWidth = (borders, name) => {
- var _numberOf3;
- const attributes = attributesOf(find(borders, name));
- const style = attributes["w:val"];
- return style === void 0 || style === "nil" || style === "none" ? 0 : ((_numberOf3 = numberOf(attributes["w:sz"])) !== null && _numberOf3 !== void 0 ? _numberOf3 : 0) / EIGHTHS_PER_POINT;
- };
/**
* Why a cell's properties (`w:tcPr`) change how its text is laid out in a way not yet followed, when they do: cells merged
- * across columns as the oldest versions of Word wrote them (`w:hMerge`), text that doesn't wrap (`w:noWrap`), and text
- * fitted to the cell (`w:tcFitText`).
+ * across columns as the oldest versions of Word wrote them (`w:hMerge`), text that doesn't wrap (`w:noWrap`), text
+ * fitted to the cell (`w:tcFitText`), and text that runs down the cell with its East Asian characters upright, or across
+ * with them on their side (`w:textDirection` tbLrV, tbRlV and lrTbV).
*/
var unsupportedCellOf = (properties) => {
if (find(properties, "w:hMerge") !== void 0) return "cells merged across columns as old versions of Word wrote them";
if (onOff(properties, "w:noWrap") === true) return "a table cell whose text doesn't wrap";
- return onOff(properties, "w:tcFitText") === true ? "text fitted to its table cell" : void 0;
+ if (onOff(properties, "w:tcFitText") === true) return "text fitted to its table cell";
+ const direction = valueOf(properties, "w:textDirection");
+ return direction === void 0 || HORIZONTAL.has(direction) || VERTICAL.has(direction) ? void 0 : "text in a table cell in a direction not yet followed";
};
+ /**
+ * Why text that runs up or down a cell makes its row taller in a way not yet followed, when it does. Word makes the row
+ * as tall as a line of the cell's paragraph marks, whatever the text's size and the space around its paragraphs
+ * (`word-table-formats.docx` VT1, VT2, `word-table-formats2.docx` VT5 to VT7). Which line, for marks of different fonts or
+ * sizes, isn't known, nor what a picture or a table in it does.
+ */
+ var unsupportedVerticalOf = (blocks) => {
+ const paragraphs = blocks.filter((block) => block.type === "paragraph");
+ const marks = new Set(paragraphs.map(({ markFont: { font, size } }) => `${font} ${size}`));
+ const other = paragraphs.length < blocks.length || paragraphs.some(({ items }) => items.some(({ type }) => type === "box"));
+ return marks.size > 1 || other ? "text running up or down a table cell with marks of different sizes, a picture or a table" : void 0;
+ };
+ var HORIZONTAL = /* @__PURE__ */ new Set(["lrTb", "tb"]);
+ var VERTICAL = /* @__PURE__ */ new Set([
+ "btLr",
+ "tbRl",
+ "lr",
+ "rl"
+ ]);
/** A share of a width, as a fraction, from fiftieths of a percent or a percentage written with a % */
var shareOf = (value) => {
const amount = numberOf(value);
@@ -4599,35 +5105,106 @@ var docxLayout = (function(exports) {
const share = type === "pct" ? shareOf(value) : void 0;
return _objectSpread2(_objectSpread2({}, width !== void 0 && width > 0 ? { width } : {}), share !== void 0 && share > 0 ? { share } : {});
};
+ var LAID_OUT_ALIKE = /* @__PURE__ */ new Set([
+ "w:tblStyle",
+ "w:shd",
+ "w:jc",
+ "w:vAlign",
+ "w:cnfStyle",
+ "w:hidden",
+ "w:headers",
+ "w:tblLook",
+ "w:tblStyleRowBandSize",
+ "w:tblStyleColBandSize",
+ "w:tblCaption",
+ "w:tblDescription",
+ "w:tblPrChange",
+ "w:trPrChange",
+ "w:tcPrChange",
+ "w:tblPrExChange"
+ ]);
+ /** Whether table, row or cell properties change how its text is laid out, beyond those that don't or are read */
+ var changesLines = (properties, read = /* @__PURE__ */ new Set()) => properties.some((property) => !LAID_OUT_ALIKE.has(nameOf(property)) && !read.has(nameOf(property)));
+ var FOLLOWED_CELL_PROPERTIES = /* @__PURE__ */ new Set(["w:tcBorders", "w:tcMar"]);
+ /** The last of a property given among properties, each over those before: those of a table's styles, then its own */
+ var lastOf = (properties, name) => properties.reduce((found, given) => {
+ var _find;
+ return (_find = find(given, name)) !== null && _find !== void 0 ? _find : found;
+ }, void 0);
+ var UNSAID_LOOK = {
+ firstRow: true,
+ lastRow: false,
+ firstColumn: true,
+ lastColumn: false,
+ rowBands: true,
+ columnBands: false
+ };
/**
* Reads a table (`w:tbl`): the width, margins and content of each cell, and the height and borders of each row. Word
* sizes the columns of a table whose cells don't all have widths to their text, and widens a column of one whose cells
* all have widths for a word longer than they give it, unless its layout is fixed, so those are worked out as it is laid
* out.
+ *
+ * The table takes its margins, borders, space between cells and indent from its style and the styles that is based on,
+ * or the default table style when it has none that is a table style, then from itself, each over those before. Its
+ * style's paragraph and run formatting applies to its cells' paragraphs, then the formatting of the parts of its style
+ * for the cell, such as its first row's (`w:tblStylePr`), where the table turns them on (`w:tblLook`), with the cell
+ * borders and margins they give. A cell's own borders and margins are over those.
*/
var readTable = (element, reader) => {
- var _ref6, _ref7, _ref8, _ref9, _ref10, _read$find, _blocks$find;
+ var _twips, _readTableLook, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _read$find, _blocks$find, _read$0$cells, _read$, _roomOf, _roomOf2;
const children = contentOf$2(element).filter(isObject);
const properties = childrenOf(find(children, "w:tblPr"));
const style = valueOf(properties, "w:tblStyle");
const ownStyles = styleChain(reader.styles, style, "table");
const tableStyles = ownStyles.length > 0 ? ownStyles : styleChain(reader.styles, reader.styles.defaultTableStyle, "table");
+ const allProperties = [...tableStyles.map(({ tableProperties = [] }) => tableProperties), properties];
const tableMargins = _objectSpread2(_objectSpread2({
top: 0,
bottom: 0,
left: 0,
right: 0
}, Object.assign({}, ...tableStyles.map(({ cellMargins }) => cellMargins))), readCellMargins(find(properties, "w:tblCellMar")));
- const borders = childrenOf(find(properties, "w:tblBorders"));
+ const tableBorders = Object.assign({}, ...allProperties.map((given) => readBorderSet(find(given, "w:tblBorders"))));
+ const tableSpacing = readCellSpacing(lastOf(allProperties, "w:tblCellSpacing"));
+ const { "w:w": indentValue, "w:type": indentType = "dxa" } = attributesOf(lastOf(allProperties, "w:tblInd"));
+ const indent = indentType === "nil" ? 0 : indentType === "dxa" ? (_twips = twips(indentValue)) !== null && _twips !== void 0 ? _twips : 0 : void 0;
const grid = childrenOf(find(children, "w:tblGrid")).filter((child) => "w:gridCol" in child).map((column) => {
- var _twips;
- return (_twips = twips(attributesOf(column["w:gridCol"])["w:w"])) !== null && _twips !== void 0 ? _twips : 0;
+ var _twips2;
+ return (_twips2 = twips(attributesOf(column["w:gridCol"])["w:w"])) !== null && _twips2 !== void 0 ? _twips2 : 0;
});
const parts = unwrap(children);
const rows = withBookmarks(parts, "w:tr");
+ const conditional = ownStyles.flatMap(({ conditional: given = /* @__PURE__ */ new Map() }) => [...given]);
+ const look = (_readTableLook = readTableLook(lastOf(allProperties, "w:tblLook"))) !== null && _readTableLook !== void 0 ? _readTableLook : UNSAID_LOOK;
+ const bandSize = (name) => numberOf(attributesOf(lastOf(allProperties, name))["w:val"]);
+ const bands = {
+ rows: bandSize("w:tblStyleRowBandSize"),
+ columns: bandSize("w:tblStyleColBandSize")
+ };
+ /**
+ * The paragraph and run formatting the table's style gives a cell's paragraphs, with that of the parts of it for the
+ * cell, the borders and margins those give the cell, and why a part of it for the cell changes its lines in a way not
+ * yet followed: with table or row properties, or cell properties other than borders and margins
+ */
+ const formatsOf = (position) => {
+ if (conditional.length === 0) return UNFORMATTED;
+ const applying = conditionalTypesOf(position, look, bands).flatMap((type) => conditional.filter(([given]) => given === type));
+ const unfollowed = applying.some(([, format]) => changesLines([...format.tableProperties, ...format.rowProperties]) || changesLines(format.cellProperties, FOLLOWED_CELL_PROPERTIES));
+ return _objectSpread2({
+ formats: [...ownStyles, ...applying.map(([, format]) => format)],
+ borders: Object.assign({}, ...applying.map(([, { cellProperties }]) => readBorderSet(find(cellProperties, "w:tcBorders")))),
+ margins: Object.assign({}, ...applying.map(([, { cellProperties }]) => readCellMargins(find(cellProperties, "w:tcMar"))))
+ }, unfollowed ? { unsupported: "a table style's formatting for some of its cells" } : {});
+ };
+ const UNFORMATTED = {
+ formats: ownStyles,
+ borders: {},
+ margins: {}
+ };
const gridWidth = (from, to) => grid.slice(from, to).reduce((total, value) => total + value, 0);
const read = rows.map(({ element: row, bookmarks: rowBookmarks }, rowIndex) => {
- var _numberOf4;
+ var _numberOf3;
const rowChildren = contentOf$2(row).filter(isObject);
const rowProperties = childrenOf(find(rowChildren, "w:trPr"));
const rowParts = unwrap(rowChildren);
@@ -4635,60 +5212,100 @@ var docxLayout = (function(exports) {
const heightAttributes = attributesOf(find(rowProperties, "w:trHeight"));
const height = twips(heightAttributes["w:val"]);
const { "w:hRule": rule } = heightAttributes;
- const skipped = (_numberOf4 = numberOf(attributesOf(find(rowProperties, "w:gridBefore"))["w:val"])) !== null && _numberOf4 !== void 0 ? _numberOf4 : 0;
- const { cells, edges, column: end, unsupported: cellsUnsupported } = rowCells.reduce(({ column, cells: done, edges: before, unsupported: unsupportedBefore }, { element: cell }) => {
- var _numberOf5, _twips2, _shareOf;
+ const skipped = (_numberOf3 = numberOf(attributesOf(find(rowProperties, "w:gridBefore"))["w:val"])) !== null && _numberOf3 !== void 0 ? _numberOf3 : 0;
+ const ownSpacing = find(rowProperties, "w:tblCellSpacing");
+ const spacing = ownSpacing === void 0 ? tableSpacing : readCellSpacing(ownSpacing);
+ const { cells, edges, column: end, unsupported: cellsUnsupported } = rowCells.reduce(({ column, cells: done, edges: before, unsupported: unsupportedBefore }, { element: cell }, cellIndex) => {
+ var _numberOf4, _twips3, _shareOf, _ref6, _ref7;
const cellChildren = contentOf$2(cell).filter(isObject);
const cellProperties = childrenOf(find(cellChildren, "w:tcPr"));
- const span = (_numberOf5 = numberOf(attributesOf(find(cellProperties, "w:gridSpan"))["w:val"])) !== null && _numberOf5 !== void 0 ? _numberOf5 : 1;
+ const span = (_numberOf4 = numberOf(attributesOf(find(cellProperties, "w:gridSpan"))["w:val"])) !== null && _numberOf4 !== void 0 ? _numberOf4 : 1;
const mergeElement = find(cellProperties, "w:vMerge");
const merge = mergeElement === void 0 ? void 0 : attributesOf(mergeElement)["w:val"] === "restart" ? "restart" : "continue";
- const margins = _objectSpread2(_objectSpread2({}, tableMargins), readCellMargins(find(cellProperties, "w:tcMar")));
+ const formatted = formatsOf({
+ row: rowIndex,
+ rows: rows.length,
+ cell: cellIndex,
+ cells: rowCells.length
+ });
+ const margins = _objectSpread2(_objectSpread2(_objectSpread2({}, tableMargins), formatted.margins), readCellMargins(find(cellProperties, "w:tcMar")));
const { "w:w": ownWidth, "w:type": widthType = "dxa" } = attributesOf(find(cellProperties, "w:tcW"));
- const inTwips = widthType === "dxa" ? (_twips2 = twips(ownWidth)) !== null && _twips2 !== void 0 ? _twips2 : 0 : 0;
+ const inTwips = widthType === "dxa" ? (_twips3 = twips(ownWidth)) !== null && _twips3 !== void 0 ? _twips3 : 0 : 0;
const hasWidth = inTwips > 0 || widthType === "pct" && ((_shareOf = shareOf(ownWidth)) !== null && _shareOf !== void 0 ? _shareOf : 0) > 0;
const width = inTwips > 0 ? inTwips : gridWidth(column, column + span);
+ const direction = valueOf(cellProperties, "w:textDirection");
+ const cellBlocks = readBlocks(cellChildren, reader, formatted.formats);
+ const vertical = direction !== void 0 && VERTICAL.has(direction);
return _objectSpread2(_objectSpread2({
column: column + span,
edges: new Map([...before, [column + span, before.get(column) + width]])
- }, withoutUndefined({ unsupported: unsupportedBefore !== null && unsupportedBefore !== void 0 ? unsupportedBefore : unsupportedCellOf(cellProperties) })), {}, { cells: [...done, _objectSpread2(_objectSpread2(_objectSpread2({ column }, span > 1 ? { span } : {}), {}, { width: width - margins.left - margins.right }, hasWidth ? { ownWidth: width } : {}), {}, {
- blocks: readBlocks(cellChildren, reader, style),
+ }, withoutUndefined({ unsupported: (_ref6 = (_ref7 = unsupportedBefore !== null && unsupportedBefore !== void 0 ? unsupportedBefore : unsupportedCellOf(cellProperties)) !== null && _ref7 !== void 0 ? _ref7 : formatted.unsupported) !== null && _ref6 !== void 0 ? _ref6 : vertical ? unsupportedVerticalOf(cellBlocks) : void 0 })), {}, { cells: [...done, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({ column }, span > 1 ? { span } : {}), {}, { width: width - margins.left - margins.right }, hasWidth ? { ownWidth: width } : {}), {}, {
+ blocks: cellBlocks,
marginTop: margins.top,
marginBottom: margins.bottom,
marginLeft: margins.left,
marginRight: margins.right
- }, merge ? { verticalMerge: merge } : {})] });
+ }, merge ? { verticalMerge: merge } : {}), vertical ? { vertical: true } : {}), onOff(cellProperties, "w:hideMark") === true ? { hideMark: true } : {}), {}, {
+ borders: formatted === UNFORMATTED ? readBorderSet(find(cellProperties, "w:tcBorders")) : _objectSpread2(_objectSpread2({}, formatted.borders), readBorderSet(find(cellProperties, "w:tcBorders"))),
+ margins,
+ gridWidth: width
+ })] });
}, {
column: skipped,
cells: [],
edges: /* @__PURE__ */ new Map([[skipped, gridWidth(0, skipped)]])
});
- const rowUnsupported = find(rowProperties, "w:divId") !== void 0 ? "a table row in an HTML division" : rowParts.some((part) => "w:sdt" in part) ? BOUND_CONTROL : cellsUnsupported;
+ const rowUnsupported = find(rowProperties, "w:divId") !== void 0 ? "a table row in an HTML division" : rowParts.some((part) => "w:sdt" in part) ? BOUND_CONTROL : changesLines(childrenOf(find(rowChildren, "w:tblPrEx"))) ? "a table row with table properties of its own" : cellsUnsupported;
return _objectSpread2(_objectSpread2({
+ cells,
edges,
- end
+ end,
+ spacing
}, withoutUndefined({ unsupported: rowUnsupported })), {}, {
bookmarks: rowBookmarks,
cellBookmarks: rowCells.map(({ bookmarks }) => bookmarks),
- row: _objectSpread2(_objectSpread2({ cells }, height !== void 0 && rule !== "auto" ? { height: {
+ row: _objectSpread2(_objectSpread2({}, height !== void 0 && rule !== "auto" ? { height: {
value: height,
rule: rule === "exact" ? "exact" : "atLeast"
} } : {}), {}, {
header: onOff(rowProperties, "w:tblHeader") === true,
- cantSplit: onOff(rowProperties, "w:cantSplit") === true,
- borderTop: borderWidth(borders, rowIndex === 0 ? "w:top" : "w:insideH"),
- borderBottom: rowIndex === rows.length - 1 ? borderWidth(borders, "w:bottom") : 0
+ cantSplit: onOff(rowProperties, "w:cantSplit") === true
})
});
});
+ const tableCells = read.flatMap(({ cells }) => cells);
+ const fixed = attributesOf(find(properties, "w:tblLayout"))["w:type"] === "fixed";
+ const fits = !fixed && tableCells.some(({ ownWidth }) => ownWidth === void 0);
+ const spacingUnsupported = tableSpacing === void 0 || read.some(({ spacing }) => spacing === void 0) ? "space between table cells as a share of the table's width" : read.some(({ spacing }) => spacing !== tableSpacing) ? "a table row with space between its cells of its own" : void 0;
+ const followedSpacing = spacingUnsupported === void 0 ? tableSpacing : 0;
+ const geometry = tableGeometry(read.map(({ cells }) => ({
+ cells,
+ spacing: followedSpacing
+ })), {
+ borders: tableBorders,
+ spacing: followedSpacing
+ });
+ const spaced = followedSpacing > 0;
let carried = [];
- const tableRows = read.map(({ row, bookmarks, cellBookmarks }) => {
+ const tableRows = read.map(({ row, cells, bookmarks, cellBookmarks }, rowIndex) => {
+ var _placed$borderTop, _placed$borderBottom;
carried = [...carried, ...bookmarks];
- return _objectSpread2(_objectSpread2({}, row), {}, { cells: row.cells.map((cell, index) => {
+ const placed = typeof geometry === "string" ? void 0 : geometry[rowIndex];
+ return _objectSpread2(_objectSpread2(_objectSpread2({}, row), {}, {
+ borderTop: (_placed$borderTop = placed === null || placed === void 0 ? void 0 : placed.borderTop) !== null && _placed$borderTop !== void 0 ? _placed$borderTop : 0,
+ borderBottom: (_placed$borderBottom = placed === null || placed === void 0 ? void 0 : placed.borderBottom) !== null && _placed$borderBottom !== void 0 ? _placed$borderBottom : 0
+ }, withoutUndefined({ breakBorder: placed === null || placed === void 0 ? void 0 : placed.breakBorder })), {}, { cells: cells.map((_ref8, index) => {
+ let { borders: _, margins, gridWidth: __ } = _ref8, cell = _objectWithoutProperties(_ref8, _excluded2);
const pending = [...carried, ...cellBookmarks[index]];
const marked = pending.length === 0 ? void 0 : startingAtFirst(cell.blocks, pending);
carried = marked === void 0 ? pending : [];
- return marked === void 0 ? cell : _objectSpread2(_objectSpread2({}, cell), {}, { blocks: marked });
+ const around = placed === null || placed === void 0 ? void 0 : placed.cells[index];
+ const spacingRoom = around === void 0 ? 0 : around.left - margins.left + around.right - margins.right;
+ return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, cell), around === void 0 ? {} : {
+ width: around.width,
+ marginLeft: around.left,
+ marginRight: around.right
+ }), spaced && cell.ownWidth !== void 0 ? { ownWidth: cell.ownWidth + spacingRoom } : {}), marked === void 0 ? {} : { blocks: marked });
}) });
});
const edgesAt = /* @__PURE__ */ new Map();
@@ -4698,10 +5315,7 @@ var docxLayout = (function(exports) {
edgesAt.set(column, other);
return Math.abs(other - edge) > WIDTH_TOLERANCE;
}));
- const tableCells = read.flatMap(({ row }) => row.cells);
const blocks = tableCells.flatMap((cell) => cell.blocks);
- const fixed = attributesOf(find(properties, "w:tblLayout"))["w:type"] === "fixed";
- const fits = !fixed && tableCells.some(({ ownWidth }) => ownWidth === void 0);
const unfitted = read.reduce((most, { end }) => Math.max(most, end), 0) > MOST_COLUMNS ? `a table given no widths of more than ${MOST_COLUMNS} columns` : void 0;
const lengths = unknownLengthIn([
find(children, "w:tblPr"),
@@ -4711,14 +5325,21 @@ var docxLayout = (function(exports) {
return [find(rowChildren, "w:trPr"), ...unwrap(rowChildren).filter((part) => "w:tc" in part).map((cell) => find(contentOf$2(cell).filter(isObject), "w:tcPr"))];
})
]);
- const unsupported = (_ref6 = (_ref7 = (_ref8 = (_ref9 = (_ref10 = find(properties, "w:tblpPr") === void 0 ? void 0 : "a table that text flows around") !== null && _ref10 !== void 0 ? _ref10 : parts.some((part) => "w:sdt" in part) ? BOUND_CONTROL : void 0) !== null && _ref9 !== void 0 ? _ref9 : (_read$find = read.find((row) => row.unsupported !== void 0)) === null || _read$find === void 0 ? void 0 : _read$find.unsupported) !== null && _ref8 !== void 0 ? _ref8 : fits ? unfitted : unequal ? "a table whose rows give a column different widths" : void 0) !== null && _ref7 !== void 0 ? _ref7 : lengths) !== null && _ref6 !== void 0 ? _ref6 : (_blocks$find = blocks.find((block) => block.unsupported !== void 0)) === null || _blocks$find === void 0 ? void 0 : _blocks$find.unsupported;
- return _objectSpread2(_objectSpread2(_objectSpread2({
+ const styleUnsupported = tableStyles.some(({ rowProperties = [], cellProperties = [] }) => changesLines([...rowProperties, ...cellProperties])) ? "a table style with formatting of its rows or cells" : void 0;
+ const unsupported = (_ref9 = (_ref10 = (_ref11 = (_ref12 = (_ref13 = (_ref14 = (_ref15 = (_ref16 = (_ref17 = find(properties, "w:tblpPr") === void 0 ? void 0 : "a table that text flows around") !== null && _ref17 !== void 0 ? _ref17 : parts.some((part) => "w:sdt" in part) ? BOUND_CONTROL : void 0) !== null && _ref16 !== void 0 ? _ref16 : (_read$find = read.find((row) => row.unsupported !== void 0)) === null || _read$find === void 0 ? void 0 : _read$find.unsupported) !== null && _ref15 !== void 0 ? _ref15 : fits ? unfitted : unequal ? "a table whose rows give a column different widths" : void 0) !== null && _ref14 !== void 0 ? _ref14 : spacingUnsupported) !== null && _ref13 !== void 0 ? _ref13 : typeof geometry === "string" ? geometry : void 0) !== null && _ref12 !== void 0 ? _ref12 : indent === void 0 ? "a table indented by a share of the width" : void 0) !== null && _ref11 !== void 0 ? _ref11 : styleUnsupported) !== null && _ref10 !== void 0 ? _ref10 : lengths) !== null && _ref9 !== void 0 ? _ref9 : (_blocks$find = blocks.find((block) => block.unsupported !== void 0)) === null || _blocks$find === void 0 ? void 0 : _blocks$find.unsupported;
+ const givenWidth = readTableWidth(properties);
+ const rowWidth = ((_read$0$cells = (_read$ = read[0]) === null || _read$ === void 0 ? void 0 : _read$.cells) !== null && _read$0$cells !== void 0 ? _read$0$cells : []).reduce((total, cell) => {
+ var _cell$ownWidth;
+ return total + ((_cell$ownWidth = cell.ownWidth) !== null && _cell$ownWidth !== void 0 ? _cell$ownWidth : 0);
+ }, 0);
+ const tableWidth = spaced && givenWidth.width === void 0 && givenWidth.share === void 0 ? { width: rowWidth } : givenWidth;
+ return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
type: "table",
rows: tableRows
- }, fits ? { fit: readTableWidth(properties) } : {}), !fits && !fixed ? { widen: _objectSpread2(_objectSpread2({}, readTableWidth(properties)), {}, { acrossColumns: tableCells.some(({ span }) => span !== void 0) }) } : {}), {}, {
- borderLeft: borderWidth(borders, "w:left"),
- borderRight: borderWidth(borders, "w:right")
- }, unsupported ? { unsupported } : {});
+ }, fits ? { fit: givenWidth } : {}), !fits && (!fixed || spaced) ? { widen: _objectSpread2(_objectSpread2({}, tableWidth), {}, { acrossColumns: tableCells.some(({ span }) => span !== void 0) }) } : {}), {}, {
+ borderLeft: (_roomOf = roomOf(tableBorders.left)) !== null && _roomOf !== void 0 ? _roomOf : 0,
+ borderRight: (_roomOf2 = roomOf(tableBorders.right)) !== null && _roomOf2 !== void 0 ? _roomOf2 : 0
+ }, indent ? { indent } : {}), spaced ? { cellSpacing: followedSpacing } : {}), unsupported ? { unsupported } : {});
};
/** A block in place of what can't be laid out, with why */
var unsupportedBlock = (unsupported) => ({
@@ -4764,9 +5385,9 @@ var docxLayout = (function(exports) {
* Reads a paragraph or table, or what is in its place and can't be laid out: an imported document, an equation outside
* a paragraph, or a content control bound to custom XML. Undefined for anything else.
*/
- var readBlock = (element, reader, tableStyle) => {
+ var readBlock = (element, reader, tableFormats) => {
switch (nameOf(element)) {
- case "w:p": return readParagraph(element, reader, tableStyle);
+ case "w:p": return readParagraph(element, reader, tableFormats);
case "w:tbl": return readTable(element, reader);
case "w:sdt": return unsupportedBlock(BOUND_CONTROL);
case "w:altChunk": return unsupportedBlock("an imported document");
@@ -4779,11 +5400,11 @@ var docxLayout = (function(exports) {
* Reads the paragraphs and tables in a part of a document, such as a table cell or a header, and in the content controls
* and custom XML in it. A bookmark between them starts with the next.
*/
- var readBlocks = (elements, reader, tableStyle) => {
+ var readBlocks = (elements, reader, tableFormats) => {
const blocks = [];
let bookmarks = [];
for (const element of unwrap(elements)) {
- const block = readBlock(element, reader, tableStyle);
+ const block = readBlock(element, reader, tableFormats);
if (block === void 0) bookmarks = [...bookmarks, ...bookmarksIn([element])];
else {
const marked = startingWith(block, bookmarks);
@@ -4816,15 +5437,15 @@ var docxLayout = (function(exports) {
* the same space between them, unless the section gives each column's width.
*/
var readColumns = (element, width) => {
- var _numberOf6, _twips4;
+ var _numberOf5, _twips5;
const attributes = attributesOf(element);
const given = childrenOf(element).filter((child) => "w:col" in child);
if (isOff(attributes["w:equalWidth"]) && given.length > 0) return given.map((column) => {
- var _twips3;
- return (_twips3 = twips(attributesOf(column["w:col"])["w:w"])) !== null && _twips3 !== void 0 ? _twips3 : 0;
+ var _twips4;
+ return (_twips4 = twips(attributesOf(column["w:col"])["w:w"])) !== null && _twips4 !== void 0 ? _twips4 : 0;
});
- const count = Math.max(1, (_numberOf6 = numberOf(attributes["w:num"])) !== null && _numberOf6 !== void 0 ? _numberOf6 : 1);
- const space = (_twips4 = twips(attributes["w:space"])) !== null && _twips4 !== void 0 ? _twips4 : DEFAULT_COLUMN_SPACE;
+ const count = Math.max(1, (_numberOf5 = numberOf(attributes["w:num"])) !== null && _numberOf5 !== void 0 ? _numberOf5 : 1);
+ const space = (_twips5 = twips(attributes["w:space"])) !== null && _twips5 !== void 0 ? _twips5 : DEFAULT_COLUMN_SPACE;
return Array.from({ length: count }, () => (width - space * (count - 1)) / count);
};
/**
@@ -4832,7 +5453,7 @@ var docxLayout = (function(exports) {
* doesn't give a header or footer for a kind of page has the one of the section before.
*/
var readSection = (element, readPart, previous) => {
- var _stringOf, _twips5, _twips6, _margins$wLeft, _twips7, _margins$wRight, _twips8, _twips9, _twips10, _twips11, _twips12, _twips13, _CHAPTER_SEPARATORS$S;
+ var _stringOf, _twips6, _twips7, _margins$wLeft, _twips8, _margins$wRight, _twips9, _twips10, _twips11, _twips12, _twips13, _twips14, _CHAPTER_SEPARATORS$S;
const properties = childrenOf(element);
const size = attributesOf(find(properties, "w:pgSz"));
const margins = attributesOf(find(properties, "w:pgMar"));
@@ -4842,23 +5463,23 @@ var docxLayout = (function(exports) {
const format = (_stringOf = stringOf(numbering["w:fmt"])) !== null && _stringOf !== void 0 ? _stringOf : "decimal";
const firstNumber = numberOf(numbering["w:start"]);
const chapterLevel = numberOf(numbering["w:chapStyle"]);
- const pageWidth = (_twips5 = twips(size["w:w"])) !== null && _twips5 !== void 0 ? _twips5 : DEFAULT_SECTION.pageWidth;
- const marginLeft = (_twips6 = twips((_margins$wLeft = margins["w:left"]) !== null && _margins$wLeft !== void 0 ? _margins$wLeft : margins["w:start"])) !== null && _twips6 !== void 0 ? _twips6 : DEFAULT_SECTION.marginLeft;
- const marginRight = (_twips7 = twips((_margins$wRight = margins["w:right"]) !== null && _margins$wRight !== void 0 ? _margins$wRight : margins["w:end"])) !== null && _twips7 !== void 0 ? _twips7 : DEFAULT_SECTION.marginRight;
- const gutter = (_twips8 = twips(margins["w:gutter"])) !== null && _twips8 !== void 0 ? _twips8 : DEFAULT_SECTION.gutter;
+ const pageWidth = (_twips6 = twips(size["w:w"])) !== null && _twips6 !== void 0 ? _twips6 : DEFAULT_SECTION.pageWidth;
+ const marginLeft = (_twips7 = twips((_margins$wLeft = margins["w:left"]) !== null && _margins$wLeft !== void 0 ? _margins$wLeft : margins["w:start"])) !== null && _twips7 !== void 0 ? _twips7 : DEFAULT_SECTION.marginLeft;
+ const marginRight = (_twips8 = twips((_margins$wRight = margins["w:right"]) !== null && _margins$wRight !== void 0 ? _margins$wRight : margins["w:end"])) !== null && _twips8 !== void 0 ? _twips8 : DEFAULT_SECTION.marginRight;
+ const gutter = (_twips9 = twips(margins["w:gutter"])) !== null && _twips9 !== void 0 ? _twips9 : DEFAULT_SECTION.gutter;
const columns = readColumns(find(properties, "w:cols"), pageWidth - marginLeft - marginRight - gutter);
const unsupported = grid === "lines" || grid === "linesAndChars" || grid === "snapToChars" ? "a document grid" : formatPageNumber(1, format) === void 0 ? "page numbers in a format not yet written" : find(properties, "w:textDirection") !== void 0 ? "text that runs down the page" : find(properties, "w15:footnoteColumns") === void 0 ? unknownLengthIn(element) : "footnotes in columns of their own";
const headers = readReferences(properties, "w:headerReference", readPart);
const footers = readReferences(properties, "w:footerReference", readPart);
return _objectSpread2(_objectSpread2(_objectSpread2({
pageWidth,
- pageHeight: (_twips9 = twips(size["w:h"])) !== null && _twips9 !== void 0 ? _twips9 : DEFAULT_SECTION.pageHeight,
- marginTop: (_twips10 = twips(margins["w:top"])) !== null && _twips10 !== void 0 ? _twips10 : DEFAULT_SECTION.marginTop,
- marginBottom: (_twips11 = twips(margins["w:bottom"])) !== null && _twips11 !== void 0 ? _twips11 : DEFAULT_SECTION.marginBottom,
+ pageHeight: (_twips10 = twips(size["w:h"])) !== null && _twips10 !== void 0 ? _twips10 : DEFAULT_SECTION.pageHeight,
+ marginTop: (_twips11 = twips(margins["w:top"])) !== null && _twips11 !== void 0 ? _twips11 : DEFAULT_SECTION.marginTop,
+ marginBottom: (_twips12 = twips(margins["w:bottom"])) !== null && _twips12 !== void 0 ? _twips12 : DEFAULT_SECTION.marginBottom,
marginLeft,
marginRight,
- header: (_twips12 = twips(margins["w:header"])) !== null && _twips12 !== void 0 ? _twips12 : DEFAULT_SECTION.header,
- footer: (_twips13 = twips(margins["w:footer"])) !== null && _twips13 !== void 0 ? _twips13 : DEFAULT_SECTION.footer,
+ header: (_twips13 = twips(margins["w:header"])) !== null && _twips13 !== void 0 ? _twips13 : DEFAULT_SECTION.header,
+ footer: (_twips14 = twips(margins["w:footer"])) !== null && _twips14 !== void 0 ? _twips14 : DEFAULT_SECTION.footer,
gutter,
start: start !== void 0 && START_TYPES.has(start) ? start : "nextPage",
titlePage: onOff(properties, "w:titlePg") === true,
@@ -4880,15 +5501,15 @@ var docxLayout = (function(exports) {
const root = childrenOf(xml === null || xml === void 0 ? void 0 : xml["w:numbering"]);
const abstract = new Map(root.filter((child) => "w:abstractNum" in child).map((child) => {
const byIndex = childrenOf(child["w:abstractNum"]).filter((level) => "w:lvl" in level).map((level) => {
- var _numberOf7, _valueOf4, _stringOf2, _valueOf5, _numberOf8;
+ var _numberOf6, _valueOf4, _stringOf2, _valueOf5, _numberOf7;
const levelChildren = childrenOf(level["w:lvl"]);
return {
- index: (_numberOf7 = numberOf(attributesOf(level["w:lvl"])["w:ilvl"])) !== null && _numberOf7 !== void 0 ? _numberOf7 : 0,
+ index: (_numberOf6 = numberOf(attributesOf(level["w:lvl"])["w:ilvl"])) !== null && _numberOf6 !== void 0 ? _numberOf6 : 0,
level: _objectSpread2(_objectSpread2({}, withoutUndefined({ style: valueOf(levelChildren, "w:pStyle") })), {}, {
format: (_valueOf4 = valueOf(levelChildren, "w:numFmt")) !== null && _valueOf4 !== void 0 ? _valueOf4 : "decimal",
text: (_stringOf2 = stringOf(attributesOf(find(levelChildren, "w:lvlText"))["w:val"])) !== null && _stringOf2 !== void 0 ? _stringOf2 : "",
suffix: (_valueOf5 = valueOf(levelChildren, "w:suff")) !== null && _valueOf5 !== void 0 ? _valueOf5 : "tab",
- start: (_numberOf8 = numberOf(attributesOf(find(levelChildren, "w:start"))["w:val"])) !== null && _numberOf8 !== void 0 ? _numberOf8 : 0,
+ start: (_numberOf7 = numberOf(attributesOf(find(levelChildren, "w:start"))["w:val"])) !== null && _numberOf7 !== void 0 ? _numberOf7 : 0,
paragraph: readParagraphFormat(find(levelChildren, "w:pPr")),
run: readRunFormat(find(levelChildren, "w:rPr"), styles.themeFonts)
})
@@ -4928,13 +5549,13 @@ var docxLayout = (function(exports) {
* Reads the parts of the document's settings (`w:settings`) that change how it is laid out.
*/
var readSettings = (xml) => {
- var _compatibility$find, _find$, _find, _twips14;
+ var _compatibility$find, _find$, _find2, _twips15;
const settings = childrenOf(xml === null || xml === void 0 ? void 0 : xml["w:settings"]);
const compatibility = childrenOf(find(settings, "w:compat"));
const lists = readKinsokuLists(settings);
const spacingControl = valueOf(settings, "w:characterSpacingControl");
const mode = numberOf(attributesOf((_compatibility$find = compatibility.find((child) => "w:compatSetting" in child && attributesOf(child["w:compatSetting"])["w:name"] === "compatibilityMode")) === null || _compatibility$find === void 0 ? void 0 : _compatibility$find["w:compatSetting"])["w:val"]);
- const unsupported = (_find$ = (_find = [
+ const unsupported = (_find$ = (_find2 = [
[onOff(settings, "w:autoHyphenation"), "hyphenation"],
[onOff(settings, "w:strictFirstAndLastChars"), "the strict rules for the characters that can't start a line"],
[spacingControl !== void 0 && spacingControl !== "doNotCompress", "punctuation compressed"],
@@ -4942,9 +5563,9 @@ var docxLayout = (function(exports) {
[onOff(settings, "w:bookFoldPrinting") || onOff(settings, "w:bookFoldRevPrinting"), "pages printed as a folded booklet"],
[onOff(settings, "w:printTwoOnOne"), "two pages printed on each sheet"],
[onOff(settings, "w:linkStyles"), "styles updated from the document's template when Word opens it"]
- ].find(([applies]) => applies === true)) === null || _find === void 0 ? void 0 : _find[1]) !== null && _find$ !== void 0 ? _find$ : unknownLengthIn(settings);
+ ].find(([applies]) => applies === true)) === null || _find2 === void 0 ? void 0 : _find2[1]) !== null && _find$ !== void 0 ? _find$ : unknownLengthIn(settings);
return _objectSpread2(_objectSpread2({
- defaultTabStop: (_twips14 = twips(attributesOf(find(settings, "w:defaultTabStop"))["w:val"])) !== null && _twips14 !== void 0 ? _twips14 : 36,
+ defaultTabStop: (_twips15 = twips(attributesOf(find(settings, "w:defaultTabStop"))["w:val"])) !== null && _twips15 !== void 0 ? _twips15 : 36,
evenAndOddHeaders: onOff(settings, "w:evenAndOddHeaders") === true,
addsParagraphSpacing: onOff(compatibility, "w:doNotUseHTMLParagraphAutoSpacing") === true
}, Object.keys(lists).length > 0 ? { breakRules: { lists } } : {}), unsupported ? { unsupported } : {});
@@ -4985,7 +5606,7 @@ var docxLayout = (function(exports) {
* Reads a document's body (`w:body`), with the other parts of the document.
*/
var readContent = (body, parts) => {
- var _parts$otherListIds, _parts$otherListIds2, _ref11, _documentContent$unsu;
+ var _parts$otherListIds, _parts$otherListIds2, _ref18, _documentContent$unsu;
const { styles } = parts;
const { lists: numbering, unsupported: inNumbering } = readNumbering(parts.numbering, styles, (_parts$otherListIds = parts.otherListIds) !== null && _parts$otherListIds !== void 0 ? _parts$otherListIds : /* @__PURE__ */ new Map());
const listIds = (_parts$otherListIds2 = parts.otherListIds) !== null && _parts$otherListIds2 !== void 0 ? _parts$otherListIds2 : /* @__PURE__ */ new Map();
@@ -5086,7 +5707,7 @@ var docxLayout = (function(exports) {
footnoteNumbers,
endnoteNumbers
}, readSettings(parts.settings));
- return _objectSpread2(_objectSpread2({}, documentContent), withoutUndefined({ unsupported: (_ref11 = (_documentContent$unsu = documentContent.unsupported) !== null && _documentContent$unsu !== void 0 ? _documentContent$unsu : styles.unsupported) !== null && _ref11 !== void 0 ? _ref11 : inNumbering }));
+ return _objectSpread2(_objectSpread2({}, documentContent), withoutUndefined({ unsupported: (_ref18 = (_documentContent$unsu = documentContent.unsupported) !== null && _documentContent$unsu !== void 0 ? _documentContent$unsu : styles.unsupported) !== null && _ref18 !== void 0 ? _ref18 : inNumbering }));
};
//#endregion
//#region src/layout/read-docx.ts
diff --git a/live-examples/lib/shapes.iife.js b/live-examples/lib/shapes.iife.js
index e795673e72..6b1e827792 100644
--- a/live-examples/lib/shapes.iife.js
+++ b/live-examples/lib/shapes.iife.js
@@ -4047,6 +4047,29 @@ var docxShapes = (function(exports, docx) {
};
};
/**
+ * Reads what a table style (`w:style` of type "table") gives its tables beyond paragraph and run formatting: the margins
+ * of their cells, its table, row and cell properties, and the parts of its formatting for some of their cells.
+ */
+ var readTableStyle = (children, themeFonts) => {
+ const tableProperties = childrenOf(find(children, "w:tblPr"));
+ return {
+ cellMargins: readCellMargins(find(tableProperties, "w:tblCellMar")),
+ tableProperties,
+ rowProperties: childrenOf(find(children, "w:trPr")),
+ cellProperties: childrenOf(find(children, "w:tcPr")),
+ conditional: new Map(children.filter((child) => "w:tblStylePr" in child).map((child) => {
+ const parts = childrenOf(child["w:tblStylePr"]);
+ return [String(attributesOf(child["w:tblStylePr"])["w:type"]), {
+ run: readRunFormat(find(parts, "w:rPr"), themeFonts),
+ paragraph: readParagraphFormat(find(parts, "w:pPr")),
+ tableProperties: childrenOf(find(parts, "w:tblPr")),
+ rowProperties: childrenOf(find(parts, "w:trPr")),
+ cellProperties: childrenOf(find(parts, "w:tcPr"))
+ }];
+ }))
+ };
+ };
+ /**
* Reads the document's defaults and styles from its styles part (`w:styles`), once it is formatted, with the fonts of
* its theme.
*/
@@ -4070,7 +4093,7 @@ var docxShapes = (function(exports, docx) {
}) }), {}, {
run: readRunFormat(find(children, "w:rPr"), themeFonts),
paragraph: readParagraphFormat(find(children, "w:pPr"))
- }, attributes["w:type"] === "table" ? { cellMargins: readCellMargins(find(childrenOf(find(children, "w:tblPr")), "w:tblCellMar")) } : {})
+ }, attributes["w:type"] === "table" ? readTableStyle(children, themeFonts) : {})
};
}).filter((style) => style.id !== void 0);
const defaultStyle = (type) => {
diff --git a/usage/layout.md b/usage/layout.md
index e999a004db..81356d3a1d 100644
--- a/usage/layout.md
+++ b/usage/layout.md
@@ -195,7 +195,8 @@ The pages are laid out with the widths and heights of the characters of the font
- numbered and bulleted lists, including those a paragraph's style numbers it in
- footnotes, which take room at the bottom of the page their reference is on, and endnotes, which follow the text. A footnote that doesn't fit below its reference continues at the bottom of the next page, as Word continues it: it breaks between its paragraphs and table rows, and inside a paragraph keeping to its widow and orphan control, and its reference's line moves to the next page with it when too little of it would stay. One longer than a page fills the pages after it, and the text goes on above its end. A table row refers to footnotes as a line does: it moves to the next page with a footnote that doesn't fit below it, and one that breaks across pages has each line's footnote on the page the line is on, and breaks after a line whose footnote continues. In columns, the footnotes of a page are laid out in the columns too, as Word lays them out: one after the other from the first column, evened out, and every column ends above them
- pictures in the line
-- tables, with their columns' widths (`columnWidths`, or their cells' widths), their rows' heights, cell margins and borders. The columns of a table given no widths are sized to their text, as Word sizes them: each as wide as its longest line, or narrower when they don't all fit, but never narrower than its longest word, and a column whose cells give it a width keeps it. A cell merged across columns (`columnSpan`) widens them where its longest line needs more room, each in proportion to how wide it is, and a table in a cell counts as wide as its columns. In a table whose cells all have widths, a column with a word longer than its cells give it is widened to fit the word, and the other columns are narrowed to make room, as Word does, unless the table's layout is fixed. Rows break across pages between the lines of their cells, as Word breaks them, keeping to widow and orphan control and lines kept together, and with room on the page for the space after a cell's paragraph that ends there. They move to the next page whole when a cell would have none of its lines on the page, when they are kept whole (`cantSplit`), and when the page hasn't room for the height they are set to. Where a table breaks across pages, Word draws its bottom border below the last of it on the page, which takes room there too. Header rows are repeated at the top of each page and column a table is on
+- tables, with their columns' widths (`columnWidths`, or their cells' widths), their rows' heights, cell margins and borders. The columns of a table given no widths are sized to their text, as Word sizes them: each as wide as its longest line, or narrower when they don't all fit, but never narrower than its longest word, and a column whose cells give it a width keeps it. A cell merged across columns (`columnSpan`) widens them where its longest line needs more room, each in proportion to how wide it is, and a table in a cell counts as wide as its columns. In a table whose cells all have widths, a column with a word longer than its cells give it is widened to fit the word, and the other columns are narrowed to make room, as Word does, unless the table's layout is fixed. Rows break across pages between the lines of their cells, as Word breaks them, keeping to widow and orphan control and lines kept together, and with room on the page for the space after a cell's paragraph that ends there. They move to the next page whole when a cell would have none of its lines on the page, when they are kept whole (`cantSplit`), and when the page hasn't room for the height they are set to. Where a table breaks across pages, Word draws its bottom border below the last of it on the page, which takes room there too, or its cells' own bottom borders. Header rows are repeated at the top of each page and column a table is on
+- table formatting, as Word lays it out. Borders come from the table's style and the table (`borders`), side by side, from its cells (`TableCell`'s `borders`), and from the parts of its style for some of its cells. Where two cells meet, Word draws the wider of their borders, and each row is as much taller as the widest border above its cells. Double, triple and the other styles of border take the room Word gives them, such as three times their width for a double border, and a border's `space` adds to it. A cell's text is as far in from a border beside it as its margin, or half the border when that is more. A row is as tall as its tallest cell's text, with the largest margins above and below of its cells, which needn't be the same cell's. Space between cells (`cellSpacing`) goes around each cell and inside the table's edges, and the table keeps its width, its columns narrowed for the space as Word narrows them. A row whose first cell's first paragraph is kept with the next (`keepNext`) is kept on the page with the next row, or, for the last row, with the paragraph after the table, and rows kept together that don't fit on a page of their own start a new page and break where it ends. Text that runs up or down a cell (`textDirection`) makes its row only as tall as a line of its paragraph mark, as Word breaks it into lines as long as the row is tall. A table sized to its text that is indented (`indent`) is sized in the room the indent leaves. The parts of a table style for some cells, such as its first row, its last column or its bands of rows, apply where the table turns them on (`tableLook`), and where it doesn't say, as Word turns them on: its first row and column and its bands of rows. In [templates](#templates), an empty last paragraph of a cell whose mark is hidden (`w:hideMark`) takes no room
- sections, with their page sizes, margins, columns, headers and footers, how they start, and their page numbering. Page numbers are written in Word's number formats as Word writes them, such as roman numerals, letters, words ("twenty-one") and the numbers of other languages, but for those it leaves blank (see below), and with chapter numbers in front of them (`chapterHeadingLevel`), such as 2-5 for page 5 of chapter 2. Each column's lines are broken at its own width, so a paragraph that goes on into a column of another width is broken again there, as Word breaks it. Widow control counts the lines left for the next column as they are broken in the column before, as Word counts them, and a table sized to its text keeps its columns' widths in a wider column. Columns before a continuous section break are evened out, as Word evens them out, unless a column break is in them, and the next section starts below the longest. A section that starts in the next column (`SectionType.NEXT_COLUMN`) starts in the next column of the page when the section before has as many columns and one is left, as Word starts it, and on a new page otherwise. A paragraph kept together that is taller than a column goes down only the first column of each page, as Word lays it out, from the top of a new page unless it is at the top of this one, and what follows it goes on below it. A section that ends with a table has a line below it for the empty paragraph that ends the section, as Word has it
## What it leaves blank
@@ -211,6 +212,10 @@ It stops at the first thing it can't lay out yet, and the page numbers of the he
- footnotes in columns of different widths, a footnote in columns that doesn't fit below its reference, or that moves its reference to the next page when the columns are laid out above it, footnotes referred to from two sections on one page, the first of them in columns, and a footnote in a section that starts in the next column when a column of the section before goes down further than it leaves room for
- a table row kept whole that is taller than a page, a row that breaks across pages with merged cells, or a table in it, and a row that doesn't fit on the page with the text of a cell merged down from a row above in it
- a footnote in a table row that holds back lines of a cell beside it, which would fit on the page above the footnote, and a table row that fits on an empty page, but not with its footnote
+- a table border in a style Word's PDFs haven't shown, such as a picture border, or a wave or 3D border of another width than half a point, 1.5 or 3 points, and two cells' borders of different styles where they meet
+- space between a table's cells beside borders left or right of them, with a long word in a cell, or in a table wider than its cells, a row of a table with space between its cells and borders where the table breaks across pages, and a row of one that breaks across pages
+- text that runs up or down a table cell in a row that breaks across pages, in a table sized to its text, with a word longer than its cell, or with paragraph marks of different sizes, a picture or a table in it
+- a table row kept with the next before a row that then moves to the next page whole, such as one of a height that doesn't fit
- a table whose rows give a column different widths, a table given no widths of more than 63 columns, more than Word allows, and, in a table whose cells all have widths, a word longer than the table can make room for, a long word in a table wider than its cells, or one in a table with cells merged across its columns
- a long word in a cell merged across the columns of a table given no widths, which Word makes room for in a way not yet followed: a word longer than those columns' longest words together, when the table is narrowed to fit, or than their longest lines together, when more than one of them has anything in it
- a character whose width in its font isn't known, so its line may not be where Word puts it: a letter or symbol its font doesn't have, or its font's file has no glyph for, which Word draws in another font, such as most mathematical symbols in Calibri, Arial and Courier New, which Word draws in Cambria Math; a few that Word drew in a way their widths can't be read from, such as Ž and Ё in Courier New; and a symbol font's own symbol, such as Wingdings' tick (`SymbolRun`), or a symbol whose character isn't four hexadecimal digits
@@ -223,7 +228,7 @@ It stops at the first thing it can't lay out yet, and the page numbers of the he
- page numbers in Thai and Hindi words (`thaiCounting` and `hindiCounting`), and page numbers Word writes as an error: any in `none`, 0 in Hebrew, Arabic, Thai and Hindi digits and Chicago's symbols, and those past where a format's letters run out, such as 781 in letters. Page numbers in Hebrew past 100, and in Hindi letters past 75 (`hindiVowels`) and 37 (`hindiConsonants`), haven't been checked in Word yet
- a chapter number from a heading in a table
- a document in compatibility mode, which Word lays out as an older version of Word did: one saved by Word 2010 or earlier, or by an application that writes an older mode, such as LibreOffice, or given an older `compatibility` `version`
-- in [templates](#templates), what `docx` doesn't write and Word lays out in ways not yet followed: text with a phonetic guide, text fitted to a width or to its cell, two lines in one and horizontal in vertical text, ink and other content parts, a subdocument, a paragraph or table row in an HTML division, a table cell whose text doesn't wrap, cells merged across columns as old versions of Word wrote them, footnotes in columns of their own, a content control Word fills in from custom XML when it opens the document, pages printed as a folded booklet or two to a sheet, and styles Word updates from the document's template when it opens it
+- in [templates](#templates), what `docx` doesn't write and Word lays out in ways not yet followed: space between table cells as a share of the table's width or of a row's own, a table indented by a share of the width, a row with table properties of its own, a table style with formatting of its rows or cells, or a part of one for some cells with properties other than borders and margins, text in a table cell in a direction with East Asian characters upright, text with a phonetic guide, text fitted to a width or to its cell, two lines in one and horizontal in vertical text, ink and other content parts, a subdocument, a paragraph or table row in an HTML division, a table cell whose text doesn't wrap, cells merged across columns as old versions of Word wrote them, footnotes in columns of their own, a content control Word fills in from custom XML when it opens the document, pages printed as a folded booklet or two to a sheet, and styles Word updates from the document's template when it opens it
When laying out the pages again with the page numbers it worked out still changes them after three passes, as when a table of contents wraps one way with a number and the other way without it, all of them are left blank, and `layoutDocument` lays out the pages without them.
The unique identifier for this abstract numbering definition.