Skip to content

7.0.0

Compare
Choose a tag to compare
@dolanmiu dolanmiu released this 27 Sep 12:55
· 1585 commits to master since this release

image

#868 - Update Webpack 3 to Webpack 5 and testing frameworks
#928 - Added support for w:fldSimple, including convenience for MailMerge
#948 - Conform to XML schema
#1031 - Column Break
#1057 - Numbering start from number doesn't work fix
#1074 - PageRef feature
#1163 - Attaching numbering to custom style
#1169 - Use correct height rule
#1168 - Extend Columns API to allow specifying individual column widths/spacing

#956 - V7 Work
#1120 - Multiple children in hyperlinks
#1131 - Add ParagraphChild in Bookmark

New features

In several places, as allowed by the spec, Universal Measure units can now be used.
Universal Measure units are strings in the format /-?[0-9]+(.[0-9]+)?(mm|cm|in|pt|pc|pi)/, for example: "14pt", "20mm", "2in", "2cm".
These include page margins, page size, paragraph indents, and font sizes. These should be experimented with, some of these may not work and need testing -- even if it's technically valid according to the spec.

Added a bunch of formats to NumberFormat.

Much more compliant docx files, which should act more consistently in different editors.

Reduced bundle size slightly.

Boolean options like bold, etc can now be explicitly toggled off -- when set to false it adds the tag to disable it, rather than just omit the tag to enable it, which allows more flexibility.

Breaking changes

Renamed enum PageNumberFormat -> NumberFormat.

Section vertical align enum changed: SectionVerticalAlignValue -> VerticalAlign

Runtime checks were added for some values. These can now throw errors for invalid arguments in some cases.

color values must now be in hex (eg "00CCFF") for Underline, Shading, run color, background color, border color

Paragraph border argument signature changed.
old:

  new Paragraph({
      border: {
          top: {
              value: "single",
              size: 6,
              color: "red",
          },
      }
  })

new:

  new Paragraph({
      border: {
          top: {
              style: BorderStyle.SINGLE,
              size: 6,
              color: "FF0000",
          },
      }
  })

For TableOfContents, updateFields option in Document must be explicitly set:

new Document({
  features: {
      updateFields: true,
  },
  // ...
})

ITableShadingAttributesProperties changed to IShadingAttributesProperties

Table and TableCell shading option signature changed to be consistent with shading everywhere else.

old:

  shading: {
      val: ShadingType.REVERSE_DIAGONAL_STRIPE,
      color: "00FFFF",
      fill: "FF0000",
  },

new:

  shading: {
      type: ShadingType.REVERSE_DIAGONAL_STRIPE,
      color: "00FFFF",
      fill: "FF0000",
  },

A great many internal classes were shifted around or removed. Internal methods were removed in several places. These changes should not affect you if you stuck to the public API (what's in the demos and docs)