@stll/docx-core 0.20.2 → 0.21.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/dist/{document-Dqed2Ilk.d.ts → document-Bu82QPAC.d.ts} +27 -1
- package/dist/{document-pvrjtG29.js → document-D6wZrAko.js} +5 -1
- package/dist/docx_kernel_bg.wasm +0 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/model/document.d.ts +2 -2
- package/dist/model/document.js +1 -1
- package/package.json +1 -1
|
@@ -802,6 +802,8 @@ type RenderedPageBreakContent = {
|
|
|
802
802
|
/** Raw XML handling modes for drawings that Folio cannot model completely. */
|
|
803
803
|
declare const DRAWING_RAW_XML_MODES: {
|
|
804
804
|
readonly PRESERVE_ONLY: "preserveOnly";
|
|
805
|
+
/** The modeled image is a rendered preview of richer markup, so regeneration cannot reproduce the drawing. */
|
|
806
|
+
readonly PREVIEW_ONLY: "previewOnly";
|
|
805
807
|
};
|
|
806
808
|
/** Raw XML handling mode for a drawing. */
|
|
807
809
|
type DrawingRawXmlMode = (typeof DRAWING_RAW_XML_MODES)[keyof typeof DRAWING_RAW_XML_MODES];
|
|
@@ -823,6 +825,15 @@ type DrawingContent = {
|
|
|
823
825
|
rawXml: string;
|
|
824
826
|
/** Explicitly classifies raw XML that has no editable projected representation. */
|
|
825
827
|
rawXmlMode: typeof DRAWING_RAW_XML_MODES.PRESERVE_ONLY;
|
|
828
|
+
} | {
|
|
829
|
+
type: "drawing";
|
|
830
|
+
/** A render of `rawXml`, not a projection of it: editing it cannot describe the drawing. */
|
|
831
|
+
image: Image;
|
|
832
|
+
/** Original OOXML, the only faithful representation of the drawing. */
|
|
833
|
+
rawXml: string;
|
|
834
|
+
/** Required: a stale fingerprint is what marks the preview unsaveable rather than regenerable. */
|
|
835
|
+
rawImageFingerprint: string;
|
|
836
|
+
rawXmlMode: typeof DRAWING_RAW_XML_MODES.PREVIEW_ONLY;
|
|
826
837
|
};
|
|
827
838
|
/**
|
|
828
839
|
* Shape reference
|
|
@@ -1009,6 +1020,19 @@ type ImageCrop = {
|
|
|
1009
1020
|
right?: number;
|
|
1010
1021
|
bottom?: number;
|
|
1011
1022
|
};
|
|
1023
|
+
/**
|
|
1024
|
+
* `a:graphicFrameLocks` manipulation locks (ECMA-376 §20.1.2.2.19), in schema
|
|
1025
|
+
* attribute order. A field is undefined when the authored XML omits the
|
|
1026
|
+
* attribute, so a round-trip never materializes a lock the author never wrote.
|
|
1027
|
+
*/
|
|
1028
|
+
type ImageFrameLocks = {
|
|
1029
|
+
noGrp?: boolean;
|
|
1030
|
+
noDrilldown?: boolean;
|
|
1031
|
+
noSelect?: boolean;
|
|
1032
|
+
noChangeAspect?: boolean;
|
|
1033
|
+
noMove?: boolean;
|
|
1034
|
+
noResize?: boolean;
|
|
1035
|
+
};
|
|
1012
1036
|
/**
|
|
1013
1037
|
* Embedded image (w:drawing)
|
|
1014
1038
|
*/
|
|
@@ -1044,6 +1068,8 @@ type Image = {
|
|
|
1044
1068
|
padding?: ImagePadding;
|
|
1045
1069
|
/** Source-bitmap crop (wp:srcRect), eigenpal #424 */
|
|
1046
1070
|
crop?: ImageCrop;
|
|
1071
|
+
/** `wp:cNvGraphicFramePr > a:graphicFrameLocks`: authored manipulation locks. */
|
|
1072
|
+
frameLocks?: ImageFrameLocks;
|
|
1047
1073
|
/**
|
|
1048
1074
|
* Opacity in [0, 1] (OOXML `a:alphaModFix amt`). Undefined or `1` means
|
|
1049
1075
|
* fully opaque. Mirrors eigenpal docx-editor #424.
|
|
@@ -2438,4 +2464,4 @@ type Document = {
|
|
|
2438
2464
|
warnings?: string[];
|
|
2439
2465
|
};
|
|
2440
2466
|
//#endregion
|
|
2441
|
-
export {
|
|
2467
|
+
export { ImagePadding as $, TableCellPropertyChange as $t, ComplexField as A, TabLeader as An, ReviewCarrier as At, FieldCharContent as B, TableWidthType as Bn, Shape as Bt, BookmarkStart as C, ConditionalFormatStyle as Cn, ParagraphMarkChange as Ct, CommentRangeEnd as D, ParagraphAlignment as Dn, PositionalTab as Dt, Comment as E, LineSpacingRule as En, PictureWatermark as Et, DrawingRawXmlMode as F, TableCellFormatting as Fn, SdtType as Ft, FootnoteProperties as G, ColorValue as Gn, ShapeTextBody as Gt, FooterReference as H, TextFormatting as Hn, ShapeFill as Ht, Endnote as I, TableFormatting as In, Section as It, HeaderReference as J, ThemeColorSlot as Jn, SoftHyphenContent as Jt, HeaderFooter as K, KnownBorderStyle as Kn, ShapeType as Kt, EndnotePosition as L, TableLook as Ln, SectionProperties as Lt, Deletion as M, TabStopAlignment as Mn, RunContent as Mt, DocumentBody as N, TableBorders as Nn, RunPropertyChange as Nt, CommentRangeStart as O, ParagraphFormatting as On, PropertyChangeInfo as Ot, DrawingContent as P, TableCellBorders as Pn, SdtProperties as Pt, ImageFrameLocks as Q, TableCell as Qt, EndnoteProperties as R, TableMeasurement as Rn, SectionPropertyChange as Rt, BookmarkEnd as S, CellMargins as Sn, ParagraphContent as St, Column as T, FloatingTableProperties as Tn, ParagraphPropertyChange as Tt, Footnote as U, UnderlineStyle as Un, ShapeGeometryAdjustment as Ut, FieldType as V, TextEffect as Vn, ShapeContent as Vt, FootnotePosition as W, BorderSpec as Wn, ShapeOutline as Wt, Image as X, TabContent as Xt, Hyperlink as Y, SymbolContent as Yt, ImageCrop as Z, Table as Zt, ThemeColorScheme as _, ListMarkerFormatting as _n, NoteNumberRestart as _t, DocxPackage as a, TextContent as an, Insertion as at, BlockContent as b, NumberingDefinitions as bn, PageOrientation as bt, FontTable as c, TrackedRunChange as cn, MAX_REVISION_ID as ct, RelationshipMap as d, Watermark as dn, MoveFromRangeEnd as dt, TablePropertyChange as en, ImagePosition as et, RelationshipType as f, isOoxmlSymbolCharacter as fn, MoveFromRangeStart as ft, Theme as g, ListLevel as gn, NoBreakHyphenContent as gt, StyleType as h, LevelSuffix as hn, MoveToRangeStart as ht, DocxConformanceClass as i, TextBox as in, InlineSdt as it, DRAWING_RAW_XML_MODES as j, TabStop as jn, Run as jt, CommentReference as k, SpacingExplicit as kn, REVIEW_CARRIERS as kt, MediaFile as l, TrackedRunContent as ln, MathEquation as lt, StyleDefinitions as m, AbstractNumbering as mn, MoveToRangeEnd as mt, Document as n, TableRowPropertyChange as nn, ImageTransform as nt, DocDefaults as o, TextWatermark as on, InstrTextContent as ot, Style as p, normalizeRevisionId as pn, MoveTo as pt, HeaderFooterType as q, ShadingProperties as qn, SimpleField as qt, DocumentSettings as r, TableStructuralChangeInfo as rn, ImageWrap as rt, FontInfo as s, TrackedChangeInfo as sn, LineNumberRestart as st, DOCX_CONFORMANCE_CLASSES as t, TableRow as tn, ImageSize as tt, Relationship as u, VerticalAlign as un, MoveFrom as ut, ThemeFont as v, ListRendering as vn, NoteReferenceContent as vt, BreakContent as w, EmphasisMark as wn, ParagraphMarkChangeKind as wt, BlockSdt as x, NumberingInstance as xn, Paragraph as xt, ThemeFontScheme as y, NumberFormat as yn, PARAGRAPH_MARK_CHANGE_KINDS as yt, Field as z, TableRowFormatting as zn, SectionStart as zt };
|
|
@@ -3,7 +3,11 @@ const OOXML_SYMBOL_CHARACTER_PATTERN = /^[\dA-Fa-f]{4}$/u;
|
|
|
3
3
|
/** Whether a symbol character is exactly four hexadecimal digits. */
|
|
4
4
|
const isOoxmlSymbolCharacter = (value) => OOXML_SYMBOL_CHARACTER_PATTERN.test(value);
|
|
5
5
|
/** Raw XML handling modes for drawings that Folio cannot model completely. */
|
|
6
|
-
const DRAWING_RAW_XML_MODES = {
|
|
6
|
+
const DRAWING_RAW_XML_MODES = {
|
|
7
|
+
PRESERVE_ONLY: "preserveOnly",
|
|
8
|
+
/** The modeled image is a rendered preview of richer markup, so regeneration cannot reproduce the drawing. */
|
|
9
|
+
PREVIEW_ONLY: "previewOnly"
|
|
10
|
+
};
|
|
7
11
|
/**
|
|
8
12
|
* Largest value a revision id (`w:id`) may carry: 2^31 - 1.
|
|
9
13
|
*
|
package/dist/docx_kernel_bg.wasm
CHANGED
|
Binary file
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Dt as PositionalTab, Lt as SectionProperties, Mt as RunContent, N as DocumentBody, Qt as TableCell, St as ParagraphContent, Zt as Table, a as DocxPackage, an as TextContent, b as BlockContent, bn as NumberingDefinitions, i as DocxConformanceClass, jt as Run, n as Document, p as Style, t as DOCX_CONFORMANCE_CLASSES, tn as TableRow, w as BreakContent, xt as Paragraph } from "./document-Bu82QPAC.js";
|
|
2
2
|
import { Buffer } from "node:buffer";
|
|
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 { o as isOoxmlSymbolCharacter, t as DOCX_CONFORMANCE_CLASSES } from "./document-
|
|
1
|
+
import { o as isOoxmlSymbolCharacter, t as DOCX_CONFORMANCE_CLASSES } from "./document-D6wZrAko.js";
|
|
2
2
|
import JSZip from "jszip";
|
|
3
3
|
import { panic } from "better-result";
|
|
4
4
|
import { XMLParser, XMLValidator } from "fast-xml-parser";
|
package/dist/model/document.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
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, DRAWING_RAW_XML_MODES, type Deletion, type DocDefaults, Document, type DocumentBody, DocumentSettings, DocxConformanceClass, DocxPackage, type DrawingContent, type DrawingRawXmlMode, 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 ListMarkerFormatting, 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, PARAGRAPH_MARK_CHANGE_KINDS, type PageOrientation, type Paragraph, type ParagraphAlignment, type ParagraphContent, type ParagraphFormatting, type ParagraphMarkChange, type ParagraphMarkChangeKind, type ParagraphPropertyChange, type PictureWatermark, type PositionalTab, type PropertyChangeInfo, REVIEW_CARRIERS, type Relationship, type RelationshipMap, type RelationshipType, type ReviewCarrier, 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 ShapeGeometryAdjustment, 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 TrackedRunContent, type UnderlineStyle, type VerticalAlign, type Watermark, isOoxmlSymbolCharacter, normalizeRevisionId };
|
|
1
|
+
import { $ as ImagePadding, $t as TableCellPropertyChange, A as ComplexField, An as TabLeader, At as ReviewCarrier, B as FieldCharContent, Bn as TableWidthType, Bt as Shape, C as BookmarkStart, Cn as ConditionalFormatStyle, Ct as ParagraphMarkChange, D as CommentRangeEnd, Dn as ParagraphAlignment, Dt as PositionalTab, E as Comment, En as LineSpacingRule, Et as PictureWatermark, F as DrawingRawXmlMode, Fn as TableCellFormatting, Ft as SdtType, G as FootnoteProperties, Gn as ColorValue, Gt as ShapeTextBody, H as FooterReference, Hn as TextFormatting, Ht as ShapeFill, I as Endnote, In as TableFormatting, It as Section, J as HeaderReference, Jn as ThemeColorSlot, Jt as SoftHyphenContent, K as HeaderFooter, Kn as KnownBorderStyle, Kt as ShapeType, L as EndnotePosition, Ln as TableLook, Lt as SectionProperties, M as Deletion, Mn as TabStopAlignment, Mt as RunContent, N as DocumentBody, Nn as TableBorders, Nt as RunPropertyChange, O as CommentRangeStart, On as ParagraphFormatting, Ot as PropertyChangeInfo, P as DrawingContent, Pn as TableCellBorders, Pt as SdtProperties, Q as ImageFrameLocks, Qt as TableCell, R as EndnoteProperties, Rn as TableMeasurement, Rt as SectionPropertyChange, S as BookmarkEnd, Sn as CellMargins, St as ParagraphContent, T as Column, Tn as FloatingTableProperties, Tt as ParagraphPropertyChange, U as Footnote, Un as UnderlineStyle, Ut as ShapeGeometryAdjustment, V as FieldType, Vn as TextEffect, Vt as ShapeContent, W as FootnotePosition, Wn as BorderSpec, Wt as ShapeOutline, X as Image, Xt as TabContent, Y as Hyperlink, Yt as SymbolContent, Z as ImageCrop, Zt as Table, _ as ThemeColorScheme, _n as ListMarkerFormatting, _t as NoteNumberRestart, a as DocxPackage, an as TextContent, at as Insertion, b as BlockContent, bn as NumberingDefinitions, bt as PageOrientation, c as FontTable, cn as TrackedRunChange, ct as MAX_REVISION_ID, d as RelationshipMap, dn as Watermark, dt as MoveFromRangeEnd, en as TablePropertyChange, et as ImagePosition, f as RelationshipType, fn as isOoxmlSymbolCharacter, ft as MoveFromRangeStart, g as Theme, gn as ListLevel, gt as NoBreakHyphenContent, h as StyleType, hn as LevelSuffix, ht as MoveToRangeStart, i as DocxConformanceClass, in as TextBox, it as InlineSdt, j as DRAWING_RAW_XML_MODES, jn as TabStop, jt as Run, k as CommentReference, kn as SpacingExplicit, kt as REVIEW_CARRIERS, l as MediaFile, ln as TrackedRunContent, lt as MathEquation, m as StyleDefinitions, mn as AbstractNumbering, mt as MoveToRangeEnd, n as Document, nn as TableRowPropertyChange, nt as ImageTransform, o as DocDefaults, on as TextWatermark, ot as InstrTextContent, p as Style, pn as normalizeRevisionId, pt as MoveTo, q as HeaderFooterType, qn as ShadingProperties, qt as SimpleField, r as DocumentSettings, rn as TableStructuralChangeInfo, rt as ImageWrap, s as FontInfo, sn as TrackedChangeInfo, st as LineNumberRestart, t as DOCX_CONFORMANCE_CLASSES, tn as TableRow, tt as ImageSize, u as Relationship, un as VerticalAlign, ut as MoveFrom, v as ThemeFont, vn as ListRendering, vt as NoteReferenceContent, w as BreakContent, wn as EmphasisMark, wt as ParagraphMarkChangeKind, x as BlockSdt, xn as NumberingInstance, xt as Paragraph, y as ThemeFontScheme, yn as NumberFormat, yt as PARAGRAPH_MARK_CHANGE_KINDS, z as Field, zn as TableRowFormatting, zt as SectionStart } from "../document-Bu82QPAC.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, DRAWING_RAW_XML_MODES, type Deletion, type DocDefaults, Document, type DocumentBody, DocumentSettings, DocxConformanceClass, DocxPackage, type DrawingContent, type DrawingRawXmlMode, 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 ImageFrameLocks, 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 ListMarkerFormatting, 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, PARAGRAPH_MARK_CHANGE_KINDS, type PageOrientation, type Paragraph, type ParagraphAlignment, type ParagraphContent, type ParagraphFormatting, type ParagraphMarkChange, type ParagraphMarkChangeKind, type ParagraphPropertyChange, type PictureWatermark, type PositionalTab, type PropertyChangeInfo, REVIEW_CARRIERS, type Relationship, type RelationshipMap, type RelationshipType, type ReviewCarrier, 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 ShapeGeometryAdjustment, 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 TrackedRunContent, type UnderlineStyle, type VerticalAlign, type Watermark, isOoxmlSymbolCharacter, normalizeRevisionId };
|
package/dist/model/document.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as REVIEW_CARRIERS, i as PARAGRAPH_MARK_CHANGE_KINDS, n as DRAWING_RAW_XML_MODES, o as isOoxmlSymbolCharacter, r as MAX_REVISION_ID, s as normalizeRevisionId, t as DOCX_CONFORMANCE_CLASSES } from "../document-
|
|
1
|
+
import { a as REVIEW_CARRIERS, i as PARAGRAPH_MARK_CHANGE_KINDS, n as DRAWING_RAW_XML_MODES, o as isOoxmlSymbolCharacter, r as MAX_REVISION_ID, s as normalizeRevisionId, t as DOCX_CONFORMANCE_CLASSES } from "../document-D6wZrAko.js";
|
|
2
2
|
export { DOCX_CONFORMANCE_CLASSES, DRAWING_RAW_XML_MODES, MAX_REVISION_ID, PARAGRAPH_MARK_CHANGE_KINDS, REVIEW_CARRIERS, isOoxmlSymbolCharacter, normalizeRevisionId };
|
package/package.json
CHANGED