@docxkit/plugin-callout 0.3.0 → 0.4.0

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
@@ -7,6 +7,6 @@ Callout/admonition plugin for docx-kit.
7
7
  ```ts
8
8
  import { calloutPlugin } from '@docxkit/plugin-callout'
9
9
 
10
- builder.use(calloutPlugin)
10
+ builder.use(calloutPlugin())
11
11
  builder.callout({ type: 'info', text: 'Note: this is important.' })
12
12
  ```
package/dist/index.d.ts CHANGED
@@ -144,12 +144,18 @@ interface ParagraphStyleRule {
144
144
  marginRight?: UnitValue;
145
145
  /** Top margin. */
146
146
  marginTop?: UnitValue;
147
+ /** Outline level used by Word navigation and table-of-contents fields (0–9). */
148
+ outlineLevel?: number;
147
149
  /** Force page break before this paragraph. */
148
150
  pageBreakBefore?: boolean;
151
+ /** Custom tab stops for this paragraph. */
152
+ tabStops?: TabStopRule[];
149
153
  /** Horizontal text alignment. */
150
154
  textAlign?: TextAlign;
151
155
  /** First-line indent. */
152
156
  textIndent?: UnitValue;
157
+ /** Prevent isolated first or last lines across page boundaries. */
158
+ widowControl?: boolean;
153
159
  /**
154
160
  * CSS-like margin shorthand.
155
161
  *
@@ -191,6 +197,15 @@ interface StyleSheetEntry extends DocxStyleRule {
191
197
  /** Inherit style properties from one or more other style classes. */
192
198
  extends?: string | string[];
193
199
  }
200
+ /** A paragraph tab stop. */
201
+ interface TabStopRule {
202
+ /** Position from the paragraph's left edge. */
203
+ position: UnitValue;
204
+ /** Optional leader characters before the tab stop. */
205
+ leader?: 'dot' | 'hyphen' | 'middleDot' | 'none' | 'underscore';
206
+ /** Tab alignment. */
207
+ type: 'bar' | 'center' | 'clear' | 'decimal' | 'end' | 'left' | 'num' | 'right' | 'start';
208
+ }
194
209
  /** Horizontal text alignment. */
195
210
  type TextAlign = 'center' | 'justify' | 'left' | 'right';
196
211
  /**
@@ -214,7 +229,7 @@ interface TextStyleRule {
214
229
  * Takes precedence over `fontWeight` when both are set.
215
230
  */
216
231
  bold?: boolean;
217
- /** Character spacing (letter-spacing). */
232
+ /** Raw OOXML character spacing in twips. Prefer `letterSpacing` for CSS units. */
218
233
  characterSpacing?: number;
219
234
  /** Text / foreground color (hex, named, or theme token like `"$colors.primary"`). */
220
235
  color?: HexColor | StyleToken<string>;
