@office-open/docx 0.10.11 → 0.10.13

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.
Files changed (36) hide show
  1. package/dist/chart.d.mts +1 -0
  2. package/dist/chart.mjs +2 -0
  3. package/dist/{parts-D0KoDfg7.mjs → comments-BKbOd_pv.mjs} +132 -5489
  4. package/dist/comments-BKbOd_pv.mjs.map +1 -0
  5. package/dist/context-B4Ffx12w.mjs +4467 -0
  6. package/dist/context-B4Ffx12w.mjs.map +1 -0
  7. package/dist/{core-properties-CIG9ZnsW.d.mts → core-properties-DIyQ18ti.d.mts} +59 -59
  8. package/dist/core-properties-DIyQ18ti.d.mts.map +1 -0
  9. package/dist/document-attributes-C6PDT-ap.mjs +60 -0
  10. package/dist/document-attributes-C6PDT-ap.mjs.map +1 -0
  11. package/dist/drawingml.d.mts +1 -0
  12. package/dist/drawingml.mjs +2 -0
  13. package/dist/{generate-CG1wp4pb.mjs → generate-B-rbYRj-.mjs} +15 -14
  14. package/dist/generate-B-rbYRj-.mjs.map +1 -0
  15. package/dist/generate.d.mts +1 -1
  16. package/dist/generate.mjs +1 -1
  17. package/dist/index.d.mts +2 -2
  18. package/dist/index.mjs +1156 -4
  19. package/dist/index.mjs.map +1 -1
  20. package/dist/{parse-IeJ0NXYz.mjs → parse-D8NipXPu.mjs} +187 -9
  21. package/dist/parse-D8NipXPu.mjs.map +1 -0
  22. package/dist/parse.d.mts +1 -1
  23. package/dist/parse.mjs +1 -1
  24. package/dist/patch/index.d.mts +1 -1
  25. package/dist/patch/index.d.mts.map +1 -1
  26. package/dist/patch/index.mjs +17 -11
  27. package/dist/patch/index.mjs.map +1 -1
  28. package/dist/smartart.d.mts +1 -0
  29. package/dist/smartart.mjs +2 -0
  30. package/package.json +16 -4
  31. package/dist/context-nyQP2Fkk.mjs +0 -479
  32. package/dist/context-nyQP2Fkk.mjs.map +0 -1
  33. package/dist/core-properties-CIG9ZnsW.d.mts.map +0 -1
  34. package/dist/generate-CG1wp4pb.mjs.map +0 -1
  35. package/dist/parse-IeJ0NXYz.mjs.map +0 -1
  36. package/dist/parts-D0KoDfg7.mjs.map +0 -1
package/dist/index.mjs CHANGED
@@ -1,8 +1,11 @@
1
- import { $ as PageBorderZOrder, $t as stringifyCustomXmlShell, A as StyleLevel, An as TextHorzOverflowType, At as sectionPageSizeDefaults, B as stringifyNumberingStyle, Bn as TextEffect, Bt as NumberFormat, C as footnotesDesc, Cn as RubyAlign, Ct as parseSdtBlock, D as selectTocEntryElements, Dn as EmphasisMarkType, Dt as sectionPropertiesDesc, E as parseTocFieldInstruction, En as PositionalTabRelativeTo, Et as parseSectionPropertiesEl, F as extractStyleId, Fn as parseBodyProperties, Ft as createVerticalPosition, G as createHeaderFooterReference, Gn as TextboxTightWrapType, Gt as TextWrappingSide, H as stringifyTableStyle, Hn as PageNumber, Ht as VerticalPositionAlign, I as parseStyleDefinitions, In as createImageData, It as createHorizontalPosition, J as LineNumberRestartFormat, Jn as AlignmentType, Jt as checkboxSymbolRunInner, K as SectionType, Kn as HeadingLevel, Kt as TextWrappingType, L as DefaultStylesFactory, Ln as Media, Lt as HorizontalPositionRelativeFrom, M as Styles, Mn as TextVerticalType, Mt as PageOrientation, N as buildNumberingCache, Nn as VerticalAnchor, Nt as PageNumberSeparator, O as SdtDateMappingType, On as UnderlineType, Ot as stringifySectionPropertiesXml, P as buildStyleCache, Pn as createBodyProperties, Pt as createPageNumberType, Q as PageBorderOffsetFrom, Qt as setBodyParseChild, R as stringifyCharacterStyle, Rn as createTransformation, Rt as VerticalPositionRelativeFrom, S as endnotesDesc, Sn as parseFormFieldData, St as stringifyTableOfContents, T as parseTocFieldFromElements, Tn as PositionalTabLeader, U as HeaderFooterReferenceType, Un as breakXml, Ut as createWrapThrough, V as stringifyParagraphStyle, Vn as EMPTY_RUN_ELEMENTS, Vt as SpaceType, W as HeaderFooterType, Wn as TextAlignmentType, Wt as createWrapTight, X as createPageMargin, Xt as parseCustomXmlProperties, Y as createLineNumberType, Yt as customXmlBlockDesc, Z as PageBorderDisplay, Zt as sdtBlockDesc, _ as glossaryDesc, _n as TextDirection, a as appPropertiesDesc, an as parseShading, at as LevelFormat, b as CharacterSet, bn as FormFieldTextType, c as relationshipsDesc, cn as widthFiftiethsToPct, ct as parseTablePropertiesEl, d as withAltChunkOverrides, dn as BorderStyle, dt as tableDesc, en as stringifySdtPr, et as DocumentGridType, f as withMediaDefaults, fn as TableLayoutType, ft as stringifyChildDispatch, g as DocPartType, gn as TableAnchorType, gt as resetDrawingIdGen, h as DocPartGallery, hn as RelativeVerticalPosition, ht as drawingDesc, i as webSettingsDesc, in as ShadingType, it as parseNumberingDefinitions, j as settingsDesc, jn as TextVertOverflowType, jt as PageTextDirectionType, k as SdtLock, kn as TextBodyWrappingType, kt as sectionMarginDefaults, l as buildContentTypesFromRegistry, ln as widthPctToFiftieths, lt as parseTableRowPropertiesEl, m as DocPartBehavior, mn as RelativeHorizontalPosition, mt as stringifyRunInline, n as frameXml, nn as subDocDesc, nt as DocumentAttributeNamespaces, o as customPropertiesDesc, on as objectDesc, ot as LevelSuffix, p as commentsDesc, pn as OverlapType, pt as stringifyParagraphInline, q as createSectionType, qn as LineRuleType, qt as altChunkDesc, r as framesetXml, rt as Numbering, s as corePropertiesDesc, sn as WidthType, st as parseTableCellPropertiesEl, t as TargetScreenSize, tn as stringifySdtShell, tt as createDocumentGrid, u as contentTypesDesc, un as TABLE_BORDERS_NONE, ut as setTableParseChild, v as bibliographyDesc, vn as VerticalMergeType, w as parseToc, wn as PositionalTabAlignment, wt as parseSdtProperties, x as EditGroupType, xn as createFormFieldData, y as fontTableDesc, yn as ProofErrorType, z as stringifyConditionalTableStyle, zn as HighlightColor, zt as HorizontalPositionAlign } from "./parts-D0KoDfg7.mjs";
2
- import { i as AltChunkCollection, n as DocxWriteContext, r as SubDocCollection, t as DocxReadContext } from "./context-nyQP2Fkk.mjs";
1
+ import { A as DefaultStylesFactory, B as AlignmentType, C as footnotesDesc, D as buildStyleCache, E as buildNumberingCache, F as stringifyTableStyle, I as Numbering, L as parseNumberingDefinitions, M as stringifyConditionalTableStyle, N as stringifyNumberingStyle, O as extractStyleId, P as stringifyParagraphStyle, R as LevelFormat, S as endnotesDesc, T as Styles, _ as glossaryDesc, a as framesetXml, b as SubDocCollection, c as customPropertiesDesc, d as contentTypesDesc, f as withAltChunkOverrides, g as DocPartType, h as DocPartGallery, i as frameXml, j as stringifyCharacterStyle, k as parseStyleDefinitions, l as corePropertiesDesc, m as DocPartBehavior, n as DocxWriteContext, o as webSettingsDesc, p as withMediaDefaults, r as TargetScreenSize, s as appPropertiesDesc, t as DocxReadContext, u as buildContentTypesFromRegistry, v as bibliographyDesc, w as settingsDesc, x as AltChunkCollection, y as fontTableDesc, z as LevelSuffix } from "./context-B4Ffx12w.mjs";
2
+ import { A as PageOrientation, B as TextWrappingType, Ct as EMPTY_RUN_ELEMENTS, D as sectionMarginDefaults, Dt as LineRuleType, E as stringifySectionPropertiesXml, Et as HeadingLevel, F as HorizontalPositionAlign, G as sdtBlockDesc, H as checkboxSymbolRunInner, I as NumberFormat, J as stringifySdtPr, K as setBodyParseChild, L as SpaceType, M as createPageNumberType, N as HorizontalPositionRelativeFrom, O as sectionPageSizeDefaults, P as VerticalPositionRelativeFrom, R as VerticalPositionAlign, S as parseSdtProperties, St as createTransformation, T as sectionPropertiesDesc, Tt as breakXml, U as customXmlBlockDesc, V as altChunkDesc, W as parseCustomXmlProperties, X as subDocDesc, Y as stringifySdtShell, _t as VerticalAnchor, a as setTableParseChild, at as widthFiftiethsToPct, b as stringifyTableOfContents, bt as createImageData, ct as TextDirection, d as stringifyParagraphInline, dt as createFormFieldData, f as stringifyRunInline, ft as parseFormFieldData, gt as TextVerticalType, ht as TextVertOverflowType, i as parseTableRowPropertiesEl, it as WidthType, j as PageNumberSeparator, k as PageTextDirectionType, lt as VerticalMergeType, m as resetDrawingIdGen, mt as TextHorzOverflowType, n as parseTableCellPropertiesEl, nt as parseShading, o as tableDesc, ot as widthPctToFiftieths, p as drawingDesc, pt as TextBodyWrappingType, q as stringifyCustomXmlShell, r as parseTablePropertiesEl, rt as objectDesc, st as BorderStyle, t as commentsDesc, tt as ShadingType, u as stringifyChildDispatch, ut as FormFieldTextType, vt as createBodyProperties, w as parseSectionPropertiesEl, wt as PageNumber, x as parseSdtBlock, xt as Media, yt as parseBodyProperties, z as TextWrappingSide } from "./comments-BKbOd_pv.mjs";
3
+ import { t as DocumentAttributeNamespaces } from "./document-attributes-C6PDT-ap.mjs";
4
+ import { a as parseTocFieldFromElements, i as parseToc, n as parseDocument, o as parseTocFieldInstruction, r as parseDocx, s as selectTocEntryElements, t as parseArchive } from "./parse-D8NipXPu.mjs";
3
5
  import { patchDetector, patchDocument } from "./patch/index.mjs";
