@office-open/docx 0.9.0 → 0.9.2

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.
@@ -1,5 +1,5 @@
1
- import { E as fontTableDesc, M as endnotesDesc, N as footnotesDesc, T as bibliographyDesc, a as stringifyBodyChild, b as commentsDesc, d as customPropertiesDesc, f as corePropertiesDesc, n as DocxWriteContext, o as stringifyDocumentXml, u as webSettingsDesc, v as buildContentTypes, w as glossaryDesc, y as contentTypesDesc, z as settingsDesc } from "./context-Ca7nmKV2.mjs";
2
- import { w as DocumentAttributeNamespaces } from "./document-CWr8C_OX.mjs";
1
+ import { A as footnotesDesc, B as settingsDesc, C as fontTableDesc, N as stringifyBodyChild, P as stringifyDocumentXml, S as bibliographyDesc, _ as commentsDesc, c as corePropertiesDesc, g as contentTypesDesc, h as buildContentTypes, k as endnotesDesc, n as DocxWriteContext, o as webSettingsDesc, s as customPropertiesDesc, x as glossaryDesc } from "./context-CERMOUn0.mjs";
2
+ import { w as DocumentAttributeNamespaces } from "./document-CeM-U6J3.mjs";
3
3
  import { APP_PROPS_XML, OoxmlMimeType, addSmartArtRelationships, createPacker, findAndReplaceImagePlaceholders, formatId, hasPlaceholders, replaceAllPlaceholders, replaceNumberingPlaceholders } from "@office-open/core";
4
4
  import { escapeXml } from "@office-open/xml";
5
5
  import { DEFAULT_DRAWING_XML, getColorXml, getLayoutXml, getStyleXml } from "@office-open/core/smartart";
