@office-open/docx 0.10.2 → 0.10.4
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/{context-vnFOOEWL.mjs → context-CI0zR7rE.mjs} +133 -56
- package/dist/context-CI0zR7rE.mjs.map +1 -0
- package/dist/{core-properties-CcpNQvVY.d.mts → core-properties-Dp-aEoX3.d.mts} +241 -175
- package/dist/core-properties-Dp-aEoX3.d.mts.map +1 -0
- package/dist/{generate-DQkv8c9y.mjs → generate-B-n09INq.mjs} +62 -55
- package/dist/generate-B-n09INq.mjs.map +1 -0
- package/dist/generate.d.mts +1 -1
- package/dist/generate.mjs +1 -1
- package/dist/index.d.mts +2 -39
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/dist/{parse-ZZPID0vi.mjs → parse-D6c9kHXh.mjs} +11 -25
- package/dist/parse-D6c9kHXh.mjs.map +1 -0
- package/dist/parse.d.mts +1 -1
- package/dist/parse.mjs +1 -1
- package/dist/{parts-DvRRYUug.mjs → parts-DgrmHznM.mjs} +780 -559
- package/dist/parts-DgrmHznM.mjs.map +1 -0
- package/dist/patch/index.d.mts +1 -1
- package/dist/patch/index.d.mts.map +1 -1
- package/dist/patch/index.mjs +8 -19
- package/dist/patch/index.mjs.map +1 -1
- package/package.json +3 -3
- package/dist/context-vnFOOEWL.mjs.map +0 -1
- package/dist/core-properties-CcpNQvVY.d.mts.map +0 -1
- package/dist/generate-DQkv8c9y.mjs.map +0 -1
- package/dist/parse-ZZPID0vi.mjs.map +0 -1
- package/dist/parts-DvRRYUug.mjs.map +0 -1
package/dist/patch/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Yt as SectionChild, Zn as ParagraphChild, br as CommentOptions, za as RunOptions } from "../core-properties-Dp-aEoX3.mjs";
|
|
2
2
|
import { BasePatchOptions, CorePropertiesOptions, DataType, OutputByType, OutputType } from "@office-open/core";
|
|
3
3
|
|
|
4
4
|
//#region src/patch/from-docx.d.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/patch/from-docx.ts","../../src/patch/patch-detector.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/patch/from-docx.ts","../../src/patch/patch-detector.ts"],"mappings":";;;;KAyDY,YAAA,GAAe,IAAI,CAAC,cAAA;AAAA,KA4HpB,KAAA;EACN,IAAA;EAAmB,QAAA,YAAoB,UAAA,GAAa,cAAA;AAAA;EACpD,IAAA;EAAkB,QAAA,EAAU,YAAA;AAAA;AAAA,UAYjB,oBAAA,WACL,UAAA,GAAa,UAAA,UACf,gBAAA,CAAiB,CAAA;EAEzB,YAAA,GAAe,QAAA,CAAS,MAAA,SAAe,KAAA;EAEvC,WAAA,GAAc,QAAA,CAAS,MAAA,SAAe,KAAA;EAEtC,cAAA,GAAiB,OAAA,CAAQ,qBAAA;EACzB,kBAAA;EACA,SAAA;EAEA,MAAA,GAAS,YAAA;EAOT,QAAA;IACE,UAAA,GAAa,QAAA,CAAS,MAAA,SAAe,YAAA;IACrC,YAAA,GAAe,QAAA,CAAS,MAAA,SAAe,YAAA;EAAA;AAAA;AAAA,cAwB9B,aAAA,aAAiC,UAAA,GAAa,UAAA;EAAY,UAAA;EAAA,IAAA;EAAA,YAAA;EAAA,WAAA;EAAA,cAAA;EAAA,MAAA;EAAA,QAAA;EAAA,kBAAA;EAAA,qBAAA;EAAA;AAAA,GAWpE,oBAAA,CAAqB,CAAA,MAAK,OAAA,CAAQ,YAAA,CAAa,CAAA;;;UC7OxC,oBAAA;EACR,IAAA,EAAM,QAAQ;AAAA;AAAA,cA4BH,aAAA;EAAuB;AAAA,GAAU,oBAAA,KAAuB,OAAA"}
|
package/dist/patch/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DOCX_NS, OoxmlMimeType, TargetModeType, appendContentType, appendRelationship, applyCorePropertiesOverride, createReplacer, createTraverser, getNextRelationshipIndex, getReferencedMedia, replaceImagePlaceholders, strFromU8, toJson, toUint8Array, unzipSync, zipAndConvert } from "@office-open/core";
|
|
1
|
+
import { Mn as Media, dt as stringifyChildDispatch, ft as stringifyParagraphInline, p as commentsDesc, pt as stringifyRunInline, tt as DocumentAttributeNamespaces, ut as tableDesc } from "../parts-DgrmHznM.mjs";
|
|
2
|
+
import { DOCX_NS, OoxmlMimeType, TargetModeType, appendContentType, appendOverride, appendRelationship, applyCorePropertiesOverride, createReplacer, createTraverser, getNextRelationshipIndex, getReferencedMedia, nextNumericId, replaceImagePlaceholders, strFromU8, toJson, toUint8Array, unzipSync, zipAndConvert } from "@office-open/core";
|
|
3
3
|
import { escapeXml, js2xml, xml2js } from "@office-open/xml";
|
|
4
4
|
//#region src/patch/from-docx.ts
|
|
5
5
|
/** Reusable TextEncoder (stateless, safe to share). */
|
|
@@ -260,21 +260,16 @@ function makeElement(name, attributes = {}) {
|
|
|
260
260
|
function commentReferenceRun(id) {
|
|
261
261
|
return xml2js(`<w:r><w:rPr><w:rStyle w:val="CommentReference"/></w:rPr><w:commentReference w:id="${id}"/></w:r>`).elements[0];
|
|
262
262
|
}
|
|
263
|
-
/**
|
|
264
|
-
function
|
|
263
|
+
/** Next continuation id for an appended `<w:comment>` (-1 seed → 0 when none). */
|
|
264
|
+
function nextCommentId(commentsPart) {
|
|
265
265
|
const root = commentsPart?.elements?.find((e) => e.name === "w:comments");
|
|
266
|
-
|
|
267
|
-
for (const c of root?.elements ?? []) if (c.name === "w:comment") {
|
|
268
|
-
const id = Number(c.attributes?.["w:id"]);
|
|
269
|
-
if (Number.isFinite(id)) max = Math.max(max, id);
|
|
270
|
-
}
|
|
271
|
-
return max;
|
|
266
|
+
return nextNumericId(root, "w:comment", "w:id", -1);
|
|
272
267
|
}
|
|
273
268
|
/** Assign continuation ids to every requested comment anchor. */
|
|
274
269
|
function buildAssignedComments(zipContent, comments) {
|
|
275
270
|
if (!comments) return [];
|
|
276
271
|
const raw = zipContent["word/comments.xml"];
|
|
277
|
-
let nextId = raw ?
|
|
272
|
+
let nextId = raw ? nextCommentId(toJson(strFromU8(raw))) : 0;
|
|
278
273
|
const assigned = [];
|
|
279
274
|
if (comments.placeholders) for (const [key, list] of Object.entries(comments.placeholders)) for (const options of list) assigned.push({
|
|
280
275
|
id: nextId++,
|
|
@@ -352,14 +347,8 @@ function mergeCommentsPart(map, assigned, file) {
|
|
|
352
347
|
map.set(relsKey, relsJson);
|
|
353
348
|
appendRelationship(relsJson, getNextRelationshipIndex(relsJson), COMMENTS_REL_TYPE, "comments.xml");
|
|
354
349
|
}
|
|
355
|
-
const
|
|
356
|
-
if (
|
|
357
|
-
const els = typesEl.elements ?? (typesEl.elements = []);
|
|
358
|
-
if (!els.some((e) => e.name === "Override" && e.attributes?.["PartName"] === "/word/comments.xml")) els.push(makeElement("Override", {
|
|
359
|
-
PartName: "/word/comments.xml",
|
|
360
|
-
ContentType: COMMENTS_CONTENT_TYPE
|
|
361
|
-
}));
|
|
362
|
-
}
|
|
350
|
+
const contentTypes = map.get("[Content_Types].xml");
|
|
351
|
+
if (contentTypes) appendOverride(contentTypes, "/word/comments.xml", COMMENTS_CONTENT_TYPE);
|
|
363
352
|
}
|
|
364
353
|
//#endregion
|
|
365
354
|
//#region src/patch/patch-detector.ts
|
package/dist/patch/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/patch/from-docx.ts","../../src/patch/patch-detector.ts"],"sourcesContent":["import { TargetModeType } from \"@office-open/core\";\nimport {\n DOCX_NS,\n OoxmlMimeType,\n appendContentType,\n appendRelationship,\n applyCorePropertiesOverride,\n createReplacer,\n getNextRelationshipIndex,\n getReferencedMedia,\n replaceImagePlaceholders,\n strFromU8,\n toJson,\n unzipSync,\n zipAndConvert,\n} from \"@office-open/core\";\nimport type {\n BasePatchOptions,\n CorePropertiesOptions,\n OutputByType,\n OutputType,\n} from \"@office-open/core\";\nimport { toUint8Array } from \"@office-open/core\";\nimport { escapeXml, js2xml, xml2js } from \"@office-open/xml\";\nimport type { Element } from \"@office-open/xml\";\nimport { commentsDesc } from \"@parts/comments\";\nimport { DocumentAttributeNamespaces } from \"@parts/document\";\nimport {\n stringifyChildDispatch,\n stringifyParagraphInline,\n stringifyRunInline,\n} from \"@parts/inline\";\nimport type { ParagraphChild } from \"@parts/paragraph/paragraph\";\nimport type { ParagraphOptions } from \"@parts/paragraph/paragraph\";\nimport type { CommentOptions } from \"@parts/paragraph/run/comment-run\";\nimport type { RunOptions } from \"@parts/paragraph/run/run\";\nimport { tableDesc } from \"@parts/table/descriptor\";\nimport type { TableOptions } from \"@parts/table/table\";\nimport { Media } from \"@shared/media\";\nimport type { SectionChild } from \"@shared/section\";\n\nimport type { BodyContext } from \"../context\";\nimport type { ViewWrapper } from \"../context\";\n\n/** Reusable TextEncoder (stateless, safe to share). */\nconst encoder = new TextEncoder();\n\nconst COMMENTS_REL_TYPE =\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments\";\nconst COMMENTS_CONTENT_TYPE =\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\";\n\n/** A comment injected by patch — same as CommentOptions but without an id\n * (the patch assigns continuation ids). */\nexport type PatchComment = Omit<CommentOptions, \"id\">;\n\n/** A comment request resolved to an id and an anchor (paragraph index or placeholder). */\ninterface AssignedComment {\n id: number;\n anchor: { kind: \"paragraph\"; index: number } | { kind: \"placeholder\"; key: string };\n options: PatchComment;\n}\n\n/**\n * Document patching module for modifying existing .docx files.\n *\n * Uses compile-path stringifiers (zero class instantiation) to serialize\n * patch content — no Formatter, no XmlComponent instances.\n *\n * @module\n */\n\n// ── Patch content stringification ──\n\n/**\n * Lightweight BodyContext adapter for patch serialization.\n * Captures hyperlink and image relationships for post-processing.\n */\nfunction createPatchContext(\n file: { media: Media },\n hyperlinkSink: Array<{ id: string; link: string }>,\n): BodyContext {\n return {\n fileData: file as unknown as BodyContext[\"fileData\"],\n file: file as unknown as BodyContext[\"file\"],\n viewWrapper: {\n relationships: {\n addRelationship: (linkId: string, _type: string, target: string, _mode?: string) => {\n hyperlinkSink.push({ id: linkId, link: target });\n },\n relationshipCount: 0,\n },\n } as unknown as BodyContext[\"viewWrapper\"],\n stringifyChild: () => \"\",\n addRelationship: () => \"\",\n addMedia: () => \"\",\n };\n}\n\n/**\n * Serialize a patch child (SectionChild / ParagraphChild / string) into XML\n * elements via the compile-path stringifiers. Shared by the placeholder\n * replacer and body-level `append`. Relies on the module-level\n * {@link currentPatchCtx} for relationship/media sinks.\n */\nconst formatChildElement = (child: unknown): Element[] => {\n let xmlStr: string;\n\n if (typeof child === \"string\") {\n // Plain string → simple run\n xmlStr = `<w:r><w:t xml:space=\"preserve\">${escapeXml(child)}</w:t></w:r>`;\n } else if (typeof child === \"object\" && child !== null) {\n const obj = child as Record<string, unknown>;\n // SectionChild level (paragraph / table) — for DOCUMENT patches and append\n if (\"paragraph\" in obj) {\n xmlStr = stringifyParagraphInline(obj.paragraph as ParagraphOptions, currentPatchCtx);\n } else if (\"table\" in obj) {\n xmlStr = tableDesc.stringify(obj.table as TableOptions, currentPatchCtx) ?? \"\";\n } else {\n // ParagraphChild level — for PARAGRAPH patches\n // Try compile-path JSON child dispatch first\n const jr = stringifyChildDispatch(child as ParagraphChild, currentPatchCtx);\n if (jr !== undefined) {\n xmlStr = Array.isArray(jr) ? jr.join(\"\") : jr;\n } else {\n // RunOptions (plain objects with text/children/bold/etc.)\n xmlStr = stringifyRunInline(child as RunOptions, currentPatchCtx);\n }\n }\n } else {\n xmlStr = \"<w:r/>\";\n }\n\n const jsonObj = xml2js(xmlStr, { captureSpacesBetweenElements: true });\n return [jsonObj.elements![0]];\n};\n\nconst docxReplacer = createReplacer({\n ns: DOCX_NS,\n formatChild: formatChildElement,\n});\n\n/**\n * Splice block-level children into `<w:body>` before the trailing `<w:sectPr>`\n * (the final section properties). If the body has no trailing sectPr, append at\n * the end. Reuses {@link formatChildElement} so the same serialization and\n * relationship/media sinks apply as placeholder patches.\n */\nconst appendToBody = (root: Element, children: SectionChild[]): void => {\n const docEl = root.elements?.find((e) => e.name === \"w:document\");\n const body = docEl?.elements?.find((e) => e.name === \"w:body\");\n if (!body) return;\n const els = body.elements ?? (body.elements = []);\n const newEls: Element[] = [];\n for (const child of children) {\n newEls.push(...formatChildElement(child));\n }\n // Insert before the trailing <w:sectPr>; otherwise at the end.\n let insertAt = els.length;\n for (let i = els.length - 1; i >= 0; i--) {\n if (els[i].name === \"w:sectPr\") {\n insertAt = i;\n break;\n }\n }\n els.splice(insertAt, 0, ...newEls);\n};\n\n/** Current patch context — set per file in the main loop. */\nlet currentPatchCtx: BodyContext;\n\n/**\n * A patch operation: replace a placeholder with either inline run-level\n * content (`type: \"paragraph\"`) or block-level content (`type: \"document\"`).\n *\n * The `type` is a bare string literal (no PatchType enum) — the core\n * replacer already discriminates on `patch.type`.\n */\nexport type Patch =\n | { type: \"paragraph\"; children: (string | RunOptions | ParagraphChild)[] }\n | { type: \"document\"; children: SectionChild[] };\n\ninterface ImageRelationshipAddition {\n key: string;\n mediaDatas: { fileName: string }[];\n}\n\ninterface HyperlinkRelationshipAddition {\n key: string;\n hyperlink: { id: string; link: string };\n}\n\nexport interface PatchDocumentOptions<\n T extends OutputType = OutputType,\n> extends BasePatchOptions<T> {\n /** Placeholder substitutions: `{{key}}` (per delimiters) → patch content. */\n placeholders?: Readonly<Record<string, Patch>>;\n /** Literal find/replace: the find string → patch content (no delimiters added). */\n findReplace?: Readonly<Record<string, Patch>>;\n /** Core-properties metadata override (merged over the existing docProps/core.xml). */\n coreProperties?: Partial<CorePropertiesOptions>;\n keepOriginalStyles?: boolean;\n recursive?: boolean;\n /** Block-level content appended to the document body, before the final section break. */\n append?: SectionChild[];\n /**\n * Comments to inject. `paragraphs` anchors a comment to the Nth body paragraph\n * (0-based, wraps the whole paragraph); `placeholders` anchors to the run\n * containing a {{key}} (wrapped before placeholder substitution). Ids are\n * continued from any existing word/comments.xml; entries are merged in.\n */\n comments?: {\n paragraphs?: Readonly<Record<number, PatchComment[]>>;\n placeholders?: Readonly<Record<string, PatchComment[]>>;\n };\n}\n\nconst UTF16LE = new Uint8Array([0xff, 0xfe]);\nconst UTF16BE = new Uint8Array([0xfe, 0xff]);\n\nconst compareByteArrays = (a: Uint8Array, b: Uint8Array): boolean => {\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n};\n\n/**\n * Patches an existing .docx document by replacing placeholders with new content.\n *\n * @publicApi\n */\nexport const patchDocument = async <T extends OutputType = OutputType>({\n outputType,\n data,\n placeholders,\n findReplace,\n coreProperties,\n append,\n comments,\n keepOriginalStyles = true,\n placeholderDelimiters = { end: \"}}\", start: \"{{\" } as const,\n recursive = true,\n}: PatchDocumentOptions<T>): Promise<OutputByType[T]> => {\n const zipContent = unzipSync(toUint8Array(data));\n const contexts = new Map<string, BodyContext>();\n const media = new Media();\n const file = { media } as BodyContext[\"file\"];\n\n // Resolve comment ids by continuation from any existing word/comments.xml.\n const assignedComments = buildAssignedComments(zipContent, comments);\n\n const map = new Map<string, Element>();\n\n const imageRelationshipAdditions: ImageRelationshipAddition[] = [];\n const hyperlinkRelationshipAdditions: HyperlinkRelationshipAddition[] = [];\n let hasMedia = false;\n\n const binaryContentMap = new Map<string, Uint8Array>();\n\n for (const [key, value] of Object.entries(zipContent)) {\n const startBytes = value.slice(0, 2);\n if (compareByteArrays(startBytes, UTF16LE) || compareByteArrays(startBytes, UTF16BE)) {\n binaryContentMap.set(key, value);\n continue;\n }\n\n if (!key.endsWith(\".xml\") && !key.endsWith(\".rels\")) {\n binaryContentMap.set(key, value);\n continue;\n }\n\n const json = toJson(strFromU8(value));\n\n if (key === \"word/document.xml\") {\n const document = json.elements?.find((i) => i.name === \"w:document\");\n if (document && document.attributes) {\n for (const ns of [\"mc\", \"wp\", \"r\", \"w15\", \"m\"] as const) {\n document.attributes[`xmlns:${ns}`] = DocumentAttributeNamespaces[ns];\n }\n document.attributes[\"mc:Ignorable\"] =\n `${document.attributes[\"mc:Ignorable\"] || \"\"} w15`.trim();\n }\n }\n\n if (key.startsWith(\"word/\") && !key.endsWith(\".xml.rels\")) {\n const hyperlinkSink: Array<{ id: string; link: string }> = [];\n\n const context: BodyContext = {\n fileData: file,\n file,\n viewWrapper: {\n relationships: {\n addRelationship: (\n linkId: string,\n _: string,\n target: string,\n __: (typeof TargetModeType)[keyof typeof TargetModeType],\n ) => {\n hyperlinkRelationshipAdditions.push({\n hyperlink: {\n id: linkId,\n link: target,\n },\n key,\n });\n },\n },\n } as unknown as ViewWrapper,\n stringifyChild: () => \"\",\n addRelationship: () => \"\",\n addMedia: () => \"\",\n };\n contexts.set(key, context);\n\n if (!placeholderDelimiters?.start.trim() || !placeholderDelimiters?.end.trim()) {\n throw new Error(\"Both start and end delimiters must be non-empty strings.\");\n }\n\n const { start, end } = placeholderDelimiters;\n\n // Create compile-path context for stringifying patch children\n const patchCtx = createPatchContext(file, hyperlinkSink);\n currentPatchCtx = patchCtx;\n\n // Anchor placeholder comments BEFORE substitution, wrapping the {{key}} run.\n if (key === \"word/document.xml\") {\n for (const ac of assignedComments) {\n if (ac.anchor.kind === \"placeholder\") {\n wrapPlaceholderComment(json, `${start}${ac.anchor.key}${end}`, ac.id);\n }\n }\n }\n\n // Build (find-text → patch) entries. Placeholders wrap the key in\n // delimiters; findReplace uses the literal key. Both share one engine.\n const entries: Array<{ find: string; patch: Patch }> = [];\n if (placeholders) {\n for (const [key, value] of Object.entries(placeholders)) {\n entries.push({ find: `${start}${key}${end}`, patch: value });\n }\n }\n if (findReplace) {\n for (const [key, value] of Object.entries(findReplace)) {\n entries.push({ find: key, patch: value });\n }\n }\n\n for (const { find: patchText, patch: patchValue } of entries) {\n while (true) {\n const { didFindOccurrence } = docxReplacer({\n context,\n json,\n keepOriginalStyles,\n patch: patchValue,\n patchText,\n });\n if (!recursive || !didFindOccurrence) {\n break;\n }\n }\n }\n\n // Append block-level children to the document body before the final sectPr.\n if (append && append.length > 0 && key === \"word/document.xml\") {\n appendToBody(json, append);\n }\n\n // Anchor paragraph comments AFTER body edits, wrapping the Nth paragraph.\n if (key === \"word/document.xml\") {\n for (const ac of assignedComments) {\n if (ac.anchor.kind === \"paragraph\") {\n wrapParagraphComment(json, ac.anchor.index, ac.id);\n }\n }\n }\n\n // Flush hyperlink relationships captured by the compile-path context\n for (const hl of hyperlinkSink) {\n hyperlinkRelationshipAdditions.push({\n hyperlink: { id: hl.id, link: hl.link },\n key,\n });\n }\n\n const mediaDatas = getReferencedMedia(JSON.stringify(json), media.array);\n if (mediaDatas.length > 0) {\n hasMedia = true;\n imageRelationshipAdditions.push({\n key,\n mediaDatas,\n });\n }\n }\n\n map.set(key, json);\n }\n\n // Merge injected comments into word/comments.xml + wire rels + content types.\n if (assignedComments.length > 0) {\n mergeCommentsPart(map, assignedComments, file);\n }\n\n for (const { key, mediaDatas } of imageRelationshipAdditions) {\n const relationshipKey = `word/_rels/${key.split(\"/\").pop()}.rels`;\n const relationshipsJson = map.get(relationshipKey) ?? createRelationshipFile();\n map.set(relationshipKey, relationshipsJson);\n\n const index = getNextRelationshipIndex(relationshipsJson);\n const newJson = replaceImagePlaceholders(\n JSON.stringify(map.get(key)),\n mediaDatas,\n index,\n \"plain\",\n );\n map.set(key, JSON.parse(newJson) as Element);\n\n for (let i = 0; i < mediaDatas.length; i++) {\n const { fileName } = mediaDatas[i];\n appendRelationship(\n relationshipsJson,\n index + i,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\",\n `media/${fileName}`,\n );\n }\n }\n\n for (const { key, hyperlink } of hyperlinkRelationshipAdditions) {\n const relationshipKey = `word/_rels/${key.split(\"/\").pop()}.rels`;\n\n const relationshipsJson = map.get(relationshipKey) ?? createRelationshipFile();\n map.set(relationshipKey, relationshipsJson);\n\n appendRelationship(\n relationshipsJson,\n hyperlink.id,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink\",\n hyperlink.link,\n TargetModeType.EXTERNAL,\n );\n }\n\n if (hasMedia) {\n const contentTypesJson = map.get(\"[Content_Types].xml\");\n\n if (!contentTypesJson) {\n throw new Error(\"Could not find content types file\");\n }\n\n appendContentType(contentTypesJson, \"image/png\", \"png\");\n appendContentType(contentTypesJson, \"image/jpeg\", \"jpeg\");\n appendContentType(contentTypesJson, \"image/jpeg\", \"jpg\");\n appendContentType(contentTypesJson, \"image/bmp\", \"bmp\");\n appendContentType(contentTypesJson, \"image/gif\", \"gif\");\n appendContentType(contentTypesJson, \"image/svg+xml\", \"svg\");\n }\n\n const files: Record<string, Uint8Array> = {};\n const XML_DECL = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>';\n\n for (const [key, value] of map) {\n files[key] =\n key === \"docProps/core.xml\" && coreProperties\n ? encoder.encode(XML_DECL + applyCorePropertiesOverride(value, coreProperties))\n : encoder.encode(js2xml(value));\n }\n\n for (const [key, value] of binaryContentMap) {\n files[key] = value;\n }\n\n for (const { data: mediaData, fileName } of media.array) {\n files[`word/media/${fileName}`] =\n mediaData instanceof Uint8Array ? mediaData : new Uint8Array(mediaData);\n }\n\n return await zipAndConvert(files, outputType, OoxmlMimeType.DOCX);\n};\n\nconst createRelationshipFile = (): Element => ({\n declaration: {\n attributes: {\n encoding: \"UTF-8\",\n standalone: \"yes\",\n version: \"1.0\",\n },\n },\n elements: [\n {\n attributes: {\n xmlns: \"http://schemas.openxmlformats.org/package/2006/relationships\",\n },\n elements: [],\n name: \"Relationships\",\n type: \"element\",\n },\n ],\n});\n\n/** Build a bare OOXML element node with attributes and no children. */\nfunction makeElement(name: string, attributes: Record<string, string> = {}): Element {\n return { type: \"element\", name, attributes, elements: [] };\n}\n\n/** A `<w:r>` carrying a `<w:commentReference>` (CommentReference run style). */\nfunction commentReferenceRun(id: number): Element {\n return xml2js(\n `<w:r><w:rPr><w:rStyle w:val=\"CommentReference\"/></w:rPr><w:commentReference w:id=\"${id}\"/></w:r>`,\n ).elements![0];\n}\n\n/** Largest `w:id` among existing `<w:comment>` entries (-1 when none). */\nfunction maxCommentId(commentsPart: Element | undefined): number {\n const root = commentsPart?.elements?.find((e) => e.name === \"w:comments\");\n let max = -1;\n for (const c of root?.elements ?? []) {\n if (c.name === \"w:comment\") {\n const id = Number(c.attributes?.[\"w:id\"]);\n if (Number.isFinite(id)) max = Math.max(max, id);\n }\n }\n return max;\n}\n\n/** Assign continuation ids to every requested comment anchor. */\nfunction buildAssignedComments(\n zipContent: Record<string, Uint8Array>,\n comments: PatchDocumentOptions[\"comments\"],\n): AssignedComment[] {\n if (!comments) return [];\n const raw = zipContent[\"word/comments.xml\"];\n let nextId = raw ? maxCommentId(toJson(strFromU8(raw))) + 1 : 0;\n const assigned: AssignedComment[] = [];\n if (comments.placeholders) {\n for (const [key, list] of Object.entries(comments.placeholders)) {\n for (const options of list) {\n assigned.push({ id: nextId++, anchor: { kind: \"placeholder\", key }, options });\n }\n }\n }\n if (comments.paragraphs) {\n for (const [indexStr, list] of Object.entries(comments.paragraphs)) {\n const index = Number(indexStr);\n for (const options of list) {\n assigned.push({ id: nextId++, anchor: { kind: \"paragraph\", index }, options });\n }\n }\n }\n return assigned;\n}\n\n/** Wrap the Nth body paragraph with comment range markers + a reference run. */\nfunction wrapParagraphComment(json: Element, index: number, commentId: number): void {\n const body = json.elements\n ?.find((e) => e.name === \"w:document\")\n ?.elements?.find((e) => e.name === \"w:body\");\n if (!body) return;\n const paragraphs = (body.elements ?? []).filter((e) => e.name === \"w:p\");\n const target = paragraphs[index];\n if (!target) {\n throw new Error(`patchDocument: no paragraph at index ${index} to comment`);\n }\n const els = target.elements ?? (target.elements = []);\n const start = makeElement(\"w:commentRangeStart\", { \"w:id\": String(commentId) });\n const end = makeElement(\"w:commentRangeEnd\", { \"w:id\": String(commentId) });\n // Insert start after a leading <w:pPr> (or at the head); end + ref at the tail.\n const insertAt = els.length > 0 && els[0].name === \"w:pPr\" ? 1 : 0;\n els.splice(insertAt, 0, start);\n els.push(end, commentReferenceRun(commentId));\n}\n\n/** Wrap the first run whose `<w:t>` contains the placeholder with comment markers. */\nfunction wrapPlaceholderComment(json: Element, placeholder: string, commentId: number): void {\n const body = json.elements\n ?.find((e) => e.name === \"w:document\")\n ?.elements?.find((e) => e.name === \"w:body\");\n if (!body) return;\n for (const p of body.elements ?? []) {\n if (p.name !== \"w:p\") continue;\n const els = p.elements ?? [];\n for (let i = 0; i < els.length; i++) {\n if (els[i].name !== \"w:r\") continue;\n const t = (els[i].elements ?? []).find((e) => e.name === \"w:t\");\n const text = t?.elements?.[0]?.text;\n if (typeof text === \"string\" && text.includes(placeholder)) {\n els.splice(i, 0, makeElement(\"w:commentRangeStart\", { \"w:id\": String(commentId) }));\n els.splice(\n i + 2,\n 0,\n makeElement(\"w:commentRangeEnd\", { \"w:id\": String(commentId) }),\n commentReferenceRun(commentId),\n );\n return; // only the first occurrence\n }\n }\n }\n}\n\n/**\n * Merge assigned comments into word/comments.xml (appending to an existing part\n * or creating one) and wire document.xml.rels + content types when newly added.\n */\nfunction mergeCommentsPart(\n map: Map<string, Element>,\n assigned: AssignedComment[],\n file: { media: Media },\n): void {\n const newOpts: CommentOptions[] = assigned.map((ac) => ({ id: ac.id, ...ac.options }));\n const ctx = createPatchContext(file, []);\n const newXml = commentsDesc.stringify({ children: newOpts }, ctx) ?? \"\";\n const existingEl = map.get(\"word/comments.xml\");\n const wasNew = !existingEl;\n\n if (existingEl) {\n // Append new <w:comment> elements to the existing <w:comments> root.\n const existingRoot = existingEl.elements?.find((e) => e.name === \"w:comments\");\n const newRoot = xml2js(newXml).elements?.find((e) => e.name === \"w:comments\");\n existingRoot?.elements?.push(...(newRoot?.elements ?? []));\n } else {\n map.set(\n \"word/comments.xml\",\n toJson(`<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>${newXml}`),\n );\n }\n\n if (wasNew) {\n const relsKey = \"word/_rels/document.xml.rels\";\n const relsJson = map.get(relsKey) ?? createRelationshipFile();\n map.set(relsKey, relsJson);\n appendRelationship(\n relsJson,\n getNextRelationshipIndex(relsJson),\n COMMENTS_REL_TYPE,\n \"comments.xml\",\n );\n }\n\n // Content types — ensure the comments Override exists (deduped). An existing\n // comments part normally already declares it, but defend against incomplete templates.\n const typesEl = map.get(\"[Content_Types].xml\")?.elements?.find((e) => e.name === \"Types\");\n if (typesEl) {\n const els = typesEl.elements ?? (typesEl.elements = []);\n if (\n !els.some((e) => e.name === \"Override\" && e.attributes?.[\"PartName\"] === \"/word/comments.xml\")\n ) {\n els.push(\n makeElement(\"Override\", {\n PartName: \"/word/comments.xml\",\n ContentType: COMMENTS_CONTENT_TYPE,\n }),\n );\n }\n }\n}\n","/**\n * Patch detector for discovering placeholders in document templates.\n *\n * @module\n */\nimport { DOCX_NS, createTraverser, strFromU8, toJson, unzipSync } from \"@office-open/core\";\nimport { toUint8Array } from \"@office-open/core\";\nimport type { DataType } from \"@office-open/core\";\n\n/**\n * Options for patch detection.\n *\n * @property data - The document template to scan for placeholders\n */\ninterface PatchDetectorOptions {\n data: DataType;\n}\n\n/**\n * Detects all placeholders present in a document template.\n *\n * Scans through all XML content in a .docx file to find placeholder text\n * enclosed in delimiters (default: {{placeholder}}). This is useful for\n * discovering what patches a template expects before performing replacement.\n *\n * @param options - Patch detector configuration\n * @returns Array of placeholder keys found in the document\n *\n * @example\n * ```typescript\n * const placeholders = await patchDetector({ data: templateBuffer });\n * // Returns: [\"name\", \"date\", \"address\"] if template contains {{name}}, {{date}}, {{address}}\n *\n * // Use detected placeholders to create patches\n * const patches = {};\n * for (const key of placeholders) {\n * patches[key] = {\n * type: \"paragraph\",\n * children: [new TextRun(getUserData(key))],\n * };\n * });\n * ```\n */\nexport const patchDetector = async ({ data }: PatchDetectorOptions): Promise<string[]> => {\n const zipContent = unzipSync(toUint8Array(data));\n const patches = new Set<string>();\n\n for (const [key, value] of Object.entries(zipContent)) {\n if (!key.endsWith(\".xml\") && !key.endsWith(\".rels\")) {\n continue;\n }\n if (key.startsWith(\"word/\") && !key.endsWith(\".xml.rels\")) {\n const json = toJson(strFromU8(value));\n const { traverse } = createTraverser(DOCX_NS);\n for (const p of traverse(json)) {\n for (const patch of findPatchKeys(p.text)) {\n patches.add(patch);\n }\n }\n }\n }\n return [...patches];\n};\n\n/**\n * Extracts placeholder keys from text using regex pattern.\n *\n * @param text - Text to search for placeholders\n * @returns Array of placeholder keys (without delimiters)\n */\nconst findPatchKeys = (text: string): string[] => {\n const pattern = /(?<=\\{\\{).+?(?=\\}\\})/gs;\n return text.match(pattern) ?? [];\n};\n"],"mappings":";;;;;AA6CA,MAAM,UAAU,IAAI,YAAY;AAEhC,MAAM,oBACJ;AACF,MAAM,wBACJ;;;;;;;;;;;;;AA4BF,SAAS,mBACP,MACA,eACa;CACb,OAAO;EACL,UAAU;EACJ;EACN,aAAa,EACX,eAAe;GACb,kBAAkB,QAAgB,OAAe,QAAgB,UAAmB;IAClF,cAAc,KAAK;KAAE,IAAI;KAAQ,MAAM;IAAO,CAAC;GACjD;GACA,mBAAmB;EACrB,EACF;EACA,sBAAsB;EACtB,uBAAuB;EACvB,gBAAgB;CAClB;AACF;;;;;;;AAQA,MAAM,sBAAsB,UAA8B;CACxD,IAAI;CAEJ,IAAI,OAAO,UAAU,UAEnB,SAAS,kCAAkC,UAAU,KAAK,EAAE;MACvD,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM;EACtD,MAAM,MAAM;EAEZ,IAAI,eAAe,KACjB,SAAS,yBAAyB,IAAI,WAA+B,eAAe;OAC/E,IAAI,WAAW,KACpB,SAAS,UAAU,UAAU,IAAI,OAAuB,eAAe,KAAK;OACvE;GAGL,MAAM,KAAK,uBAAuB,OAAyB,eAAe;GAC1E,IAAI,OAAO,KAAA,GACT,SAAS,MAAM,QAAQ,EAAE,IAAI,GAAG,KAAK,EAAE,IAAI;QAG3C,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|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/patch/from-docx.ts","../../src/patch/patch-detector.ts"],"sourcesContent":["import { TargetModeType } from \"@office-open/core\";\nimport {\n DOCX_NS,\n OoxmlMimeType,\n appendContentType,\n appendOverride,\n appendRelationship,\n applyCorePropertiesOverride,\n createReplacer,\n getNextRelationshipIndex,\n getReferencedMedia,\n nextNumericId,\n replaceImagePlaceholders,\n strFromU8,\n toJson,\n unzipSync,\n zipAndConvert,\n} from \"@office-open/core\";\nimport type {\n BasePatchOptions,\n CorePropertiesOptions,\n OutputByType,\n OutputType,\n} from \"@office-open/core\";\nimport { toUint8Array } from \"@office-open/core\";\nimport { escapeXml, js2xml, xml2js } from \"@office-open/xml\";\nimport type { Element } from \"@office-open/xml\";\nimport { commentsDesc } from \"@parts/comments\";\nimport { DocumentAttributeNamespaces } from \"@parts/document\";\nimport {\n stringifyChildDispatch,\n stringifyParagraphInline,\n stringifyRunInline,\n} from \"@parts/inline\";\nimport type { ParagraphChild } from \"@parts/paragraph/paragraph\";\nimport type { ParagraphOptions } from \"@parts/paragraph/paragraph\";\nimport type { CommentOptions } from \"@parts/paragraph/run/comment-run\";\nimport type { RunOptions } from \"@parts/paragraph/run/run\";\nimport { tableDesc } from \"@parts/table/descriptor\";\nimport type { TableOptions } from \"@parts/table/table\";\nimport { Media } from \"@shared/media\";\nimport type { MediaData } from \"@shared/media/data\";\nimport type { SectionChild } from \"@shared/section\";\n\nimport type { BodyContext } from \"../context\";\nimport type { ViewWrapper } from \"../context\";\n\n/** Reusable TextEncoder (stateless, safe to share). */\nconst encoder = new TextEncoder();\n\nconst COMMENTS_REL_TYPE =\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments\";\nconst COMMENTS_CONTENT_TYPE =\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\";\n\n/** A comment injected by patch — same as CommentOptions but without an id\n * (the patch assigns continuation ids). */\nexport type PatchComment = Omit<CommentOptions, \"id\">;\n\n/** A comment request resolved to an id and an anchor (paragraph index or placeholder). */\ninterface AssignedComment {\n id: number;\n anchor: { kind: \"paragraph\"; index: number } | { kind: \"placeholder\"; key: string };\n options: PatchComment;\n}\n\n/**\n * Document patching module for modifying existing .docx files.\n *\n * Uses compile-path stringifiers (zero class instantiation) to serialize\n * patch content — no Formatter, no XmlComponent instances.\n *\n * @module\n */\n\n// ── Patch content stringification ──\n\n/**\n * Lightweight BodyContext adapter for patch serialization.\n * Captures hyperlink and image relationships for post-processing.\n */\nfunction createPatchContext(\n file: { media: Media<MediaData> },\n hyperlinkSink: Array<{ id: string; link: string }>,\n): BodyContext {\n return {\n fileData: file as unknown as BodyContext[\"fileData\"],\n file: file as unknown as BodyContext[\"file\"],\n viewWrapper: {\n relationships: {\n addRelationship: (linkId: string, _type: string, target: string, _mode?: string) => {\n hyperlinkSink.push({ id: linkId, link: target });\n },\n relationshipCount: 0,\n },\n } as unknown as BodyContext[\"viewWrapper\"],\n stringifyChild: () => \"\",\n addRelationship: () => \"\",\n addMedia: () => \"\",\n };\n}\n\n/**\n * Serialize a patch child (SectionChild / ParagraphChild / string) into XML\n * elements via the compile-path stringifiers. Shared by the placeholder\n * replacer and body-level `append`. Relies on the module-level\n * {@link currentPatchCtx} for relationship/media sinks.\n */\nconst formatChildElement = (child: unknown): Element[] => {\n let xmlStr: string;\n\n if (typeof child === \"string\") {\n // Plain string → simple run\n xmlStr = `<w:r><w:t xml:space=\"preserve\">${escapeXml(child)}</w:t></w:r>`;\n } else if (typeof child === \"object\" && child !== null) {\n const obj = child as Record<string, unknown>;\n // SectionChild level (paragraph / table) — for DOCUMENT patches and append\n if (\"paragraph\" in obj) {\n xmlStr = stringifyParagraphInline(obj.paragraph as ParagraphOptions, currentPatchCtx);\n } else if (\"table\" in obj) {\n xmlStr = tableDesc.stringify(obj.table as TableOptions, currentPatchCtx) ?? \"\";\n } else {\n // ParagraphChild level — for PARAGRAPH patches\n // Try compile-path JSON child dispatch first\n const jr = stringifyChildDispatch(child as ParagraphChild, currentPatchCtx);\n if (jr !== undefined) {\n xmlStr = Array.isArray(jr) ? jr.join(\"\") : jr;\n } else {\n // RunOptions (plain objects with text/children/bold/etc.)\n xmlStr = stringifyRunInline(child as RunOptions, currentPatchCtx);\n }\n }\n } else {\n xmlStr = \"<w:r/>\";\n }\n\n const jsonObj = xml2js(xmlStr, { captureSpacesBetweenElements: true });\n return [jsonObj.elements![0]];\n};\n\nconst docxReplacer = createReplacer({\n ns: DOCX_NS,\n formatChild: formatChildElement,\n});\n\n/**\n * Splice block-level children into `<w:body>` before the trailing `<w:sectPr>`\n * (the final section properties). If the body has no trailing sectPr, append at\n * the end. Reuses {@link formatChildElement} so the same serialization and\n * relationship/media sinks apply as placeholder patches.\n */\nconst appendToBody = (root: Element, children: SectionChild[]): void => {\n const docEl = root.elements?.find((e) => e.name === \"w:document\");\n const body = docEl?.elements?.find((e) => e.name === \"w:body\");\n if (!body) return;\n const els = body.elements ?? (body.elements = []);\n const newEls: Element[] = [];\n for (const child of children) {\n newEls.push(...formatChildElement(child));\n }\n // Insert before the trailing <w:sectPr>; otherwise at the end.\n let insertAt = els.length;\n for (let i = els.length - 1; i >= 0; i--) {\n if (els[i].name === \"w:sectPr\") {\n insertAt = i;\n break;\n }\n }\n els.splice(insertAt, 0, ...newEls);\n};\n\n/** Current patch context — set per file in the main loop. */\nlet currentPatchCtx: BodyContext;\n\n/**\n * A patch operation: replace a placeholder with either inline run-level\n * content (`type: \"paragraph\"`) or block-level content (`type: \"document\"`).\n *\n * The `type` is a bare string literal (no PatchType enum) — the core\n * replacer already discriminates on `patch.type`.\n */\nexport type Patch =\n | { type: \"paragraph\"; children: (string | RunOptions | ParagraphChild)[] }\n | { type: \"document\"; children: SectionChild[] };\n\ninterface ImageRelationshipAddition {\n key: string;\n mediaDatas: { fileName: string }[];\n}\n\ninterface HyperlinkRelationshipAddition {\n key: string;\n hyperlink: { id: string; link: string };\n}\n\nexport interface PatchDocumentOptions<\n T extends OutputType = OutputType,\n> extends BasePatchOptions<T> {\n /** Placeholder substitutions: `{{key}}` (per delimiters) → patch content. */\n placeholders?: Readonly<Record<string, Patch>>;\n /** Literal find/replace: the find string → patch content (no delimiters added). */\n findReplace?: Readonly<Record<string, Patch>>;\n /** Core-properties metadata override (merged over the existing docProps/core.xml). */\n coreProperties?: Partial<CorePropertiesOptions>;\n keepOriginalStyles?: boolean;\n recursive?: boolean;\n /** Block-level content appended to the document body, before the final section break. */\n append?: SectionChild[];\n /**\n * Comments to inject. `paragraphs` anchors a comment to the Nth body paragraph\n * (0-based, wraps the whole paragraph); `placeholders` anchors to the run\n * containing a {{key}} (wrapped before placeholder substitution). Ids are\n * continued from any existing word/comments.xml; entries are merged in.\n */\n comments?: {\n paragraphs?: Readonly<Record<number, PatchComment[]>>;\n placeholders?: Readonly<Record<string, PatchComment[]>>;\n };\n}\n\nconst UTF16LE = new Uint8Array([0xff, 0xfe]);\nconst UTF16BE = new Uint8Array([0xfe, 0xff]);\n\nconst compareByteArrays = (a: Uint8Array, b: Uint8Array): boolean => {\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n};\n\n/**\n * Patches an existing .docx document by replacing placeholders with new content.\n *\n * @publicApi\n */\nexport const patchDocument = async <T extends OutputType = OutputType>({\n outputType,\n data,\n placeholders,\n findReplace,\n coreProperties,\n append,\n comments,\n keepOriginalStyles = true,\n placeholderDelimiters = { end: \"}}\", start: \"{{\" } as const,\n recursive = true,\n}: PatchDocumentOptions<T>): Promise<OutputByType[T]> => {\n const zipContent = unzipSync(toUint8Array(data));\n const contexts = new Map<string, BodyContext>();\n const media = new Media<MediaData>();\n const file = { media } as BodyContext[\"file\"];\n\n // Resolve comment ids by continuation from any existing word/comments.xml.\n const assignedComments = buildAssignedComments(zipContent, comments);\n\n const map = new Map<string, Element>();\n\n const imageRelationshipAdditions: ImageRelationshipAddition[] = [];\n const hyperlinkRelationshipAdditions: HyperlinkRelationshipAddition[] = [];\n let hasMedia = false;\n\n const binaryContentMap = new Map<string, Uint8Array>();\n\n for (const [key, value] of Object.entries(zipContent)) {\n const startBytes = value.slice(0, 2);\n if (compareByteArrays(startBytes, UTF16LE) || compareByteArrays(startBytes, UTF16BE)) {\n binaryContentMap.set(key, value);\n continue;\n }\n\n if (!key.endsWith(\".xml\") && !key.endsWith(\".rels\")) {\n binaryContentMap.set(key, value);\n continue;\n }\n\n const json = toJson(strFromU8(value));\n\n if (key === \"word/document.xml\") {\n const document = json.elements?.find((i) => i.name === \"w:document\");\n if (document && document.attributes) {\n for (const ns of [\"mc\", \"wp\", \"r\", \"w15\", \"m\"] as const) {\n document.attributes[`xmlns:${ns}`] = DocumentAttributeNamespaces[ns];\n }\n document.attributes[\"mc:Ignorable\"] =\n `${document.attributes[\"mc:Ignorable\"] || \"\"} w15`.trim();\n }\n }\n\n if (key.startsWith(\"word/\") && !key.endsWith(\".xml.rels\")) {\n const hyperlinkSink: Array<{ id: string; link: string }> = [];\n\n const context: BodyContext = {\n fileData: file,\n file,\n viewWrapper: {\n relationships: {\n addRelationship: (\n linkId: string,\n _: string,\n target: string,\n __: (typeof TargetModeType)[keyof typeof TargetModeType],\n ) => {\n hyperlinkRelationshipAdditions.push({\n hyperlink: {\n id: linkId,\n link: target,\n },\n key,\n });\n },\n },\n } as unknown as ViewWrapper,\n stringifyChild: () => \"\",\n addRelationship: () => \"\",\n addMedia: () => \"\",\n };\n contexts.set(key, context);\n\n if (!placeholderDelimiters?.start.trim() || !placeholderDelimiters?.end.trim()) {\n throw new Error(\"Both start and end delimiters must be non-empty strings.\");\n }\n\n const { start, end } = placeholderDelimiters;\n\n // Create compile-path context for stringifying patch children\n const patchCtx = createPatchContext(file, hyperlinkSink);\n currentPatchCtx = patchCtx;\n\n // Anchor placeholder comments BEFORE substitution, wrapping the {{key}} run.\n if (key === \"word/document.xml\") {\n for (const ac of assignedComments) {\n if (ac.anchor.kind === \"placeholder\") {\n wrapPlaceholderComment(json, `${start}${ac.anchor.key}${end}`, ac.id);\n }\n }\n }\n\n // Build (find-text → patch) entries. Placeholders wrap the key in\n // delimiters; findReplace uses the literal key. Both share one engine.\n const entries: Array<{ find: string; patch: Patch }> = [];\n if (placeholders) {\n for (const [key, value] of Object.entries(placeholders)) {\n entries.push({ find: `${start}${key}${end}`, patch: value });\n }\n }\n if (findReplace) {\n for (const [key, value] of Object.entries(findReplace)) {\n entries.push({ find: key, patch: value });\n }\n }\n\n for (const { find: patchText, patch: patchValue } of entries) {\n while (true) {\n const { didFindOccurrence } = docxReplacer({\n context,\n json,\n keepOriginalStyles,\n patch: patchValue,\n patchText,\n });\n if (!recursive || !didFindOccurrence) {\n break;\n }\n }\n }\n\n // Append block-level children to the document body before the final sectPr.\n if (append && append.length > 0 && key === \"word/document.xml\") {\n appendToBody(json, append);\n }\n\n // Anchor paragraph comments AFTER body edits, wrapping the Nth paragraph.\n if (key === \"word/document.xml\") {\n for (const ac of assignedComments) {\n if (ac.anchor.kind === \"paragraph\") {\n wrapParagraphComment(json, ac.anchor.index, ac.id);\n }\n }\n }\n\n // Flush hyperlink relationships captured by the compile-path context\n for (const hl of hyperlinkSink) {\n hyperlinkRelationshipAdditions.push({\n hyperlink: { id: hl.id, link: hl.link },\n key,\n });\n }\n\n const mediaDatas = getReferencedMedia(JSON.stringify(json), media.array);\n if (mediaDatas.length > 0) {\n hasMedia = true;\n imageRelationshipAdditions.push({\n key,\n mediaDatas,\n });\n }\n }\n\n map.set(key, json);\n }\n\n // Merge injected comments into word/comments.xml + wire rels + content types.\n if (assignedComments.length > 0) {\n mergeCommentsPart(map, assignedComments, file);\n }\n\n for (const { key, mediaDatas } of imageRelationshipAdditions) {\n const relationshipKey = `word/_rels/${key.split(\"/\").pop()}.rels`;\n const relationshipsJson = map.get(relationshipKey) ?? createRelationshipFile();\n map.set(relationshipKey, relationshipsJson);\n\n const index = getNextRelationshipIndex(relationshipsJson);\n const newJson = replaceImagePlaceholders(\n JSON.stringify(map.get(key)),\n mediaDatas,\n index,\n \"plain\",\n );\n map.set(key, JSON.parse(newJson) as Element);\n\n for (let i = 0; i < mediaDatas.length; i++) {\n const { fileName } = mediaDatas[i];\n appendRelationship(\n relationshipsJson,\n index + i,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\",\n `media/${fileName}`,\n );\n }\n }\n\n for (const { key, hyperlink } of hyperlinkRelationshipAdditions) {\n const relationshipKey = `word/_rels/${key.split(\"/\").pop()}.rels`;\n\n const relationshipsJson = map.get(relationshipKey) ?? createRelationshipFile();\n map.set(relationshipKey, relationshipsJson);\n\n appendRelationship(\n relationshipsJson,\n hyperlink.id,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink\",\n hyperlink.link,\n TargetModeType.EXTERNAL,\n );\n }\n\n if (hasMedia) {\n const contentTypesJson = map.get(\"[Content_Types].xml\");\n\n if (!contentTypesJson) {\n throw new Error(\"Could not find content types file\");\n }\n\n appendContentType(contentTypesJson, \"image/png\", \"png\");\n appendContentType(contentTypesJson, \"image/jpeg\", \"jpeg\");\n appendContentType(contentTypesJson, \"image/jpeg\", \"jpg\");\n appendContentType(contentTypesJson, \"image/bmp\", \"bmp\");\n appendContentType(contentTypesJson, \"image/gif\", \"gif\");\n appendContentType(contentTypesJson, \"image/svg+xml\", \"svg\");\n }\n\n const files: Record<string, Uint8Array> = {};\n const XML_DECL = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>';\n\n for (const [key, value] of map) {\n files[key] =\n key === \"docProps/core.xml\" && coreProperties\n ? encoder.encode(XML_DECL + applyCorePropertiesOverride(value, coreProperties))\n : encoder.encode(js2xml(value));\n }\n\n for (const [key, value] of binaryContentMap) {\n files[key] = value;\n }\n\n for (const { data: mediaData, fileName } of media.array) {\n files[`word/media/${fileName}`] =\n mediaData instanceof Uint8Array ? mediaData : new Uint8Array(mediaData);\n }\n\n return await zipAndConvert(files, outputType, OoxmlMimeType.DOCX);\n};\n\nconst createRelationshipFile = (): Element => ({\n declaration: {\n attributes: {\n encoding: \"UTF-8\",\n standalone: \"yes\",\n version: \"1.0\",\n },\n },\n elements: [\n {\n attributes: {\n xmlns: \"http://schemas.openxmlformats.org/package/2006/relationships\",\n },\n elements: [],\n name: \"Relationships\",\n type: \"element\",\n },\n ],\n});\n\n/** Build a bare OOXML element node with attributes and no children. */\nfunction makeElement(name: string, attributes: Record<string, string> = {}): Element {\n return { type: \"element\", name, attributes, elements: [] };\n}\n\n/** A `<w:r>` carrying a `<w:commentReference>` (CommentReference run style). */\nfunction commentReferenceRun(id: number): Element {\n return xml2js(\n `<w:r><w:rPr><w:rStyle w:val=\"CommentReference\"/></w:rPr><w:commentReference w:id=\"${id}\"/></w:r>`,\n ).elements![0];\n}\n\n/** Next continuation id for an appended `<w:comment>` (-1 seed → 0 when none). */\nfunction nextCommentId(commentsPart: Element | undefined): number {\n const root = commentsPart?.elements?.find((e) => e.name === \"w:comments\");\n return nextNumericId(root, \"w:comment\", \"w:id\", -1);\n}\n\n/** Assign continuation ids to every requested comment anchor. */\nfunction buildAssignedComments(\n zipContent: Record<string, Uint8Array>,\n comments: PatchDocumentOptions[\"comments\"],\n): AssignedComment[] {\n if (!comments) return [];\n const raw = zipContent[\"word/comments.xml\"];\n let nextId = raw ? nextCommentId(toJson(strFromU8(raw))) : 0;\n const assigned: AssignedComment[] = [];\n if (comments.placeholders) {\n for (const [key, list] of Object.entries(comments.placeholders)) {\n for (const options of list) {\n assigned.push({ id: nextId++, anchor: { kind: \"placeholder\", key }, options });\n }\n }\n }\n if (comments.paragraphs) {\n for (const [indexStr, list] of Object.entries(comments.paragraphs)) {\n const index = Number(indexStr);\n for (const options of list) {\n assigned.push({ id: nextId++, anchor: { kind: \"paragraph\", index }, options });\n }\n }\n }\n return assigned;\n}\n\n/** Wrap the Nth body paragraph with comment range markers + a reference run. */\nfunction wrapParagraphComment(json: Element, index: number, commentId: number): void {\n const body = json.elements\n ?.find((e) => e.name === \"w:document\")\n ?.elements?.find((e) => e.name === \"w:body\");\n if (!body) return;\n const paragraphs = (body.elements ?? []).filter((e) => e.name === \"w:p\");\n const target = paragraphs[index];\n if (!target) {\n throw new Error(`patchDocument: no paragraph at index ${index} to comment`);\n }\n const els = target.elements ?? (target.elements = []);\n const start = makeElement(\"w:commentRangeStart\", { \"w:id\": String(commentId) });\n const end = makeElement(\"w:commentRangeEnd\", { \"w:id\": String(commentId) });\n // Insert start after a leading <w:pPr> (or at the head); end + ref at the tail.\n const insertAt = els.length > 0 && els[0].name === \"w:pPr\" ? 1 : 0;\n els.splice(insertAt, 0, start);\n els.push(end, commentReferenceRun(commentId));\n}\n\n/** Wrap the first run whose `<w:t>` contains the placeholder with comment markers. */\nfunction wrapPlaceholderComment(json: Element, placeholder: string, commentId: number): void {\n const body = json.elements\n ?.find((e) => e.name === \"w:document\")\n ?.elements?.find((e) => e.name === \"w:body\");\n if (!body) return;\n for (const p of body.elements ?? []) {\n if (p.name !== \"w:p\") continue;\n const els = p.elements ?? [];\n for (let i = 0; i < els.length; i++) {\n if (els[i].name !== \"w:r\") continue;\n const t = (els[i].elements ?? []).find((e) => e.name === \"w:t\");\n const text = t?.elements?.[0]?.text;\n if (typeof text === \"string\" && text.includes(placeholder)) {\n els.splice(i, 0, makeElement(\"w:commentRangeStart\", { \"w:id\": String(commentId) }));\n els.splice(\n i + 2,\n 0,\n makeElement(\"w:commentRangeEnd\", { \"w:id\": String(commentId) }),\n commentReferenceRun(commentId),\n );\n return; // only the first occurrence\n }\n }\n }\n}\n\n/**\n * Merge assigned comments into word/comments.xml (appending to an existing part\n * or creating one) and wire document.xml.rels + content types when newly added.\n */\nfunction mergeCommentsPart(\n map: Map<string, Element>,\n assigned: AssignedComment[],\n file: { media: Media<MediaData> },\n): void {\n const newOpts: CommentOptions[] = assigned.map((ac) => ({ id: ac.id, ...ac.options }));\n const ctx = createPatchContext(file, []);\n const newXml = commentsDesc.stringify({ children: newOpts }, ctx) ?? \"\";\n const existingEl = map.get(\"word/comments.xml\");\n const wasNew = !existingEl;\n\n if (existingEl) {\n // Append new <w:comment> elements to the existing <w:comments> root.\n const existingRoot = existingEl.elements?.find((e) => e.name === \"w:comments\");\n const newRoot = xml2js(newXml).elements?.find((e) => e.name === \"w:comments\");\n existingRoot?.elements?.push(...(newRoot?.elements ?? []));\n } else {\n map.set(\n \"word/comments.xml\",\n toJson(`<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>${newXml}`),\n );\n }\n\n if (wasNew) {\n const relsKey = \"word/_rels/document.xml.rels\";\n const relsJson = map.get(relsKey) ?? createRelationshipFile();\n map.set(relsKey, relsJson);\n appendRelationship(\n relsJson,\n getNextRelationshipIndex(relsJson),\n COMMENTS_REL_TYPE,\n \"comments.xml\",\n );\n }\n\n // Content types — ensure the comments Override exists (deduped). An existing\n // comments part normally already declares it, but defend against incomplete templates.\n const contentTypes = map.get(\"[Content_Types].xml\");\n if (contentTypes) {\n appendOverride(contentTypes, \"/word/comments.xml\", COMMENTS_CONTENT_TYPE);\n }\n}\n","/**\n * Patch detector for discovering placeholders in document templates.\n *\n * @module\n */\nimport { DOCX_NS, createTraverser, strFromU8, toJson, unzipSync } from \"@office-open/core\";\nimport { toUint8Array } from \"@office-open/core\";\nimport type { DataType } from \"@office-open/core\";\n\n/**\n * Options for patch detection.\n *\n * @property data - The document template to scan for placeholders\n */\ninterface PatchDetectorOptions {\n data: DataType;\n}\n\n/**\n * Detects all placeholders present in a document template.\n *\n * Scans through all XML content in a .docx file to find placeholder text\n * enclosed in delimiters (default: {{placeholder}}). This is useful for\n * discovering what patches a template expects before performing replacement.\n *\n * @param options - Patch detector configuration\n * @returns Array of placeholder keys found in the document\n *\n * @example\n * ```typescript\n * const placeholders = await patchDetector({ data: templateBuffer });\n * // Returns: [\"name\", \"date\", \"address\"] if template contains {{name}}, {{date}}, {{address}}\n *\n * // Use detected placeholders to create patches\n * const patches = {};\n * for (const key of placeholders) {\n * patches[key] = {\n * type: \"paragraph\",\n * children: [new TextRun(getUserData(key))],\n * };\n * });\n * ```\n */\nexport const patchDetector = async ({ data }: PatchDetectorOptions): Promise<string[]> => {\n const zipContent = unzipSync(toUint8Array(data));\n const patches = new Set<string>();\n\n for (const [key, value] of Object.entries(zipContent)) {\n if (!key.endsWith(\".xml\") && !key.endsWith(\".rels\")) {\n continue;\n }\n if (key.startsWith(\"word/\") && !key.endsWith(\".xml.rels\")) {\n const json = toJson(strFromU8(value));\n const { traverse } = createTraverser(DOCX_NS);\n for (const p of traverse(json)) {\n for (const patch of findPatchKeys(p.text)) {\n patches.add(patch);\n }\n }\n }\n }\n return [...patches];\n};\n\n/**\n * Extracts placeholder keys from text using regex pattern.\n *\n * @param text - Text to search for placeholders\n * @returns Array of placeholder keys (without delimiters)\n */\nconst findPatchKeys = (text: string): string[] => {\n const pattern = /(?<=\\{\\{).+?(?=\\}\\})/gs;\n return text.match(pattern) ?? [];\n};\n"],"mappings":";;;;;AAgDA,MAAM,UAAU,IAAI,YAAY;AAEhC,MAAM,oBACJ;AACF,MAAM,wBACJ;;;;;;;;;;;;;AA4BF,SAAS,mBACP,MACA,eACa;CACb,OAAO;EACL,UAAU;EACJ;EACN,aAAa,EACX,eAAe;GACb,kBAAkB,QAAgB,OAAe,QAAgB,UAAmB;IAClF,cAAc,KAAK;KAAE,IAAI;KAAQ,MAAM;IAAO,CAAC;GACjD;GACA,mBAAmB;EACrB,EACF;EACA,sBAAsB;EACtB,uBAAuB;EACvB,gBAAgB;CAClB;AACF;;;;;;;AAQA,MAAM,sBAAsB,UAA8B;CACxD,IAAI;CAEJ,IAAI,OAAO,UAAU,UAEnB,SAAS,kCAAkC,UAAU,KAAK,EAAE;MACvD,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM;EACtD,MAAM,MAAM;EAEZ,IAAI,eAAe,KACjB,SAAS,yBAAyB,IAAI,WAA+B,eAAe;OAC/E,IAAI,WAAW,KACpB,SAAS,UAAU,UAAU,IAAI,OAAuB,eAAe,KAAK;OACvE;GAGL,MAAM,KAAK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;CAGF,IAAI,QAAQ;EACV,MAAM,UAAU;EAChB,MAAM,WAAW,IAAI,IAAI,OAAO,KAAK,uBAAuB;EAC5D,IAAI,IAAI,SAAS,QAAQ;EACzB,mBACE,UACA,yBAAyB,QAAQ,GACjC,mBACA,cACF;CACF;CAIA,MAAM,eAAe,IAAI,IAAI,qBAAqB;CAClD,IAAI,cACF,eAAe,cAAc,sBAAsB,qBAAqB;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC1lBA,MAAa,gBAAgB,OAAO,EAAE,WAAoD;CACxF,MAAM,aAAa,UAAU,aAAa,IAAI,CAAC;CAC/C,MAAM,0BAAU,IAAI,IAAY;CAEhC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,UAAU,GAAG;EACrD,IAAI,CAAC,IAAI,SAAS,MAAM,KAAK,CAAC,IAAI,SAAS,OAAO,GAChD;EAEF,IAAI,IAAI,WAAW,OAAO,KAAK,CAAC,IAAI,SAAS,WAAW,GAAG;GACzD,MAAM,OAAO,OAAO,UAAU,KAAK,CAAC;GACpC,MAAM,EAAE,aAAa,gBAAgB,OAAO;GAC5C,KAAK,MAAM,KAAK,SAAS,IAAI,GAC3B,KAAK,MAAM,SAAS,cAAc,EAAE,IAAI,GACtC,QAAQ,IAAI,KAAK;EAGvB;CACF;CACA,OAAO,CAAC,GAAG,OAAO;AACpB;;;;;;;AAQA,MAAM,iBAAiB,SAA2B;CAEhD,OAAO,KAAK,MAAM,wBAAO,KAAK,CAAC;AACjC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@office-open/docx",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.4",
|
|
4
4
|
"description": "Generate, parse, and patch .docx documents with a declarative TypeScript API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"clippy",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@office-open/core": "0.10.
|
|
57
|
-
"@office-open/xml": "0.10.
|
|
56
|
+
"@office-open/core": "0.10.4",
|
|
57
|
+
"@office-open/xml": "0.10.4"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
60
|
"dev": "basis build --stub",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context-vnFOOEWL.mjs","names":[],"sources":["../src/parts/alt-chunk/alt-chunk-collection.ts","../src/parts/sub-doc/sub-doc-collection.ts","../src/parts/styles/external-styles-factory.ts","../src/shared/embeddings/embeddings.ts","../src/context.ts"],"sourcesContent":["/**\n * AltChunk collection module for managing alternative format content parts.\n *\n * @module\n */\n\n/**\n * Stores alternative format chunk data for later serialization by the compiler.\n */\nexport interface AltChunkData {\n /** Unique key for this alt chunk (e.g., relId) */\n key: string;\n /** Raw content data */\n data: Uint8Array;\n /** Part sub-path within word/ (e.g., \"afchunks/afchunk1.html\") */\n path: string;\n /** File extension (e.g., \"html\", \"rtf\", \"txt\") */\n extension: string;\n /** MIME content type (e.g., \"text/html\", \"application/rtf\") */\n contentType: string;\n}\n\n/**\n * Manages alternative format chunk parts in a document.\n *\n * Stores external content (HTML, RTF, plain text) that will be\n * serialized into separate parts in the DOCX package.\n */\nexport class AltChunkCollection {\n private map: Map<string, AltChunkData>;\n\n public constructor() {\n this.map = new Map<string, AltChunkData>();\n }\n\n public addAltChunk(key: string, data: AltChunkData): void {\n this.map.set(key, data);\n }\n\n public get array(): AltChunkData[] {\n return [...this.map.values()];\n }\n}\n","/**\n * Sub-document collection module for managing sub-document parts.\n *\n * @module\n */\n\n/**\n * Stores sub-document data for later serialization by the compiler.\n */\nexport interface SubDocData {\n /** Raw document data (.docx bytes) */\n data: Uint8Array;\n /** Part sub-path within word/ (e.g., \"subdocs/subdoc1.docx\") */\n path: string;\n}\n\n/**\n * Manages sub-document parts in a document.\n */\nexport class SubDocCollection {\n private map: Map<string, SubDocData>;\n\n public constructor() {\n this.map = new Map<string, SubDocData>();\n }\n\n public addSubDoc(key: string, data: SubDocData): void {\n this.map.set(key, data);\n }\n\n public get array(): SubDocData[] {\n return [...this.map.values()];\n }\n}\n","/**\n * External styles factory module for WordprocessingML documents.\n *\n * Parses styles from external XML and returns raw XML strings.\n * No XmlComponent dependency.\n *\n * Reference: http://officeopenxml.com/WPstyles.php\n *\n * @module\n */\nimport { js2xml, xml2js } from \"@office-open/xml\";\nimport type { Element as XMLElement } from \"@office-open/xml\";\n\nimport type { StylesOptions } from \"./styles\";\n\n/**\n * Factory for creating styles from external XML sources.\n *\n * Parses styles from XML (typically from a styles.xml file)\n * and returns raw XML strings for each style element.\n */\nexport class ExternalStylesFactory {\n /**\n * Creates new Styles based on the given XML data.\n *\n * Parses the styles XML and converts each child to a raw XML string.\n */\n public newInstance(xmlData: string): StylesOptions {\n const xmlObj = xml2js(xmlData, { compact: false }) as XMLElement;\n\n let stylesXmlElement: XMLElement | undefined;\n for (const xmlElm of xmlObj.elements || []) {\n if (xmlElm.name === \"w:styles\") {\n stylesXmlElement = xmlElm;\n }\n }\n\n if (stylesXmlElement === undefined) {\n return { importedStyles: [], initialAttributes: {} };\n }\n\n const stylesElements = stylesXmlElement.elements || [];\n\n return {\n importedStyles: stylesElements.map((childElm) => ({\n _raw: js2xml({ elements: [childElm] }),\n })),\n initialAttributes: (stylesXmlElement.attributes as Record<string, string>) ?? {},\n };\n }\n}\n","/**\n * Embeddings module for WordprocessingML documents.\n *\n * Manages OLE object embeddings (word/embeddings/oleObjectN.bin) referenced by\n * w:object elements. Mirrors the Media collection pattern but targets binary\n * OLE container parts instead of images.\n *\n * @module\n */\n\n/** OLE embedding data stored under word/embeddings/. */\nexport interface EmbeddingData {\n /** File name within word/embeddings/ (e.g. \"oleObject1.bin\"). */\n fileName: string;\n /** Raw OLE container bytes. */\n data: Uint8Array;\n /** OLE program id (e.g. \"Excel.Sheet.12\") — informational only. */\n progId?: string;\n}\n\n/**\n * Collects OLE embeddings allocated during document generation. Each embedding\n * is stored under a sequential `oleObjectN.bin` name in word/embeddings/,\n * mirroring MS Office's numbering so output is deterministic and diffable.\n */\nexport class EmbeddingCollection {\n private map = new Map<string, EmbeddingData>();\n private counter = 0;\n\n /** Allocate the next sequential embedding file name (oleObject1.bin, …). */\n public nextEmbeddingName(): string {\n return `oleObject${++this.counter}.bin`;\n }\n\n /** Register an embedding under a unique key. */\n public addEmbedding(key: string, data: EmbeddingData): void {\n this.map.set(key, data);\n }\n\n /** All registered embeddings in insertion order. */\n public get array(): EmbeddingData[] {\n return [...this.map.values()];\n }\n}\n","/**\n * DOCX compilation context.\n *\n * DocxWriteContext holds all mutable state needed during document compilation.\n * generateDocument() creates a DocxWriteContext internally.\n *\n * @module\n */\n\nimport { Relationships } from \"@office-open/core\";\nimport { ChartCollection } from \"@office-open/core/chart\";\nimport type { ReadContext, WriteContext } from \"@office-open/core/descriptor\";\nimport { SmartArtCollection } from \"@office-open/core/smartart\";\nimport type { Element } from \"@office-open/xml\";\nimport { AltChunkCollection } from \"@parts/alt-chunk/alt-chunk-collection\";\nimport type { DocumentOptions } from \"@parts/core-properties\";\nimport type { SectionPropertiesOptions } from \"@parts/document/body/section-properties/section-properties\";\nimport type { EndnoteSeparator } from \"@parts/endnotes/descriptor\";\nimport { FontWrapper } from \"@parts/fonts/font-wrapper\";\nimport type { FootnoteSeparator } from \"@parts/footnotes/descriptor\";\nimport type { GlossaryDocumentOptions } from \"@parts/glossary-document\";\nimport type { HeaderFooterEntry } from \"@parts/header-footer\";\nimport { Numbering } from \"@parts/numbering\";\nimport type { ParagraphOptions } from \"@parts/paragraph/paragraph\";\nimport type { SettingsOptions } from \"@parts/settings/settings\";\nimport { Styles, extractStyleId } from \"@parts/styles\";\nimport { ExternalStylesFactory } from \"@parts/styles/external-styles-factory\";\nimport { DefaultStylesFactory, collectDefaultOverrideIds } from \"@parts/styles/factory\";\nimport { SubDocCollection } from \"@parts/sub-doc/sub-doc-collection\";\nimport type { WebSettingsOptions } from \"@parts/web-settings\";\nimport { EmbeddingCollection } from \"@shared/embeddings/embeddings\";\nimport { Media } from \"@shared/media\";\nimport type { SectionOptions } from \"@shared/section\";\nimport type { SectionChild } from \"@shared/section\";\n\nimport type { DocxDocument } from \"./parse\";\n\n/** Interface for document view wrappers — provides relationships access. */\nexport interface ViewWrapper {\n relationships: Relationships;\n}\n\n// ── BodyContext ──\n\n/**\n * Context for body-level stringification.\n *\n * Pure JSON pipeline context — extends WriteContext for descriptor compatibility.\n * No dependency on XmlComponent Context (compile/ uses zero toXml calls).\n */\nexport interface BodyContext extends WriteContext {\n /** The root write context with all mutable document state. */\n fileData: DocxWriteContext;\n /** Alias for fileData — some descriptor internals access context.file. */\n file: DocxWriteContext;\n /** Current view wrapper for relationship access. */\n viewWrapper: { relationships: Relationships };\n /** Stringify a body-level child element — injected to break circular imports. */\n stringifyChild: (child: SectionChild, ctx: BodyContext) => string;\n}\n\n// ── DocxWriteContext ──\n\nexport class DocxWriteContext implements WriteContext {\n private _currentRelationshipId = 1;\n\n // --- Accessed by XmlComponent via context.file.* during toXml() ---\n declare public document: { relationships: Relationships };\n declare public numbering: Numbering;\n declare public media: Media;\n declare public charts: ChartCollection;\n declare public smartArts: SmartArtCollection;\n declare public embeddings: EmbeddingCollection;\n declare public altChunks: AltChunkCollection;\n declare public subDocs: SubDocCollection;\n declare public comments: { relationships: Relationships };\n declare public footNotes: {\n relationships: Relationships;\n notes: Map<number, (ParagraphOptions | string)[]>;\n separator?: FootnoteSeparator;\n continuationSeparator?: FootnoteSeparator;\n };\n declare public endnotes: {\n relationships: Relationships;\n notes: Map<number, (ParagraphOptions | string)[]>;\n separator?: EndnoteSeparator;\n continuationSeparator?: EndnoteSeparator;\n };\n\n // --- Additional state used by the compiler ---\n declare public fileRelationships: Relationships;\n declare public _settingsOptions: SettingsOptions;\n declare public styles: Styles;\n declare public fontTable: FontWrapper;\n declare public glossaryOptions: GlossaryDocumentOptions | undefined;\n declare public webSettings: WebSettingsOptions | undefined;\n\n // --- Section properties (one per section, raw options for descriptor pipeline) ---\n private _sectionProperties: SectionPropertiesOptions[] = [];\n public get sectionProperties(): readonly SectionPropertiesOptions[] {\n return this._sectionProperties;\n }\n\n // --- WriteContext interface (core descriptor pipeline) ---\n\n public addRelationship(_type: string, _target: string, _mode?: string): string {\n const id = this._currentRelationshipId++;\n return `rId${id}`;\n }\n\n public addMedia(_data: Uint8Array, _type: string): string {\n // DOCX media registration goes through Media.addImage() in compiler.\n return \"\";\n }\n\n // --- Internal tracking ---\n private _headers: HeaderFooterEntry[] = [];\n private _footers: HeaderFooterEntry[] = [];\n\n // --- Original input preserved for descriptor usage ---\n declare public _options: DocumentOptions;\n\n constructor(options: DocumentOptions) {\n this._options = options;\n\n this.numbering = new Numbering(options.numbering ? options.numbering : { config: [] });\n\n this.comments = { relationships: new Relationships() };\n this.fileRelationships = new Relationships();\n this.footNotes = { relationships: new Relationships(), notes: new Map() };\n this.endnotes = { relationships: new Relationships(), notes: new Map() };\n this.document = { relationships: new Relationships() };\n this._settingsOptions = {\n compatibility: options.compatibility,\n compatibilityModeVersion: options.compatabilityModeVersion,\n defaultTabStop: options.defaultTabStop,\n evenAndOddHeaders: options.evenAndOddHeaderAndFooters ? true : false,\n characterSpacingControl: options.characterSpacingControl,\n hyphenation: {\n autoHyphenation: options.hyphenation?.autoHyphenation,\n consecutiveHyphenLimit: options.hyphenation?.consecutiveHyphenLimit,\n doNotHyphenateCaps: options.hyphenation?.doNotHyphenateCaps,\n hyphenationZone: options.hyphenation?.hyphenationZone,\n },\n trackRevisions: options.features?.trackRevisions,\n updateFields: options.features?.updateFields,\n documentProtection: options.features?.documentProtection,\n view: options.view,\n zoom: options.zoom,\n writeProtection: options.writeProtection,\n displayBackgroundShape:\n options.displayBackgroundShape ?? (options.background?.image ? true : undefined),\n embedTrueTypeFonts: options.embedTrueTypeFonts,\n embedSystemFonts: options.embedSystemFonts,\n saveSubsetFonts: options.saveSubsetFonts,\n docVars: options.docVars,\n colorSchemeMapping: options.colorSchemeMapping,\n mailMerge: options.mailMerge,\n ...options.settings,\n };\n\n this.media = new Media();\n this.charts = new ChartCollection();\n this.smartArts = new SmartArtCollection();\n this.embeddings = new EmbeddingCollection();\n this.altChunks = new AltChunkCollection();\n this.subDocs = new SubDocCollection();\n\n if (options.externalStyles !== undefined) {\n const defaultFactory = new DefaultStylesFactory();\n const defaultStyles = defaultFactory.newInstance(options.styles?.default);\n const externalFactory = new ExternalStylesFactory();\n const externalStyles = externalFactory.newInstance(options.externalStyles);\n // Skip docDefaults AND latentStyles from default factory —\n // external styles already provide them; XSD requires docDefaults → latentStyles → style sequence.\n // Also drop builtins whose styleId the external XML already defines so\n // user definitions override defaults (no duplicate styleId in the output).\n const externalStyleIds = new Set<string>();\n for (const s of externalStyles.importedStyles ?? []) {\n const id = extractStyleId(s._raw);\n if (id) externalStyleIds.add(id);\n }\n const defaultStyleElements = defaultStyles.importedStyles!.slice(2).filter((s) => {\n const id = extractStyleId(s._raw);\n return !id || !externalStyleIds.has(id);\n });\n this.styles = new Styles({\n ...externalStyles,\n importedStyles: [...externalStyles.importedStyles!, ...defaultStyleElements],\n });\n } else if (options.styles) {\n const stylesFactory = new DefaultStylesFactory();\n const defaultStyles = stylesFactory.newInstance(options.styles.default);\n // importedStyles[0]=docDefaults, [1]=latentStyles, [2+]=builtin styles.\n // paragraphStyles/characterStyles stay available for numbering registration\n // below but are NOT emitted when round-tripping (the raw importedStyles\n // already carry every source style — emitting both would duplicate them).\n const {\n importedStyles: parsedStyles,\n paragraphStyles,\n characterStyles,\n tableStyles,\n ...restStyles\n } = options.styles;\n const merged = defaultStyles.importedStyles ? [...defaultStyles.importedStyles] : [];\n if (restStyles.docDefaultsXml) {\n const ddIdx = merged.findIndex((s) => s._raw.startsWith(\"<w:docDefaults\"));\n if (ddIdx >= 0) merged[ddIdx] = { _raw: restStyles.docDefaultsXml };\n }\n if (restStyles.latentStylesXml) {\n const latentIdx = merged.findIndex((s) => s._raw.startsWith(\"<w:latentStyles\"));\n if (latentIdx >= 0) merged[latentIdx] = { _raw: restStyles.latentStylesXml };\n }\n if (parsedStyles && parsedStyles.length > 0) {\n // Round-trip: emit verbatim source styles (suppress factory builtins\n // and structured re-emission). User overrides via default.<field>\n // (e.g. default.heading1) take precedence over the verbatim source —\n // drop those ids from the source and emit the factory's structured\n // version instead, so \"modify a default style\" works post-parse.\n merged.splice(2);\n const overrideIds = collectDefaultOverrideIds(options.styles.default);\n if (overrideIds.size > 0) {\n const overrideById = new Map<string, { _raw: string }>();\n for (const s of defaultStyles.importedStyles!.slice(2)) {\n const id = extractStyleId(s._raw);\n if (id) overrideById.set(id, s);\n }\n for (const s of parsedStyles) {\n const id = extractStyleId(s._raw);\n if (id && overrideIds.has(id)) continue;\n merged.push(s);\n }\n for (const id of overrideIds) {\n const s = overrideById.get(id);\n if (s) merged.push(s);\n }\n } else {\n merged.push(...parsedStyles);\n }\n this.styles = new Styles({ ...defaultStyles, importedStyles: merged, ...restStyles });\n } else {\n // Generation: factory builtins + structured custom styles.\n this.styles = new Styles({\n ...defaultStyles,\n paragraphStyles,\n characterStyles,\n tableStyles,\n ...restStyles,\n });\n }\n } else {\n const stylesFactory = new DefaultStylesFactory();\n this.styles = new Styles(stylesFactory.newInstance());\n }\n\n // Register numbering references from custom paragraph/character styles.\n // Style definitions may contain numbering properties whose concrete instances\n // are never created through the body paragraph processing path.\n if (options.styles?.paragraphStyles) {\n for (const style of options.styles.paragraphStyles) {\n const num = style.paragraph?.numbering;\n if (num) {\n this.numbering.createConcreteNumberingInstance(num.reference, num.instance ?? 0);\n }\n }\n }\n\n this.addDefaultRelationships();\n\n for (const section of options.sections) {\n this.addSection(section);\n }\n\n if (options.footnotes) {\n for (const key in options.footnotes) {\n // Skip the round-tripped separator markers (they carry no .children).\n if (key === \"separator\" || key === \"continuationSeparator\") continue;\n this.footNotes.notes.set(parseFloat(key), options.footnotes[key].children);\n }\n this.footNotes.separator = options.footnotes.separator;\n this.footNotes.continuationSeparator = options.footnotes.continuationSeparator;\n }\n\n if (options.endnotes) {\n for (const key in options.endnotes) {\n if (key === \"separator\" || key === \"continuationSeparator\") continue;\n this.endnotes.notes.set(parseFloat(key), options.endnotes[key].children);\n }\n this.endnotes.separator = options.endnotes.separator;\n this.endnotes.continuationSeparator = options.endnotes.continuationSeparator;\n }\n\n this.fontTable = new FontWrapper(options.fonts ?? []);\n this.glossaryOptions = options.glossary;\n this.webSettings = options.webSettings ?? undefined;\n\n if (options.glossary) {\n this.document.relationships.addRelationship(\n this._currentRelationshipId++,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/glossaryDocument\",\n \"glossary/document.xml\",\n );\n }\n\n if (this.webSettings) {\n this.document.relationships.addRelationship(\n this._currentRelationshipId++,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings\",\n \"webSettings.xml\",\n );\n }\n }\n\n get headers(): HeaderFooterEntry[] {\n return this._headers;\n }\n\n get footers(): HeaderFooterEntry[] {\n return this._footers;\n }\n\n // --- Private helpers ---\n\n private addSection({ headers = {}, footers = {}, properties }: SectionOptions): void {\n const sectPrOptions: SectionPropertiesOptions = {\n ...properties,\n footerWrapperGroup: {\n default: footers.default ? this.createFooter(footers.default) : undefined,\n even: footers.even ? this.createFooter(footers.even) : undefined,\n first: footers.first ? this.createFooter(footers.first) : undefined,\n },\n headerWrapperGroup: {\n default: headers.default ? this.createHeader(headers.default) : undefined,\n even: headers.even ? this.createHeader(headers.even) : undefined,\n first: headers.first ? this.createHeader(headers.first) : undefined,\n },\n };\n this._sectionProperties.push(sectPrOptions);\n }\n\n private createHeader(header: SectionChild[]): HeaderFooterEntry {\n const referenceId = this._currentRelationshipId++;\n const entry: HeaderFooterEntry = {\n children: header,\n relationships: new Relationships(),\n referenceId,\n };\n this.addHeaderToDocument(entry);\n return entry;\n }\n\n private createFooter(footer: SectionChild[]): HeaderFooterEntry {\n const referenceId = this._currentRelationshipId++;\n const entry: HeaderFooterEntry = {\n children: footer,\n relationships: new Relationships(),\n referenceId,\n };\n this.addFooterToDocument(entry);\n return entry;\n }\n\n private addHeaderToDocument(header: HeaderFooterEntry): void {\n this._headers.push(header);\n this.document.relationships.addRelationship(\n header.referenceId,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/header\",\n `header${this._headers.length}.xml`,\n );\n }\n\n private addFooterToDocument(footer: HeaderFooterEntry): void {\n this._footers.push(footer);\n this.document.relationships.addRelationship(\n footer.referenceId,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer\",\n `footer${this._footers.length}.xml`,\n );\n }\n\n private addDefaultRelationships(): void {\n this.fileRelationships.addRelationship(\n 1,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n \"word/document.xml\",\n );\n this.fileRelationships.addRelationship(\n 2,\n \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n \"docProps/core.xml\",\n );\n this.fileRelationships.addRelationship(\n 3,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\",\n \"docProps/app.xml\",\n );\n this.fileRelationships.addRelationship(\n 4,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties\",\n \"docProps/custom.xml\",\n );\n\n this.document.relationships.addRelationship(\n this._currentRelationshipId++,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles\",\n \"styles.xml\",\n );\n this.document.relationships.addRelationship(\n this._currentRelationshipId++,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering\",\n \"numbering.xml\",\n );\n this.document.relationships.addRelationship(\n this._currentRelationshipId++,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes\",\n \"footnotes.xml\",\n );\n this.document.relationships.addRelationship(\n this._currentRelationshipId++,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes\",\n \"endnotes.xml\",\n );\n this.document.relationships.addRelationship(\n this._currentRelationshipId++,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings\",\n \"settings.xml\",\n );\n // Comments is an optional part — only wire the document→comments relationship\n // when the document actually carries comments. Emitting it unconditionally\n // produces an orphan comments.xml that Word rejects as an OPC violation\n // (empty part with no [Content_Types] Override when content types are\n // passed through from the source on round-trip).\n if (this._options.comments?.children?.length) {\n this.document.relationships.addRelationship(\n this._currentRelationshipId++,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments\",\n \"comments.xml\",\n );\n }\n if (this._options.bibliography) {\n this.document.relationships.addRelationship(\n this._currentRelationshipId++,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/bibliography\",\n \"bibliography.xml\",\n );\n }\n\n // Theme — a raw-passthrough part. Only declare the document→theme\n // relationship when the source carried one, so Word can resolve theme\n // colors/fonts. Without it theme1.xml is an orphan part Word may reject.\n const themePart = this._options.rawParts?.find((p) => p.path.startsWith(\"word/theme/\"));\n if (themePart) {\n this.document.relationships.addRelationship(\n this._currentRelationshipId++,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\",\n themePart.path.replace(/^word\\//, \"\"),\n );\n }\n\n // customXml storage — raw-passthrough parts. Declare the document→customXml\n // relationship for each item (itemProps are linked via the item's own .rels,\n // not directly by the document) so Word can bind cover-page metadata, etc.\n for (const part of this._options.rawParts ?? []) {\n if (\n part.path.startsWith(\"customXml/\") &&\n part.path.endsWith(\".xml\") &&\n !part.path.includes(\"/_rels/\") &&\n !part.path.includes(\"itemProps\")\n ) {\n this.document.relationships.addRelationship(\n this._currentRelationshipId++,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml\",\n `../${part.path}`,\n );\n }\n }\n }\n}\n\n// ── DocxReadContext ──\n\n/**\n * DOCX-specific read context.\n *\n * Holds references to the parsed DocxDocument and cached style/numbering data\n * used throughout the DOCX parsing pipeline. Implements ReadContext for\n * descriptor pipeline compatibility.\n */\nexport class DocxReadContext implements ReadContext {\n /**\n * Path of the part currently being parsed. Each part carries its own .rels\n * with independent rId numbering, so drawings inside a part must resolve\n * image relationships against that part's rels. Defaults to the document body.\n */\n public currentPart = \"word/document.xml\";\n\n constructor(\n public docx: DocxDocument,\n public styleCache: Map<string, Element>,\n public numberingCache: Map<string, Element>,\n ) {}\n\n resolveRelationship(rId: string): string | undefined {\n const partMedia = this.docx.partRefs.partMedia.get(this.currentPart);\n if (partMedia) {\n const media = partMedia.get(rId);\n if (media) return media;\n }\n return (\n this.docx.partRefs.headers.get(rId) ??\n this.docx.partRefs.footers.get(rId) ??\n this.docx.partRefs.media.get(rId) ??\n this.docx.partRefs.charts.get(rId) ??\n this.docx.partRefs.diagramData.get(rId) ??\n this.docx.partRefs.afChunks.get(rId) ??\n this.docx.partRefs.subDocs.get(rId) ??\n this.docx.partRefs.hyperlinks.get(rId)\n );\n }\n\n /**\n * Run `fn` with `currentPart` temporarily set to `partPath`, restoring the\n * previous value afterwards. Use when parsing a sub-document part (header,\n * footer, footnotes, …) so its drawings resolve images from its own rels.\n */\n withPart<T>(partPath: string, fn: () => T): T {\n const prev = this.currentPart;\n this.currentPart = partPath;\n try {\n return fn();\n } finally {\n this.currentPart = prev;\n }\n }\n\n getPart(path: string): Element | undefined {\n return this.docx.doc.get(path);\n }\n\n getRaw(path: string): Uint8Array | undefined {\n return this.docx.doc.getRaw(path);\n }\n}\n"],"mappings":";;;;;;;;;;;;AA4BA,IAAa,qBAAb,MAAgC;CAC9B;CAEA,cAAqB;EACnB,KAAK,sBAAM,IAAI,IAA0B;CAC3C;CAEA,YAAmB,KAAa,MAA0B;EACxD,KAAK,IAAI,IAAI,KAAK,IAAI;CACxB;CAEA,IAAW,QAAwB;EACjC,OAAO,CAAC,GAAG,KAAK,IAAI,OAAO,CAAC;CAC9B;AACF;;;;;;ACvBA,IAAa,mBAAb,MAA8B;CAC5B;CAEA,cAAqB;EACnB,KAAK,sBAAM,IAAI,IAAwB;CACzC;CAEA,UAAiB,KAAa,MAAwB;EACpD,KAAK,IAAI,IAAI,KAAK,IAAI;CACxB;CAEA,IAAW,QAAsB;EAC/B,OAAO,CAA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;EAC3C,OAAO,KAAK,KAAK,IAAI,OAAO,IAAI;CAClC;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"core-properties-CcpNQvVY.d.mts","names":[],"sources":["../src/parts/bibliography.ts","../src/parts/contenttypes.ts","../src/parts/fonts/font.ts","../src/parts/alt-chunk/alt-chunk-collection.ts","../src/parts/alt-chunk/alt-chunk.ts","../src/shared/border.ts","../src/shared/shading.ts","../src/shared/track-revision/track-revision.ts","../src/parts/paragraph/run/east-asian-layout.ts","../src/parts/paragraph/run/emphasis-mark.ts","../src/parts/paragraph/run/formatting.ts","../src/parts/paragraph/run/language.ts","../src/parts/paragraph/run/run-fonts.ts","../src/parts/paragraph/run/underline.ts","../src/parts/paragraph/run/properties.ts","../src/parts/table-of-contents/table-of-contents-properties.ts","../src/parts/table-of-contents/sdt-properties.ts","../src/parts/table-of-contents/toc-parse.ts","../src/parts/table-of-contents/descriptor.ts","../src/shared/track-revision/track-revision-components/cell-merge.ts","../src/shared/vertical-align.ts","../src/parts/table/table-width.ts","../src/parts/table/table-properties/table-cell-margin.ts","../src/parts/paragraph/formatting/alignment.ts","../src/parts/paragraph/formatting/border.ts","../src/parts/paragraph/formatting/cnf-style.ts","../src/parts/paragraph/formatting/indent.ts","../src/parts/paragraph/formatting/break.ts","../src/parts/paragraph/formatting/spacing.ts","../src/parts/paragraph/formatting/style.ts","../src/parts/paragraph/formatting/tab-stop.ts","../src/parts/paragraph/math.ts","../src/parts/table/grid.ts","../src/parts/table/table-cell-spacing.ts","../src/parts/table/table-properties/table-borders.ts","../src/parts/table/table-properties/table-float-properties.ts","../src/parts/table/table-properties/table-layout.ts","../src/parts/table/table-properties/table-look.ts","../src/parts/table/table-properties/table-properties.ts","../src/parts/table/table-properties/table-property-exceptions.ts","../src/parts/table/table-cell/table-cell-components.ts","../src/parts/table/table-row/table-row.ts","../src/parts/table/table-row/table-row-height.ts","../src/parts/table/table.ts","../src/parts/table/stringify.ts","../src/parts/table/descriptor.ts","../src/shared/constants.ts","../src/parts/paragraph/frame/frame-properties.ts","../src/parts/object/object-element.ts","../src/parts/paragraph/run/empty-children.ts","../src/parts/paragraph/run/run.ts","../src/parts/paragraph/properties.ts","../src/parts/paragraph/run/symbol-run.ts","../src/parts/drawing/doc-properties/doc-properties.ts","../src/parts/drawing/drawing.ts","../src/parts/drawing/text-wrap/text-wrapping.ts","../src/parts/drawing/text-wrap/wrap-tight.ts","../src/parts/drawing/text-wrap/wrap-through.ts","../src/parts/drawing/floating/floating-position.ts","../src/parts/drawing/floating/horizontal-position.ts","../src/parts/drawing/floating/vertical-position.ts","../src/parts/drawing/descriptor.ts","../src/parts/drawing/inline/graphic/graphic-data/wpg/wpg-group.ts","../src/parts/drawing/inline/graphic/graphic-data/wps/body-properties.ts","../src/parts/drawing/inline/graphic/graphic-data/wps/non-visual-shape-properties.ts","../src/parts/drawing/inline/graphic/graphic-data/wps/wps-shape.ts","../src/shared/media/data.ts","../src/shared/media/media.ts","../src/parts/paragraph/run/image-run.ts","../src/parts/paragraph/run/chart-run.ts","../src/parts/paragraph/run/smartart-run.ts","../src/parts/document/document-background/document-background.ts","../src/parts/paragraph/run/wps-shape-run.ts","../src/parts/paragraph/run/wpg-group-run.ts","../src/parts/paragraph/run/simple-field.ts","../src/parts/paragraph/run/comment-run.ts","../src/parts/paragraph/run/positional-tab.ts","../src/parts/paragraph/run/ruby.ts","../src/parts/paragraph/run/form-field.ts","../src/parts/paragraph/run/smart-tag-run.ts","../src/parts/paragraph/run/proof-error.ts","../src/parts/paragraph/paragraph.ts","../src/parts/table/table-row/table-row-properties.ts","../src/parts/table/table-cell/table-cell-properties.ts","../src/parts/table/table-cell/table-cell.ts","../src/parts/custom-xml/custom-xml.ts","../src/parts/document/body/section-properties/properties/column.ts","../src/parts/document/body/section-properties/properties/columns.ts","../src/parts/document/body/section-properties/properties/doc-grid.ts","../src/parts/document/body/section-properties/properties/page-size.ts","../src/parts/document/body/section-properties/properties/page-number.ts","../src/parts/document/body/section-properties/properties/page-borders.ts","../src/parts/document/body/section-properties/properties/page-margin.ts","../src/parts/document/body/section-properties/properties/page-text-direction.ts","../src/parts/document/body/section-properties/properties/line-number.ts","../src/parts/document/body/section-properties/properties/section-type.ts","../src/parts/document/body/section-properties/properties/header-footer-reference.ts","../src/parts/document/body/section-properties/descriptor.ts","../src/parts/sub-doc/sub-doc.ts","../src/parts/textbox/types.ts","../src/parts/textbox/shape/shape.ts","../src/shared/section.ts","../src/parts/document/document-attributes.ts","../src/parts/header-footer.ts","../src/parts/document/body/section-properties/properties/footnote-endnote-properties.ts","../src/parts/document/body/section-properties/section-properties.ts","../src/parts/endnotes/descriptor.ts","../src/parts/footnotes/descriptor.ts","../src/parts/glossary-document.ts","../src/parts/numbering/level.ts","../src/parts/numbering/numbering.ts","../src/parts/numbering/abstract-numbering.ts","../src/parts/numbering/num.ts","../src/parts/settings/compatibility.ts","../src/parts/settings/settings.ts","../src/parts/styles/factory.ts","../src/parts/styles/styles.ts","../src/parts/sub-doc/sub-doc-collection.ts","../src/parts/frameset.ts","../src/parts/web-settings.ts","../src/shared/embeddings/embeddings.ts","../src/parse.ts","../src/context.ts","../src/parts/fonts/font-wrapper.ts","../src/parts/fonts/font-table.ts","../src/parts/settings/descriptor.ts","../src/parts/core-properties.ts"],"mappings":";;;;;;;;UAkCiB,iBAAA;EACf,IAAA;EACA,KAAA;EACA,MAAA;EACA,IAAA;EACA,KAAA;EACA,GAAA;EACA,SAAA;EACA,OAAA;EACA,MAAA;EACA,KAAA;EACA,KAAA;EACA,SAAA;EACA,IAAA;EACA,GAAA;EACA,OAAA;EACA,WAAA;AAAA;AAAA,UASe,mBAAA;EACf,OAAA,EAAS,iBAAiB;EAC1B,SAAA;AAAA;AAAA,cAmCW,gBAAA,EAAkB,gBAAgB,CAAC,mBAAA;;;UCrF/B,kBAAA;EACf,SAAA;EACA,WAAW;AAAA;AAAA,UAGI,mBAAA;EACf,QAAA;EACA,WAAW;AAAA;AAAA,UAGI,i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