@stll/docx-core 0.38.0 → 0.39.1
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-wNmygRXS.d.ts → document-BkGU2ctn.d.ts} +158 -68
- package/dist/{document-C02Ulybe.js → document-oU-dz9zs.js} +141 -1
- package/dist/docx_kernel_bg.wasm +0 -0
- package/dist/index.d.ts +30 -68
- package/dist/index.js +78 -33
- package/dist/model/document.d.ts +2 -2
- package/dist/model/document.js +1 -2
- package/dist/ops/documentOps.d.ts +356 -93
- package/dist/ops/documentOps.js +5937 -3887
- package/dist/projection.d.ts +15 -14
- package/dist/projection.js +8 -4
- package/dist/schema/sequenceChildren.d.ts +7 -7
- package/dist/schema/sequenceChildren.js +1 -2
- package/dist/{sequenceChildren-B8ODeI3J.js → sequenceChildren-9SUK1Tm1.js} +23 -4
- package/dist/zip/writeZipPart.d.ts +2 -2
- package/package.json +7 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as finalizeParagraphFormatting, Dn as Run, E as Style, H as setDocumentBodyComments, K as BlockContent, On as RunContent, Pn as SectionProperties, Q as BreakContent, V as isCanonicallyEmptyParagraphFormatting, Vr as NumberingDefinitions, Xn as TableCell, Yn as Table, _n as PositionalTab, cr as TextContent, ct as DocumentBackground, dn as Paragraph, fn as ParagraphContent, i as Document, ir as TableRow, lt as DocumentBackgroundDrawing, o as DocxConformanceClass, r as DOCX_CONFORMANCE_CLASSES, s as DocxPackage, ut as DocumentBody } from "./document-BkGU2ctn.js";
|
|
2
|
+
import { TaggedErrorClass } from "better-result";
|
|
2
3
|
import JSZip from "jszip";
|
|
3
4
|
import { Buffer } from "node:buffer";
|
|
4
5
|
//#region src/legal-source/types.d.ts
|
|
@@ -108,18 +109,18 @@ type LegalSourceDocxCompileResult = ({
|
|
|
108
109
|
}>;
|
|
109
110
|
//#endregion
|
|
110
111
|
//#region src/legal-source/compile.d.ts
|
|
111
|
-
declare const compileLegalSourceToDocument: (source: string, options?: LegalSourceCompileOptions) => LegalSourceCompileResult;
|
|
112
|
+
export declare const compileLegalSourceToDocument: (source: string, options?: LegalSourceCompileOptions) => LegalSourceCompileResult;
|
|
112
113
|
//#endregion
|
|
113
114
|
//#region src/legal-source/parser.d.ts
|
|
114
|
-
declare const parseLegalSource: (source: string, options?: {
|
|
115
|
+
export declare const parseLegalSource: (source: string, options?: {
|
|
115
116
|
titleFallback?: string;
|
|
116
117
|
}) => LegalSourceParseResult;
|
|
117
118
|
//#endregion
|
|
118
119
|
//#region src/legal-source/validate.d.ts
|
|
119
|
-
declare const validateLegalDraft: (draft: LegalDraft) => LegalDraftDiagnostic[];
|
|
120
|
+
export declare const validateLegalDraft: (draft: LegalDraft) => LegalDraftDiagnostic[];
|
|
120
121
|
//#endregion
|
|
121
122
|
//#region src/legal-source/index.d.ts
|
|
122
|
-
declare const compileLegalSourceToDocx: (source: string, options?: LegalSourceCompileOptions) => Promise<LegalSourceDocxCompileResult>;
|
|
123
|
+
export declare const compileLegalSourceToDocx: (source: string, options?: LegalSourceCompileOptions) => Promise<LegalSourceDocxCompileResult>;
|
|
123
124
|
//#endregion
|
|
124
125
|
//#region src/markdown/content.d.ts
|
|
125
126
|
/** Block content and the numbering definitions its list paragraphs reference. */
|
|
@@ -139,7 +140,7 @@ type MarkdownContent = {
|
|
|
139
140
|
* Synchronous. The caller places the blocks into a `Document` of its own
|
|
140
141
|
* (page geometry, styles, and presets are the host's decision).
|
|
141
142
|
*/
|
|
142
|
-
declare const compileMarkdownToContent: (markdown: string) => MarkdownContent;
|
|
143
|
+
export declare const compileMarkdownToContent: (markdown: string) => MarkdownContent;
|
|
143
144
|
//#endregion
|
|
144
145
|
//#region src/markdown/href.d.ts
|
|
145
146
|
/**
|
|
@@ -148,7 +149,7 @@ declare const compileMarkdownToContent: (markdown: string) => MarkdownContent;
|
|
|
148
149
|
* `undefined` so a markdown link degrades to its text instead of carrying an
|
|
149
150
|
* executable target into the document.
|
|
150
151
|
*/
|
|
151
|
-
declare const sanitizeExternalUrl: (rawUrl: string | undefined) => string | undefined;
|
|
152
|
+
export declare const sanitizeExternalUrl: (rawUrl: string | undefined) => string | undefined;
|
|
152
153
|
//#endregion
|
|
153
154
|
//#region src/serialize/docx.d.ts
|
|
154
155
|
type SerializeDocumentOptions = {
|
|
@@ -175,12 +176,12 @@ type SerializeDocumentOptions = {
|
|
|
175
176
|
* from-scratch document builder those suites can call; the brand follows it,
|
|
176
177
|
* not the other way round.
|
|
177
178
|
*/
|
|
178
|
-
declare const serializeDocumentToDocx: (document: Document, options?: SerializeDocumentOptions) => Promise<ArrayBuffer>;
|
|
179
|
+
export declare const serializeDocumentToDocx: (document: Document, options?: SerializeDocumentOptions) => Promise<ArrayBuffer>;
|
|
179
180
|
//#endregion
|
|
180
181
|
//#region src/serialize/numericIds.d.ts
|
|
181
|
-
declare const
|
|
182
|
+
declare const InvalidOoxmlNumericIdErrorBase: TaggedErrorClass<"InvalidOoxmlNumericIdError">;
|
|
182
183
|
/** A writer would emit an identifier outside its OOXML schema's numeric domain. */
|
|
183
|
-
declare class InvalidOoxmlNumericIdError extends
|
|
184
|
+
export declare class InvalidOoxmlNumericIdError extends InvalidOoxmlNumericIdErrorBase<{
|
|
184
185
|
message: string;
|
|
185
186
|
partPath: string;
|
|
186
187
|
elementName: string;
|
|
@@ -194,8 +195,8 @@ type NumericIdOptions = {
|
|
|
194
195
|
attributeName: string;
|
|
195
196
|
domain?: "signed32" | "unsigned32";
|
|
196
197
|
};
|
|
197
|
-
declare const isValidOoxmlNumericId: (value: string | number, domain?: "signed32" | "unsigned32") => boolean;
|
|
198
|
-
declare const assertValidOoxmlNumericId: ({ value, partPath, elementName, attributeName, domain }: NumericIdOptions) => void;
|
|
198
|
+
export declare const isValidOoxmlNumericId: (value: string | number, domain?: "signed32" | "unsigned32") => boolean;
|
|
199
|
+
export declare const assertValidOoxmlNumericId: ({ value, partPath, elementName, attributeName, domain }: NumericIdOptions) => void;
|
|
199
200
|
type NumericIdAttributeOptions = {
|
|
200
201
|
elementName: string;
|
|
201
202
|
elementNamespace: string | undefined;
|
|
@@ -203,28 +204,28 @@ type NumericIdAttributeOptions = {
|
|
|
203
204
|
attributeNamespace: string | undefined;
|
|
204
205
|
};
|
|
205
206
|
/** Shared schema classification for import normalization and writer validation. */
|
|
206
|
-
declare const ooxmlNumericIdDomain: ({ elementName, elementNamespace, attributeName, attributeNamespace }: NumericIdAttributeOptions) => "signed32" | "unsigned32" | undefined;
|
|
207
|
+
export declare const ooxmlNumericIdDomain: ({ elementName, elementNamespace, attributeName, attributeNamespace }: NumericIdAttributeOptions) => "signed32" | "unsigned32" | undefined;
|
|
207
208
|
type OoxmlNumericIdAttributeOptions = {
|
|
208
209
|
elementName: string;
|
|
209
210
|
attributeName: string;
|
|
210
211
|
};
|
|
211
212
|
/** Attributes an identity scan must retain, derived from the domain classifier. */
|
|
212
|
-
declare const isOoxmlNumericIdAttributeName: ({ elementName, attributeName }: OoxmlNumericIdAttributeOptions) => boolean;
|
|
213
|
+
export declare const isOoxmlNumericIdAttributeName: ({ elementName, attributeName }: OoxmlNumericIdAttributeOptions) => boolean;
|
|
213
214
|
/** Conservative presence check; safe IDs must still be reserved during import repair. */
|
|
214
|
-
declare const mayContainOoxmlNumericIds: (xml: string) => boolean;
|
|
215
|
+
export declare const mayContainOoxmlNumericIds: (xml: string) => boolean;
|
|
215
216
|
/**
|
|
216
217
|
* Conservative lexical preflight; namespace classification remains authoritative.
|
|
217
218
|
* A prefix is considered numeric if any scope binds it to WordprocessingML. This can send
|
|
218
219
|
* a shadowed foreign attribute to the full parser, but cannot hide a numeric one.
|
|
219
220
|
* Suspicious values with entity-encoded bindings or values require the authoritative scan.
|
|
220
221
|
*/
|
|
221
|
-
declare const mayContainInvalidOoxmlNumericIds: (xml: string, mode?: "schema" | "range") => boolean;
|
|
222
|
+
export declare const mayContainInvalidOoxmlNumericIds: (xml: string, mode?: "schema" | "range") => boolean;
|
|
222
223
|
/**
|
|
223
224
|
* Validate both authored and opaque replayed identifiers by namespace URI.
|
|
224
225
|
* This runs at ZIP exits too, so unchanged parts cannot bypass the writer guard.
|
|
225
226
|
* Permission-range ids are strings in OOXML and intentionally remain unrestricted.
|
|
226
227
|
*/
|
|
227
|
-
declare const assertValidOoxmlNumericIds: (xml: string, partPath: string) => void;
|
|
228
|
+
export declare const assertValidOoxmlNumericIds: (xml: string, partPath: string) => void;
|
|
228
229
|
//#endregion
|
|
229
230
|
//#region src/serialize/xml.d.ts
|
|
230
231
|
/**
|
|
@@ -249,7 +250,7 @@ declare const assertValidOoxmlNumericIds: (xml: string, partPath: string) => voi
|
|
|
249
250
|
* *writes* is one spelling per polarity, because a package that writes three
|
|
250
251
|
* makes every byte-level comparison argue about which one it is looking at.
|
|
251
252
|
*/
|
|
252
|
-
declare const serializeOnOffElement: (value: boolean | undefined, name: string) => string;
|
|
253
|
+
export declare const serializeOnOffElement: (value: boolean | undefined, name: string) => string;
|
|
253
254
|
/**
|
|
254
255
|
* Append a `CT_OnOff` element to a property list, and nothing when it is absent.
|
|
255
256
|
*
|
|
@@ -257,58 +258,19 @@ declare const serializeOnOffElement: (value: boolean | undefined, name: string)
|
|
|
257
258
|
* `parts.length`, so an absent toggle must not leave an empty string behind:
|
|
258
259
|
* that would turn an unformatted run into a `<w:rPr></w:rPr>`.
|
|
259
260
|
*/
|
|
260
|
-
declare const pushOnOffElement: (parts: string[], value: boolean | undefined, name: string) => void;
|
|
261
|
+
export declare const pushOnOffElement: (parts: string[], value: boolean | undefined, name: string) => void;
|
|
261
262
|
//#endregion
|
|
262
263
|
//#region src/serialize/xmlEscape.d.ts
|
|
263
|
-
/**
|
|
264
|
-
* The one owner of XML character escaping for every part folio writes.
|
|
265
|
-
*
|
|
266
|
-
* Two contexts, two functions. A value going into element content takes
|
|
267
|
-
* {@link escapeXmlText}; a value going between the quotes of an attribute
|
|
268
|
-
* takes {@link escapeXmlAttribute}. Nothing else escapes XML by hand: a
|
|
269
|
-
* second escaper always ends up disagreeing with this one about some
|
|
270
|
-
* character, and the disagreement is a package Word refuses to open.
|
|
271
|
-
*
|
|
272
|
-
* Both functions guarantee the same contract: **the result is always legal
|
|
273
|
-
* XML 1.0 character data.** That is what makes the contract checkable — a
|
|
274
|
-
* caller cannot produce a corrupt part by forgetting something.
|
|
275
|
-
*
|
|
276
|
-
* XML 1.0 §2.2 `Char` admits tab, LF, CR, `#x20`-`#xD7FF`, `#xE000`-`#xFFFD`
|
|
277
|
-
* and the astral planes. Everything else — the rest of C0, `#xFFFE`,
|
|
278
|
-
* `#xFFFF`, an unpaired surrogate — cannot appear in a document at all, and
|
|
279
|
-
* cannot be escaped into one either: `�` is as illegal as a raw NUL
|
|
280
|
-
* (§4.1 requires a character reference to refer to a legal `Char`). The only
|
|
281
|
-
* output that is well-formed is one without them, so they are dropped here.
|
|
282
|
-
* Callers that own an input boundary sanitise before this point, with
|
|
283
|
-
* `sanitizeXmlCharacters`, so a user-visible value loses its illegal
|
|
284
|
-
* characters where something can still report it; the drop below is the last
|
|
285
|
-
* line of defence for a boundary nobody has covered yet.
|
|
286
|
-
*
|
|
287
|
-
* The whitespace rules are where the two contexts part:
|
|
288
|
-
*
|
|
289
|
-
* - §3.3.3 normalises tab, LF and CR in an **attribute value** to a space in
|
|
290
|
-
* every conformant parser, so a literal one does not survive a save. They
|
|
291
|
-
* are written as character references, which the same step leaves alone.
|
|
292
|
-
* - §2.11 normalises a literal CR (and CRLF) in **content** to LF on read, so
|
|
293
|
-
* CR is written as a reference there too. Tab and LF survive as themselves.
|
|
294
|
-
*
|
|
295
|
-
* Both contexts escape all five of `& < > " '`. Only `&` and `<` must be
|
|
296
|
-
* escaped in content, but folio has always written the full set, `>` closes
|
|
297
|
-
* the `]]>` hazard of §2.4 without a special case, and one lexical form
|
|
298
|
-
* across every writer is worth more than the bytes it costs. Every spelling
|
|
299
|
-
* here reads back as the character it stands for, so the rule preserves the
|
|
300
|
-
* value whichever context it lands in.
|
|
301
|
-
*/
|
|
302
264
|
/** Escape a value for XML element content. Tab and LF survive as themselves. */
|
|
303
|
-
declare const escapeXmlText: (value: string) => string;
|
|
265
|
+
export declare const escapeXmlText: (value: string) => string;
|
|
304
266
|
/**
|
|
305
267
|
* Escape a value for an XML attribute value, of either quoting. Tab, LF and CR
|
|
306
268
|
* become character references so attribute-value normalisation cannot flatten
|
|
307
269
|
* them to spaces.
|
|
308
270
|
*/
|
|
309
|
-
declare const escapeXmlAttribute: (value: string) => string;
|
|
271
|
+
export declare const escapeXmlAttribute: (value: string) => string;
|
|
310
272
|
/** Whether `value` holds a character XML 1.0 cannot represent at all. */
|
|
311
|
-
declare const hasIllegalXmlCharacters: (value: string) => boolean;
|
|
273
|
+
export declare const hasIllegalXmlCharacters: (value: string) => boolean;
|
|
312
274
|
/**
|
|
313
275
|
* Make a value from outside folio representable in XML: an unpaired surrogate
|
|
314
276
|
* becomes U+FFFD, every other character XML cannot hold is dropped.
|
|
@@ -319,7 +281,7 @@ declare const hasIllegalXmlCharacters: (value: string) => boolean;
|
|
|
319
281
|
* go. `escapeXmlText` and `escapeXmlAttribute` apply the same rule again
|
|
320
282
|
* further down, but by then nobody can say which input lost a character.
|
|
321
283
|
*/
|
|
322
|
-
declare const sanitizeXmlCharacters: (value: string) => string;
|
|
284
|
+
export declare const sanitizeXmlCharacters: (value: string) => string;
|
|
323
285
|
//#endregion
|
|
324
286
|
//#region src/serialize/textWhitespace.d.ts
|
|
325
287
|
/**
|
|
@@ -332,7 +294,7 @@ declare const sanitizeXmlCharacters: (value: string) => string;
|
|
|
332
294
|
* fact only drifts, and it did: the editor round trip dropped it whenever two
|
|
333
295
|
* runs merged, because ProseMirror has nowhere to carry it.
|
|
334
296
|
*/
|
|
335
|
-
declare const requiresXmlSpacePreserve: (text: string) => boolean;
|
|
297
|
+
export declare const requiresXmlSpacePreserve: (text: string) => boolean;
|
|
336
298
|
//#endregion
|
|
337
299
|
//#region src/validate/docx.d.ts
|
|
338
300
|
declare module "jszip" {
|
|
@@ -341,7 +303,7 @@ declare module "jszip" {
|
|
|
341
303
|
internalStream(type: "uint8array"): JSZip.JSZipStreamHelper<Uint8Array>;
|
|
342
304
|
}
|
|
343
305
|
}
|
|
344
|
-
declare const DOCX_PACKAGE_ISSUE_CODES: {
|
|
306
|
+
export declare const DOCX_PACKAGE_ISSUE_CODES: {
|
|
345
307
|
readonly ArchiveBoundsExceeded: "archive_bounds_exceeded";
|
|
346
308
|
readonly InvalidArchive: "invalid_archive";
|
|
347
309
|
readonly InvalidPackageGraph: "invalid_package_graph";
|
|
@@ -367,8 +329,8 @@ type ValidateDocumentModelResult = {
|
|
|
367
329
|
valid: boolean;
|
|
368
330
|
issues: ValidateDocumentModelIssue[];
|
|
369
331
|
};
|
|
370
|
-
declare const validateDocxPackage: (buffer: ArrayBuffer | Uint8Array) => Promise<ValidateDocxPackageResult>;
|
|
371
|
-
declare const validateDocumentModel: (document: Document) => ValidateDocumentModelResult;
|
|
372
|
-
declare const assertValidDocumentModel: (document: Document) => void;
|
|
332
|
+
export declare const validateDocxPackage: (buffer: ArrayBuffer | Uint8Array) => Promise<ValidateDocxPackageResult>;
|
|
333
|
+
export declare const validateDocumentModel: (document: Document) => ValidateDocumentModelResult;
|
|
334
|
+
export declare const assertValidDocumentModel: (document: Document) => void;
|
|
373
335
|
//#endregion
|
|
374
|
-
export { type Autofix, type BlockContent, type BreakContent, type CompiledLegalDocument, DOCX_CONFORMANCE_CLASSES,
|
|
336
|
+
export { type Autofix, type BlockContent, type BreakContent, type CompiledLegalDocument, DOCX_CONFORMANCE_CLASSES, type Document, type DocumentBackground, type DocumentBackgroundDrawing, type DocumentBody, type DocxConformanceClass, type DocxPackage, type DocxPackageIssueCode, type LegalDraft, type LegalDraftBlock, type LegalDraftDiagnostic, type LegalSourceCompileOptions, type LegalSourceCompileResult, type LegalSourceDocxCompileResult, type LegalSourceParseResult, type MarkdownContent, type Paragraph, type ParagraphContent, type PositionalTab, type Run, type RunContent, type SectionProperties, type Style, type Table, type TableCell, type TableRow, type TextContent, type ValidateDocumentModelIssue, type ValidateDocumentModelResult, type ValidateDocxPackageResult, finalizeParagraphFormatting, isCanonicallyEmptyParagraphFormatting, setDocumentBodyComments };
|
package/dist/index.js
CHANGED
|
@@ -1,26 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { T as borderStyleToken, Z as headingOutlineLevel, _t as isCanonicallyEmptyParagraphFormatting, ct as paragraphNumberingReferenceId, d as isNoteReferenceId, f as isOoxmlSymbolCharacter, gt as finalizeParagraphFormatting, k as statesNoBorder, lt as paragraphNumberingSlots, ot as paragraphNumberingLevel, r as DOCX_CONFORMANCE_CLASSES, s as MAX_REVISION_ID, st as paragraphNumberingReference, vt as setDocumentBodyComments } from "./document-oU-dz9zs.js";
|
|
2
|
+
import { i as serializeSequenceChildren } from "./sequenceChildren-9SUK1Tm1.js";
|
|
2
3
|
import { writeZipPart } from "./zip/writeZipPart.js";
|
|
3
|
-
import { i as serializeSequenceChildren } from "./sequenceChildren-B8ODeI3J.js";
|
|
4
4
|
import { a as hasIllegalXmlCharacters, i as escapeXmlText, n as sanitizeMarkdownHref, o as sanitizeXmlCharacters, r as escapeXmlAttribute, t as sanitizeExternalUrl } from "./href-2XSCK-T8.js";
|
|
5
5
|
import { Result, TaggedError, panic } from "better-result";
|
|
6
|
-
import { decodeText, encodeUtf8 } from "@stll/utf8-boundaries";
|
|
7
6
|
import JSZip from "jszip";
|
|
7
|
+
import { decodeText, encodeUtf8 } from "@stll/utf8-boundaries";
|
|
8
8
|
import { XMLParser, XMLValidator } from "fast-xml-parser";
|
|
9
9
|
import { ENTITY_ACTION, EntityDecoder } from "@nodable/entities";
|
|
10
10
|
import { Marked } from "marked";
|
|
11
|
-
//#region src/serialize/textWhitespace.ts
|
|
12
|
-
/**
|
|
13
|
-
* Whether `<w:t>` needs `xml:space="preserve"` to render the text as written.
|
|
14
|
-
*
|
|
15
|
-
* Without the attribute an XML reader trims leading and trailing spaces and
|
|
16
|
-
* collapses runs of them, so the attribute is a pure function of the text: it
|
|
17
|
-
* is needed exactly when that normalisation would change what the reader sees.
|
|
18
|
-
* The model therefore keeps no flag of its own — a stored copy of a derived
|
|
19
|
-
* fact only drifts, and it did: the editor round trip dropped it whenever two
|
|
20
|
-
* runs merged, because ProseMirror has nowhere to carry it.
|
|
21
|
-
*/
|
|
22
|
-
const requiresXmlSpacePreserve = (text) => text.startsWith(" ") || text.endsWith(" ") || text.includes(" ");
|
|
23
|
-
//#endregion
|
|
24
11
|
//#region src/serialize/numericIds.ts
|
|
25
12
|
const WORD_NAMESPACES = /* @__PURE__ */ new Set(["http://schemas.openxmlformats.org/wordprocessingml/2006/main", "http://purl.oclc.org/ooxml/wordprocessingml/main"]);
|
|
26
13
|
const DRAWING_NAMESPACES = /* @__PURE__ */ new Set([
|
|
@@ -46,8 +33,9 @@ const ID_VALUE_ELEMENTS = /* @__PURE__ */ new Set([
|
|
|
46
33
|
const STRING_ID_ELEMENTS = /* @__PURE__ */ new Set(["permStart", "permEnd"]);
|
|
47
34
|
const MAX_UNSIGNED_ID = 4294967295;
|
|
48
35
|
const MIN_SIGNED_ID = -2147483648;
|
|
36
|
+
const InvalidOoxmlNumericIdErrorBase = TaggedError("InvalidOoxmlNumericIdError");
|
|
49
37
|
/** A writer would emit an identifier outside its OOXML schema's numeric domain. */
|
|
50
|
-
var InvalidOoxmlNumericIdError = class extends
|
|
38
|
+
var InvalidOoxmlNumericIdError = class extends InvalidOoxmlNumericIdErrorBase {};
|
|
51
39
|
const isValidOoxmlNumericId = (value, domain = "signed32") => {
|
|
52
40
|
const spelling = String(value).trim();
|
|
53
41
|
const numeric = Number(spelling);
|
|
@@ -219,6 +207,19 @@ const assertValidOoxmlNumericIds = (xml, partPath) => {
|
|
|
219
207
|
visit(parser.parse(xml), /* @__PURE__ */ new Map());
|
|
220
208
|
};
|
|
221
209
|
//#endregion
|
|
210
|
+
//#region src/serialize/textWhitespace.ts
|
|
211
|
+
/**
|
|
212
|
+
* Whether `<w:t>` needs `xml:space="preserve"` to render the text as written.
|
|
213
|
+
*
|
|
214
|
+
* Without the attribute an XML reader trims leading and trailing spaces and
|
|
215
|
+
* collapses runs of them, so the attribute is a pure function of the text: it
|
|
216
|
+
* is needed exactly when that normalisation would change what the reader sees.
|
|
217
|
+
* The model therefore keeps no flag of its own — a stored copy of a derived
|
|
218
|
+
* fact only drifts, and it did: the editor round trip dropped it whenever two
|
|
219
|
+
* runs merged, because ProseMirror has nowhere to carry it.
|
|
220
|
+
*/
|
|
221
|
+
const requiresXmlSpacePreserve = (text) => text.startsWith(" ") || text.endsWith(" ") || text.includes(" ");
|
|
222
|
+
//#endregion
|
|
222
223
|
//#region src/serialize/xml.ts
|
|
223
224
|
const attr = (name, value) => value === void 0 ? "" : ` ${name}="${escapeXmlAttribute(String(value))}"`;
|
|
224
225
|
/**
|
|
@@ -432,7 +433,11 @@ const serializeBlock = (block) => {
|
|
|
432
433
|
case "blockCustomXml": return `${block.openingXml}${block.content.map(serializeBlock).join("")}${block.closingXml}`;
|
|
433
434
|
case "preservedBlock": return block.xml;
|
|
434
435
|
case "bookmarkStart":
|
|
435
|
-
case "bookmarkEnd":
|
|
436
|
+
case "bookmarkEnd":
|
|
437
|
+
case "moveFromRangeStart":
|
|
438
|
+
case "moveFromRangeEnd":
|
|
439
|
+
case "moveToRangeStart":
|
|
440
|
+
case "moveToRangeEnd": return "";
|
|
436
441
|
default: return "";
|
|
437
442
|
}
|
|
438
443
|
};
|
|
@@ -451,6 +456,8 @@ const serializeParagraphProperties = (paragraph) => {
|
|
|
451
456
|
const { numId, ilvl } = paragraphNumberingSlots(formatting.numPr);
|
|
452
457
|
parts.push("<w:numPr>" + (ilvl === void 0 ? "" : `<w:ilvl w:val="${ilvl}"/>`) + (numId === void 0 ? "" : `<w:numId w:val="${numId}"/>`) + "</w:numPr>");
|
|
453
458
|
}
|
|
459
|
+
pushOnOffElement(parts, formatting?.autoSpaceDE, "autoSpaceDE");
|
|
460
|
+
pushOnOffElement(parts, formatting?.autoSpaceDN, "autoSpaceDN");
|
|
454
461
|
if (formatting?.spaceBefore !== void 0 || formatting?.spaceAfter !== void 0 || formatting?.lineSpacing !== void 0) parts.push(`<w:spacing${attr("w:before", formatting.spaceBefore)}${attr("w:after", formatting.spaceAfter)}${attr("w:line", formatting.lineSpacing)}${attr("w:lineRule", formatting.lineSpacingRule)}/>`);
|
|
455
462
|
if (formatting?.indentLeft !== void 0 || formatting?.indentRight !== void 0 || formatting?.indentFirstLine !== void 0) parts.push(`<w:ind${attr("w:left", formatting.indentLeft)}${attr("w:right", formatting.indentRight)}${attr(formatting.hangingIndent ? "w:hanging" : "w:firstLine", formatting.indentFirstLine)}/>`);
|
|
456
463
|
if (formatting?.alignment) parts.push(`<w:jc w:val="${formatting.alignment}"/>`);
|
|
@@ -761,7 +768,8 @@ const relationshipSource = (path) => {
|
|
|
761
768
|
const match = /^(.*\/)?_rels\/([^/]+)\.rels$/u.exec(path);
|
|
762
769
|
return match ? `${match.at(1) ?? ""}${match.at(2) ?? ""}` : null;
|
|
763
770
|
};
|
|
764
|
-
|
|
771
|
+
const PackageUriErrorBase = TaggedError("PackageUriError");
|
|
772
|
+
var PackageUriError = class extends PackageUriErrorBase {};
|
|
765
773
|
const resolveTarget = (source, target) => {
|
|
766
774
|
const targetPath = target.split("#").at(0);
|
|
767
775
|
if (!targetPath || targetPath.includes("\\") || targetPath.includes("?") || /^[a-z]+:/iu.test(targetPath)) return null;
|
|
@@ -1015,9 +1023,9 @@ const DOCX_PACKAGE_ISSUE_CODES = {
|
|
|
1015
1023
|
* archive with an excessive part count can't force an unbounded allocation.
|
|
1016
1024
|
*/
|
|
1017
1025
|
const VALIDATE_DOCX_MAX_ENTRIES = 4096;
|
|
1018
|
-
const VALIDATE_DOCX_MAX_ENTRY_BYTES =
|
|
1019
|
-
const VALIDATE_DOCX_MAX_TOTAL_BYTES =
|
|
1020
|
-
const VALIDATE_DOCX_MAX_DOCUMENT_XML_BYTES =
|
|
1026
|
+
const VALIDATE_DOCX_MAX_ENTRY_BYTES = 134217728;
|
|
1027
|
+
const VALIDATE_DOCX_MAX_TOTAL_BYTES = 268435456;
|
|
1028
|
+
const VALIDATE_DOCX_MAX_DOCUMENT_XML_BYTES = 33554432;
|
|
1021
1029
|
/**
|
|
1022
1030
|
* Inflated bytes allowed per compressed byte, for a markup or text entry and
|
|
1023
1031
|
* for the whole archive, once either passes the grace size. Real document
|
|
@@ -1027,7 +1035,7 @@ const VALIDATE_DOCX_MAX_DOCUMENT_XML_BYTES = 32 * 1024 * 1024;
|
|
|
1027
1035
|
* the byte limits bound them.
|
|
1028
1036
|
*/
|
|
1029
1037
|
const VALIDATE_DOCX_MAX_COMPRESSION_RATIO = 200;
|
|
1030
|
-
const VALIDATE_DOCX_COMPRESSION_RATIO_GRACE_BYTES =
|
|
1038
|
+
const VALIDATE_DOCX_COMPRESSION_RATIO_GRACE_BYTES = 4194304;
|
|
1031
1039
|
const WORDPROCESSINGML_NAMESPACES = /* @__PURE__ */ new Set(["http://schemas.openxmlformats.org/wordprocessingml/2006/main", "http://purl.oclc.org/ooxml/wordprocessingml/main"]);
|
|
1032
1040
|
const packageXmlParser = new XMLParser({
|
|
1033
1041
|
preserveOrder: true,
|
|
@@ -1329,7 +1337,8 @@ const validateDocumentModel = (document) => {
|
|
|
1329
1337
|
const assertValidDocumentModel = (document) => {
|
|
1330
1338
|
const result = validateDocumentModel(document);
|
|
1331
1339
|
if (result.valid) return;
|
|
1332
|
-
|
|
1340
|
+
const details = result.issues.flatMap((issue) => issue.severity === "error" ? [`${issue.path}: ${issue.message}`] : []).join("\n");
|
|
1341
|
+
panic(`Invalid DOCX document model:\n${details}`);
|
|
1333
1342
|
};
|
|
1334
1343
|
const createValidationContext = (document) => ({
|
|
1335
1344
|
issues: [],
|
|
@@ -1383,6 +1392,15 @@ const recordPath = (map, id, path) => {
|
|
|
1383
1392
|
const validateBlocks = (blocks, path, ctx) => {
|
|
1384
1393
|
for (const [index, block] of blocks.entries()) validateBlock(block, `${path}[${index}]`, ctx);
|
|
1385
1394
|
};
|
|
1395
|
+
/** The pair counter each range marker between blocks counts toward. */
|
|
1396
|
+
const blockRangeMarkerCounters = (ctx) => ({
|
|
1397
|
+
bookmarkStart: ctx.bookmarkStarts,
|
|
1398
|
+
bookmarkEnd: ctx.bookmarkEnds,
|
|
1399
|
+
moveFromRangeStart: ctx.moveFromStarts,
|
|
1400
|
+
moveFromRangeEnd: ctx.moveFromEnds,
|
|
1401
|
+
moveToRangeStart: ctx.moveToStarts,
|
|
1402
|
+
moveToRangeEnd: ctx.moveToEnds
|
|
1403
|
+
});
|
|
1386
1404
|
const validateBlock = (block, path, ctx) => {
|
|
1387
1405
|
if (block.type === "paragraph") {
|
|
1388
1406
|
validateParagraph(block, path, ctx);
|
|
@@ -1393,7 +1411,10 @@ const validateBlock = (block, path, ctx) => {
|
|
|
1393
1411
|
return;
|
|
1394
1412
|
}
|
|
1395
1413
|
if (block.type === "preservedBlock") return;
|
|
1396
|
-
if (block.type === "bookmarkStart" || block.type === "bookmarkEnd")
|
|
1414
|
+
if (block.type === "bookmarkStart" || block.type === "bookmarkEnd" || block.type === "moveFromRangeStart" || block.type === "moveFromRangeEnd" || block.type === "moveToRangeStart" || block.type === "moveToRangeEnd") {
|
|
1415
|
+
increment(blockRangeMarkerCounters(ctx)[block.type], block.id);
|
|
1416
|
+
return;
|
|
1417
|
+
}
|
|
1397
1418
|
if (block.content.length === 0) {
|
|
1398
1419
|
addWarning(ctx, `${path}.content`, "Block content control is empty.");
|
|
1399
1420
|
return;
|
|
@@ -1537,12 +1558,34 @@ const validateHyperlinkChild = (child, path, ctx) => {
|
|
|
1537
1558
|
increment(ctx.bookmarkStarts, child.id);
|
|
1538
1559
|
return;
|
|
1539
1560
|
}
|
|
1561
|
+
if (child.type === "commentRangeStart") {
|
|
1562
|
+
increment(ctx.commentRangeStarts, child.id);
|
|
1563
|
+
recordPath(ctx.referencedCommentIds, child.id, path);
|
|
1564
|
+
return;
|
|
1565
|
+
}
|
|
1566
|
+
if (child.type === "commentRangeEnd") {
|
|
1567
|
+
increment(ctx.commentRangeEnds, child.id);
|
|
1568
|
+
recordPath(ctx.referencedCommentIds, child.id, path);
|
|
1569
|
+
return;
|
|
1570
|
+
}
|
|
1571
|
+
if (child.type === "commentReference") {
|
|
1572
|
+
recordPath(ctx.referencedCommentIds, child.id, path);
|
|
1573
|
+
return;
|
|
1574
|
+
}
|
|
1540
1575
|
if (child.type === "preservedInline") return;
|
|
1541
1576
|
if (child.type === "inlineWrapper") {
|
|
1542
1577
|
validateParagraphContent(child, path, ctx);
|
|
1543
1578
|
return;
|
|
1544
1579
|
}
|
|
1545
|
-
|
|
1580
|
+
if (child.type === "bookmarkEnd") {
|
|
1581
|
+
increment(ctx.bookmarkEnds, child.id);
|
|
1582
|
+
return;
|
|
1583
|
+
}
|
|
1584
|
+
if (child.type === "moveFromRangeStart" || child.type === "moveFromRangeEnd" || child.type === "moveToRangeStart" || child.type === "moveToRangeEnd") {
|
|
1585
|
+
validateParagraphContent(child, path, ctx);
|
|
1586
|
+
return;
|
|
1587
|
+
}
|
|
1588
|
+
panic(`Unsupported hyperlink child: ${JSON.stringify(child)}`);
|
|
1546
1589
|
};
|
|
1547
1590
|
const validateTrackedRunChange = (change, path, ctx) => {
|
|
1548
1591
|
if (change.info.author.trim() === "") addError(ctx, `${path}.info.author`, "Tracked change author is empty.");
|
|
@@ -2712,7 +2755,6 @@ const appendBlock = (content, block, options) => {
|
|
|
2712
2755
|
}]
|
|
2713
2756
|
});
|
|
2714
2757
|
return;
|
|
2715
|
-
default:
|
|
2716
2758
|
}
|
|
2717
2759
|
};
|
|
2718
2760
|
const clauseNumbering = (block, profile) => {
|
|
@@ -3179,11 +3221,14 @@ const compileLegalSourceToDocx = async (source, options = {}) => {
|
|
|
3179
3221
|
};
|
|
3180
3222
|
//#endregion
|
|
3181
3223
|
//#region src/markdown/content.ts
|
|
3182
|
-
const para = (runs, styleId) =>
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
}
|
|
3224
|
+
const para = (runs, styleId) => {
|
|
3225
|
+
const formatting = finalizeParagraphFormatting(styleId ? { styleId } : {});
|
|
3226
|
+
return {
|
|
3227
|
+
type: "paragraph",
|
|
3228
|
+
...formatting === void 0 ? {} : { formatting },
|
|
3229
|
+
content: runs.length > 0 ? runs : [textRun("")]
|
|
3230
|
+
};
|
|
3231
|
+
};
|
|
3187
3232
|
const listPara = (runs, rendering) => ({
|
|
3188
3233
|
type: "paragraph",
|
|
3189
3234
|
formatting: { numPr: paragraphNumberingReference({
|
|
@@ -3382,4 +3427,4 @@ const compileMarkdownToContent = (markdown) => {
|
|
|
3382
3427
|
};
|
|
3383
3428
|
};
|
|
3384
3429
|
//#endregion
|
|
3385
|
-
export { DOCX_CONFORMANCE_CLASSES, DOCX_PACKAGE_ISSUE_CODES, InvalidOoxmlNumericIdError, assertValidDocumentModel, assertValidOoxmlNumericId, assertValidOoxmlNumericIds, compileLegalSourceToDocument, compileLegalSourceToDocx, compileMarkdownToContent, escapeXmlAttribute, escapeXmlText, hasIllegalXmlCharacters, isOoxmlNumericIdAttributeName, isValidOoxmlNumericId, mayContainInvalidOoxmlNumericIds, mayContainOoxmlNumericIds, ooxmlNumericIdDomain, parseLegalSource, pushOnOffElement, requiresXmlSpacePreserve, sanitizeExternalUrl, sanitizeXmlCharacters, serializeDocumentToDocx, serializeOnOffElement, validateDocumentModel, validateDocxPackage, validateLegalDraft };
|
|
3430
|
+
export { DOCX_CONFORMANCE_CLASSES, DOCX_PACKAGE_ISSUE_CODES, InvalidOoxmlNumericIdError, assertValidDocumentModel, assertValidOoxmlNumericId, assertValidOoxmlNumericIds, compileLegalSourceToDocument, compileLegalSourceToDocx, compileMarkdownToContent, escapeXmlAttribute, escapeXmlText, finalizeParagraphFormatting, hasIllegalXmlCharacters, isCanonicallyEmptyParagraphFormatting, isOoxmlNumericIdAttributeName, isValidOoxmlNumericId, mayContainInvalidOoxmlNumericIds, mayContainOoxmlNumericIds, ooxmlNumericIdDomain, parseLegalSource, pushOnOffElement, requiresXmlSpacePreserve, sanitizeExternalUrl, sanitizeXmlCharacters, serializeDocumentToDocx, serializeOnOffElement, setDocumentBodyComments, validateDocumentModel, validateDocxPackage, validateLegalDraft };
|
package/dist/model/document.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as Column, $i as UnrecognisedThemeColor, $n as TableContentCarrier, $r as TableCellBorders, $t as MoveFromRangeStart, A as ThemeColorScheme, Ai as headingLevelOf, An as SdtEndProperties, Ar as PRESET_LINE_DASH_VALS, At as Hyperlink, B as finalizeParagraphFormatting, Bi as TEXT_DIRECTIONS, Bn as ShapeFill, Br as ListRendering, Bt as ImageWrap, C as Relationship, Ci as paragraphNumberingSlots, Cn as PropertyChangeInfo, Cr as PreviewDescriptor, Ct as FooterReference, D as StyleDefinitions, Di as BODY_TEXT_OUTLINE_LEVEL, Dn as Run, Dr as isPresetLineDashVal, Dt as HeaderFooter, E as Style, Ei as sameStatedParagraphNumbering, En as ReviewCarrier, Er as UnrecognisedPresetLineDash, Et as FootnoteProperties, F as MAX_RETAINED_PARSE_WARNINGS_PER_CODE, Fi as NumberFormat, Fn as SectionPropertyChange, Fr as LevelLegacy, Ft as ImageFrameLocks, G as BidiControl, Gi as TextDirection, Gn as SimpleField, Gr as EmphasisMark, Gt as InstrTextContent, H as setDocumentBodyComments, Hi as TEXT_DIRECTION_FLOW_BY_TOKEN, Hn as ShapeOutline, Hr as NumberingInstance, Ht as InlineSdt, I as PARSE_WARNING_CODES, Ii as PARAGRAPH_ALIGNMENTS, In as SectionStart, Ir as LevelOverride, It as ImagePadding, J as BlockSdt, Ji as ColorValue, Jn as TabContent, Jr as ParagraphFormatting, Jt as MarkupRangeMarker, K as BlockContent, Ki as TextDirectionFlow, Kn as SoftHyphenContent, Kr as FloatingTableProperties, Kt as LineNumberRestart, L as ParseWarning, Li as ParagraphAlignment, Ln as Shape, Lr as LevelSuffix, Lt as ImagePosition, M as ThemeFontScheme, Mi as outlineLevelFromStatedValue, Mn as SdtType, Mr as AbstractNumbering, Mt as Image, N as IMPORTED_ID_COLLISION_KINDS, Ni as outlineLevelStatedValue, Nn as Section, Nr as COUNTER_FORMATS, Nt as ImageCrop, O as StyleType, Oi as HeadingOutlineLevel, On as RunContent, Or as presetLineDashFrom, Ot as HeaderFooterType, P as ImportedIdCollisionKind, Pi as NUMBER_FORMATS, Pn as SectionProperties, Pr as CounterFormat, Pt as ImageDocPrLink, Q as BreakContent, Qi as ThemeColorValue, Qn as TableCellPropertyChange, Qr as TableBorders, Qt as MoveFromRangeEnd, R as ParseWarningCode, Ri as TABLE_ALIGNMENTS, Rn as ShapeAlternateContent, Rr as ListLevel, Rt as ImageSize, S as MediaFile, Si as paragraphNumberingReferenceId, Sn as PropertyChange, Sr as relationshipIdOf, St as FoldedListNumber, T as RelationshipType, Ti as sameEffectiveParagraphNumbering, Tn as REVIEW_CARRIERS, Tr as PresetLineDashValue, Tt as FootnotePosition, U as getSingularRunPropertyChange, Ui as TabStopAlignment, Un as ShapeTextBody, Ur as CellMargins, Ut as InlineWrapper, V as isCanonicallyEmptyParagraphFormatting, Vi as TEXT_DIRECTION_FLOWS, Vn as ShapeGeometryAdjustment, Vr as NumberingDefinitions, Vt as ImageWrapPolygon, W as BIDI_CONTROLS, Wi as TableAlignment, Wn as ShapeType, Wr as ConditionalFormatStyle, Wt as Insertion, X as BookmarkRangeMarker, Xi as SCHEME_COLOR_VALUE_BY_THEME_COLOR, Xn as TableCell, Xr as TabLeader, Xt as MoveBookmarkMarker, Y as BookmarkEnd, Yi as ShadingProperties, Yn as Table, Yr as SpacingExplicit, Yt as MathEquation, Z as BookmarkStart, Zi as THEME_COLOR_BY_SCHEME_COLOR_VALUE, Zn as TableCellBlock, Zr as TabStop, Zt as MoveFrom, _ as DocDefaults, _a as statesNoBorder, _i as isNumberingReference, _n as PositionalTab, _r as WrapPolygonPoint, _t as EndnotePosition, a as DocumentSettings, aa as themeColorToken, ai as TablePropertyExceptionFormatting, an as NoteMarkerContent, ar as TableRowPropertyChange, at as DRAWING_RAW_XML_MODES, b as FontInfo, bi as paragraphNumberingLevel, bn as PreservedInline, br as RelationshipId, bt as FieldCharContent, c as NumberingLevelEntry, ca as THEME_COLORS, ci as TextEffect, cn as PARAGRAPH_MARK_CHANGE_KINDS, cr as TextContent, ct as DocumentBackground, d as numberingInstanceResolves, da as UnrecognisedBorderStyle, di as NO_NUMBERING_NUM_ID, dn as Paragraph, dr as TrackedRunChange, dt as DrawingAnchor, ea as isSchemeColorValue, ei as TableCellFormatting, en as MoveTo, er as TableCustomXmlWrapper, et as Comment, f as numberingLevelEntries, fa as borderStyleFrom, fi as NO_PARAGRAPH_NUMBERING, fn as ParagraphContent, fr as TrackedRunContent, ft as DrawingContent, g as ExhaustiveFields, ga as isBorderStyle, gi as ResolvedParagraphNumbering, gn as PictureWatermark, gr as WrapDistances, gt as Endnote, h as isNumberingLevel, ha as isBorderNone, hi as ParagraphNumberingSlots, hn as ParagraphPropertyChange, hr as WrapDistanceSlots, ht as EffectExtentSlots, i as Document, ia as themeColorSlot, ii as TableMeasurement, in as NonVisualDrawingNames, ir as TableRow, it as ComplexField, j as ThemeFont, ji as headingOutlineLevel, jn as SdtProperties, jr as PresetLineDashVal, k as Theme, ki as OutlineLevel, kn as RunPropertyChange, kr as presetLineDashToken, kt as HeaderReference, l as NumberingLevelResolution, la as ThemeColor, li as TextFormatting, ln as PROPERTY_REVISION_KINDS, lr as TextWatermark, lt as DocumentBackgroundDrawing, m as resolveNumberingLevel, ma as isBorderNil, mi as ParagraphNumberingReference, mn as ParagraphMarkChangeKind, mr as Watermark, mt as DrawingRawXmlMode, n as DEFAULT_TAB_STOP_TWIPS, na as knownThemeColor, ni as TableGridChange, nn as MoveToRangeStart, nr as TablePropertyChange, nt as CommentRangeStart, o as DocxConformanceClass, oa as SchemeColorSlot, oi as TableRowFormatting, on as NoteNumberRestart, or as TableStructuralChangeInfo, ot as Deletion, p as numberingLevelHasMarkerSlot, pa as borderStyleToken, pi as ParagraphNumberingOverride, pn as ParagraphMarkChange, pr as VerticalAlign, pt as DrawingGroupChild, q as BlockCustomXml, qi as BorderSpec, qn as SymbolContent, qr as LineSpacingRule, qt as MAX_REVISION_ID, r as DOCX_CONFORMANCE_CLASSES, ra as readThemeColor, ri as TableLook, rn as NoBreakHyphenContent, rr as TablePropertyExceptionChange, rt as CommentReference, s as DocxPackage, sa as SchemeColorValue, si as TableWidthType, sn as NoteReferenceContent, sr as TextBox, st as DisplacedByCustomXml, t as COMMENT_PART_RELATIONSHIPS, ta as isThemeColor, ti as TableFormatting, tn as MoveToRangeEnd, tr as TablePreservedMarkup, tt as CommentRangeEnd, u as levelShowsMarker, ua as BorderStyleValue, ui as UnderlineStyle, un as PageOrientation, ur as TrackedChangeInfo, ut as DocumentBody, v as EmbeddedFontRef, va as BORDER_STYLES, vi as mergeParagraphNumbering, vn as PositionedBookmarkMarker, vr as isOoxmlSymbolCharacter, vt as EndnoteProperties, w as RelationshipMap, wi as resolveParagraphNumbering, wn as PropertyRevisionKind, wr as PreviewShape, wt as Footnote, x as FontTable, xi as paragraphNumberingReference, xn as PreservedXmlContent, xr as mintRelationshipId, xt as FieldType, y as FontCharset, ya as BorderStyle, yi as paragraphNumberingFromSlots, yn as PreservedBlock, yr as normalizeRevisionId, yt as Field, z as ParseWarningLocation, zi as TAB_STOP_ALIGNMENTS, zn as ShapeContent, zr as ListMarkerFormatting, zt as ImageTransform } from "../document-BkGU2ctn.js";
|
|
2
2
|
import { n as PreservedChild, r as PreservedMarkup, t as PreservedAttribute } from "../preservedMarkup-G8XjWhs2.js";
|
|
3
|
-
export { type AbstractNumbering, BIDI_CONTROLS, BODY_TEXT_OUTLINE_LEVEL, BORDER_STYLES, type BidiControl, type BlockContent, type BlockCustomXml, type BlockSdt, type BookmarkEnd, type BookmarkRangeMarker, type BookmarkStart, type BorderSpec, type BorderStyle, type BorderStyleValue, type BreakContent, COMMENT_PART_RELATIONSHIPS, COUNTER_FORMATS, type CellMargins, type ColorValue, type Column, type Comment, type CommentRangeEnd, type CommentRangeStart, type CommentReference, type ComplexField, type ConditionalFormatStyle, type CounterFormat, DEFAULT_TAB_STOP_TWIPS, DOCX_CONFORMANCE_CLASSES, DRAWING_RAW_XML_MODES, type Deletion, type DisplacedByCustomXml, type DocDefaults, Document, type DocumentBackground, type DocumentBackgroundDrawing, type DocumentBody, DocumentSettings, DocxConformanceClass, DocxPackage, type DrawingAnchor, type DrawingContent, type DrawingGroupChild, type DrawingRawXmlMode, type EffectExtentSlots, type EmbeddedFontRef, type EmphasisMark, type Endnote, type EndnotePosition, type EndnoteProperties, type ExhaustiveFields, type Field, type FieldCharContent, type FieldType, type FloatingTableProperties, type FoldedListNumber, type FontCharset, type FontInfo, type FontTable, type FooterReference, type Footnote, type FootnotePosition, type FootnoteProperties, type HeaderFooter, type HeaderFooterType, type HeaderReference, type HeadingOutlineLevel, type Hyperlink, IMPORTED_ID_COLLISION_KINDS, type Image, type ImageCrop, type ImageDocPrLink, type ImageFrameLocks, type ImagePadding, type ImagePosition, type ImageSize, type ImageTransform, type ImageWrap, type ImageWrapPolygon, type ImportedIdCollisionKind, type InlineSdt, type InlineWrapper, type Insertion, type InstrTextContent, type LevelLegacy, type LevelOverride, type LevelSuffix, type LineNumberRestart, type LineSpacingRule, type ListLevel, type ListMarkerFormatting, type ListRendering, MAX_RETAINED_PARSE_WARNINGS_PER_CODE, MAX_REVISION_ID, type MarkupRangeMarker, type MathEquation, type MediaFile, type MoveBookmarkMarker, type MoveFrom, type MoveFromRangeEnd, type MoveFromRangeStart, type MoveTo, type MoveToRangeEnd, type MoveToRangeStart, NO_NUMBERING_NUM_ID, NO_PARAGRAPH_NUMBERING, NUMBER_FORMATS, type NoBreakHyphenContent, type NonVisualDrawingNames, type NoteMarkerContent, type NoteNumberRestart, type NoteReferenceContent, type NumberFormat, type NumberingDefinitions, type NumberingInstance, type OutlineLevel, PARAGRAPH_ALIGNMENTS, PARAGRAPH_MARK_CHANGE_KINDS, PARSE_WARNING_CODES, PRESET_LINE_DASH_VALS, PROPERTY_REVISION_KINDS, type PageOrientation, type Paragraph, type ParagraphAlignment, type ParagraphContent, type ParagraphFormatting, type ParagraphMarkChange, type ParagraphMarkChangeKind, type ParagraphNumberingOverride, type ParagraphNumberingReference, type ParagraphNumberingSlots, type ParagraphPropertyChange, type ParseWarning, type ParseWarningCode, type ParseWarningLocation, type PictureWatermark, type PositionalTab, type PositionedBookmarkMarker, type PreservedAttribute, type PreservedBlock, type PreservedChild, type PreservedInline, type PreservedMarkup, type PreservedXmlContent, type PresetLineDashVal, type PresetLineDashValue, type PreviewDescriptor, type PreviewShape, type PropertyChange, type PropertyChangeInfo, type PropertyRevisionKind, REVIEW_CARRIERS, type Relationship, type RelationshipId, type RelationshipMap, type RelationshipType, type ResolvedParagraphNumbering, type ReviewCarrier, type Run, type RunContent, type RunPropertyChange, SCHEME_COLOR_VALUE_BY_THEME_COLOR, type SchemeColorSlot, type SchemeColorValue, type SdtEndProperties, type SdtProperties, type SdtType, type Section, type SectionProperties, type SectionPropertyChange, type SectionStart, type ShadingProperties, type Shape, type ShapeAlternateContent, 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, TABLE_ALIGNMENTS, TAB_STOP_ALIGNMENTS, TEXT_DIRECTIONS, TEXT_DIRECTION_FLOWS, TEXT_DIRECTION_FLOW_BY_TOKEN, THEME_COLORS, THEME_COLOR_BY_SCHEME_COLOR_VALUE, type TabContent, type TabLeader, type TabStop, type TabStopAlignment, type Table, type TableAlignment, type TableBorders, type TableCell, type TableCellBlock, type TableCellBorders, type TableCellFormatting, type TableCellPropertyChange, type TableContentCarrier, type TableCustomXmlWrapper, type TableFormatting, type TableGridChange, type TableLook, type TableMeasurement, type TablePreservedMarkup, type TablePropertyChange, type TablePropertyExceptionChange, type TablePropertyExceptionFormatting, type TableRow, type TableRowFormatting, type TableRowPropertyChange, type TableStructuralChangeInfo, type TableWidthType, type TextBox, type TextContent, type TextDirection, type TextDirectionFlow, type TextEffect, type TextFormatting, type TextWatermark, type Theme, type ThemeColor, type ThemeColorScheme, type ThemeColorValue, type ThemeFont, type ThemeFontScheme, type TrackedChangeInfo, type TrackedRunChange, type TrackedRunContent, type UnderlineStyle, type UnrecognisedBorderStyle, type UnrecognisedPresetLineDash, type UnrecognisedThemeColor, type VerticalAlign, type Watermark, type WrapDistanceSlots, type WrapDistances, type WrapPolygonPoint, borderStyleFrom, borderStyleToken, getSingularRunPropertyChange, headingLevelOf, headingOutlineLevel, isBorderNil, isBorderNone, isBorderStyle, isNumberingLevel, isNumberingReference, isOoxmlSymbolCharacter, isPresetLineDashVal, isSchemeColorValue, isThemeColor, knownThemeColor, mergeParagraphNumbering, mintRelationshipId, normalizeRevisionId, outlineLevelFromStatedValue, outlineLevelStatedValue, paragraphNumberingFromSlots, paragraphNumberingLevel, paragraphNumberingReference, paragraphNumberingReferenceId, paragraphNumberingSlots, presetLineDashFrom, presetLineDashToken, readThemeColor, relationshipIdOf, resolveParagraphNumbering, sameEffectiveParagraphNumbering, sameStatedParagraphNumbering, statesNoBorder, themeColorSlot, themeColorToken };
|
|
3
|
+
export { type AbstractNumbering, BIDI_CONTROLS, BODY_TEXT_OUTLINE_LEVEL, BORDER_STYLES, type BidiControl, type BlockContent, type BlockCustomXml, type BlockSdt, type BookmarkEnd, type BookmarkRangeMarker, type BookmarkStart, type BorderSpec, type BorderStyle, type BorderStyleValue, type BreakContent, COMMENT_PART_RELATIONSHIPS, COUNTER_FORMATS, type CellMargins, type ColorValue, type Column, type Comment, type CommentRangeEnd, type CommentRangeStart, type CommentReference, type ComplexField, type ConditionalFormatStyle, type CounterFormat, DEFAULT_TAB_STOP_TWIPS, DOCX_CONFORMANCE_CLASSES, DRAWING_RAW_XML_MODES, type Deletion, type DisplacedByCustomXml, type DocDefaults, Document, type DocumentBackground, type DocumentBackgroundDrawing, type DocumentBody, DocumentSettings, DocxConformanceClass, DocxPackage, type DrawingAnchor, type DrawingContent, type DrawingGroupChild, type DrawingRawXmlMode, type EffectExtentSlots, type EmbeddedFontRef, type EmphasisMark, type Endnote, type EndnotePosition, type EndnoteProperties, type ExhaustiveFields, type Field, type FieldCharContent, type FieldType, type FloatingTableProperties, type FoldedListNumber, type FontCharset, type FontInfo, type FontTable, type FooterReference, type Footnote, type FootnotePosition, type FootnoteProperties, type HeaderFooter, type HeaderFooterType, type HeaderReference, type HeadingOutlineLevel, type Hyperlink, IMPORTED_ID_COLLISION_KINDS, type Image, type ImageCrop, type ImageDocPrLink, type ImageFrameLocks, type ImagePadding, type ImagePosition, type ImageSize, type ImageTransform, type ImageWrap, type ImageWrapPolygon, type ImportedIdCollisionKind, type InlineSdt, type InlineWrapper, type Insertion, type InstrTextContent, type LevelLegacy, type LevelOverride, type LevelSuffix, type LineNumberRestart, type LineSpacingRule, type ListLevel, type ListMarkerFormatting, type ListRendering, MAX_RETAINED_PARSE_WARNINGS_PER_CODE, MAX_REVISION_ID, type MarkupRangeMarker, type MathEquation, type MediaFile, type MoveBookmarkMarker, type MoveFrom, type MoveFromRangeEnd, type MoveFromRangeStart, type MoveTo, type MoveToRangeEnd, type MoveToRangeStart, NO_NUMBERING_NUM_ID, NO_PARAGRAPH_NUMBERING, NUMBER_FORMATS, type NoBreakHyphenContent, type NonVisualDrawingNames, type NoteMarkerContent, type NoteNumberRestart, type NoteReferenceContent, type NumberFormat, type NumberingDefinitions, type NumberingInstance, type NumberingLevelEntry, type NumberingLevelResolution, type OutlineLevel, PARAGRAPH_ALIGNMENTS, PARAGRAPH_MARK_CHANGE_KINDS, PARSE_WARNING_CODES, PRESET_LINE_DASH_VALS, PROPERTY_REVISION_KINDS, type PageOrientation, type Paragraph, type ParagraphAlignment, type ParagraphContent, type ParagraphFormatting, type ParagraphMarkChange, type ParagraphMarkChangeKind, type ParagraphNumberingOverride, type ParagraphNumberingReference, type ParagraphNumberingSlots, type ParagraphPropertyChange, type ParseWarning, type ParseWarningCode, type ParseWarningLocation, type PictureWatermark, type PositionalTab, type PositionedBookmarkMarker, type PreservedAttribute, type PreservedBlock, type PreservedChild, type PreservedInline, type PreservedMarkup, type PreservedXmlContent, type PresetLineDashVal, type PresetLineDashValue, type PreviewDescriptor, type PreviewShape, type PropertyChange, type PropertyChangeInfo, type PropertyRevisionKind, REVIEW_CARRIERS, type Relationship, type RelationshipId, type RelationshipMap, type RelationshipType, type ResolvedParagraphNumbering, type ReviewCarrier, type Run, type RunContent, type RunPropertyChange, SCHEME_COLOR_VALUE_BY_THEME_COLOR, type SchemeColorSlot, type SchemeColorValue, type SdtEndProperties, type SdtProperties, type SdtType, type Section, type SectionProperties, type SectionPropertyChange, type SectionStart, type ShadingProperties, type Shape, type ShapeAlternateContent, 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, TABLE_ALIGNMENTS, TAB_STOP_ALIGNMENTS, TEXT_DIRECTIONS, TEXT_DIRECTION_FLOWS, TEXT_DIRECTION_FLOW_BY_TOKEN, THEME_COLORS, THEME_COLOR_BY_SCHEME_COLOR_VALUE, type TabContent, type TabLeader, type TabStop, type TabStopAlignment, type Table, type TableAlignment, type TableBorders, type TableCell, type TableCellBlock, type TableCellBorders, type TableCellFormatting, type TableCellPropertyChange, type TableContentCarrier, type TableCustomXmlWrapper, type TableFormatting, type TableGridChange, type TableLook, type TableMeasurement, type TablePreservedMarkup, type TablePropertyChange, type TablePropertyExceptionChange, type TablePropertyExceptionFormatting, type TableRow, type TableRowFormatting, type TableRowPropertyChange, type TableStructuralChangeInfo, type TableWidthType, type TextBox, type TextContent, type TextDirection, type TextDirectionFlow, type TextEffect, type TextFormatting, type TextWatermark, type Theme, type ThemeColor, type ThemeColorScheme, type ThemeColorValue, type ThemeFont, type ThemeFontScheme, type TrackedChangeInfo, type TrackedRunChange, type TrackedRunContent, type UnderlineStyle, type UnrecognisedBorderStyle, type UnrecognisedPresetLineDash, type UnrecognisedThemeColor, type VerticalAlign, type Watermark, type WrapDistanceSlots, type WrapDistances, type WrapPolygonPoint, borderStyleFrom, borderStyleToken, finalizeParagraphFormatting, getSingularRunPropertyChange, headingLevelOf, headingOutlineLevel, isBorderNil, isBorderNone, isBorderStyle, isCanonicallyEmptyParagraphFormatting, isNumberingLevel, isNumberingReference, isOoxmlSymbolCharacter, isPresetLineDashVal, isSchemeColorValue, isThemeColor, knownThemeColor, levelShowsMarker, mergeParagraphNumbering, mintRelationshipId, normalizeRevisionId, numberingInstanceResolves, numberingLevelEntries, numberingLevelHasMarkerSlot, outlineLevelFromStatedValue, outlineLevelStatedValue, paragraphNumberingFromSlots, paragraphNumberingLevel, paragraphNumberingReference, paragraphNumberingReferenceId, paragraphNumberingSlots, presetLineDashFrom, presetLineDashToken, readThemeColor, relationshipIdOf, resolveNumberingLevel, resolveParagraphNumbering, sameEffectiveParagraphNumbering, sameStatedParagraphNumbering, setDocumentBodyComments, statesNoBorder, themeColorSlot, themeColorToken };
|
package/dist/model/document.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { BIDI_CONTROLS, BODY_TEXT_OUTLINE_LEVEL, BORDER_STYLES, COMMENT_PART_RELATIONSHIPS, COUNTER_FORMATS, DEFAULT_TAB_STOP_TWIPS, DOCX_CONFORMANCE_CLASSES, DRAWING_RAW_XML_MODES, IMPORTED_ID_COLLISION_KINDS, MAX_RETAINED_PARSE_WARNINGS_PER_CODE, MAX_REVISION_ID, NO_NUMBERING_NUM_ID, NO_PARAGRAPH_NUMBERING, NUMBER_FORMATS, PARAGRAPH_ALIGNMENTS, PARAGRAPH_MARK_CHANGE_KINDS, PARSE_WARNING_CODES, PRESET_LINE_DASH_VALS, PROPERTY_REVISION_KINDS, REVIEW_CARRIERS, SCHEME_COLOR_VALUE_BY_THEME_COLOR, TABLE_ALIGNMENTS, TAB_STOP_ALIGNMENTS, TEXT_DIRECTIONS, TEXT_DIRECTION_FLOWS, TEXT_DIRECTION_FLOW_BY_TOKEN, THEME_COLORS, THEME_COLOR_BY_SCHEME_COLOR_VALUE, borderStyleFrom, borderStyleToken, getSingularRunPropertyChange, headingLevelOf, headingOutlineLevel, isBorderNil, isBorderNone, isBorderStyle, isNumberingLevel, isNumberingReference, isOoxmlSymbolCharacter, isPresetLineDashVal, isSchemeColorValue, isThemeColor, knownThemeColor, mergeParagraphNumbering, mintRelationshipId, normalizeRevisionId, outlineLevelFromStatedValue, outlineLevelStatedValue, paragraphNumberingFromSlots, paragraphNumberingLevel, paragraphNumberingReference, paragraphNumberingReferenceId, paragraphNumberingSlots, presetLineDashFrom, presetLineDashToken, readThemeColor, relationshipIdOf, resolveParagraphNumbering, sameEffectiveParagraphNumbering, sameStatedParagraphNumbering, statesNoBorder, themeColorSlot, themeColorToken };
|
|
1
|
+
export { i as BIDI_CONTROLS, Y as BODY_TEXT_OUTLINE_LEVEL, A as BORDER_STYLES, t as COMMENT_PART_RELATIONSHIPS, y as COUNTER_FORMATS, n as DEFAULT_TAB_STOP_TWIPS, r as DOCX_CONFORMANCE_CLASSES, a as DRAWING_RAW_XML_MODES, pt as IMPORTED_ID_COLLISION_KINDS, mt as MAX_RETAINED_PARSE_WARNINGS_PER_CODE, s as MAX_REVISION_ID, tt as NO_NUMBERING_NUM_ID, nt as NO_PARAGRAPH_NUMBERING, j as NUMBER_FORMATS, M as PARAGRAPH_ALIGNMENTS, c as PARAGRAPH_MARK_CHANGE_KINDS, ht as PARSE_WARNING_CODES, C as PRESET_LINE_DASH_VALS, l as PROPERTY_REVISION_KINDS, u as REVIEW_CARRIERS, R as SCHEME_COLOR_VALUE_BY_THEME_COLOR, N as TABLE_ALIGNMENTS, P as TAB_STOP_ALIGNMENTS, F as TEXT_DIRECTIONS, I as TEXT_DIRECTION_FLOWS, L as TEXT_DIRECTION_FLOW_BY_TOKEN, K as THEME_COLORS, z as THEME_COLOR_BY_SCHEME_COLOR_VALUE, w as borderStyleFrom, T as borderStyleToken, gt as finalizeParagraphFormatting, yt as getSingularRunPropertyChange, X as headingLevelOf, Z as headingOutlineLevel, E as isBorderNil, D as isBorderNone, O as isBorderStyle, _t as isCanonicallyEmptyParagraphFormatting, et as isNumberingLevel, rt as isNumberingReference, f as isOoxmlSymbolCharacter, b as isPresetLineDashVal, B as isSchemeColorValue, V as isThemeColor, H as knownThemeColor, m as levelShowsMarker, it as mergeParagraphNumbering, q as mintRelationshipId, p as normalizeRevisionId, h as numberingInstanceResolves, g as numberingLevelEntries, _ as numberingLevelHasMarkerSlot, Q as outlineLevelFromStatedValue, $ as outlineLevelStatedValue, at as paragraphNumberingFromSlots, ot as paragraphNumberingLevel, st as paragraphNumberingReference, ct as paragraphNumberingReferenceId, lt as paragraphNumberingSlots, x as presetLineDashFrom, S as presetLineDashToken, U as readThemeColor, J as relationshipIdOf, v as resolveNumberingLevel, ut as resolveParagraphNumbering, dt as sameEffectiveParagraphNumbering, ft as sameStatedParagraphNumbering, vt as setDocumentBodyComments, k as statesNoBorder, W as themeColorSlot, G as themeColorToken } from "../document-oU-dz9zs.js";
|