4
- import { n as parseDocument, r as parseDocx, t as parseArchive } from "./parse-IeJ0NXYz.mjs";
5
- import { i as compileDocument, n as generateDocumentStream, r as generateDocumentSync, t as generateDocument } from "./generate-CG1wp4pb.mjs";
6
+ import { i as compileDocument, n as generateDocumentStream, r as generateDocumentSync, t as generateDocument } from "./generate-B-rbYRj-.mjs";
7
+ import { convertToEmu, decimalNumber, signedTwipsMeasureValue, twipsMeasureValue } from "@office-open/core";
8
+ import { element, escapeXml } from "@office-open/xml";
6
9
  //#region src/parts/paragraph/formatting/break.ts
7
10
  /**
8
11
  * Break type values for WordprocessingML documents.
@@ -78,6 +81,324 @@ const TabStopPosition = {
78
81
  /** Maximum tab stop position (right margin) */
79
82
  MAX: 9026 };
80
83
  //#endregion
84
+ //#region src/parts/paragraph/properties.ts
85
+ /**
86
+ * Vertical text alignment types for paragraphs.
87
+ *
88
+ * Specifies the vertical alignment of text within the paragraph.
89
+ *
90
+ * @publicApi
91
+ */
92
+ const TextAlignmentType = {
93
+ /** Align text to the top */
94
+ TOP: "top",
95
+ /** Align text to the center */
96
+ CENTER: "center",
97
+ /** Align text to the baseline */
98
+ BASELINE: "baseline",
99
+ /** Align text to the bottom */
100
+ BOTTOM: "bottom",
101
+ /** Automatically determine vertical alignment */
102
+ AUTO: "auto"
103
+ };
104
+ /**
105
+ * Textbox tight wrap types for paragraphs.
106
+ *
107
+ * Specifies how tightly text wraps around a textbox.
108
+ *
109
+ * @publicApi
110
+ */
111
+ const TextboxTightWrapType = {
112
+ /** No tight wrapping */
113
+ NONE: "none",
114
+ /** Tight wrap on all lines */
115
+ ALL_LINES: "allLines",
116
+ /** Tight wrap on first and last lines */
117
+ FIRST_AND_LAST_LINE: "firstAndLastLine",
118
+ /** Tight wrap on first line only */
119
+ FIRST_LINE_ONLY: "firstLineOnly",
120
+ /** Tight wrap on last line only */
121
+ LAST_LINE_ONLY: "lastLineOnly"
122
+ };
123
+ //#endregion
124
+ //#region src/parts/paragraph/run/properties.ts
125
+ /**
126
+ * Text animation effect types.
127
+ *
128
+ * Reference: http://officeopenxml.com/WPtextFormatting.php
129
+ *
130
+ * @publicApi
131
+ */
132
+ const TextEffect = {
133
+ /** Blinking background animation */
134
+ BLINK_BACKGROUND: "blinkBackground",
135
+ /** Lights animation effect */
136
+ LIGHTS: "lights",
137
+ /** Black marching ants animation */
138
+ ANTS_BLACK: "antsBlack",
139
+ /** Red marching ants animation */
140
+ ANTS_RED: "antsRed",
141
+ /** Shimmer animation effect */
142
+ SHIMMER: "shimmer",
143
+ /** Sparkle animation effect */
144
+ SPARKLE: "sparkle",
145
+ /** No text effect */
146
+ NONE: "none"
147
+ };
148
+ /**
149
+ * Highlight color values for text highlighting.
150
+ *
151
+ * Reference: http://officeopenxml.com/WPtextShading.php
152
+ */
153
+ const HighlightColor = {
154
+ /** Black highlight */
155
+ BLACK: "black",
156
+ /** Blue highlight */
157
+ BLUE: "blue",
158
+ /** Cyan highlight */
159
+ CYAN: "cyan",
160
+ /** Dark blue highlight */
161
+ DARK_BLUE: "darkBlue",
162
+ /** Dark cyan highlight */
163
+ DARK_CYAN: "darkCyan",
164
+ /** Dark gray highlight */
165
+ DARK_GRAY: "darkGray",
166
+ /** Dark green highlight */
167
+ DARK_GREEN: "darkGreen",
168
+ /** Dark magenta highlight */
169
+ DARK_MAGENTA: "darkMagenta",
170
+ /** Dark red highlight */
171
+ DARK_RED: "darkRed",
172
+ /** Dark yellow highlight */
173
+ DARK_YELLOW: "darkYellow",
174
+ /** Green highlight */
175
+ GREEN: "green",
176
+ /** Light gray highlight */
177
+ LIGHT_GRAY: "lightGray",
178
+ /** Magenta highlight */
179
+ MAGENTA: "magenta",
180
+ /** No highlight */
181
+ NONE: "none",
182
+ /** Red highlight */
183
+ RED: "red",
184
+ /** White highlight */
185
+ WHITE: "white",
186
+ /** Yellow highlight */
187
+ YELLOW: "yellow"
188
+ };
189
+ //#endregion
190
+ //#region src/parts/paragraph/run/underline.ts
191
+ /**
192
+ * Underline module for WordprocessingML documents.
193
+ *
194
+ * This module provides support for underlining text with various styles and colors.
195
+ *
196
+ * Reference: http://officeopenxml.com/WPrun.php
197
+ *
198
+ * @module
199
+ */
200
+ /**
201
+ * Underline style types for text.
202
+ *
203
+ * Defines the various underline patterns that can be applied to text runs.
204
+ *
205
+ * Reference: http://officeopenxml.com/WPrun.php
206
+ *
207
+ * ## XSD Schema
208
+ * ```xml
209
+ * <xsd:simpleType name="ST_Underline">
210
+ * <xsd:restriction base="xsd:string">
211
+ * <xsd:enumeration value="single"/>
212
+ * <xsd:enumeration value="words"/>
213
+ * <xsd:enumeration value="double"/>
214
+ * <xsd:enumeration value="thick"/>
215
+ * <xsd:enumeration value="dotted"/>
216
+ * <xsd:enumeration value="dottedHeavy"/>
217
+ * <xsd:enumeration value="dash"/>
218
+ * <xsd:enumeration value="dashedHeavy"/>
219
+ * <xsd:enumeration value="dashLong"/>
220
+ * <xsd:enumeration value="dashLongHeavy"/>
221
+ * <xsd:enumeration value="dotDash"/>
222
+ * <xsd:enumeration value="dashDotHeavy"/>
223
+ * <xsd:enumeration value="dotDotDash"/>
224
+ * <xsd:enumeration value="dashDotDotHeavy"/>
225
+ * <xsd:enumeration value="wave"/>
226
+ * <xsd:enumeration value="wavyHeavy"/>
227
+ * <xsd:enumeration value="wavyDouble"/>
228
+ * <xsd:enumeration value="none"/>
229
+ * </xsd:restriction>
230
+ * </xsd:simpleType>
231
+ * ```
232
+ *
233
+ * @publicApi
234
+ */
235
+ const UnderlineType = {
236
+ /** Single underline */
237
+ SINGLE: "single",
238
+ /** Underline words only (not spaces) */
239
+ WORDS: "words",
240
+ /** Double underline */
241
+ DOUBLE: "double",
242
+ /** Thick single underline */
243
+ THICK: "thick",
244
+ /** Dotted underline */
245
+ DOTTED: "dotted",
246
+ /** Heavy dotted underline */
247
+ DOTTEDHEAVY: "dottedHeavy",
248
+ /** Dashed underline */
249
+ DASH: "dash",
250
+ /** Heavy dashed underline */
251
+ DASHEDHEAVY: "dashedHeavy",
252
+ /** Long dashed underline */
253
+ DASHLONG: "dashLong",
254
+ /** Heavy long dashed underline */
255
+ DASHLONGHEAVY: "dashLongHeavy",
256
+ /** Dot-dash underline */
257
+ DOTDASH: "dotDash",
258
+ /** Heavy dot-dash underline */
259
+ DASHDOTHEAVY: "dashDotHeavy",
260
+ /** Dot-dot-dash underline */
261
+ DOTDOTDASH: "dotDotDash",
262
+ /** Heavy dot-dot-dash underline */
263
+ DASHDOTDOTHEAVY: "dashDotDotHeavy",
264
+ /** Wave underline */
265
+ WAVE: "wave",
266
+ /** Heavy wave underline */
267
+ WAVYHEAVY: "wavyHeavy",
268
+ /** Double wave underline */
269
+ WAVYDOUBLE: "wavyDouble",
270
+ /** No underline */
271
+ NONE: "none"
272
+ };
273
+ //#endregion
274
+ //#region src/parts/paragraph/run/emphasis-mark.ts
275
+ /**
276
+ * Emphasis mark module for WordprocessingML run properties.
277
+ *
278
+ * This module provides support for East Asian emphasis marks, which are
279
+ * characters placed above or below text to emphasize it.
280
+ *
281
+ * Reference: http://officeopenxml.com/WPrun.php
282
+ *
283
+ * @module
284
+ */
285
+ /**
286
+ * Emphasis mark types.
287
+ *
288
+ * Defines the types of emphasis marks that can be applied to text.
289
+ * Emphasis marks are commonly used in East Asian typography.
290
+ *
291
+ * ## XSD Schema
292
+ * ```xml
293
+ * <xsd:simpleType name="ST_Em">
294
+ * <xsd:restriction base="xsd:string">
295
+ * <xsd:enumeration value="none"/>
296
+ * <xsd:enumeration value="dot"/>
297
+ * <xsd:enumeration value="comma"/>
298
+ * <xsd:enumeration value="circle"/>
299
+ * <xsd:enumeration value="underDot"/>
300
+ * </xsd:restriction>
301
+ * </xsd:simpleType>
302
+ * ```
303
+ *
304
+ * @publicApi
305
+ */
306
+ const EmphasisMarkType = {
307
+ /** No emphasis mark */
308
+ NONE: "none",
309
+ /** Comma emphasis mark */
310
+ COMMA: "comma",
311
+ /** Circle emphasis mark */
312
+ CIRCLE: "circle",
313
+ /** Dot emphasis mark */
314
+ DOT: "dot",
315
+ /** Under dot emphasis mark */
316
+ UNDER_DOT: "underDot"
317
+ };
318
+ //#endregion
319
+ //#region src/parts/paragraph/run/positional-tab.ts
320
+ /**
321
+ * Positional tab types for WordprocessingML documents.
322
+ *
323
+ * @module
324
+ */
325
+ const PositionalTabAlignment = {
326
+ LEFT: "left",
327
+ CENTER: "center",
328
+ RIGHT: "right"
329
+ };
330
+ const PositionalTabRelativeTo = {
331
+ MARGIN: "margin",
332
+ INDENT: "indent"
333
+ };
334
+ const PositionalTabLeader = {
335
+ NONE: "none",
336
+ DOT: "dot",
337
+ HYPHEN: "hyphen",
338
+ UNDERSCORE: "underscore",
339
+ MIDDLE_DOT: "middleDot"
340
+ };
341
+ //#endregion
342
+ //#region src/parts/paragraph/run/ruby.ts
343
+ /**
344
+ * Ruby annotation module for WordprocessingML documents.
345
+ *
346
+ * Ruby annotations are small text rendered above or below base text,
347
+ * commonly used for pronunciation guides in East Asian languages (furigana
348
+ * in Japanese, pinyin in Chinese, etc.).
349
+ *
350
+ * Used via the JSON API: `{ ruby: { text: "かな", base: "漢字" } }` as a
351
+ * paragraph or run child.
352
+ *
353
+ * Reference: ISO/IEC 29500-4, wml.xsd, CT_Ruby
354
+ *
355
+ * @module
356
+ */
357
+ /**
358
+ * Ruby alignment options.
359
+ *
360
+ * ## XSD Schema
361
+ * ```xml
362
+ * <xsd:simpleType name="ST_RubyAlign">
363
+ * <xsd:restriction base="xsd:string">
364
+ * <xsd:enumeration value="center"/>
365
+ * <xsd:enumeration value="distributeLetter"/>
366
+ * <xsd:enumeration value="distributeSpace"/>
367
+ * <xsd:enumeration value="left"/>
368
+ * <xsd:enumeration value="right"/>
369
+ * <xsd:enumeration value="rightVertical"/>
370
+ * </xsd:restriction>
371
+ * </xsd:simpleType>
372
+ * ```
373
+ */
374
+ const RubyAlign = {
375
+ /** Center alignment */
376
+ CENTER: "center",
377
+ /** Distribute letters evenly */
378
+ DISTRIBUTE_LETTER: "distributeLetter",
379
+ /** Distribute space evenly */
380
+ DISTRIBUTE_SPACE: "distributeSpace",
381
+ /** Left alignment */
382
+ LEFT: "left",
383
+ /** Right alignment */
384
+ RIGHT: "right",
385
+ /** Right vertical alignment */
386
+ RIGHT_VERTICAL: "rightVertical"
387
+ };
388
+ //#endregion
389
+ //#region src/parts/paragraph/run/proof-error.ts
390
+ /**
391
+ * Proof error types for WordprocessingML documents.
392
+ *
393
+ * @module
394
+ */
395
+ const ProofErrorType = {
396
+ SPELL_START: "spellStart",
397
+ SPELL_END: "spellEnd",
398
+ GRAM_START: "gramStart",
399
+ GRAM_END: "gramEnd"
400
+ };
401
+ //#endregion
81
402
  //#region src/parts/paragraph/links/hyperlink.ts