@@ -223,6 +238,10 @@ interface TextStyleRule {
223
238
  * Use for properties not yet covered by the CSS-like mapping.
224
239
  */
225
240
  docx?: Record<string, unknown>;
241
+ /** Double strikethrough toggle. */
242
+ doubleStrike?: boolean;
243
+ /** Embossed text effect. */
244
+ emboss?: boolean;
226
245
  /**
227
246
  * Font family name (e.g. `"Arial"`, or theme token like `"$fonts.heading"`).
228
247
  */
@@ -235,13 +254,17 @@ interface TextStyleRule {
235
254
  fontWeight?: FontWeight;
236
255
  /** Text highlight color (background marker). */
237
256
  highlight?: HighlightColor;
257
+ /** Imprinted (engraved) text effect. */
258
+ imprint?: boolean;
238
259
  /**
239
260
  * Convenience boolean: `true` maps to `fontStyle: 'italic'`.
240
261
  * Takes precedence over `fontStyle` when both are set.
241
262
  */
242
263
  italic?: boolean;
243
- /** Character spacing. */
264
+ /** CSS-like character spacing with unit conversion. */
244
265
  letterSpacing?: UnitValue;
266
+ /** Right-to-left run direction. */
267
+ rightToLeft?: boolean;
245
268
  /** Small caps text variant. */
246
269
  smallCaps?: boolean;
247
270
  /** Strikethrough toggle. */
@@ -279,17 +302,29 @@ interface BaseNode<TStyles extends StyleSheet = StyleSheet> {
279
302
  *
280
303
  * @template TStyles — The user's stylesheet type
281
304
  */
282
- type BlockNode<TStyles extends StyleSheet = StyleSheet> = BulletListNode<TStyles> | HeadingNode<TStyles> | HyperlinkNode<TStyles> | ImageNode<TStyles> | NumberedListNode<TStyles> | PageBreakNode | ParagraphNode<TStyles> | PluginNode<string, unknown, TStyles> | SectionBreakNode | TableNode<Record<string, unknown>, TStyles>;
305
+ type BlockNode<TStyles extends StyleSheet = StyleSheet> = BookmarkNode<TStyles> | BulletListNode<TStyles> | CheckboxNode<TStyles> | ColumnBreakNode | CommentNode<TStyles> | FootnoteNode<TStyles> | HeadingNode<TStyles> | HyperlinkNode<TStyles> | ImageNode<TStyles> | MathNode | NumberedListNode<TStyles> | PageBreakNode | ParagraphNode<TStyles> | PluginNode<string, unknown, TStyles> | RevisionNode<TStyles> | SectionBreakNode | TableNode<Record<string, unknown>, TStyles> | TextBoxNode<TStyles> | ThematicBreakNode<TStyles>;
306
+ /**
307
+ * A named bookmark that can be targeted by an internal hyperlink.
308
+ */
309
+ interface BookmarkNode<TStyles extends StyleSheet = StyleSheet> extends BaseNode<TStyles> {
310
+ /** Text or styled text runs contained by the bookmark. */
311
+ children: (string | TextNode<TStyles>)[];
312
+ /** Stable bookmark name. */
313
+ name: string;
314
+ type: 'bookmark';
315
+ }
283
316
  /**
284
317
  * A structured list item (for rich bullet/numbered items).
285
318
  *
286
319
  * @template TStyles — The user's stylesheet type
287
320
  */
288
321
  interface BulletItem<TStyles extends StyleSheet = StyleSheet> extends BaseNode<TStyles> {
289
- /** Item text content. */
290
- text: string;
291
322
  /** Optional inline children override (instead of text). */
292
323
  children?: InlineNode<TStyles>[];
324
+ /** Per-item nested list level (0–8). Overrides the list-level default. */
325
+ level?: number;
326
+ /** Item text content, used when `children` is absent. */
327
+ text?: string;
293
328
  }
294
329
  /**
295
330
  * A bullet list node.
@@ -307,12 +342,65 @@ interface BulletListNode<TStyles extends StyleSheet = StyleSheet> extends BaseNo
307
342
  /** Nested list level (0 = top-level). */
308
343
  level?: number;
309
344
  }
345
+ /**
346
+ * A Word checkbox content control.
347
+ */
348
+ interface CheckboxNode<TStyles extends StyleSheet = StyleSheet> extends BaseNode<TStyles> {
349
+ type: 'checkbox';
350
+ /** Accessible alias for the checkbox control. */
351
+ alias?: string;
352
+ /** Whether the checkbox is checked. */
353
+ checked?: boolean;
354
+ /** Checked-state glyph and font. */
355
+ checkedState?: CheckboxSymbol;
356
+ /** Optional label rendered after the checkbox. */
357
+ label?: string;
358
+ /** Unchecked-state glyph and font. */
359
+ uncheckedState?: CheckboxSymbol;
360
+ }
361
+ /** Checkbox glyph customization. */
362
+ interface CheckboxSymbol {
363
+ /** Font containing the glyph. */
364
+ font?: string;
365
+ /** Unicode code point expressed as a hexadecimal string. */
366
+ value?: string;
367
+ }
310
368
  /**
311
369
  * Extract valid class name keys from a stylesheet type.
312
370
  *
313
371
  * @template TStyles — The user's stylesheet type
314
372
  */
315
373
  type ClassName<TStyles extends StyleSheet> = Extract<keyof TStyles, string>;
374
+ /**
375
+ * A forced column break.
376
+ */
377
+ interface ColumnBreakNode {
378
+ type: 'columnBreak';
379
+ }
380
+ /**
381
+ * An annotated content range backed by a Word comment.
382
+ */
383
+ interface CommentNode<TStyles extends StyleSheet = StyleSheet> extends BaseNode<TStyles> {
384
+ /** Comment author. */
385
+ author: string;
386
+ /** Annotated inline content. */
387
+ children: InlineNode<TStyles>[];
388
+ /** Comment body paragraphs or plain text. */
389
+ comment: (string | ParagraphNode<TStyles>)[];
390
+ type: 'comment';
391
+ /** ISO-8601 creation timestamp. */
392
+ date?: string;
393
+ /** Author initials. */
394
+ initials?: string;
395
+ }
396
+ /**
397
+ * A footnote reference and its document-level footnote content.
398
+ */
399
+ interface FootnoteNode<TStyles extends StyleSheet = StyleSheet> extends BaseNode<TStyles> {
400
+ /** Footnote body paragraphs or plain text. */
401
+ content: (string | ParagraphNode<TStyles>)[];
402
+ type: 'footnote';
403
+ }
316
404
  /**
317
405
  * A heading node (h1–h6).
318
406
  *
@@ -334,8 +422,10 @@ interface HyperlinkNode<TStyles extends StyleSheet = StyleSheet> extends BaseNod
334
422
  /** Display text or inline children. */
335
423
  children: (string | TextNode<TStyles>)[];
336
424
  type: 'hyperlink';
337
- /** Link target URL. */
338
- url: string;
425
+ /** Internal bookmark target (used instead of `url`). */
426
+ anchor?: string;
427
+ /** External link target URL. */
428
+ url?: string;
339
429
  }
340
430
  /**
341
431
  * An image node.
@@ -363,8 +453,11 @@ interface ImageNode<TStyles extends StyleSheet = StyleSheet> extends BaseNode<TS
363
453
  * - Object allows wrap mode and position offsets
364
454
  */
365
455
  floating?: boolean | {
366
- /** Text wrap mode. */wrap?: 'square' | 'tight' | 'topAndBottom'; /** Horizontal offset. */
367
- x?: UnitValue; /** Vertical offset. */
456
+ /** Text wrap mode. */
457
+ wrap?: 'square' | 'tight' | 'topAndBottom';
458
+ /** Horizontal offset. */
459
+ x?: UnitValue;
460
+ /** Vertical offset. */
368
461
  y?: UnitValue;
369
462
  };
370
463
  }
