wordinweb 0.1.10 → 0.1.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 +6 -2
- package/dist/index.d.ts +27 -8
- package/dist/index.js +799 -193
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -119,7 +119,7 @@ The object passed to `onReady`. Every command operates on the current selection
|
|
|
119
119
|
- `insertBlankPage()` — inserts a complete blank page at the caret.
|
|
120
120
|
- `insertCoverPage({ title, subtitle?, author? })` — prepends an editable, styled cover page.
|
|
121
121
|
- `setLineNumbering(patch, scope?)`, `getLineNumbering()`.
|
|
122
|
-
- `openHeaderFooter("header" | "footer")`, `closeHeaderFooter()` — create or directly enter page header/footer
|
|
122
|
+
- `openHeaderFooter("header" | "footer")`, `closeHeaderFooter()` — create or directly enter the repeating page layer; shapes and lines inserted there repeat on the pages using that header/footer. Escape closes it.
|
|
123
123
|
|
|
124
124
|
**Tables**
|
|
125
125
|
- `insertTable(rows, cols)`.
|
|
@@ -139,7 +139,7 @@ The object passed to `onReady`. Every command operates on the current selection
|
|
|
139
139
|
- `insertField(instruction, cachedResult?)`, `insertDateTime("date" | "time", picture?)` — live Word fields.
|
|
140
140
|
- `addBookmark(name)`, `listBookmarks()`, `insertCrossReference(name, "text" | "page")` — named bookmark targets and live `REF` / `PAGEREF` fields.
|
|
141
141
|
- `insertEquation(linear)`, `insertSymbol(symbol)` — native editable OMML equations and arbitrary Unicode symbols.
|
|
142
|
-
- `insertShape(preset, text?)` — floating editable DrawingML rectangles, rounded rectangles, ellipses, diamonds, and text boxes.
|
|
142
|
+
- `insertShape(preset, text?)` — floating editable DrawingML lines, rectangles, rounded rectangles, ellipses, diamonds, and text boxes. Selected objects expose exact page position, size, outline, wrapping, and layer controls.
|
|
143
143
|
- `insertWordArt(text, preset?)` — editable DrawingML WordArt with plain, arch, wave, and chevron presets.
|
|
144
144
|
- `insertChart(data)`, `updateSelectedChart(data)` — native editable ChartML with its embedded workbook.
|
|
145
145
|
- `insertSmartArt(data)`, `updateSelectedSmartArt(data)` — native editable SmartArt data, layout, style, colors, and cached drawing parts.
|
|
@@ -167,6 +167,10 @@ The object passed to `onReady`. Every command operates on the current selection
|
|
|
167
167
|
|
|
168
168
|
A ready-made formatting toolbar for an editable `DocxView`. Use `mode="simple"` for the basic Home editing strip or `mode="advanced"` for the full Home / Insert / Draw / Layout ribbon supported by the installed version.
|
|
169
169
|
Layout includes Word-style paper presets plus a custom width/height dialog; both document and current-section scope emit native page-size properties.
|
|
170
|
+
Editable text also has a right-click menu for clipboard, formatting, links,
|
|
171
|
+
comments, lists, and alignment. Word-style shortcuts include heading levels,
|
|
172
|
+
page breaks, links, comments, lists, and paragraph alignment in addition to the
|
|
173
|
+
standard formatting and history commands.
|
|
170
174
|
|
|
171
175
|
| Prop | Type | What it does |
|
|
172
176
|
| --- | --- | --- |
|
package/dist/index.d.ts
CHANGED
|
@@ -109,6 +109,11 @@ interface RunProps {
|
|
|
109
109
|
smallCaps?: boolean;
|
|
110
110
|
/** Letter spacing px (w:spacing, twips in OOXML). */
|
|
111
111
|
letterSpacing?: number;
|
|
112
|
+
/** Minimum font size in px at which w:kern enables pair kerning; null is
|
|
113
|
+
* the explicit w:kern=0 override. */
|
|
114
|
+
kerningThreshold?: number | null;
|
|
115
|
+
/** Paint-only letter spacing when layout advances intentionally differ. */
|
|
116
|
+
paintLetterSpacing?: number;
|
|
112
117
|
/** w:w horizontal character scaling as a fraction (1.5 = 150%). */
|
|
113
118
|
textScale?: number;
|
|
114
119
|
/** w:fitText target width in px: the run's advances scale so its text
|
|
@@ -376,6 +381,9 @@ interface MathContent {
|
|
|
376
381
|
* display-style layout - larger n-ary operators with limits stacked
|
|
377
382
|
* above/below, and full-size fraction numerators/denominators. */
|
|
378
383
|
display?: boolean;
|
|
384
|
+
/** Display group with several direct equations. Word leaves a small
|
|
385
|
+
* advance after script clusters in these grouped displays. */
|
|
386
|
+
multiEquationDisplay?: boolean;
|
|
379
387
|
/** m:oMathParaPr/m:jc - display-equation justification. Absent: the
|
|
380
388
|
* document default (settings m:mathPr/m:defJc, itself "centerGroup" when
|
|
381
389
|
* unset). */
|
|
@@ -521,13 +529,11 @@ interface ShapeWordArt {
|
|
|
521
529
|
/** Clockwise degrees. */
|
|
522
530
|
rotation: number;
|
|
523
531
|
behind?: boolean;
|
|
524
|
-
/** The v:textpath font-size (px).
|
|
525
|
-
* shape (see noFit). */
|
|
532
|
+
/** The source v:textpath font-size (px). */
|
|
526
533
|
fontSize?: number;
|
|
527
534
|
/** The referenced v:shapetype has a malformed text-guide path (missing
|
|
528
|
-
* coordinates), so Word
|
|
529
|
-
*
|
|
530
|
-
* than a box-filling watermark. Render at fontSize, unstretched, to match. */
|
|
535
|
+
* coordinates), so Word collapses its horizontal glyph outlines into a thin
|
|
536
|
+
* vertical band instead of painting a box-filling watermark. */
|
|
531
537
|
noFit?: boolean;
|
|
532
538
|
/** Source VML shape element (v:shape / v:rect) for interactive editing:
|
|
533
539
|
* the v:textpath string, fill/opacity, and rotation live under it. */
|
|
@@ -724,6 +730,8 @@ interface DrawingTextShape {
|
|
|
724
730
|
};
|
|
725
731
|
/** Vertical anchoring of the text inside the box (bodyPr anchor). */
|
|
726
732
|
textAnchor?: "top" | "middle" | "bottom";
|
|
733
|
+
/** DrawingML cached text paint-only baseline adjustment in px. */
|
|
734
|
+
paintOffsetY?: number;
|
|
727
735
|
}
|
|
728
736
|
interface DrawingPath {
|
|
729
737
|
/** Position/size inside the drawing, px. */
|
|
@@ -803,6 +811,8 @@ interface Paragraph {
|
|
|
803
811
|
interface TableCellProps {
|
|
804
812
|
/** Preferred width px (from tcW when dxa). */
|
|
805
813
|
width?: number;
|
|
814
|
+
/** The source explicitly declares tcW type="auto" (distinct from no tcW). */
|
|
815
|
+
widthAuto?: boolean;
|
|
806
816
|
gridSpan: number;
|
|
807
817
|
vMerge?: "restart" | "continue";
|
|
808
818
|
borders?: {
|
|
@@ -1140,6 +1150,9 @@ declare class DocxDocument {
|
|
|
1140
1150
|
/** Note content by note id (render-only; sources stripped). */
|
|
1141
1151
|
readonly footnotes: Map<number, Block[]>;
|
|
1142
1152
|
readonly endnotes: Map<number, Block[]>;
|
|
1153
|
+
/** The separator paragraph controls the gap between its rule and the first
|
|
1154
|
+
* footnote. */
|
|
1155
|
+
readonly footnoteSeparator: Block[];
|
|
1143
1156
|
/** `_Ref` cross-reference bookmark ranges (name → captured runs). REF
|
|
1144
1157
|
* fields re-render the referenced text from these — Word recomputes REF on
|
|
1145
1158
|
* open, so the cached field result in the file is stale. */
|
|
@@ -1228,6 +1241,10 @@ declare class DocxDocument {
|
|
|
1228
1241
|
* single-threaded and sequential per section. */
|
|
1229
1242
|
charGridEa: boolean;
|
|
1230
1243
|
private constructor();
|
|
1244
|
+
/** Resolve content controls mapped to standard package core properties.
|
|
1245
|
+
* Word refreshes these bindings on open, so the serialized sdtContent can
|
|
1246
|
+
* be stale even though the visible value comes from docProps/core.xml. */
|
|
1247
|
+
private hydrateCorePropertyControls;
|
|
1231
1248
|
/** Repair only objects emitted by older WordInWeb builds that Word rejects. */
|
|
1232
1249
|
private repairLegacyWordInWebObjects;
|
|
1233
1250
|
/**
|
|
@@ -1422,6 +1439,8 @@ interface FontSpec {
|
|
|
1422
1439
|
size: number;
|
|
1423
1440
|
bold: boolean;
|
|
1424
1441
|
italic: boolean;
|
|
1442
|
+
/** Pair kerning is active because the run met its w:kern size threshold. */
|
|
1443
|
+
kerning?: boolean;
|
|
1425
1444
|
/** Optional PAINT-only family tried before `family` in the CSS stack, without
|
|
1426
1445
|
* affecting metrics or width lookups (keyed by `family`). Used for CJK: the
|
|
1427
1446
|
* line-pitch profile stays keyed by the macOS substitute face while the real
|
|
@@ -1686,10 +1705,10 @@ interface WordArtItem {
|
|
|
1686
1705
|
/** Clockwise degrees. */
|
|
1687
1706
|
rotation: number;
|
|
1688
1707
|
behind?: boolean;
|
|
1689
|
-
/** v:textpath font-size (px)
|
|
1708
|
+
/** Source v:textpath font-size (px). */
|
|
1690
1709
|
fontSize?: number;
|
|
1691
|
-
/** Malformed shapetype guide path:
|
|
1692
|
-
*
|
|
1710
|
+
/** Malformed shapetype guide path: Word collapses the fitted glyph outlines
|
|
1711
|
+
* into a thin vertical band. */
|
|
1693
1712
|
noFit?: boolean;
|
|
1694
1713
|
/** Source VML shape element (v:shape / v:rect), for interactive select/edit. */
|
|
1695
1714
|
src?: XmlElement;
|