ooxml.js 4.5.2 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{codec-CUdvXX8t.d.ts → codec-CR6QtZWA.d.ts} +2 -2
- package/dist/{codec-CbZEJgb3.d.cts → codec-mAL1djiN.d.cts} +2 -2
- package/dist/codec.d.cts +1 -1
- package/dist/codec.d.ts +1 -1
- package/dist/{document-package-kartHoyl.d.ts → document-package-BqYJqSDu.d.ts} +2 -1
- package/dist/{document-package-BDr3nkqJ.d.cts → document-package-Dcd0KSvQ.d.cts} +2 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/typed/document-package.cjs +2 -2
- package/dist/typed/document-package.d.cts +1 -1
- package/dist/typed/document-package.d.ts +1 -1
- package/dist/typed/document-package.js +2 -2
- package/dist/typed/docx/write.cjs +22 -9
- package/dist/typed/docx/write.d.cts +2 -2
- package/dist/typed/docx/write.d.ts +2 -2
- package/dist/typed/docx/write.js +22 -9
- package/dist/write-Dn_CL8qb.d.cts +17 -0
- package/dist/write-inqdKHR3.d.ts +17 -0
- package/package.json +1 -1
- package/dist/write-97yEqc6w.d.ts +0 -11
- package/dist/write-BFEF46Ir.d.cts +0 -11
package/README.md
CHANGED
|
@@ -297,7 +297,7 @@ The package layers a lossless core outward to lossy convenience views:
|
|
|
297
297
|
|
|
298
298
|
- **A `Content` suffix means the flat form, not a lesser one.** `readDocx` and `readDocxContent` are the same read; the suffix says which shape comes back (`DocumentPackage` versus the flat `DocxDocument`/`ContentDocument`), never which is more faithful. The pair that genuinely differs in what it reads is `readXlsxWorkbook`, whose name says so by naming its own return type rather than taking a suffix.
|
|
299
299
|
- **A construct marker brackets whole blocks, never a sub-sequence of runs.** A construct covering a sub-sequence of one paragraph's runs lands on that paragraph's `constructs` field as a run range (see the fidelity-constructs section above) — bookmarks, fields, internal links, comment extents, note references, and `w:ffData` form fields alike. An inline SDT or a few inserted words inside an otherwise untouched paragraph are still read exactly as before — the text survives, the construct does not — as is a bookmark whose two halves sit in different paragraphs. So does a block extent that crosses another, or that straddles a section break or table-cell boundary: neither is expressible as balanced brackets (nor as a tree group, which is what the marker pair promotes to), and both are dropped — a drop `document-schema.js`'s extent-scope note ratifies — rather than emitted at a position that would decode to a different nesting.
|
|
300
|
-
- **The docx pair round-trips `sections`, not a whole `DocxDocument`.** Numbering definitions, cell border styling/shading, section break kinds (`w:sectPr/w:type` onto `ContentSection.breakType`, both directions), and `w:themeColor` (without `themeShade`/`themeTint`) are read; images read into `ContentImageBlock` (floating `wp:anchor` position not recorded); `PAGE`/`NUMPAGES` fields resolve to Word's cached text. Headers and footers are read both as the flat per-part text arrays the reader always produced and structurally — each referenced part as block flow (`headerFooterParts`) plus per-section default/first/even references (`sectionHeaderFooters`); collapsing the flat arrays into that model wants a breaking change to a published shape and is tracked rather than taken. An inline `w:object`/`o:OLEObject` whose payload part is itself a ZIP archive — a modern producer's embedded xlsx/docx/pptx, detected by magic bytes through `archive-codec` — or a classic OLE compound-file `.bin` whose root storage carries the embedded file as an OLE-packaged `Package` stream, read through `archive-codec`'s bounded CFB reader, is decoded into a nested content document and emitted as a `ContentEmbeddedObjectBlock` beside its containing paragraph's own block, sized from `w:dxaOrig`/`w:dyaOrig`; the object's VML preview picture (`v:imagedata`) and a `w:object` inside a footnote (notes ride as text, with no block flow to lift an object into — a header/footer's own objects DO recover, those parts being walked as block flow) are not read, a compound file holding native legacy streams (BIFF and friends — no `Package` stream, or a packaged file that is not a ZIP) stays opaque, and a payload that does not decode as one of the three OOXML flavours (a plain archive, corrupt zip or compound-file data, a bodyless docx) degrades to no embedded block rather than failing the host read. The writer emits such a block back out as the inverse `w:object`/`o:OLEObject`: the nested document is re-serialised through its own format's builder into a fresh `word/embeddings/oleObject<N>.<docx|xlsx>` ZIP part carrying its relationship and content-type override, and `w:dxaOrig`/`w:dyaOrig` are derived from the block's frame (twips). An embedded presentation document has no
|
|
300
|
+
- **The docx pair round-trips `sections`, not a whole `DocxDocument`.** Numbering definitions, cell border styling/shading, section break kinds (`w:sectPr/w:type` onto `ContentSection.breakType`, both directions), and `w:themeColor` (without `themeShade`/`themeTint`) are read; images read into `ContentImageBlock` (floating `wp:anchor` position not recorded); `PAGE`/`NUMPAGES` fields resolve to Word's cached text. Headers and footers are read both as the flat per-part text arrays the reader always produced and structurally — each referenced part as block flow (`headerFooterParts`) plus per-section default/first/even references (`sectionHeaderFooters`); collapsing the flat arrays into that model wants a breaking change to a published shape and is tracked rather than taken. An inline `w:object`/`o:OLEObject` whose payload part is itself a ZIP archive — a modern producer's embedded xlsx/docx/pptx, detected by magic bytes through `archive-codec` — or a classic OLE compound-file `.bin` whose root storage carries the embedded file as an OLE-packaged `Package` stream, read through `archive-codec`'s bounded CFB reader, is decoded into a nested content document and emitted as a `ContentEmbeddedObjectBlock` beside its containing paragraph's own block, sized from `w:dxaOrig`/`w:dyaOrig`; the object's VML preview picture (`v:imagedata`) and a `w:object` inside a footnote (notes ride as text, with no block flow to lift an object into — a header/footer's own objects DO recover, those parts being walked as block flow) are not read, a compound file holding native legacy streams (BIFF and friends — no `Package` stream, or a packaged file that is not a ZIP) stays opaque, and a payload that does not decode as one of the three OOXML flavours (a plain archive, corrupt zip or compound-file data, a bodyless docx) degrades to no embedded block rather than failing the host read. The writer emits such a block back out as the inverse `w:object`/`o:OLEObject`: the nested document is re-serialised through its own format's builder into a fresh `word/embeddings/oleObject<N>.<docx|xlsx|pptx>` ZIP part carrying its relationship and content-type override, and `w:dxaOrig`/`w:dyaOrig` are derived from the block's frame (twips). An embedded presentation document serialises through an injected port — `BuildDocxContentOptions.serialiseEmbeddedPresentation`, a presentation `ContentDocument` → pptx-bytes function this package accepts because it has no PresentationML writer of its own, and the ecosystem's one pptx writer lives one layer up in documents.js (which exports `embeddedPresentationSerialiser`, wired from its own pptx builder, for exactly this call); with no serialiser injected, a `ContentDocument` carrying one is refused with a thrown error rather than a silent drop, and no VML preview picture is regenerated (the reader never read one into the model, and real previews are WMF/EMF this ecosystem has no writer for; Word shows a blank until activated). The writer emits no `styles.xml`, `numbering.xml`, comments, footnotes, endnotes, or headers/footers, so the `DocxDocument` fields outside `sections` do not come back — a paragraph's `styleId` is still written as a `w:pStyle` reference, resolving to nothing, since every property the style would have contributed is already spelled as direct formatting by then.
|
|
301
301
|
- **pptx is read-only.** Connector shapes (`p:cxnSp`) are skipped; shape rotation composes through groups; a dynamic field (`a:fld`, e.g. slidenum/datetime) reads as an ordinary run plus a `field` run construct carrying `@type` as the instruction and the cached `a:t` as the result; an internal slide-jump link (`a:hlinkClick` resolving to a slide relationship, no `TargetMode`) records a `link` run construct with an internal target naming the destination slide's package part path (e.g. `ppt/slides/slide2.xml` — PresentationML addresses slides by part relationship, never by name; the flat run's `hyperlink` field stays reserved for external URIs, and an action-only `ppaction://hlinkshowjump` names no target part and records nothing); a chart graphic frame reads its chart part's cached series/category model into a table block (header row = series names, one row per category index); a SmartArt graphic frame reads its diagram data model's node text as paragraphs in diagram order (depth-first over `parOf` connections, siblings by `srcOrd`); an OLE graphic frame reads the fallback picture its `mc:Fallback` carries (or, with none reachable, a paragraph naming the `p:oleObj`'s `progId`), and when the payload part is itself a ZIP archive — a modern producer's embedded xlsx/docx/pptx, detected by magic bytes through `archive-codec` — or a classic OLE compound-file `.bin` whose root storage carries the embedded file as an OLE-packaged `Package` stream, read through `archive-codec`'s bounded CFB reader, also decodes it into a nested content document and emits it as an `embeddedObject` block beside the picture, sized to the frame's own geometry; a compound file holding native legacy streams (no `Package` stream, or a packaged file that is not a ZIP) stays opaque external-application data, and a payload that does not decode as one of the three OOXML flavours degrades to no embedded block rather than failing the slide read.
|
|
302
302
|
- **xlsx has no native percentage/currency/date/time cell type.** Both directions are closed via the number-format engine: reading classifies style → format code → kind; writing emits interned `numFmt` codes, fed back through the classifier in tests. `displayText` is the typed-value spelling, not the producer's rendered string. A chart graphic frame reads as an embedded `chart` object (`embeddedObjects`, one row per series over the shared category axis, values verbatim `c:v` text, frame resolved through the sheet's own column widths and row heights), and a drawing picture (`xdr:pic`) as a `ContentSheetImage` (`images`, media bytes sniffed through the drawing part's relationships, frame resolved the same way) — one-way rows, since the writer emits no drawing part. A workbook's general defined names and table/List objects ride the tree reader's root `definitions` table (`readXlsx`), the landing the schema's own verdict gives a named range; the flat reader and the write pair carry neither. `dataValidation` and `conditionalFormatting` rules quarantine verbatim on their range's anchor cell through the residue channel, pending the corpus-gated vocabulary the construct inventory defers.
|
|
303
303
|
- **`test:smoke` depends on a fresh build.** It runs `tsdown && vitest run --project smoke`, always rebuilding `dist/` first. A bare `vitest` runs both projects; `smoke` fails loudly (`Cannot find module '../dist/index.js'`) if `dist/` is unbuilt.
|
|
@@ -9,9 +9,9 @@ import "./util-DFe4UbvU.js";
|
|
|
9
9
|
import "./compact-f0TfhicN.js";
|
|
10
10
|
import "./color-fFIKAs-Y.js";
|
|
11
11
|
import "./metadata-o_WH9V_I.js";
|
|
12
|
-
import "./
|
|
12
|
+
import "./write-inqdKHR3.js";
|
|
13
|
+
import "./document-package-BqYJqSDu.js";
|
|
13
14
|
import "./read-D30xHgEp.js";
|
|
14
|
-
import "./write-97yEqc6w.js";
|
|
15
15
|
import "./numbering-D0YfuiOO.js";
|
|
16
16
|
import "./read-ZWJPDvG-.js";
|
|
17
17
|
import "./xlsx-DacFqZeF.js";
|
|
@@ -9,9 +9,9 @@ import "./util-M3JJlDhF.cjs";
|
|
|
9
9
|
import "./compact-B1qg9oex.cjs";
|
|
10
10
|
import "./color-fFIKAs-Y.cjs";
|
|
11
11
|
import "./metadata-D6o-kLpg.cjs";
|
|
12
|
-
import "./
|
|
12
|
+
import "./write-Dn_CL8qb.cjs";
|
|
13
|
+
import "./document-package-Dcd0KSvQ.cjs";
|
|
13
14
|
import "./read-LTgVJIPU.cjs";
|
|
14
|
-
import "./write-BFEF46Ir.cjs";
|
|
15
15
|
import "./numbering-C53LT-Jx.cjs";
|
|
16
16
|
import "./read-BoV9SZy4.cjs";
|
|
17
17
|
import "./xlsx-CpX5nzGV.cjs";
|
package/dist/codec.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as xmlCodec, n as encodePackage, r as packageCodec, t as decodePackage } from "./codec-
|
|
1
|
+
import { i as xmlCodec, n as encodePackage, r as packageCodec, t as decodePackage } from "./codec-mAL1djiN.cjs";
|
|
2
2
|
export { decodePackage, encodePackage, packageCodec, xmlCodec };
|
package/dist/codec.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as xmlCodec, n as encodePackage, r as packageCodec, t as decodePackage } from "./codec-
|
|
1
|
+
import { i as xmlCodec, n as encodePackage, r as packageCodec, t as decodePackage } from "./codec-CR6QtZWA.js";
|
|
2
2
|
export { decodePackage, encodePackage, packageCodec, xmlCodec };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { r as Package } from "./package-BUojjTXf.js";
|
|
2
|
+
import { t as BuildDocxContentOptions } from "./write-inqdKHR3.js";
|
|
2
3
|
import { DocumentPackage } from "document-schema.js";
|
|
3
4
|
//#region src/typed/document-package.d.ts
|
|
4
5
|
declare function readDocx(pkg: Package): DocumentPackage;
|
|
5
|
-
declare function buildDocxPackage(document: DocumentPackage): Package;
|
|
6
|
+
declare function buildDocxPackage(document: DocumentPackage, options?: BuildDocxContentOptions): Package;
|
|
6
7
|
declare function readPptx(pkg: Package): DocumentPackage;
|
|
7
8
|
declare function readXlsx(pkg: Package): DocumentPackage;
|
|
8
9
|
declare function buildXlsxPackage(document: DocumentPackage): Package;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { r as Package } from "./package-L24lkba-.cjs";
|
|
2
|
+
import { t as BuildDocxContentOptions } from "./write-Dn_CL8qb.cjs";
|
|
2
3
|
import { DocumentPackage } from "document-schema.js";
|
|
3
4
|
//#region src/typed/document-package.d.ts
|
|
4
5
|
declare function readDocx(pkg: Package): DocumentPackage;
|
|
5
|
-
declare function buildDocxPackage(document: DocumentPackage): Package;
|
|
6
|
+
declare function buildDocxPackage(document: DocumentPackage, options?: BuildDocxContentOptions): Package;
|
|
6
7
|
declare function readPptx(pkg: Package): DocumentPackage;
|
|
7
8
|
declare function readXlsx(pkg: Package): DocumentPackage;
|
|
8
9
|
declare function buildXlsxPackage(document: DocumentPackage): Package;
|
package/dist/index.d.cts
CHANGED
|
@@ -13,13 +13,13 @@ import { _ as encodeCompactPackage, b as toCompact, c as CompactPart, f as Compa
|
|
|
13
13
|
import { n as applyColorTransforms, t as ColorTransform } from "./color-fFIKAs-Y.cjs";
|
|
14
14
|
import { n as DocumentMetadataSchema, t as DocumentMetadata } from "./metadata-D6o-kLpg.cjs";
|
|
15
15
|
import { n as sniffImageFormat, t as ImageFormat } from "./sniff-DjpnUZRp.cjs";
|
|
16
|
-
import {
|
|
16
|
+
import { i as buildDocxPackageFromContent, n as DocxContent, r as EmbeddedPresentationSerialiser, t as BuildDocxContentOptions } from "./write-Dn_CL8qb.cjs";
|
|
17
|
+
import { a as readXlsx, i as readPptx, n as buildXlsxPackage, r as readDocx, t as buildDocxPackage } from "./document-package-Dcd0KSvQ.cjs";
|
|
17
18
|
import { a as Footnote, d as readDocxContent, i as DocxDocumentSchema, n as CommentSchema, o as FootnoteSchema, r as DocxDocument, t as Comment } from "./read-LTgVJIPU.cjs";
|
|
18
|
-
import { n as buildDocxPackageFromContent, t as DocxContent } from "./write-BFEF46Ir.cjs";
|
|
19
19
|
import { a as NumberingLevelSchema, i as NumberingLevel, n as NumberingDefinitionSchema, o as readNumberingDefinitions, r as NumberingDefinitions, t as NumberingDefinition } from "./numbering-C53LT-Jx.cjs";
|
|
20
20
|
import { n as PptxDocumentSchema, r as readPptxContent, t as PptxDocument } from "./read-BoV9SZy4.cjs";
|
|
21
21
|
import { a as XlsxSheet, c as XlsxWorkbookSchema, i as XlsxCellSchema, l as readXlsxWorkbook, n as DefinedNameSchema, o as XlsxSheetSchema, r as XlsxCell, s as XlsxWorkbook, t as DefinedName } from "./xlsx-CpX5nzGV.cjs";
|
|
22
22
|
import { t as readXlsxContent } from "./content-C79O3esU.cjs";
|
|
23
23
|
import { t as buildXlsxPackageFromContent } from "./build-D-ldsmtA.cjs";
|
|
24
|
-
import { $ as ContentShapeSchema, $n as isHeadingGroupNode, $t as PackageChildren, A as ContentConstructStart, An as SlideDescriptor, At as DrawPageChild, B as ContentImageBlock, Bn as StylesTableSchema, Bt as LinkDescriptorSchema, C as ContentBorderSchema, Cn as ShapeDescriptor, Ct as ContentTableRow, D as ContentCellValueSchema, Dn as SheetDescriptor, Dt as DivisionDescriptorSchema, E as ContentCellValue, En as SheetChild, Et as DivisionDescriptor, F as ContentControlLockSchema, Fn as StyleParagraphProperties, Ft as FieldDescriptorSchema, G as ContentPageBreakSchema, Gn as decompose, Gt as ListGroupSchema, H as ContentListMembership, Hn as applyRunStyleProperties, Ht as LinkTargetSchema, I as ContentControlType, In as StyleParagraphPropertiesSchema, It as HeadingGroupNode, J as ContentRun, Jn as flattenPackage, Jt as MarginsSchema, K as ContentParagraph, Kn as factorStyles, Kt as ListParagraph, L as ContentControlTypeSchema, Ln as StyleRunProperties, Lt as HeadingGroupSchema, M as ContentControlDescriptor, Mn as SlideGroupSchema, Mt as DrawPageGroupNode, N as ContentControlDescriptorSchema, Nn as StyleEntry, Nt as DrawPageGroupSchema, O as ContentConstructEnd, On as SheetGroupNode, Ot as DocumentPackage, P as ContentControlLock, Pn as StyleEntrySchema, Pt as FieldDescriptor, Q as ContentShape, Qn as isDrawPageGroupNode, Qt as PackageBlockLeafSchema, R as ContentDocument, Rn as StyleRunPropertiesSchema, Rt as HeadingParagraph, S as ContentBorder, Sn as ShapeConstructGroupSchema, St as ContentTableCellSchema, T as ContentCellBordersSchema, Tn as ShapeGroupSchema, Tt as ContentTableSchema, U as ContentListMembershipSchema, Un as assemblePackage, Ut as ListChild, V as ContentImageBlockSchema, Vn as applyParagraphStyleProperties, Vt as LinkTarget, W as ContentPageBreak, Wn as colorToRgbHex, Wt as ListGroupNode, X as ContentSection, Xn as isContentConstructEnd, Xt as PAGE_SIZE_LETTER, Y as ContentRunSchema, Yn as isContentBlock, Yt as PAGE_SIZE_A4, Z as ContentSectionSchema, Zn as isContentConstructStart, Zt as PackageBlockLeaf, _ as ConstructDescriptorSchema, _n as SectionDescriptor, _t as ContentSlideSchema, a as Alignment, an as PackageNodeSchema, ar as isSectionConstructGroupNode, at as ContentSheetImage, b as ContentBlock, bn as ShapeChild, bt as ContentTable, c as AnchorDescriptorSchema, cn as ProvenanceChange, cr as isShapeGroupNode, ct as ContentSheetPrintRangeSchema, d as Box, dn as ProvenanceDescriptorSchema, dr as overlayStyleEntries, dt as ContentSheetRepeatRange, en as PackageGroup, er as isListGroupNode, et as ContentSheet, f as BoxSchema, fn as SLIDE_SIZE_STANDARD, fr as resolveStyleChain, ft as ContentSheetRepeatRangeSchema, g as ConstructDescriptor, gn as SectionConstructGroupSchema, gt as ContentSlide, h as ColorSchema, hn as SectionConstructGroupNode, ht as ContentSheetSchema, i as xmlCodec, in as PackageNode, ir as isPackageNode, it as ContentSheetColumnSchema, j as ContentConstructStartSchema, jn as SlideGroupNode, jt as DrawPageDescriptor, k as ContentConstructEndSchema, kn as SheetGroupSchema, kt as DocumentPackageSchema, l as AnchorType, ln as ProvenanceChangeSchema, lr as isSheetGroupNode, lt as ContentSheetPrintSettings, m as Color, mn as SectionChild, mt as ContentSheetRowSchema, n as encodePackage, nn as PackageLeaf, nr as isPackageGroup, nt as ContentSheetCellSchema, o as AlignmentSchema, on as PageSize, or as isSectionGroupNode, ot as ContentSheetImageSchema, p as COLOR_BLACK, pn as SLIDE_SIZE_WIDESCREEN, pr as rgbHexToColor, pt as ContentSheetRow, q as ContentParagraphSchema, qn as findConstructMarkerImbalance, qt as Margins, r as packageCodec, rn as PackageLeafSchema, rr as isPackageLeaf, rt as ContentSheetColumn, s as AnchorDescriptor, sn as PageSizeSchema, sr as isShapeConstructGroupNode, st as ContentSheetPrintRange, t as decodePackage, tn as PackageGroupSchema, tr as isPackageBlockLeaf, tt as ContentSheetCell, u as AnchorTypeSchema, un as ProvenanceDescriptor, ur as isSlideGroupNode, ut as ContentSheetPrintSettingsSchema, v as ConstructMarkerImbalance, vn as SectionGroupNode, vt as ContentStrokeStyle, w as ContentCellBorders, wn as ShapeGroupNode, wt as ContentTableRowSchema, x as ContentBlockSchema, xn as ShapeConstructGroupNode, xt as ContentTableCell, y as ConstructMarkerImbalanceError, yn as SectionGroupSchema, yt as ContentStrokeStyleSchema, z as ContentDocumentSchema, zn as StylesTable, zt as LinkDescriptor } from "./codec-
|
|
25
|
-
export { type Alignment, AlignmentSchema, type AnchorDescriptor, AnchorDescriptorSchema, type AnchorType, AnchorTypeSchema, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, BoxSchema, COLOR_BLACK, type Color, ColorSchema, type ColorTransform, type Comment, CommentSchema, type CompactAttrPairs, type CompactPackage, CompactPackageSchema, type CompactPart, CompactPartSchema, type CompactXmlNode, CompactXmlNodeSchema, type ConstructDescriptor, ConstructDescriptorSchema, type ConstructMarkerImbalance, ConstructMarkerImbalanceError, type ContentBlock, ContentBlockSchema, type ContentBorder, ContentBorderSchema, type ContentCellBorders, ContentCellBordersSchema, type ContentCellValue, ContentCellValueSchema, type ContentConstructEnd, ContentConstructEndSchema, type ContentConstructStart, ContentConstructStartSchema, type ContentControlDescriptor, ContentControlDescriptorSchema, type ContentControlLock, ContentControlLockSchema, type ContentControlType, ContentControlTypeSchema, type ContentDocument, ContentDocumentSchema, type ContentImageBlock, ContentImageBlockSchema, type ContentListMembership, ContentListMembershipSchema, type ContentPageBreak, ContentPageBreakSchema, type ContentParagraph, ContentParagraphSchema, type ContentRun, ContentRunSchema, type ContentSection, ContentSectionSchema, type ContentShape, ContentShapeSchema, type ContentSheet, type ContentSheetCell, ContentSheetCellSchema, type ContentSheetColumn, ContentSheetColumnSchema, type ContentSheetImage, ContentSheetImageSchema, type ContentSheetPrintRange, ContentSheetPrintRangeSchema, type ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, type ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, type ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, type ContentSlide, ContentSlideSchema, type ContentStrokeStyle, ContentStrokeStyleSchema, type ContentTable, type ContentTableCell, ContentTableCellSchema, type ContentTableRow, ContentTableRowSchema, ContentTableSchema, type DefinedName, DefinedNameSchema, type DivisionDescriptor, DivisionDescriptorSchema, type DocumentMetadata, DocumentMetadataSchema, type DocumentPackage, DocumentPackageSchema, type DocxContent, type DocxDocument, DocxDocumentSchema, type DrawPageChild, type DrawPageDescriptor, type DrawPageGroupNode, DrawPageGroupSchema, type FieldDescriptor, FieldDescriptorSchema, type Footnote, FootnoteSchema, type HeadingGroupNode, HeadingGroupSchema, type HeadingParagraph, type ImageFormat, type LinkDescriptor, LinkDescriptorSchema, type LinkTarget, LinkTargetSchema, type ListChild, type ListGroupNode, ListGroupSchema, type ListParagraph, type Margins, MarginsSchema, type NumberingDefinition, NumberingDefinitionSchema, type NumberingDefinitions, type NumberingLevel, NumberingLevelSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, type PackageBlockLeaf, PackageBlockLeafSchema, type PackageChildren, type PackageGroup, PackageGroupSchema, type PackageLeaf, PackageLeafSchema, type PackageNode, PackageNodeSchema, PackageSchema, type PageSize, PageSizeSchema, type Part, PartSchema, type PptxDocument, PptxDocumentSchema, type ProvenanceChange, ProvenanceChangeSchema, type ProvenanceDescriptor, ProvenanceDescriptorSchema, type Relationship, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type SectionChild, type SectionConstructGroupNode, SectionConstructGroupSchema, type SectionDescriptor, type SectionGroupNode, SectionGroupSchema, type ShapeChild, type ShapeConstructGroupNode, ShapeConstructGroupSchema, type ShapeDescriptor, type ShapeGroupNode, ShapeGroupSchema, type SheetChild, type SheetDescriptor, type SheetGroupNode, SheetGroupSchema, type SlideDescriptor, type SlideGroupNode, SlideGroupSchema, type StyleEntry, StyleEntrySchema, type StyleParagraphProperties, StyleParagraphPropertiesSchema, type StyleRunProperties, StyleRunPropertiesSchema, type StylesTable, StylesTableSchema, type XlsxCell, XlsxCellSchema, type XlsxSheet, XlsxSheetSchema, type XlsxWorkbook, XlsxWorkbookSchema, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, applyColorTransforms, applyParagraphStyleProperties, applyRunStyleProperties, assemblePackage, attr, base64ToBytes, buildDocxPackage, buildDocxPackageFromContent, buildXlsxPackage, buildXlsxPackageFromContent, buildXml, bytesToBase64, childrenWithTag, colorToRgbHex, compactCodec, compactPackageCodec, decodeCompactPackage, decodeEntities, decodePackage, decompose, el, elementsWithTag, encodeCompactPackage, encodePackage, encodeXmlText, factorStyles, findConstructMarkerImbalance, flattenPackage, fromCompact, isCompactXmlNode, isContentBlock, isContentConstructEnd, isContentConstructStart, isDrawPageGroupNode, isHeadingGroupNode, isListGroupNode, isPackageBlockLeaf, isPackageGroup, isPackageLeaf, isPackageNode, isSectionConstructGroupNode, isSectionGroupNode, isShapeConstructGroupNode, isShapeGroupNode, isSheetGroupNode, isSlideGroupNode, isXmlNode, overlayStyleEntries, packageCodec, parsePackage, parseXml, readDocx, readDocxContent, readNumberingDefinitions, readPptx, readPptxContent, readXlsx, readXlsxContent, readXlsxWorkbook, resolveRelationships, resolveStyleChain, rgbHexToColor, rootElement, serializePackage, sniffImageFormat, textContent, toCompact, txt, unzipPackage, walk, xmlCodec, zipPackage };
|
|
24
|
+
import { $ as ContentShapeSchema, $n as isHeadingGroupNode, $t as PackageChildren, A as ContentConstructStart, An as SlideDescriptor, At as DrawPageChild, B as ContentImageBlock, Bn as StylesTableSchema, Bt as LinkDescriptorSchema, C as ContentBorderSchema, Cn as ShapeDescriptor, Ct as ContentTableRow, D as ContentCellValueSchema, Dn as SheetDescriptor, Dt as DivisionDescriptorSchema, E as ContentCellValue, En as SheetChild, Et as DivisionDescriptor, F as ContentControlLockSchema, Fn as StyleParagraphProperties, Ft as FieldDescriptorSchema, G as ContentPageBreakSchema, Gn as decompose, Gt as ListGroupSchema, H as ContentListMembership, Hn as applyRunStyleProperties, Ht as LinkTargetSchema, I as ContentControlType, In as StyleParagraphPropertiesSchema, It as HeadingGroupNode, J as ContentRun, Jn as flattenPackage, Jt as MarginsSchema, K as ContentParagraph, Kn as factorStyles, Kt as ListParagraph, L as ContentControlTypeSchema, Ln as StyleRunProperties, Lt as HeadingGroupSchema, M as ContentControlDescriptor, Mn as SlideGroupSchema, Mt as DrawPageGroupNode, N as ContentControlDescriptorSchema, Nn as StyleEntry, Nt as DrawPageGroupSchema, O as ContentConstructEnd, On as SheetGroupNode, Ot as DocumentPackage, P as ContentControlLock, Pn as StyleEntrySchema, Pt as FieldDescriptor, Q as ContentShape, Qn as isDrawPageGroupNode, Qt as PackageBlockLeafSchema, R as ContentDocument, Rn as StyleRunPropertiesSchema, Rt as HeadingParagraph, S as ContentBorder, Sn as ShapeConstructGroupSchema, St as ContentTableCellSchema, T as ContentCellBordersSchema, Tn as ShapeGroupSchema, Tt as ContentTableSchema, U as ContentListMembershipSchema, Un as assemblePackage, Ut as ListChild, V as ContentImageBlockSchema, Vn as applyParagraphStyleProperties, Vt as LinkTarget, W as ContentPageBreak, Wn as colorToRgbHex, Wt as ListGroupNode, X as ContentSection, Xn as isContentConstructEnd, Xt as PAGE_SIZE_LETTER, Y as ContentRunSchema, Yn as isContentBlock, Yt as PAGE_SIZE_A4, Z as ContentSectionSchema, Zn as isContentConstructStart, Zt as PackageBlockLeaf, _ as ConstructDescriptorSchema, _n as SectionDescriptor, _t as ContentSlideSchema, a as Alignment, an as PackageNodeSchema, ar as isSectionConstructGroupNode, at as ContentSheetImage, b as ContentBlock, bn as ShapeChild, bt as ContentTable, c as AnchorDescriptorSchema, cn as ProvenanceChange, cr as isShapeGroupNode, ct as ContentSheetPrintRangeSchema, d as Box, dn as ProvenanceDescriptorSchema, dr as overlayStyleEntries, dt as ContentSheetRepeatRange, en as PackageGroup, er as isListGroupNode, et as ContentSheet, f as BoxSchema, fn as SLIDE_SIZE_STANDARD, fr as resolveStyleChain, ft as ContentSheetRepeatRangeSchema, g as ConstructDescriptor, gn as SectionConstructGroupSchema, gt as ContentSlide, h as ColorSchema, hn as SectionConstructGroupNode, ht as ContentSheetSchema, i as xmlCodec, in as PackageNode, ir as isPackageNode, it as ContentSheetColumnSchema, j as ContentConstructStartSchema, jn as SlideGroupNode, jt as DrawPageDescriptor, k as ContentConstructEndSchema, kn as SheetGroupSchema, kt as DocumentPackageSchema, l as AnchorType, ln as ProvenanceChangeSchema, lr as isSheetGroupNode, lt as ContentSheetPrintSettings, m as Color, mn as SectionChild, mt as ContentSheetRowSchema, n as encodePackage, nn as PackageLeaf, nr as isPackageGroup, nt as ContentSheetCellSchema, o as AlignmentSchema, on as PageSize, or as isSectionGroupNode, ot as ContentSheetImageSchema, p as COLOR_BLACK, pn as SLIDE_SIZE_WIDESCREEN, pr as rgbHexToColor, pt as ContentSheetRow, q as ContentParagraphSchema, qn as findConstructMarkerImbalance, qt as Margins, r as packageCodec, rn as PackageLeafSchema, rr as isPackageLeaf, rt as ContentSheetColumn, s as AnchorDescriptor, sn as PageSizeSchema, sr as isShapeConstructGroupNode, st as ContentSheetPrintRange, t as decodePackage, tn as PackageGroupSchema, tr as isPackageBlockLeaf, tt as ContentSheetCell, u as AnchorTypeSchema, un as ProvenanceDescriptor, ur as isSlideGroupNode, ut as ContentSheetPrintSettingsSchema, v as ConstructMarkerImbalance, vn as SectionGroupNode, vt as ContentStrokeStyle, w as ContentCellBorders, wn as ShapeGroupNode, wt as ContentTableRowSchema, x as ContentBlockSchema, xn as ShapeConstructGroupNode, xt as ContentTableCell, y as ConstructMarkerImbalanceError, yn as SectionGroupSchema, yt as ContentStrokeStyleSchema, z as ContentDocumentSchema, zn as StylesTable, zt as LinkDescriptor } from "./codec-mAL1djiN.cjs";
|
|
25
|
+
export { type Alignment, AlignmentSchema, type AnchorDescriptor, AnchorDescriptorSchema, type AnchorType, AnchorTypeSchema, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, BoxSchema, type BuildDocxContentOptions, COLOR_BLACK, type Color, ColorSchema, type ColorTransform, type Comment, CommentSchema, type CompactAttrPairs, type CompactPackage, CompactPackageSchema, type CompactPart, CompactPartSchema, type CompactXmlNode, CompactXmlNodeSchema, type ConstructDescriptor, ConstructDescriptorSchema, type ConstructMarkerImbalance, ConstructMarkerImbalanceError, type ContentBlock, ContentBlockSchema, type ContentBorder, ContentBorderSchema, type ContentCellBorders, ContentCellBordersSchema, type ContentCellValue, ContentCellValueSchema, type ContentConstructEnd, ContentConstructEndSchema, type ContentConstructStart, ContentConstructStartSchema, type ContentControlDescriptor, ContentControlDescriptorSchema, type ContentControlLock, ContentControlLockSchema, type ContentControlType, ContentControlTypeSchema, type ContentDocument, ContentDocumentSchema, type ContentImageBlock, ContentImageBlockSchema, type ContentListMembership, ContentListMembershipSchema, type ContentPageBreak, ContentPageBreakSchema, type ContentParagraph, ContentParagraphSchema, type ContentRun, ContentRunSchema, type ContentSection, ContentSectionSchema, type ContentShape, ContentShapeSchema, type ContentSheet, type ContentSheetCell, ContentSheetCellSchema, type ContentSheetColumn, ContentSheetColumnSchema, type ContentSheetImage, ContentSheetImageSchema, type ContentSheetPrintRange, ContentSheetPrintRangeSchema, type ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, type ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, type ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, type ContentSlide, ContentSlideSchema, type ContentStrokeStyle, ContentStrokeStyleSchema, type ContentTable, type ContentTableCell, ContentTableCellSchema, type ContentTableRow, ContentTableRowSchema, ContentTableSchema, type DefinedName, DefinedNameSchema, type DivisionDescriptor, DivisionDescriptorSchema, type DocumentMetadata, DocumentMetadataSchema, type DocumentPackage, DocumentPackageSchema, type DocxContent, type DocxDocument, DocxDocumentSchema, type DrawPageChild, type DrawPageDescriptor, type DrawPageGroupNode, DrawPageGroupSchema, type EmbeddedPresentationSerialiser, type FieldDescriptor, FieldDescriptorSchema, type Footnote, FootnoteSchema, type HeadingGroupNode, HeadingGroupSchema, type HeadingParagraph, type ImageFormat, type LinkDescriptor, LinkDescriptorSchema, type LinkTarget, LinkTargetSchema, type ListChild, type ListGroupNode, ListGroupSchema, type ListParagraph, type Margins, MarginsSchema, type NumberingDefinition, NumberingDefinitionSchema, type NumberingDefinitions, type NumberingLevel, NumberingLevelSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, type PackageBlockLeaf, PackageBlockLeafSchema, type PackageChildren, type PackageGroup, PackageGroupSchema, type PackageLeaf, PackageLeafSchema, type PackageNode, PackageNodeSchema, PackageSchema, type PageSize, PageSizeSchema, type Part, PartSchema, type PptxDocument, PptxDocumentSchema, type ProvenanceChange, ProvenanceChangeSchema, type ProvenanceDescriptor, ProvenanceDescriptorSchema, type Relationship, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type SectionChild, type SectionConstructGroupNode, SectionConstructGroupSchema, type SectionDescriptor, type SectionGroupNode, SectionGroupSchema, type ShapeChild, type ShapeConstructGroupNode, ShapeConstructGroupSchema, type ShapeDescriptor, type ShapeGroupNode, ShapeGroupSchema, type SheetChild, type SheetDescriptor, type SheetGroupNode, SheetGroupSchema, type SlideDescriptor, type SlideGroupNode, SlideGroupSchema, type StyleEntry, StyleEntrySchema, type StyleParagraphProperties, StyleParagraphPropertiesSchema, type StyleRunProperties, StyleRunPropertiesSchema, type StylesTable, StylesTableSchema, type XlsxCell, XlsxCellSchema, type XlsxSheet, XlsxSheetSchema, type XlsxWorkbook, XlsxWorkbookSchema, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, applyColorTransforms, applyParagraphStyleProperties, applyRunStyleProperties, assemblePackage, attr, base64ToBytes, buildDocxPackage, buildDocxPackageFromContent, buildXlsxPackage, buildXlsxPackageFromContent, buildXml, bytesToBase64, childrenWithTag, colorToRgbHex, compactCodec, compactPackageCodec, decodeCompactPackage, decodeEntities, decodePackage, decompose, el, elementsWithTag, encodeCompactPackage, encodePackage, encodeXmlText, factorStyles, findConstructMarkerImbalance, flattenPackage, fromCompact, isCompactXmlNode, isContentBlock, isContentConstructEnd, isContentConstructStart, isDrawPageGroupNode, isHeadingGroupNode, isListGroupNode, isPackageBlockLeaf, isPackageGroup, isPackageLeaf, isPackageNode, isSectionConstructGroupNode, isSectionGroupNode, isShapeConstructGroupNode, isShapeGroupNode, isSheetGroupNode, isSlideGroupNode, isXmlNode, overlayStyleEntries, packageCodec, parsePackage, parseXml, readDocx, readDocxContent, readNumberingDefinitions, readPptx, readPptxContent, readXlsx, readXlsxContent, readXlsxWorkbook, resolveRelationships, resolveStyleChain, rgbHexToColor, rootElement, serializePackage, sniffImageFormat, textContent, toCompact, txt, unzipPackage, walk, xmlCodec, zipPackage };
|
package/dist/index.d.ts
CHANGED
|
@@ -13,13 +13,13 @@ import { _ as encodeCompactPackage, b as toCompact, c as CompactPart, f as Compa
|
|
|
13
13
|
import { n as applyColorTransforms, t as ColorTransform } from "./color-fFIKAs-Y.js";
|
|
14
14
|
import { n as DocumentMetadataSchema, t as DocumentMetadata } from "./metadata-o_WH9V_I.js";
|
|
15
15
|
import { n as sniffImageFormat, t as ImageFormat } from "./sniff-DjpnUZRp.js";
|
|
16
|
-
import {
|
|
16
|
+
import { i as buildDocxPackageFromContent, n as DocxContent, r as EmbeddedPresentationSerialiser, t as BuildDocxContentOptions } from "./write-inqdKHR3.js";
|
|
17
|
+
import { a as readXlsx, i as readPptx, n as buildXlsxPackage, r as readDocx, t as buildDocxPackage } from "./document-package-BqYJqSDu.js";
|
|
17
18
|
import { a as Footnote, d as readDocxContent, i as DocxDocumentSchema, n as CommentSchema, o as FootnoteSchema, r as DocxDocument, t as Comment } from "./read-D30xHgEp.js";
|
|
18
|
-
import { n as buildDocxPackageFromContent, t as DocxContent } from "./write-97yEqc6w.js";
|
|
19
19
|
import { a as NumberingLevelSchema, i as NumberingLevel, n as NumberingDefinitionSchema, o as readNumberingDefinitions, r as NumberingDefinitions, t as NumberingDefinition } from "./numbering-D0YfuiOO.js";
|
|
20
20
|
import { n as PptxDocumentSchema, r as readPptxContent, t as PptxDocument } from "./read-ZWJPDvG-.js";
|
|
21
21
|
import { a as XlsxSheet, c as XlsxWorkbookSchema, i as XlsxCellSchema, l as readXlsxWorkbook, n as DefinedNameSchema, o as XlsxSheetSchema, r as XlsxCell, s as XlsxWorkbook, t as DefinedName } from "./xlsx-DacFqZeF.js";
|
|
22
22
|
import { t as readXlsxContent } from "./content-MEmp_Rlx.js";
|
|
23
23
|
import { t as buildXlsxPackageFromContent } from "./build-q0qMH_ML.js";
|
|
24
|
-
import { $ as ContentShapeSchema, $n as isHeadingGroupNode, $t as PackageChildren, A as ContentConstructStart, An as SlideDescriptor, At as DrawPageChild, B as ContentImageBlock, Bn as StylesTableSchema, Bt as LinkDescriptorSchema, C as ContentBorderSchema, Cn as ShapeDescriptor, Ct as ContentTableRow, D as ContentCellValueSchema, Dn as SheetDescriptor, Dt as DivisionDescriptorSchema, E as ContentCellValue, En as SheetChild, Et as DivisionDescriptor, F as ContentControlLockSchema, Fn as StyleParagraphProperties, Ft as FieldDescriptorSchema, G as ContentPageBreakSchema, Gn as decompose, Gt as ListGroupSchema, H as ContentListMembership, Hn as applyRunStyleProperties, Ht as LinkTargetSchema, I as ContentControlType, In as StyleParagraphPropertiesSchema, It as HeadingGroupNode, J as ContentRun, Jn as flattenPackage, Jt as MarginsSchema, K as ContentParagraph, Kn as factorStyles, Kt as ListParagraph, L as ContentControlTypeSchema, Ln as StyleRunProperties, Lt as HeadingGroupSchema, M as ContentControlDescriptor, Mn as SlideGroupSchema, Mt as DrawPageGroupNode, N as ContentControlDescriptorSchema, Nn as StyleEntry, Nt as DrawPageGroupSchema, O as ContentConstructEnd, On as SheetGroupNode, Ot as DocumentPackage, P as ContentControlLock, Pn as StyleEntrySchema, Pt as FieldDescriptor, Q as ContentShape, Qn as isDrawPageGroupNode, Qt as PackageBlockLeafSchema, R as ContentDocument, Rn as StyleRunPropertiesSchema, Rt as HeadingParagraph, S as ContentBorder, Sn as ShapeConstructGroupSchema, St as ContentTableCellSchema, T as ContentCellBordersSchema, Tn as ShapeGroupSchema, Tt as ContentTableSchema, U as ContentListMembershipSchema, Un as assemblePackage, Ut as ListChild, V as ContentImageBlockSchema, Vn as applyParagraphStyleProperties, Vt as LinkTarget, W as ContentPageBreak, Wn as colorToRgbHex, Wt as ListGroupNode, X as ContentSection, Xn as isContentConstructEnd, Xt as PAGE_SIZE_LETTER, Y as ContentRunSchema, Yn as isContentBlock, Yt as PAGE_SIZE_A4, Z as ContentSectionSchema, Zn as isContentConstructStart, Zt as PackageBlockLeaf, _ as ConstructDescriptorSchema, _n as SectionDescriptor, _t as ContentSlideSchema, a as Alignment, an as PackageNodeSchema, ar as isSectionConstructGroupNode, at as ContentSheetImage, b as ContentBlock, bn as ShapeChild, bt as ContentTable, c as AnchorDescriptorSchema, cn as ProvenanceChange, cr as isShapeGroupNode, ct as ContentSheetPrintRangeSchema, d as Box, dn as ProvenanceDescriptorSchema, dr as overlayStyleEntries, dt as ContentSheetRepeatRange, en as PackageGroup, er as isListGroupNode, et as ContentSheet, f as BoxSchema, fn as SLIDE_SIZE_STANDARD, fr as resolveStyleChain, ft as ContentSheetRepeatRangeSchema, g as ConstructDescriptor, gn as SectionConstructGroupSchema, gt as ContentSlide, h as ColorSchema, hn as SectionConstructGroupNode, ht as ContentSheetSchema, i as xmlCodec, in as PackageNode, ir as isPackageNode, it as ContentSheetColumnSchema, j as ContentConstructStartSchema, jn as SlideGroupNode, jt as DrawPageDescriptor, k as ContentConstructEndSchema, kn as SheetGroupSchema, kt as DocumentPackageSchema, l as AnchorType, ln as ProvenanceChangeSchema, lr as isSheetGroupNode, lt as ContentSheetPrintSettings, m as Color, mn as SectionChild, mt as ContentSheetRowSchema, n as encodePackage, nn as PackageLeaf, nr as isPackageGroup, nt as ContentSheetCellSchema, o as AlignmentSchema, on as PageSize, or as isSectionGroupNode, ot as ContentSheetImageSchema, p as COLOR_BLACK, pn as SLIDE_SIZE_WIDESCREEN, pr as rgbHexToColor, pt as ContentSheetRow, q as ContentParagraphSchema, qn as findConstructMarkerImbalance, qt as Margins, r as packageCodec, rn as PackageLeafSchema, rr as isPackageLeaf, rt as ContentSheetColumn, s as AnchorDescriptor, sn as PageSizeSchema, sr as isShapeConstructGroupNode, st as ContentSheetPrintRange, t as decodePackage, tn as PackageGroupSchema, tr as isPackageBlockLeaf, tt as ContentSheetCell, u as AnchorTypeSchema, un as ProvenanceDescriptor, ur as isSlideGroupNode, ut as ContentSheetPrintSettingsSchema, v as ConstructMarkerImbalance, vn as SectionGroupNode, vt as ContentStrokeStyle, w as ContentCellBorders, wn as ShapeGroupNode, wt as ContentTableRowSchema, x as ContentBlockSchema, xn as ShapeConstructGroupNode, xt as ContentTableCell, y as ConstructMarkerImbalanceError, yn as SectionGroupSchema, yt as ContentStrokeStyleSchema, z as ContentDocumentSchema, zn as StylesTable, zt as LinkDescriptor } from "./codec-
|
|
25
|
-
export { type Alignment, AlignmentSchema, type AnchorDescriptor, AnchorDescriptorSchema, type AnchorType, AnchorTypeSchema, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, BoxSchema, COLOR_BLACK, type Color, ColorSchema, type ColorTransform, type Comment, CommentSchema, type CompactAttrPairs, type CompactPackage, CompactPackageSchema, type CompactPart, CompactPartSchema, type CompactXmlNode, CompactXmlNodeSchema, type ConstructDescriptor, ConstructDescriptorSchema, type ConstructMarkerImbalance, ConstructMarkerImbalanceError, type ContentBlock, ContentBlockSchema, type ContentBorder, ContentBorderSchema, type ContentCellBorders, ContentCellBordersSchema, type ContentCellValue, ContentCellValueSchema, type ContentConstructEnd, ContentConstructEndSchema, type ContentConstructStart, ContentConstructStartSchema, type ContentControlDescriptor, ContentControlDescriptorSchema, type ContentControlLock, ContentControlLockSchema, type ContentControlType, ContentControlTypeSchema, type ContentDocument, ContentDocumentSchema, type ContentImageBlock, ContentImageBlockSchema, type ContentListMembership, ContentListMembershipSchema, type ContentPageBreak, ContentPageBreakSchema, type ContentParagraph, ContentParagraphSchema, type ContentRun, ContentRunSchema, type ContentSection, ContentSectionSchema, type ContentShape, ContentShapeSchema, type ContentSheet, type ContentSheetCell, ContentSheetCellSchema, type ContentSheetColumn, ContentSheetColumnSchema, type ContentSheetImage, ContentSheetImageSchema, type ContentSheetPrintRange, ContentSheetPrintRangeSchema, type ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, type ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, type ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, type ContentSlide, ContentSlideSchema, type ContentStrokeStyle, ContentStrokeStyleSchema, type ContentTable, type ContentTableCell, ContentTableCellSchema, type ContentTableRow, ContentTableRowSchema, ContentTableSchema, type DefinedName, DefinedNameSchema, type DivisionDescriptor, DivisionDescriptorSchema, type DocumentMetadata, DocumentMetadataSchema, type DocumentPackage, DocumentPackageSchema, type DocxContent, type DocxDocument, DocxDocumentSchema, type DrawPageChild, type DrawPageDescriptor, type DrawPageGroupNode, DrawPageGroupSchema, type FieldDescriptor, FieldDescriptorSchema, type Footnote, FootnoteSchema, type HeadingGroupNode, HeadingGroupSchema, type HeadingParagraph, type ImageFormat, type LinkDescriptor, LinkDescriptorSchema, type LinkTarget, LinkTargetSchema, type ListChild, type ListGroupNode, ListGroupSchema, type ListParagraph, type Margins, MarginsSchema, type NumberingDefinition, NumberingDefinitionSchema, type NumberingDefinitions, type NumberingLevel, NumberingLevelSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, type PackageBlockLeaf, PackageBlockLeafSchema, type PackageChildren, type PackageGroup, PackageGroupSchema, type PackageLeaf, PackageLeafSchema, type PackageNode, PackageNodeSchema, PackageSchema, type PageSize, PageSizeSchema, type Part, PartSchema, type PptxDocument, PptxDocumentSchema, type ProvenanceChange, ProvenanceChangeSchema, type ProvenanceDescriptor, ProvenanceDescriptorSchema, type Relationship, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type SectionChild, type SectionConstructGroupNode, SectionConstructGroupSchema, type SectionDescriptor, type SectionGroupNode, SectionGroupSchema, type ShapeChild, type ShapeConstructGroupNode, ShapeConstructGroupSchema, type ShapeDescriptor, type ShapeGroupNode, ShapeGroupSchema, type SheetChild, type SheetDescriptor, type SheetGroupNode, SheetGroupSchema, type SlideDescriptor, type SlideGroupNode, SlideGroupSchema, type StyleEntry, StyleEntrySchema, type StyleParagraphProperties, StyleParagraphPropertiesSchema, type StyleRunProperties, StyleRunPropertiesSchema, type StylesTable, StylesTableSchema, type XlsxCell, XlsxCellSchema, type XlsxSheet, XlsxSheetSchema, type XlsxWorkbook, XlsxWorkbookSchema, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, applyColorTransforms, applyParagraphStyleProperties, applyRunStyleProperties, assemblePackage, attr, base64ToBytes, buildDocxPackage, buildDocxPackageFromContent, buildXlsxPackage, buildXlsxPackageFromContent, buildXml, bytesToBase64, childrenWithTag, colorToRgbHex, compactCodec, compactPackageCodec, decodeCompactPackage, decodeEntities, decodePackage, decompose, el, elementsWithTag, encodeCompactPackage, encodePackage, encodeXmlText, factorStyles, findConstructMarkerImbalance, flattenPackage, fromCompact, isCompactXmlNode, isContentBlock, isContentConstructEnd, isContentConstructStart, isDrawPageGroupNode, isHeadingGroupNode, isListGroupNode, isPackageBlockLeaf, isPackageGroup, isPackageLeaf, isPackageNode, isSectionConstructGroupNode, isSectionGroupNode, isShapeConstructGroupNode, isShapeGroupNode, isSheetGroupNode, isSlideGroupNode, isXmlNode, overlayStyleEntries, packageCodec, parsePackage, parseXml, readDocx, readDocxContent, readNumberingDefinitions, readPptx, readPptxContent, readXlsx, readXlsxContent, readXlsxWorkbook, resolveRelationships, resolveStyleChain, rgbHexToColor, rootElement, serializePackage, sniffImageFormat, textContent, toCompact, txt, unzipPackage, walk, xmlCodec, zipPackage };
|
|
24
|
+
import { $ as ContentShapeSchema, $n as isHeadingGroupNode, $t as PackageChildren, A as ContentConstructStart, An as SlideDescriptor, At as DrawPageChild, B as ContentImageBlock, Bn as StylesTableSchema, Bt as LinkDescriptorSchema, C as ContentBorderSchema, Cn as ShapeDescriptor, Ct as ContentTableRow, D as ContentCellValueSchema, Dn as SheetDescriptor, Dt as DivisionDescriptorSchema, E as ContentCellValue, En as SheetChild, Et as DivisionDescriptor, F as ContentControlLockSchema, Fn as StyleParagraphProperties, Ft as FieldDescriptorSchema, G as ContentPageBreakSchema, Gn as decompose, Gt as ListGroupSchema, H as ContentListMembership, Hn as applyRunStyleProperties, Ht as LinkTargetSchema, I as ContentControlType, In as StyleParagraphPropertiesSchema, It as HeadingGroupNode, J as ContentRun, Jn as flattenPackage, Jt as MarginsSchema, K as ContentParagraph, Kn as factorStyles, Kt as ListParagraph, L as ContentControlTypeSchema, Ln as StyleRunProperties, Lt as HeadingGroupSchema, M as ContentControlDescriptor, Mn as SlideGroupSchema, Mt as DrawPageGroupNode, N as ContentControlDescriptorSchema, Nn as StyleEntry, Nt as DrawPageGroupSchema, O as ContentConstructEnd, On as SheetGroupNode, Ot as DocumentPackage, P as ContentControlLock, Pn as StyleEntrySchema, Pt as FieldDescriptor, Q as ContentShape, Qn as isDrawPageGroupNode, Qt as PackageBlockLeafSchema, R as ContentDocument, Rn as StyleRunPropertiesSchema, Rt as HeadingParagraph, S as ContentBorder, Sn as ShapeConstructGroupSchema, St as ContentTableCellSchema, T as ContentCellBordersSchema, Tn as ShapeGroupSchema, Tt as ContentTableSchema, U as ContentListMembershipSchema, Un as assemblePackage, Ut as ListChild, V as ContentImageBlockSchema, Vn as applyParagraphStyleProperties, Vt as LinkTarget, W as ContentPageBreak, Wn as colorToRgbHex, Wt as ListGroupNode, X as ContentSection, Xn as isContentConstructEnd, Xt as PAGE_SIZE_LETTER, Y as ContentRunSchema, Yn as isContentBlock, Yt as PAGE_SIZE_A4, Z as ContentSectionSchema, Zn as isContentConstructStart, Zt as PackageBlockLeaf, _ as ConstructDescriptorSchema, _n as SectionDescriptor, _t as ContentSlideSchema, a as Alignment, an as PackageNodeSchema, ar as isSectionConstructGroupNode, at as ContentSheetImage, b as ContentBlock, bn as ShapeChild, bt as ContentTable, c as AnchorDescriptorSchema, cn as ProvenanceChange, cr as isShapeGroupNode, ct as ContentSheetPrintRangeSchema, d as Box, dn as ProvenanceDescriptorSchema, dr as overlayStyleEntries, dt as ContentSheetRepeatRange, en as PackageGroup, er as isListGroupNode, et as ContentSheet, f as BoxSchema, fn as SLIDE_SIZE_STANDARD, fr as resolveStyleChain, ft as ContentSheetRepeatRangeSchema, g as ConstructDescriptor, gn as SectionConstructGroupSchema, gt as ContentSlide, h as ColorSchema, hn as SectionConstructGroupNode, ht as ContentSheetSchema, i as xmlCodec, in as PackageNode, ir as isPackageNode, it as ContentSheetColumnSchema, j as ContentConstructStartSchema, jn as SlideGroupNode, jt as DrawPageDescriptor, k as ContentConstructEndSchema, kn as SheetGroupSchema, kt as DocumentPackageSchema, l as AnchorType, ln as ProvenanceChangeSchema, lr as isSheetGroupNode, lt as ContentSheetPrintSettings, m as Color, mn as SectionChild, mt as ContentSheetRowSchema, n as encodePackage, nn as PackageLeaf, nr as isPackageGroup, nt as ContentSheetCellSchema, o as AlignmentSchema, on as PageSize, or as isSectionGroupNode, ot as ContentSheetImageSchema, p as COLOR_BLACK, pn as SLIDE_SIZE_WIDESCREEN, pr as rgbHexToColor, pt as ContentSheetRow, q as ContentParagraphSchema, qn as findConstructMarkerImbalance, qt as Margins, r as packageCodec, rn as PackageLeafSchema, rr as isPackageLeaf, rt as ContentSheetColumn, s as AnchorDescriptor, sn as PageSizeSchema, sr as isShapeConstructGroupNode, st as ContentSheetPrintRange, t as decodePackage, tn as PackageGroupSchema, tr as isPackageBlockLeaf, tt as ContentSheetCell, u as AnchorTypeSchema, un as ProvenanceDescriptor, ur as isSlideGroupNode, ut as ContentSheetPrintSettingsSchema, v as ConstructMarkerImbalance, vn as SectionGroupNode, vt as ContentStrokeStyle, w as ContentCellBorders, wn as ShapeGroupNode, wt as ContentTableRowSchema, x as ContentBlockSchema, xn as ShapeConstructGroupNode, xt as ContentTableCell, y as ConstructMarkerImbalanceError, yn as SectionGroupSchema, yt as ContentStrokeStyleSchema, z as ContentDocumentSchema, zn as StylesTable, zt as LinkDescriptor } from "./codec-CR6QtZWA.js";
|
|
25
|
+
export { type Alignment, AlignmentSchema, type AnchorDescriptor, AnchorDescriptorSchema, type AnchorType, AnchorTypeSchema, type Attribute, AttributeSchema, type BinaryPart, BinaryPartSchema, type Box, BoxSchema, type BuildDocxContentOptions, COLOR_BLACK, type Color, ColorSchema, type ColorTransform, type Comment, CommentSchema, type CompactAttrPairs, type CompactPackage, CompactPackageSchema, type CompactPart, CompactPartSchema, type CompactXmlNode, CompactXmlNodeSchema, type ConstructDescriptor, ConstructDescriptorSchema, type ConstructMarkerImbalance, ConstructMarkerImbalanceError, type ContentBlock, ContentBlockSchema, type ContentBorder, ContentBorderSchema, type ContentCellBorders, ContentCellBordersSchema, type ContentCellValue, ContentCellValueSchema, type ContentConstructEnd, ContentConstructEndSchema, type ContentConstructStart, ContentConstructStartSchema, type ContentControlDescriptor, ContentControlDescriptorSchema, type ContentControlLock, ContentControlLockSchema, type ContentControlType, ContentControlTypeSchema, type ContentDocument, ContentDocumentSchema, type ContentImageBlock, ContentImageBlockSchema, type ContentListMembership, ContentListMembershipSchema, type ContentPageBreak, ContentPageBreakSchema, type ContentParagraph, ContentParagraphSchema, type ContentRun, ContentRunSchema, type ContentSection, ContentSectionSchema, type ContentShape, ContentShapeSchema, type ContentSheet, type ContentSheetCell, ContentSheetCellSchema, type ContentSheetColumn, ContentSheetColumnSchema, type ContentSheetImage, ContentSheetImageSchema, type ContentSheetPrintRange, ContentSheetPrintRangeSchema, type ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, type ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, type ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, type ContentSlide, ContentSlideSchema, type ContentStrokeStyle, ContentStrokeStyleSchema, type ContentTable, type ContentTableCell, ContentTableCellSchema, type ContentTableRow, ContentTableRowSchema, ContentTableSchema, type DefinedName, DefinedNameSchema, type DivisionDescriptor, DivisionDescriptorSchema, type DocumentMetadata, DocumentMetadataSchema, type DocumentPackage, DocumentPackageSchema, type DocxContent, type DocxDocument, DocxDocumentSchema, type DrawPageChild, type DrawPageDescriptor, type DrawPageGroupNode, DrawPageGroupSchema, type EmbeddedPresentationSerialiser, type FieldDescriptor, FieldDescriptorSchema, type Footnote, FootnoteSchema, type HeadingGroupNode, HeadingGroupSchema, type HeadingParagraph, type ImageFormat, type LinkDescriptor, LinkDescriptorSchema, type LinkTarget, LinkTargetSchema, type ListChild, type ListGroupNode, ListGroupSchema, type ListParagraph, type Margins, MarginsSchema, type NumberingDefinition, NumberingDefinitionSchema, type NumberingDefinitions, type NumberingLevel, NumberingLevelSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, type Package, type PackageBlockLeaf, PackageBlockLeafSchema, type PackageChildren, type PackageGroup, PackageGroupSchema, type PackageLeaf, PackageLeafSchema, type PackageNode, PackageNodeSchema, PackageSchema, type PageSize, PageSizeSchema, type Part, PartSchema, type PptxDocument, PptxDocumentSchema, type ProvenanceChange, ProvenanceChangeSchema, type ProvenanceDescriptor, ProvenanceDescriptorSchema, type Relationship, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, type SectionChild, type SectionConstructGroupNode, SectionConstructGroupSchema, type SectionDescriptor, type SectionGroupNode, SectionGroupSchema, type ShapeChild, type ShapeConstructGroupNode, ShapeConstructGroupSchema, type ShapeDescriptor, type ShapeGroupNode, ShapeGroupSchema, type SheetChild, type SheetDescriptor, type SheetGroupNode, SheetGroupSchema, type SlideDescriptor, type SlideGroupNode, SlideGroupSchema, type StyleEntry, StyleEntrySchema, type StyleParagraphProperties, StyleParagraphPropertiesSchema, type StyleRunProperties, StyleRunPropertiesSchema, type StylesTable, StylesTableSchema, type XlsxCell, XlsxCellSchema, type XlsxSheet, XlsxSheetSchema, type XlsxWorkbook, XlsxWorkbookSchema, type XmlCdata, XmlCdataSchema, type XmlComment, XmlCommentSchema, type XmlDeclaration, XmlDeclarationSchema, type XmlElement, XmlElementSchema, type XmlNode, XmlNodeSchema, type XmlPart, XmlPartSchema, type XmlPi, XmlPiSchema, type XmlText, XmlTextSchema, applyColorTransforms, applyParagraphStyleProperties, applyRunStyleProperties, assemblePackage, attr, base64ToBytes, buildDocxPackage, buildDocxPackageFromContent, buildXlsxPackage, buildXlsxPackageFromContent, buildXml, bytesToBase64, childrenWithTag, colorToRgbHex, compactCodec, compactPackageCodec, decodeCompactPackage, decodeEntities, decodePackage, decompose, el, elementsWithTag, encodeCompactPackage, encodePackage, encodeXmlText, factorStyles, findConstructMarkerImbalance, flattenPackage, fromCompact, isCompactXmlNode, isContentBlock, isContentConstructEnd, isContentConstructStart, isDrawPageGroupNode, isHeadingGroupNode, isListGroupNode, isPackageBlockLeaf, isPackageGroup, isPackageLeaf, isPackageNode, isSectionConstructGroupNode, isSectionGroupNode, isShapeConstructGroupNode, isShapeGroupNode, isSheetGroupNode, isSlideGroupNode, isXmlNode, overlayStyleEntries, packageCodec, parsePackage, parseXml, readDocx, readDocxContent, readNumberingDefinitions, readPptx, readPptxContent, readXlsx, readXlsxContent, readXlsxWorkbook, resolveRelationships, resolveStyleChain, rgbHexToColor, rootElement, serializePackage, sniffImageFormat, textContent, toCompact, txt, unzipPackage, walk, xmlCodec, zipPackage };
|
|
@@ -14,10 +14,10 @@ function readDocx(pkg) {
|
|
|
14
14
|
sections
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
-
function buildDocxPackage(document) {
|
|
17
|
+
function buildDocxPackage(document, options) {
|
|
18
18
|
const content = (0, document_schema_js.flattenPackage)(document);
|
|
19
19
|
if (content.kind !== "wordprocessing") throw new Error(`buildDocxPackage: expected a DocumentPackage of kind "wordprocessing", got "${content.kind}"`);
|
|
20
|
-
return require_typed_docx_write.buildDocxPackageFromContent(content);
|
|
20
|
+
return require_typed_docx_write.buildDocxPackageFromContent(content, options);
|
|
21
21
|
}
|
|
22
22
|
function readPptx(pkg) {
|
|
23
23
|
const { metadata, slides } = require_read.readPptxContent(pkg);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as readXlsx, i as readPptx, n as buildXlsxPackage, r as readDocx, t as buildDocxPackage } from "../document-package-
|
|
1
|
+
import { a as readXlsx, i as readPptx, n as buildXlsxPackage, r as readDocx, t as buildDocxPackage } from "../document-package-Dcd0KSvQ.cjs";
|
|
2
2
|
export { buildDocxPackage, buildXlsxPackage, readDocx, readPptx, readXlsx };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as readXlsx, i as readPptx, n as buildXlsxPackage, r as readDocx, t as buildDocxPackage } from "../document-package-
|
|
1
|
+
import { a as readXlsx, i as readPptx, n as buildXlsxPackage, r as readDocx, t as buildDocxPackage } from "../document-package-BqYJqSDu.js";
|
|
2
2
|
export { buildDocxPackage, buildXlsxPackage, readDocx, readPptx, readXlsx };
|
|
@@ -13,10 +13,10 @@ function readDocx(pkg) {
|
|
|
13
13
|
sections
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
-
function buildDocxPackage(document) {
|
|
16
|
+
function buildDocxPackage(document, options) {
|
|
17
17
|
const content = flattenPackage(document);
|
|
18
18
|
if (content.kind !== "wordprocessing") throw new Error(`buildDocxPackage: expected a DocumentPackage of kind "wordprocessing", got "${content.kind}"`);
|
|
19
|
-
return buildDocxPackageFromContent(content);
|
|
19
|
+
return buildDocxPackageFromContent(content, options);
|
|
20
20
|
}
|
|
21
21
|
function readPptx(pkg) {
|
|
22
22
|
const { metadata, slides } = readPptxContent(pkg);
|
|
@@ -28,8 +28,11 @@ const VML_OFFICE_NS = "urn:schemas-microsoft-com:office:office";
|
|
|
28
28
|
const CT_DOCUMENT = "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml";
|
|
29
29
|
const CT_CORE_PROPS = "application/vnd.openxmlformats-package.core-properties+xml";
|
|
30
30
|
const CT_EXTENDED_PROPS = "application/vnd.openxmlformats-officedocument.extended-properties+xml";
|
|
31
|
-
const
|
|
32
|
-
|
|
31
|
+
const EMBEDDED_PART_CONTENT_TYPES = {
|
|
32
|
+
docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
33
|
+
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
34
|
+
pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
35
|
+
};
|
|
33
36
|
const REL_OFFICE_DOCUMENT = `${REL_NS}/officeDocument`;
|
|
34
37
|
const REL_CORE_PROPS = `${PKG_RELS_NS}/metadata/core-properties`;
|
|
35
38
|
const REL_EXTENDED_PROPS = `${REL_NS}/extended-properties`;
|
|
@@ -37,7 +40,7 @@ const REL_HYPERLINK = `${REL_NS}/hyperlink`;
|
|
|
37
40
|
const REL_IMAGE = `${REL_NS}/image`;
|
|
38
41
|
const REL_OLE_OBJECT = `${REL_NS}/oleObject`;
|
|
39
42
|
const DOCUMENT_PART_PATH = "word/document.xml";
|
|
40
|
-
function newWriteState() {
|
|
43
|
+
function newWriteState(options) {
|
|
41
44
|
return {
|
|
42
45
|
relationships: [],
|
|
43
46
|
hyperlinkIds: /* @__PURE__ */ new Map(),
|
|
@@ -45,6 +48,7 @@ function newWriteState() {
|
|
|
45
48
|
mediaParts: /* @__PURE__ */ new Map(),
|
|
46
49
|
embeddingIds: /* @__PURE__ */ new Map(),
|
|
47
50
|
embeddingParts: /* @__PURE__ */ new Map(),
|
|
51
|
+
serialiseEmbeddedPresentation: options?.serialiseEmbeddedPresentation,
|
|
48
52
|
nextDrawingId: 1,
|
|
49
53
|
nextMarkerId: 1
|
|
50
54
|
};
|
|
@@ -409,7 +413,7 @@ function buildDrawing(image, state) {
|
|
|
409
413
|
require_xml_fragment.el("a:graphic", { "xmlns:a": DRAWINGML_NS }, [require_xml_fragment.el("a:graphicData", { uri: DRAWING_PIC_NS }, [picture])])
|
|
410
414
|
])]);
|
|
411
415
|
}
|
|
412
|
-
function embeddedPayloadOf(document) {
|
|
416
|
+
function embeddedPayloadOf(document, state) {
|
|
413
417
|
switch (document.kind) {
|
|
414
418
|
case "wordprocessing": return {
|
|
415
419
|
extension: "docx",
|
|
@@ -421,7 +425,16 @@ function embeddedPayloadOf(document) {
|
|
|
421
425
|
progId: "Excel.Sheet.12",
|
|
422
426
|
base64: require_util_base64.bytesToBase64(require_codec.encodePackage(require_typed_xlsx_build.buildXlsxPackageFromContent(document)))
|
|
423
427
|
};
|
|
424
|
-
|
|
428
|
+
case "presentation": {
|
|
429
|
+
const serialise = state.serialiseEmbeddedPresentation;
|
|
430
|
+
if (serialise === void 0) throw new Error("buildDocxPackageFromContent: an embedded object carrying a presentation document has no serialiser (this package has no PresentationML writer; pass options.serialiseEmbeddedPresentation -- documents.js wires one from its own pptx builder)");
|
|
431
|
+
return {
|
|
432
|
+
extension: "pptx",
|
|
433
|
+
progId: "PowerPoint.Show.12",
|
|
434
|
+
base64: require_util_base64.bytesToBase64(serialise(document))
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
default: throw new Error(`buildDocxPackageFromContent: an embedded object carrying a ${document.kind} document has no OOXML OLE payload this writer can produce (embedded wordprocessing and spreadsheet documents serialise through their own builders, a presentation through options.serialiseEmbeddedPresentation, and drawing/formula are ODF/MathML spellings)`);
|
|
425
438
|
}
|
|
426
439
|
}
|
|
427
440
|
function embeddedObjectRelationshipId(state, payload) {
|
|
@@ -434,7 +447,7 @@ function embeddedObjectRelationshipId(state, payload) {
|
|
|
434
447
|
return id;
|
|
435
448
|
}
|
|
436
449
|
function buildObjectElement(block, state) {
|
|
437
|
-
const payload = embeddedPayloadOf(block.document);
|
|
450
|
+
const payload = embeddedPayloadOf(block.document, state);
|
|
438
451
|
const relId = embeddedObjectRelationshipId(state, payload);
|
|
439
452
|
return require_xml_fragment.el("w:object", {
|
|
440
453
|
"w:dxaOrig": String(require_typed_shared_units.ptToTwips(block.frame.widthPt)),
|
|
@@ -770,7 +783,7 @@ function buildContentTypesPart(state) {
|
|
|
770
783
|
}));
|
|
771
784
|
const embeddingOverrides = [...state.embeddingParts].map(([name, payload]) => require_xml_fragment.el("Override", {
|
|
772
785
|
PartName: `/word/embeddings/${name}`,
|
|
773
|
-
ContentType: payload.extension
|
|
786
|
+
ContentType: EMBEDDED_PART_CONTENT_TYPES[payload.extension]
|
|
774
787
|
}));
|
|
775
788
|
return xmlPart(require_xml_fragment.el("Types", { xmlns: CONTENT_TYPES_NS }, [
|
|
776
789
|
...defaults,
|
|
@@ -841,8 +854,8 @@ function buildExtendedPropertiesPart(metadata) {
|
|
|
841
854
|
if (metadata.creator !== void 0) children.push(require_xml_fragment.el("Application", {}, [require_xml_fragment.txt(require_xml_entities.encodeXmlText(metadata.creator))]));
|
|
842
855
|
return xmlPart(require_xml_fragment.el("Properties", { xmlns: EXTENDED_PROPS_NS }, children));
|
|
843
856
|
}
|
|
844
|
-
function buildDocxPackageFromContent(content) {
|
|
845
|
-
const state = newWriteState();
|
|
857
|
+
function buildDocxPackageFromContent(content, options) {
|
|
858
|
+
const state = newWriteState(options);
|
|
846
859
|
const documentPart = buildDocumentPart(content.sections.length === 0 ? [{
|
|
847
860
|
pageSize: {
|
|
848
861
|
widthPt: 612,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { DocxContent, buildDocxPackageFromContent };
|
|
1
|
+
import { i as buildDocxPackageFromContent, n as DocxContent, r as EmbeddedPresentationSerialiser, t as BuildDocxContentOptions } from "../../write-Dn_CL8qb.cjs";
|
|
2
|
+
export { BuildDocxContentOptions, DocxContent, EmbeddedPresentationSerialiser, buildDocxPackageFromContent };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { DocxContent, buildDocxPackageFromContent };
|
|
1
|
+
import { i as buildDocxPackageFromContent, n as DocxContent, r as EmbeddedPresentationSerialiser, t as BuildDocxContentOptions } from "../../write-inqdKHR3.js";
|
|
2
|
+
export { BuildDocxContentOptions, DocxContent, EmbeddedPresentationSerialiser, buildDocxPackageFromContent };
|
package/dist/typed/docx/write.js
CHANGED
|
@@ -27,8 +27,11 @@ const VML_OFFICE_NS = "urn:schemas-microsoft-com:office:office";
|
|
|
27
27
|
const CT_DOCUMENT = "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml";
|
|
28
28
|
const CT_CORE_PROPS = "application/vnd.openxmlformats-package.core-properties+xml";
|
|
29
29
|
const CT_EXTENDED_PROPS = "application/vnd.openxmlformats-officedocument.extended-properties+xml";
|
|
30
|
-
const
|
|
31
|
-
|
|
30
|
+
const EMBEDDED_PART_CONTENT_TYPES = {
|
|
31
|
+
docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
32
|
+
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
33
|
+
pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
34
|
+
};
|
|
32
35
|
const REL_OFFICE_DOCUMENT = `${REL_NS}/officeDocument`;
|
|
33
36
|
const REL_CORE_PROPS = `${PKG_RELS_NS}/metadata/core-properties`;
|
|
34
37
|
const REL_EXTENDED_PROPS = `${REL_NS}/extended-properties`;
|
|
@@ -36,7 +39,7 @@ const REL_HYPERLINK = `${REL_NS}/hyperlink`;
|
|
|
36
39
|
const REL_IMAGE = `${REL_NS}/image`;
|
|
37
40
|
const REL_OLE_OBJECT = `${REL_NS}/oleObject`;
|
|
38
41
|
const DOCUMENT_PART_PATH = "word/document.xml";
|
|
39
|
-
function newWriteState() {
|
|
42
|
+
function newWriteState(options) {
|
|
40
43
|
return {
|
|
41
44
|
relationships: [],
|
|
42
45
|
hyperlinkIds: /* @__PURE__ */ new Map(),
|
|
@@ -44,6 +47,7 @@ function newWriteState() {
|
|
|
44
47
|
mediaParts: /* @__PURE__ */ new Map(),
|
|
45
48
|
embeddingIds: /* @__PURE__ */ new Map(),
|
|
46
49
|
embeddingParts: /* @__PURE__ */ new Map(),
|
|
50
|
+
serialiseEmbeddedPresentation: options?.serialiseEmbeddedPresentation,
|
|
47
51
|
nextDrawingId: 1,
|
|
48
52
|
nextMarkerId: 1
|
|
49
53
|
};
|
|
@@ -408,7 +412,7 @@ function buildDrawing(image, state) {
|
|
|
408
412
|
el("a:graphic", { "xmlns:a": DRAWINGML_NS }, [el("a:graphicData", { uri: DRAWING_PIC_NS }, [picture])])
|
|
409
413
|
])]);
|
|
410
414
|
}
|
|
411
|
-
function embeddedPayloadOf(document) {
|
|
415
|
+
function embeddedPayloadOf(document, state) {
|
|
412
416
|
switch (document.kind) {
|
|
413
417
|
case "wordprocessing": return {
|
|
414
418
|
extension: "docx",
|
|
@@ -420,7 +424,16 @@ function embeddedPayloadOf(document) {
|
|
|
420
424
|
progId: "Excel.Sheet.12",
|
|
421
425
|
base64: bytesToBase64(encodePackage(buildXlsxPackageFromContent(document)))
|
|
422
426
|
};
|
|
423
|
-
|
|
427
|
+
case "presentation": {
|
|
428
|
+
const serialise = state.serialiseEmbeddedPresentation;
|
|
429
|
+
if (serialise === void 0) throw new Error("buildDocxPackageFromContent: an embedded object carrying a presentation document has no serialiser (this package has no PresentationML writer; pass options.serialiseEmbeddedPresentation -- documents.js wires one from its own pptx builder)");
|
|
430
|
+
return {
|
|
431
|
+
extension: "pptx",
|
|
432
|
+
progId: "PowerPoint.Show.12",
|
|
433
|
+
base64: bytesToBase64(serialise(document))
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
default: throw new Error(`buildDocxPackageFromContent: an embedded object carrying a ${document.kind} document has no OOXML OLE payload this writer can produce (embedded wordprocessing and spreadsheet documents serialise through their own builders, a presentation through options.serialiseEmbeddedPresentation, and drawing/formula are ODF/MathML spellings)`);
|
|
424
437
|
}
|
|
425
438
|
}
|
|
426
439
|
function embeddedObjectRelationshipId(state, payload) {
|
|
@@ -433,7 +446,7 @@ function embeddedObjectRelationshipId(state, payload) {
|
|
|
433
446
|
return id;
|
|
434
447
|
}
|
|
435
448
|
function buildObjectElement(block, state) {
|
|
436
|
-
const payload = embeddedPayloadOf(block.document);
|
|
449
|
+
const payload = embeddedPayloadOf(block.document, state);
|
|
437
450
|
const relId = embeddedObjectRelationshipId(state, payload);
|
|
438
451
|
return el("w:object", {
|
|
439
452
|
"w:dxaOrig": String(ptToTwips(block.frame.widthPt)),
|
|
@@ -769,7 +782,7 @@ function buildContentTypesPart(state) {
|
|
|
769
782
|
}));
|
|
770
783
|
const embeddingOverrides = [...state.embeddingParts].map(([name, payload]) => el("Override", {
|
|
771
784
|
PartName: `/word/embeddings/${name}`,
|
|
772
|
-
ContentType: payload.extension
|
|
785
|
+
ContentType: EMBEDDED_PART_CONTENT_TYPES[payload.extension]
|
|
773
786
|
}));
|
|
774
787
|
return xmlPart(el("Types", { xmlns: CONTENT_TYPES_NS }, [
|
|
775
788
|
...defaults,
|
|
@@ -840,8 +853,8 @@ function buildExtendedPropertiesPart(metadata) {
|
|
|
840
853
|
if (metadata.creator !== void 0) children.push(el("Application", {}, [txt(encodeXmlText(metadata.creator))]));
|
|
841
854
|
return xmlPart(el("Properties", { xmlns: EXTENDED_PROPS_NS }, children));
|
|
842
855
|
}
|
|
843
|
-
function buildDocxPackageFromContent(content) {
|
|
844
|
-
const state = newWriteState();
|
|
856
|
+
function buildDocxPackageFromContent(content, options) {
|
|
857
|
+
const state = newWriteState(options);
|
|
845
858
|
const documentPart = buildDocumentPart(content.sections.length === 0 ? [{
|
|
846
859
|
pageSize: {
|
|
847
860
|
widthPt: 612,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { r as Package } from "./package-L24lkba-.cjs";
|
|
2
|
+
import { t as DocumentMetadata } from "./metadata-D6o-kLpg.cjs";
|
|
3
|
+
import { ContentDocument, ContentSection } from "document-schema.js";
|
|
4
|
+
//#region src/typed/docx/write.d.ts
|
|
5
|
+
interface DocxContent {
|
|
6
|
+
readonly metadata?: DocumentMetadata;
|
|
7
|
+
readonly sections: readonly ContentSection[];
|
|
8
|
+
}
|
|
9
|
+
type EmbeddedPresentationSerialiser = (document: Extract<ContentDocument, {
|
|
10
|
+
kind: 'presentation';
|
|
11
|
+
}>) => Uint8Array<ArrayBuffer>;
|
|
12
|
+
interface BuildDocxContentOptions {
|
|
13
|
+
readonly serialiseEmbeddedPresentation?: EmbeddedPresentationSerialiser;
|
|
14
|
+
}
|
|
15
|
+
declare function buildDocxPackageFromContent(content: DocxContent, options?: BuildDocxContentOptions): Package;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { buildDocxPackageFromContent as i, DocxContent as n, EmbeddedPresentationSerialiser as r, BuildDocxContentOptions as t };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { r as Package } from "./package-BUojjTXf.js";
|
|
2
|
+
import { t as DocumentMetadata } from "./metadata-o_WH9V_I.js";
|
|
3
|
+
import { ContentDocument, ContentSection } from "document-schema.js";
|
|
4
|
+
//#region src/typed/docx/write.d.ts
|
|
5
|
+
interface DocxContent {
|
|
6
|
+
readonly metadata?: DocumentMetadata;
|
|
7
|
+
readonly sections: readonly ContentSection[];
|
|
8
|
+
}
|
|
9
|
+
type EmbeddedPresentationSerialiser = (document: Extract<ContentDocument, {
|
|
10
|
+
kind: 'presentation';
|
|
11
|
+
}>) => Uint8Array<ArrayBuffer>;
|
|
12
|
+
interface BuildDocxContentOptions {
|
|
13
|
+
readonly serialiseEmbeddedPresentation?: EmbeddedPresentationSerialiser;
|
|
14
|
+
}
|
|
15
|
+
declare function buildDocxPackageFromContent(content: DocxContent, options?: BuildDocxContentOptions): Package;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { buildDocxPackageFromContent as i, DocxContent as n, EmbeddedPresentationSerialiser as r, BuildDocxContentOptions as t };
|
package/package.json
CHANGED
package/dist/write-97yEqc6w.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { r as Package } from "./package-BUojjTXf.js";
|
|
2
|
-
import { t as DocumentMetadata } from "./metadata-o_WH9V_I.js";
|
|
3
|
-
import { ContentSection } from "document-schema.js";
|
|
4
|
-
//#region src/typed/docx/write.d.ts
|
|
5
|
-
interface DocxContent {
|
|
6
|
-
readonly metadata?: DocumentMetadata;
|
|
7
|
-
readonly sections: readonly ContentSection[];
|
|
8
|
-
}
|
|
9
|
-
declare function buildDocxPackageFromContent(content: DocxContent): Package;
|
|
10
|
-
//#endregion
|
|
11
|
-
export { buildDocxPackageFromContent as n, DocxContent as t };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { r as Package } from "./package-L24lkba-.cjs";
|
|
2
|
-
import { t as DocumentMetadata } from "./metadata-D6o-kLpg.cjs";
|
|
3
|
-
import { ContentSection } from "document-schema.js";
|
|
4
|
-
//#region src/typed/docx/write.d.ts
|
|
5
|
-
interface DocxContent {
|
|
6
|
-
readonly metadata?: DocumentMetadata;
|
|
7
|
-
readonly sections: readonly ContentSection[];
|
|
8
|
-
}
|
|
9
|
-
declare function buildDocxPackageFromContent(content: DocxContent): Package;
|
|
10
|
-
//#endregion
|
|
11
|
-
export { buildDocxPackageFromContent as n, DocxContent as t };
|