@@ -373,7 +466,63 @@ interface ImageNode<TStyles extends StyleSheet = StyleSheet> extends BaseNode<TS
373
466
  *
374
467
  * @template TStyles — The user's stylesheet type
375
468
  */
376
- type InlineNode<TStyles extends StyleSheet = StyleSheet> = HyperlinkNode<TStyles> | ImageNode<TStyles> | TextNode<TStyles>;
469
+ type InlineNode<TStyles extends StyleSheet = StyleSheet> = BookmarkNode<TStyles> | CheckboxNode<TStyles> | CommentNode<TStyles> | FootnoteNode<TStyles> | HyperlinkNode<TStyles> | ImageNode<TStyles> | MathNode | RevisionNode<TStyles> | TextNode<TStyles>;
470
+ /**
471
+ * A recursive expression used by {@link MathNode}.
472
+ */
473
+ type MathExpression = MathFractionExpression | MathFunctionExpression | MathIntegralExpression | MathRadicalExpression | MathScriptExpression | MathSumExpression | MathTextExpression;
474
+ /** A mathematical fraction. */
475
+ interface MathFractionExpression {
476
+ denominator: MathExpression[];
477
+ numerator: MathExpression[];
478
+ type: 'fraction';
479
+ }
480
+ /** A named mathematical function. */
481
+ interface MathFunctionExpression {
482
+ arguments: MathExpression[];
483
+ name: MathExpression[];
484
+ type: 'function';
485
+ }
486
+ /** A mathematical integral. */
487
+ interface MathIntegralExpression {
488
+ children: MathExpression[];
489
+ type: 'integral';
490
+ subScript?: MathExpression[];
491
+ superScript?: MathExpression[];
492
+ }
493
+ /**
494
+ * An Office Math (OMML) expression.
495
+ */
496
+ interface MathNode {
497
+ /** Structured mathematical expression tree. */
498
+ children: MathExpression[];
499
+ type: 'math';
500
+ }
501
+ /** A mathematical radical with an optional degree. */
502
+ interface MathRadicalExpression {
503
+ children: MathExpression[];
504
+ type: 'radical';
505
+ degree?: MathExpression[];
506
+ }
507
+ /** Subscript, superscript, or combined script. */
508
+ interface MathScriptExpression {
509
+ children: MathExpression[];
510
+ type: 'script';
511
+ subScript?: MathExpression[];
512
+ superScript?: MathExpression[];
513
+ }
514
+ /** A mathematical sum. */
515
+ interface MathSumExpression {
516
+ children: MathExpression[];
517
+ type: 'sum';
518
+ subScript?: MathExpression[];
519
+ superScript?: MathExpression[];
520
+ }
521
+ /** Plain text inside a mathematical expression. */
522
+ interface MathTextExpression {
523
+ text: string;
524
+ type: 'text';
525
+ }
377
526
  /**
378
527
  * A numbered / ordered list node.
379
528
  *
@@ -429,6 +578,21 @@ interface PluginNode<TName extends string = string, TOptions = unknown, TStyles
429
578
  options: TOptions;
430
579
  type: 'plugin';
431
580
  }
581
+ /**
582
+ * An inserted or deleted text revision.
583
+ */
584
+ interface RevisionNode<TStyles extends StyleSheet = StyleSheet> extends BaseNode<TStyles> {
585
+ /** Revision author. */
586
+ author: string;
587
+ /** Text or styled text runs in the revision. */
588
+ children: (string | TextNode<TStyles>)[];
589
+ /** ISO-8601 revision timestamp. */
590
+ date: string;
591
+ /** Document-unique revision identifier. */
592
+ revisionId: number;
593
+ /** Revision kind. */
594
+ type: 'deletedText' | 'insertedText';
595
+ }
432
596
  /**
433
597
  * Internal marker node that represents a section boundary.
434
598
  *
@@ -443,6 +607,17 @@ interface SectionBreakNode {
443
607
  /** Optional per-section page/header/footer overrides. */