82
403
  /**
83
404
  * Hyperlink types for WordprocessingML documents.
@@ -169,6 +490,122 @@ const FrameWrap = {
169
490
  TIGHT: "tight"
170
491
  };
171
492
  //#endregion
493
+ //#region src/parts/table/table-properties/table-float-properties.ts
494
+ /**
495
+ * Table float properties module for WordprocessingML documents.
496
+ *
497
+ * This module provides floating table positioning options, allowing tables
498
+ * to float with text wrapping around them.
499
+ *
500
+ * Reference: http://officeopenxml.com/WPtableFloating.php
501
+ *
502
+ * @module
503
+ */
504
+ /**
505
+ * Anchor types for floating table positioning.
506
+ *
507
+ * Specifies the base object from which positioning is determined.
508
+ */
509
+ const TableAnchorType = {
510
+ MARGIN: "margin",
511
+ PAGE: "page",
512
+ TEXT: "text"
513
+ };
514
+ /**
515
+ * Relative horizontal position values for floating tables.
516
+ */
517
+ const RelativeHorizontalPosition = {
518
+ CENTER: "center",
519
+ INSIDE: "inside",
520
+ LEFT: "left",
521
+ OUTSIDE: "outside",
522
+ RIGHT: "right"
523
+ };
524
+ /**
525
+ * Relative vertical position values for floating tables.
526
+ */
527
+ const RelativeVerticalPosition = {
528
+ BOTTOM: "bottom",
529
+ CENTER: "center",
530
+ INLINE: "inline",
531
+ INSIDE: "inside",
532
+ OUTSIDE: "outside",
533
+ TOP: "top"
534
+ };
535
+ /**
536
+ * Table overlap behavior types.
537
+ *
538
+ * ## XSD Schema
539
+ * ```xml
540
+ * <xsd:simpleType name="ST_TblOverlap">
541
+ * <xsd:restriction base="xsd:string">
542
+ * <xsd:enumeration value="never"/>
543
+ * <xsd:enumeration value="overlap"/>
544
+ * </xsd:restriction>
545
+ * </xsd:simpleType>
546
+ * ```
547
+ */
548
+ const OverlapType = {
549
+ NEVER: "never",
550
+ OVERLAP: "overlap"
551
+ };
552
+ //#endregion
553
+ //#region src/parts/table/table-properties/table-layout.ts
554
+ /**
555
+ * Table layout module for WordprocessingML documents.
556
+ *
557
+ * This module provides table layout algorithm settings.
558
+ *
559
+ * @module
560
+ */
561
+ /**
562
+ * Table layout algorithm types.
563
+ *
564
+ * Specifies how the table width is calculated.
565
+ *
566
+ * ## XSD Schema
567
+ * ```xml
568
+ * <xsd:simpleType name="ST_TblLayoutType">
569
+ * <xsd:restriction base="xsd:string">
570
+ * <xsd:enumeration value="fixed"/>
571
+ * <xsd:enumeration value="autofit"/>
572
+ * </xsd:restriction>
573
+ * </xsd:simpleType>
574
+ * ```
575
+ *
576
+ * @publicApi
577
+ */
578
+ const TableLayoutType = {
579
+ /** Auto-fit layout - column widths are adjusted based on content */
580
+ AUTOFIT: "autofit",
581
+ /** Fixed layout - column widths are fixed as specified */
582
+ FIXED: "fixed"
583
+ };
584
+ //#endregion
585
+ //#region src/parts/table/table-properties/table-borders.ts
586
+ /**
587
+ * Table borders module for WordprocessingML documents.
588
+ *
589
+ * This module provides border options for tables.
590
+ *
591
+ * Reference: http://officeopenxml.com/WPtableBorders.php
592
+ *
593
+ * @module
594
+ */
595
+ const NONE_BORDER = {
596
+ color: "auto",
597
+ size: 0,
598
+ style: BorderStyle.NONE
599
+ };
600
+ const TABLE_BORDERS_NONE = {
601
+ bottom: NONE_BORDER,
602
+ insideHorizontal: NONE_BORDER,
603
+ insideVertical: NONE_BORDER,
604
+ left: NONE_BORDER,
605
+ right: NONE_BORDER,
606
+ top: NONE_BORDER
607
+ };
608
+ //#endregion
172
609
  //#region src/parts/table/table-row/table-row-height.ts