@@ -487,4 +487,4 @@ function generateDocumentStream(options, packerOptions) {
487
487
  //#endregion
488
488
  export { generateDocumentStream as n, generateDocumentSync as r, generateDocument as t };
489
489
 
490
- //# sourceMappingURL=generate-m1Cw7CHL.mjs.map
490
+ //# sourceMappingURL=generate-DiDgl0bc.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"generate-m1Cw7CHL.mjs","names":[],"sources":["../src/parts/fonts/obfuscate-ttf-to-odttf.ts","../src/parts/header-footer.ts","../src/compiler.ts","../src/generate.ts"],"sourcesContent":["/**\n * Font obfuscation module for embedding fonts in WordprocessingML documents.\n *\n * This module implements the OOXML font obfuscation algorithm used to embed\n * fonts in DOCX documents. Obfuscation is required by the OOXML specification\n * to prevent simple extraction of embedded font files.\n *\n * Reference: ECMA-376 Part 2, Section 11.1 (Font Embedding)\n *\n * @module\n */\n\n/** Start offset for obfuscation in the font file */\nconst obfuscatedStartOffset = 0;\n/** End offset for obfuscation (first 32 bytes are obfuscated) */\nconst obfuscatedEndOffset = 32;\n/** Expected GUID size (32 hex characters without dashes) */\nconst guidSize = 32;\n\n/**\n * Obfuscates a TrueType font file for embedding in OOXML documents.\n *\n * The obfuscation algorithm XORs the first 32 bytes of the font file\n * with a reversed byte sequence derived from the font's GUID key.\n * This prevents simple extraction while maintaining font functionality.\n *\n * @param buf - The original font file as a byte array\n * @param fontKey - The GUID key for the font (with or without dashes)\n * @returns The obfuscated font data\n * @throws Error if the fontKey is not a valid 32-character GUID\n *\n * @example\n * ```typescript\n * const fontData = readFileSync(\"font.ttf\");\n * const fontKey = \"00000000-0000-0000-0000-000000000000\";\n * const obfuscatedData = obfuscate(fontData, fontKey);\n * ```\n *\n * @internal\n */\nexport const obfuscate = (buf: Uint8Array, fontKey: string): Uint8Array => {\n const guid = fontKey.replace(/-/g, \"\");\n if (guid.length !== guidSize) {\n throw new Error(`Error: Cannot extract GUID from font filename: ${fontKey}`);\n }\n\n const hexStrings = guid.replace(/(..)/g, \"$1 \").trim().split(\" \");\n const hexNumbers = hexStrings.map((hexString) => parseInt(hexString, 16));\n hexNumbers.reverse();\n\n const bytesToObfuscate = buf.slice(obfuscatedStartOffset, obfuscatedEndOffset);\n const obfuscatedBytes = bytesToObfuscate.map(\n (byte, i) => byte ^ hexNumbers[i % hexNumbers.length],\n );\n\n const out = new Uint8Array(\n obfuscatedStartOffset + obfuscatedBytes.length + Math.max(0, buf.length - obfuscatedEndOffset),\n );\n out.set(buf.slice(0, obfuscatedStartOffset));\n out.set(obfuscatedBytes, obfuscatedStartOffset);\n out.set(buf.slice(obfuscatedEndOffset), obfuscatedStartOffset + obfuscatedBytes.length);\n return out;\n};\n","/**\n * Header/Footer entry module for WordprocessingML documents.\n *\n * Replaces the former HeaderWrapper/FooterWrapper/Header/Footer/HeaderFooterBase\n * class hierarchy with a simple data structure + pure serialization function.\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, CT_HdrFtr\n *\n * @module\n */\n\nimport type { Relationships } from \"@office-open/core\";\nimport { escapeXml } from \"@office-open/xml\";\nimport type { SectionChild } from \"@shared/section\";\n\nimport { stringifyBodyChild } from \"../body\";\nimport type { BodyContext } from \"../context\";\nimport { DocumentAttributeNamespaces } from \"./document/document-attributes\";\nimport type { DocumentAttributeNamespace } from \"./document/document-attributes\";\n\n/**\n * Simple data structure for a header or footer entry.\n *\n * Replaces HeaderWrapper/FooterWrapper — holds children, relationships,\n * and the reference ID needed for section property references.\n *\n * Children are raw SectionChild objects (plain JSON or class instances).\n */\nexport interface HeaderFooterEntry {\n children: SectionChild[];\n relationships: Relationships;\n referenceId: number;\n}\n\n/**\n * Namespace keys used by header elements.\n * @internal\n */\nexport const HEADER_NAMESPACES: DocumentAttributeNamespace[] = [\n \"cx\",\n \"cx1\",\n \"cx2\",\n \"cx3\",\n \"cx4\",\n \"cx5\",\n \"cx6\",\n \"cx7\",\n \"cx8\",\n \"m\",\n \"mc\",\n \"o\",\n \"r\",\n \"v\",\n \"w\",\n \"w10\",\n \"w14\",\n \"w15\",\n \"w16cid\",\n \"w16se\",\n \"wne\",\n \"wp\",\n \"wp14\",\n \"wpc\",\n \"wpg\",\n \"wpi\",\n \"wps\",\n];\n\n/**\n * Namespace keys used by footer elements.\n * @internal\n */\nexport const FOOTER_NAMESPACES: DocumentAttributeNamespace[] = [\n \"m\",\n \"mc\",\n \"o\",\n \"r\",\n \"v\",\n \"w\",\n \"w10\",\n \"w14\",\n \"w15\",\n \"wne\",\n \"wp\",\n \"wp14\",\n \"wpc\",\n \"wpg\",\n \"wpi\",\n \"wps\",\n];\n\n/**\n * Serialize a header or footer to XML.\n *\n * Builds the `<w:hdr>` or `<w:ftr>` element with namespace declarations,\n * then serializes each child element via `stringifyBodyChild()`.\n *\n * @param tag - Element tag name (\"w:hdr\" or \"w:ftr\")\n * @param namespaces - Namespace keys to declare on the root element\n * @param children - Block-level child elements (raw SectionChild objects)\n * @param ctx - Body context for stringification\n */\nexport function stringifyHeaderFooter(\n tag: string,\n namespaces: DocumentAttributeNamespace[],\n children: SectionChild[],\n ctx: BodyContext,\n): string {\n const attrParts: string[] = [];\n for (const ns of namespaces) {\n attrParts.push(`xmlns:${ns}=\"${escapeXml(DocumentAttributeNamespaces[ns])}\"`);\n }\n const attrStr = attrParts.join(\" \");\n\n const childParts: string[] = [];\n for (const child of children) {\n childParts.push(stringifyBodyChild(child, ctx));\n }\n\n const body = childParts.join(\"\");\n return body.length === 0 ? `<${tag} ${attrStr}/>` : `<${tag} ${attrStr}>${body}</${tag}>`;\n}\n","/**\n * DOCX document compiler — pure function entry point.\n *\n * compileDocument() accepts DocumentOptions directly,\n * creates a DocxWriteContext internally, and produces a Zippable result.\n * All XML parts are produced via descriptors or serialize() —\n * no Formatter dependency.\n *\n * @module\n */\n\nimport {\n addSmartArtRelationships,\n findAndReplaceImagePlaceholders,\n formatId,\n hasPlaceholders,\n replaceAllPlaceholders,\n replaceNumberingPlaceholders,\n} from \"@office-open/core\";\nimport type { XmlifyedFile, ZipOptions, Zippable } from \"@office-open/core\";\nimport { APP_PROPS_XML } from \"@office-open/core\";\nimport {\n DEFAULT_DRAWING_XML,\n getColorXml,\n getLayoutXml,\n getStyleXml,\n} from \"@office-open/core/smartart\";\nimport type { DocumentOptions } from \"@parts/core-properties\";\nimport { obfuscate } from \"@parts/fonts/obfuscate-ttf-to-odttf\";\nimport { HEADER_NAMESPACES, FOOTER_NAMESPACES, stringifyHeaderFooter } from \"@parts/header-footer\";\n\nimport { stringifyDocumentXml, stringifyBodyChild, type BodyContext } from \"./body\";\nimport { DocxWriteContext } from \"./context\";\nimport {\n corePropertiesDesc,\n customPropertiesDesc,\n contentTypesDesc,\n buildContentTypes,\n fontTableDesc,\n webSettingsDesc,\n commentsDesc,\n bibliographyDesc,\n settingsDesc,\n footnotesDesc,\n endnotesDesc,\n glossaryDesc,\n} from \"./parts\";\n\n/** Reusable TextEncoder (stateless, safe to share). */\nconst encoder = new TextEncoder();\n\n/** XML declaration prepended to every OOXML part. */\nconst XML_DECL = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>';\n\n/** Extended context for header/footer formatted view caching. */\ntype DocxContext = BodyContext & {\n headerFormattedViews?: Map<number, string>;\n footerFormattedViews?: Map<number, string>;\n};\n\n// ── Public API ──\n\n/**\n * Compile document options into a flat file map suitable for fflate zipSync.\n *\n * This is the primary entry point for DOCX generation — accepts DocumentOptions\n * directly.\n */\nexport function compileDocument(\n options: DocumentOptions,\n overrides: XmlifyedFile[] = [],\n mediaLevel: number = 0,\n): Zippable {\n const ctx = new DocxWriteContext(options);\n const files: Zippable = {};\n\n const headerFormattedViews = new Map<number, string>();\n const footerFormattedViews = new Map<number, string>();\n\n const xmlifiedFileMapping = xmlifyContext(ctx, headerFormattedViews, footerFormattedViews);\n const map = new Map<string, XmlifyedFile | XmlifyedFile[]>(Object.entries(xmlifiedFileMapping));\n\n for (const [, obj] of map) {\n if (Array.isArray(obj)) {\n for (const subFile of obj as XmlifyedFile[]) {\n files[subFile.path] =\n typeof subFile.data === \"string\" ? encoder.encode(subFile.data) : subFile.data;\n }\n } else {\n const fileObj = obj as XmlifyedFile;\n files[fileObj.path] =\n typeof fileObj.data === \"string\" ? encoder.encode(fileObj.data) : fileObj.data;\n }\n }\n\n for (const subFile of overrides) {\n files[subFile.path] =\n typeof subFile.data === \"string\" ? encoder.encode(subFile.data) : subFile.data;\n }\n\n // Media files\n const mediaArray = ctx.media.array;\n for (const mediaData of mediaArray) {\n files[`word/media/${mediaData.fileName}`] = [\n mediaData.data as Uint8Array,\n { level: mediaLevel as ZipOptions[\"level\"] },\n ];\n if (mediaData.type === \"svg\") {\n files[`word/media/${mediaData.fallback.fileName}`] = [\n mediaData.fallback.data as Uint8Array,\n { level: mediaLevel as ZipOptions[\"level\"] },\n ];\n }\n }\n\n // Font files\n for (const { data: buffer, name, fontKey } of ctx.fontTable.fontOptionsWithKey) {\n const [nameWithoutExtension] = name.split(\".\");\n files[`word/fonts/${nameWithoutExtension}.odttf`] = obfuscate(buffer, fontKey);\n }\n\n return files;\n}\n\n// ── Internal ──\n\n/**\n * Complete mapping of all XML files in an OOXML document package.\n */\ninterface XmlifyedFileMapping {\n Document: XmlifyedFile;\n Styles: XmlifyedFile;\n Properties: XmlifyedFile;\n Numbering: XmlifyedFile;\n Relationships: XmlifyedFile;\n FileRelationships: XmlifyedFile;\n Headers: XmlifyedFile[];\n Footers: XmlifyedFile[];\n HeaderRelationships: XmlifyedFile[];\n FooterRelationships: XmlifyedFile[];\n ContentTypes: XmlifyedFile;\n CustomProperties: XmlifyedFile;\n AppProperties: XmlifyedFile;\n FootNotes: XmlifyedFile;\n FootNotesRelationships: XmlifyedFile;\n Endnotes: XmlifyedFile;\n EndnotesRelationships: XmlifyedFile;\n Settings: XmlifyedFile;\n Comments?: XmlifyedFile;\n CommentsRelationships?: XmlifyedFile;\n FontTable?: XmlifyedFile;\n FontTableRelationships?: XmlifyedFile;\n Bibliography?: XmlifyedFile;\n Charts?: XmlifyedFile[];\n DiagramData?: XmlifyedFile[];\n DiagramLayout?: XmlifyedFile[];\n DiagramStyle?: XmlifyedFile[];\n DiagramColors?: XmlifyedFile[];\n DiagramDrawing?: XmlifyedFile[];\n AltChunks?: XmlifyedFile[];\n SubDocs?: XmlifyedFile[];\n Glossary?: XmlifyedFile;\n WebSettings?: XmlifyedFile;\n}\n\nfunction xmlifyContext(\n ctx: DocxWriteContext,\n headerFormattedViews: Map<number, string>,\n footerFormattedViews: Map<number, string>,\n): XmlifyedFileMapping {\n const mkCtx = (viewWrapper: DocxContext[\"viewWrapper\"] = ctx.document): DocxContext => ({\n fileData: ctx,\n file: ctx,\n viewWrapper,\n stringifyChild: stringifyBodyChild,\n addRelationship: (type: string, target: string, mode?: string) =>\n ctx.addRelationship(type, target, mode),\n addMedia: (data: Uint8Array, type: string) => ctx.addMedia(data, type),\n });\n\n const documentRelationshipCount = ctx.document.relationships.relationshipCount + 1;\n const docCtx = mkCtx(ctx.document);\n const documentXmlData = XML_DECL + stringifyDocumentXml(ctx, docCtx);\n\n const commentRelationshipCount = ctx.comments.relationships.relationshipCount + 1;\n const commentCtx = mkCtx({ relationships: ctx.comments.relationships });\n const commentXmlData =\n XML_DECL + commentsDesc.stringify(ctx._options.comments ?? { children: [] }, commentCtx);\n\n const footnoteRelationshipCount = ctx.footNotes.relationships.relationshipCount + 1;\n const footnoteCtx = mkCtx({\n relationships: ctx.footNotes.relationships,\n });\n const footnoteXmlData =\n XML_DECL + (footnotesDesc.stringify({ notes: ctx.footNotes.notes }, footnoteCtx) ?? \"\");\n\n const documentMedia = findAndReplaceImagePlaceholders(\n documentXmlData,\n ctx.media.array,\n documentRelationshipCount,\n );\n const commentMedia = findAndReplaceImagePlaceholders(\n commentXmlData,\n ctx.media.array,\n commentRelationshipCount,\n );\n const footnoteMedia = findAndReplaceImagePlaceholders(\n footnoteXmlData,\n ctx.media.array,\n footnoteRelationshipCount,\n );\n\n return {\n AppProperties: {\n data: XML_DECL + APP_PROPS_XML,\n path: \"docProps/app.xml\",\n },\n Comments: {\n data: (() => {\n const xmlData = commentMedia.referenced.length > 0 ? commentMedia.xml : commentXmlData;\n return replaceNumberingPlaceholders(xmlData, ctx.numbering.concreteNumbering);\n })(),\n path: \"word/comments.xml\",\n },\n CommentsRelationships: {\n data: (() => {\n for (let i = 0; i < commentMedia.referenced.length; i++) {\n ctx.comments.relationships.addRelationship(\n commentRelationshipCount + i,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\",\n `media/${commentMedia.referenced[i].fileName}`,\n );\n }\n return XML_DECL + ctx.comments.relationships.serialize();\n })(),\n path: \"word/_rels/comments.xml.rels\",\n },\n ContentTypes: {\n data:\n XML_DECL +\n (contentTypesDesc.stringify(\n buildContentTypes({\n headerCount: ctx.headers.length,\n footerCount: ctx.footers.length,\n chartCount: ctx.charts.array.length,\n smartArtCount: ctx.smartArts.array.length,\n hasBibliography: !!ctx._options.bibliography,\n hasGlossary: !!ctx.glossaryOptions,\n hasWebSettings: !!ctx.webSettings,\n altChunks: ctx.altChunks.array.map((ac) => ({\n path: `/word/${ac.path}`,\n contentType: ac.contentType ?? \"application/xhtml+xml\",\n })),\n subDocs: ctx.subDocs.array.map((sd) => ({ path: `/word/${sd.path}` })),\n }),\n ctx,\n ) ?? \"\"),\n path: \"[Content_Types].xml\",\n },\n CustomProperties: {\n data:\n XML_DECL +\n (customPropertiesDesc.stringify({ properties: ctx._options.customProperties ?? [] }, ctx) ??\n \"\"),\n path: \"docProps/custom.xml\",\n },\n Document: {\n data: (() => {\n let xmlData = documentMedia.referenced.length > 0 ? documentMedia.xml : documentXmlData;\n if (hasPlaceholders(xmlData)) {\n const mediaCount = documentMedia.referenced.length;\n const chartKeys = ctx.charts.array.map((c) => c.key);\n const smartArtKeys = ctx.smartArts.array.map((s) => s.key);\n const chartOffset = documentRelationshipCount + mediaCount;\n const smartArtOffset = chartOffset + chartKeys.length;\n\n // Build combined replacement entries for charts, smartart, and numbering\n const entries: Array<{ prefix?: string; key: string; value: string }> = [];\n for (let i = 0; i < chartKeys.length; i++) {\n entries.push({\n prefix: \"chart:\",\n key: chartKeys[i],\n value: formatId(chartOffset, i, \"rId\"),\n });\n }\n const saPrefixes = [\"smartart:\", \"smartart-lo:\", \"smartart-qs:\", \"smartart-cs:\"];\n for (let i = 0; i < smartArtKeys.length; i++) {\n for (let p = 0; p < saPrefixes.length; p++) {\n entries.push({\n prefix: saPrefixes[p],\n key: smartArtKeys[i],\n value: formatId(smartArtOffset + p * smartArtKeys.length, i, \"rId\"),\n });\n }\n }\n for (const { reference, instance, numId } of ctx.numbering.concreteNumbering) {\n entries.push({ key: `${reference}-${instance}`, value: numId.toString() });\n }\n xmlData = replaceAllPlaceholders(xmlData, entries);\n } else {\n xmlData = replaceNumberingPlaceholders(xmlData, ctx.numbering.concreteNumbering);\n }\n return xmlData;\n })(),\n path: \"word/document.xml\",\n },\n Endnotes: {\n data: (() => {\n const endnoteCtx = mkCtx({\n relationships: ctx.endnotes.relationships,\n });\n const xmlData =\n XML_DECL + (endnotesDesc.stringify({ notes: ctx.endnotes.notes }, endnoteCtx) ?? \"\");\n const endnoteRelCount = ctx.endnotes.relationships.relationshipCount + 1;\n const endnoteMedia = findAndReplaceImagePlaceholders(\n xmlData,\n ctx.media.array,\n endnoteRelCount,\n );\n if (endnoteMedia.referenced.length > 0) {\n for (let i = 0; i < endnoteMedia.referenced.length; i++) {\n ctx.endnotes.relationships.addRelationship(\n endnoteRelCount + i,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\",\n `media/${endnoteMedia.referenced[i].fileName}`,\n );\n }\n return replaceNumberingPlaceholders(endnoteMedia.xml, ctx.numbering.concreteNumbering);\n }\n return replaceNumberingPlaceholders(xmlData, ctx.numbering.concreteNumbering);\n })(),\n path: \"word/endnotes.xml\",\n },\n EndnotesRelationships: {\n data: XML_DECL + ctx.endnotes.relationships.serialize(),\n path: \"word/_rels/endnotes.xml.rels\",\n },\n FileRelationships: {\n data: XML_DECL + ctx.fileRelationships.serialize(),\n path: \"_rels/.rels\",\n },\n FontTable: {\n data:\n XML_DECL +\n (fontTableDesc.stringify({ fonts: ctx.fontTable.fontOptionsWithKey }, ctx) ?? \"\"),\n path: \"word/fontTable.xml\",\n },\n FontTableRelationships: {\n data: XML_DECL + ctx.fontTable.relationships.serialize(),\n path: \"word/_rels/fontTable.xml.rels\",\n },\n FootNotes: {\n data: (() => {\n const xmlData = footnoteMedia.referenced.length > 0 ? footnoteMedia.xml : footnoteXmlData;\n return replaceNumberingPlaceholders(xmlData, ctx.numbering.concreteNumbering);\n })(),\n path: \"word/footnotes.xml\",\n },\n FootNotesRelationships: {\n data: (() => {\n for (let i = 0; i < footnoteMedia.referenced.length; i++) {\n ctx.footNotes.relationships.addRelationship(\n footnoteRelationshipCount + i,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\",\n `media/${footnoteMedia.referenced[i].fileName}`,\n );\n }\n return XML_DECL + ctx.footNotes.relationships.serialize();\n })(),\n path: \"word/_rels/footnotes.xml.rels\",\n },\n FooterRelationships: ctx.footers.map((entry, index) => {\n const footerCtx = mkCtx({ relationships: entry.relationships });\n const xmlData =\n XML_DECL + stringifyHeaderFooter(\"w:ftr\", FOOTER_NAMESPACES, entry.children, footerCtx);\n footerFormattedViews.set(index, xmlData);\n const footerMedia = findAndReplaceImagePlaceholders(xmlData, ctx.media.array, 0);\n\n for (let i = 0; i < footerMedia.referenced.length; i++) {\n entry.relationships.addRelationship(\n i,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\",\n `media/${footerMedia.referenced[i].fileName}`,\n );\n }\n\n return {\n data: XML_DECL + entry.relationships.serialize(),\n path: `word/_rels/footer${index + 1}.xml.rels`,\n };\n }),\n Footers: ctx.footers.map((_entry, index) => {\n const tempXmlData = footerFormattedViews.get(index)!;\n const footerMedia = findAndReplaceImagePlaceholders(tempXmlData, ctx.media.array, 0);\n const xmlData = footerMedia.referenced.length > 0 ? footerMedia.xml : tempXmlData;\n\n return {\n data: replaceNumberingPlaceholders(xmlData, ctx.numbering.concreteNumbering),\n path: `word/footer${index + 1}.xml`,\n };\n }),\n HeaderRelationships: ctx.headers.map((entry, index) => {\n const headerCtx = mkCtx({ relationships: entry.relationships });\n const xmlData =\n XML_DECL + stringifyHeaderFooter(\"w:hdr\", HEADER_NAMESPACES, entry.children, headerCtx);\n headerFormattedViews.set(index, xmlData);\n const headerMedia = findAndReplaceImagePlaceholders(xmlData, ctx.media.array, 0);\n\n for (let i = 0; i < headerMedia.referenced.length; i++) {\n entry.relationships.addRelationship(\n i,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\",\n `media/${headerMedia.referenced[i].fileName}`,\n );\n }\n\n return {\n data: XML_DECL + entry.relationships.serialize(),\n path: `word/_rels/header${index + 1}.xml.rels`,\n };\n }),\n Headers: ctx.headers.map((_entry, index) => {\n const tempXmlData = headerFormattedViews.get(index)!;\n const headerMedia = findAndReplaceImagePlaceholders(tempXmlData, ctx.media.array, 0);\n const xmlData = headerMedia.referenced.length > 0 ? headerMedia.xml : tempXmlData;\n\n return {\n data: replaceNumberingPlaceholders(xmlData, ctx.numbering.concreteNumbering),\n path: `word/header${index + 1}.xml`,\n };\n }),\n Numbering: {\n data: ctx.numbering.serialize(),\n path: \"word/numbering.xml\",\n },\n Properties: {\n data: XML_DECL + (corePropertiesDesc.stringify(ctx._options, ctx) ?? \"\"),\n path: \"docProps/core.xml\",\n },\n Relationships: {\n data: (() => {\n for (let i = 0; i < documentMedia.referenced.length; i++) {\n ctx.document.relationships.addRelationship(\n documentRelationshipCount + i,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\",\n `media/${documentMedia.referenced[i].fileName}`,\n );\n }\n\n const chartOffset = documentRelationshipCount + documentMedia.referenced.length;\n for (let i = 0; i < ctx.charts.array.length; i++) {\n ctx.document.relationships.addRelationship(\n chartOffset + i,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart\",\n `charts/chart${i + 1}.xml`,\n );\n }\n\n addSmartArtRelationships(\n ctx.smartArts.array.map((s) => s.key),\n (id, type, target) => {\n ctx.document.relationships.addRelationship(id, type, target);\n },\n documentRelationshipCount + documentMedia.referenced.length + ctx.charts.array.length,\n 0,\n {\n pathPrefix: \"\",\n styleRelType: \"http://schemas.microsoft.com/office/2007/relationships/diagramStyle\",\n },\n );\n\n ctx.document.relationships.addRelationship(\n ctx.document.relationships.relationshipCount + 1,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable\",\n \"fontTable.xml\",\n );\n\n return XML_DECL + ctx.document.relationships.serialize();\n })(),\n path: \"word/_rels/document.xml.rels\",\n },\n Settings: {\n data: XML_DECL + (settingsDesc.stringify(ctx._settingsOptions, ctx) ?? \"\"),\n path: \"word/settings.xml\",\n },\n Styles: {\n data: (() => {\n const xmlStyles = ctx.styles.serialize();\n return replaceNumberingPlaceholders(xmlStyles, ctx.numbering.concreteNumbering);\n })(),\n path: \"word/styles.xml\",\n },\n ...(ctx._options.bibliography\n ? {\n Bibliography: {\n data: XML_DECL + (bibliographyDesc.stringify(ctx._options.bibliography, ctx) ?? \"\"),\n path: \"word/bibliography.xml\",\n },\n }\n : {}),\n ...(ctx.charts.array.length > 0\n ? {\n Charts: ctx.charts.array.flatMap((chartData, i) => [\n {\n data: XML_DECL + chartData.chartSpaceXml,\n path: `word/charts/chart${i + 1}.xml`,\n },\n {\n data: '<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"/>',\n path: `word/charts/_rels/chart${i + 1}.xml.rels`,\n },\n ]),\n }\n : {}),\n ...(ctx.smartArts.array.length > 0\n ? {\n DiagramData: ctx.smartArts.array.map((smartArtData, i) => ({\n data: XML_DECL + smartArtData.dataModelXml,\n path: `word/diagrams/data${i + 1}.xml`,\n })),\n DiagramLayout: ctx.smartArts.array.map((smartArtData, i) => ({\n data: getLayoutXml(smartArtData.layout),\n path: `word/diagrams/layout${i + 1}.xml`,\n })),\n DiagramStyle: ctx.smartArts.array.map((smartArtData, i) => ({\n data: getStyleXml(smartArtData.style),\n path: `word/diagrams/quickStyle${i + 1}.xml`,\n })),\n DiagramColors: ctx.smartArts.array.map((smartArtData, i) => ({\n data: getColorXml(smartArtData.color),\n path: `word/diagrams/colors${i + 1}.xml`,\n })),\n DiagramDrawing: ctx.smartArts.array.map((_, i) => ({\n data: DEFAULT_DRAWING_XML,\n path: `word/diagrams/drawing${i + 1}.xml`,\n })),\n }\n : {}),\n ...(ctx.altChunks.array.length > 0\n ? {\n AltChunks: ctx.altChunks.array.map((altChunkData) => ({\n data: altChunkData.data,\n path: `word/${altChunkData.path}`,\n })),\n }\n : {}),\n ...(ctx.subDocs.array.length > 0\n ? {\n SubDocs: ctx.subDocs.array.map((subDocData) => ({\n data: subDocData.data,\n path: `word/${subDocData.path}`,\n })),\n }\n : {}),\n ...(ctx.glossaryOptions\n ? {\n Glossary: {\n data: (() => {\n const glossaryCtx = mkCtx(undefined);\n return XML_DECL + (glossaryDesc.stringify(ctx.glossaryOptions!, glossaryCtx) ?? \"\");\n })(),\n path: \"word/glossary/document.xml\",\n },\n }\n : {}),\n ...(ctx.webSettings\n ? {\n WebSettings: {\n data: XML_DECL + (webSettingsDesc.stringify(ctx._options.webSettings ?? {}, ctx) ?? \"\"),\n path: \"word/webSettings.xml\",\n },\n }\n : {}),\n };\n}\n","/**\n * Pure function API for generating DOCX files.\n *\n * @module\n */\n\nimport { createPacker, OoxmlMimeType } from \"@office-open/core\";\nimport type { OutputByType, OutputType, PackerOptions } from \"@office-open/core\";\nimport type { DocumentOptions } from \"@parts/core-properties\";\n\nimport { compileDocument } from \"./compiler\";\n\n/** @internal Packer instance for DOCX generation. */\nconst Packer = createPacker<DocumentOptions>({\n compile: (options, overrides, mediaLevel) => compileDocument(options, overrides, mediaLevel),\n mimeType: OoxmlMimeType.DOCX,\n});\n\n/**\n * Generate a DOCX file from pure JSON options.\n *\n * The output format is controlled by `packerOptions.type` (default: `\"nodebuffer\"` → Buffer).\n * For synchronous generation, use {@link generateDocumentSync}. For streaming, use {@link generateDocumentStream}.\n *\n * @param options - Document options (sections, styles, numbering, etc.)\n * @param packerOptions - Optional packer configuration (type, compression, overrides, etc.)\n *\n * @example\n * ```typescript\n * import { generateDocument } from \"@office-open/docx\";\n *\n * const buffer = await generateDocument({ sections: [...] });\n * const bytes = await generateDocument({ sections: [...] }, { type: \"uint8array\" });\n * const blob = await generateDocument({ sections: [...] }, { type: \"blob\" });\n * ```\n */\nexport function generateDocument<T extends OutputType = \"nodebuffer\">(\n options: DocumentOptions,\n packerOptions?: PackerOptions<T>,\n): Promise<OutputByType[T]> {\n return Packer.pack(options, packerOptions) as Promise<OutputByType[T]>;\n}\n\n/**\n * Synchronously generate a DOCX file from pure JSON options.\n */\nexport function generateDocumentSync<T extends OutputType = \"nodebuffer\">(\n options: DocumentOptions,\n packerOptions?: PackerOptions<T>,\n): OutputByType[T] {\n return Packer.packSync(options, packerOptions) as OutputByType[T];\n}\n\n/**\n * Generate a DOCX file as a `ReadableStream<Uint8Array>`.\n */\nexport function generateDocumentStream(\n options: DocumentOptions,\n packerOptions?: PackerOptions,\n): ReadableStream<Uint8Array> {\n return Packer.toStream(options, packerOptions);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAaA,MAAM,wBAAwB;;AAE9B,MAAM,sBAAsB;;AAE5B,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;AAuBjB,MAAa,aAAa,KAAiB,YAAgC;CACzE,MAAM,OAAO,QAAQ,QAAQ,MAAM,EAAE;CACrC,IAAI,KAAK,WAAW,UAClB,MAAM,IAAI,MAAM,kDAAkD,SAAS;CAI7E,MAAM,aADa,KAAK,QAAQ,SAAS,KAAK,EAAE,KAAK,EAAE,MAAM,GACjC,EAAE,KAAK,cAAc,SAAS,WAAW,EAAE,CAAC;CACxE,WAAW,QAAQ;CAGnB,MAAM,kBADmB,IAAI,MAAM,uBAAuB,mBACnB,EAAE,KACtC,MAAM,MAAM,OAAO,WAAW,IAAI,WAAW,OAChD;CAEA,MAAM,MAAM,IAAI,WACd,wBAAwB,gBAAgB,SAAS,KAAK,IAAI,GAAG,IAAI,SAAS,mBAAmB,CAC/F;CACA,IAAI,IAAI,IAAI,MAAM,GAAG,qBAAqB,CAAC;CAC3C,IAAI,IAAI,iBAAiB,qBAAqB;CAC9C,IAAI,IAAI,IAAI,MAAM,mBAAmB,GAAG,wBAAwB,gBAAgB,MAAM;CACtF,OAAO;AACT;;;;;;;ACxBA,MAAa,oBAAkD;CAC7D;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;C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ACE,SAAS,IAAI,QAAQ,MAAM,KAAK,gBAAgB;GAC9C,MAAM,WAAW;GACjB,MAAM,QAAQ,WAAW;EAC3B,EAAE,EACJ,IACA,CAAC;EACL,GAAI,IAAI,kBACJ,EACE,UAAU;GACR,aAAa;IACX,MAAM,cAAc,MAAM,KAAA,CAAS;IACnC,OAAO,YAAY,aAAa,UAAU,IAAI,iBAAkB,WAAW,KAAK;GAClF,GAAG;GACH,MAAM;EACR,EACF,IACA,CAAC;EACL,GAAI,IAAI,cACJ,EACE,aAAa;GACX,MAAM,YAAY,gBAAgB,UAAU,IAAI,SAAS,eAAe,CAAC,GAAG,GAAG,KAAK;GACpF,MAAM;EACR,EACF,IACA,CAAC;CACP;AACF;;;;;;;;;ACjjBA,MAAM,SAAS,aAA8B;CAC3C,UAAU,SAAS,WAAW,eAAe,gBAAgB,SAAS,WAAW,UAAU;CAC3F,UAAU,cAAc;AAC1B,CAAC;;;;;;;;;;;;;;;;;;;AAoBD,SAAgB,iBACd,SACA,eAC0B;CAC1B,OAAO,OAAO,KAAK,SAAS,aAAa;AAC3C;;;;AAKA,SAAgB,qBACd,SACA,eACiB;CACjB,OAAO,OAAO,SAAS,SAAS,aAAa;AAC/C;;;;AAKA,SAAgB,uBACd,SACA,eAC4B;CAC5B,OAAO,OAAO,SAAS,SAAS,aAAa;AAC/C"}
1
+ {"version":3,"file":"generate-DiDgl0bc.mjs","names":[],"sources":["../src/parts/fonts/obfuscate-ttf-to-odttf.ts","../src/parts/header-footer.ts","../src/compiler.ts","../src/generate.ts"],"sourcesContent":["/**\n * Font obfuscation module for embedding fonts in WordprocessingML documents.\n *\n * This module implements the OOXML font obfuscation algorithm used to embed\n * fonts in DOCX documents. Obfuscation is required by the OOXML specification\n * to prevent simple extraction of embedded font files.\n *\n * Reference: ECMA-376 Part 2, Section 11.1 (Font Embedding)\n *\n * @module\n */\n\n/** Start offset for obfuscation in the font file */\nconst obfuscatedStartOffset = 0;\n/** End offset for obfuscation (first 32 bytes are obfuscated) */\nconst obfuscatedEndOffset = 32;\n/** Expected GUID size (32 hex characters without dashes) */\nconst guidSize = 32;\n\n/**\n * Obfuscates a TrueType font file for embedding in OOXML documents.\n *\n * The obfuscation algorithm XORs the first 32 bytes of the font file\n * with a reversed byte sequence derived from the font's GUID key.\n * This prevents simple extraction while maintaining font functionality.\n *\n * @param buf - The original font file as a byte array\n * @param fontKey - The GUID key for the font (with or without dashes)\n * @returns The obfuscated font data\n * @throws Error if the fontKey is not a valid 32-character GUID\n *\n * @example\n * ```typescript\n * const fontData = readFileSync(\"font.ttf\");\n * const fontKey = \"00000000-0000-0000-0000-000000000000\";\n * const obfuscatedData = obfuscate(fontData, fontKey);\n * ```\n *\n * @internal\n */\nexport const obfuscate = (buf: Uint8Array, fontKey: string): Uint8Array => {\n const guid = fontKey.replace(/-/g, \"\");\n if (guid.length !== guidSize) {\n throw new Error(`Error: Cannot extract GUID from font filename: ${fontKey}`);\n }\n\n const hexStrings = guid.replace(/(..)/g, \"$1 \").trim().split(\" \");\n const hexNumbers = hexStrings.map((hexString) => parseInt(hexString, 16));\n hexNumbers.reverse();\n\n const bytesToObfuscate = buf.slice(obfuscatedStartOffset, obfuscatedEndOffset);\n const obfuscatedBytes = bytesToObfuscate.map(\n (byte, i) => byte ^ hexNumbers[i % hexNumbers.length],\n );\n\n const out = new Uint8Array(\n obfuscatedStartOffset + obfuscatedBytes.length + Math.max(0, buf.length - obfuscatedEndOffset),\n );\n out.set(buf.slice(0, obfuscatedStartOffset));\n out.set(obfuscatedBytes, obfuscatedStartOffset);\n out.set(buf.slice(obfuscatedEndOffset), obfuscatedStartOffset + obfuscatedBytes.length);\n return out;\n};\n","/**\n * Header/Footer entry module for WordprocessingML documents.\n *\n * Replaces the former HeaderWrapper/FooterWrapper/Header/Footer/HeaderFooterBase\n * class hierarchy with a simple data structure + pure serialization function.\n *\n * Reference: ISO/IEC 29500-4, wml.xsd, CT_HdrFtr\n *\n * @module\n */\n\nimport type { Relationships } from \"@office-open/core\";\nimport { escapeXml } from \"@office-open/xml\";\nimport type { SectionChild } from \"@shared/section\";\n\nimport { stringifyBodyChild } from \"../body\";\nimport type { BodyContext } from \"../context\";\nimport { DocumentAttributeNamespaces } from \"./document/document-attributes\";\nimport type { DocumentAttributeNamespace } from \"./document/document-attributes\";\n\n/**\n * Simple data structure for a header or footer entry.\n *\n * Replaces HeaderWrapper/FooterWrapper — holds children, relationships,\n * and the reference ID needed for section property references.\n *\n * Children are raw SectionChild objects (plain JSON or class instances).\n */\nexport interface HeaderFooterEntry {\n children: SectionChild[];\n relationships: Relationships;\n referenceId: number;\n}\n\n/**\n * Namespace keys used by header elements.\n * @internal\n */\nexport const HEADER_NAMESPACES: DocumentAttributeNamespace[] = [\n \"cx\",\n \"cx1\",\n \"cx2\",\n \"cx3\",\n \"cx4\",\n \"cx5\",\n \"cx6\",\n \"cx7\",\n \"cx8\",\n \"m\",\n \"mc\",\n \"o\",\n \"r\",\n \"v\",\n \"w\",\n \"w10\",\n \"w14\",\n \"w15\",\n \"w16cid\",\n \"w16se\",\n \"wne\",\n \"wp\",\n \"wp14\",\n \"wpc\",\n \"wpg\",\n \"wpi\",\n \"wps\",\n];\n\n/**\n * Namespace keys used by footer elements.\n * @internal\n */\nexport const FOOTER_NAMESPACES: DocumentAttributeNamespace[] = [\n \"m\",\n \"mc\",\n \"o\",\n \"r\",\n \"v\",\n \"w\",\n \"w10\",\n \"w14\",\n \"w15\",\n \"wne\",\n \"wp\",\n \"wp14\",\n \"wpc\",\n \"wpg\",\n \"wpi\",\n \"wps\",\n];\n\n/**\n * Serialize a header or footer to XML.\n *\n * Builds the `<w:hdr>` or `<w:ftr>` element with namespace declarations,\n * then serializes each child element via `stringifyBodyChild()`.\n *\n * @param tag - Element tag name (\"w:hdr\" or \"w:ftr\")\n * @param namespaces - Namespace keys to declare on the root element\n * @param children - Block-level child elements (raw SectionChild objects)\n * @param ctx - Body context for stringification\n */\nexport function stringifyHeaderFooter(\n tag: string,\n namespaces: DocumentAttributeNamespace[],\n children: SectionChild[],\n ctx: BodyContext,\n): string {\n const attrParts: string[] = [];\n for (const ns of namespaces) {\n attrParts.push(`xmlns:${ns}=\"${escapeXml(DocumentAttributeNamespaces[ns])}\"`);\n }\n const attrStr = attrParts.join(\" \");\n\n const childParts: string[] = [];\n for (const child of children) {\n childParts.push(stringifyBodyChild(child, ctx));\n }\n\n const body = childParts.join(\"\");\n return body.length === 0 ? `<${tag} ${attrStr}/>` : `<${tag} ${attrStr}>${body}</${tag}>`;\n}\n","/**\n * DOCX document compiler — pure function entry point.\n *\n * compileDocument() accepts DocumentOptions directly,\n * creates a DocxWriteContext internally, and produces a Zippable result.\n * All XML parts are produced via descriptors or serialize() —\n * no Formatter dependency.\n *\n * @module\n */\n\nimport {\n addSmartArtRelationships,\n findAndReplaceImagePlaceholders,\n formatId,\n hasPlaceholders,\n replaceAllPlaceholders,\n replaceNumberingPlaceholders,\n} from \"@office-open/core\";\nimport type { XmlifyedFile, ZipOptions, Zippable } from \"@office-open/core\";\nimport { APP_PROPS_XML } from \"@office-open/core\";\nimport {\n DEFAULT_DRAWING_XML,\n getColorXml,\n getLayoutXml,\n getStyleXml,\n} from \"@office-open/core/smartart\";\nimport type { DocumentOptions } from \"@parts/core-properties\";\nimport { obfuscate } from \"@parts/fonts/obfuscate-ttf-to-odttf\";\nimport { HEADER_NAMESPACES, FOOTER_NAMESPACES, stringifyHeaderFooter } from \"@parts/header-footer\";\n\nimport { stringifyDocumentXml, stringifyBodyChild, type BodyContext } from \"./body\";\nimport { DocxWriteContext } from \"./context\";\nimport {\n corePropertiesDesc,\n customPropertiesDesc,\n contentTypesDesc,\n buildContentTypes,\n fontTableDesc,\n webSettingsDesc,\n commentsDesc,\n bibliographyDesc,\n settingsDesc,\n footnotesDesc,\n endnotesDesc,\n glossaryDesc,\n} from \"./parts\";\n\n/** Reusable TextEncoder (stateless, safe to share). */\nconst encoder = new TextEncoder();\n\n/** XML declaration prepended to every OOXML part. */\nconst XML_DECL = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>';\n\n/** Extended context for header/footer formatted view caching. */\ntype DocxContext = BodyContext & {\n headerFormattedViews?: Map<number, string>;\n footerFormattedViews?: Map<number, string>;\n};\n\n// ── Public API ──\n\n/**\n * Compile document options into a flat file map suitable for fflate zipSync.\n *\n * This is the primary entry point for DOCX generation — accepts DocumentOptions\n * directly.\n */\nexport function compileDocument(\n options: DocumentOptions,\n overrides: XmlifyedFile[] = [],\n mediaLevel: number = 0,\n): Zippable {\n const ctx = new DocxWriteContext(options);\n const files: Zippable = {};\n\n const headerFormattedViews = new Map<number, string>();\n const footerFormattedViews = new Map<number, string>();\n\n const xmlifiedFileMapping = xmlifyContext(ctx, headerFormattedViews, footerFormattedViews);\n const map = new Map<string, XmlifyedFile | XmlifyedFile[]>(Object.entries(xmlifiedFileMapping));\n\n for (const [, obj] of map) {\n if (Array.isArray(obj)) {\n for (const subFile of obj as XmlifyedFile[]) {\n files[subFile.path] =\n typeof subFile.data === \"string\" ? encoder.encode(subFile.data) : subFile.data;\n }\n } else {\n const fileObj = obj as XmlifyedFile;\n files[fileObj.path] =\n typeof fileObj.data === \"string\" ? encoder.encode(fileObj.data) : fileObj.data;\n }\n }\n\n for (const subFile of overrides) {\n files[subFile.path] =\n typeof subFile.data === \"string\" ? encoder.encode(subFile.data) : subFile.data;\n }\n\n // Media files\n const mediaArray = ctx.media.array;\n for (const mediaData of mediaArray) {\n files[`word/media/${mediaData.fileName}`] = [\n mediaData.data as Uint8Array,\n { level: mediaLevel as ZipOptions[\"level\"] },\n ];\n if (mediaData.type === \"svg\") {\n files[`word/media/${mediaData.fallback.fileName}`] = [\n mediaData.fallback.data as Uint8Array,\n { level: mediaLevel as ZipOptions[\"level\"] },\n ];\n }\n }\n\n // Font files\n for (const { data: buffer, name, fontKey } of ctx.fontTable.fontOptionsWithKey) {\n const [nameWithoutExtension] = name.split(\".\");\n files[`word/fonts/${nameWithoutExtension}.odttf`] = obfuscate(buffer, fontKey);\n }\n\n return files;\n}\n\n// ── Internal ──\n\n/**\n * Complete mapping of all XML files in an OOXML document package.\n */\ninterface XmlifyedFileMapping {\n Document: XmlifyedFile;\n Styles: XmlifyedFile;\n Properties: XmlifyedFile;\n Numbering: XmlifyedFile;\n Relationships: XmlifyedFile;\n FileRelationships: XmlifyedFile;\n Headers: XmlifyedFile[];\n Footers: XmlifyedFile[];\n HeaderRelationships: XmlifyedFile[];\n FooterRelationships: XmlifyedFile[];\n ContentTypes: XmlifyedFile;\n CustomProperties: XmlifyedFile;\n AppProperties: XmlifyedFile;\n FootNotes: XmlifyedFile;\n FootNotesRelationships: XmlifyedFile;\n Endnotes: XmlifyedFile;\n EndnotesRelationships: XmlifyedFile;\n Settings: XmlifyedFile;\n Comments?: XmlifyedFile;\n CommentsRelationships?: XmlifyedFile;\n FontTable?: XmlifyedFile;\n FontTableRelationships?: XmlifyedFile;\n Bibliography?: XmlifyedFile;\n Charts?: XmlifyedFile[];\n DiagramData?: XmlifyedFile[];\n DiagramLayout?: XmlifyedFile[];\n DiagramStyle?: XmlifyedFile[];\n DiagramColors?: XmlifyedFile[];\n DiagramDrawing?: XmlifyedFile[];\n AltChunks?: XmlifyedFile[];\n SubDocs?: XmlifyedFile[];\n Glossary?: XmlifyedFile;\n WebSettings?: XmlifyedFile;\n}\n\nfunction xmlifyContext(\n ctx: DocxWriteContext,\n headerFormattedViews: Map<number, string>,\n footerFormattedViews: Map<number, string>,\n): XmlifyedFileMapping {\n const mkCtx = (viewWrapper: DocxContext[\"viewWrapper\"] = ctx.document): DocxContext => ({\n fileData: ctx,\n file: ctx,\n viewWrapper,\n stringifyChild: stringifyBodyChild,\n addRelationship: (type: string, target: string, mode?: string) =>\n ctx.addRelationship(type, target, mode),\n addMedia: (data: Uint8Array, type: string) => ctx.addMedia(data, type),\n });\n\n const documentRelationshipCount = ctx.document.relationships.relationshipCount + 1;\n const docCtx = mkCtx(ctx.document);\n const documentXmlData = XML_DECL + stringifyDocumentXml(ctx, docCtx);\n\n const commentRelationshipCount = ctx.comments.relationships.relationshipCount + 1;\n const commentCtx = mkCtx({ relationships: ctx.comments.relationships });\n const commentXmlData =\n XML_DECL + commentsDesc.stringify(ctx._options.comments ?? { children: [] }, commentCtx);\n\n const footnoteRelationshipCount = ctx.footNotes.relationships.relationshipCount + 1;\n const footnoteCtx = mkCtx({\n relationships: ctx.footNotes.relationships,\n });\n const footnoteXmlData =\n XML_DECL + (footnotesDesc.stringify({ notes: ctx.footNotes.notes }, footnoteCtx) ?? \"\");\n\n const documentMedia = findAndReplaceImagePlaceholders(\n documentXmlData,\n ctx.media.array,\n documentRelationshipCount,\n );\n const commentMedia = findAndReplaceImagePlaceholders(\n commentXmlData,\n ctx.media.array,\n commentRelationshipCount,\n );\n const footnoteMedia = findAndReplaceImagePlaceholders(\n footnoteXmlData,\n ctx.media.array,\n footnoteRelationshipCount,\n );\n\n return {\n AppProperties: {\n data: XML_DECL + APP_PROPS_XML,\n path: \"docProps/app.xml\",\n },\n Comments: {\n data: (() => {\n const xmlData = commentMedia.referenced.length > 0 ? commentMedia.xml : commentXmlData;\n return replaceNumberingPlaceholders(xmlData, ctx.numbering.concreteNumbering);\n })(),\n path: \"word/comments.xml\",\n },\n CommentsRelationships: {\n data: (() => {\n for (let i = 0; i < commentMedia.referenced.length; i++) {\n ctx.comments.relationships.addRelationship(\n commentRelationshipCount + i,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\",\n `media/${commentMedia.referenced[i].fileName}`,\n );\n }\n return XML_DECL + ctx.comments.relationships.serialize();\n })(),\n path: \"word/_rels/comments.xml.rels\",\n },\n ContentTypes: {\n data:\n XML_DECL +\n (contentTypesDesc.stringify(\n buildContentTypes({\n headerCount: ctx.headers.length,\n footerCount: ctx.footers.length,\n chartCount: ctx.charts.array.length,\n smartArtCount: ctx.smartArts.array.length,\n hasBibliography: !!ctx._options.bibliography,\n hasGlossary: !!ctx.glossaryOptions,\n hasWebSettings: !!ctx.webSettings,\n altChunks: ctx.altChunks.array.map((ac) => ({\n path: `/word/${ac.path}`,\n contentType: ac.contentType ?? \"application/xhtml+xml\",\n })),\n subDocs: ctx.subDocs.array.map((sd) => ({ path: `/word/${sd.path}` })),\n }),\n ctx,\n ) ?? \"\"),\n path: \"[Content_Types].xml\",\n },\n CustomProperties: {\n data:\n XML_DECL +\n (customPropertiesDesc.stringify({ properties: ctx._options.customProperties ?? [] }, ctx) ??\n \"\"),\n path: \"docProps/custom.xml\",\n },\n Document: {\n data: (() => {\n let xmlData = documentMedia.referenced.length > 0 ? documentMedia.xml : documentXmlData;\n if (hasPlaceholders(xmlData)) {\n const mediaCount = documentMedia.referenced.length;\n const chartKeys = ctx.charts.array.map((c) => c.key);\n const smartArtKeys = ctx.smartArts.array.map((s) => s.key);\n const chartOffset = documentRelationshipCount + mediaCount;\n const smartArtOffset = chartOffset + chartKeys.length;\n\n // Build combined replacement entries for charts, smartart, and numbering\n const entries: Array<{ prefix?: string; key: string; value: string }> = [];\n for (let i = 0; i < chartKeys.length; i++) {\n entries.push({\n prefix: \"chart:\",\n key: chartKeys[i],\n value: formatId(chartOffset, i, \"rId\"),\n });\n }\n const saPrefixes = [\"smartart:\", \"smartart-lo:\", \"smartart-qs:\", \"smartart-cs:\"];\n for (let i = 0; i < smartArtKeys.length; i++) {\n for (let p = 0; p < saPrefixes.length; p++) {\n entries.push({\n prefix: saPrefixes[p],\n key: smartArtKeys[i],\n value: formatId(smartArtOffset + p * smartArtKeys.length, i, \"rId\"),\n });\n }\n }\n for (const { reference, instance, numId } of ctx.numbering.concreteNumbering) {\n entries.push({ key: `${reference}-${instance}`, value: numId.toString() });\n }\n xmlData = replaceAllPlaceholders(xmlData, entries);\n } else {\n xmlData = replaceNumberingPlaceholders(xmlData, ctx.numbering.concreteNumbering);\n }\n return xmlData;\n })(),\n path: \"word/document.xml\",\n },\n Endnotes: {\n data: (() => {\n const endnoteCtx = mkCtx({\n relationships: ctx.endnotes.relationships,\n });\n const xmlData =\n XML_DECL + (endnotesDesc.stringify({ notes: ctx.endnotes.notes }, endnoteCtx) ?? \"\");\n const endnoteRelCount = ctx.endnotes.relationships.relationshipCount + 1;\n const endnoteMedia = findAndReplaceImagePlaceholders(\n xmlData,\n ctx.media.array,\n endnoteRelCount,\n );\n if (endnoteMedia.referenced.length > 0) {\n for (let i = 0; i < endnoteMedia.referenced.length; i++) {\n ctx.endnotes.relationships.addRelationship(\n endnoteRelCount + i,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\",\n `media/${endnoteMedia.referenced[i].fileName}`,\n );\n }\n return replaceNumberingPlaceholders(endnoteMedia.xml, ctx.numbering.concreteNumbering);\n }\n return replaceNumberingPlaceholders(xmlData, ctx.numbering.concreteNumbering);\n })(),\n path: \"word/endnotes.xml\",\n },\n EndnotesRelationships: {\n data: XML_DECL + ctx.endnotes.relationships.serialize(),\n path: \"word/_rels/endnotes.xml.rels\",\n },\n FileRelationships: {\n data: XML_DECL + ctx.fileRelationships.serialize(),\n path: \"_rels/.rels\",\n },\n FontTable: {\n data:\n XML_DECL +\n (fontTableDesc.stringify({ fonts: ctx.fontTable.fontOptionsWithKey }, ctx) ?? \"\"),\n path: \"word/fontTable.xml\",\n },\n FontTableRelationships: {\n data: XML_DECL + ctx.fontTable.relationships.serialize(),\n path: \"word/_rels/fontTable.xml.rels\",\n },\n FootNotes: {\n data: (() => {\n const xmlData = footnoteMedia.referenced.length > 0 ? footnoteMedia.xml : footnoteXmlData;\n return replaceNumberingPlaceholders(xmlData, ctx.numbering.concreteNumbering);\n })(),\n path: \"word/footnotes.xml\",\n },\n FootNotesRelationships: {\n data: (() => {\n for (let i = 0; i < footnoteMedia.referenced.length; i++) {\n ctx.footNotes.relationships.addRelationship(\n footnoteRelationshipCount + i,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\",\n `media/${footnoteMedia.referenced[i].fileName}`,\n );\n }\n return XML_DECL + ctx.footNotes.relationships.serialize();\n })(),\n path: \"word/_rels/footnotes.xml.rels\",\n },\n FooterRelationships: ctx.footers.map((entry, index) => {\n const footerCtx = mkCtx({ relationships: entry.relationships });\n const xmlData =\n XML_DECL + stringifyHeaderFooter(\"w:ftr\", FOOTER_NAMESPACES, entry.children, footerCtx);\n footerFormattedViews.set(index, xmlData);\n const footerMedia = findAndReplaceImagePlaceholders(xmlData, ctx.media.array, 0);\n\n for (let i = 0; i < footerMedia.referenced.length; i++) {\n entry.relationships.addRelationship(\n i,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\",\n `media/${footerMedia.referenced[i].fileName}`,\n );\n }\n\n return {\n data: XML_DECL + entry.relationships.serialize(),\n path: `word/_rels/footer${index + 1}.xml.rels`,\n };\n }),\n Footers: ctx.footers.map((_entry, index) => {\n const tempXmlData = footerFormattedViews.get(index)!;\n const footerMedia = findAndReplaceImagePlaceholders(tempXmlData, ctx.media.array, 0);\n const xmlData = footerMedia.referenced.length > 0 ? footerMedia.xml : tempXmlData;\n\n return {\n data: replaceNumberingPlaceholders(xmlData, ctx.numbering.concreteNumbering),\n path: `word/footer${index + 1}.xml`,\n };\n }),\n HeaderRelationships: ctx.headers.map((entry, index) => {\n const headerCtx = mkCtx({ relationships: entry.relationships });\n const xmlData =\n XML_DECL + stringifyHeaderFooter(\"w:hdr\", HEADER_NAMESPACES, entry.children, headerCtx);\n headerFormattedViews.set(index, xmlData);\n const headerMedia = findAndReplaceImagePlaceholders(xmlData, ctx.media.array, 0);\n\n for (let i = 0; i < headerMedia.referenced.length; i++) {\n entry.relationships.addRelationship(\n i,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\",\n `media/${headerMedia.referenced[i].fileName}`,\n );\n }\n\n return {\n data: XML_DECL + entry.relationships.serialize(),\n path: `word/_rels/header${index + 1}.xml.rels`,\n };\n }),\n Headers: ctx.headers.map((_entry, index) => {\n const tempXmlData = headerFormattedViews.get(index)!;\n const headerMedia = findAndReplaceImagePlaceholders(tempXmlData, ctx.media.array, 0);\n const xmlData = headerMedia.referenced.length > 0 ? headerMedia.xml : tempXmlData;\n\n return {\n data: replaceNumberingPlaceholders(xmlData, ctx.numbering.concreteNumbering),\n path: `word/header${index + 1}.xml`,\n };\n }),\n Numbering: {\n data: ctx.numbering.serialize(),\n path: \"word/numbering.xml\",\n },\n Properties: {\n data: XML_DECL + (corePropertiesDesc.stringify(ctx._options, ctx) ?? \"\"),\n path: \"docProps/core.xml\",\n },\n Relationships: {\n data: (() => {\n for (let i = 0; i < documentMedia.referenced.length; i++) {\n ctx.document.relationships.addRelationship(\n documentRelationshipCount + i,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\",\n `media/${documentMedia.referenced[i].fileName}`,\n );\n }\n\n const chartOffset = documentRelationshipCount + documentMedia.referenced.length;\n for (let i = 0; i < ctx.charts.array.length; i++) {\n ctx.document.relationships.addRelationship(\n chartOffset + i,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart\",\n `charts/chart${i + 1}.xml`,\n );\n }\n\n addSmartArtRelationships(\n ctx.smartArts.array.map((s) => s.key),\n (id, type, target) => {\n ctx.document.relationships.addRelationship(id, type, target);\n },\n documentRelationshipCount + documentMedia.referenced.length + ctx.charts.array.length,\n 0,\n {\n pathPrefix: \"\",\n styleRelType: \"http://schemas.microsoft.com/office/2007/relationships/diagramStyle\",\n },\n );\n\n ctx.document.relationships.addRelationship(\n ctx.document.relationships.relationshipCount + 1,\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable\",\n \"fontTable.xml\",\n );\n\n return XML_DECL + ctx.document.relationships.serialize();\n })(),\n path: \"word/_rels/document.xml.rels\",\n },\n Settings: {\n data: XML_DECL + (settingsDesc.stringify(ctx._settingsOptions, ctx) ?? \"\"),\n path: \"word/settings.xml\",\n },\n Styles: {\n data: (() => {\n const xmlStyles = ctx.styles.serialize();\n return replaceNumberingPlaceholders(xmlStyles, ctx.numbering.concreteNumbering);\n })(),\n path: \"word/styles.xml\",\n },\n ...(ctx._options.bibliography\n ? {\n Bibliography: {\n data: XML_DECL + (bibliographyDesc.stringify(ctx._options.bibliography, ctx) ?? \"\"),\n path: \"word/bibliography.xml\",\n },\n }\n : {}),\n ...(ctx.charts.array.length > 0\n ? {\n Charts: ctx.charts.array.flatMap((chartData, i) => [\n {\n data: XML_DECL + chartData.chartSpaceXml,\n path: `word/charts/chart${i + 1}.xml`,\n },\n {\n data: '<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"/>',\n path: `word/charts/_rels/chart${i + 1}.xml.rels`,\n },\n ]),\n }\n : {}),\n ...(ctx.smartArts.array.length > 0\n ? {\n DiagramData: ctx.smartArts.array.map((smartArtData, i) => ({\n data: XML_DECL + smartArtData.dataModelXml,\n path: `word/diagrams/data${i + 1}.xml`,\n })),\n DiagramLayout: ctx.smartArts.array.map((smartArtData, i) => ({\n data: getLayoutXml(smartArtData.layout),\n path: `word/diagrams/layout${i + 1}.xml`,\n })),\n DiagramStyle: ctx.smartArts.array.map((smartArtData, i) => ({\n data: getStyleXml(smartArtData.style),\n path: `word/diagrams/quickStyle${i + 1}.xml`,\n })),\n DiagramColors: ctx.smartArts.array.map((smartArtData, i) => ({\n data: getColorXml(smartArtData.color),\n path: `word/diagrams/colors${i + 1}.xml`,\n })),\n DiagramDrawing: ctx.smartArts.array.map((_, i) => ({\n data: DEFAULT_DRAWING_XML,\n path: `word/diagrams/drawing${i + 1}.xml`,\n })),\n }\n : {}),\n ...(ctx.altChunks.array.length > 0\n ? {\n AltChunks: ctx.altChunks.array.map((altChunkData) => ({\n data: altChunkData.data,\n path: `word/${altChunkData.path}`,\n })),\n }\n : {}),\n ...(ctx.subDocs.array.length > 0\n ? {\n SubDocs: ctx.subDocs.array.map((subDocData) => ({\n data: subDocData.data,\n path: `word/${subDocData.path}`,\n })),\n }\n : {}),\n ...(ctx.glossaryOptions\n ? {\n Glossary: {\n data: (() => {\n const glossaryCtx = mkCtx(undefined);\n return XML_DECL + (glossaryDesc.stringify(ctx.glossaryOptions!, glossaryCtx) ?? \"\");\n })(),\n path: \"word/glossary/document.xml\",\n },\n }\n : {}),\n ...(ctx.webSettings\n ? {\n WebSettings: {\n data: XML_DECL + (webSettingsDesc.stringify(ctx._options.webSettings ?? {}, ctx) ?? \"\"),\n path: \"word/webSettings.xml\",\n },\n }\n : {}),\n };\n}\n","/**\n * Pure function API for generating DOCX files.\n *\n * @module\n */\n\nimport { createPacker, OoxmlMimeType } from \"@office-open/core\";\nimport type { OutputByType, OutputType, PackerOptions } from \"@office-open/core\";\nimport type { DocumentOptions } from \"@parts/core-properties\";\n\nimport { compileDocument } from \"./compiler\";\n\n/** @internal Packer instance for DOCX generation. */\nconst Packer = createPacker<DocumentOptions>({\n compile: (options, overrides, mediaLevel) => compileDocument(options, overrides, mediaLevel),\n mimeType: OoxmlMimeType.DOCX,\n});\n\n/**\n * Generate a DOCX file from pure JSON options.\n *\n * The output format is controlled by `packerOptions.type` (default: `\"nodebuffer\"` → Buffer).\n * For synchronous generation, use {@link generateDocumentSync}. For streaming, use {@link generateDocumentStream}.\n *\n * @param options - Document options (sections, styles, numbering, etc.)\n * @param packerOptions - Optional packer configuration (type, compression, overrides, etc.)\n *\n * @example\n * ```typescript\n * import { generateDocument } from \"@office-open/docx\";\n *\n * const buffer = await generateDocument({ sections: [...] });\n * const bytes = await generateDocument({ sections: [...] }, { type: \"uint8array\" });\n * const blob = await generateDocument({ sections: [...] }, { type: \"blob\" });\n * ```\n */\nexport function generateDocument<T extends OutputType = \"nodebuffer\">(\n options: DocumentOptions,\n packerOptions?: PackerOptions<T>,\n): Promise<OutputByType[T]> {\n return Packer.pack(options, packerOptions) as Promise<OutputByType[T]>;\n}\n\n/**\n * Synchronously generate a DOCX file from pure JSON options.\n */\nexport function generateDocumentSync<T extends OutputType = \"nodebuffer\">(\n options: DocumentOptions,\n packerOptions?: PackerOptions<T>,\n): OutputByType[T] {\n return Packer.packSync(options, packerOptions) as OutputByType[T];\n}\n\n/**\n * Generate a DOCX file as a `ReadableStream<Uint8Array>`.\n */\nexport function generateDocumentStream(\n options: DocumentOptions,\n packerOptions?: PackerOptions,\n): ReadableStream<Uint8Array> {\n return Packer.toStream(options, packerOptions);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAaA,MAAM,wBAAwB;;AAE9B,MAAM,sBAAsB;;AAE5B,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;AAuBjB,MAAa,aAAa,KAAiB,YAAgC;CACzE,MAAM,OAAO,QAAQ,QAAQ,MAAM,EAAE;CACrC,IAAI,KAAK,WAAW,UAClB,MAAM,IAAI,MAAM,kDAAkD,SAAS;CAI7E,MAAM,aADa,KAAK,QAAQ,SAAS,KAAK,EAAE,KAAK,EAAE,MAAM,GACjC,EAAE,KAAK,cAAc,SAAS,WAAW,EAAE,CAAC;CACxE,WAAW,QAAQ;CAGnB,MAAM,kBADmB,IAAI,MAAM,uBAAuB,mBACnB,EAAE,KACtC,MAAM,MAAM,OAAO,WAAW,IAAI,WAAW,OAChD;CAEA,MAAM,MAAM,IAAI,WACd,wBAAwB,gBAAgB,SAAS,KAAK,IAAI,GAAG,IAAI,SAAS,mBAAmB,CAC/F;CACA,IAAI,IAAI,IAAI,MAAM,GAAG,qBAAqB,CAAC;CAC3C,IAAI,IAAI,iBAAiB,qBAAqB;CAC9C,IAAI,IAAI,IAAI,MAAM,mBAAmB,GAAG,wBAAwB,gBAAgB,MAAM;CACtF,OAAO;AACT;;;;;;;ACxBA,MAAa,oBAAkD;CAC7D;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;;AAMA,MAAa,oBAAkD;CAC7D;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;;;;;;;;;AAaA,SAAgB,sBACd,KACA,YACA,UACA,KACQ;CACR,MAAM,YAAsB,CAAC;CAC7B,KAAK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AM;EACR,EACF,IACA,CAAC;EACL,GAAI,IAAI,cACJ,EACE,aAAa;GACX,MAAM,YAAY,gBAAgB,UAAU,IAAI,SAAS,eAAe,CAAC,GAAG,GAAG,KAAK;GACpF,MAAM;EACR,EACF,IACA,CAAC;CACP;AACF;;;;;;;;;ACjjBA,MAAM,SAAS,aAA8B;CAC3C,UAAU,SAAS,WAAW,eAAe,gBAAgB,SAAS,WAAW,UAAU;CAC3F,UAAU,cAAc;AAC1B,CAAC;;;;;;;;;;;;;;;;;;;AAoBD,SAAgB,iBACd,SACA,eAC0B;CAC1B,OAAO,OAAO,KAAK,SAAS,aAAa;AAC3C;;;;AAKA,SAAgB,qBACd,SACA,eACiB;CACjB,OAAO,OAAO,SAAS,SAAS,aAAa;AAC/C;;;;AAKA,SAAgB,uBACd,SACA,eAC4B;CAC5B,OAAO,OAAO,SAAS,SAAS,aAAa;AAC/C"}
@@ -1,4 +1,4 @@
1
- import { n as DocumentOptions } from "./core-properties-B3ztqzLD.mjs";
1
+ import { n as DocumentOptions } from "./core-properties-Bh8_D5Kh.mjs";
2
2
  import { OutputByType, OutputType, PackerOptions } from "@office-open/core";
3
3
 
4
4
  //#region src/generate.d.ts
package/dist/generate.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { n as generateDocumentStream, r as generateDocumentSync, t as generateDocument } from "./generate-m1Cw7CHL.mjs";
1
+ import { n as generateDocumentStream, r as generateDocumentSync, t as generateDocument } from "./generate-DiDgl0bc.mjs";
2
2
  export { generateDocument, generateDocumentStream, generateDocumentSync };
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { $ as SettingsOptions, $i as ChildOffset, $n as IParagraphJsonChild, $r as DayShort, $t as PageTextDirectionType, A as StylesOptions, Aa as BreakTypeValue, Ai as FlatTextOptions, An as ITableRowPropertiesChangeOptions, Ar as IParagraphPropertiesChangeOptions, At as SdtDataBindingOptions, B as HyphenationOptions, Ba as VerticalAlignTable, Bi as MediaTransformation, Bn as TablePropertiesOptionsBase, Br as HighlightColor, Bt as SubDocOptions, C as WebSettingsOptions, Ca as TabStopDefinition, Ci as SmartArtOptions, Cn as CustomXmlRunOptions, Cr as SimpleFieldOptions, Ct as DocumentAttributeNamespaces, D as SubDocCollection, Da as LineRuleType, Di as WpsShapeCoreOptions, Dn as TableOptions, Dr as IImageOptions, Dt as stringifyTableOfContents, E as webSettingsDesc, Ea as HeadingLevel, Ei as resetDrawingIdGen, En as tableDesc, Er as ChartOptions, Et as VmlShapeStyle, F as CaptionOptions, Fa as BorderStyle, Fi as TextVertOverflowType, Fn as TextDirection, Fr as TextAlignmentType, Ft as SdtLock, G as MailMergeSourceType, Ga as ShadingType, Gi as IMediaData, Gn as RelativeVerticalPosition, Gr as TextEffect, Gt as HeaderFooterReferenceType, H as MailMergeDest, Ha as ICellMergeAttributes, Hi as ChartMediaData, Hn as TableLayoutType, Hr as IRunPropertiesChangeOptions, Ht as sectionPropertiesDesc, I as CaptionsOptions, Ia as AlignmentType, Ii as TextVerticalType, In as VerticalMergeType, Ir as TextboxTightWrapType, It as SdtPropertiesOptions, J as OdsoFieldType, Ja as AltChunkData, Ji as WORKAROUND2, Jn as TABLE_BORDERS_NONE, Jr as EmphasisMarkType, Jt as SectionType, K as MathPropertiesOptions, Ka as AltChunkOptions, Ki as MediaDataTransformation, Kn as TableAnchorType, Kr as UnderlineType, Kt as HeaderFooterType, L as DocumentProtectionOptions, La as SectionVerticalAlign, Li as VerticalAnchor, Ln as TablePropertyExOptions, Lr as IParagraphRunOptions, Lt as SdtTextOptions, M as buildStyleCache, Ma as CnfConditionalOptions, Mi as PresetTextShapeOptions, Mn as TableRowPropertiesOptionsBase, Mr as IParagraphStylePropertiesOptions, Mt as SdtDateOptions, N as parseStyleDefinitions, Na as BordersOptions, Ni as TextBodyWrappingType, Nn as HeightRule, Nr as LevelParagraphStylePropertiesOptions, Nt as SdtDropDownListOptions, O as SubDocData, Oa as SpacingProperties, Oi as WpsShapeOptions, On as TableRowOptions, Or as createImageData, Ot as parseToc, P as AutoCaptionOptions, Pa as BorderOptions, Pi as TextHorzOverflowType, Pn as TableCellBordersOptions, Pr as ParagraphPropertiesOptions, Pt as SdtListItem, Q as RsidsOptions, Qa as bibliographyDesc, Qi as ChildExtent, Qn as ChartChild, Qr as DayLong, Qt as createLineNumberType, R as EndnotePropertiesOptions, Ra as TableVerticalAlign, Ri as createBodyProperties, Rn as ITablePropertiesChangeOptions, Rr as PageNumber, Rt as StyleLevel, S as WebSettingsInput, Sa as LeaderType, Si as SmartArtNode, Sn as CustomXmlRowOptions, Sr as CommentsOptions, St as DocumentAttributeNamespace, T as framesetXml, Ta as TabStopType, Ti as drawingDesc, Tn as setTableParseChild, Tr as IWpsShapeOptions, Tt as SectionOptions, U as MailMergeDocType, Ua as VerticalMergeRevisionType, Ui as IExtendedMediaData, Un as OverlapType, Ur as RunPropertiesOptions, Ut as stringifySectionPropertiesXml, V as MailMergeDataType, Va as createVerticalAlign, Vi as createTransformation, Vn as TableLookOptions, Vr as IParagraphRunPropertiesOptions, Vt as parseSectionPropertiesEl, W as MailMergeOptions, Wa as ShadingAttributesProperties, Wi as IGroupChildMediaData, Wn as RelativeHorizontalPosition, Wr as RunStylePropertiesOptions, Wt as HeaderFooterReferenceOptions, X as ReadModeInkLockDownOptions, Xa as BibliographyOptions, Xi as WpgMediaData, Xn as TableWidthProperties, Xr as CarriageReturn, Xt as LineNumberAttributes, Y as OdsoOptions, Ya as CharacterSet, Yi as WpgCommonMediaData, Yn as TableBordersOptions, Yr as AnnotationReference, Yt as createSectionType, Z as RevisionViewOptions, Za as SourceTypeOptions, Zi as WpsMediaData, Zn as WidthType, Zr as ContinuationSeparator, Zt as LineNumberRestartFormat, _ as parseDocument, _a as TextWrappingType, _i as IXYFrameOptions, _n as CustomXmlAttributeOptions, _r as PositionalTabAlignment, _t as ISectionPropertiesChangeOptions, a as DocumentBackgroundOptions, aa as createVerticalPosition, ai as NoBreakHyphen, an as PageBordersOptions, ar as ProofErrorTypeValue, at as NumberingOptions, b as DivOptions, ba as SpaceType, bi as MathScriptType, bn as CustomXmlDataBindingOptions, br as PositionalTabRelativeTo, bt as sectionMarginDefaults, c as customPropertiesDesc, ca as HorizontalPositionOptions, ci as SoftHyphen, cn as createPageNumberType, cr as DropDownListOptions, ct as LevelSuffix, d as BodyContext, da as VerticalPositionOptions, di as YearShort, dn as createPageSize, dr as FormFieldTextOptions, dt as DocPartGallery, ea as GroupChild, ei as EndnoteReference, en as PageMarginAttributes, er as ImageChild, et as WriteProtectionOptions, f as DocxReadContext, fa as VerticalPositionRelativeFrom, fi as DropCapType, fn as DocGridAttributesProperties, fr as FormFieldTextType, ft as DocPartOptions, g as parseArchive, ga as TextWrappingSide, gi as IFrameOptions, gn as ColumnAttributes, gr as RubyOptions, gt as HeaderFooterGroup, h as DocxPartRefs, ha as TextWrapping, hi as IAlignmentFrameOptions, hn as ColumnsAttributes, hr as RubyAlign, ht as glossaryDesc, i as BackgroundImageOptions, ia as DrawingOptions, ii as MonthShort, in as PageBorderZOrder, ir as ProofErrorType, it as Numbering, j as buildNumberingCache, ja as IndentAttributesProperties, ji as NormalAutofitOptions, jn as ITableRowPropertiesOptions, jr as IParagraphPropertiesOptionsBase, jt as SdtDateMappingType, k as Styles, ka as BreakType, ki as BodyPropertiesOptions, kn as CnfStyleOptions, kr as ISymbolRunOptions, kt as SdtComboBoxOptions, l as settingsDesc, la as HorizontalPositionRelativeFrom, li as Tab, ln as PageOrientation, lr as FormFieldCommonOptions, lt as LevelsOptions, m as DocxDocument, ma as createWrapTight, mi as FrameWrap, mn as createDocumentGrid, mr as createFormFieldData, mt as GlossaryDocumentOptions, n as DocumentOptions, na as WpgGroupOptions, ni as LastRenderedPageBreak, nn as PageBorderDisplay, nr as ParagraphOptions, nt as ConcreteNumberingOptions, o as CustomPropertiesInput, oa as createHorizontalPosition, oi as PageNumberElement, on as PageNumberSeparator, or as SmartTagRunOptions, ot as parseNumberingDefinitions, p as DocxWriteContext, pa as createWrapThrough, pi as FrameAnchorType, pn as DocumentGridType, pr as TextInputOptions, pt as DocPartType, q as OdsoFieldMapDataOptions, qa as AltChunkCollection, qi as SmartArtMediaData, qn as TableFloatOptions, qr as FontAttributesProperties, qt as createHeaderFooterReference, r as corePropertiesDesc, ra as Distance, ri as MonthLong, rn as PageBorderOffsetFrom, rr as SmartArtChild, rt as AbstractNumberingOptions, s as CustomPropertyOptions, sa as Floating, si as Separator, sn as PageNumberTypeAttributes, sr as CheckBoxOptions, st as LevelFormat, t as CorePropertiesInput, ta as WpgGroupCoreOptions, ti as FootnoteReferenceElement, tn as createPageMargin, tr as MathChild, tt as CompatibilityOptions, u as EmbeddedFontOptionsWithKey, ua as Margins, ui as YearLong, un as PageSizeAttributes, ur as FormFieldOptions, ut as DocPartBehavior, v as parseDocx, va as HorizontalPositionAlign, vi as MathInput, vn as CustomXmlBlockOptions, vr as PositionalTabLeader, vt as ISectionPropertiesOptions, w as frameXml, wa as TabStopPosition, wi as DrawingDescriptorOptions, wn as TableCellOptions, wr as IWpgGroupOptions, wt as SectionChild, x as TargetScreenSize, xa as VerticalPositionAlign, xi as MathStyleType, xn as CustomXmlPrOptions, xr as CommentOptions, xt as sectionPageSizeDefaults, y as DivBorderOptions, ya as NumberFormat, yi as MathRunPropertiesOptions, yn as CustomXmlCellOptions, yr as PositionalTabOptions, yt as SectionPropertiesOptionsBase, z as FootnotePropertiesOptions, za as VerticalAlignSection, zi as Media, zn as ITablePropertiesOptions, zr as RunOptions, zt as TableOfContentsOptions } from "./core-properties-B3ztqzLD.mjs";
1
+ import { $ as SettingsOptions, $a as buildContentTypes, $i as MonthLong, $n as ImageChild, $r as ExtendedMediaData, $t as PageTextDirectionType, A as StylesOptions, Aa as BreakTypeValue, Ai as ParagraphStylePropertiesOptions, An as TableRowPropertiesChangeOptions, Ar as createImageData, At as SdtDataBindingOptions, B as HyphenationOptions, Ba as VerticalAlignTable, Bi as RunStylePropertiesOptions, Bn as TablePropertiesOptionsBase, Br as HorizontalPositionRelativeFrom, Bt as SubDocOptions, C as WebSettingsOptions, Ca as TabStopDefinition, Ci as WpgGroupCoreOptions, Cn as CustomXmlRunOptions, Cr as SimpleFieldOptions, Ct as DocumentAttributeNamespaces, D as SubDocCollection, Da as LineRuleType, Di as ParagraphPropertiesChangeOptions, Dn as TableOptions, Dr as SmartArtOptions, Dt as stringifyTableOfContents, E as webSettingsDesc, Ea as HeadingLevel, Ei as LevelParagraphStylePropertiesOptions, En as tableDesc, Er as SmartArtNode, Et as VmlShapeStyle, F as CaptionOptions, Fa as BorderStyle, Fi as RunOptions, Fn as TextDirection, Fr as DrawingOptions, Ft as SdtLock, G as MailMergeSourceType, Ga as ShadingType, Gi as AnnotationReference, Gn as RelativeVerticalPosition, Gr as createWrapTight, Gt as HeaderFooterReferenceType, H as MailMergeDest, Ha as CellMergeAttributes, Hi as UnderlineType, Hn as TableLayoutType, Hr as VerticalPositionOptions, Ht as sectionPropertiesDesc, I as CaptionsOptions, Ia as AlignmentType, Ii as HighlightColor, In as VerticalMergeType, Ir as createVerticalPosition, It as SdtPropertiesOptions, J as OdsoFieldType, Ja as AltChunkData, Ji as DayLong, Jn as TABLE_BORDERS_NONE, Jr as TextWrappingType, Jt as SectionType, K as MathPropertiesOptions, Ka as AltChunkOptions, Ki as CarriageReturn, Kn as TableAnchorType, Kr as TextWrapping, Kt as HeaderFooterType, L as DocumentProtectionOptions, La as SectionVerticalAlign, Li as ParagraphRunPropertiesOptions, Ln as TablePropertyExOptions, Lr as createHorizontalPosition, Lt as SdtTextOptions, M as buildStyleCache, Ma as CnfConditionalOptions, Mi as TextboxTightWrapType, Mn as TableRowPropertiesOptionsBase, Mr as drawingDesc, Mt as SdtDateOptions, N as parseStyleDefinitions, Na as BordersOptions, Ni as PageNumber, Nn as HeightRule, Nr as resetDrawingIdGen, Nt as SdtDropDownListOptions, O as SubDocData, Oa as SpacingProperties, Oi as ParagraphPropertiesOptions, On as TableRowOptions, Or as ChartOptions, Ot as parseToc, P as AutoCaptionOptions, Pa as BorderOptions, Pi as ParagraphRunOptions, Pn as TableCellBordersOptions, Pr as Distance, Pt as SdtListItem, Q as RsidsOptions, Qa as ContentTypesInput, Qi as LastRenderedPageBreak, Qn as ChartChild, Qr as ChartMediaData, Qt as createLineNumberType, R as EndnotePropertiesOptions, Ra as TableVerticalAlign, Ri as RunPropertiesChangeOptions, Rn as TablePropertiesChangeOptions, Rr as Floating, Rt as StyleLevel, S as WebSettingsInput, Sa as LeaderType, Si as GroupChild, Sn as CustomXmlRowOptions, Sr as CommentsOptions, St as DocumentAttributeNamespace, T as framesetXml, Ta as TabStopType, Ti as SymbolRunOptions, Tn as setTableParseChild, Tr as WpsShapeRunOptions, Tt as SectionOptions, U as MailMergeDocType, Ua as VerticalMergeRevisionType, Ui as FontAttributesProperties, Un as OverlapType, Ur as VerticalPositionRelativeFrom, Ut as stringifySectionPropertiesXml, V as MailMergeDataType, Va as createVerticalAlign, Vi as TextEffect, Vn as TableLookOptions, Vr as Margins, Vt as parseSectionPropertiesEl, W as MailMergeOptions, Wa as ShadingAttributesProperties, Wi as EmphasisMarkType, Wn as RelativeHorizontalPosition, Wr as createWrapThrough, Wt as HeaderFooterReferenceOptions, X as ReadModeInkLockDownOptions, Xa as ContentTypeDefault, Xi as EndnoteReference, Xn as TableWidthProperties, Xr as MediaTransformation, Xt as LineNumberAttributes, Y as OdsoOptions, Ya as CharacterSet, Yi as DayShort, Yn as TableBordersOptions, Yr as Media, Yt as createSectionType, Z as RevisionViewOptions, Za as ContentTypeOverride, Zi as FootnoteReferenceElement, Zn as WidthType, Zr as createTransformation, Zt as LineNumberRestartFormat, _ as parseDocument, _a as VerticalPositionAlign, _i as TextVerticalType, _n as CustomXmlAttributeOptions, _r as PositionalTabAlignment, _t as SectionPropertiesChangeOptions, a as DocumentBackgroundOptions, aa as Tab, ai as WpgCommonMediaData, an as PageBordersOptions, ar as ProofErrorTypeValue, at as NumberingOptions, b as DivOptions, ba as MathScriptType, bi as ChildExtent, bn as CustomXmlDataBindingOptions, br as PositionalTabRelativeTo, bt as sectionMarginDefaults, c as customPropertiesDesc, ca as AlignmentFrameOptions, ci as WpsShapeCoreOptions, cn as createPageNumberType, cr as DropDownListOptions, ct as LevelSuffix, d as BodyContext, da as FrameOptions, di as FlatTextOptions, dn as createPageSize, dr as FormFieldTextOptions, dt as DocPartGallery, ea as MonthShort, ei as GroupChildMediaData, en as PageMarginAttributes, eo as contentTypesDesc, er as MathChild, et as WriteProtectionOptions, f as DocxReadContext, fa as FrameWrap, fi as NormalAutofitOptions, fn as DocGridAttributesProperties, fr as FormFieldTextType, ft as DocPartOptions, g as parseArchive, ga as SpaceType, gi as TextVertOverflowType, gn as ColumnAttributes, gr as RubyOptions, gt as HeaderFooterGroup, h as DocxPartRefs, ha as NumberFormat, hi as TextHorzOverflowType, hn as ColumnsAttributes, hr as RubyAlign, ht as glossaryDesc, i as BackgroundImageOptions, ia as SoftHyphen, ii as WORKAROUND2, in as PageBorderZOrder, ir as ProofErrorType, it as Numbering, j as buildNumberingCache, ja as IndentAttributesProperties, ji as TextAlignmentType, jn as TableRowPropertiesOptions, jr as DrawingDescriptorOptions, jt as SdtDateMappingType, k as Styles, ka as BreakType, ki as ParagraphPropertiesOptionsBase, kn as CnfStyleOptions, kr as ImageOptions, kt as SdtComboBoxOptions, l as settingsDesc, la as DropCapType, li as WpsShapeOptions, ln as PageOrientation, lr as FormFieldCommonOptions, lt as LevelsOptions, m as DocxDocument, ma as HorizontalPositionAlign, mi as TextBodyWrappingType, mn as createDocumentGrid, mr as createFormFieldData, mt as GlossaryDocumentOptions, n as DocumentOptions, na as PageNumberElement, ni as MediaDataTransformation, nn as PageBorderDisplay, no as SourceTypeOptions, nr as ParagraphOptions, nt as ConcreteNumberingOptions, o as CustomPropertiesInput, oa as YearLong, oi as WpgMediaData, on as PageNumberSeparator, or as SmartTagRunOptions, ot as parseNumberingDefinitions, p as DocxWriteContext, pa as XYFrameOptions, pi as PresetTextShapeOptions, pn as DocumentGridType, pr as TextInputOptions, pt as DocPartType, q as OdsoFieldMapDataOptions, qa as AltChunkCollection, qi as ContinuationSeparator, qn as TableFloatOptions, qr as TextWrappingSide, qt as createHeaderFooterReference, r as corePropertiesDesc, ra as Separator, ri as SmartArtMediaData, rn as PageBorderOffsetFrom, ro as bibliographyDesc, rr as SmartArtChild, rt as AbstractNumberingOptions, s as CustomPropertyOptions, sa as YearShort, si as WpsMediaData, sn as PageNumberTypeAttributes, sr as CheckBoxOptions, st as LevelFormat, t as CorePropertiesInput, ta as NoBreakHyphen, ti as MediaData, tn as createPageMargin, to as BibliographyOptions, tr as ParagraphChild, tt as CompatibilityOptions, u as EmbeddedFontOptionsWithKey, ua as FrameAnchorType, ui as BodyPropertiesOptions, un as PageSizeAttributes, ur as FormFieldOptions, ut as DocPartBehavior, v as parseDocx, va as MathInput, vi as VerticalAnchor, vn as CustomXmlBlockOptions, vr as PositionalTabLeader, vt as SectionPropertiesOptions, w as frameXml, wa as TabStopPosition, wi as WpgGroupOptions, wn as TableCellOptions, wr as WpgGroupRunOptions, wt as SectionChild, x as TargetScreenSize, xa as MathStyleType, xi as ChildOffset, xn as CustomXmlPrOptions, xr as CommentOptions, xt as sectionPageSizeDefaults, y as DivBorderOptions, ya as MathRunPropertiesOptions, yi as createBodyProperties, yn as CustomXmlCellOptions, yr as PositionalTabOptions, yt as SectionPropertiesOptionsBase, z as FootnotePropertiesOptions, za as VerticalAlignSection, zi as RunPropertiesOptions, zn as TablePropertiesOptions, zr as HorizontalPositionOptions, zt as TableOfContentsOptions } from "./core-properties-Bh8_D5Kh.mjs";
2
2
  import { generateDocument, generateDocumentStream, generateDocumentSync } from "./generate.mjs";
3
- import { IPatch, InputDataType, PatchDocumentOptions, PatchDocumentOutputType, PatchType, patchDetector, patchDocument } from "./patch/index.mjs";
3
+ import { InputDataType, Patch, PatchDocumentOptions, PatchDocumentOutputType, PatchType, patchDetector, patchDocument } from "./patch/index.mjs";
4
4
  import { CompressionOptions, OutputByType, OutputType, PackerOptions } from "@office-open/core";
5
5
  import { Element } from "@office-open/xml";
6
6
  import { CustomDescriptor } from "@office-open/core/descriptor";
@@ -108,7 +108,7 @@ interface FontTableInput {
108
108
  declare const fontTableDesc: CustomDescriptor<FontTableInput>;
109
109
  //#endregion
110
110
  //#region src/parts/textbox/textbox.d.ts
111
- type ITextboxOptions = Omit<ParagraphOptions, "style" | "children"> & {
111
+ type TextboxOptions = Omit<ParagraphOptions, "style" | "children"> & {
112
112
  style?: VmlShapeStyle;
113
113
  children?: SectionChild[];
114
114
  };
@@ -143,41 +143,9 @@ interface ObjectElementOptions {
143
143
  //#region src/parts/comments.d.ts
144
144
  declare const commentsDesc: CustomDescriptor<CommentsOptions, BodyContext>;
145
145
  //#endregion
146
- //#region src/parts/contenttypes.d.ts
147
- interface ContentTypeDefault {
148
- extension: string;
149
- contentType: string;
150
- }
151
- interface ContentTypeOverride {
152
- partName: string;
153
- contentType: string;
154
- }
155
- interface ContentTypesInput {
156
- defaults: ContentTypeDefault[];
157
- overrides: ContentTypeOverride[];
158
- }
159
- declare const contentTypesDesc: CustomDescriptor<ContentTypesInput>;
160
- declare function buildContentTypes(extras?: {
161
- headerCount?: number;
162
- footerCount?: number;
163
- chartCount?: number;
164
- smartArtCount?: number;
165
- hasBibliography?: boolean;
166
- hasGlossary?: boolean;
167
- hasWebSettings?: boolean;
168
- altChunks?: {
169
- path: string;
170
- contentType: string;
171
- }[];
172
- subDocs?: {
173
- path: string;
174
- }[];
175
- }): ContentTypesInput;
176
- //#endregion
177
146
  //#region src/parts/inline.d.ts
178
147
  declare function stringifyRunInline(opts: RunOptions, ctx: BodyContext): string;
179
- type ParagraphChild = IParagraphJsonChild | RunOptions;
180
- declare function stringifyJsonChild(child: ParagraphChild, ctx: BodyContext): string | string[] | undefined;
148
+ declare function stringifyChildDispatch(child: ParagraphChild, ctx: BodyContext): string | string[] | undefined;
181
149
  declare function stringifyParagraphInline(opts: string | ParagraphOptions, ctx: BodyContext): string;
182
150
  //#endregion
183
151
  //#region src/parts/relationships.d.ts
@@ -199,6 +167,7 @@ interface SdtChildOptions {
199
167
  properties: SdtPropertiesOptions;
200
168
  children?: SectionChild[];
201
169
  }
170
+ declare function setBodyParseChild(parser: (el: Element, ctx: DocxReadContext) => SectionChild): void;
202
171
  declare const sdtBlockDesc: CustomDescriptor<SdtChildOptions, BodyContext>;
203
172
  interface CustomXmlBlockDescriptorOptions {
204
173
  element: string;
@@ -208,5 +177,5 @@ interface CustomXmlBlockDescriptorOptions {
208
177
  }
209
178
  declare const customXmlBlockDesc: CustomDescriptor<CustomXmlBlockDescriptorOptions, BodyContext>;
210
179
  //#endregion
211
- export { AbstractNumberingOptions, AlignmentType, AltChunkCollection, AltChunkData, AltChunkOptions, AnnotationReference, AutoCaptionOptions, BackgroundImageOptions, BibliographyOptions, type BodyContext, BodyPropertiesOptions, BookmarkOptions, BorderOptions, BorderStyle, BordersOptions, BreakType, BreakTypeValue, CaptionOptions, CaptionsOptions, CarriageReturn, CharacterSet, ChartChild, ChartMediaData, ChartOptions, CheckBoxOptions, ChildExtent, ChildOffset, CnfConditionalOptions, CnfStyleOptions, ColumnAttributes, ColumnsAttributes, CommentOptions, CommentsOptions, type CompatibilityOptions, type CompressionOptions, ConcreteNumberingOptions, ContentTypeDefault, ContentTypeOverride, ContentTypesInput, ContinuationSeparator, CorePropertiesInput, CustomPropertiesInput, CustomPropertyOptions, type CustomXmlAttributeOptions, CustomXmlBlockDescriptorOptions, type CustomXmlBlockOptions, type CustomXmlCellOptions, type CustomXmlDataBindingOptions, type CustomXmlPrOptions, type CustomXmlRowOptions, type CustomXmlRunOptions, DayLong, DayShort, DirOptions, Distance, DivBorderOptions, DivOptions, DocGridAttributesProperties, DocPartBehavior, DocPartGallery, DocPartOptions, DocPartType, DocumentAttributeNamespace, DocumentAttributeNamespaces, DocumentBackgroundOptions, DocumentGridType, DocumentOptions, DocumentProtectionOptions, DocxDocument, DocxPartRefs, type DocxReadContext, type DocxWriteContext, DrawingDescriptorOptions, DrawingOptions, DropCapType, DropDownListOptions, EditGroup, EditGroupType, EmphasisMarkType, EndnoteOptions, EndnotePropertiesOptions, EndnoteReference, EndnoteType, EndnotesData, ExternalHyperlinkOptions, FlatTextOptions, Floating, FontAttributesProperties, FontTableInput, FootnoteOptions, FootnotePropertiesOptions, FootnoteReferenceElement, FootnoteType, FootnotesData, FormFieldCommonOptions, FormFieldOptions, FormFieldTextOptions, FormFieldTextType, FrameAnchorType, FrameWrap, GlossaryDocumentOptions, GroupChild, HeaderFooterGroup, HeaderFooterReferenceOptions, HeaderFooterReferenceType, HeaderFooterType, HeadingLevel, HeightRule, HighlightColor, HorizontalPositionAlign, HorizontalPositionOptions, HorizontalPositionRelativeFrom, HyperlinkType, HyphenationOptions, IAlignmentFrameOptions, ICellMergeAttributes, IExtendedMediaData, IFrameOptions, IGroupChildMediaData, IImageOptions, IMediaData, IParagraphJsonChild, IParagraphPropertiesChangeOptions, IParagraphPropertiesOptionsBase, IParagraphRunOptions, IParagraphRunPropertiesOptions, IParagraphStylePropertiesOptions, IPatch, IRunPropertiesChangeOptions, ISectionPropertiesChangeOptions, ISectionPropertiesOptions, ISymbolRunOptions, ITablePropertiesChangeOptions, ITablePropertiesOptions, ITableRowPropertiesChangeOptions, ITableRowPropertiesOptions, ITextboxOptions, IWpgGroupOptions, IWpsShapeOptions, IXYFrameOptions, ImageChild, IndentAttributesProperties, InputDataType, InternalHyperlinkOptions, LastRenderedPageBreak, LeaderType, LevelFormat, LevelParagraphStylePropertiesOptions, LevelSuffix, LevelsOptions, LineNumberAttributes, LineNumberRestartFormat, LineRuleType, MailMergeDataType, MailMergeDest, MailMergeDocType, MailMergeOptions, MailMergeSourceType, Margins, MathChild, MathInput, MathPropertiesOptions, MathRunPropertiesOptions, MathScriptType, MathStyleType, Media, MediaDataTransformation, MediaTransformation, MonthLong, MonthShort, NoBreakHyphen, NormalAutofitOptions, NumberFormat, NumberedItemReferenceFormat, NumberedItemReferenceOptions, Numbering, NumberingOptions, type ObjectElementOptions, type ObjectEmbedOptions, type ObjectLinkOptions, OdsoFieldMapDataOptions, OdsoFieldType, OdsoOptions, type OutputByType, type OutputType, OverlapType, type PackerOptions, PageBorderDisplay, PageBorderOffsetFrom, PageBorderZOrder, PageBordersOptions, PageMarginAttributes, PageNumber, PageNumberElement, PageNumberSeparator, PageNumberTypeAttributes, PageOrientation, PageSizeAttributes, PageTextDirectionType, ParagraphChild, ParagraphOptions, ParagraphPropertiesOptions, PatchDocumentOptions, PatchDocumentOutputType, PatchType, PermStartOptions, PositionalTabAlignment, PositionalTabLeader, PositionalTabOptions, PositionalTabRelativeTo, PresetTextShapeOptions, ProofErrorType, ProofErrorTypeValue, ReadModeInkLockDownOptions, RelationshipEntry, RelationshipsInput, RelativeHorizontalPosition, RelativeVerticalPosition, RevisionViewOptions, RsidsOptions, RubyAlign, RubyOptions, RunOptions, RunPropertiesOptions, RunStylePropertiesOptions, SdtChildOptions, SdtComboBoxOptions, SdtDataBindingOptions, SdtDateMappingType, SdtDateOptions, SdtDropDownListOptions, SdtListItem, SdtLock, SdtPropertiesOptions, SdtTextOptions, SectionChild, SectionOptions, SectionPropertiesOptionsBase, SectionType, SectionVerticalAlign, Separator, SettingsOptions, ShadingAttributesProperties, ShadingType, SimpleFieldOptions, SmartArtChild, SmartArtMediaData, SmartArtNode, SmartArtOptions, SmartTagRunOptions, SoftHyphen, SourceTypeOptions, SpaceType, SpacingProperties, StyleLevel, Styles, StylesOptions, SubDocCollection, SubDocData, SubDocOptions, TABLE_BORDERS_NONE, Tab, TabStopDefinition, TabStopPosition, TabStopType, TableAnchorType, TableBordersOptions, TableCellBordersOptions, TableCellOptions, TableFloatOptions, TableLayoutType, TableLookOptions, TableOfContentsOptions, TableOptions, TablePropertiesOptionsBase, TablePropertyExOptions, TableRowOptions, TableRowPropertiesOptionsBase, TableVerticalAlign, TableWidthProperties, TargetScreenSize, TextAlignmentType, TextBodyWrappingType, TextDirection, TextEffect, TextHorzOverflowType, TextInputOptions, TextVertOverflowType, TextVerticalType, TextWrapping, TextWrappingSide, TextWrappingType, TextboxTightWrapType, UnderlineType, VerticalAlignSection, VerticalAlignTable, VerticalAnchor, VerticalMergeRevisionType, VerticalMergeType, VerticalPositionAlign, VerticalPositionOptions, VerticalPositionRelativeFrom, WORKAROUND2, WebSettingsInput, WebSettingsOptions, WidthType, WpgCommonMediaData, WpgGroupCoreOptions, WpgGroupOptions, WpgMediaData, WpsMediaData, WpsShapeCoreOptions, WpsShapeOptions, WriteProtectionOptions, YearLong, YearShort, altChunkDesc, bibliographyDesc, buildContentTypes, buildNumberingCache, buildStyleCache, commentsDesc, contentTypesDesc, corePropertiesDesc, createBodyProperties, createDocumentGrid, createFormFieldData, createHeaderFooterReference, createHorizontalPosition, createImageData, createLineNumberType, createPageMargin, createPageNumberType, createPageSize, createSectionType, createTransformation, createVerticalAlign, createVerticalPosition, createWrapThrough, createWrapTight, customPropertiesDesc, customXmlBlockDesc, drawingDesc, endnotesDesc, fontTableDesc, footnotesDesc, frameXml, framesetXml, generateDocument, generateDocumentStream, generateDocumentSync, glossaryDesc, parseArchive, parseDocument, parseDocx, parseNumberingDefinitions, parseSdtBlock, parseSectionPropertiesEl, parseStyleDefinitions, parseToc, patchDetector, patchDocument, relationshipsDesc, resetDrawingIdGen, sdtBlockDesc, sectionMarginDefaults, sectionPageSizeDefaults, sectionPropertiesDesc, setTableParseChild, settingsDesc, stringifyJsonChild, stringifyParagraphInline, stringifyRunInline, stringifySectionPropertiesXml, stringifyTableOfContents, subDocDesc, tableDesc, webSettingsDesc };
180
+ export { AbstractNumberingOptions, AlignmentFrameOptions, AlignmentType, AltChunkCollection, AltChunkData, AltChunkOptions, AnnotationReference, AutoCaptionOptions, BackgroundImageOptions, BibliographyOptions, type BodyContext, BodyPropertiesOptions, BookmarkOptions, BorderOptions, BorderStyle, BordersOptions, BreakType, BreakTypeValue, CaptionOptions, CaptionsOptions, CarriageReturn, CellMergeAttributes, CharacterSet, ChartChild, ChartMediaData, ChartOptions, CheckBoxOptions, ChildExtent, ChildOffset, CnfConditionalOptions, CnfStyleOptions, ColumnAttributes, ColumnsAttributes, CommentOptions, CommentsOptions, type CompatibilityOptions, type CompressionOptions, ConcreteNumberingOptions, ContentTypeDefault, ContentTypeOverride, ContentTypesInput, ContinuationSeparator, CorePropertiesInput, CustomPropertiesInput, CustomPropertyOptions, type CustomXmlAttributeOptions, CustomXmlBlockDescriptorOptions, type CustomXmlBlockOptions, type CustomXmlCellOptions, type CustomXmlDataBindingOptions, type CustomXmlPrOptions, type CustomXmlRowOptions, type CustomXmlRunOptions, DayLong, DayShort, DirOptions, Distance, DivBorderOptions, DivOptions, DocGridAttributesProperties, DocPartBehavior, DocPartGallery, DocPartOptions, DocPartType, DocumentAttributeNamespace, DocumentAttributeNamespaces, DocumentBackgroundOptions, DocumentGridType, DocumentOptions, DocumentProtectionOptions, DocxDocument, DocxPartRefs, type DocxReadContext, type DocxWriteContext, DrawingDescriptorOptions, DrawingOptions, DropCapType, DropDownListOptions, EditGroup, EditGroupType, EmphasisMarkType, EndnoteOptions, EndnotePropertiesOptions, EndnoteReference, EndnoteType, EndnotesData, ExtendedMediaData, ExternalHyperlinkOptions, FlatTextOptions, Floating, FontAttributesProperties, FontTableInput, FootnoteOptions, FootnotePropertiesOptions, FootnoteReferenceElement, FootnoteType, FootnotesData, FormFieldCommonOptions, FormFieldOptions, FormFieldTextOptions, FormFieldTextType, FrameAnchorType, FrameOptions, FrameWrap, GlossaryDocumentOptions, GroupChild, GroupChildMediaData, HeaderFooterGroup, HeaderFooterReferenceOptions, HeaderFooterReferenceType, HeaderFooterType, HeadingLevel, HeightRule, HighlightColor, HorizontalPositionAlign, HorizontalPositionOptions, HorizontalPositionRelativeFrom, HyperlinkType, HyphenationOptions, ImageChild, ImageOptions, IndentAttributesProperties, InputDataType, InternalHyperlinkOptions, LastRenderedPageBreak, LeaderType, LevelFormat, LevelParagraphStylePropertiesOptions, LevelSuffix, LevelsOptions, LineNumberAttributes, LineNumberRestartFormat, LineRuleType, MailMergeDataType, MailMergeDest, MailMergeDocType, MailMergeOptions, MailMergeSourceType, Margins, MathChild, MathInput, MathPropertiesOptions, MathRunPropertiesOptions, MathScriptType, MathStyleType, Media, MediaData, MediaDataTransformation, MediaTransformation, MonthLong, MonthShort, NoBreakHyphen, NormalAutofitOptions, NumberFormat, NumberedItemReferenceFormat, NumberedItemReferenceOptions, Numbering, NumberingOptions, type ObjectElementOptions, type ObjectEmbedOptions, type ObjectLinkOptions, OdsoFieldMapDataOptions, OdsoFieldType, OdsoOptions, type OutputByType, type OutputType, OverlapType, type PackerOptions, PageBorderDisplay, PageBorderOffsetFrom, PageBorderZOrder, PageBordersOptions, PageMarginAttributes, PageNumber, PageNumberElement, PageNumberSeparator, PageNumberTypeAttributes, PageOrientation, PageSizeAttributes, PageTextDirectionType, ParagraphChild, ParagraphOptions, ParagraphPropertiesChangeOptions, ParagraphPropertiesOptions, ParagraphPropertiesOptionsBase, ParagraphRunOptions, ParagraphRunPropertiesOptions, ParagraphStylePropertiesOptions, Patch, PatchDocumentOptions, PatchDocumentOutputType, PatchType, PermStartOptions, PositionalTabAlignment, PositionalTabLeader, PositionalTabOptions, PositionalTabRelativeTo, PresetTextShapeOptions, ProofErrorType, ProofErrorTypeValue, ReadModeInkLockDownOptions, RelationshipEntry, RelationshipsInput, RelativeHorizontalPosition, RelativeVerticalPosition, RevisionViewOptions, RsidsOptions, RubyAlign, RubyOptions, RunOptions, RunPropertiesChangeOptions, RunPropertiesOptions, RunStylePropertiesOptions, SdtChildOptions, SdtComboBoxOptions, SdtDataBindingOptions, SdtDateMappingType, SdtDateOptions, SdtDropDownListOptions, SdtListItem, SdtLock, SdtPropertiesOptions, SdtTextOptions, SectionChild, SectionOptions, SectionPropertiesChangeOptions, SectionPropertiesOptions, SectionPropertiesOptionsBase, SectionType, SectionVerticalAlign, Separator, SettingsOptions, ShadingAttributesProperties, ShadingType, SimpleFieldOptions, SmartArtChild, SmartArtMediaData, SmartArtNode, SmartArtOptions, SmartTagRunOptions, SoftHyphen, SourceTypeOptions, SpaceType, SpacingProperties, StyleLevel, Styles, StylesOptions, SubDocCollection, SubDocData, SubDocOptions, SymbolRunOptions, TABLE_BORDERS_NONE, Tab, TabStopDefinition, TabStopPosition, TabStopType, TableAnchorType, TableBordersOptions, TableCellBordersOptions, TableCellOptions, TableFloatOptions, TableLayoutType, TableLookOptions, TableOfContentsOptions, TableOptions, TablePropertiesChangeOptions, TablePropertiesOptions, TablePropertiesOptionsBase, TablePropertyExOptions, TableRowOptions, TableRowPropertiesChangeOptions, TableRowPropertiesOptions, TableRowPropertiesOptionsBase, TableVerticalAlign, TableWidthProperties, TargetScreenSize, TextAlignmentType, TextBodyWrappingType, TextDirection, TextEffect, TextHorzOverflowType, TextInputOptions, TextVertOverflowType, TextVerticalType, TextWrapping, TextWrappingSide, TextWrappingType, TextboxOptions, TextboxTightWrapType, UnderlineType, VerticalAlignSection, VerticalAlignTable, VerticalAnchor, VerticalMergeRevisionType, VerticalMergeType, VerticalPositionAlign, VerticalPositionOptions, VerticalPositionRelativeFrom, WORKAROUND2, WebSettingsInput, WebSettingsOptions, WidthType, WpgCommonMediaData, WpgGroupCoreOptions, WpgGroupOptions, WpgGroupRunOptions, WpgMediaData, WpsMediaData, WpsShapeCoreOptions, WpsShapeOptions, WpsShapeRunOptions, WriteProtectionOptions, XYFrameOptions, YearLong, YearShort, altChunkDesc, bibliographyDesc, buildContentTypes, buildNumberingCache, buildStyleCache, commentsDesc, contentTypesDesc, corePropertiesDesc, createBodyProperties, createDocumentGrid, createFormFieldData, createHeaderFooterReference, createHorizontalPosition, createImageData, createLineNumberType, createPageMargin, createPageNumberType, createPageSize, createSectionType, createTransformation, createVerticalAlign, createVerticalPosition, createWrapThrough, createWrapTight, customPropertiesDesc, customXmlBlockDesc, drawingDesc, endnotesDesc, fontTableDesc, footnotesDesc, frameXml, framesetXml, generateDocument, generateDocumentStream, generateDocumentSync, glossaryDesc, parseArchive, parseDocument, parseDocx, parseNumberingDefinitions, parseSdtBlock, parseSectionPropertiesEl, parseStyleDefinitions, parseToc, patchDetector, patchDocument, relationshipsDesc, resetDrawingIdGen, sdtBlockDesc, sectionMarginDefaults, sectionPageSizeDefaults, sectionPropertiesDesc, setBodyParseChild, setTableParseChild, settingsDesc, stringifyChildDispatch, stringifyParagraphInline, stringifyRunInline, stringifySectionPropertiesXml, stringifyTableOfContents, subDocDesc, tableDesc, webSettingsDesc };
212
181
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/parts/paragraph/links/hyperlink.ts","../src/parts/paragraph/links/bookmark.ts","../src/parts/paragraph/links/numbered-item-ref.ts","../src/parts/paragraph/links/bidi.ts","../src/parts/footnotes/footnote/footnote.ts","../src/parts/footnotes/descriptor.ts","../src/parts/endnotes/endnote/endnote.ts","../src/parts/endnotes/descriptor.ts","../src/parts/sdt/sdt-parse.ts","../src/parts/perm-start.ts","../src/parts/fonts/descriptor.ts","../src/parts/textbox/textbox.ts","../src/parts/object/object-element.ts","../src/parts/comments.ts","../src/parts/contenttypes.ts","../src/parts/inline.ts","../src/parts/relationships.ts","../src/parts/bodychildren.ts"],"mappings":";;;;;;;;cAUa,aAAA;EAAA,SAKH,QAAA;EAAA,SAAA,QAAA;AAAA;AAAA,UAKO,wBAAA;EAEf,MAAA;EAEA,OAAO;AAAA;AAAA,UAMQ,wBAAA;EAEf,IAAA;EAEA,OAAA;EAEA,QAAA;AAAA;;;UC3Be,eAAA;EAEf,EAAE;AAAA;;;aCKQ,2BAAA;EACV,IAAA;EAIA,QAAA;EAIA,UAAA;EAIA,YAAA;AAAA;AAAA,UAGe,4BAAA;EAKf,SAAA;EAKA,eAAA,GAAkB,2BAA2B;AAAA;;;UCjC9B,UAAA;EAEf,GAAG;AAAA;;;cCQQ,YAAA;EAAA,SAKH,SAAA;EAAA,SAAA,sBAAA;AAAA;AAAA,UAWO,eAAA;EAEf,EAAA;EAEA,IAAA,WAAe,YAAA,eAA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5C,+BAAA;EACf,OAAA;EACA,GAAA;EACA,WAAA,GAAc,kBAAA;EACd,QAAA,GAAW,YAAY;AAAA;AAAA,cAsBZ,kBAAA,EAAoB,gBAAA,CAAiB,+BAAA,EAAiC,WAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/parts/paragraph/links/hyperlink.ts","../src/parts/paragraph/links/bookmark.ts","../src/parts/paragraph/links/numbered-item-ref.ts","../src/parts/paragraph/links/bidi.ts","../src/parts/footnotes/footnote/footnote.ts","../src/parts/footnotes/descriptor.ts","../src/parts/endnotes/endnote/endnote.ts","../src/parts/endnotes/descriptor.ts","../src/parts/sdt/sdt-parse.ts","../src/parts/perm-start.ts","../src/parts/fonts/descriptor.ts","../src/parts/textbox/textbox.ts","../src/parts/object/object-element.ts","../src/parts/comments.ts","../src/parts/inline.ts","../src/parts/relationships.ts","../src/parts/bodychildren.ts"],"mappings":";;;;;;;;cAUa,aAAA;EAAA,SAKH,QAAA;EAAA,SAAA,QAAA;AAAA;AAAA,UAKO,wBAAA;EAEf,MAAA;EAEA,OAAO;AAAA;AAAA,UAMQ,wBAAA;EAEf,IAAA;EAEA,OAAA;EAEA,QAAA;AAAA;;;UC3Be,eAAA;EAEf,EAAE;AAAA;;;aCKQ,2BAAA;EACV,IAAA;EAIA,QAAA;EAIA,UAAA;EAIA,YAAA;AAAA;AAAA,UAGe,4BAAA;EAKf,SAAA;EAKA,eAAA,GAAkB,2BAA2B;AAAA;;;UCjC9B,UAAA;EAEf,GAAG;AAAA;;;cCQQ,YAAA;EAAA,SAKH,SAAA;EAAA,SAAA,sBAAA;AAAA;AAAA,UAWO,eAAA;EAEf,EAAA;EAEA,IAAA,WAAe,YAAA,eAA2B,YAAA;EAE1C,QAAA,GAAW,gBAAA;AAAA;;;UClBI,aAAA;EACf,KAAA,EAAO,GAAG,UAAU,gBAAA;AAAA;AAAA,cA6CT,aAAA,EAAe,gBAAA,CAAiB,aAAA,EAAe,WAAA;;;cC9D/C,WAAA;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AAA,EAAY,GAAA,EAAK,WAAW;AAAA,iBAqErD,sBAAA,CACd,KAAA,EAAO,cAAA,EACP,GAAA,EAAK,WAAW;AAAA,iBA+gBF,wBAAA,CACd,IAAA,WAAe,gBAAA,EACf,GAAA,EAAK,WAAW;;;UC/mBD,iBAAA;EACf,EAAA;EACA,IAAA;EACA,MAAA;EACA,UAAA;AAAA;AAAA,UAGe,kBAAA;EACf,aAAA,EAAe,iBAAiB;AAAA;AAAA,cAGrB,iBAAA,EAAmB,gBAAgB,CAAC,kBAAA;;;cC4BpC,YAAA,EAAc,gBAAA,CAAiB,eAAA,EAAiB,WAAA;AAAA,cA2EhD,UAAA,EAAY,gBAAA,CAAiB,aAAA,EAAe,WAAA;AAAA,UAmCxC,eAAA;EACf,UAAA,EAAY,oBAAA;EACZ,QAAA,GAAW,YAAY;AAAA;AAAA,iBA2ST,iBAAA,CACd,MAAA,GAAS,EAAA,EAAI,OAAA,EAAS,GAAA,EAAK,eAAA,KAAoB,YAAA;AAAA,cAcpC,YAAA,EAAc,gBAAA,CAAiB,eAAA,EAAiB,WAAA;AAAA,UA+C5C,+BAAA;EACf,OAAA;EACA,GAAA;EACA,WAAA,GAAc,kBAAA;EACd,QAAA,GAAW,YAAY;AAAA;AAAA,cAsBZ,kBAAA,EAAoB,gBAAA,CAAiB,+BAAA,EAAiC,WAAA"}
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import { $ as TableAnchorType, A as EditGroupType, B as Styles, C as DocPartType, D as CharacterSet, E as fontTableDesc, F as parseToc, G as parseNumberingDefinitions, H as buildStyleCache, I as SdtDateMappingType, J as TABLE_BORDERS_NONE, K as LevelFormat, L as SdtLock, M as endnotesDesc, N as footnotesDesc, O as SubDocCollection, P as stringifyTableOfContents, Q as RelativeVerticalPosition, R as StyleLevel, S as DocPartGallery, T as bibliographyDesc, U as parseStyleDefinitions, V as buildNumberingCache, W as Numbering, X as OverlapType, Y as TableLayoutType, Z as RelativeHorizontalPosition, _ as relationshipsDesc, at as PositionalTabLeader, b as commentsDesc, c as frameXml, ct as UnderlineType, d as customPropertiesDesc, dt as TextEffect, et as ProofErrorType, f as corePropertiesDesc, ft as PageNumber, g as subDocDesc, gt as AlignmentType, h as sdtBlockDesc, ht as HeadingLevel, it as PositionalTabAlignment, j as parseSdtBlock, k as AltChunkCollection, l as framesetXml, lt as createImageData, m as customXmlBlockDesc, mt as TextboxTightWrapType, nt as createFormFieldData, ot as PositionalTabRelativeTo, p as altChunkDesc, pt as TextAlignmentType, q as LevelSuffix, rt as RubyAlign, s as TargetScreenSize, st as EmphasisMarkType, tt as FormFieldTextType, u as webSettingsDesc, ut as HighlightColor, v as buildContentTypes, w as glossaryDesc, x as DocPartBehavior, y as contentTypesDesc, z as settingsDesc } from "./context-Ca7nmKV2.mjs";
2
- import { $ as TextHorzOverflowType, B as HorizontalPositionAlign, C as createPageSize, D as stringifyJsonChild, E as tableDesc, G as createWrapTight, H as SpaceType, I as createVerticalPosition, J as WidthType, K as TextWrappingSide, L as createHorizontalPosition, N as drawingDesc, O as stringifyParagraphInline, P as resetDrawingIdGen, Q as TextBodyWrappingType, R as HorizontalPositionRelativeFrom, S as PageOrientation, T as setTableParseChild, U as VerticalPositionAlign, V as NumberFormat, W as createWrapThrough, X as TextDirection, Y as BorderStyle, Z as VerticalMergeType, _ as DocumentGridType, a as HeaderFooterType, at as Media, b as sectionPageSizeDefaults, c as createSectionType, d as createPageMargin, et as TextVertOverflowType, f as PageBorderDisplay, g as createPageNumberType, h as PageNumberSeparator, i as HeaderFooterReferenceType, it as WORKAROUND2, k as stringifyRunInline, l as LineNumberRestartFormat, m as PageBorderZOrder, n as sectionPropertiesDesc, nt as VerticalAnchor, o as createHeaderFooterReference, ot as createTransformation, p as PageBorderOffsetFrom, q as TextWrappingType, r as stringifySectionPropertiesXml, rt as createBodyProperties, s as SectionType, t as parseSectionPropertiesEl, tt as TextVerticalType, u as createLineNumberType, v as createDocumentGrid, w as DocumentAttributeNamespaces, x as PageTextDirectionType, y as sectionMarginDefaults, z as VerticalPositionRelativeFrom } from "./document-CWr8C_OX.mjs";
1
+ import { $ as RelativeVerticalPosition, A as footnotesDesc, B as settingsDesc, C as fontTableDesc, D as EditGroupType, E as AltChunkCollection, F as stringifyTableOfContents, G as Numbering, H as buildNumberingCache, I as parseToc, J as LevelSuffix, K as parseNumberingDefinitions, L as SdtDateMappingType, O as parseSdtBlock, Q as RelativeHorizontalPosition, R as SdtLock, S as bibliographyDesc, T as SubDocCollection, U as buildStyleCache, V as Styles, W as parseStyleDefinitions, X as TableLayoutType, Y as TABLE_BORDERS_NONE, Z as OverlapType, _ as commentsDesc, _t as AlignmentType, a as framesetXml, at as PositionalTabAlignment, b as DocPartType, c as corePropertiesDesc, ct as EmphasisMarkType, d as sdtBlockDesc, dt as HighlightColor, et as TableAnchorType, f as setBodyParseChild, ft as TextEffect, g as contentTypesDesc, gt as HeadingLevel, h as buildContentTypes, ht as TextboxTightWrapType, i as frameXml, it as RubyAlign, k as endnotesDesc, l as altChunkDesc, lt as UnderlineType, m as relationshipsDesc, mt as TextAlignmentType, nt as FormFieldTextType, o as webSettingsDesc, ot as PositionalTabLeader, p as subDocDesc, pt as PageNumber, q as LevelFormat, r as TargetScreenSize, rt as createFormFieldData, s as customPropertiesDesc, st as PositionalTabRelativeTo, tt as ProofErrorType, u as customXmlBlockDesc, ut as createImageData, v as DocPartBehavior, w as CharacterSet, x as glossaryDesc, y as DocPartGallery, z as StyleLevel } from "./context-CERMOUn0.mjs";
2
+ import { $ as TextHorzOverflowType, B as HorizontalPositionAlign, C as createPageSize, D as stringifyChildDispatch, E as tableDesc, G as createWrapTight, H as SpaceType, I as createVerticalPosition, J as WidthType, K as TextWrappingSide, L as createHorizontalPosition, N as drawingDesc, O as stringifyParagraphInline, P as resetDrawingIdGen, Q as TextBodyWrappingType, R as HorizontalPositionRelativeFrom, S as PageOrientation, T as setTableParseChild, U as VerticalPositionAlign, V as NumberFormat, W as createWrapThrough, X as TextDirection, Y as BorderStyle, Z as VerticalMergeType, _ as DocumentGridType, a as HeaderFooterType, at as Media, b as sectionPageSizeDefaults, c as createSectionType, d as createPageMargin, et as TextVertOverflowType, f as PageBorderDisplay, g as createPageNumberType, h as PageNumberSeparator, i as HeaderFooterReferenceType, it as WORKAROUND2, k as stringifyRunInline, l as LineNumberRestartFormat, m as PageBorderZOrder, n as sectionPropertiesDesc, nt as VerticalAnchor, o as createHeaderFooterReference, ot as createTransformation, p as PageBorderOffsetFrom, q as TextWrappingType, r as stringifySectionPropertiesXml, rt as createBodyProperties, s as SectionType, t as parseSectionPropertiesEl, tt as TextVerticalType, u as createLineNumberType, v as createDocumentGrid, w as DocumentAttributeNamespaces, x as PageTextDirectionType, y as sectionMarginDefaults, z as VerticalPositionRelativeFrom } from "./document-CeM-U6J3.mjs";
3
3
  import { PatchType, patchDetector, patchDocument } from "./patch/index.mjs";
4
- import { n as parseDocument, r as parseDocx, t as parseArchive } from "./parse-D9ujyKBr.mjs";
5
- import { n as generateDocumentStream, r as generateDocumentSync, t as generateDocument } from "./generate-m1Cw7CHL.mjs";
4
+ import { n as parseDocument, r as parseDocx, t as parseArchive } from "./parse-BIJM6_8Y.mjs";
5
+ import { n as generateDocumentStream, r as generateDocumentSync, t as generateDocument } from "./generate-DiDgl0bc.mjs";
6
6
  //#region src/parts/paragraph/formatting/break.ts
7
7
  /**
8
8
  * Break type values for WordprocessingML documents.
@@ -396,6 +396,6 @@ const VerticalAlignSection = {
396
396
  */
397
397
  const createVerticalAlign = (value) => `<w:vAlign w:val="${value}"/>`;
398
398
  //#endregion
399
- export { AlignmentType, AltChunkCollection, BorderStyle, BreakType, CharacterSet, DocPartBehavior, DocPartGallery, DocPartType, DocumentAttributeNamespaces, DocumentGridType, DropCapType, EditGroupType, EmphasisMarkType, EndnoteType, FootnoteType, FormFieldTextType, FrameAnchorType, FrameWrap, HeaderFooterReferenceType, HeaderFooterType, HeadingLevel, HeightRule, HighlightColor, HorizontalPositionAlign, HorizontalPositionRelativeFrom, HyperlinkType, LeaderType, LevelFormat, LevelSuffix, LineNumberRestartFormat, LineRuleType, Media, NumberFormat, NumberedItemReferenceFormat, Numbering, OverlapType, PageBorderDisplay, PageBorderOffsetFrom, PageBorderZOrder, PageNumber, PageNumberSeparator, PageOrientation, PageTextDirectionType, PatchType, PositionalTabAlignment, PositionalTabLeader, PositionalTabRelativeTo, ProofErrorType, RelativeHorizontalPosition, RelativeVerticalPosition, RubyAlign, SdtDateMappingType, SdtLock, SectionType, ShadingType, SpaceType, StyleLevel, Styles, SubDocCollection, TABLE_BORDERS_NONE, TabStopPosition, TabStopType, TableAnchorType, TableLayoutType, TargetScreenSize, TextAlignmentType, TextBodyWrappingType, TextDirection, TextEffect, TextHorzOverflowType, TextVertOverflowType, TextVerticalType, TextWrappingSide, TextWrappingType, TextboxTightWrapType, UnderlineType, VerticalAlignSection, VerticalAlignTable, VerticalAnchor, VerticalMergeRevisionType, VerticalMergeType, VerticalPositionAlign, VerticalPositionRelativeFrom, WORKAROUND2, WidthType, altChunkDesc, bibliographyDesc, buildContentTypes, buildNumberingCache, buildStyleCache, commentsDesc, contentTypesDesc, corePropertiesDesc, createBodyProperties, createDocumentGrid, createFormFieldData, createHeaderFooterReference, createHorizontalPosition, createImageData, createLineNumberType, createPageMargin, createPageNumberType, createPageSize, createSectionType, createTransformation, createVerticalAlign, createVerticalPosition, createWrapThrough, createWrapTight, customPropertiesDesc, customXmlBlockDesc, drawingDesc, endnotesDesc, fontTableDesc, footnotesDesc, frameXml, framesetXml, generateDocument, generateDocumentStream, generateDocumentSync, glossaryDesc, parseArchive, parseDocument, parseDocx, parseNumberingDefinitions, parseSdtBlock, parseSectionPropertiesEl, parseStyleDefinitions, parseToc, patchDetector, patchDocument, relationshipsDesc, resetDrawingIdGen, sdtBlockDesc, sectionMarginDefaults, sectionPageSizeDefaults, sectionPropertiesDesc, setTableParseChild, settingsDesc, stringifyJsonChild, stringifyParagraphInline, stringifyRunInline, stringifySectionPropertiesXml, stringifyTableOfContents, subDocDesc, tableDesc, webSettingsDesc };
399
+ export { AlignmentType, AltChunkCollection, BorderStyle, BreakType, CharacterSet, DocPartBehavior, DocPartGallery, DocPartType, DocumentAttributeNamespaces, DocumentGridType, DropCapType, EditGroupType, EmphasisMarkType, EndnoteType, FootnoteType, FormFieldTextType, FrameAnchorType, FrameWrap, HeaderFooterReferenceType, HeaderFooterType, HeadingLevel, HeightRule, HighlightColor, HorizontalPositionAlign, HorizontalPositionRelativeFrom, HyperlinkType, LeaderType, LevelFormat, LevelSuffix, LineNumberRestartFormat, LineRuleType, Media, NumberFormat, NumberedItemReferenceFormat, Numbering, OverlapType, PageBorderDisplay, PageBorderOffsetFrom, PageBorderZOrder, PageNumber, PageNumberSeparator, PageOrientation, PageTextDirectionType, PatchType, PositionalTabAlignment, PositionalTabLeader, PositionalTabRelativeTo, ProofErrorType, RelativeHorizontalPosition, RelativeVerticalPosition, RubyAlign, SdtDateMappingType, SdtLock, SectionType, ShadingType, SpaceType, StyleLevel, Styles, SubDocCollection, TABLE_BORDERS_NONE, TabStopPosition, TabStopType, TableAnchorType, TableLayoutType, TargetScreenSize, TextAlignmentType, TextBodyWrappingType, TextDirection, TextEffect, TextHorzOverflowType, TextVertOverflowType, TextVerticalType, TextWrappingSide, TextWrappingType, TextboxTightWrapType, UnderlineType, VerticalAlignSection, VerticalAlignTable, VerticalAnchor, VerticalMergeRevisionType, VerticalMergeType, VerticalPositionAlign, VerticalPositionRelativeFrom, WORKAROUND2, WidthType, altChunkDesc, bibliographyDesc, buildContentTypes, buildNumberingCache, buildStyleCache, commentsDesc, contentTypesDesc, corePropertiesDesc, createBodyProperties, createDocumentGrid, createFormFieldData, createHeaderFooterReference, createHorizontalPosition, createImageData, createLineNumberType, createPageMargin, createPageNumberType, createPageSize, createSectionType, createTransformation, createVerticalAlign, createVerticalPosition, createWrapThrough, createWrapTight, customPropertiesDesc, customXmlBlockDesc, drawingDesc, endnotesDesc, fontTableDesc, footnotesDesc, frameXml, framesetXml, generateDocument, generateDocumentStream, generateDocumentSync, glossaryDesc, parseArchive, parseDocument, parseDocx, parseNumberingDefinitions, parseSdtBlock, parseSectionPropertiesEl, parseStyleDefinitions, parseToc, patchDetector, patchDocument, relationshipsDesc, resetDrawingIdGen, sdtBlockDesc, sectionMarginDefaults, sectionPageSizeDefaults, sectionPropertiesDesc, setBodyParseChild, setTableParseChild, settingsDesc, stringifyChildDispatch, stringifyParagraphInline, stringifyRunInline, stringifySectionPropertiesXml, stringifyTableOfContents, subDocDesc, tableDesc, webSettingsDesc };
400
400
 
401
401
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/parts/paragraph/formatting/break.ts","../src/parts/paragraph/formatting/spacing.ts","../src/parts/paragraph/formatting/tab-stop.ts","../src/parts/paragraph/links/hyperlink.ts","../src/parts/paragraph/links/numbered-item-ref.ts","../src/parts/paragraph/frame/frame-properties.ts","../src/parts/table/table-row/table-row-height.ts","../src/parts/footnotes/footnote/footnote.ts","../src/parts/endnotes/endnote/endnote.ts","../src/shared/shading.ts","../src/shared/track-revision/track-revision-components/cell-merge.ts","../src/shared/vertical-align.ts"],"sourcesContent":["/**\n * Break type values for WordprocessingML documents.\n *\n * @module\n */\n\n/**\n * Break type constants.\n * @internal\n */\nexport const BreakType = {\n /** Column break */\n COLUMN: \"column\",\n /** Page break */\n PAGE: \"page\",\n} as const;\n\nexport type BreakTypeValue = (typeof BreakType)[keyof typeof BreakType];\n","/**\n * Paragraph spacing module for WordprocessingML documents.\n *\n * This module provides spacing options for paragraphs including space before,\n * space after, and line spacing.\n *\n * Reference: http://officeopenxml.com/WPspacing.php\n *\n * @module\n */\n\n/**\n * Line spacing rule types.\n *\n * Specifies how the line height is calculated.\n *\n * @publicApi\n */\nexport const LineRuleType = {\n /** Line spacing is at least the specified value */\n AT_LEAST: \"atLeast\",\n /** Line spacing is exactly the specified value */\n EXACTLY: \"exactly\",\n /** Line spacing is exactly the specified value (alias for EXACTLY) */\n EXACT: \"exact\",\n /** Line spacing is automatically determined based on content */\n AUTO: \"auto\",\n} as const;\n\n/**\n * Properties for configuring paragraph spacing.\n *\n * All values are in twips (twentieths of a point) unless otherwise specified.\n */\nexport interface SpacingProperties {\n /** Spacing after the paragraph in twips */\n after?: number;\n /** Spacing before the paragraph in twips */\n before?: number;\n /** Line spacing value in twips (interpretation depends on lineRule) */\n line?: number;\n /** How to interpret the line spacing value */\n lineRule?: (typeof LineRuleType)[keyof typeof LineRuleType];\n /** Use automatic spacing before the paragraph */\n beforeAutoSpacing?: boolean;\n /** Use automatic spacing after the paragraph */\n afterAutoSpacing?: boolean;\n /** Spacing before the paragraph in line units */\n beforeLines?: number;\n /** Spacing after the paragraph in line units */\n afterLines?: number;\n}\n","/**\n * Tab stop module for WordprocessingML documents.\n *\n * This module provides tab stop definitions for paragraphs.\n *\n * Reference: http://officeopenxml.com/WPtab.php\n *\n * @module\n */\n\n/**\n * Definition for a single tab stop.\n *\n * @see {@link TabStop}\n */\nexport interface TabStopDefinition {\n /** The type of tab stop alignment */\n type: (typeof TabStopType)[keyof typeof TabStopType];\n /** The position of the tab stop in twips */\n position: number | (typeof TabStopPosition)[keyof typeof TabStopPosition];\n /** Optional leader character to fill space before the tab */\n leader?: (typeof LeaderType)[keyof typeof LeaderType];\n}\n\n/**\n * Tab stop alignment types.\n *\n * Specifies the type of tab stop and how text aligns to it.\n *\n * @publicApi\n */\nexport const TabStopType = {\n /** Left-aligned tab stop */\n LEFT: \"left\",\n /** Right-aligned tab stop */\n RIGHT: \"right\",\n /** Center-aligned tab stop */\n CENTER: \"center\",\n /** Bar tab stop - inserts a vertical bar at the position */\n BAR: \"bar\",\n /** Clears a tab stop at the specified position */\n CLEAR: \"clear\",\n /** Decimal-aligned tab stop - aligns on decimal point */\n DECIMAL: \"decimal\",\n /** End-aligned tab stop (right-to-left equivalent) */\n END: \"end\",\n /** List tab stop for numbered lists */\n NUM: \"num\",\n /** Start-aligned tab stop (left-to-right equivalent) */\n START: \"start\",\n} as const;\n\n/**\n * Tab stop leader character types.\n *\n * Specifies the character used to fill the space before the tab stop.\n *\n * @publicApi\n */\nexport const LeaderType = {\n /** Dot leader (....) */\n DOT: \"dot\",\n /** Heavy leader */\n HEAVY: \"heavy\",\n /** Hyphen leader (----) */\n HYPHEN: \"hyphen\",\n /** Middle dot leader (····) */\n MIDDLE_DOT: \"middleDot\",\n /** No leader */\n NONE: \"none\",\n /** Underscore leader (____) */\n UNDERSCORE: \"underscore\",\n} as const;\n\n/**\n * Predefined tab stop positions.\n *\n * @publicApi\n */\nexport const TabStopPosition = {\n /** Maximum tab stop position (right margin) */\n MAX: 9026,\n} as const;\n","/**\n * Hyperlink types for WordprocessingML documents.\n *\n * @module\n */\n\n/**\n * Hyperlink type enumeration.\n * @publicApi\n */\nexport const HyperlinkType = {\n /** Internal hyperlink to a bookmark within the document */\n INTERNAL: \"INTERNAL\",\n /** External hyperlink to a URL outside the document */\n EXTERNAL: \"EXTERNAL\",\n} as const;\n\n/**\n * Options for creating an internal hyperlink.\n */\nexport interface InternalHyperlinkOptions {\n /** Name of the bookmark to link to within the document */\n anchor: string;\n /** Screen tip text shown when hovering over the hyperlink */\n tooltip?: string;\n}\n\n/**\n * Options for creating an external hyperlink.\n */\nexport interface ExternalHyperlinkOptions {\n /** URL to link to outside the document */\n link: string;\n /** Screen tip text shown when hovering over the hyperlink */\n tooltip?: string;\n /** Target frame for the hyperlink (e.g., \"_blank\", \"_self\") */\n tgtFrame?: string;\n}\n","/**\n * Numbered item reference module for WordprocessingML documents.\n *\n * This module provides cross-references to numbered items (such as\n * numbered paragraphs, list items, or headings) within a document.\n *\n * Reference: https://learn.microsoft.com/en-us/openspecs/office_standards/ms-oi29500/7088a8ce-e784-49d4-94b8-cba6ef8fce78\n *\n * @module\n */\n\n/**\n * Format options for numbered item references.\n *\n * Specifies how the paragraph number should be displayed when referenced.\n */\nexport enum NumberedItemReferenceFormat {\n NONE = \"none\",\n /**\n * \\r option - inserts the paragraph number of the bookmarked paragraph in relative context, or relative to its position in the numbering scheme\n */\n RELATIVE = \"relative\",\n /**\n * \\n option - causes the field result to be the paragraph number without trailing periods. No information about prior numbered levels is displayed unless it is included as part of the current level.\n */\n NO_CONTEXT = \"no_context\",\n /**\n * \\w option - causes the field result to be the entire paragraph number without trailing periods, regardless of the location of the REF field.\n */\n FULL_CONTEXT = \"full_context\",\n}\n\nexport interface NumberedItemReferenceOptions {\n /**\n * \\h option - Creates a hyperlink to the bookmarked paragraph.\n * @default true\n */\n hyperlink?: boolean;\n /**\n * Which switch to use for the reference format\n * @default NumberedItemReferenceFormat.FULL_CONTEXT\n */\n referenceFormat?: NumberedItemReferenceFormat;\n}\n","import type { HeightRule } from \"@parts/table\";\n/**\n * Frame properties module for paragraph text frames in WordprocessingML documents.\n *\n * Frames allow paragraphs to be positioned absolutely on the page, enabling text wrapping\n * and drop cap effects. They are commonly used for floating text boxes and decorative elements.\n *\n * Reference: http://officeopenxml.com/WPparagraph-textFrames.php\n *\n * @module\n */\nimport type { HorizontalPositionAlign, VerticalPositionAlign } from \"@shared/constants\";\n\n/**\n * Drop cap types for paragraph frames.\n */\nexport const DropCapType = {\n /** No drop cap effect */\n NONE: \"none\",\n /** Drop cap that drops down into the paragraph text */\n DROP: \"drop\",\n /** Drop cap that extends into the margin */\n MARGIN: \"margin\",\n} as const;\n\n/**\n * Frame anchor types specifying what the frame should be anchored relative to.\n */\nexport const FrameAnchorType = {\n /** Anchor relative to the page margin */\n MARGIN: \"margin\",\n /** Anchor relative to the page edge */\n PAGE: \"page\",\n /** Anchor relative to the text column */\n TEXT: \"text\",\n} as const;\n\n/**\n * Text wrapping types for frames.\n */\nexport const FrameWrap = {\n /** Wrap text around the frame on all sides */\n AROUND: \"around\",\n /** Automatic wrapping based on available space */\n AUTO: \"auto\",\n /** No text wrapping */\n NONE: \"none\",\n /** Do not allow text beside the frame */\n NOT_BESIDE: \"notBeside\",\n /** Allow text to flow through the frame */\n THROUGH: \"through\",\n /** Wrap text tightly around the frame */\n TIGHT: \"tight\",\n} as const;\n\n/**\n * Base options shared by all frame types.\n */\ninterface BaseFrameOptions {\n /** Lock the anchor position to prevent it from moving */\n anchorLock?: boolean;\n /** Drop cap effect type */\n dropCap?: (typeof DropCapType)[keyof typeof DropCapType];\n /** Frame width in twips */\n width: number;\n /** Frame height in twips */\n height: number;\n /** Text wrapping behavior around the frame */\n wrap?: (typeof FrameWrap)[keyof typeof FrameWrap];\n /** Number of lines for drop cap effect */\n lines?: number;\n /** Anchor reference points for horizontal and vertical positioning */\n anchor: {\n /** Horizontal anchor reference point */\n horizontal: (typeof FrameAnchorType)[keyof typeof FrameAnchorType];\n /** Vertical anchor reference point */\n vertical: (typeof FrameAnchorType)[keyof typeof FrameAnchorType];\n };\n /** Spacing between frame and surrounding text in twips */\n space?: {\n /** Horizontal spacing in twips */\n horizontal: number;\n /** Vertical spacing in twips */\n vertical: number;\n };\n /** Height rule determining how frame height is calculated */\n rule?: (typeof HeightRule)[keyof typeof HeightRule];\n}\n\n/**\n * Options for frames positioned using absolute X/Y coordinates.\n */\nexport type IXYFrameOptions = {\n /** Must be \"absolute\" for coordinate-based positioning */\n type: \"absolute\";\n /** Absolute X and Y coordinates in twips */\n position: {\n /** Horizontal position in twips from the anchor point */\n x: number;\n /** Vertical position in twips from the anchor point */\n y: number;\n };\n} & BaseFrameOptions;\n\n/**\n * Options for frames positioned using alignment values.\n */\nexport type IAlignmentFrameOptions = {\n /** Must be \"alignment\" for alignment-based positioning */\n type: \"alignment\";\n /** Horizontal and vertical alignment values */\n alignment: {\n /** Horizontal alignment relative to the anchor */\n x: (typeof HorizontalPositionAlign)[keyof typeof HorizontalPositionAlign];\n /** Vertical alignment relative to the anchor */\n y: (typeof VerticalPositionAlign)[keyof typeof VerticalPositionAlign];\n };\n} & BaseFrameOptions;\n\n/**\n * Union type for all frame positioning options.\n */\nexport type IFrameOptions = IXYFrameOptions | IAlignmentFrameOptions;\n","/**\n * Table row height module for WordprocessingML documents.\n *\n * This module provides row height configuration including rules for how height should be applied.\n *\n * Reference: http://officeopenxml.com/WPtableRow.php\n *\n * @module\n */\n\n/**\n * Height rules for table rows.\n *\n * Specifies how the height value should be interpreted.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_HeightRule\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"auto\"/>\n * <xsd:enumeration value=\"exact\"/>\n * <xsd:enumeration value=\"atLeast\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const HeightRule = {\n /** Height is determined based on the content, so value is ignored. */\n AUTO: \"auto\",\n /** At least the value specified */\n ATLEAST: \"atLeast\",\n /** Exactly the value specified */\n EXACT: \"exact\",\n} as const;\n","/**\n * Footnote module for WordprocessingML documents.\n *\n * This module provides support for footnotes that appear at the bottom\n * of the page referenced from the main document text.\n *\n * Reference: http://officeopenxml.com/WPfootnotes.php\n *\n * @module\n */\nimport type { ParagraphOptions } from \"@parts/paragraph/paragraph\";\n\n/**\n * Enumeration of footnote types.\n *\n * Reference: http://officeopenxml.com/WPfootnotes.php\n *\n * @publicApi\n */\nexport const FootnoteType = {\n /** Separator line between body text and footnotes */\n SEPERATOR: \"separator\",\n /** Continuation separator for footnotes spanning pages */\n CONTINUATION_SEPERATOR: \"continuationSeparator\",\n} as const;\n\n/**\n * Options for creating a Footnote.\n *\n * @property id - Unique numeric identifier for this footnote\n * @property type - Type of footnote (separator, continuationSeparator, or normal)\n * @property children - Array of paragraphs that make up the footnote content\n *\n * @see {@link Footnote}\n */\nexport interface FootnoteOptions {\n /** Unique numeric identifier for this footnote */\n id: number;\n /** Type of footnote (separator or continuation separator) */\n type?: (typeof FootnoteType)[keyof typeof FootnoteType];\n /** Content of the footnote (paragraphs, tables, etc.) */\n children: (ParagraphOptions | string)[];\n}\n","/**\n * Endnote module for WordprocessingML documents.\n *\n * @module\n */\nimport type { ParagraphOptions } from \"@parts/paragraph/paragraph\";\n\nexport const EndnoteType = {\n CONTINUATION_SEPARATOR: \"continuationSeparator\",\n\n SEPARATOR: \"separator\",\n} as const;\n\nexport interface EndnoteOptions {\n id: number;\n type?: (typeof EndnoteType)[keyof typeof EndnoteType];\n children: (ParagraphOptions | string)[];\n}\n","/**\n * Shading module for WordprocessingML documents.\n *\n * Shading is used to apply background colors and patterns to paragraphs,\n * table cells, and text runs. The shading type is identical in all places.\n *\n * Reference: http://officeopenxml.com/WPshading.php\n *\n * @see http://officeopenxml.com/WPtableShading.php\n * @see http://officeopenxml.com/WPtableCellProperties-Shading.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Shd\">\n * <xsd:attribute name=\"val\" type=\"ST_Shd\" use=\"required\"/>\n * <xsd:attribute name=\"color\" type=\"ST_HexColor\" use=\"optional\"/>\n * <xsd:attribute name=\"themeColor\" type=\"ST_ThemeColor\" use=\"optional\"/>\n * <xsd:attribute name=\"themeTint\" type=\"ST_UcharHexNumber\" use=\"optional\"/>\n * <xsd:attribute name=\"themeShade\" type=\"ST_UcharHexNumber\" use=\"optional\"/>\n * <xsd:attribute name=\"fill\" type=\"ST_HexColor\" use=\"optional\"/>\n * <xsd:attribute name=\"themeFill\" type=\"ST_ThemeColor\" use=\"optional\"/>\n * <xsd:attribute name=\"themeFillTint\" type=\"ST_UcharHexNumber\" use=\"optional\"/>\n * <xsd:attribute name=\"themeFillShade\" type=\"ST_UcharHexNumber\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n *\n * @module\n */\nimport type { ThemeColor } from \"@office-open/core\";\n\n/**\n * Properties for configuring shading.\n *\n * @property fill - Background fill color in hex format (e.g., \"FF0000\" for red)\n * @property color - Pattern color in hex format\n * @property type - Shading pattern type\n */\nexport interface ShadingAttributesProperties {\n fill?: string;\n color?: string;\n type?: (typeof ShadingType)[keyof typeof ShadingType];\n /** Theme color reference */\n themeColor?: (typeof ThemeColor)[keyof typeof ThemeColor];\n /** Theme color tint (2-char hex) */\n themeTint?: string;\n /** Theme color shade (2-char hex) */\n themeShade?: string;\n /** Theme fill color reference */\n themeFill?: (typeof ThemeColor)[keyof typeof ThemeColor];\n /** Theme fill tint (2-char hex) */\n themeFillTint?: string;\n /** Theme fill shade (2-char hex) */\n themeFillShade?: string;\n}\n\n/**\n * Shading pattern types.\n *\n * Specifies the pattern used for shading. The pattern combines the fill\n * color and the pattern color.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_Shd\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"nil\"/>\n * <xsd:enumeration value=\"clear\"/>\n * <xsd:enumeration value=\"solid\"/>\n * <xsd:enumeration value=\"horzStripe\"/>\n * <xsd:enumeration value=\"vertStripe\"/>\n * <xsd:enumeration value=\"reverseDiagStripe\"/>\n * <xsd:enumeration value=\"diagStripe\"/>\n * <xsd:enumeration value=\"horzCross\"/>\n * <xsd:enumeration value=\"diagCross\"/>\n * <!-- ... percent values ... -->\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const ShadingType = {\n /** Clear shading - no pattern, fill color only */\n CLEAR: \"clear\",\n DIAGONAL_CROSS: \"diagCross\",\n DIAGONAL_STRIPE: \"diagStripe\",\n HORIZONTAL_CROSS: \"horzCross\",\n HORIZONTAL_STRIPE: \"horzStripe\",\n NIL: \"nil\",\n PERCENT_10: \"pct10\",\n PERCENT_12: \"pct12\",\n PERCENT_15: \"pct15\",\n PERCENT_20: \"pct20\",\n PERCENT_25: \"pct25\",\n PERCENT_30: \"pct30\",\n PERCENT_35: \"pct35\",\n PERCENT_37: \"pct37\",\n PERCENT_40: \"pct40\",\n PERCENT_45: \"pct45\",\n PERCENT_5: \"pct5\",\n PERCENT_50: \"pct50\",\n PERCENT_55: \"pct55\",\n PERCENT_60: \"pct60\",\n PERCENT_62: \"pct62\",\n PERCENT_65: \"pct65\",\n PERCENT_70: \"pct70\",\n PERCENT_75: \"pct75\",\n PERCENT_80: \"pct80\",\n PERCENT_85: \"pct85\",\n PERCENT_87: \"pct87\",\n PERCENT_90: \"pct90\",\n PERCENT_95: \"pct95\",\n REVERSE_DIAGONAL_STRIPE: \"reverseDiagStripe\",\n SOLID: \"solid\",\n THIN_DIAGONAL_CROSS: \"thinDiagCross\",\n THIN_DIAGONAL_STRIPE: \"thinDiagStripe\",\n THIN_HORIZONTAL_CROSS: \"thinHorzCross\",\n THIN_REVERSE_DIAGONAL_STRIPE: \"thinReverseDiagStripe\",\n THIN_VERTICAL_STRIPE: \"thinVertStripe\",\n VERTICAL_STRIPE: \"vertStripe\",\n} as const;\n","/**\n * Cell merge track revision component.\n *\n * @module\n */\n\nimport type { ChangedAttributesProperties } from \"../track-revision\";\n\n/**\n * Vertical merge revision types.\n */\nexport const VerticalMergeRevisionType = {\n /**\n * Cell that is merged with upper one.\n */\n CONTINUE: \"continue\",\n /**\n * Cell that is starting the vertical merge.\n */\n RESTART: \"restart\",\n} as const;\n\nexport type ICellMergeAttributes = ChangedAttributesProperties & {\n verticalMerge?: (typeof VerticalMergeRevisionType)[keyof typeof VerticalMergeRevisionType];\n verticalMergeOriginal?: (typeof VerticalMergeRevisionType)[keyof typeof VerticalMergeRevisionType];\n};\n","/**\n * Vertical alignment module for WordprocessingML documents.\n *\n * This module provides vertical alignment options for table cells and sections.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_VerticalJc\">\n * <xsd:attribute name=\"val\" type=\"ST_VerticalJc\" use=\"required\"/>\n * </xsd:complexType>\n *\n * <xsd:simpleType name=\"ST_VerticalJc\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"both\"/>\n * <xsd:enumeration value=\"top\"/>\n * <xsd:enumeration value=\"center\"/>\n * <xsd:enumeration value=\"bottom\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @module\n */\n/**\n * Enumeration for table-cell vertical alignment. Only `top`, `center`, `bottom`\n * are valid according to ECMA-376 (§17.18.87 ST_VerticalJc within `<w:tcPr>`).\n *\n * @publicApi\n */\nexport const VerticalAlignTable = {\n BOTTOM: \"bottom\",\n CENTER: \"center\",\n TOP: \"top\",\n} as const;\n\n/**\n * Enumeration for section (<w:sectPr>) vertical alignment. Adds `both` on top of\n * the table-cell set (§17.18.87 ST_VerticalJc within <w:sectPr>).\n *\n * @publicApi\n */\nexport const VerticalAlignSection = {\n ...VerticalAlignTable,\n BOTH: \"both\",\n} as const;\n\nexport type TableVerticalAlign = (typeof VerticalAlignTable)[keyof typeof VerticalAlignTable];\n\nexport type SectionVerticalAlign = (typeof VerticalAlignSection)[keyof typeof VerticalAlignSection];\n\n/**\n * Creates a vertical alignment element in a WordprocessingML document.\n *\n * Used in table cells and sections to control vertical text positioning.\n *\n * @example\n * ```typescript\n * createVerticalAlign(VerticalAlignTable.CENTER);\n * ```\n */\nexport const createVerticalAlign = (value: TableVerticalAlign | SectionVerticalAlign): string =>\n `<w:vAlign w:val=\"${value}\"/>`;\n"],"mappings":";;;;;;;;;;;;;;;AAUA,MAAa,YAAY;;CAEvB,QAAQ;;CAER,MAAM;AACR;;;;;;;;;;;;;;;;;;;;ACGA,MAAa,eAAe;;CAE1B,UAAU;;CAEV,SAAS;;CAET,OAAO;;CAEP,MAAM;AACR;;;;;;;;;;ACIA,MAAa,cAAc;;CAEzB,MAAM;;CAEN,OAAO;;CAEP,QAAQ;;CAER,KAAK;;CAEL,OAAO;;CAEP,SAAS;;CAET,KAAK;;CAEL,KAAK;;CAEL,OAAO;AACT;;;;;;;;AASA,MAAa,aAAa;;CAExB,KAAK;;CAEL,OAAO;;CAEP,QAAQ;;CAER,YAAY;;CAEZ,MAAM;;CAEN,YAAY;AACd;;;;;;AAOA,MAAa,kBAAkB;;AAE7B,KAAK,KACP;;;;;;;;;;;;ACxEA,MAAa,gBAAgB;;CAE3B,UAAU;;CAEV,UAAU;AACZ;;;;;;;;;;;;;;;;;;ACCA,IAAY,8BAAL,yBAAA,6BAAA;CACL,4BAAA,UAAA;;;;CAIA,4B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AK;AACP;;;;;;;AAQA,MAAa,uBAAuB;CAClC,GAAG;CACH,MAAM;AACR;;;;;;;;;;;AAgBA,MAAa,uBAAuB,UAClC,oBAAoB,MAAM"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/parts/paragraph/formatting/break.ts","../src/parts/paragraph/formatting/spacing.ts","../src/parts/paragraph/formatting/tab-stop.ts","../src/parts/paragraph/links/hyperlink.ts","../src/parts/paragraph/links/numbered-item-ref.ts","../src/parts/paragraph/frame/frame-properties.ts","../src/parts/table/table-row/table-row-height.ts","../src/parts/footnotes/footnote/footnote.ts","../src/parts/endnotes/endnote/endnote.ts","../src/shared/shading.ts","../src/shared/track-revision/track-revision-components/cell-merge.ts","../src/shared/vertical-align.ts"],"sourcesContent":["/**\n * Break type values for WordprocessingML documents.\n *\n * @module\n */\n\n/**\n * Break type constants.\n * @internal\n */\nexport const BreakType = {\n /** Column break */\n COLUMN: \"column\",\n /** Page break */\n PAGE: \"page\",\n} as const;\n\nexport type BreakTypeValue = (typeof BreakType)[keyof typeof BreakType];\n","/**\n * Paragraph spacing module for WordprocessingML documents.\n *\n * This module provides spacing options for paragraphs including space before,\n * space after, and line spacing.\n *\n * Reference: http://officeopenxml.com/WPspacing.php\n *\n * @module\n */\n\n/**\n * Line spacing rule types.\n *\n * Specifies how the line height is calculated.\n *\n * @publicApi\n */\nexport const LineRuleType = {\n /** Line spacing is at least the specified value */\n AT_LEAST: \"atLeast\",\n /** Line spacing is exactly the specified value */\n EXACTLY: \"exactly\",\n /** Line spacing is exactly the specified value (alias for EXACTLY) */\n EXACT: \"exact\",\n /** Line spacing is automatically determined based on content */\n AUTO: \"auto\",\n} as const;\n\n/**\n * Properties for configuring paragraph spacing.\n *\n * All values are in twips (twentieths of a point) unless otherwise specified.\n */\nexport interface SpacingProperties {\n /** Spacing after the paragraph in twips */\n after?: number;\n /** Spacing before the paragraph in twips */\n before?: number;\n /** Line spacing value in twips (interpretation depends on lineRule) */\n line?: number;\n /** How to interpret the line spacing value */\n lineRule?: (typeof LineRuleType)[keyof typeof LineRuleType];\n /** Use automatic spacing before the paragraph */\n beforeAutoSpacing?: boolean;\n /** Use automatic spacing after the paragraph */\n afterAutoSpacing?: boolean;\n /** Spacing before the paragraph in line units */\n beforeLines?: number;\n /** Spacing after the paragraph in line units */\n afterLines?: number;\n}\n","/**\n * Tab stop module for WordprocessingML documents.\n *\n * This module provides tab stop definitions for paragraphs.\n *\n * Reference: http://officeopenxml.com/WPtab.php\n *\n * @module\n */\n\n/**\n * Definition for a single tab stop.\n *\n * @see {@link TabStop}\n */\nexport interface TabStopDefinition {\n /** The type of tab stop alignment */\n type: (typeof TabStopType)[keyof typeof TabStopType];\n /** The position of the tab stop in twips */\n position: number | (typeof TabStopPosition)[keyof typeof TabStopPosition];\n /** Optional leader character to fill space before the tab */\n leader?: (typeof LeaderType)[keyof typeof LeaderType];\n}\n\n/**\n * Tab stop alignment types.\n *\n * Specifies the type of tab stop and how text aligns to it.\n *\n * @publicApi\n */\nexport const TabStopType = {\n /** Left-aligned tab stop */\n LEFT: \"left\",\n /** Right-aligned tab stop */\n RIGHT: \"right\",\n /** Center-aligned tab stop */\n CENTER: \"center\",\n /** Bar tab stop - inserts a vertical bar at the position */\n BAR: \"bar\",\n /** Clears a tab stop at the specified position */\n CLEAR: \"clear\",\n /** Decimal-aligned tab stop - aligns on decimal point */\n DECIMAL: \"decimal\",\n /** End-aligned tab stop (right-to-left equivalent) */\n END: \"end\",\n /** List tab stop for numbered lists */\n NUM: \"num\",\n /** Start-aligned tab stop (left-to-right equivalent) */\n START: \"start\",\n} as const;\n\n/**\n * Tab stop leader character types.\n *\n * Specifies the character used to fill the space before the tab stop.\n *\n * @publicApi\n */\nexport const LeaderType = {\n /** Dot leader (....) */\n DOT: \"dot\",\n /** Heavy leader */\n HEAVY: \"heavy\",\n /** Hyphen leader (----) */\n HYPHEN: \"hyphen\",\n /** Middle dot leader (····) */\n MIDDLE_DOT: \"middleDot\",\n /** No leader */\n NONE: \"none\",\n /** Underscore leader (____) */\n UNDERSCORE: \"underscore\",\n} as const;\n\n/**\n * Predefined tab stop positions.\n *\n * @publicApi\n */\nexport const TabStopPosition = {\n /** Maximum tab stop position (right margin) */\n MAX: 9026,\n} as const;\n","/**\n * Hyperlink types for WordprocessingML documents.\n *\n * @module\n */\n\n/**\n * Hyperlink type enumeration.\n * @publicApi\n */\nexport const HyperlinkType = {\n /** Internal hyperlink to a bookmark within the document */\n INTERNAL: \"INTERNAL\",\n /** External hyperlink to a URL outside the document */\n EXTERNAL: \"EXTERNAL\",\n} as const;\n\n/**\n * Options for creating an internal hyperlink.\n */\nexport interface InternalHyperlinkOptions {\n /** Name of the bookmark to link to within the document */\n anchor: string;\n /** Screen tip text shown when hovering over the hyperlink */\n tooltip?: string;\n}\n\n/**\n * Options for creating an external hyperlink.\n */\nexport interface ExternalHyperlinkOptions {\n /** URL to link to outside the document */\n link: string;\n /** Screen tip text shown when hovering over the hyperlink */\n tooltip?: string;\n /** Target frame for the hyperlink (e.g., \"_blank\", \"_self\") */\n tgtFrame?: string;\n}\n","/**\n * Numbered item reference module for WordprocessingML documents.\n *\n * This module provides cross-references to numbered items (such as\n * numbered paragraphs, list items, or headings) within a document.\n *\n * Reference: https://learn.microsoft.com/en-us/openspecs/office_standards/ms-oi29500/7088a8ce-e784-49d4-94b8-cba6ef8fce78\n *\n * @module\n */\n\n/**\n * Format options for numbered item references.\n *\n * Specifies how the paragraph number should be displayed when referenced.\n */\nexport enum NumberedItemReferenceFormat {\n NONE = \"none\",\n /**\n * \\r option - inserts the paragraph number of the bookmarked paragraph in relative context, or relative to its position in the numbering scheme\n */\n RELATIVE = \"relative\",\n /**\n * \\n option - causes the field result to be the paragraph number without trailing periods. No information about prior numbered levels is displayed unless it is included as part of the current level.\n */\n NO_CONTEXT = \"no_context\",\n /**\n * \\w option - causes the field result to be the entire paragraph number without trailing periods, regardless of the location of the REF field.\n */\n FULL_CONTEXT = \"full_context\",\n}\n\nexport interface NumberedItemReferenceOptions {\n /**\n * \\h option - Creates a hyperlink to the bookmarked paragraph.\n * @default true\n */\n hyperlink?: boolean;\n /**\n * Which switch to use for the reference format\n * @default NumberedItemReferenceFormat.FULL_CONTEXT\n */\n referenceFormat?: NumberedItemReferenceFormat;\n}\n","import type { HeightRule } from \"@parts/table\";\n/**\n * Frame properties module for paragraph text frames in WordprocessingML documents.\n *\n * Frames allow paragraphs to be positioned absolutely on the page, enabling text wrapping\n * and drop cap effects. They are commonly used for floating text boxes and decorative elements.\n *\n * Reference: http://officeopenxml.com/WPparagraph-textFrames.php\n *\n * @module\n */\nimport type { HorizontalPositionAlign, VerticalPositionAlign } from \"@shared/constants\";\n\n/**\n * Drop cap types for paragraph frames.\n */\nexport const DropCapType = {\n /** No drop cap effect */\n NONE: \"none\",\n /** Drop cap that drops down into the paragraph text */\n DROP: \"drop\",\n /** Drop cap that extends into the margin */\n MARGIN: \"margin\",\n} as const;\n\n/**\n * Frame anchor types specifying what the frame should be anchored relative to.\n */\nexport const FrameAnchorType = {\n /** Anchor relative to the page margin */\n MARGIN: \"margin\",\n /** Anchor relative to the page edge */\n PAGE: \"page\",\n /** Anchor relative to the text column */\n TEXT: \"text\",\n} as const;\n\n/**\n * Text wrapping types for frames.\n */\nexport const FrameWrap = {\n /** Wrap text around the frame on all sides */\n AROUND: \"around\",\n /** Automatic wrapping based on available space */\n AUTO: \"auto\",\n /** No text wrapping */\n NONE: \"none\",\n /** Do not allow text beside the frame */\n NOT_BESIDE: \"notBeside\",\n /** Allow text to flow through the frame */\n THROUGH: \"through\",\n /** Wrap text tightly around the frame */\n TIGHT: \"tight\",\n} as const;\n\n/**\n * Base options shared by all frame types.\n */\ninterface BaseFrameOptions {\n /** Lock the anchor position to prevent it from moving */\n anchorLock?: boolean;\n /** Drop cap effect type */\n dropCap?: (typeof DropCapType)[keyof typeof DropCapType];\n /** Frame width in twips */\n width: number;\n /** Frame height in twips */\n height: number;\n /** Text wrapping behavior around the frame */\n wrap?: (typeof FrameWrap)[keyof typeof FrameWrap];\n /** Number of lines for drop cap effect */\n lines?: number;\n /** Anchor reference points for horizontal and vertical positioning */\n anchor: {\n /** Horizontal anchor reference point */\n horizontal: (typeof FrameAnchorType)[keyof typeof FrameAnchorType];\n /** Vertical anchor reference point */\n vertical: (typeof FrameAnchorType)[keyof typeof FrameAnchorType];\n };\n /** Spacing between frame and surrounding text in twips */\n space?: {\n /** Horizontal spacing in twips */\n horizontal: number;\n /** Vertical spacing in twips */\n vertical: number;\n };\n /** Height rule determining how frame height is calculated */\n rule?: (typeof HeightRule)[keyof typeof HeightRule];\n}\n\n/**\n * Options for frames positioned using absolute X/Y coordinates.\n */\nexport type XYFrameOptions = {\n /** Must be \"absolute\" for coordinate-based positioning */\n type: \"absolute\";\n /** Absolute X and Y coordinates in twips */\n position: {\n /** Horizontal position in twips from the anchor point */\n x: number;\n /** Vertical position in twips from the anchor point */\n y: number;\n };\n} & BaseFrameOptions;\n\n/**\n * Options for frames positioned using alignment values.\n */\nexport type AlignmentFrameOptions = {\n /** Must be \"alignment\" for alignment-based positioning */\n type: \"alignment\";\n /** Horizontal and vertical alignment values */\n alignment: {\n /** Horizontal alignment relative to the anchor */\n x: (typeof HorizontalPositionAlign)[keyof typeof HorizontalPositionAlign];\n /** Vertical alignment relative to the anchor */\n y: (typeof VerticalPositionAlign)[keyof typeof VerticalPositionAlign];\n };\n} & BaseFrameOptions;\n\n/**\n * Union type for all frame positioning options.\n */\nexport type FrameOptions = XYFrameOptions | AlignmentFrameOptions;\n","/**\n * Table row height module for WordprocessingML documents.\n *\n * This module provides row height configuration including rules for how height should be applied.\n *\n * Reference: http://officeopenxml.com/WPtableRow.php\n *\n * @module\n */\n\n/**\n * Height rules for table rows.\n *\n * Specifies how the height value should be interpreted.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_HeightRule\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"auto\"/>\n * <xsd:enumeration value=\"exact\"/>\n * <xsd:enumeration value=\"atLeast\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const HeightRule = {\n /** Height is determined based on the content, so value is ignored. */\n AUTO: \"auto\",\n /** At least the value specified */\n ATLEAST: \"atLeast\",\n /** Exactly the value specified */\n EXACT: \"exact\",\n} as const;\n","/**\n * Footnote module for WordprocessingML documents.\n *\n * This module provides support for footnotes that appear at the bottom\n * of the page referenced from the main document text.\n *\n * Reference: http://officeopenxml.com/WPfootnotes.php\n *\n * @module\n */\nimport type { ParagraphOptions } from \"@parts/paragraph/paragraph\";\n\n/**\n * Enumeration of footnote types.\n *\n * Reference: http://officeopenxml.com/WPfootnotes.php\n *\n * @publicApi\n */\nexport const FootnoteType = {\n /** Separator line between body text and footnotes */\n SEPERATOR: \"separator\",\n /** Continuation separator for footnotes spanning pages */\n CONTINUATION_SEPERATOR: \"continuationSeparator\",\n} as const;\n\n/**\n * Options for creating a Footnote.\n *\n * @property id - Unique numeric identifier for this footnote\n * @property type - Type of footnote (separator, continuationSeparator, or normal)\n * @property children - Array of paragraphs that make up the footnote content\n *\n * @see {@link Footnote}\n */\nexport interface FootnoteOptions {\n /** Unique numeric identifier for this footnote */\n id: number;\n /** Type of footnote (separator or continuation separator) */\n type?: (typeof FootnoteType)[keyof typeof FootnoteType];\n /** Content of the footnote (paragraphs, tables, etc.) */\n children: (ParagraphOptions | string)[];\n}\n","/**\n * Endnote module for WordprocessingML documents.\n *\n * @module\n */\nimport type { ParagraphOptions } from \"@parts/paragraph/paragraph\";\n\nexport const EndnoteType = {\n CONTINUATION_SEPARATOR: \"continuationSeparator\",\n\n SEPARATOR: \"separator\",\n} as const;\n\nexport interface EndnoteOptions {\n id: number;\n type?: (typeof EndnoteType)[keyof typeof EndnoteType];\n children: (ParagraphOptions | string)[];\n}\n","/**\n * Shading module for WordprocessingML documents.\n *\n * Shading is used to apply background colors and patterns to paragraphs,\n * table cells, and text runs. The shading type is identical in all places.\n *\n * Reference: http://officeopenxml.com/WPshading.php\n *\n * @see http://officeopenxml.com/WPtableShading.php\n * @see http://officeopenxml.com/WPtableCellProperties-Shading.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Shd\">\n * <xsd:attribute name=\"val\" type=\"ST_Shd\" use=\"required\"/>\n * <xsd:attribute name=\"color\" type=\"ST_HexColor\" use=\"optional\"/>\n * <xsd:attribute name=\"themeColor\" type=\"ST_ThemeColor\" use=\"optional\"/>\n * <xsd:attribute name=\"themeTint\" type=\"ST_UcharHexNumber\" use=\"optional\"/>\n * <xsd:attribute name=\"themeShade\" type=\"ST_UcharHexNumber\" use=\"optional\"/>\n * <xsd:attribute name=\"fill\" type=\"ST_HexColor\" use=\"optional\"/>\n * <xsd:attribute name=\"themeFill\" type=\"ST_ThemeColor\" use=\"optional\"/>\n * <xsd:attribute name=\"themeFillTint\" type=\"ST_UcharHexNumber\" use=\"optional\"/>\n * <xsd:attribute name=\"themeFillShade\" type=\"ST_UcharHexNumber\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n *\n * @module\n */\nimport type { ThemeColor } from \"@office-open/core\";\n\n/**\n * Properties for configuring shading.\n *\n * @property fill - Background fill color in hex format (e.g., \"FF0000\" for red)\n * @property color - Pattern color in hex format\n * @property type - Shading pattern type\n */\nexport interface ShadingAttributesProperties {\n fill?: string;\n color?: string;\n type?: (typeof ShadingType)[keyof typeof ShadingType];\n /** Theme color reference */\n themeColor?: (typeof ThemeColor)[keyof typeof ThemeColor];\n /** Theme color tint (2-char hex) */\n themeTint?: string;\n /** Theme color shade (2-char hex) */\n themeShade?: string;\n /** Theme fill color reference */\n themeFill?: (typeof ThemeColor)[keyof typeof ThemeColor];\n /** Theme fill tint (2-char hex) */\n themeFillTint?: string;\n /** Theme fill shade (2-char hex) */\n themeFillShade?: string;\n}\n\n/**\n * Shading pattern types.\n *\n * Specifies the pattern used for shading. The pattern combines the fill\n * color and the pattern color.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_Shd\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"nil\"/>\n * <xsd:enumeration value=\"clear\"/>\n * <xsd:enumeration value=\"solid\"/>\n * <xsd:enumeration value=\"horzStripe\"/>\n * <xsd:enumeration value=\"vertStripe\"/>\n * <xsd:enumeration value=\"reverseDiagStripe\"/>\n * <xsd:enumeration value=\"diagStripe\"/>\n * <xsd:enumeration value=\"horzCross\"/>\n * <xsd:enumeration value=\"diagCross\"/>\n * <!-- ... percent values ... -->\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const ShadingType = {\n /** Clear shading - no pattern, fill color only */\n CLEAR: \"clear\",\n DIAGONAL_CROSS: \"diagCross\",\n DIAGONAL_STRIPE: \"diagStripe\",\n HORIZONTAL_CROSS: \"horzCross\",\n HORIZONTAL_STRIPE: \"horzStripe\",\n NIL: \"nil\",\n PERCENT_10: \"pct10\",\n PERCENT_12: \"pct12\",\n PERCENT_15: \"pct15\",\n PERCENT_20: \"pct20\",\n PERCENT_25: \"pct25\",\n PERCENT_30: \"pct30\",\n PERCENT_35: \"pct35\",\n PERCENT_37: \"pct37\",\n PERCENT_40: \"pct40\",\n PERCENT_45: \"pct45\",\n PERCENT_5: \"pct5\",\n PERCENT_50: \"pct50\",\n PERCENT_55: \"pct55\",\n PERCENT_60: \"pct60\",\n PERCENT_62: \"pct62\",\n PERCENT_65: \"pct65\",\n PERCENT_70: \"pct70\",\n PERCENT_75: \"pct75\",\n PERCENT_80: \"pct80\",\n PERCENT_85: \"pct85\",\n PERCENT_87: \"pct87\",\n PERCENT_90: \"pct90\",\n PERCENT_95: \"pct95\",\n REVERSE_DIAGONAL_STRIPE: \"reverseDiagStripe\",\n SOLID: \"solid\",\n THIN_DIAGONAL_CROSS: \"thinDiagCross\",\n THIN_DIAGONAL_STRIPE: \"thinDiagStripe\",\n THIN_HORIZONTAL_CROSS: \"thinHorzCross\",\n THIN_REVERSE_DIAGONAL_STRIPE: \"thinReverseDiagStripe\",\n THIN_VERTICAL_STRIPE: \"thinVertStripe\",\n VERTICAL_STRIPE: \"vertStripe\",\n} as const;\n","/**\n * Cell merge track revision component.\n *\n * @module\n */\n\nimport type { ChangedAttributesProperties } from \"../track-revision\";\n\n/**\n * Vertical merge revision types.\n */\nexport const VerticalMergeRevisionType = {\n /**\n * Cell that is merged with upper one.\n */\n CONTINUE: \"continue\",\n /**\n * Cell that is starting the vertical merge.\n */\n RESTART: \"restart\",\n} as const;\n\nexport type CellMergeAttributes = ChangedAttributesProperties & {\n verticalMerge?: (typeof VerticalMergeRevisionType)[keyof typeof VerticalMergeRevisionType];\n verticalMergeOriginal?: (typeof VerticalMergeRevisionType)[keyof typeof VerticalMergeRevisionType];\n};\n","/**\n * Vertical alignment module for WordprocessingML documents.\n *\n * This module provides vertical alignment options for table cells and sections.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_VerticalJc\">\n * <xsd:attribute name=\"val\" type=\"ST_VerticalJc\" use=\"required\"/>\n * </xsd:complexType>\n *\n * <xsd:simpleType name=\"ST_VerticalJc\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"both\"/>\n * <xsd:enumeration value=\"top\"/>\n * <xsd:enumeration value=\"center\"/>\n * <xsd:enumeration value=\"bottom\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @module\n */\n/**\n * Enumeration for table-cell vertical alignment. Only `top`, `center`, `bottom`\n * are valid according to ECMA-376 (§17.18.87 ST_VerticalJc within `<w:tcPr>`).\n *\n * @publicApi\n */\nexport const VerticalAlignTable = {\n BOTTOM: \"bottom\",\n CENTER: \"center\",\n TOP: \"top\",\n} as const;\n\n/**\n * Enumeration for section (<w:sectPr>) vertical alignment. Adds `both` on top of\n * the table-cell set (§17.18.87 ST_VerticalJc within <w:sectPr>).\n *\n * @publicApi\n */\nexport const VerticalAlignSection = {\n ...VerticalAlignTable,\n BOTH: \"both\",\n} as const;\n\nexport type TableVerticalAlign = (typeof VerticalAlignTable)[keyof typeof VerticalAlignTable];\n\nexport type SectionVerticalAlign = (typeof VerticalAlignSection)[keyof typeof VerticalAlignSection];\n\n/**\n * Creates a vertical alignment element in a WordprocessingML document.\n *\n * Used in table cells and sections to control vertical text positioning.\n *\n * @example\n * ```typescript\n * createVerticalAlign(VerticalAlignTable.CENTER);\n * ```\n */\nexport const createVerticalAlign = (value: TableVerticalAlign | SectionVerticalAlign): string =>\n `<w:vAlign w:val=\"${value}\"/>`;\n"],"mappings":";;;;;;;;;;;;;;;AAUA,MAAa,YAAY;;CAEvB,QAAQ;;CAER,MAAM;AACR;;;;;;;;;;;;;;;;;;;;ACGA,MAAa,eAAe;;CAE1B,UAAU;;CAEV,SAAS;;CAET,OAAO;;CAEP,MAAM;AACR;;;;;;;;;;ACIA,MAAa,cAAc;;CAEzB,MAAM;;CAEN,OAAO;;CAEP,QAAQ;;CAER,KAAK;;CAEL,OAAO;;CAEP,SAAS;;CAET,KAAK;;CAEL,KAAK;;CAEL,OAAO;AACT;;;;;;;;AASA,MAAa,aAAa;;CAExB,KAAK;;CAEL,OAAO;;CAEP,QAAQ;;CAER,YAAY;;CAEZ,MAAM;;CAEN,YAAY;AACd;;;;;;AAOA,MAAa,kBAAkB;;AAE7B,KAAK,KACP;;;;;;;;;;;;ACxEA,MAAa,gBAAgB;;CAE3B,UAAU;;CAEV,UAAU;AACZ;;;;;;;;;;;;;;;;;;ACCA,IAAY,8BAAL,yBAAA,6BAAA;CACL,4BAAA,UAAA;;;;CAIA,4BAAA,cAAA;;;;CAIA,4BAAA,gBAAA;;;;CAIA,4BAAA,kBAAA;;AACF,EAAA,CAAA,CAAA;;;;;;ACdA,MAAa,cAAc;;CAEzB,MAAM;;CAEN,MAAM;;CAEN,QAAQ;AACV;;;;AAKA,MAAa,kBAAkB;;CAE7B,QAAQ;;CAER,MAAM;;CAEN,MAAM;AACR;;;;AAKA,MAAa,YAAY;;CAEvB,QAAQ;;CAER,MAAM;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