444
608
  config?: SectionConfig;
445
609
  }
610
+ /** Table-level border configuration. */
611
+ interface TableBordersConfig {
612
+ bottom?: BorderRule;
613
+ insideHorizontal?: BorderRule;
614
+ insideVertical?: BorderRule;
615
+ left?: BorderRule;
616
+ right?: BorderRule;
617
+ top?: BorderRule;
618
+ }
619
+ /** Per-cell style resolver. */
620
+ type TableCellStyleResolver<TData extends Record<string, unknown> = Record<string, unknown>> = (value: TData[keyof TData], row: TData, rowIndex: number, column: TableColumn<TData>) => DocxStyleRule;
446
621
  /**
447
622
  * A column definition for a table.
448
623
  *
@@ -455,17 +630,22 @@ interface TableColumn<TData extends Record<string, unknown> = Record<string, unk
455
630
  title: string;
456
631
  /** Cell text alignment. */
457
632
  align?: 'center' | 'left' | 'right';
633
+ /** Per-column data cell style or resolver. */
634
+ cellStyle?: DocxStyleRule | TableCellStyleResolver<TData>;
458
635
  /**
459
636
  * Span multiple columns horizontally.
460
637
  *
461
638
  * Applied to all cells in this column.
462
639
  */
463
640
  colSpan?: number;
