Skip to content

Latest commit

 

History

History
383 lines (214 loc) · 12.4 KB

CHANGELOG.md

File metadata and controls

383 lines (214 loc) · 12.4 KB

Change Log

Fixed

  • Fix "Module not found: Default condition should be last one" error.

Fixed

  • Re-fix importing the package without a bundler (#120).

Fixed

  • Fix importing the package without a bundler (#120).

Added

  • Image transparency support (#109).

This version introduces the notion of "tag options". These options are controlled through the template and are useful for situations where we want to allow the template author to use the same data in different ways. For instance, if we have a collection in the data and we want to allow the template author to use this collection inside a table to either produce multiple rows or in order to expand the collection inside a single table cell. In this case, the template author will be able to specify either {# my collection [loopOver: "row"]} or {# my collection [loopOver: "content"]} to control the resulting outcome.

Added

  • BREAKING - Introduce "tag options" syntax: {tag name [options]}. E.g. {# Students [loopOver: "rows"]}.
    • This may break existing templates that use brackets as part of their tag names.
    • If you still need to use brackets in the tag name (for instance if you are using an advanced syntax and access an array element by index), you can change the tag options delimiters through the TemplateHandler options (e.g. use [[ options ]] instead of [ options ]).
  • loopOver tag option, to control loop behavior in tables, as explained above.

Changed

  • BREAKING - A loop inside a single table cell is assumed to be a paragraph loop, not a table loop (will repeat content, not rows; should fix #50, #52, #56, #85, #92 and #110). The default behavior can be overridden by using the new loopOver option.

Fixed

  • Properly handle XML comments in template doc (#113).

Added

  • Link tooltip support (#91).

Added

  • Image alt text support (#86).

Changed

  • Update dependencies (xmldom).

Fixed

  • Encode attribute values (#62).

Changed

  • Update dependencies (jszip, xmldom) (#73).

Added

  • Add documentation for the parseTags method (here) (#65).

Fixed

  • Use ESM import for lodash.get so the package can be used with modern bundlers (#66).

Added

  • BREAKING - Add support for nesting tags, loops and other conditions inside simple conditions (#49). This requires changing the way some values are look up in the input data. Please see the readme file for details (here).

Added

  • Add skipEmptyTag option (#45).

Added

  • Support for simple conditions (docs).
  • Support for custom data resolvers - enables advanced syntax support (docs).

Changed

  • BREAKING - Container closing tag name is ignored and no longer throws when the closing tag has different name than the opening one (docs).

Changed

  • Update dependencies (jszip, xmldom).

Stable release - from now on breaking changes to the public API (the public interface of TemplateHandler) will introduce a new major release.

Fixed

  • Initial content types parsing.
  • Bug in paragraph loops (#36).

Added

  • Headers and footers support.

Fixed

  • Consistent handling of RawXmlContent when the xml prop is null.

Added

  • Support for RawXmlContent.replaceParagraph.

Added

  • Expose "Community Extensions" on npm (readme changes).

Fixed

  • Parsing of tags with custom delimiters.

Fixed

  • Parsing of tags with custom delimiters.

Fixed

  • Export extensions types.

Added

  • Expose Docx.rawZipFile property.

Added

  • Extensions API (#24).

Added

  • Allow overriding container tag logic using explicit content type.

Changed

  • ScopeData.getScopeData is now generic (#17).
  • The data argument of TemplateHandler.process is now strongly typed.
  • Bundle with Rollup instead of Webpack.
  • Auto generate typings.

Fixed

  • Fix typings.

Changed

  • BREAKING: Delimiters can not contain leading or trailing whitespace.
  • Loosen up TemplateHandlerOptions typings.

Fixed

  • Loop tag names trimming.
  • Custom loop delimiters support.
  • Zip export and typings.

Added

Fixed

  • Re-fix "Binary type 'Buffer' is not supported" on Node.

Fixed

  • Link plugin in cases where the link tag is not the only node in it's run.

Added

  • Link plugin.
  • TemplateHandler.version property.

This version removes the notion of a "tag type" and uses instead the notion of "content type". Instead of inferring the type from the tag prefix the type is now explicitly declared in the supplied JSON data.

Example:

Before:

tag: "{@newPage}"  
data: {  
    newPage: "<w:br w:type="page"/>"
}

After:

tag: "{newPage}"
data: {
    newPage: {
        _type: "rawXml",
        xml: "<w:br w:type="page"/>"
    }
}

The only exceptions are the "loop" content type which still uses the "#" opening prefix and "/" closing prefix, and the "text" content type which is the default and does not requires explicitly stating it.

Added

  • Image plugin.
  • Support multi-character delimiters.
  • Template plugins can be async.
  • Improved the docs (readme).

Changed

  • BREAKING: RawXmlPlugin requires data of the form { _type: 'rawXml', xml: string }.

Removed

  • BREAKING: Remove the Tag.type property.

Fixed

  • Parsing error in some cases where multiple tags are declared in the same run.

Fixed

  • "Binary type 'Buffer' is not supported." on Node 12.

Fixed

  • Handle non-textual values (numbers, booleans...) in TextPlugin.

Added

  • Loop over lists and table rows.
    Notice: The loop logic for tables is a bit different than the logic of the existing paragraph loop. Instead of repeating the content in between the opening and closing tags it repeats entire rows (including content in the row that appears before the opening or after the closing tag). The same goes for lists - the entire bullet is repeated.
  • Throw MalformedFileError when fails to open template file as zip.
  • Continuous integration with CircleCI.

Changed

  • Change dev stack to Babel, Jest and ESLint.

Added

  • Easily find out what tags are present in a given template (TemplateHandler.parseTags).

Added

  • Full browser example in readme file.

Added

  • Package keywords for npm visibility.

Fixed

  • Fix serialization of text nodes with empty values.

Added

  • Add readme badges

Added

  • Preserve leading and trailing whitespace
  • More info on missing delimiter errors

Fixed

  • Various bug fixes

Added

  • Typings file
  • First version

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

  • Added for new features.
  • Changed for changes in existing functionality.
  • Deprecated for soon-to-be removed features.
  • Removed for now removed features.
  • Fixed for any bug fixes.
  • Security in case of vulnerabilities.