docx-plus 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -11,33 +11,57 @@ Easily generate and modify .docx files with JS/TS. Works for Node and on the Bro
11
11
 
12
12
  ## What's Different from docx?
13
13
 
14
- | | docx | docx-plus |
15
- | ------------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
16
- | ZIP handling | jszip | **fflate** (faster, smaller) |
17
- | Data conversion | Manual env detection (`Buffer.from` etc.) | **undio** (universal `toUint8Array`) |
18
- | `Packer.toStream()` | Removed (pseudo-streaming) | **Restored** with real streaming ZIP |
19
- | Theme support | Partial (missing `ThemeColor`/`ThemeFont`) | **Full** (`ThemeColor`, `ThemeFont` enums, theme attributes on `Color`, `Underline`, `Border`, `Shading`) |
20
- | CT_Ind | Twips-only indent | **Character-based** (`startChars`, `endChars`, `hangingChars`, `firstLineChars`) |
21
- | CT_Spacing | Missing `beforeLines`/`afterLines` | **Complete** (both twips & line-unit spacing) |
22
- | CT_Border | Missing `shadow`/`frame`/theme attrs | **Complete** (`shadow`, `frame`, `themeColor`, `themeTint`, `themeShade`) |
23
- | CT_Shd | Missing theme fill/color attrs | **Complete** (`themeColor`, `themeFill`, `themeTint`/`themeShade`) |
24
- | EG_RPrBase | Missing `outline`/`shadow`/`webHidden`/`fitText`/`cs`/`eastAsianLayout` | **Complete** (all spec-defined elements including `eastAsianLayout`) |
25
- | ST_Em | `dot` only | **Complete** (`none`, `comma`, `circle`, `dot`, `underDot`) |
26
- | ST_TabTlc | Missing `heavy` | **Complete** (`none`, `dot`, `hyphen`, `middleDot`, `underscore`, `heavy`) |
27
- | CT_PPrBase | Missing 9 paragraph props | **Complete** (`suppressAutoHyphens`, `adjustRightInd`, `snapToGrid`, `mirrorIndents`, East Asian typography, `textAlignment`, `textboxTightWrap`) |
28
- | CT_SectPr | Missing `noEndnote`/`bidi`/`rtlGutter`/`paperSrc`/`footnotePr`/`endnotePr` | **Complete** (all spec-defined elements) |
29
- | DrawingML colors | RGB + scheme only | **Complete** (`EG_ColorChoice`: RGB, scheme, HSL, system, preset + `EG_ColorTransform` with 29 transforms) |
30
- | DrawingML fills | Solid fill only | **Complete** (`solidFill`, `noFill`, `gradFill` with linear/path gradient + color stops) |
31
- | DrawingML outline | Basic line (width, cap, fill) | **Complete** (`a:ln` with `prstDash`, `lineJoin`, compound line, pen alignment, all fill types) |
32
- | DrawingML effects | Not implemented | **Complete** (`effectLst`: blur, fillOverlay, glow, outerShdw, innerShdw, prstShdw, reflection, softEdge — works on both shapes and images) |
33
- | DrawingML 3D | Not implemented | **Complete** (`sp3d`: bevel top/bottom, extrusionClr, contourClr, preset materials) |
34
- | Image cropping | Not implemented | **Supported** (`srcRect` with configurable `l/t/r/b` percentages) |
35
- | Image fill mode | Stretch only | **Complete** (`stretch` default, `tile` with scale/flip/alignment options) |
36
- | Image adjustment | Not implemented | **Supported** (grayscale, luminance, HSL, tint, duotone, biLevel, alphaCeiling/Floor/Inverse/ModFix/Repl/BiLevel, colorChange, colorRepl, blur) |
37
- | Image hyperlink | Click only (via wrapping `ExternalHyperlink`) | **Complete** (explicit `hyperlink.click`/`hyperlink.hover` on `altText`, with relationship registration) |
38
- | Group Shape | Basic (transform only) | **Enhanced** (fill, effects, `chOff`/`chExt` child coordinates) |
39
- | Test environment | jsdom | happy-dom |
40
- | OOXML compliance | ECMA-376 (legacy) | **ISO/IEC 29500-4** (latest) also aligned with Microsoft Word and WPS default behavior |
14
+ | | docx | docx-plus |
15
+ | ----------------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
16
+ | ZIP handling | jszip | **fflate** (faster, smaller) |
17
+ | Data conversion | Manual env detection (`Buffer.from` etc.) | **undio** (universal `toUint8Array`) |
18
+ | `Packer.toStream()` | Removed (pseudo-streaming) | **Restored** with real streaming ZIP |
19
+ | Theme support | Partial (missing `ThemeColor`/`ThemeFont`) | **Full** (`ThemeColor`, `ThemeFont` enums, theme attributes on `Color`, `Underline`, `Border`, `Shading`) |
20
+ | CT_Ind | Twips-only indent | **Character-based** (`startChars`, `endChars`, `hangingChars`, `firstLineChars`) |
21
+ | CT_Spacing | Missing `beforeLines`/`afterLines` | **Complete** (both twips & line-unit spacing) |
22
+ | CT_Border | Missing `shadow`/`frame`/theme attrs | **Complete** (`shadow`, `frame`, `themeColor`, `themeTint`, `themeShade`) |
23
+ | CT_Shd | Missing theme fill/color attrs | **Complete** (`themeColor`, `themeFill`, `themeTint`/`themeShade`) |
24
+ | EG_RPrBase | Missing `outline`/`shadow`/`webHidden`/`fitText`/`cs`/`eastAsianLayout` | **Complete** (all spec-defined elements including `eastAsianLayout`) |
25
+ | ST_Em | `dot` only | **Complete** (`none`, `comma`, `circle`, `dot`, `underDot`) |
26
+ | ST_TabTlc | Missing `heavy` | **Complete** (`none`, `dot`, `hyphen`, `middleDot`, `underscore`, `heavy`) |
27
+ | CT_PPrBase | Missing 9 paragraph props | **Complete** (`suppressAutoHyphens`, `adjustRightInd`, `snapToGrid`, `mirrorIndents`, East Asian typography, `textAlignment`, `textboxTightWrap`) |
28
+ | CT_SectPr | Missing `noEndnote`/`bidi`/`rtlGutter`/`paperSrc`/`footnotePr`/`endnotePr` | **Complete** (all spec-defined elements) |
29
+ | CT_SdtRun / CT_SdtBlock | Not implemented | **Complete** (`StructuredDocumentTagRun`, comboBox, dropDownList, date, text, equation, data binding) |
30
+ | CT_FFData | Basic checkbox only | **Complete** (`checkBox`, `ddList`, `textInput` with all options) |
31
+ | CT_Ruby | Not implemented | **Complete** (furigana/pinyin with all alignment options) |
32
+ | CT_TblStylePr | Not implemented | **Complete** (all 13 override types with paragraph/run/table/row/cell properties) |
33
+ | CT_CustomGeometry2D | Not implemented | **Complete** (`custGeom` with moveTo, lineTo, arcTo, quadBezTo, cubicBezTo, close) |
34
+ | CT_Scene3D | Not implemented | **Complete** (`scene3d` with camera, lightRig, backdrop) |
35
+ | CT_EffectContainer | Not implemented | **Complete** (`effectDag` with 28 effect types, recursive nesting, `sib`/`tree` container types) |
36
+ | CT_TextBodyProperties | 5 attributes, 1 child element | **Complete** (all 19 attributes + prstTxWarp, EG_TextAutofit, scene3d, EG_Text3D) |
37
+ | DrawingML colors | RGB + scheme only | **Complete** (`EG_ColorChoice`: RGB, scheme, HSL, system, preset + `EG_ColorTransform` with 29 transforms) |
38
+ | DrawingML fills | Solid fill only | **Complete** (`solidFill`, `noFill`, `gradFill`, `pattFill`, `grpFill`) |
39
+ | DrawingML outline | Basic line (width, cap, fill) | **Complete** (`a:ln` with `prstDash`, `lineJoin`, compound line, pen alignment, all fill types, line end markers) |
40
+ | DrawingML effects | Not implemented | **Complete** (`effectLst` + `effectDag`: blur, fillOverlay, glow, outerShdw, innerShdw, prstShdw, reflection, softEdge + 20 additional effects) |
41
+ | DrawingML 3D | Not implemented | **Complete** (`sp3d` + `scene3d`: bevel, extrusion, contour, materials, camera, lightRig, rotation) |
42
+ | Image cropping | Not implemented | **Supported** (`srcRect` with configurable `l/t/r/b` percentages) |
43
+ | Image fill mode | Stretch only | **Complete** (`stretch` default, `tile` with scale/flip/alignment options) |
44
+ | Image adjustment | Not implemented | **Supported** (grayscale, luminance, HSL, tint, duotone, biLevel, alpha effects, colorChange, colorRepl, blur) |
45
+ | Image hyperlink | Click only (via wrapping `ExternalHyperlink`) | **Complete** (explicit `hyperlink.click`/`hyperlink.hover` on `altText`, with relationship registration) |
46
+ | Math advanced | Basic math only | **Complete** (box, borderBox, eqArr, groupChr, matrix, phant, accent, fraction, nAry, func, delim, bar, limLow, limUpp, sPre, sSub, sSup) |
47
+ | Group Shape | Basic (transform only) | **Enhanced** (fill, effects, `chOff`/`chExt` child coordinates) |
48
+ | Test environment | jsdom | happy-dom |
49
+ | OOXML compliance | ECMA-376 (legacy) | **ISO/IEC 29500-4** (latest) — comprehensive WordprocessingML, DrawingML, and Shared Math coverage; see scope notes below |
50
+
51
+ ## OOXML Coverage
52
+
53
+ **docx-plus** provides comprehensive coverage of the WordprocessingML, DrawingML, and Shared Math specifications within ISO/IEC 29500-4. This includes:
54
+
55
+ - **WordprocessingML**: paragraphs, runs, tables (full row/cell/table properties), sections, headers/footers, footnotes/endnotes, table of contents, numbering/lists, styles, bookmarks, hyperlinks, SDT content controls, form fields, track changes, comments, bibliography sources, math equations, ruby annotations, and more
56
+ - **DrawingML**: shapes, images, text bodies, colors (all 6 color types + 29 transforms), fills (solid, gradient, pattern, group), outlines, effects (28 types with recursive containers), 3D scenes, custom geometry, and image adjustments
57
+ - **Shared Math**: all equation structures (fraction, radical, n-ary, integrals, matrices, accents, delimiters, etc.)
58
+
59
+ **Not in scope** (separate OOXML domains with their own dedicated specifications):
60
+
61
+ - **SmartArt** (`dgm:`) — graphical diagram engine
62
+ - **Charts** (`c:`) — native OOXML charting (typically handled by charting libraries)
63
+ - **Mail Merge** — field codes are supported, but external data source connections are not
64
+ - **Cover Pages** — `docPartObj` SDT is supported, but Building Blocks part references require template files
41
65
 
42
66
  ## Installation
43
67
 
@@ -85,7 +109,7 @@ Please refer to the [documentation](https://github.com/DemoMacro/docx-plus#readm
85
109
 
86
110
  ## Examples
87
111
 
88
- Check the [demo folder](https://github.com/DemoMacro/docx-plus/tree/master/demo) for 90+ working examples covering every feature.
112
+ Check the [demo folder](https://github.com/DemoMacro/docx-plus/tree/master/demo) for 110+ working examples covering every feature.
89
113
 
90
114
  ## Contributing
91
115