ooxml.js 4.1.1 → 4.3.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 +6 -4
- package/dist/{codec-DxnbKt4O.d.ts → codec-BrTMlL0a.d.ts} +2 -2
- package/dist/{codec-DO0MNF45.d.cts → codec-DNjHjEDm.d.cts} +2 -2
- package/dist/codec.d.cts +1 -1
- package/dist/codec.d.ts +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/{read-Legu2Pt-.js → read-BQoFiqsb.js} +31 -6
- package/dist/{read-DY3Sm5T3.d.cts → read-BoV9SZy4.d.cts} +34 -0
- package/dist/{read-ClIHv1ef.d.cts → read-CDX1WbiF.d.cts} +17 -0
- package/dist/{read-gB0H2bff.d.ts → read-CxMli3Om.d.ts} +17 -0
- package/dist/{read-DPAy4uu8.cjs → read-Di5UfiSh.cjs} +29 -4
- package/dist/{read-DcJZITV9.d.ts → read-ZWJPDvG-.d.ts} +34 -0
- package/dist/typed/document-package.cjs +2 -2
- package/dist/typed/document-package.js +2 -2
- package/dist/typed/docx/constructs.cjs +59 -5
- package/dist/typed/docx/constructs.d.cts +10 -2
- package/dist/typed/docx/constructs.d.ts +10 -2
- package/dist/typed/docx/constructs.js +59 -6
- package/dist/typed/docx/read.cjs +1 -1
- package/dist/typed/docx/read.d.cts +1 -1
- package/dist/typed/docx/read.d.ts +1 -1
- package/dist/typed/docx/read.js +1 -1
- package/dist/typed/docx/write.cjs +139 -6
- package/dist/typed/docx/write.js +140 -7
- package/dist/typed/embedded.cjs +1 -1
- package/dist/typed/embedded.js +1 -1
- package/dist/typed/pptx/read.cjs +1 -1
- package/dist/typed/pptx/read.d.cts +1 -1
- package/dist/typed/pptx/read.d.ts +1 -1
- package/dist/typed/pptx/read.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -144,7 +144,9 @@ const pkg = buildXlsxPackageFromContent(content); // a fresh Package built from
|
|
|
144
144
|
|
|
145
145
|
Both docx readers read the block-scoped fidelity constructs — structured document tags, fields, bookmarks, and tracked changes. In the flat form they are `document-schema.js` construct-boundary markers bracketing the blocks each one spans, one matched `constructStart`/`constructEnd` pair per construct, nesting as brackets do; in the tree they are promoted to a group over exactly that region, carrying the same descriptor. Both docx writers write them back.
|
|
146
146
|
|
|
147
|
-
A
|
|
147
|
+
A bookmark whose extent is a sub-sequence of one paragraph's runs — the bookmark over three words inside a sentence — is read onto that paragraph's own `constructs` field (`document-schema.js`'s run-level construct extents: a descriptor plus a half-open run range, so the paragraph is never split to host a wrapper), and the docx writer puts its `w:bookmarkStart`/`w:bookmarkEnd` halves back between the runs the range names. Two such bookmarks whose extents cross both survive — run ranges are data, not brackets. The other run-level constructs — a field inside a sentence, a run-level content control, a few inserted words in an otherwise untouched paragraph, and a bookmark whose halves sit in two different paragraphs — still have no encoding here: the text comes through, the construct does not. See the gotchas below.
|
|
148
|
+
|
|
149
|
+
A construct with format-specific specifics the harmonised vocabulary does not name carries them in the descriptor's quarantined `source` residue (`document-schema.js`'s residue channel): an SDT whose `w:docPartObj` gallery is not the Table of Contents degrades to a `richText` control with the whole `w:docPartObj` element carried verbatim, and the docx writer re-emits that element from the residue in place of the default `w:richText` type element — the restorable tier in action, the gallery name no longer lost to the round trip.
|
|
148
150
|
|
|
149
151
|
### Migrating from 3.x
|
|
150
152
|
|
|
@@ -294,9 +296,9 @@ The package layers a lossless core outward to lossy convenience views:
|
|
|
294
296
|
## Gotchas and quirks
|
|
295
297
|
|
|
296
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.
|
|
297
|
-
- **A construct marker brackets whole blocks, never a sub-sequence of runs.**
|
|
298
|
-
- **The docx pair round-trips `sections`, not a whole `DocxDocument`.** Numbering definitions, cell border styling/shading, 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. 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` — 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`)
|
|
299
|
-
- **pptx is read-only.** Connector shapes (`p:cxnSp`) are skipped; shape rotation composes through groups; 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` — 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;
|
|
299
|
+
- **A construct marker brackets whole blocks, never a sub-sequence of runs.** A mid-paragraph bookmark is the one run-level construct with an encoding here — it lands on the paragraph's `constructs` field as a run range (see the fidelity-constructs section above). An inline field, a run-level content control, 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, 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. 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 header/footer/footnote (recovery walks the document body's block flow only) 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 serialiser here — pptx is read-only in this package — so 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, 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
|
+
- **pptx is read-only.** Connector shapes (`p:cxnSp`) are skipped; shape rotation composes through groups; 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.
|
|
300
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.
|
|
301
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.
|
|
302
304
|
- **Binary-vs-XML part classification is a byte sniff, not an extension check.** `looksLikeXml` looks for a leading `<` after skipping a UTF-8 BOM and whitespace; any future binary format starting with `<` would misclassify.
|
|
@@ -10,10 +10,10 @@ import "./compact-f0TfhicN.js";
|
|
|
10
10
|
import "./color-fFIKAs-Y.js";
|
|
11
11
|
import "./metadata-o_WH9V_I.js";
|
|
12
12
|
import "./document-package-kartHoyl.js";
|
|
13
|
-
import "./read-
|
|
13
|
+
import "./read-CxMli3Om.js";
|
|
14
14
|
import "./write-97yEqc6w.js";
|
|
15
15
|
import "./numbering-D0YfuiOO.js";
|
|
16
|
-
import "./read-
|
|
16
|
+
import "./read-ZWJPDvG-.js";
|
|
17
17
|
import "./xlsx-DacFqZeF.js";
|
|
18
18
|
import "./content-t6ZfmfQM.js";
|
|
19
19
|
import "./build-q0qMH_ML.js";
|
|
@@ -10,10 +10,10 @@ import "./compact-B1qg9oex.cjs";
|
|
|
10
10
|
import "./color-fFIKAs-Y.cjs";
|
|
11
11
|
import "./metadata-D6o-kLpg.cjs";
|
|
12
12
|
import "./document-package-BDr3nkqJ.cjs";
|
|
13
|
-
import "./read-
|
|
13
|
+
import "./read-CDX1WbiF.cjs";
|
|
14
14
|
import "./write-BFEF46Ir.cjs";
|
|
15
15
|
import "./numbering-C53LT-Jx.cjs";
|
|
16
|
-
import "./read-
|
|
16
|
+
import "./read-BoV9SZy4.cjs";
|
|
17
17
|
import "./xlsx-CpX5nzGV.cjs";
|
|
18
18
|
import "./content-UlQ-Nhgi.cjs";
|
|
19
19
|
import "./build-D-ldsmtA.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-DNjHjEDm.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-BrTMlL0a.js";
|
|
2
2
|
export { decodePackage, encodePackage, packageCodec, xmlCodec };
|
package/dist/index.cjs
CHANGED
|
@@ -15,11 +15,11 @@ const require_typed_util = require("./typed/util.cjs");
|
|
|
15
15
|
const require_typed_shared_color = require("./typed/shared/color.cjs");
|
|
16
16
|
const require_typed_shared_metadata = require("./typed/shared/metadata.cjs");
|
|
17
17
|
const require_image_sniff = require("./image/sniff.cjs");
|
|
18
|
-
const require_read = require("./read-
|
|
18
|
+
const require_read = require("./read-Di5UfiSh.cjs");
|
|
19
19
|
const require_typed_xlsx_content = require("./typed/xlsx/content.cjs");
|
|
20
20
|
const require_typed_docx_numbering = require("./typed/docx/numbering.cjs");
|
|
21
|
-
const require_typed_docx_write = require("./typed/docx/write.cjs");
|
|
22
21
|
const require_typed_xlsx_build = require("./typed/xlsx/build.cjs");
|
|
22
|
+
const require_typed_docx_write = require("./typed/docx/write.cjs");
|
|
23
23
|
const require_typed_document_package = require("./typed/document-package.cjs");
|
|
24
24
|
const require_typed_xlsx = require("./typed/xlsx.cjs");
|
|
25
25
|
let document_schema_js = require("document-schema.js");
|
package/dist/index.d.cts
CHANGED
|
@@ -14,12 +14,12 @@ import { n as applyColorTransforms, t as ColorTransform } from "./color-fFIKAs-Y
|
|
|
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
16
|
import { a as readXlsx, i as readPptx, n as buildXlsxPackage, r as readDocx, t as buildDocxPackage } from "./document-package-BDr3nkqJ.cjs";
|
|
17
|
-
import { a as Footnote, i as DocxDocumentSchema, n as CommentSchema, o as FootnoteSchema, r as DocxDocument, s as readDocxContent, t as Comment } from "./read-
|
|
17
|
+
import { a as Footnote, i as DocxDocumentSchema, n as CommentSchema, o as FootnoteSchema, r as DocxDocument, s as readDocxContent, t as Comment } from "./read-CDX1WbiF.cjs";
|
|
18
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
|
-
import { n as PptxDocumentSchema, r as readPptxContent, t as PptxDocument } from "./read-
|
|
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-UlQ-Nhgi.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-
|
|
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-DNjHjEDm.cjs";
|
|
25
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -14,12 +14,12 @@ import { n as applyColorTransforms, t as ColorTransform } from "./color-fFIKAs-Y
|
|
|
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
16
|
import { a as readXlsx, i as readPptx, n as buildXlsxPackage, r as readDocx, t as buildDocxPackage } from "./document-package-kartHoyl.js";
|
|
17
|
-
import { a as Footnote, i as DocxDocumentSchema, n as CommentSchema, o as FootnoteSchema, r as DocxDocument, s as readDocxContent, t as Comment } from "./read-
|
|
17
|
+
import { a as Footnote, i as DocxDocumentSchema, n as CommentSchema, o as FootnoteSchema, r as DocxDocument, s as readDocxContent, t as Comment } from "./read-CxMli3Om.js";
|
|
18
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
|
-
import { n as PptxDocumentSchema, r as readPptxContent, t as PptxDocument } from "./read-
|
|
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-t6ZfmfQM.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-
|
|
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-BrTMlL0a.js";
|
|
25
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 };
|
package/dist/index.js
CHANGED
|
@@ -14,11 +14,11 @@ import { attr, childrenWithTag, decodeEntities, elementsWithTag, resolveRelation
|
|
|
14
14
|
import { applyColorTransforms } from "./typed/shared/color.js";
|
|
15
15
|
import { DocumentMetadataSchema } from "./typed/shared/metadata.js";
|
|
16
16
|
import { sniffImageFormat } from "./image/sniff.js";
|
|
17
|
-
import { c as readPptxContent, i as readDocxContent, n as DocxDocumentSchema, r as FootnoteSchema, s as PptxDocumentSchema, t as CommentSchema } from "./read-
|
|
17
|
+
import { c as readPptxContent, i as readDocxContent, n as DocxDocumentSchema, r as FootnoteSchema, s as PptxDocumentSchema, t as CommentSchema } from "./read-BQoFiqsb.js";
|
|
18
18
|
import { readXlsxContent } from "./typed/xlsx/content.js";
|
|
19
19
|
import { NumberingDefinitionSchema, NumberingLevelSchema, readNumberingDefinitions } from "./typed/docx/numbering.js";
|
|
20
|
-
import { buildDocxPackageFromContent } from "./typed/docx/write.js";
|
|
21
20
|
import { buildXlsxPackageFromContent } from "./typed/xlsx/build.js";
|
|
21
|
+
import { buildDocxPackageFromContent } from "./typed/docx/write.js";
|
|
22
22
|
import { buildDocxPackage, buildXlsxPackage, readDocx, readPptx, readXlsx } from "./typed/document-package.js";
|
|
23
23
|
import { DefinedNameSchema, XlsxCellSchema, XlsxSheetSchema, XlsxWorkbookSchema, readXlsxWorkbook } from "./typed/xlsx.js";
|
|
24
24
|
import { AlignmentSchema, AnchorDescriptorSchema, AnchorTypeSchema, BoxSchema, COLOR_BLACK, ColorSchema, ConstructDescriptorSchema, ConstructMarkerImbalanceError, ContentBlockSchema, ContentBorderSchema, ContentCellBordersSchema, ContentCellValueSchema, ContentConstructEndSchema, ContentConstructStartSchema, ContentControlDescriptorSchema, ContentControlLockSchema, ContentControlTypeSchema, ContentDocumentSchema, ContentImageBlockSchema, ContentListMembershipSchema, ContentPageBreakSchema, ContentParagraphSchema, ContentRunSchema, ContentSectionSchema, ContentShapeSchema, ContentSheetCellSchema, ContentSheetColumnSchema, ContentSheetImageSchema, ContentSheetPrintRangeSchema, ContentSheetPrintSettingsSchema, ContentSheetRepeatRangeSchema, ContentSheetRowSchema, ContentSheetSchema, ContentSlideSchema, ContentStrokeStyleSchema, ContentTableCellSchema, ContentTableRowSchema, ContentTableSchema, DivisionDescriptorSchema, DocumentPackageSchema, DrawPageGroupSchema, FieldDescriptorSchema, HeadingGroupSchema, LinkDescriptorSchema, LinkTargetSchema, ListGroupSchema, MarginsSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PackageBlockLeafSchema, PackageGroupSchema, PackageLeafSchema, PackageNodeSchema, PageSizeSchema, ProvenanceChangeSchema, ProvenanceDescriptorSchema, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, SectionConstructGroupSchema, SectionGroupSchema, ShapeConstructGroupSchema, ShapeGroupSchema, SheetGroupSchema, SlideGroupSchema, StyleEntrySchema, StyleParagraphPropertiesSchema, StyleRunPropertiesSchema, StylesTableSchema, applyParagraphStyleProperties, applyRunStyleProperties, assemblePackage, colorToRgbHex, decompose, factorStyles, findConstructMarkerImbalance, flattenPackage, isContentBlock, isContentConstructEnd, isContentConstructStart, isDrawPageGroupNode, isHeadingGroupNode, isListGroupNode, isPackageBlockLeaf, isPackageGroup, isPackageLeaf, isPackageNode, isSectionConstructGroupNode, isSectionGroupNode, isShapeConstructGroupNode, isShapeGroupNode, isSheetGroupNode, isSlideGroupNode, overlayStyleEntries, resolveStyleChain, rgbHexToColor } from "document-schema.js";
|
|
@@ -12,10 +12,10 @@ import { readDiagramText } from "./typed/pptx/diagram.js";
|
|
|
12
12
|
import { readXlsxContent } from "./typed/xlsx/content.js";
|
|
13
13
|
import { resolveParagraphProperties, resolveRunProperties } from "./typed/docx/styles.js";
|
|
14
14
|
import { NumberingDefinitionSchema, readNumberingDefinitions } from "./typed/docx/numbering.js";
|
|
15
|
-
import { PROVENANCE_CHANGE_BY_TAG, bookmarkAnchorDescriptor, contentBearingChildren, fieldCharType, indexParagraphContent, insertConstructMarkers, isDeletedChange, readContentControlDescriptor, readProvenanceDescriptor, runInstructionText } from "./typed/docx/constructs.js";
|
|
15
|
+
import { PROVENANCE_CHANGE_BY_TAG, bookmarkAnchorDescriptor, contentBearingChildren, fieldCharType, indexParagraphContent, insertConstructMarkers, isDeletedChange, readContentControlDescriptor, readProvenanceDescriptor, runBookmarkExtents, runInstructionText } from "./typed/docx/constructs.js";
|
|
16
16
|
import { z } from "zod";
|
|
17
17
|
import { COLOR_BLACK, ContentSectionSchema, ContentSlideSchema, PAGE_SIZE_LETTER, SLIDE_SIZE_WIDESCREEN, clampHeadingLevel, rgbHexToColor } from "document-schema.js";
|
|
18
|
-
import { isZipArchive, walkArchive } from "archive-codec";
|
|
18
|
+
import { isCompoundFile, isZipArchive, readCompoundFile, readOlePackage, walkArchive } from "archive-codec";
|
|
19
19
|
//#region src/typed/pptx/read.ts
|
|
20
20
|
const PptxDocumentSchema = z.object({
|
|
21
21
|
metadata: DocumentMetadataSchema,
|
|
@@ -439,9 +439,11 @@ function rootEntriesOf(walk) {
|
|
|
439
439
|
return entries;
|
|
440
440
|
}
|
|
441
441
|
function readEmbeddedOoxmlPayload(bytes) {
|
|
442
|
-
if (!isZipArchive(bytes)) return;
|
|
442
|
+
if (!isZipArchive(bytes) && !isCompoundFile(bytes)) return;
|
|
443
443
|
try {
|
|
444
|
-
const
|
|
444
|
+
const zipBytes = zipBytesOfPayload(bytes);
|
|
445
|
+
if (zipBytes === void 0) return;
|
|
446
|
+
const nested = packageFromEntries(rootEntriesOf(walkArchive(zipBytes)));
|
|
445
447
|
const objectKind = detectFlavour(nested);
|
|
446
448
|
return objectKind === void 0 ? void 0 : {
|
|
447
449
|
objectKind,
|
|
@@ -451,6 +453,13 @@ function readEmbeddedOoxmlPayload(bytes) {
|
|
|
451
453
|
return;
|
|
452
454
|
}
|
|
453
455
|
}
|
|
456
|
+
function zipBytesOfPayload(bytes) {
|
|
457
|
+
if (isZipArchive(bytes)) return bytes;
|
|
458
|
+
const packageStream = readCompoundFile(bytes).find((stream) => stream.path === "Package");
|
|
459
|
+
if (packageStream === void 0) return;
|
|
460
|
+
const fileBytes = readOlePackage(packageStream.bytes).fileBytes;
|
|
461
|
+
return isZipArchive(fileBytes) ? fileBytes : void 0;
|
|
462
|
+
}
|
|
454
463
|
const payloadByPart = /* @__PURE__ */ new WeakMap();
|
|
455
464
|
function readEmbeddedPayloadPart(part) {
|
|
456
465
|
const cached = payloadByPart.get(part);
|
|
@@ -653,7 +662,7 @@ function readRun(run, paragraph, context) {
|
|
|
653
662
|
color: props.color
|
|
654
663
|
};
|
|
655
664
|
}
|
|
656
|
-
function readParagraphRuns(paragraph, ctx, carryDeletions) {
|
|
665
|
+
function readParagraphRuns(paragraph, ctx, carryDeletions, halves) {
|
|
657
666
|
const runs = [];
|
|
658
667
|
let fieldState = "none";
|
|
659
668
|
function walk(nodes, hyperlinkTarget) {
|
|
@@ -684,6 +693,18 @@ function readParagraphRuns(paragraph, ctx, carryDeletions) {
|
|
|
684
693
|
} else if (node.tag === "w:sdt") {
|
|
685
694
|
const sdtContent = childrenWithTag(node, "w:sdtContent")[0];
|
|
686
695
|
if (sdtContent !== void 0) walk(sdtContent.children, hyperlinkTarget);
|
|
696
|
+
} else if (node.tag === "w:bookmarkStart" || node.tag === "w:bookmarkEnd") {
|
|
697
|
+
const id = attr(node, "w:id");
|
|
698
|
+
if (id !== void 0) {
|
|
699
|
+
const name = attr(node, "w:name");
|
|
700
|
+
halves.push({
|
|
701
|
+
element: node,
|
|
702
|
+
id,
|
|
703
|
+
name: node.tag === "w:bookmarkStart" && name !== void 0 ? decodeEntities(name) : void 0,
|
|
704
|
+
kind: node.tag === "w:bookmarkStart" ? "start" : "end",
|
|
705
|
+
runPosition: runs.length
|
|
706
|
+
});
|
|
707
|
+
}
|
|
687
708
|
}
|
|
688
709
|
}
|
|
689
710
|
}
|
|
@@ -694,9 +715,13 @@ function readParagraph(paragraph, ctx, carryDeletions) {
|
|
|
694
715
|
const pPr = childrenWithTag(paragraph, "w:pPr")[0];
|
|
695
716
|
const pStyleEl = pPr === void 0 ? void 0 : childrenWithTag(pPr, "w:pStyle")[0];
|
|
696
717
|
const props = resolveParagraphProperties(paragraph, ctx.styles);
|
|
718
|
+
const halves = [];
|
|
719
|
+
const runs = readParagraphRuns(paragraph, ctx, carryDeletions, halves);
|
|
720
|
+
const constructs = runBookmarkExtents(halves, indexParagraphContent(paragraph));
|
|
697
721
|
return {
|
|
698
722
|
kind: "paragraph",
|
|
699
|
-
runs
|
|
723
|
+
runs,
|
|
724
|
+
...constructs.length > 0 ? { constructs } : {},
|
|
700
725
|
styleId: pStyleEl === void 0 ? void 0 : attr(pStyleEl, "w:val"),
|
|
701
726
|
headingLevel: props.outlineLvl === void 0 ? void 0 : clampHeadingLevel(props.outlineLvl + 1),
|
|
702
727
|
alignment: props.alignment,
|
|
@@ -34,6 +34,23 @@ declare const PptxDocumentSchema: z.ZodObject<{
|
|
|
34
34
|
lineSpacingReduction: z.ZodOptional<z.ZodNumber>;
|
|
35
35
|
paintOrder: z.ZodOptional<z.ZodNumber>;
|
|
36
36
|
sourcePath: z.ZodOptional<z.ZodString>;
|
|
37
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
38
|
+
format: z.ZodEnum<{
|
|
39
|
+
docx: "docx";
|
|
40
|
+
pptx: "pptx";
|
|
41
|
+
xlsx: "xlsx";
|
|
42
|
+
odt: "odt";
|
|
43
|
+
ods: "ods";
|
|
44
|
+
odp: "odp";
|
|
45
|
+
odg: "odg";
|
|
46
|
+
odm: "odm";
|
|
47
|
+
odb: "odb";
|
|
48
|
+
odf: "odf";
|
|
49
|
+
markdown: "markdown";
|
|
50
|
+
pdf: "pdf";
|
|
51
|
+
}>;
|
|
52
|
+
xml: z.ZodString;
|
|
53
|
+
}, z.core.$strict>>;
|
|
37
54
|
frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
38
55
|
pageIndex: z.ZodNumber;
|
|
39
56
|
xPt: z.ZodNumber;
|
|
@@ -44,6 +61,23 @@ declare const PptxDocumentSchema: z.ZodObject<{
|
|
|
44
61
|
blocks: z.ZodArray<z.ZodCustom<ContentBlock, ContentBlock>>;
|
|
45
62
|
}, z.core.$strip>>;
|
|
46
63
|
notes: z.ZodString;
|
|
64
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
65
|
+
format: z.ZodEnum<{
|
|
66
|
+
docx: "docx";
|
|
67
|
+
pptx: "pptx";
|
|
68
|
+
xlsx: "xlsx";
|
|
69
|
+
odt: "odt";
|
|
70
|
+
ods: "ods";
|
|
71
|
+
odp: "odp";
|
|
72
|
+
odg: "odg";
|
|
73
|
+
odm: "odm";
|
|
74
|
+
odb: "odb";
|
|
75
|
+
odf: "odf";
|
|
76
|
+
markdown: "markdown";
|
|
77
|
+
pdf: "pdf";
|
|
78
|
+
}>;
|
|
79
|
+
xml: z.ZodString;
|
|
80
|
+
}, z.core.$strict>>;
|
|
47
81
|
}, z.core.$strip>>;
|
|
48
82
|
}, z.core.$strip>;
|
|
49
83
|
type PptxDocument = z.infer<typeof PptxDocumentSchema>;
|
|
@@ -34,6 +34,23 @@ declare const DocxDocumentSchema: z.ZodObject<{
|
|
|
34
34
|
leftPt: z.ZodNumber;
|
|
35
35
|
}, z.core.$strip>;
|
|
36
36
|
blocks: z.ZodArray<z.ZodCustom<ContentBlock, ContentBlock>>;
|
|
37
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
38
|
+
format: z.ZodEnum<{
|
|
39
|
+
docx: "docx";
|
|
40
|
+
pptx: "pptx";
|
|
41
|
+
xlsx: "xlsx";
|
|
42
|
+
odt: "odt";
|
|
43
|
+
ods: "ods";
|
|
44
|
+
odp: "odp";
|
|
45
|
+
odg: "odg";
|
|
46
|
+
odm: "odm";
|
|
47
|
+
odb: "odb";
|
|
48
|
+
odf: "odf";
|
|
49
|
+
markdown: "markdown";
|
|
50
|
+
pdf: "pdf";
|
|
51
|
+
}>;
|
|
52
|
+
xml: z.ZodString;
|
|
53
|
+
}, z.core.$strict>>;
|
|
37
54
|
}, z.core.$strip>>;
|
|
38
55
|
comments: z.ZodArray<z.ZodObject<{
|
|
39
56
|
author: z.ZodOptional<z.ZodString>;
|
|
@@ -34,6 +34,23 @@ declare const DocxDocumentSchema: z.ZodObject<{
|
|
|
34
34
|
leftPt: z.ZodNumber;
|
|
35
35
|
}, z.core.$strip>;
|
|
36
36
|
blocks: z.ZodArray<z.ZodCustom<ContentBlock, ContentBlock>>;
|
|
37
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
38
|
+
format: z.ZodEnum<{
|
|
39
|
+
docx: "docx";
|
|
40
|
+
pptx: "pptx";
|
|
41
|
+
xlsx: "xlsx";
|
|
42
|
+
odt: "odt";
|
|
43
|
+
ods: "ods";
|
|
44
|
+
odp: "odp";
|
|
45
|
+
odg: "odg";
|
|
46
|
+
odm: "odm";
|
|
47
|
+
odb: "odb";
|
|
48
|
+
odf: "odf";
|
|
49
|
+
markdown: "markdown";
|
|
50
|
+
pdf: "pdf";
|
|
51
|
+
}>;
|
|
52
|
+
xml: z.ZodString;
|
|
53
|
+
}, z.core.$strict>>;
|
|
37
54
|
}, z.core.$strip>>;
|
|
38
55
|
comments: z.ZodArray<z.ZodObject<{
|
|
39
56
|
author: z.ZodOptional<z.ZodString>;
|
|
@@ -439,9 +439,11 @@ function rootEntriesOf(walk) {
|
|
|
439
439
|
return entries;
|
|
440
440
|
}
|
|
441
441
|
function readEmbeddedOoxmlPayload(bytes) {
|
|
442
|
-
if (!(0, archive_codec.isZipArchive)(bytes)) return;
|
|
442
|
+
if (!(0, archive_codec.isZipArchive)(bytes) && !(0, archive_codec.isCompoundFile)(bytes)) return;
|
|
443
443
|
try {
|
|
444
|
-
const
|
|
444
|
+
const zipBytes = zipBytesOfPayload(bytes);
|
|
445
|
+
if (zipBytes === void 0) return;
|
|
446
|
+
const nested = require_package_io_read.packageFromEntries(rootEntriesOf((0, archive_codec.walkArchive)(zipBytes)));
|
|
445
447
|
const objectKind = detectFlavour(nested);
|
|
446
448
|
return objectKind === void 0 ? void 0 : {
|
|
447
449
|
objectKind,
|
|
@@ -451,6 +453,13 @@ function readEmbeddedOoxmlPayload(bytes) {
|
|
|
451
453
|
return;
|
|
452
454
|
}
|
|
453
455
|
}
|
|
456
|
+
function zipBytesOfPayload(bytes) {
|
|
457
|
+
if ((0, archive_codec.isZipArchive)(bytes)) return bytes;
|
|
458
|
+
const packageStream = (0, archive_codec.readCompoundFile)(bytes).find((stream) => stream.path === "Package");
|
|
459
|
+
if (packageStream === void 0) return;
|
|
460
|
+
const fileBytes = (0, archive_codec.readOlePackage)(packageStream.bytes).fileBytes;
|
|
461
|
+
return (0, archive_codec.isZipArchive)(fileBytes) ? fileBytes : void 0;
|
|
462
|
+
}
|
|
454
463
|
const payloadByPart = /* @__PURE__ */ new WeakMap();
|
|
455
464
|
function readEmbeddedPayloadPart(part) {
|
|
456
465
|
const cached = payloadByPart.get(part);
|
|
@@ -653,7 +662,7 @@ function readRun(run, paragraph, context) {
|
|
|
653
662
|
color: props.color
|
|
654
663
|
};
|
|
655
664
|
}
|
|
656
|
-
function readParagraphRuns(paragraph, ctx, carryDeletions) {
|
|
665
|
+
function readParagraphRuns(paragraph, ctx, carryDeletions, halves) {
|
|
657
666
|
const runs = [];
|
|
658
667
|
let fieldState = "none";
|
|
659
668
|
function walk(nodes, hyperlinkTarget) {
|
|
@@ -684,6 +693,18 @@ function readParagraphRuns(paragraph, ctx, carryDeletions) {
|
|
|
684
693
|
} else if (node.tag === "w:sdt") {
|
|
685
694
|
const sdtContent = require_typed_util.childrenWithTag(node, "w:sdtContent")[0];
|
|
686
695
|
if (sdtContent !== void 0) walk(sdtContent.children, hyperlinkTarget);
|
|
696
|
+
} else if (node.tag === "w:bookmarkStart" || node.tag === "w:bookmarkEnd") {
|
|
697
|
+
const id = require_typed_util.attr(node, "w:id");
|
|
698
|
+
if (id !== void 0) {
|
|
699
|
+
const name = require_typed_util.attr(node, "w:name");
|
|
700
|
+
halves.push({
|
|
701
|
+
element: node,
|
|
702
|
+
id,
|
|
703
|
+
name: node.tag === "w:bookmarkStart" && name !== void 0 ? require_typed_util.decodeEntities(name) : void 0,
|
|
704
|
+
kind: node.tag === "w:bookmarkStart" ? "start" : "end",
|
|
705
|
+
runPosition: runs.length
|
|
706
|
+
});
|
|
707
|
+
}
|
|
687
708
|
}
|
|
688
709
|
}
|
|
689
710
|
}
|
|
@@ -694,9 +715,13 @@ function readParagraph(paragraph, ctx, carryDeletions) {
|
|
|
694
715
|
const pPr = require_typed_util.childrenWithTag(paragraph, "w:pPr")[0];
|
|
695
716
|
const pStyleEl = pPr === void 0 ? void 0 : require_typed_util.childrenWithTag(pPr, "w:pStyle")[0];
|
|
696
717
|
const props = require_typed_docx_styles.resolveParagraphProperties(paragraph, ctx.styles);
|
|
718
|
+
const halves = [];
|
|
719
|
+
const runs = readParagraphRuns(paragraph, ctx, carryDeletions, halves);
|
|
720
|
+
const constructs = require_typed_docx_constructs.runBookmarkExtents(halves, require_typed_docx_constructs.indexParagraphContent(paragraph));
|
|
697
721
|
return {
|
|
698
722
|
kind: "paragraph",
|
|
699
|
-
runs
|
|
723
|
+
runs,
|
|
724
|
+
...constructs.length > 0 ? { constructs } : {},
|
|
700
725
|
styleId: pStyleEl === void 0 ? void 0 : require_typed_util.attr(pStyleEl, "w:val"),
|
|
701
726
|
headingLevel: props.outlineLvl === void 0 ? void 0 : (0, document_schema_js.clampHeadingLevel)(props.outlineLvl + 1),
|
|
702
727
|
alignment: props.alignment,
|
|
@@ -34,6 +34,23 @@ declare const PptxDocumentSchema: z.ZodObject<{
|
|
|
34
34
|
lineSpacingReduction: z.ZodOptional<z.ZodNumber>;
|
|
35
35
|
paintOrder: z.ZodOptional<z.ZodNumber>;
|
|
36
36
|
sourcePath: z.ZodOptional<z.ZodString>;
|
|
37
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
38
|
+
format: z.ZodEnum<{
|
|
39
|
+
docx: "docx";
|
|
40
|
+
pptx: "pptx";
|
|
41
|
+
xlsx: "xlsx";
|
|
42
|
+
odt: "odt";
|
|
43
|
+
ods: "ods";
|
|
44
|
+
odp: "odp";
|
|
45
|
+
odg: "odg";
|
|
46
|
+
odm: "odm";
|
|
47
|
+
odb: "odb";
|
|
48
|
+
odf: "odf";
|
|
49
|
+
markdown: "markdown";
|
|
50
|
+
pdf: "pdf";
|
|
51
|
+
}>;
|
|
52
|
+
xml: z.ZodString;
|
|
53
|
+
}, z.core.$strict>>;
|
|
37
54
|
frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
38
55
|
pageIndex: z.ZodNumber;
|
|
39
56
|
xPt: z.ZodNumber;
|
|
@@ -44,6 +61,23 @@ declare const PptxDocumentSchema: z.ZodObject<{
|
|
|
44
61
|
blocks: z.ZodArray<z.ZodCustom<ContentBlock, ContentBlock>>;
|
|
45
62
|
}, z.core.$strip>>;
|
|
46
63
|
notes: z.ZodString;
|
|
64
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
65
|
+
format: z.ZodEnum<{
|
|
66
|
+
docx: "docx";
|
|
67
|
+
pptx: "pptx";
|
|
68
|
+
xlsx: "xlsx";
|
|
69
|
+
odt: "odt";
|
|
70
|
+
ods: "ods";
|
|
71
|
+
odp: "odp";
|
|
72
|
+
odg: "odg";
|
|
73
|
+
odm: "odm";
|
|
74
|
+
odb: "odb";
|
|
75
|
+
odf: "odf";
|
|
76
|
+
markdown: "markdown";
|
|
77
|
+
pdf: "pdf";
|
|
78
|
+
}>;
|
|
79
|
+
xml: z.ZodString;
|
|
80
|
+
}, z.core.$strict>>;
|
|
47
81
|
}, z.core.$strip>>;
|
|
48
82
|
}, z.core.$strip>;
|
|
49
83
|
type PptxDocument = z.infer<typeof PptxDocumentSchema>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_read = require("../read-
|
|
2
|
+
const require_read = require("../read-Di5UfiSh.cjs");
|
|
3
3
|
const require_typed_xlsx_content = require("./xlsx/content.cjs");
|
|
4
|
-
const require_typed_docx_write = require("./docx/write.cjs");
|
|
5
4
|
const require_typed_xlsx_build = require("./xlsx/build.cjs");
|
|
5
|
+
const require_typed_docx_write = require("./docx/write.cjs");
|
|
6
6
|
let document_schema_js = require("document-schema.js");
|
|
7
7
|
//#region src/typed/document-package.ts
|
|
8
8
|
function readDocx(pkg) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as readPptxContent, i as readDocxContent } from "../read-
|
|
1
|
+
import { c as readPptxContent, i as readDocxContent } from "../read-BQoFiqsb.js";
|
|
2
2
|
import { readXlsxContent } from "./xlsx/content.js";
|
|
3
|
-
import { buildDocxPackageFromContent } from "./docx/write.js";
|
|
4
3
|
import { buildXlsxPackageFromContent } from "./xlsx/build.js";
|
|
4
|
+
import { buildDocxPackageFromContent } from "./docx/write.js";
|
|
5
5
|
import { assemblePackage, flattenPackage } from "document-schema.js";
|
|
6
6
|
//#region src/typed/document-package.ts
|
|
7
7
|
function readDocx(pkg) {
|