Repository navigation
0.1.4
CR-003 phase A: the helpers @docx4j/core-ts needed from the object model, each replacing a private copy there.
builders/wml
- Content controls:
sdt(content, options)builds all fourw:sdtforms, with the form inferred
from the content (w:tra row,w:tca cell, runs a run, else block) or forced with{ form }.
sdtPrwritesw:alias,w:tag,w:idand the kind element in that order, with Office JS's
ContentControlTypenames as the kinds.nextSdtId(root)gives an id free in a tree, and
sdtProperty/sdtKindOfread a control's properties and its kind back. - Rows and cells:
tr(cells, { widths })andtc(blocks, { width }).tblis now built over
them, with its output unchanged. - Inline pictures:
inlinePicture(relId, { cx, cy, id, name, descr, title }), docx4j's
BinaryPartAbstractImage.createImageInline, including thewp:docPr/@titlethat docx4j CR-018
added (Office JSaltTextTitle). - Run properties as an element list:
rPrToElements/rPrFromElementsconvert between
w:rPr's named properties and theEG_RPrBaselist thatw:rPrChange/w:rPrkeeps, in schema
order and covering every member, the w14 effects included. walkAll:walkplus the DOM elements anxs:anyproperty holds, so a caller can rewrite
r:embedwherever it appears.runItemsOf(added in 0.1.3) is documented here for the first time.
Facade
deepCopyAs(value, typeName, parent?)copies and types the copy as one of the value's base
types, dropping the properties that type does not declare: aw:pPrChangeholds aPPrBase, and a
copy that stays aPPrmarshals as<w:pPr xsi:type="w:CT_PPr">, which is valid but not what Word
writes.deepCopyAsSyncandgetContextSync()are the same for a caller that cannot await and
knows the context is built;getContextSyncthrows otherwise.
Notes
All additive, so this is a patch release. @docx4j/core-ts reviewed every signature against its call
sites before publication; deepCopyAsSync exists because of that review.
Requires @docx4j/jsonix ^3.2.1.