docx-plus 0.0.10 → 0.0.11
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 +7 -4
- package/dist/index.cjs +10 -10
- package/dist/index.iife.js +10 -10
- package/dist/index.mjs +10 -10
- package/dist/index.umd.js +10 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,22 +16,25 @@ Easily generate and modify .docx files with JS/TS. Works for Node and on the Bro
|
|
|
16
16
|
| ZIP handling | jszip | **fflate** (faster, smaller) |
|
|
17
17
|
| Data conversion | Manual env detection (`Buffer.from` etc.) | **undio** (universal `toUint8Array`) |
|
|
18
18
|
| `Packer.toStream()` | Removed (pseudo-streaming) | **Restored** with real streaming ZIP |
|
|
19
|
-
| Test environment | jsdom | happy-dom |
|
|
20
|
-
| OOXML compliance | ECMA-376 (legacy) | **ISO/IEC 29500-4** (latest) |
|
|
21
19
|
| Theme support | Partial (missing `ThemeColor`/`ThemeFont`) | **Full** (`ThemeColor`, `ThemeFont` enums, theme attributes on `Color`, `Underline`, `Border`, `Shading`) |
|
|
22
20
|
| CT_Ind | Twips-only indent | **Character-based** (`startChars`, `endChars`, `hangingChars`, `firstLineChars`) |
|
|
23
21
|
| CT_Spacing | Missing `beforeLines`/`afterLines` | **Complete** (both twips & line-unit spacing) |
|
|
24
22
|
| CT_Border | Missing `shadow`/`frame`/theme attrs | **Complete** (`shadow`, `frame`, `themeColor`, `themeTint`, `themeShade`) |
|
|
25
23
|
| CT_Shd | Missing theme fill/color attrs | **Complete** (`themeColor`, `themeFill`, `themeTint`/`themeShade`) |
|
|
26
|
-
| EG_RPrBase | Missing `outline`/`shadow`/`webHidden`/`fitText`/`cs`
|
|
24
|
+
| EG_RPrBase | Missing `outline`/`shadow`/`webHidden`/`fitText`/`cs`/`eastAsianLayout` | **Complete** (all spec-defined elements including `eastAsianLayout`) |
|
|
27
25
|
| ST_Em | `dot` only | **Complete** (`none`, `comma`, `circle`, `dot`, `underDot`) |
|
|
28
26
|
| ST_TabTlc | Missing `heavy` | **Complete** (`none`, `dot`, `hyphen`, `middleDot`, `underscore`, `heavy`) |
|
|
29
27
|
| CT_PPrBase | Missing 9 paragraph props | **Complete** (`suppressAutoHyphens`, `adjustRightInd`, `snapToGrid`, `mirrorIndents`, East Asian typography, `textAlignment`, `textboxTightWrap`) |
|
|
30
28
|
| CT_SectPr | Missing `noEndnote`/`bidi`/`rtlGutter`/`paperSrc`/`footnotePr`/`endnotePr` | **Complete** (all spec-defined elements) |
|
|
31
|
-
| EG_RPrBase | Missing `eastAsianLayout` | **Complete** (`eastAsianLayout` with `combine`, `combineBrackets`, `vert`, `vertCompress`) |
|
|
32
29
|
| DrawingML colors | RGB + scheme only | **Complete** (`EG_ColorChoice`: RGB, scheme, HSL, system, preset + `EG_ColorTransform` with 29 transforms) |
|
|
33
30
|
| DrawingML fills | Solid fill only | **Complete** (`solidFill`, `noFill`, `gradFill` with linear/path gradient + color stops) |
|
|
34
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`: glow, outerShdw, innerShdw, prstShdw, reflection, softEdge) |
|
|
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
|
+
| Group Shape | Basic (transform only) | **Enhanced** (fill, effects, `chOff`/`chExt` child coordinates) |
|
|
36
|
+
| Test environment | jsdom | happy-dom |
|
|
37
|
+
| OOXML compliance | ECMA-376 (legacy) | **ISO/IEC 29500-4** (latest) — also aligned with Microsoft Word and WPS default behavior |
|
|
35
38
|
|
|
36
39
|
## Installation
|
|
37
40
|
|
package/dist/index.cjs
CHANGED
|
@@ -15397,23 +15397,23 @@ const createSectionType = (value) => new BuilderElement({
|
|
|
15397
15397
|
* Default margin values for sections (in twips).
|
|
15398
15398
|
*
|
|
15399
15399
|
* Standard margins are 1 inch (1440 twips) on all sides.
|
|
15400
|
-
* Header/footer margins are
|
|
15400
|
+
* Header/footer margins are from page edge.
|
|
15401
15401
|
*
|
|
15402
15402
|
* @property TOP - Top margin: 1440 twips (1 inch)
|
|
15403
|
-
* @property RIGHT - Right margin:
|
|
15403
|
+
* @property RIGHT - Right margin: 1800 twips (1.25 inches)
|
|
15404
15404
|
* @property BOTTOM - Bottom margin: 1440 twips (1 inch)
|
|
15405
|
-
* @property LEFT - Left margin:
|
|
15406
|
-
* @property HEADER - Header margin:
|
|
15407
|
-
* @property FOOTER - Footer margin:
|
|
15405
|
+
* @property LEFT - Left margin: 1800 twips (1.25 inches)
|
|
15406
|
+
* @property HEADER - Header margin: 851 twips (0.59 inches)
|
|
15407
|
+
* @property FOOTER - Footer margin: 992 twips (0.69 inches)
|
|
15408
15408
|
* @property GUTTER - Gutter margin: 0 twips
|
|
15409
15409
|
*/
|
|
15410
15410
|
const sectionMarginDefaults = {
|
|
15411
15411
|
TOP: 1440,
|
|
15412
|
-
RIGHT:
|
|
15412
|
+
RIGHT: 1800,
|
|
15413
15413
|
BOTTOM: 1440,
|
|
15414
|
-
LEFT:
|
|
15415
|
-
HEADER:
|
|
15416
|
-
FOOTER:
|
|
15414
|
+
LEFT: 1800,
|
|
15415
|
+
HEADER: 851,
|
|
15416
|
+
FOOTER: 992,
|
|
15417
15417
|
GUTTER: 0
|
|
15418
15418
|
};
|
|
15419
15419
|
/**
|
|
@@ -15480,7 +15480,7 @@ const sectionPageSizeDefaults = {
|
|
|
15480
15480
|
* ```
|
|
15481
15481
|
*/
|
|
15482
15482
|
var SectionProperties = class extends XmlComponent {
|
|
15483
|
-
constructor({ page: { size: { width = sectionPageSizeDefaults.WIDTH, height = sectionPageSizeDefaults.HEIGHT, orientation = sectionPageSizeDefaults.ORIENTATION } = {}, margin: { top = sectionMarginDefaults.TOP, right = sectionMarginDefaults.RIGHT, bottom = sectionMarginDefaults.BOTTOM, left = sectionMarginDefaults.LEFT, header = sectionMarginDefaults.HEADER, footer = sectionMarginDefaults.FOOTER, gutter = sectionMarginDefaults.GUTTER } = {}, pageNumbers = {}, borders, textDirection } = {}, grid: { linePitch =
|
|
15483
|
+
constructor({ page: { size: { width = sectionPageSizeDefaults.WIDTH, height = sectionPageSizeDefaults.HEIGHT, orientation = sectionPageSizeDefaults.ORIENTATION } = {}, margin: { top = sectionMarginDefaults.TOP, right = sectionMarginDefaults.RIGHT, bottom = sectionMarginDefaults.BOTTOM, left = sectionMarginDefaults.LEFT, header = sectionMarginDefaults.HEADER, footer = sectionMarginDefaults.FOOTER, gutter = sectionMarginDefaults.GUTTER } = {}, pageNumbers = {}, borders, textDirection } = {}, grid: { linePitch = 312, charSpace = 0, type: gridType = "lines" } = {}, headerWrapperGroup = {}, footerWrapperGroup = {}, lineNumbers, titlePage, verticalAlign, column, type, revision, noEndnote, bidi, rtlGutter, paperSrc, footnotePr, endnotePr } = {}) {
|
|
15484
15484
|
super("w:sectPr");
|
|
15485
15485
|
this.addHeaderFooterGroup(HeaderFooterType.HEADER, headerWrapperGroup);
|
|
15486
15486
|
this.addHeaderFooterGroup(HeaderFooterType.FOOTER, footerWrapperGroup);
|
package/dist/index.iife.js
CHANGED
|
@@ -15392,23 +15392,23 @@ var docx = (function(exports, xml_js, hash_js, nanoid_non_secure, undio, fflate,
|
|
|
15392
15392
|
* Default margin values for sections (in twips).
|
|
15393
15393
|
*
|
|
15394
15394
|
* Standard margins are 1 inch (1440 twips) on all sides.
|
|
15395
|
-
* Header/footer margins are
|
|
15395
|
+
* Header/footer margins are from page edge.
|
|
15396
15396
|
*
|
|
15397
15397
|
* @property TOP - Top margin: 1440 twips (1 inch)
|
|
15398
|
-
* @property RIGHT - Right margin:
|
|
15398
|
+
* @property RIGHT - Right margin: 1800 twips (1.25 inches)
|
|
15399
15399
|
* @property BOTTOM - Bottom margin: 1440 twips (1 inch)
|
|
15400
|
-
* @property LEFT - Left margin:
|
|
15401
|
-
* @property HEADER - Header margin:
|
|
15402
|
-
* @property FOOTER - Footer margin:
|
|
15400
|
+
* @property LEFT - Left margin: 1800 twips (1.25 inches)
|
|
15401
|
+
* @property HEADER - Header margin: 851 twips (0.59 inches)
|
|
15402
|
+
* @property FOOTER - Footer margin: 992 twips (0.69 inches)
|
|
15403
15403
|
* @property GUTTER - Gutter margin: 0 twips
|
|
15404
15404
|
*/
|
|
15405
15405
|
const sectionMarginDefaults = {
|
|
15406
15406
|
TOP: 1440,
|
|
15407
|
-
RIGHT:
|
|
15407
|
+
RIGHT: 1800,
|
|
15408
15408
|
BOTTOM: 1440,
|
|
15409
|
-
LEFT:
|
|
15410
|
-
HEADER:
|
|
15411
|
-
FOOTER:
|
|
15409
|
+
LEFT: 1800,
|
|
15410
|
+
HEADER: 851,
|
|
15411
|
+
FOOTER: 992,
|
|
15412
15412
|
GUTTER: 0
|
|
15413
15413
|
};
|
|
15414
15414
|
/**
|
|
@@ -15475,7 +15475,7 @@ var docx = (function(exports, xml_js, hash_js, nanoid_non_secure, undio, fflate,
|
|
|
15475
15475
|
* ```
|
|
15476
15476
|
*/
|
|
15477
15477
|
var SectionProperties = class extends XmlComponent {
|
|
15478
|
-
constructor({ page: { size: { width = sectionPageSizeDefaults.WIDTH, height = sectionPageSizeDefaults.HEIGHT, orientation = sectionPageSizeDefaults.ORIENTATION } = {}, margin: { top = sectionMarginDefaults.TOP, right = sectionMarginDefaults.RIGHT, bottom = sectionMarginDefaults.BOTTOM, left = sectionMarginDefaults.LEFT, header = sectionMarginDefaults.HEADER, footer = sectionMarginDefaults.FOOTER, gutter = sectionMarginDefaults.GUTTER } = {}, pageNumbers = {}, borders, textDirection } = {}, grid: { linePitch =
|
|
15478
|
+
constructor({ page: { size: { width = sectionPageSizeDefaults.WIDTH, height = sectionPageSizeDefaults.HEIGHT, orientation = sectionPageSizeDefaults.ORIENTATION } = {}, margin: { top = sectionMarginDefaults.TOP, right = sectionMarginDefaults.RIGHT, bottom = sectionMarginDefaults.BOTTOM, left = sectionMarginDefaults.LEFT, header = sectionMarginDefaults.HEADER, footer = sectionMarginDefaults.FOOTER, gutter = sectionMarginDefaults.GUTTER } = {}, pageNumbers = {}, borders, textDirection } = {}, grid: { linePitch = 312, charSpace = 0, type: gridType = "lines" } = {}, headerWrapperGroup = {}, footerWrapperGroup = {}, lineNumbers, titlePage, verticalAlign, column, type, revision, noEndnote, bidi, rtlGutter, paperSrc, footnotePr, endnotePr } = {}) {
|
|
15479
15479
|
super("w:sectPr");
|
|
15480
15480
|
this.addHeaderFooterGroup(HeaderFooterType.HEADER, headerWrapperGroup);
|
|
15481
15481
|
this.addHeaderFooterGroup(HeaderFooterType.FOOTER, footerWrapperGroup);
|
package/dist/index.mjs
CHANGED
|
@@ -15372,23 +15372,23 @@ const createSectionType = (value) => new BuilderElement({
|
|
|
15372
15372
|
* Default margin values for sections (in twips).
|
|
15373
15373
|
*
|
|
15374
15374
|
* Standard margins are 1 inch (1440 twips) on all sides.
|
|
15375
|
-
* Header/footer margins are
|
|
15375
|
+
* Header/footer margins are from page edge.
|
|
15376
15376
|
*
|
|
15377
15377
|
* @property TOP - Top margin: 1440 twips (1 inch)
|
|
15378
|
-
* @property RIGHT - Right margin:
|
|
15378
|
+
* @property RIGHT - Right margin: 1800 twips (1.25 inches)
|
|
15379
15379
|
* @property BOTTOM - Bottom margin: 1440 twips (1 inch)
|
|
15380
|
-
* @property LEFT - Left margin:
|
|
15381
|
-
* @property HEADER - Header margin:
|
|
15382
|
-
* @property FOOTER - Footer margin:
|
|
15380
|
+
* @property LEFT - Left margin: 1800 twips (1.25 inches)
|
|
15381
|
+
* @property HEADER - Header margin: 851 twips (0.59 inches)
|
|
15382
|
+
* @property FOOTER - Footer margin: 992 twips (0.69 inches)
|
|
15383
15383
|
* @property GUTTER - Gutter margin: 0 twips
|
|
15384
15384
|
*/
|
|
15385
15385
|
const sectionMarginDefaults = {
|
|
15386
15386
|
TOP: 1440,
|
|
15387
|
-
RIGHT:
|
|
15387
|
+
RIGHT: 1800,
|
|
15388
15388
|
BOTTOM: 1440,
|
|
15389
|
-
LEFT:
|
|
15390
|
-
HEADER:
|
|
15391
|
-
FOOTER:
|
|
15389
|
+
LEFT: 1800,
|
|
15390
|
+
HEADER: 851,
|
|
15391
|
+
FOOTER: 992,
|
|
15392
15392
|
GUTTER: 0
|
|
15393
15393
|
};
|
|
15394
15394
|
/**
|
|
@@ -15455,7 +15455,7 @@ const sectionPageSizeDefaults = {
|
|
|
15455
15455
|
* ```
|
|
15456
15456
|
*/
|
|
15457
15457
|
var SectionProperties = class extends XmlComponent {
|
|
15458
|
-
constructor({ page: { size: { width = sectionPageSizeDefaults.WIDTH, height = sectionPageSizeDefaults.HEIGHT, orientation = sectionPageSizeDefaults.ORIENTATION } = {}, margin: { top = sectionMarginDefaults.TOP, right = sectionMarginDefaults.RIGHT, bottom = sectionMarginDefaults.BOTTOM, left = sectionMarginDefaults.LEFT, header = sectionMarginDefaults.HEADER, footer = sectionMarginDefaults.FOOTER, gutter = sectionMarginDefaults.GUTTER } = {}, pageNumbers = {}, borders, textDirection } = {}, grid: { linePitch =
|
|
15458
|
+
constructor({ page: { size: { width = sectionPageSizeDefaults.WIDTH, height = sectionPageSizeDefaults.HEIGHT, orientation = sectionPageSizeDefaults.ORIENTATION } = {}, margin: { top = sectionMarginDefaults.TOP, right = sectionMarginDefaults.RIGHT, bottom = sectionMarginDefaults.BOTTOM, left = sectionMarginDefaults.LEFT, header = sectionMarginDefaults.HEADER, footer = sectionMarginDefaults.FOOTER, gutter = sectionMarginDefaults.GUTTER } = {}, pageNumbers = {}, borders, textDirection } = {}, grid: { linePitch = 312, charSpace = 0, type: gridType = "lines" } = {}, headerWrapperGroup = {}, footerWrapperGroup = {}, lineNumbers, titlePage, verticalAlign, column, type, revision, noEndnote, bidi, rtlGutter, paperSrc, footnotePr, endnotePr } = {}) {
|
|
15459
15459
|
super("w:sectPr");
|
|
15460
15460
|
this.addHeaderFooterGroup(HeaderFooterType.HEADER, headerWrapperGroup);
|
|
15461
15461
|
this.addHeaderFooterGroup(HeaderFooterType.FOOTER, footerWrapperGroup);
|
package/dist/index.umd.js
CHANGED
|
@@ -15402,23 +15402,23 @@
|
|
|
15402
15402
|
* Default margin values for sections (in twips).
|
|
15403
15403
|
*
|
|
15404
15404
|
* Standard margins are 1 inch (1440 twips) on all sides.
|
|
15405
|
-
* Header/footer margins are
|
|
15405
|
+
* Header/footer margins are from page edge.
|
|
15406
15406
|
*
|
|
15407
15407
|
* @property TOP - Top margin: 1440 twips (1 inch)
|
|
15408
|
-
* @property RIGHT - Right margin:
|
|
15408
|
+
* @property RIGHT - Right margin: 1800 twips (1.25 inches)
|
|
15409
15409
|
* @property BOTTOM - Bottom margin: 1440 twips (1 inch)
|
|
15410
|
-
* @property LEFT - Left margin:
|
|
15411
|
-
* @property HEADER - Header margin:
|
|
15412
|
-
* @property FOOTER - Footer margin:
|
|
15410
|
+
* @property LEFT - Left margin: 1800 twips (1.25 inches)
|
|
15411
|
+
* @property HEADER - Header margin: 851 twips (0.59 inches)
|
|
15412
|
+
* @property FOOTER - Footer margin: 992 twips (0.69 inches)
|
|
15413
15413
|
* @property GUTTER - Gutter margin: 0 twips
|
|
15414
15414
|
*/
|
|
15415
15415
|
const sectionMarginDefaults = {
|
|
15416
15416
|
TOP: 1440,
|
|
15417
|
-
RIGHT:
|
|
15417
|
+
RIGHT: 1800,
|
|
15418
15418
|
BOTTOM: 1440,
|
|
15419
|
-
LEFT:
|
|
15420
|
-
HEADER:
|
|
15421
|
-
FOOTER:
|
|
15419
|
+
LEFT: 1800,
|
|
15420
|
+
HEADER: 851,
|
|
15421
|
+
FOOTER: 992,
|
|
15422
15422
|
GUTTER: 0
|
|
15423
15423
|
};
|
|
15424
15424
|
/**
|
|
@@ -15485,7 +15485,7 @@
|
|
|
15485
15485
|
* ```
|
|
15486
15486
|
*/
|
|
15487
15487
|
var SectionProperties = class extends XmlComponent {
|
|
15488
|
-
constructor({ page: { size: { width = sectionPageSizeDefaults.WIDTH, height = sectionPageSizeDefaults.HEIGHT, orientation = sectionPageSizeDefaults.ORIENTATION } = {}, margin: { top = sectionMarginDefaults.TOP, right = sectionMarginDefaults.RIGHT, bottom = sectionMarginDefaults.BOTTOM, left = sectionMarginDefaults.LEFT, header = sectionMarginDefaults.HEADER, footer = sectionMarginDefaults.FOOTER, gutter = sectionMarginDefaults.GUTTER } = {}, pageNumbers = {}, borders, textDirection } = {}, grid: { linePitch =
|
|
15488
|
+
constructor({ page: { size: { width = sectionPageSizeDefaults.WIDTH, height = sectionPageSizeDefaults.HEIGHT, orientation = sectionPageSizeDefaults.ORIENTATION } = {}, margin: { top = sectionMarginDefaults.TOP, right = sectionMarginDefaults.RIGHT, bottom = sectionMarginDefaults.BOTTOM, left = sectionMarginDefaults.LEFT, header = sectionMarginDefaults.HEADER, footer = sectionMarginDefaults.FOOTER, gutter = sectionMarginDefaults.GUTTER } = {}, pageNumbers = {}, borders, textDirection } = {}, grid: { linePitch = 312, charSpace = 0, type: gridType = "lines" } = {}, headerWrapperGroup = {}, footerWrapperGroup = {}, lineNumbers, titlePage, verticalAlign, column, type, revision, noEndnote, bidi, rtlGutter, paperSrc, footnotePr, endnotePr } = {}) {
|
|
15489
15489
|
super("w:sectPr");
|
|
15490
15490
|
this.addHeaderFooterGroup(HeaderFooterType.HEADER, headerWrapperGroup);
|
|
15491
15491
|
this.addHeaderFooterGroup(HeaderFooterType.FOOTER, footerWrapperGroup);
|