173
610
  /**
174
611
  * Table row height module for WordprocessingML documents.
@@ -206,6 +643,631 @@ const HeightRule = {
206
643
  EXACT: "exact"
207
644
  };
208
645
  //#endregion
646
+ //#region src/parts/drawing/text-wrap/wrap-tight.ts
647
+ /**
648
+ * Wrap Tight module for DrawingML text wrapping.
649
+ *
650
+ * This module provides tight text wrapping for floating drawings
651
+ * where text wraps closely around the image shape.
652
+ *
653
+ * Reference: http://officeopenxml.com/drwPicFloating-textWrap.php
654
+ *
655
+ * @module
656
+ */
657
+ /**
658
+ * Creates a default rectangular wrap polygon matching the image extent.
659
+ *
660
+ * Reference: http://officeopenxml.com/drwPicFloating-textWrap.php
661
+ *
662
+ * ## XSD Schema
663
+ * ```xml
664
+ * <xsd:complexType name="CT_WrapPath">
665
+ * <xsd:sequence>
666
+ * <xsd:element name="start" type="a:CT_Point2D" minOccurs="1" maxOccurs="1"/>
667
+ * <xsd:element name="lineTo" type="a:CT_Point2D" minOccurs="2" maxOccurs="unbounded"/>
668
+ * </xsd:sequence>
669
+ * <xsd:attribute name="edited" type="xsd:boolean" use="optional"/>
670
+ * </xsd:complexType>
671
+ * ```
672
+ */
673
+ const createWrapPolygon$1 = (cx, cy) => element("wp:wrapPolygon", { edited: "0" }, [
674
+ `<wp:start x="0" y="0"/>`,
675
+ `<wp:lineTo x="0" y="${-cy}"/>`,
676
+ `<wp:lineTo x="${cx}" y="${-cy}"/>`,
677
+ `<wp:lineTo x="${cx}" y="0"/>`,
678
+ `<wp:lineTo x="0" y="0"/>`
679
+ ]);
680
+ /**
681
+ * Creates tight text wrapping for a floating drawing.
682
+ *
683
+ * WrapTight causes text to wrap closely around the contours
684
+ * of the drawing rather than its rectangular bounding box.
685
+ * A default rectangular wrap polygon matching the image extent is generated.
686
+ *
687
+ * Reference: http://officeopenxml.com/drwPicFloating-textWrap.php
688
+ *
689
+ * ## XSD Schema
690
+ * ```xml
691
+ * <xsd:complexType name="CT_WrapTight">
692
+ * <xsd:sequence>
693
+ * <xsd:element name="wrapPolygon" type="CT_WrapPath" minOccurs="1" maxOccurs="1"/>
694
+ * </xsd:sequence>
695
+ * <xsd:attribute name="wrapText" type="ST_WrapText" use="required"/>
696
+ * <xsd:attribute name="distL" type="ST_WrapDistance"/>
697
+ * <xsd:attribute name="distR" type="ST_WrapDistance"/>
698
+ * </xsd:complexType>
699
+ * ```
700
+ */
701
+ const createWrapTight = (textWrapping, margins = {
702
+ bottom: 0,
703
+ left: 0,
704
+ right: 0,
705
+ top: 0
706
+ }, extent) => element("wp:wrapTight", {
707
+ distL: margins.left,
708
+ distR: margins.right,
709
+ wrapText: textWrapping.side || TextWrappingSide.BOTH_SIDES
710
+ }, [createWrapPolygon$1(extent.x, extent.y)]);
711
+ //#endregion
712
+ //#region src/parts/drawing/text-wrap/wrap-through.ts
713
+ /**
714
+ * Wrap Through module for DrawingML text wrapping.
715
+ *
716
+ * This module provides "through" text wrapping for floating drawings
717
+ * where text wraps through the image contours, filling any concave areas.
718
+ *
719
+ * Reference: http://officeopenxml.com/drwPicFloating-textWrap.php
720
+ *
721
+ * @module
722
+ */
723
+ /**
724
+ * Creates a default rectangular wrap polygon matching the image extent.
725
+ *
726
+ * Reference: http://officeopenxml.com/drwPicFloating-textWrap.php
727
+ *
728
+ * ## XSD Schema
729
+ * ```xml
730
+ * <xsd:complexType name="CT_WrapPath">
731
+ * <xsd:sequence>
732
+ * <xsd:element name="start" type="a:CT_Point2D" minOccurs="1" maxOccurs="1"/>
733
+ * <xsd:element name="lineTo" type="a:CT_Point2D" minOccurs="2" maxOccurs="unbounded"/>
734
+ * </xsd:sequence>
735
+ * <xsd:attribute name="edited" type="xsd:boolean" use="optional"/>
736
+ * </xsd:complexType>
737
+ * ```
738
+ */
739
+ const createWrapPolygon = (cx, cy) => element("wp:wrapPolygon", { edited: "0" }, [
740
+ `<wp:start x="0" y="0"/>`,
741
+ `<wp:lineTo x="0" y="${-cy}"/>`,
742
+ `<wp:lineTo x="${cx}" y="${-cy}"/>`,
743
+ `<wp:lineTo x="${cx}" y="0"/>`,
744
+ `<wp:lineTo x="0" y="0"/>`
745
+ ]);
746
+ /**
747
+ * Creates "through" text wrapping for a floating drawing.
748
+ *
749
+ * WrapThrough is similar to WrapTight but allows text to wrap through
750
+ * the concave portions of the drawing shape (e.g., the inside of the letter "O").
751
+ * A default rectangular wrap polygon matching the image extent is generated.
752
+ *
753
+ * Reference: http://officeopenxml.com/drwPicFloating-textWrap.php
754
+ *
755
+ * ## XSD Schema
756
+ * ```xml
757
+ * <xsd:complexType name="CT_WrapThrough">
758
+ * <xsd:sequence>
759
+ * <xsd:element name="wrapPolygon" type="CT_WrapPath" minOccurs="1" maxOccurs="1"/>
760
+ * </xsd:sequence>
761
+ * <xsd:attribute name="wrapText" type="ST_WrapText" use="required"/>
762
+ * <xsd:attribute name="distL" type="ST_WrapDistance"/>
763
+ * <xsd:attribute name="distR" type="ST_WrapDistance"/>
764
+ * </xsd:complexType>
765
+ * ```
766
+ */
767
+ const createWrapThrough = (textWrapping, margins = {
768
+ bottom: 0,
769
+ left: 0,
770
+ right: 0,
771
+ top: 0
772
+ }, extent) => element("wp:wrapThrough", {
773
+ distL: margins.left,
774
+ distR: margins.right,
775
+ wrapText: textWrapping.side || TextWrappingSide.BOTH_SIDES
776
+ }, [createWrapPolygon(extent.x, extent.y)]);
777
+ //#endregion
778
+ //#region src/parts/drawing/floating/horizontal-position.ts
779
+ /**
780
+ * Horizontal position module for floating drawings in WordprocessingML documents.
781
+ *
782
+ * This module provides horizontal positioning for floating drawing objects,
783
+ * specifying the horizontal placement relative to a base element.
784
+ *
785
+ * Reference: http://officeopenxml.com/drwPicFloating-position.php
786
+ *
787
+ * @module
788
+ */
789
+ /**
790
+ * Creates a horizontal position element for floating drawings.
791
+ *
792
+ * The positionH element specifies the horizontal positioning of a floating
793
+ * object relative to a base element (page, margin, column, etc.).
794
+ *
795
+ * Reference: https://www.datypic.com/sc/ooxml/e-wp_positionH-1.html
796
+ *
797
+ * ## XSD Schema
798
+ * ```xml
799
+ * <xsd:complexType name="CT_PosH">
800
+ * <xsd:choice>
801
+ * <xsd:element name="align" type="ST_AlignH"/>
802
+ * <xsd:element name="posOffset" type="ST_PositionOffset"/>
803
+ * </xsd:choice>
804
+ * <xsd:attribute name="relativeFrom" type="ST_RelFromH" use="required"/>
805
+ * </xsd:complexType>
806
+ * ```
807
+ *
808
+ * @param options - Horizontal position configuration
809
+ * @returns The positionH XML string
810
+ *
811
+ * @example
812
+ * ```typescript
813
+ * // Align to the left of the page
814
+ * createHorizontalPosition({
815
+ * relative: HorizontalPositionRelativeFrom.PAGE,
816
+ * align: HorizontalPositionAlign.LEFT,
817
+ * });
818
+ *
819
+ * // Offset from the margin
820
+ * createHorizontalPosition({
821
+ * relative: HorizontalPositionRelativeFrom.MARGIN,
822
+ * offset: 914400, // 1 inch in EMUs
823
+ * });
824
+ * ```
825
+ */
826
+ const createHorizontalPosition = ({ relative, align, offset }) => {
827
+ const child = align ? `<wp:align>${align}</wp:align>` : offset !== void 0 ? `<wp:posOffset>${convertToEmu(offset)}</wp:posOffset>` : `<wp:align>${HorizontalPositionAlign.LEFT}</wp:align>`;
828
+ return element("wp:positionH", { relativeFrom: relative ?? HorizontalPositionRelativeFrom.PAGE }, [child]);
829
+ };
830
+ //#endregion
831
+ //#region src/parts/drawing/floating/vertical-position.ts
832
+ /**
833
+ * Vertical position module for floating drawings in WordprocessingML documents.
834
+ *
835
+ * This module provides vertical positioning for floating drawing objects,
836
+ * specifying the vertical placement relative to a base element.
837
+ *
838
+ * Reference: http://officeopenxml.com/drwPicFloating-position.php
839
+ *
840
+ * @module
841
+ */
842
+ /**
843
+ * Creates a vertical position element for floating drawings.
844
+ *
845
+ * The positionV element specifies the vertical positioning of a floating
846
+ * object relative to a base element (page, margin, paragraph, line, etc.).
847
+ *
848
+ * Reference: https://www.datypic.com/sc/ooxml/e-wp_positionV-1.html
849
+ *
850
+ * ## XSD Schema
851
+ * ```xml
852
+ * <xsd:complexType name="CT_PosV">
853
+ * <xsd:choice>
854
+ * <xsd:element name="align" type="ST_AlignV"/>
855
+ * <xsd:element name="posOffset" type="ST_PositionOffset"/>
856
+ * </xsd:choice>
857
+ * <xsd:attribute name="relativeFrom" type="ST_RelFromV" use="required"/>
858
+ * </xsd:complexType>
859
+ * ```
860
+ *
861
+ * @param options - Vertical position configuration
862
+ * @returns The positionV XML string
863
+ *
864
+ * @example
865
+ * ```typescript
866
+ * // Align to the top of the page
867
+ * createVerticalPosition({
868
+ * relative: VerticalPositionRelativeFrom.PAGE,
869
+ * align: VerticalPositionAlign.TOP,
870
+ * });
871
+ *
872
+ * // Offset from the paragraph
873
+ * createVerticalPosition({
874
+ * relative: VerticalPositionRelativeFrom.PARAGRAPH,
875
+ * offset: 457200, // 0.5 inch in EMUs
876
+ * });
877
+ * ```
878
+ */
879
+ const createVerticalPosition = ({ relative, align, offset }) => {
880
+ const child = align ? `<wp:align>${align}</wp:align>` : offset !== void 0 ? `<wp:posOffset>${convertToEmu(offset)}</wp:posOffset>` : `<wp:align>${VerticalPositionAlign.TOP}</wp:align>`;
881
+ return element("wp:positionV", { relativeFrom: relative ?? VerticalPositionRelativeFrom.PAGE }, [child]);
882
+ };
883
+ //#endregion
884
+ //#region src/parts/document/body/section-properties/properties/doc-grid.ts
885
+ /**
886
+ * Specifies the type of the current document grid, which defines the grid behavior.
887
+ *
888
+ * The grid can define a grid which snaps all East Asian characters to grid positions, but leaves Latin text with its default spacing; a grid which adds the specified character pitch to all characters on each row; or a grid which affects only the line pitch for the current section.
889
+ *
890
+ * Reference: https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_ST_DocGrid_topic_ID0ELYP2.html
891
+ *
892
+ * ## XSD Schema
893
+ * ```xml
894
+ * <xsd:simpleType name="ST_DocGrid">
895
+ * <xsd:restriction base="xsd:string">
896
+ * <xsd:enumeration value="default"/>
897
+ * <xsd:enumeration value="lines"/>
898
+ * <xsd:enumeration value="linesAndChars"/>
899
+ * <xsd:enumeration value="snapToChars"/>
900
+ * </xsd:restriction>
901
+ * </xsd:simpleType>
902
+ * ```
903
+ */
904
+ const DocumentGridType = {
905
+ /**
906
+ * Specifies that no document grid shall be applied to the contents of the current section in the document.
907
+ */
908
+ DEFAULT: "default",
909
+ /**
910
+ * Specifies that the parent section shall have additional line pitch added to each line within it (as specified on the <docGrid> element (§2.6.5)) in order to maintain the specified number of lines per page.
911
+ */
912
+ LINES: "lines",
913
+ /**
914
+ * Specifies that the parent section shall have both the additional line pitch and character pitch added to each line and character within it (as specified on the <docGrid> element (§2.6.5)) in order to maintain a specific number of lines per page and characters per line.
915
+ *
916
+ * When this value is set, the input specified via the user interface may be allowed in exact number of line/character pitch units. */
917
+ LINES_AND_CHARS: "linesAndChars",
918
+ /**
919
+ * Specifies that the parent section shall have both the additional line pitch and character pitch added to each line and character within it (as specified on the <docGrid> element (§2.6.5)) in order to maintain a specific number of lines per page and characters per line.
920
+ *
921
+ * When this value is set, the input specified via the user interface may be restricted to the number of lines per page and characters per line, with the consumer or producer translating this information based on the current font data to get the resulting line and character pitch values
922
+ */
923
+ SNAP_TO_CHARS: "snapToChars"
924
+ };
925
+ /**
926
+ * This element specifies the settings for the document grid, which enables precise layout of full-width East Asian language characters within a document by specifying the desired number of characters per line and lines per page for all East Asian text content in this section.
927
+ *
928
+ * Reference: https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_docGrid_topic_ID0EHU5S.html
929
+ *
930
+ * ```xml
931
+ * <xsd:complexType name="CT_DocGrid">
932
+ * <xsd:attribute name="type" type="ST_DocGrid"/>
933
+ * <xsd:attribute name="linePitch" type="ST_DecimalNumber"/>
934
+ * <xsd:attribute name="charSpace" type="ST_DecimalNumber"/>
935
+ * </xsd:complexType>
936
+ * ```
937
+ * @returns
938
+ */
939
+ const createDocumentGrid = ({ type, linePitch, charSpace }) => element("w:docGrid", {
940
+ "w:charSpace": charSpace ? decimalNumber(charSpace) : void 0,
941
+ "w:linePitch": decimalNumber(linePitch),
942
+ "w:type": type
943
+ });
944
+ //#endregion
945
+ //#region src/parts/document/body/section-properties/properties/page-borders.ts
946
+ /**
947
+ * Specifies which pages display the page border.
948
+ *
949
+ * ## XSD Schema
950
+ * ```xml
951
+ * <xsd:simpleType name="ST_PageBorderDisplay">
952
+ * <xsd:restriction base="xsd:string">
953
+ * <xsd:enumeration value="allPages"/>
954
+ * <xsd:enumeration value="firstPage"/>
955
+ * <xsd:enumeration value="notFirstPage"/>
956
+ * </xsd:restriction>
957
+ * </xsd:simpleType>
958
+ * ```
959
+ *
960
+ * @publicApi
961
+ */
962
+ const PageBorderDisplay = {
963
+ /** Display border on all pages */
964
+ ALL_PAGES: "allPages",
965
+ /** Display border only on first page */
966
+ FIRST_PAGE: "firstPage",
967
+ /** Display border on all pages except first page */
968
+ NOT_FIRST_PAGE: "notFirstPage"
969
+ };
970
+ /**
971
+ * Specifies whether page border is positioned relative to page edge or text.
972
+ *
973
+ * ## XSD Schema
974
+ * ```xml
975
+ * <xsd:simpleType name="ST_PageBorderOffset">
976
+ * <xsd:restriction base="xsd:string">
977
+ * <xsd:enumeration value="page"/>
978
+ * <xsd:enumeration value="text"/>
979
+ * </xsd:restriction>
980
+ * </xsd:simpleType>
981
+ * ```
982
+ *
983
+ * @publicApi
984
+ */
985
+ const PageBorderOffsetFrom = {
986
+ /** Position border relative to page edge */
987
+ PAGE: "page",
988
+ /** Position border relative to text (default) */
989
+ TEXT: "text"
990
+ };
991
+ /**
992
+ * Specifies z-order of page border relative to intersecting objects.
993
+ *
994
+ * ## XSD Schema
995
+ * ```xml
996
+ * <xsd:simpleType name="ST_PageBorderZOrder">
997
+ * <xsd:restriction base="xsd:string">
998
+ * <xsd:enumeration value="front"/>
999
+ * <xsd:enumeration value="back"/>
1000
+ * </xsd:restriction>
1001
+ * </xsd:simpleType>
1002
+ * ```
1003
+ *
1004
+ * @publicApi
1005
+ */
1006
+ const PageBorderZOrder = {
1007
+ /** Display border behind page contents */
1008
+ BACK: "back",
1009
+ /** Display border in front of page contents (default) */
1010
+ FRONT: "front"
1011
+ };
1012
+ //#endregion
1013
+ //#region src/parts/document/body/section-properties/properties/page-margin.ts
1014
+ /**
1015
+ * Page margin module for WordprocessingML section properties.
1016
+ *
1017
+ * Defines page margins for document sections.
1018
+ *
1019
+ * Reference: http://officeopenxml.com/WPsectionPr.php
1020
+ *
1021
+ * @module
1022
+ */
1023
+ /**
1024
+ * Creates page margins (pgMar) for a document section.
1025
+ *
1026
+ * This element specifies the page margins for all pages in a section,
1027
+ * including top, bottom, left, right, header, footer, and gutter margins.
1028
+ *
1029
+ * Reference: http://officeopenxml.com/WPsectionPr.php
1030
+ *
1031
+ * ## XSD Schema
1032
+ * ```xml
1033
+ * <xsd:complexType name="CT_PageMar">
1034
+ * <xsd:attribute name="top" type="ST_SignedTwipsMeasure" use="required"/>
1035
+ * <xsd:attribute name="right" type="s:ST_TwipsMeasure" use="required"/>
1036
+ * <xsd:attribute name="bottom" type="ST_SignedTwipsMeasure" use="required"/>
1037
+ * <xsd:attribute name="left" type="s:ST_TwipsMeasure" use="required"/>
1038
+ * <xsd:attribute name="header" type="s:ST_TwipsMeasure" use="required"/>
1039
+ * <xsd:attribute name="footer" type="s:ST_TwipsMeasure" use="required"/>
1040
+ * <xsd:attribute name="gutter" type="s:ST_TwipsMeasure" use="required"/>
1041
+ * </xsd:complexType>
1042
+ * ```
1043
+ *
1044
+ * @example
1045
+ * ```typescript
1046
+ * // Create page margins with 1 inch margins (1440 twips = 1 inch)
1047
+ * createPageMargin(1440, 1440, 1440, 1440, 720, 720, 0);
1048
+ * ```
1049
+ */
1050
+ const createPageMargin = (top, right, bottom, left, header, footer, gutter) => `<w:pgMar w:bottom="${signedTwipsMeasureValue(bottom)}" w:footer="${twipsMeasureValue(footer)}" w:gutter="${twipsMeasureValue(gutter)}" w:header="${twipsMeasureValue(header)}" w:left="${twipsMeasureValue(left)}" w:right="${twipsMeasureValue(right)}" w:top="${signedTwipsMeasureValue(top)}"/>`;
1051
+ //#endregion
1052
+ //#region src/parts/document/body/section-properties/properties/line-number.ts
1053
+ /**
1054
+ * This simple type specifies when the line numbering in the parent section shall be reset to its restart value. The line numbering increments for each line (even if the line number itself is not displayed) until it reaches the restart point specified by this element.
1055
+ *
1056
+ * Reference: https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_ST_LineNumberRestart_topic_ID0EUS42.html
1057
+ *
1058
+ * ## XSD Schema
1059
+ *
1060
+ * ```xml
1061
+ * <xsd:simpleType name="ST_LineNumberRestart">
1062
+ * <xsd:restriction base="xsd:string">
1063
+ * <xsd:enumeration value="newPage"/>
1064
+ * <xsd:enumeration value="newSection"/>
1065
+ * <xsd:enumeration value="continuous"/>
1066
+ * </xsd:restriction>
1067
+ * </xsd:simpleType>
1068
+ * ```
1069
+ *
1070
+ * @publicApi
1071
+ */
1072
+ const LineNumberRestartFormat = {
1073
+ /**
1074
+ * ## Restart Line Numbering on Each Page
1075
+ *
1076
+ * Specifies that line numbering for the parent section shall restart to the starting value whenever a new page is displayed.
1077
+ */
1078
+ NEW_PAGE: "newPage",
1079
+ /**
1080
+ * ## Restart Line Numbering for Each Section
1081
+ *
1082
+ * Specifies that line numbering for the parent section shall restart to the starting value whenever the parent begins.
1083
+ */
1084
+ NEW_SECTION: "newSection",
1085
+ /**
1086
+ * ## Continue Line Numbering From Previous Section
1087
+ *
1088
+ * Specifies that line numbering for the parent section shall continue from the line numbering from the end of the previous section, if any.
1089
+ */
1090
+ CONTINUOUS: "continuous"
1091
+ };
1092
+ /**
1093
+ * This element specifies the settings for line numbering to be displayed before each column of text in this section in the document.
1094
+ *
1095
+ * References:
1096
+ * - https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_lnNumType_topic_ID0EVRAT.html
1097
+ * - http://officeopenxml.com/WPsectionLineNumbering.php
1098
+ *
1099
+ * ## XSD Schema
1100
+ *
1101
+ * ```xml
1102
+ * <xsd:complexType name="CT_LineNumber">
1103
+ * <xsd:attribute name="countBy" type="ST_DecimalNumber" use="optional"/>
1104
+ * <xsd:attribute name="start" type="ST_DecimalNumber" use="optional" default="1"/>
1105
+ * <xsd:attribute name="distance" type="s:ST_TwipsMeasure" use="optional"/>
1106
+ * <xsd:attribute name="restart" type="ST_LineNumberRestart" use="optional" default="newPage"/>
1107
+ * </xsd:complexType>
1108
+ * ```
1109
+ */
1110
+ const createLineNumberType = ({ countBy, start, restart, distance }) => element("w:lnNumType", {
1111
+ "w:countBy": countBy === void 0 ? void 0 : decimalNumber(countBy),
1112
+ "w:distance": distance === void 0 ? void 0 : twipsMeasureValue(distance),
1113
+ "w:restart": restart,
1114
+ "w:start": start === void 0 ? void 0 : decimalNumber(start)
1115
+ });
1116
+ //#endregion
1117
+ //#region src/parts/document/body/section-properties/properties/section-type.ts
1118
+ /**
1119
+ * Section type module for WordprocessingML section properties.
1120
+ *
1121
+ * Defines how a section begins relative to the previous section.
1122
+ *
1123
+ * Reference: http://officeopenxml.com/WPsection.php
1124
+ *
1125
+ * @module
1126
+ */
1127
+ /**
1128
+ * Specifies the type of section break.
1129
+ *
1130
+ * This determines where the section begins relative to the previous section.
1131
+ *
1132
+ * ## XSD Schema
1133
+ * ```xml
1134
+ * <xsd:simpleType name="ST_SectionMark">
1135
+ * <xsd:restriction base="xsd:string">
1136
+ * <xsd:enumeration value="nextPage"/>
1137
+ * <xsd:enumeration value="nextColumn"/>
1138
+ * <xsd:enumeration value="continuous"/>
1139
+ * <xsd:enumeration value="evenPage"/>
1140
+ * <xsd:enumeration value="oddPage"/>
1141
+ * </xsd:restriction>
1142
+ * </xsd:simpleType>
1143
+ * ```
1144
+ *
1145
+ * @publicApi
1146
+ */
1147
+ const SectionType = {
1148
+ /** Section begins on the next page */
1149
+ NEXT_PAGE: "nextPage",
1150
+ /** Section begins on the next column */
1151
+ NEXT_COLUMN: "nextColumn",
1152
+ /** Section begins immediately following the previous section */
1153
+ CONTINUOUS: "continuous",
1154
+ /** Section begins on the next even-numbered page */
1155
+ EVEN_PAGE: "evenPage",
1156
+ /** Section begins on the next odd-numbered page */
1157
+ ODD_PAGE: "oddPage"
1158
+ };
1159
+ /**
1160
+ * Creates section type (type) for a document section.
1161
+ *
1162
+ * This element specifies the type of section break, which determines
1163
+ * where the new section begins relative to the previous section.
1164
+ *
1165
+ * Reference: http://officeopenxml.com/WPsection.php
1166
+ *
1167
+ * ## XSD Schema
1168
+ * ```xml
1169
+ * <xsd:complexType name="CT_SectType">
1170
+ * <xsd:attribute name="val" type="ST_SectionMark"/>
1171
+ * </xsd:complexType>
1172
+ * ```
1173
+ *
1174
+ * @example
1175
+ * ```typescript
1176
+ * // Create a continuous section (no page break)
1177
+ * createSectionType(SectionType.CONTINUOUS);
1178
+ *
1179
+ * // Create a section that starts on next odd page
1180
+ * createSectionType(SectionType.ODD_PAGE);
1181
+ * ```
1182
+ */
1183
+ const createSectionType = (value) => `<w:type w:val="${value}"/>`;
1184
+ //#endregion
1185
+ //#region src/parts/document/body/section-properties/properties/header-footer-reference.ts
1186
+ /**
1187
+ * This simple type specifies the possible types of headers and footers which may be specified for a given header or footer reference in a document. This value determines the page(s) on which the current header or footer shall be displayed.
1188
+ *
1189
+ * Reference: https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_ST_HdrFtr_topic_ID0E2UW2.html
1190
+ *
1191
+ * ## XSD Schema
1192
+ * ```xml
1193
+ * <xsd:simpleType name="ST_HdrFtr">
1194
+ * <xsd:restriction base="xsd:string">
1195
+ * <xsd:enumeration value="even"/>
1196
+ * <xsd:enumeration value="default"/>
1197
+ * <xsd:enumeration value="first"/>
1198
+ * </xsd:restriction>
1199
+ * </xsd:simpleType>
1200
+ * ```
1201
+ */
1202
+ const HeaderFooterReferenceType = {
1203
+ /** Specifies that this header or footer shall appear on every page in this section which is not overridden with a specific `even` or `first` page header/footer. In a section with all three types specified, this type shall be used on all odd numbered pages (counting from the `first` page in the section, not the section numbering). */
1204
+ DEFAULT: "default",
1205
+ /** Specifies that this header or footer shall appear on the first page in this section. The appearance of this header or footer is contingent on the setting of the `titlePg` element (§2.10.6). */
1206
+ FIRST: "first",
1207
+ /** Specifies that this header or footer shall appear on all even numbered pages in this section (counting from the first page in the section, not the section numbering). The appearance of this header or footer is contingent on the setting of the `evenAndOddHeaders` element (§2.10.1). */
1208
+ EVEN: "even"
1209
+ };
1210
+ const HeaderFooterType = {
1211
+ FOOTER: "w:footerReference",
1212
+ HEADER: "w:headerReference"
1213
+ };
1214
+ const createHeaderFooterReference = (type, options) => `<${type} r:id="rId${options.id}" w:type="${options.type || HeaderFooterReferenceType.DEFAULT}"/>`;
1215
+ //#endregion
1216
+ //#region src/parts/table-of-contents/table-of-contents-properties.ts
1217
+ /**
1218
+ * Represents a style-to-level mapping for table of contents entries.
1219
+ *
1220
+ * StyleLevel associates a paragraph style name with a TOC level, allowing
1221
+ * custom styles to be included in the table of contents at specific levels.
1222
+ *
1223
+ * @publicApi
1224
+ */
1225
+ var StyleLevel = class {
1226
+ /** The name of the paragraph style. */
1227
+ styleName;
1228
+ /** The TOC level (1-9) to assign to this style. */
1229
+ level;
1230
+ constructor(styleName, level) {
1231
+ this.styleName = styleName;
1232
+ this.level = level;
1233
+ }
1234
+ };
1235
+ //#endregion
1236
+ //#region src/parts/table-of-contents/sdt-properties.ts
1237
+ /**
1238
+ * Structured Document Tag Properties module.
1239
+ *
1240
+ * Represents CT_SdtPr — the properties of a structured document tag (content control).
1241
+ * Supports all SDT types defined in the OOXML specification: comboBox, dropDownList,
1242
+ * date, text, equation,richText, picture, citation, group, bibliography, docPartObj,
1243
+ * docPartList.
1244
+ *
1245
+ * Reference: ISO/IEC 29500-4, wml.xsd, CT_SdtPr
1246
+ *
1247
+ * @module
1248
+ */
1249
+ /**
1250
+ * SDT lock type (ST_Lock).
1251
+ */
1252
+ const SdtLock = {
1253
+ /** Lock the SDT itself (cannot delete the control) */
1254
+ SDT_LOCKED: "sdtLocked",
1255
+ /** Lock the content (cannot edit content within the control) */
1256
+ CONTENT_LOCKED: "contentLocked",
1257
+ /** No locking */
1258
+ UNLOCKED: "unlocked",
1259
+ /** Lock both SDT and content */
1260
+ SDT_CONTENT_LOCKED: "sdtContentLocked"
1261
+ };
1262
+ /**
1263
+ * Date mapping type (ST_SdtDateMappingType).
1264
+ */
1265
+ const SdtDateMappingType = {
1266
+ TEXT: "text",
1267
+ DATE: "date",
1268
+ DATE_TIME: "dateTime"
1269
+ };
1270
+ //#endregion
209
1271
  //#region src/parts/footnotes/footnote/footnote.ts