641
+ /** Per-column header cell style. */
642
+ headerCellStyle?: DocxStyleRule;
464
643
  /**
465
644
  * Span multiple rows vertically (per-cell via data hints).
466
645
  *
467
- * Set `rowSpan` on individual data objects using `_rowSpan: N` or keep it
468
- * as a static column default.
646
+ * Set a keyed `_${key}_rowSpan: N` hint on an individual data object,
647
+ * use `_rowSpan: N` for every cell in that row, or keep this as a static
648
+ * column default.
469
649
  */
470
650
  rowSpan?: number;
471
651
  /** Column width. Supports percentage strings (e.g. `"30%"`). */
@@ -478,6 +658,40 @@ interface TableColumn<TData extends Record<string, unknown> = Record<string, unk
478
658
  */
479
659
  render?: (value: TData[keyof TData], row: TData, index: number) => string | InlineNode[];
480
660
  }
661
+ /** Floating table positioning. */
662
+ interface TableFloatingOptions {
663
+ /** Bottom distance from surrounding text. */
664
+ bottomFromText?: UnitValue;
665
+ /** Horizontal anchor. */
666
+ horizontalAnchor?: 'margin' | 'page' | 'text';
667
+ /** Left distance from surrounding text. */
668
+ leftFromText?: UnitValue;
669
+ /** Whether the table may overlap other floating objects. */
670
+ overlap?: boolean;
671
+ /** Right distance from surrounding text. */
672
+ rightFromText?: UnitValue;
673
+ /** Top distance from surrounding text. */
674
+ topFromText?: UnitValue;
675
+ /** Vertical anchor. */
676
+ verticalAnchor?: 'margin' | 'page' | 'text';
677
+ /** Absolute horizontal offset. */
678
+ x?: UnitValue;
679
+ /** Absolute vertical offset. */
680
+ y?: UnitValue;
681
+ /** Relative horizontal placement. */
682
+ relativeHorizontalPosition?: 'center' | 'inside' | 'left' | 'outside' | 'right';
683
+ /** Relative vertical placement. */
684
+ relativeVerticalPosition?: 'bottom' | 'center' | 'inline' | 'inside' | 'outside' | 'top';
685
+ }
686
+ /** Native Word table-look flags. */
687
+ interface TableLookOptions {
688
+ firstColumn?: boolean;
689
+ firstRow?: boolean;
690
+ lastColumn?: boolean;
691
+ lastRow?: boolean;
692
+ noHBand?: boolean;
693
+ noVBand?: boolean;
694
+ }
481
695
  /**
482
696
  * A table node with column definitions and data rows.
483
697
  *
@@ -490,16 +704,59 @@ interface TableNode<TData extends Record<string, unknown> = Record<string, unkno
490
704
  /** Row data objects. */
491
705
  data: TData[];
492
706
  type: 'table';
707
+ /** Horizontal table alignment. */
708
+ alignment?: 'center' | 'left' | 'right';
493
709
  /** Show table borders. */
494
710
  bordered?: boolean;
495
- /** Default cell style for data rows. */
496
- cellStyle?: DocxStyleRule;
711
+ /** Explicit outer and inner table borders. */
712
+ borders?: TableBordersConfig;
713
+ /** Default data cell style or per-cell resolver. */
714
+ cellStyle?: DocxStyleRule | TableCellStyleResolver<TData>;
715
+ /** Floating table positioning. Enables side-by-side layouts. */
716
+ floating?: TableFloatingOptions;
497
717
  /** Show header row (default: `true`). */
