wordinweb 0.1.10 → 0.1.12

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
@@ -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 editing; Escape closes it.
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)`.
@@ -128,7 +128,7 @@ The object passed to `onReady`. Every command operates on the current selection
128
128
  **Images**
129
129
  - `insertImage(file)` — inserts a raster image or editable SVG icon inline at the caret, clamped to the column width (TIFF/WMF/EMF are decoded to something the browser can paint).
130
130
  - `insertScreenshot()` — opens the browser screen/window/tab picker and inserts the captured frame as an editable PNG picture.
131
- - `insertModel3D(file, poster?)` — packages a GLB as a native Office 3D model with an editable poster fallback.
131
+ - `insertModel3D(file, poster?)` — packages a GLB as a native Office 3D model; editable documents show a drag-to-rotate viewport and save the orientation back to Word.
132
132
  - `insertOnlineVideo(url)` — inserts Word online-video metadata with a safe browser poster; double-click opens the validated HTTP(S) URL.
133
133
  - `insertEmbeddedObject(file, filename?)` — embeds any file as a native OLE Package; double-click safely downloads the original file in the browser.
134
134
 
@@ -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. Advanced mode also exposes Text Box as its own Insert control.
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
@@ -284,6 +289,12 @@ interface ImageContent {
284
289
  interface Model3DReference {
285
290
  part: string;
286
291
  posterPart: string;
292
+ /** Native Office model orientation, in degrees around the X/Y/Z axes. */
293
+ rotation?: {
294
+ x: number;
295
+ y: number;
296
+ z: number;
297
+ };
287
298
  }
288
299
  interface WebVideoReference {
289
300
  url: string;
@@ -376,6 +387,9 @@ interface MathContent {
376
387
  * display-style layout - larger n-ary operators with limits stacked
377
388
  * above/below, and full-size fraction numerators/denominators. */
378
389
  display?: boolean;
390
+ /** Display group with several direct equations. Word leaves a small
391
+ * advance after script clusters in these grouped displays. */
392
+ multiEquationDisplay?: boolean;
379
393
  /** m:oMathParaPr/m:jc - display-equation justification. Absent: the
380
394
  * document default (settings m:mathPr/m:defJc, itself "centerGroup" when
381
395
  * unset). */
@@ -521,13 +535,11 @@ interface ShapeWordArt {
521
535
  /** Clockwise degrees. */
522
536
  rotation: number;
523
537
  behind?: boolean;
524
- /** The v:textpath font-size (px). Only used when the text is NOT fit to the
525
- * shape (see noFit). */
538
+ /** The source v:textpath font-size (px). */
526
539
  fontSize?: number;
527
540
  /** The referenced v:shapetype has a malformed text-guide path (missing
528
- * coordinates), so Word cannot compute the fitshape scale and falls back to
529
- * drawing the string at its nominal font-size — a near-invisible mark rather
530
- * than a box-filling watermark. Render at fontSize, unstretched, to match. */
541
+ * coordinates), so Word collapses its horizontal glyph outlines into a thin
542
+ * vertical band instead of painting a box-filling watermark. */
531
543
  noFit?: boolean;
532
544
  /** Source VML shape element (v:shape / v:rect) for interactive editing:
533
545
  * the v:textpath string, fill/opacity, and rotation live under it. */
@@ -724,6 +736,8 @@ interface DrawingTextShape {
724
736
  };
725
737
  /** Vertical anchoring of the text inside the box (bodyPr anchor). */
726
738
  textAnchor?: "top" | "middle" | "bottom";
739
+ /** DrawingML cached text paint-only baseline adjustment in px. */
740
+ paintOffsetY?: number;
727
741
  }
728
742
  interface DrawingPath {
729
743
  /** Position/size inside the drawing, px. */
@@ -803,6 +817,8 @@ interface Paragraph {
803
817
  interface TableCellProps {
804
818
  /** Preferred width px (from tcW when dxa). */
805
819
  width?: number;
820
+ /** The source explicitly declares tcW type="auto" (distinct from no tcW). */
821
+ widthAuto?: boolean;
806
822
  gridSpan: number;
807
823
  vMerge?: "restart" | "continue";
808
824
  borders?: {
@@ -1140,6 +1156,9 @@ declare class DocxDocument {
1140
1156
  /** Note content by note id (render-only; sources stripped). */
1141
1157
  readonly footnotes: Map<number, Block[]>;
1142
1158
  readonly endnotes: Map<number, Block[]>;
1159
+ /** The separator paragraph controls the gap between its rule and the first
1160
+ * footnote. */
1161
+ readonly footnoteSeparator: Block[];
1143
1162
  /** `_Ref` cross-reference bookmark ranges (name → captured runs). REF
1144
1163
  * fields re-render the referenced text from these — Word recomputes REF on
1145
1164
  * open, so the cached field result in the file is stale. */
@@ -1228,6 +1247,10 @@ declare class DocxDocument {
1228
1247
  * single-threaded and sequential per section. */
1229
1248
  charGridEa: boolean;
1230
1249
  private constructor();
1250
+ /** Resolve content controls mapped to standard package core properties.
1251
+ * Word refreshes these bindings on open, so the serialized sdtContent can
1252
+ * be stale even though the visible value comes from docProps/core.xml. */
1253
+ private hydrateCorePropertyControls;
1231
1254
  /** Repair only objects emitted by older WordInWeb builds that Word rejects. */
1232
1255
  private repairLegacyWordInWebObjects;
1233
1256
  /**
@@ -1422,6 +1445,8 @@ interface FontSpec {
1422
1445
  size: number;
1423
1446
  bold: boolean;
1424
1447
  italic: boolean;
1448
+ /** Pair kerning is active because the run met its w:kern size threshold. */
1449
+ kerning?: boolean;
1425
1450
  /** Optional PAINT-only family tried before `family` in the CSS stack, without
1426
1451
  * affecting metrics or width lookups (keyed by `family`). Used for CJK: the
1427
1452
  * line-pitch profile stays keyed by the macOS substitute face while the real
@@ -1686,10 +1711,10 @@ interface WordArtItem {
1686
1711
  /** Clockwise degrees. */
1687
1712
  rotation: number;
1688
1713
  behind?: boolean;
1689
- /** v:textpath font-size (px), used only when noFit is set. */
1714
+ /** Source v:textpath font-size (px). */
1690
1715
  fontSize?: number;
1691
- /** Malformed shapetype guide path: render at nominal fontSize, unstretched
1692
- * (Word can't fitshape, so it draws a near-invisible mark). */
1716
+ /** Malformed shapetype guide path: Word collapses the fitted glyph outlines
1717
+ * into a thin vertical band. */
1693
1718
  noFit?: boolean;
1694
1719
  /** Source VML shape element (v:shape / v:rect), for interactive select/edit. */
1695
1720
  src?: XmlElement;