210
1272
  /**
211
1273
  * Enumeration of footnote types.
@@ -227,6 +1289,96 @@ const EndnoteType = {
227
1289
  SEPARATOR: "separator"
228
1290
  };
229
1291
  //#endregion
1292
+ //#region src/parts/perm-start.ts
1293
+ /**
1294
+ * Permission range markers for WordprocessingML document protection.
1295
+ *
1296
+ * These elements mark editable ranges within a protected document.
1297
+ *
1298
+ * Reference: ISO/IEC 29500-4, wml.xsd, CT_PermStart, CT_PermEnd
1299
+ *
1300
+ * @module
1301
+ */
1302
+ /**
1303
+ * Editing group values for permission ranges.
1304
+ *
1305
+ * Defines who can edit within a permission range.
1306
+ *
1307
+ * Reference: ISO/IEC 29500-4, ST_EdGrp
1308
+ */
1309
+ const EditGroupType = {
1310
+ NONE: "none",
1311
+ EVERYONE: "everyone",
1312
+ ADMINISTRATORS: "administrators",
1313
+ CONTRIBUTORS: "contributors",
1314
+ EDITORS: "editors",
1315
+ OWNERS: "owners",
1316
+ CURRENT: "current"
1317
+ };
1318
+ //#endregion
1319
+ //#region src/parts/fonts/font.ts
1320
+ /**
1321
+ * Character set constants for font definitions.
1322
+ * Maps character set names to their hexadecimal identifiers.
1323
+ *
1324
+ * @publicApi
1325
+ */
1326
+ const CharacterSet = {
1327
+ ANSI: "00",
1328
+ ARABIC: "B2",
1329
+ BALTIC: "BA",
1330
+ CHINESEBIG5: "88",
1331
+ DEFAULT: "01",
1332
+ EASTEUROPE: "EE",
1333
+ GB_2312: "86",
1334
+ GREEK: "A1",
1335
+ HANGUL: "81",
1336
+ HEBREW: "B1",
1337
+ JIS: "80",
1338
+ JOHAB: "82",
1339
+ MAC: "4D",
1340
+ OEM: "FF",
1341
+ RUSSIAN: "CC",
1342
+ SYMBOL: "02",
1343
+ THAI: "DE",
1344
+ TURKISH: "A2",
1345
+ VIETNAMESE: "A3"
1346
+ };
1347
+ //#endregion
1348
+ //#region src/parts/relationships.ts
1349
+ const relationshipsDesc = {
1350
+ kind: "custom",
1351
+ stringify(opts, _ctx) {
1352
+ const p = ["<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">"];
1353
+ for (const rel of opts.relationships) {
1354
+ const targetModeAttr = rel.targetMode ? ` TargetMode="${escapeXml(rel.targetMode)}"` : "";
1355
+ p.push(`<Relationship Id="rId${rel.id}" Type="${escapeXml(rel.type)}" Target="${escapeXml(rel.target)}"${targetModeAttr}/>`);
1356
+ }
1357
+ p.push("</Relationships>");
1358
+ return p.join("");
1359
+ },
1360
+ parse(el, _ctx) {
1361
+ const relationships = [];
1362
+ for (const child of el.elements ?? []) {
1363
+ if (child.name !== "Relationship") continue;
1364
+ const id = child.attributes?.["Id"];
1365
+ const type = child.attributes?.["Type"];
1366
+ const target = child.attributes?.["Target"];
1367
+ const targetMode = child.attributes?.["TargetMode"];
1368
+ if (id && type && target) {
1369
+ const numId = String(id).replace("rId", "");
1370
+ relationships.push({
1371
+ id: Number(numId) || id,
1372
+ type: String(type),
1373
+ target: String(target),
1374
+ targetMode: targetMode ? String(targetMode) : void 0
1375
+ });
1376
+ }
1377
+ }
1378
+ return { relationships };
1379
+ }
1380
+ };
1381
+ //#endregion
230
1382
  //#region src/shared/track-revision/track-revision-components/cell-merge.ts
231
1383
  /**
232
1384
  * Vertical merge revision types.