498
718
  header?: boolean;
499
719
  /** Style for header cells. */
500
720
  headerCellStyle?: DocxStyleRule;
721
+ /** Word table layout algorithm. */
722
+ layout?: 'autofit' | 'fixed';
501
723
  /** Alternate row shading. */
502
724
  striped?: boolean;
725
+ /** Native Word table style ID. */
726
+ styleName?: string;
727
+ /** Native Word table-look flags. */
728
+ tableLook?: TableLookOptions;
729
+ /** Render the table grid from right to left. */
730
+ visuallyRightToLeft?: boolean;
731
+ /** Overall table width. */
732
+ width?: UnitValue;
733
+ }
734
+ /**
735
+ * A legacy Word text box positioned as a block-level shape.
736
+ */
737
+ interface TextBoxNode<TStyles extends StyleSheet = StyleSheet> extends BaseNode<TStyles> {
738
+ /** Text box dimensions and positioning. */
739
+ box: TextBoxOptions;
740
+ type: 'textBox';
741
+ /** Inline children (used instead of `text`). */
742
+ children?: InlineNode<TStyles>[];
743
+ /** Plain text content. */
744
+ text?: string;
745
+ }
746
+ /** Text box dimensions and positioning. */
747
+ interface TextBoxOptions {
748
+ /** Text box width. */
749
+ width: UnitValue;
750
+ /** Text box height. */
751
+ height?: UnitValue;
752
+ /** Horizontal offset. */
753
+ left?: UnitValue;
754
+ /** Shape positioning mode. */
755
+ position?: 'absolute' | 'relative' | 'static';
756
+ /** Vertical offset. */
757
+ top?: UnitValue;
758
+ /** Text wrapping behavior. */
759
+ wrap?: 'none' | 'square';
503
760
  }
504
761
  /**
505
762
  * A text run node (inline content).
@@ -511,8 +768,31 @@ interface TextNode<TStyles extends StyleSheet = StyleSheet> extends BaseNode<TSt
511
768
  text: string;
512
769
  type: 'text';
513
770
  }
771
+ /**
772
+ * A horizontal thematic break rendered as a paragraph border.
773
+ */
774
+ interface ThematicBreakNode<TStyles extends StyleSheet = StyleSheet> extends BaseNode<TStyles> {
775
+ type: 'thematicBreak';
776
+ }
514
777
  //#endregion
515
778
  //#region ../../packages/types/dist/document.d.ts
779
+ /** OOXML document properties shown in Word's File → Info panel. */
780
+ interface DocumentMetadata {
781
+ /** Document author. */
782
+ creator?: string;
783
+ /** Application-specific string properties. */
784
+ customProperties?: Record<string, string>;
785
+ /** Document description / summary. */
786
+ description?: string;
787
+ /** Keywords / tags. */
788
+ keywords?: string[];
789
+ /** Last editor. */
790
+ lastModifiedBy?: string;
791
+ /** Document subject. */
792
+ subject?: string;
793
+ /** Document title. */
794
+ title?: string;
795
+ }
516
796
  /**
517
797
  * Top-level configuration passed to `createDocx()`.
518
798
  *
@@ -522,6 +802,10 @@ interface TextNode<TStyles extends StyleSheet = StyleSheet> extends BaseNode<TSt
522
802
  * @template TStyles — The user's stylesheet type (inferred from `styles`).
523
803
  */
