@stll/docx-core 0.3.0 → 0.5.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.
@@ -152,7 +152,8 @@ type ParagraphFormatting = {
152
152
  spaceBefore?: number; /** Spacing after in twips (w:spacing/@w:after) */
153
153
  spaceAfter?: number; /** Line spacing value (w:spacing/@w:line) */
154
154
  lineSpacing?: number; /** Line spacing rule (w:spacing/@w:lineRule) */
155
- lineSpacingRule?: LineSpacingRule; /** Auto space before (w:spacing/@w:beforeAutospacing) */
155
+ lineSpacingRule?: LineSpacingRule; /** Whether the paragraph participates in the section document grid (w:snapToGrid). */
156
+ snapToGrid?: boolean; /** Auto space before (w:spacing/@w:beforeAutospacing) */
156
157
  beforeAutospacing?: boolean; /** Auto space after (w:spacing/@w:afterAutospacing) */
157
158
  afterAutospacing?: boolean; /** Which spacing sides came from this paragraph's own pPr. */
158
159
  spacingExplicit?: SpacingExplicit; /** Left indent in twips (w:ind/@w:left) */
@@ -532,6 +533,10 @@ type SoftHyphenContent = {
532
533
  type NoBreakHyphenContent = {
533
534
  type: "noBreakHyphen";
534
535
  };
536
+ /** Cached pagination boundary emitted by a previous layout pass. */
537
+ type RenderedPageBreakContent = {
538
+ type: "renderedPageBreak";
539
+ };
535
540
  /**
536
541
  * Drawing/image reference
537
542
  */
@@ -550,7 +555,7 @@ type ShapeContent = {
550
555
  /**
551
556
  * All possible run content types
552
557
  */
553
- type RunContent = TextContent | TabContent | BreakContent | SymbolContent | NoteReferenceContent | FieldCharContent | InstrTextContent | SoftHyphenContent | NoBreakHyphenContent | DrawingContent | ShapeContent;
558
+ type RunContent = TextContent | TabContent | BreakContent | SymbolContent | NoteReferenceContent | FieldCharContent | InstrTextContent | SoftHyphenContent | NoBreakHyphenContent | RenderedPageBreakContent | DrawingContent | ShapeContent;
554
559
  /**
555
560
  * A run is a contiguous region of text with the same formatting
556
561
  */
@@ -789,8 +794,8 @@ type ShapeTextBody = {
789
794
  bottom?: number;
790
795
  left?: number;
791
796
  right?: number;
792
- }; /** Paragraphs inside the shape */
793
- content: Paragraph[];
797
+ }; /** Block content inside the shape */
798
+ content: (Paragraph | Table)[];
794
799
  };
795
800
  /**
796
801
  * Shape/drawing object (wps:wsp)
@@ -819,8 +824,8 @@ type TextBox = {
819
824
  position?: ImagePosition; /** Wrap settings */
820
825
  wrap?: ImageWrap; /** Fill */
821
826
  fill?: ShapeFill; /** Outline */
822
- outline?: ShapeOutline; /** Text content */
823
- content: Paragraph[]; /** Text fitting behavior */
827
+ outline?: ShapeOutline; /** Text and table content */
828
+ content: (Paragraph | Table)[]; /** Text fitting behavior */
824
829
  autoFit?: ShapeTextBody["autoFit"]; /** Internal margins */
825
830
  margins?: {
826
831
  top?: number;
@@ -902,6 +907,26 @@ type MathEquation = {
902
907
  ommlXml: string; /** Plain text representation for accessibility/fallback */
903
908
  plainText?: string;
904
909
  };
910
+ /**
911
+ * Largest value a revision id (`w:id`) may carry: 2^31 - 1.
912
+ *
913
+ * `w:id` on `<w:ins>`/`<w:del>` comes from `CT_Markup`, typed
914
+ * `ST_DecimalNumber` — which ECMA-376 defines as an unbounded integer. The
915
+ * bound below is an implementation limit: conforming consumers read
916
+ * `ST_DecimalNumber` into a signed 32-bit int, and a value past this bound
917
+ * overflows on load and surfaces as an unreadable document. Port of
918
+ * eigenpal/docx-editor#1093.
919
+ */
920
+ declare const MAX_REVISION_ID = 2147483647;
921
+ /**
922
+ * Coerce any revision id — including one parsed from an untrusted DOCX — into
923
+ * the range serialized `w:id` attributes may occupy.
924
+ *
925
+ * - Malformed (negative, fractional, `NaN`, `Infinity`): collapse to `0`.
926
+ * - Well-formed but out of range: fold modulo the range (not clamp) so a
927
+ * contiguous run of overflowing ids stays distinguishable.
928
+ */
929
+ declare function normalizeRevisionId(id: number): number;
905
930
  /**
906
931
  * Tracked change metadata (w:ins, w:del attributes)
907
932
  */
@@ -909,6 +934,11 @@ type TrackedChangeInfo = {
909
934
  /** Revision ID */id: number; /** Author who made the change */
910
935
  author: string; /** Date of the change */
911
936
  date?: string;
937
+ /**
938
+ * Author initials (w:initials). Optional attribution used by the review UI
939
+ * and carried through the round-trip when present on the source document.
940
+ */
941
+ initials?: string;
912
942
  };
913
943
  /**
914
944
  * Generic tracked property-change wrapper metadata (w:*PrChange)
@@ -1042,8 +1072,13 @@ type SectionPropertyChange = {
1042
1072
  * Table structural tracked change metadata (row/cell insert/delete/merge)
1043
1073
  */
1044
1074
  type TableStructuralChangeInfo = {
1045
- type: "tableRowInsertion" | "tableRowDeletion" | "tableCellInsertion" | "tableCellDeletion" | "tableCellMerge"; /** Tracked change metadata */
1075
+ type: "tableRowInsertion" | "tableRowDeletion" | "tableCellInsertion" | "tableCellDeletion"; /** Tracked change metadata */
1046
1076
  info: TrackedChangeInfo;
1077
+ } | {
1078
+ type: "tableCellMerge"; /** Tracked change metadata */
1079
+ info: TrackedChangeInfo; /** Vertical merge state applied by the revision. */
1080
+ verticalMerge?: "continue" | "rest"; /** Vertical merge state that existed before the revision. */
1081
+ verticalMergeOriginal?: "continue" | "rest";
1047
1082
  };
1048
1083
  /**
1049
1084
  * SDT type (content control type)
@@ -1116,14 +1151,14 @@ type SdtProperties = {
1116
1151
  * Inline SDT (content control within a paragraph).
1117
1152
  *
1118
1153
  * OOXML allows runs, hyperlinks, simple/complex fields, nested SDTs,
1119
- * tracked insertions/deletions, and math at this level. All of them must survive
1154
+ * tracked insertions/deletions/moves, and math at this level. All of them must survive
1120
1155
  * parse → edit → save so docProps-bound fields and reviewed template
1121
1156
  * content do not lose their wrapper on round-trip.
1122
1157
  */
1123
1158
  type InlineSdt = {
1124
1159
  type: "inlineSdt"; /** SDT properties */
1125
1160
  properties: SdtProperties; /** Inline content held inside the control */
1126
- content: (Run | Hyperlink | SimpleField | ComplexField | InlineSdt | Insertion | Deletion | MathEquation)[];
1161
+ content: (Run | Hyperlink | SimpleField | ComplexField | InlineSdt | Insertion | Deletion | MoveFrom | MoveTo | MathEquation)[];
1127
1162
  };
1128
1163
  /**
1129
1164
  * Block-level SDT (content control wrapping paragraphs/tables).
@@ -1621,6 +1656,11 @@ type MediaFile = {
1621
1656
  * Extend as more settings.xml fields enter the layout pipeline.
1622
1657
  */
1623
1658
  type DocumentSettings = {
1659
+ /**
1660
+ * Application compatibility generation from
1661
+ * `w:compat/w:compatSetting[@w:name="compatibilityMode"]`.
1662
+ */
1663
+ compatibilityMode?: number;
1624
1664
  /**
1625
1665
  * `w:defaultTabStop` (§17.6.13) — interval in twips between default
1626
1666
  * tab stops applied when a paragraph has no custom `w:tabs`. Word
@@ -1705,4 +1745,4 @@ type Document = {
1705
1745
  warnings?: string[];
1706
1746
  };
1707
1747
  //#endregion
1708
- export { ImageTransform as $, VerticalAlign as $t, ComplexField as A, BorderSpec as An, SectionStart as At, FooterReference as B, TabContent as Bt, BookmarkStart as C, TableLook as Cn, RunContent as Ct, CommentRangeEnd as D, TextEffect as Dn, Section as Dt, Comment as E, TableWidthType as En, SdtType as Et, EndnotePosition as F, ShapeTextBody as Ft, HeaderFooterType as G, TableRow as Gt, FootnotePosition as H, TableCell as Ht, EndnoteProperties as I, ShapeType as It, Image as J, TextBox as Jt, HeaderReference as K, TableRowPropertyChange as Kt, Field as L, SimpleField as Lt, DocumentBody as M, KnownBorderStyle as Mn, ShapeContent as Mt, DrawingContent as N, ShadingProperties as Nn, ShapeFill as Nt, CommentRangeStart as O, TextFormatting as On, SectionProperties as Ot, Endnote as P, ThemeColorSlot as Pn, ShapeOutline as Pt, ImageSize as Q, TrackedRunChange as Qt, FieldCharContent as R, SoftHyphenContent as Rt, BookmarkEnd as S, TableFormatting as Sn, Run as St, Column as T, TableRowFormatting as Tn, SdtProperties as Tt, FootnoteProperties as U, TableCellPropertyChange as Ut, Footnote as V, Table as Vt, HeaderFooter as W, TablePropertyChange as Wt, ImagePadding as X, TextWatermark as Xt, ImageCrop as Y, TextContent as Yt, ImagePosition as Z, TrackedChangeInfo as Zt, ThemeColorScheme as _, TabStop as _n, ParagraphContent as _t, DocxPackage as a, NumberFormat as an, MathEquation as at, BlockContent as b, TableCellBorders as bn, PictureWatermark as bt, FontTable as c, CellMargins as cn, MoveFromRangeStart as ct, RelationshipMap as d, FloatingTableProperties as dn, MoveToRangeStart as dt, Watermark as en, ImageWrap as et, RelationshipType as f, LineSpacingRule as fn, NoBreakHyphenContent as ft, Theme as g, TabLeader as gn, Paragraph as gt, StyleType as h, SpacingExplicit as hn, PageOrientation as ht, DocxConformanceClass as i, ListRendering as in, LineNumberRestart as it, Deletion as j, ColorValue as jn, Shape as jt, CommentReference as k, UnderlineStyle as kn, SectionPropertyChange as kt, MediaFile as l, ConditionalFormatStyle as ln, MoveTo as lt, StyleDefinitions as m, ParagraphFormatting as mn, NoteReferenceContent as mt, Document as n, LevelSuffix as nn, Insertion as nt, DocDefaults as o, NumberingDefinitions as on, MoveFrom as ot, Style as p, ParagraphAlignment as pn, NoteNumberRestart as pt, Hyperlink as q, TableStructuralChangeInfo as qt, DocumentSettings as r, ListLevel as rn, InstrTextContent as rt, FontInfo as s, NumberingInstance as sn, MoveFromRangeEnd as st, DOCX_CONFORMANCE_CLASSES as t, AbstractNumbering as tn, InlineSdt as tt, Relationship as u, EmphasisMark as un, MoveToRangeEnd as ut, ThemeFont as v, TabStopAlignment as vn, ParagraphMarkChange as vt, BreakContent as w, TableMeasurement as wn, RunPropertyChange as wt, BlockSdt as x, TableCellFormatting as xn, PropertyChangeInfo as xt, ThemeFontScheme as y, TableBorders as yn, ParagraphPropertyChange as yt, FieldType as z, SymbolContent as zt };
1748
+ export { ImageTransform as $, TrackedRunChange as $t, ComplexField as A, TextFormatting as An, SectionPropertyChange as At, FooterReference as B, SymbolContent as Bt, BookmarkStart as C, TableCellFormatting as Cn, Run as Ct, CommentRangeEnd as D, TableRowFormatting as Dn, SdtType as Dt, Comment as E, TableMeasurement as En, SdtProperties as Et, EndnotePosition as F, ShadingProperties as Fn, ShapeOutline as Ft, HeaderFooterType as G, TablePropertyChange as Gt, FootnotePosition as H, Table as Ht, EndnoteProperties as I, ThemeColorSlot as In, ShapeTextBody as It, Image as J, TableStructuralChangeInfo as Jt, HeaderReference as K, TableRow as Kt, Field as L, ShapeType as Lt, DocumentBody as M, BorderSpec as Mn, Shape as Mt, DrawingContent as N, ColorValue as Nn, ShapeContent as Nt, CommentRangeStart as O, TableWidthType as On, Section as Ot, Endnote as P, KnownBorderStyle as Pn, ShapeFill as Pt, ImageSize as Q, TrackedChangeInfo as Qt, FieldCharContent as R, SimpleField as Rt, BookmarkEnd as S, TableCellBorders as Sn, PropertyChangeInfo as St, Column as T, TableLook as Tn, RunPropertyChange as Tt, FootnoteProperties as U, TableCell as Ut, Footnote as V, TabContent as Vt, HeaderFooter as W, TableCellPropertyChange as Wt, ImagePadding as X, TextContent as Xt, ImageCrop as Y, TextBox as Yt, ImagePosition as Z, TextWatermark as Zt, ThemeColorScheme as _, SpacingExplicit as _n, Paragraph as _t, DocxPackage as a, ListLevel as an, MAX_REVISION_ID as at, BlockContent as b, TabStopAlignment as bn, ParagraphPropertyChange as bt, FontTable as c, NumberingDefinitions as cn, MoveFromRangeEnd as ct, RelationshipMap as d, ConditionalFormatStyle as dn, MoveToRangeEnd as dt, VerticalAlign as en, ImageWrap as et, RelationshipType as f, EmphasisMark as fn, MoveToRangeStart as ft, Theme as g, ParagraphFormatting as gn, PageOrientation as gt, StyleType as h, ParagraphAlignment as hn, NoteReferenceContent as ht, DocxConformanceClass as i, LevelSuffix as in, LineNumberRestart as it, Deletion as j, UnderlineStyle as jn, SectionStart as jt, CommentReference as k, TextEffect as kn, SectionProperties as kt, MediaFile as l, NumberingInstance as ln, MoveFromRangeStart as lt, StyleDefinitions as m, LineSpacingRule as mn, NoteNumberRestart as mt, Document as n, normalizeRevisionId as nn, Insertion as nt, DocDefaults as o, ListRendering as on, MathEquation as ot, Style as p, FloatingTableProperties as pn, NoBreakHyphenContent as pt, Hyperlink as q, TableRowPropertyChange as qt, DocumentSettings as r, AbstractNumbering as rn, InstrTextContent as rt, FontInfo as s, NumberFormat as sn, MoveFrom as st, DOCX_CONFORMANCE_CLASSES as t, Watermark as tn, InlineSdt as tt, Relationship as u, CellMargins as un, MoveTo as ut, ThemeFont as v, TabLeader as vn, ParagraphContent as vt, BreakContent as w, TableFormatting as wn, RunContent as wt, BlockSdt as x, TableBorders as xn, PictureWatermark as xt, ThemeFontScheme as y, TabStop as yn, ParagraphMarkChange as yt, FieldType as z, SoftHyphenContent as zt };
@@ -0,0 +1,35 @@
1
+ //#region src/model/content.ts
2
+ /**
3
+ * Largest value a revision id (`w:id`) may carry: 2^31 - 1.
4
+ *
5
+ * `w:id` on `<w:ins>`/`<w:del>` comes from `CT_Markup`, typed
6
+ * `ST_DecimalNumber` — which ECMA-376 defines as an unbounded integer. The
7
+ * bound below is an implementation limit: conforming consumers read
8
+ * `ST_DecimalNumber` into a signed 32-bit int, and a value past this bound
9
+ * overflows on load and surfaces as an unreadable document. Port of
10
+ * eigenpal/docx-editor#1093.
11
+ */
12
+ const MAX_REVISION_ID = 2147483647;
13
+ /**
14
+ * Coerce any revision id — including one parsed from an untrusted DOCX — into
15
+ * the range serialized `w:id` attributes may occupy.
16
+ *
17
+ * - Malformed (negative, fractional, `NaN`, `Infinity`): collapse to `0`.
18
+ * - Well-formed but out of range: fold modulo the range (not clamp) so a
19
+ * contiguous run of overflowing ids stays distinguishable.
20
+ */
21
+ function normalizeRevisionId(id) {
22
+ if (!Number.isInteger(id) || id < 0) return 0;
23
+ if (id > 2147483647) return id % 2147483648;
24
+ return id;
25
+ }
26
+ //#endregion
27
+ //#region src/model/document.ts
28
+ /** DOCX package conformance classes. */
29
+ const DOCX_CONFORMANCE_CLASSES = Object.freeze({
30
+ STRICT: "strict",
31
+ TRANSITIONAL: "transitional",
32
+ UNKNOWN: "unknown"
33
+ });
34
+ //#endregion
35
+ export { MAX_REVISION_ID as n, normalizeRevisionId as r, DOCX_CONFORMANCE_CLASSES as t };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Ct as RunContent, Gt as TableRow, Ht as TableCell, M as DocumentBody, Ot as SectionProperties, St as Run, Vt as Table, Yt as TextContent, _t as ParagraphContent, a as DocxPackage, b as BlockContent, gt as Paragraph, i as DocxConformanceClass, n as Document, p as Style, t as DOCX_CONFORMANCE_CLASSES, w as BreakContent } from "./document-Qbe-wA-j.js";
1
+ import { Ct as Run, Ht as Table, Kt as TableRow, M as DocumentBody, Ut as TableCell, Xt as TextContent, _t as Paragraph, a as DocxPackage, b as BlockContent, i as DocxConformanceClass, kt as SectionProperties, n as Document, p as Style, t as DOCX_CONFORMANCE_CLASSES, vt as ParagraphContent, w as BreakContent, wt as RunContent } from "./document-BeYAaXPa.js";
2
2
 
3
3
  //#region src/legal-source/types.d.ts
4
4
  type LegalDocumentKind = "agreement" | "letter" | "memo" | "checklist" | "pleading" | "other";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { DOCX_CONFORMANCE_CLASSES } from "./model/document.js";
1
+ import { t as DOCX_CONFORMANCE_CLASSES } from "./document-D4XHQQIj.js";
2
2
  import JSZip from "jszip";
3
3
  import { panic } from "better-result";
4
4
  //#region src/serialize/xml.ts
@@ -184,6 +184,7 @@ const serializeRunContent = (content) => {
184
184
  case "text": return `<w:t${content.preserveSpace ? " xml:space=\"preserve\"" : ""}>${escapeXml(content.text)}</w:t>`;
185
185
  case "tab": return "<w:tab/>";
186
186
  case "break": return `<w:br${attr("w:type", content.breakType)}/>`;
187
+ case "renderedPageBreak": return "<w:lastRenderedPageBreak/>";
187
188
  case "symbol": return `<w:sym w:font="${escapeXml(content.font)}" w:char="${escapeXml(content.char)}"/>`;
188
189
  case "footnoteRef": return `<w:footnoteReference w:id="${content.id}"/>`;
189
190
  case "endnoteRef": return `<w:endnoteReference w:id="${content.id}"/>`;
@@ -319,9 +320,50 @@ const serializeCoreProperties = (document) => {
319
320
  };
320
321
  //#endregion
321
322
  //#region src/validate/docx.ts
323
+ /**
324
+ * Local bounds on the ZIP archive `validateDocxPackage` inflates parts from.
325
+ * `docx-core` has no dependency on `@stll/folio-core`, so these mirror the
326
+ * shape of `packages/core/src/docx/server/boundedArchive.ts` rather than
327
+ * importing it: an untrusted or generator-produced buffer must be rejected
328
+ * for entry count and declared uncompressed size before `document.xml` /
329
+ * `document.xml.rels` are inflated, so a decompression-bomb entry or an
330
+ * archive with an excessive part count can't force an unbounded allocation.
331
+ */
332
+ const VALIDATE_DOCX_MAX_ENTRIES = 4096;
333
+ const VALIDATE_DOCX_MAX_ENTRY_BYTES = 128 * 1024 * 1024;
334
+ const VALIDATE_DOCX_MAX_TOTAL_BYTES = 256 * 1024 * 1024;
335
+ const getDeclaredUncompressedSize = (file) => {
336
+ const metadata = file._data;
337
+ return typeof metadata?.uncompressedSize === "number" ? metadata.uncompressedSize : null;
338
+ };
339
+ /**
340
+ * Reject an archive whose entry count or declared uncompressed size (total
341
+ * or per-entry) exceeds the local bounds above, before any part is inflated.
342
+ * A declared size JSZip could not determine is skipped rather than treated
343
+ * as unbounded — the per-entry cap below still bounds what an inflate call
344
+ * can actually produce once it runs.
345
+ */
346
+ const checkDocxArchiveBounds = (zip) => {
347
+ const entries = Object.values(zip.files);
348
+ if (entries.length > VALIDATE_DOCX_MAX_ENTRIES) return `Generated DOCX declares ${entries.length} archive entries, over the ${VALIDATE_DOCX_MAX_ENTRIES}-entry limit.`;
349
+ let totalUncompressedBytes = 0;
350
+ for (const entry of entries) {
351
+ const declaredBytes = getDeclaredUncompressedSize(entry);
352
+ if (declaredBytes === null) continue;
353
+ if (declaredBytes > VALIDATE_DOCX_MAX_ENTRY_BYTES) return `Generated DOCX entry "${entry.name}" declares ${declaredBytes} uncompressed bytes, over the ${VALIDATE_DOCX_MAX_ENTRY_BYTES}-byte limit.`;
354
+ totalUncompressedBytes += declaredBytes;
355
+ if (totalUncompressedBytes > VALIDATE_DOCX_MAX_TOTAL_BYTES) return `Generated DOCX declares more than ${VALIDATE_DOCX_MAX_TOTAL_BYTES} cumulative uncompressed bytes.`;
356
+ }
357
+ return null;
358
+ };
322
359
  const validateDocxPackage = async (buffer) => {
323
360
  try {
324
361
  const zip = await JSZip.loadAsync(buffer);
362
+ const boundsError = checkDocxArchiveBounds(zip);
363
+ if (boundsError) return {
364
+ valid: false,
365
+ error: boundsError
366
+ };
325
367
  for (const requiredPath of [
326
368
  "[Content_Types].xml",
327
369
  "_rels/.rels",
@@ -590,7 +632,7 @@ const validateImage = (image, path, ctx, options = {}) => {
590
632
  const validateShape = (shape, path, ctx) => {
591
633
  validateNonNegativeSize(shape.size.width, `${path}.size.width`, ctx);
592
634
  validateNonNegativeSize(shape.size.height, `${path}.size.height`, ctx);
593
- if (shape.textBody) validateParagraphs(shape.textBody.content, `${path}.textBody.content`, ctx);
635
+ if (shape.textBody) validateBlocks(shape.textBody.content, `${path}.textBody.content`, ctx);
594
636
  };
595
637
  const validateNonNegativeSize = (value, path, ctx) => {
596
638
  if (value < 0) {
@@ -649,7 +691,7 @@ const validateComments = (comments, ctx) => {
649
691
  const path = `package.document.comments[${index}]`;
650
692
  if (seen.has(comment.id)) addError(ctx, `${path}.id`, `Duplicate comment id ${comment.id}.`);
651
693
  seen.add(comment.id);
652
- if (comment.author.trim() === "") addError(ctx, `${path}.author`, "Comment author is empty.");
694
+ if (comment.author !== "" && comment.author.trim() === "") addError(ctx, `${path}.author`, "Comment author cannot be whitespace-only.");
653
695
  if (comment.parentId !== void 0 && !ctx.commentIds.has(comment.parentId)) addError(ctx, `${path}.parentId`, `Parent comment ${comment.parentId} is missing.`);
654
696
  validateParagraphs(comment.content, `${path}.content`, ctx);
655
697
  }
@@ -1,2 +1,2 @@
1
- import { $ as ImageTransform, $t as VerticalAlign, A as ComplexField, An as BorderSpec, At as SectionStart, B as FooterReference, Bt as TabContent, C as BookmarkStart, Cn as TableLook, Ct as RunContent, D as CommentRangeEnd, Dn as TextEffect, Dt as Section, E as Comment, En as TableWidthType, Et as SdtType, F as EndnotePosition, Ft as ShapeTextBody, G as HeaderFooterType, Gt as TableRow, H as FootnotePosition, Ht as TableCell, I as EndnoteProperties, It as ShapeType, J as Image, Jt as TextBox, K as HeaderReference, Kt as TableRowPropertyChange, L as Field, Lt as SimpleField, M as DocumentBody, Mn as KnownBorderStyle, Mt as ShapeContent, N as DrawingContent, Nn as ShadingProperties, Nt as ShapeFill, O as CommentRangeStart, On as TextFormatting, Ot as SectionProperties, P as Endnote, Pn as ThemeColorSlot, Pt as ShapeOutline, Q as ImageSize, Qt as TrackedRunChange, R as FieldCharContent, Rt as SoftHyphenContent, S as BookmarkEnd, Sn as TableFormatting, St as Run, T as Column, Tn as TableRowFormatting, Tt as SdtProperties, U as FootnoteProperties, Ut as TableCellPropertyChange, V as Footnote, Vt as Table, W as HeaderFooter, Wt as TablePropertyChange, X as ImagePadding, Xt as TextWatermark, Y as ImageCrop, Yt as TextContent, Z as ImagePosition, Zt as TrackedChangeInfo, _ as ThemeColorScheme, _n as TabStop, _t as ParagraphContent, a as DocxPackage, an as NumberFormat, at as MathEquation, b as BlockContent, bn as TableCellBorders, bt as PictureWatermark, c as FontTable, cn as CellMargins, ct as MoveFromRangeStart, d as RelationshipMap, dn as FloatingTableProperties, dt as MoveToRangeStart, en as Watermark, et as ImageWrap, f as RelationshipType, fn as LineSpacingRule, ft as NoBreakHyphenContent, g as Theme, gn as TabLeader, gt as Paragraph, h as StyleType, hn as SpacingExplicit, ht as PageOrientation, i as DocxConformanceClass, in as ListRendering, it as LineNumberRestart, j as Deletion, jn as ColorValue, jt as Shape, k as CommentReference, kn as UnderlineStyle, kt as SectionPropertyChange, l as MediaFile, ln as ConditionalFormatStyle, lt as MoveTo, m as StyleDefinitions, mn as ParagraphFormatting, mt as NoteReferenceContent, n as Document, nn as LevelSuffix, nt as Insertion, o as DocDefaults, on as NumberingDefinitions, ot as MoveFrom, p as Style, pn as ParagraphAlignment, pt as NoteNumberRestart, q as Hyperlink, qt as TableStructuralChangeInfo, r as DocumentSettings, rn as ListLevel, rt as InstrTextContent, s as FontInfo, sn as NumberingInstance, st as MoveFromRangeEnd, t as DOCX_CONFORMANCE_CLASSES, tn as AbstractNumbering, tt as InlineSdt, u as Relationship, un as EmphasisMark, ut as MoveToRangeEnd, v as ThemeFont, vn as TabStopAlignment, vt as ParagraphMarkChange, w as BreakContent, wn as TableMeasurement, wt as RunPropertyChange, x as BlockSdt, xn as TableCellFormatting, xt as PropertyChangeInfo, y as ThemeFontScheme, yn as TableBorders, yt as ParagraphPropertyChange, z as FieldType, zt as SymbolContent } from "../document-Qbe-wA-j.js";
2
- export { type AbstractNumbering, type BlockContent, type BlockSdt, type BookmarkEnd, type BookmarkStart, type BorderSpec, type BreakContent, type CellMargins, type ColorValue, type Column, type Comment, type CommentRangeEnd, type CommentRangeStart, type CommentReference, type ComplexField, type ConditionalFormatStyle, DOCX_CONFORMANCE_CLASSES, type Deletion, type DocDefaults, Document, type DocumentBody, DocumentSettings, DocxConformanceClass, DocxPackage, type DrawingContent, type EmphasisMark, type Endnote, type EndnotePosition, type EndnoteProperties, type Field, type FieldCharContent, type FieldType, type FloatingTableProperties, type FontInfo, type FontTable, type FooterReference, type Footnote, type FootnotePosition, type FootnoteProperties, type HeaderFooter, type HeaderFooterType, type HeaderReference, type Hyperlink, type Image, type ImageCrop, type ImagePadding, type ImagePosition, type ImageSize, type ImageTransform, type ImageWrap, type InlineSdt, type Insertion, type InstrTextContent, type KnownBorderStyle, type LevelSuffix, type LineNumberRestart, type LineSpacingRule, type ListLevel, type ListRendering, type MathEquation, type MediaFile, type MoveFrom, type MoveFromRangeEnd, type MoveFromRangeStart, type MoveTo, type MoveToRangeEnd, type MoveToRangeStart, type NoBreakHyphenContent, type NoteNumberRestart, type NoteReferenceContent, type NumberFormat, type NumberingDefinitions, type NumberingInstance, type PageOrientation, type Paragraph, type ParagraphAlignment, type ParagraphContent, type ParagraphFormatting, type ParagraphMarkChange, type ParagraphPropertyChange, type PictureWatermark, type PropertyChangeInfo, type Relationship, type RelationshipMap, type RelationshipType, type Run, type RunContent, type RunPropertyChange, type SdtProperties, type SdtType, type Section, type SectionProperties, type SectionPropertyChange, type SectionStart, type ShadingProperties, type Shape, type ShapeContent, type ShapeFill, type ShapeOutline, type ShapeTextBody, type ShapeType, type SimpleField, type SoftHyphenContent, type SpacingExplicit, type Style, type StyleDefinitions, type StyleType, type SymbolContent, type TabContent, type TabLeader, type TabStop, type TabStopAlignment, type Table, type TableBorders, type TableCell, type TableCellBorders, type TableCellFormatting, type TableCellPropertyChange, type TableFormatting, type TableLook, type TableMeasurement, type TablePropertyChange, type TableRow, type TableRowFormatting, type TableRowPropertyChange, type TableStructuralChangeInfo, type TableWidthType, type TextBox, type TextContent, type TextEffect, type TextFormatting, type TextWatermark, type Theme, type ThemeColorScheme, type ThemeColorSlot, type ThemeFont, type ThemeFontScheme, type TrackedChangeInfo, type TrackedRunChange, type UnderlineStyle, type VerticalAlign, type Watermark };
1
+ import { $ as ImageTransform, $t as TrackedRunChange, A as ComplexField, An as TextFormatting, At as SectionPropertyChange, B as FooterReference, Bt as SymbolContent, C as BookmarkStart, Cn as TableCellFormatting, Ct as Run, D as CommentRangeEnd, Dn as TableRowFormatting, Dt as SdtType, E as Comment, En as TableMeasurement, Et as SdtProperties, F as EndnotePosition, Fn as ShadingProperties, Ft as ShapeOutline, G as HeaderFooterType, Gt as TablePropertyChange, H as FootnotePosition, Ht as Table, I as EndnoteProperties, In as ThemeColorSlot, It as ShapeTextBody, J as Image, Jt as TableStructuralChangeInfo, K as HeaderReference, Kt as TableRow, L as Field, Lt as ShapeType, M as DocumentBody, Mn as BorderSpec, Mt as Shape, N as DrawingContent, Nn as ColorValue, Nt as ShapeContent, O as CommentRangeStart, On as TableWidthType, Ot as Section, P as Endnote, Pn as KnownBorderStyle, Pt as ShapeFill, Q as ImageSize, Qt as TrackedChangeInfo, R as FieldCharContent, Rt as SimpleField, S as BookmarkEnd, Sn as TableCellBorders, St as PropertyChangeInfo, T as Column, Tn as TableLook, Tt as RunPropertyChange, U as FootnoteProperties, Ut as TableCell, V as Footnote, Vt as TabContent, W as HeaderFooter, Wt as TableCellPropertyChange, X as ImagePadding, Xt as TextContent, Y as ImageCrop, Yt as TextBox, Z as ImagePosition, Zt as TextWatermark, _ as ThemeColorScheme, _n as SpacingExplicit, _t as Paragraph, a as DocxPackage, an as ListLevel, at as MAX_REVISION_ID, b as BlockContent, bn as TabStopAlignment, bt as ParagraphPropertyChange, c as FontTable, cn as NumberingDefinitions, ct as MoveFromRangeEnd, d as RelationshipMap, dn as ConditionalFormatStyle, dt as MoveToRangeEnd, en as VerticalAlign, et as ImageWrap, f as RelationshipType, fn as EmphasisMark, ft as MoveToRangeStart, g as Theme, gn as ParagraphFormatting, gt as PageOrientation, h as StyleType, hn as ParagraphAlignment, ht as NoteReferenceContent, i as DocxConformanceClass, in as LevelSuffix, it as LineNumberRestart, j as Deletion, jn as UnderlineStyle, jt as SectionStart, k as CommentReference, kn as TextEffect, kt as SectionProperties, l as MediaFile, ln as NumberingInstance, lt as MoveFromRangeStart, m as StyleDefinitions, mn as LineSpacingRule, mt as NoteNumberRestart, n as Document, nn as normalizeRevisionId, nt as Insertion, o as DocDefaults, on as ListRendering, ot as MathEquation, p as Style, pn as FloatingTableProperties, pt as NoBreakHyphenContent, q as Hyperlink, qt as TableRowPropertyChange, r as DocumentSettings, rn as AbstractNumbering, rt as InstrTextContent, s as FontInfo, sn as NumberFormat, st as MoveFrom, t as DOCX_CONFORMANCE_CLASSES, tn as Watermark, tt as InlineSdt, u as Relationship, un as CellMargins, ut as MoveTo, v as ThemeFont, vn as TabLeader, vt as ParagraphContent, w as BreakContent, wn as TableFormatting, wt as RunContent, x as BlockSdt, xn as TableBorders, xt as PictureWatermark, y as ThemeFontScheme, yn as TabStop, yt as ParagraphMarkChange, z as FieldType, zt as SoftHyphenContent } from "../document-BeYAaXPa.js";
2
+ export { type AbstractNumbering, type BlockContent, type BlockSdt, type BookmarkEnd, type BookmarkStart, type BorderSpec, type BreakContent, type CellMargins, type ColorValue, type Column, type Comment, type CommentRangeEnd, type CommentRangeStart, type CommentReference, type ComplexField, type ConditionalFormatStyle, DOCX_CONFORMANCE_CLASSES, type Deletion, type DocDefaults, Document, type DocumentBody, DocumentSettings, DocxConformanceClass, DocxPackage, type DrawingContent, type EmphasisMark, type Endnote, type EndnotePosition, type EndnoteProperties, type Field, type FieldCharContent, type FieldType, type FloatingTableProperties, type FontInfo, type FontTable, type FooterReference, type Footnote, type FootnotePosition, type FootnoteProperties, type HeaderFooter, type HeaderFooterType, type HeaderReference, type Hyperlink, type Image, type ImageCrop, type ImagePadding, type ImagePosition, type ImageSize, type ImageTransform, type ImageWrap, type InlineSdt, type Insertion, type InstrTextContent, type KnownBorderStyle, type LevelSuffix, type LineNumberRestart, type LineSpacingRule, type ListLevel, type ListRendering, MAX_REVISION_ID, type MathEquation, type MediaFile, type MoveFrom, type MoveFromRangeEnd, type MoveFromRangeStart, type MoveTo, type MoveToRangeEnd, type MoveToRangeStart, type NoBreakHyphenContent, type NoteNumberRestart, type NoteReferenceContent, type NumberFormat, type NumberingDefinitions, type NumberingInstance, type PageOrientation, type Paragraph, type ParagraphAlignment, type ParagraphContent, type ParagraphFormatting, type ParagraphMarkChange, type ParagraphPropertyChange, type PictureWatermark, type PropertyChangeInfo, type Relationship, type RelationshipMap, type RelationshipType, type Run, type RunContent, type RunPropertyChange, type SdtProperties, type SdtType, type Section, type SectionProperties, type SectionPropertyChange, type SectionStart, type ShadingProperties, type Shape, type ShapeContent, type ShapeFill, type ShapeOutline, type ShapeTextBody, type ShapeType, type SimpleField, type SoftHyphenContent, type SpacingExplicit, type Style, type StyleDefinitions, type StyleType, type SymbolContent, type TabContent, type TabLeader, type TabStop, type TabStopAlignment, type Table, type TableBorders, type TableCell, type TableCellBorders, type TableCellFormatting, type TableCellPropertyChange, type TableFormatting, type TableLook, type TableMeasurement, type TablePropertyChange, type TableRow, type TableRowFormatting, type TableRowPropertyChange, type TableStructuralChangeInfo, type TableWidthType, type TextBox, type TextContent, type TextEffect, type TextFormatting, type TextWatermark, type Theme, type ThemeColorScheme, type ThemeColorSlot, type ThemeFont, type ThemeFontScheme, type TrackedChangeInfo, type TrackedRunChange, type UnderlineStyle, type VerticalAlign, type Watermark, normalizeRevisionId };
@@ -1,9 +1,2 @@
1
- //#region src/model/document.ts
2
- /** DOCX package conformance classes. */
3
- const DOCX_CONFORMANCE_CLASSES = Object.freeze({
4
- STRICT: "strict",
5
- TRANSITIONAL: "transitional",
6
- UNKNOWN: "unknown"
7
- });
8
- //#endregion
9
- export { DOCX_CONFORMANCE_CLASSES };
1
+ import { n as MAX_REVISION_ID, r as normalizeRevisionId, t as DOCX_CONFORMANCE_CLASSES } from "../document-D4XHQQIj.js";
2
+ export { DOCX_CONFORMANCE_CLASSES, MAX_REVISION_ID, normalizeRevisionId };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stll/docx-core",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "Typed OOXML/DOCX document model with parsing, validation, and serialization, plus a legal-source compiler that produces DOCX packages.",
5
5
  "keywords": [
6
6
  "document-model",