524
804
  interface DocxKitConfig<TStyles extends StyleSheet = StyleSheet> {
805
+ /** Font files embedded into the generated DOCX package. */
806
+ fonts?: EmbeddedFont[];
807
+ /** OOXML core properties (appear in File → Info). */
808
+ metadata?: DocumentMetadata;
525
809
  /** Page dimensions and margins. */
526
810
  page?: PageConfig;
527
811
  /** Named style classes (class → style rule map). */
@@ -530,20 +814,23 @@ interface DocxKitConfig<TStyles extends StyleSheet = StyleSheet> {
530
814
  theme?: DocxTheme;
531
815
  /** Default styles applied as base for each element type. */
532
816
  defaults?: {
533
- /** Default table cell style. */cell?: DocxStyleRule; /** Default image style (applied to the paragraph wrapping the image). */
534
- image?: DocxStyleRule; /** Default paragraph style. */
535
- paragraph?: DocxStyleRule; /** Default table style. */
536
- table?: DocxStyleRule; /** Default text run style. */
817
+ /** Default table cell style. */
818
+ cell?: DocxStyleRule;
819
+ /** Default image style (applied to the paragraph wrapping the image). */
820
+ image?: DocxStyleRule;
821
+ /** Default paragraph style. */
822
+ paragraph?: DocxStyleRule;
823
+ /** Default table style. */
824
+ table?: DocxStyleRule;
825
+ /** Default text run style. */
537
826
  text?: DocxStyleRule;
538
827
  };
539
- /** OOXML core properties (appear in File → Info). */
540
- metadata?: {
541
- /** Document author. */creator?: string; /** Document description / summary. */
542
- description?: string; /** Keywords / tags. */
543
- keywords?: string[]; /** Last editor. */
544
- lastModifiedBy?: string; /** Document subject. */
545
- subject?: string; /** Document title. */
546
- title?: string;
828
+ /** Document-level Word feature switches. */
829
+ features?: {
830
+ /** Enable tracked revision display and behavior. */
831
+ trackRevisions?: boolean;
832
+ /** Ask Word to update fields when the document opens. */
833
+ updateFields?: boolean;
547
834
  };
548
835
  }
549
836
  /**
@@ -563,6 +850,13 @@ interface DocxTheme {
563
850
  /** Spacing tokens (name → value). */
564
851
  spacing?: ThemeSpacing;
565
852
  }
853
+ /** A TrueType/OpenType font embedded into the DOCX package. */
854
+ interface EmbeddedFont {
855
+ /** Raw font-file bytes. */
856
+ data: Uint8Array;
857
+ /** Font family name written to the OOXML font table. */
858
+ name: string;
859
+ }
566
860
  /**
567
861
  * Header/footer configuration for a section.
568
862
  *
@@ -588,12 +882,39 @@ interface HeaderFooterContent {
588
882
  }
589
883
  /** Page orientation. */
590
884
  type Orientation = 'landscape' | 'portrait';
885
+ /** Page border configuration. */
886
+ interface PageBorderConfig {
887
+ /** Bottom page border. */
888
+ bottom?: BorderRule;
889
+ /** Pages that display the border. */
890
+ display?: 'allPages' | 'firstPage' | 'notFirstPage';
891
+ /** Left page border. */
892
+ left?: BorderRule;
893
+ /** Measure border offsets from the page edge or text area. */
894
+ offsetFrom?: 'page' | 'text';
895
+ /** Right page border. */
896
+ right?: BorderRule;
897
+ /** Top page border. */
898
+ top?: BorderRule;
899
+ /** Render the border behind or in front of document content. */
900
+ zOrder?: 'back' | 'front';
901
+ }
591
902
  /**
592
903
  * Page configuration (size, orientation, margin).
593
904
  */
594
905
  interface PageConfig {
906
+ /** Page border configuration. */
907
+ borders?: PageBorderConfig;
908
+ /** Distance between the footer and the page edge. */
909
+ footerDistance?: UnitValue;
910
+ /** Extra gutter width for binding. */
911
+ gutter?: UnitValue;
912
+ /** Distance between the header and the page edge. */
913
+ headerDistance?: UnitValue;
595
914
  /** Page orientation (`"portrait"` default). */
596
915
  orientation?: Orientation;
916
+ /** Page-number sequence configuration for this section. */
917
+ pageNumber?: PageNumberConfig;
597
918
  /** Page size: preset name or explicit dimensions. */
598
919
  size?: PageSize | {
599
920
  height: UnitValue;
@@ -607,8 +928,35 @@ interface PageConfig {
607
928
  */
608
929
  margin?: `${string} ${string}` | `${string} ${string} ${string} ${string}` | UnitValue;
609
930
  }
931
+ /** Per-section page-number sequence configuration. */
932
+ interface PageNumberConfig {
933
+ /** First page number in the section. */
934
+ start?: number;
935
+ /** Page number format. */
936
+ format?: 'decimal' | 'lowerLetter' | 'lowerRoman' | 'upperLetter' | 'upperRoman';
937
+ }
610
938
  /** Available page size presets. */
611
939
  type PageSize = 'A3' | 'A4' | 'Legal' | 'Letter';
940
+ /** An explicitly sized section column. */
941
+ interface SectionColumn {
942
+ /** Column width. */
943
+ width: UnitValue;
944
+ /** Space after this column. */
945
+ spacing?: UnitValue;
946
+ }
947
+ /** Multi-column layout for a section. */
948
+ interface SectionColumnsConfig {
949
+ /** Explicit column widths for unequal-width layouts. */
950
+ columns?: SectionColumn[];
951
+ /** Number of equal-width columns. */
952
+ count?: number;
953
+ /** Whether Word should keep columns equally sized. */
954
+ equalWidth?: boolean;
955
+ /** Draw a separator line between columns. */
956
+ separator?: boolean;
957
+ /** Default spacing between columns. */
958
+ spacing?: UnitValue;
959
+ }
612
960
  /**
613
961
  * Per-section configuration.
614
962
  *
@@ -617,13 +965,32 @@ type PageSize = 'A3' | 'A4' | 'Legal' | 'Letter';
617
965
  * sections.
618
966
  */
619
967
  interface SectionConfig {
968
+ /** Multi-column layout. */
969
+ columns?: SectionColumnsConfig;
620
970
  /** Section footer(s). */
621
971
  footer?: HeaderFooterConfig;
622
972
  /** Section header(s). */
623
973
  header?: HeaderFooterConfig;
974
+ /** Line numbering. */
975
+ lineNumbers?: SectionLineNumberConfig;
624
976
  /** Section-specific page dimensions (overrides document-level `page`). */
625
977
  page?: PageConfig;
978
+ /** Section break behavior. */
979
+ type?: SectionType;
980
+ }
981
+ /** Line-numbering configuration for a section. */
982
+ interface SectionLineNumberConfig {
983
+ /** Number every Nth line. */
984
+ countBy?: number;
985
+ /** Distance between line numbers and text. */
986
+ distance?: UnitValue;
987
+ /** When line numbering restarts. */
988
+ restart?: 'continuous' | 'newPage' | 'newSection';
989
+ /** Starting line number. */
990
+ start?: number;
626
991
  }
992
+ /** Section break behavior. */
993
+ type SectionType = 'continuous' | 'evenPage' | 'nextColumn' | 'nextPage' | 'oddPage';
627
994
  /**
628
995
  * Theme color palette — semantic color tokens referenced by name.
629
996
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@docxkit/plugin-callout",
3
3
  "type": "module",
4
- "version": "0.3.0",
4
+ "version": "0.4.0",
5
5
  "description": "Colored callout boxes (info/warning/success/danger) — docx-kit plugin",
6
6
  "keywords": [
7
7
  "docx",
@@ -35,10 +35,10 @@
35
35
  "sideEffects": false,
36
36
  "peerDependencies": {
37
37
  "docx": "^9.7.1",
38
- "@docxkit/core": "0.3.0"
38
+ "@docxkit/core": "0.4.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@docxkit/pdk": "0.3.0"
41
+ "@docxkit/pdk": "0.4.0"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "tsdown",