@office-open/core 0.9.8 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/descriptor/index.mjs +1 -1
- package/dist/{descriptor-TtMXoZgS.mjs → descriptor-BdWTH1vv.mjs} +4 -3
- package/dist/drawingml/index.d.mts +1 -1
- package/dist/drawingml/index.mjs +1 -1
- package/dist/{index-CeVhA1an.d.mts → index-Bpw3LFuI.d.mts} +253 -209
- package/dist/index-DEeO4sOq.d.mts +239 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +4 -4
- package/dist/patch/index.d.mts +2 -2
- package/dist/patch/index.mjs +2 -2
- package/dist/{patch-ilNZTQmG.mjs → patch-DocIv0Sn.mjs} +125 -3
- package/dist/{src-CSka9ln4.mjs → src-DaZbVB3f.mjs} +265 -154
- package/package.json +2 -2
- package/dist/index-DYy8l709.d.mts +0 -127
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { Element } from "@office-open/xml";
|
|
2
|
+
import { Buffer } from "\u0000polyfill-node.buffer";
|
|
3
|
+
|
|
4
|
+
//#region src/util/data-type.d.ts
|
|
5
|
+
/** Supported binary input shapes. */
|
|
6
|
+
type DataType = ArrayBufferLike | Blob | DataView | number[] | ReadableStream | string | Uint8Array;
|
|
7
|
+
/** Test whether a string is a base64 data URL (`data:[mime];base64,...`). */
|
|
8
|
+
declare function isBase64DataURL(input: string): boolean;
|
|
9
|
+
/** Normalize any supported binary input to a `Uint8Array`. */
|
|
10
|
+
declare function toUint8Array(data: DataType): Uint8Array;
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/opc/core.d.ts
|
|
13
|
+
type IXmlableObject = Readonly<Record<string, unknown>>;
|
|
14
|
+
/**
|
|
15
|
+
* Core document properties (docProps/core.xml).
|
|
16
|
+
*
|
|
17
|
+
* Shared across docx/pptx/xlsx: each format's top-level Options extends this,
|
|
18
|
+
* parse emits the same shape, and patch overrides it — read/write symmetry
|
|
19
|
+
* (CONTRIBUTING §Property Naming). Field names follow the OPC core-properties
|
|
20
|
+
* XSD element local names (`creator` = dc:creator, … — never `author`).
|
|
21
|
+
*/
|
|
22
|
+
interface CorePropertiesOptions {
|
|
23
|
+
title?: string;
|
|
24
|
+
subject?: string;
|
|
25
|
+
creator?: string;
|
|
26
|
+
keywords?: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
lastModifiedBy?: string;
|
|
29
|
+
revision?: number;
|
|
30
|
+
lastPrinted?: string;
|
|
31
|
+
/** Creation timestamp (W3CDTF), round-tripped from dcterms:created. */
|
|
32
|
+
created?: string;
|
|
33
|
+
/** Last modified timestamp (W3CDTF), round-tripped from dcterms:modified. */
|
|
34
|
+
modified?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Parse core properties from an already-parsed XML element.
|
|
38
|
+
* Shared by docx/pptx/xlsx to extract Dublin Core metadata into the unified
|
|
39
|
+
* {@link CorePropertiesOptions} shape.
|
|
40
|
+
*/
|
|
41
|
+
declare function parseCorePropsElement(el: Element | undefined): CorePropertiesOptions;
|
|
42
|
+
/**
|
|
43
|
+
* Build a cp:coreProperties XML object from metadata.
|
|
44
|
+
*
|
|
45
|
+
* Shared by docx and pptx to avoid duplicating namespace declarations
|
|
46
|
+
* and Dublin Core property construction.
|
|
47
|
+
*/
|
|
48
|
+
declare function buildCorePropertiesXml(opts: {
|
|
49
|
+
title?: string;
|
|
50
|
+
subject?: string;
|
|
51
|
+
creator?: string;
|
|
52
|
+
keywords?: string;
|
|
53
|
+
description?: string;
|
|
54
|
+
lastModifiedBy?: string;
|
|
55
|
+
revision?: number;
|
|
56
|
+
}): IXmlableObject;
|
|
57
|
+
/**
|
|
58
|
+
* Build a cp:coreProperties XML string directly (fast path).
|
|
59
|
+
*
|
|
60
|
+
* Shared by pptx and xlsx to bypass the toXml() → xml() pipeline.
|
|
61
|
+
* created/modified default to now when not supplied; all other fields emit
|
|
62
|
+
* only when present.
|
|
63
|
+
*/
|
|
64
|
+
declare function buildCorePropertiesXmlString(opts: CorePropertiesOptions): string;
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/opc/output.d.ts
|
|
67
|
+
/**
|
|
68
|
+
* Output type definitions for OOXML document export.
|
|
69
|
+
*
|
|
70
|
+
* @module
|
|
71
|
+
*/
|
|
72
|
+
interface OutputByType {
|
|
73
|
+
base64: string;
|
|
74
|
+
string: string;
|
|
75
|
+
text: string;
|
|
76
|
+
binarystring: string;
|
|
77
|
+
array: readonly number[];
|
|
78
|
+
uint8array: Uint8Array;
|
|
79
|
+
arraybuffer: ArrayBuffer;
|
|
80
|
+
blob: Blob;
|
|
81
|
+
nodebuffer: Buffer;
|
|
82
|
+
}
|
|
83
|
+
type OutputType = keyof OutputByType;
|
|
84
|
+
declare const OoxmlMimeType: {
|
|
85
|
+
readonly DOCX: "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
86
|
+
readonly PPTX: "application/vnd.openxmlformats-officedocument.presentationml.presentation";
|
|
87
|
+
readonly XLSX: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
88
|
+
};
|
|
89
|
+
declare const convertOutput: <T extends OutputType>(data: Uint8Array, type: T, mimeType?: string) => OutputByType[T];
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region src/patch/xml-namespace.d.ts
|
|
92
|
+
/**
|
|
93
|
+
* Namespace configuration for XML patch operations.
|
|
94
|
+
*
|
|
95
|
+
* Parameterises element names so the same patch algorithm works for both
|
|
96
|
+
* DOCX (`w:*`) and PPTX (`a:*`) documents.
|
|
97
|
+
*/
|
|
98
|
+
interface XmlNamespaceConfig {
|
|
99
|
+
paragraph: string;
|
|
100
|
+
run: string;
|
|
101
|
+
text: string;
|
|
102
|
+
runProperties: string;
|
|
103
|
+
}
|
|
104
|
+
declare const DOCX_NS: XmlNamespaceConfig;
|
|
105
|
+
declare const PPTX_NS: XmlNamespaceConfig;
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region src/patch/xml-replacer.d.ts
|
|
108
|
+
interface ReplacerConfig {
|
|
109
|
+
ns: XmlNamespaceConfig;
|
|
110
|
+
formatChild: (child: unknown, context: unknown) => Element[];
|
|
111
|
+
preserveSpace?: boolean;
|
|
112
|
+
}
|
|
113
|
+
interface ReplacerResult {
|
|
114
|
+
element: Element;
|
|
115
|
+
didFindOccurrence: boolean;
|
|
116
|
+
}
|
|
117
|
+
declare function createReplacer(config: ReplacerConfig): ({
|
|
118
|
+
json,
|
|
119
|
+
patch,
|
|
120
|
+
patchText,
|
|
121
|
+
context,
|
|
122
|
+
keepOriginalStyles
|
|
123
|
+
}: {
|
|
124
|
+
json: Element;
|
|
125
|
+
patch: {
|
|
126
|
+
type: string;
|
|
127
|
+
children: readonly unknown[];
|
|
128
|
+
};
|
|
129
|
+
patchText: string;
|
|
130
|
+
context: unknown;
|
|
131
|
+
keepOriginalStyles?: boolean;
|
|
132
|
+
}) => ReplacerResult;
|
|
133
|
+
//#endregion
|
|
134
|
+
//#region src/patch/run-renderer.d.ts
|
|
135
|
+
interface ElementWrapper {
|
|
136
|
+
element: Element;
|
|
137
|
+
index: number;
|
|
138
|
+
parent: ElementWrapper | undefined;
|
|
139
|
+
}
|
|
140
|
+
interface RenderedParagraphNode {
|
|
141
|
+
text: string;
|
|
142
|
+
runs: readonly RenderedRunNode[];
|
|
143
|
+
index: number;
|
|
144
|
+
pathToParagraph: readonly number[];
|
|
145
|
+
}
|
|
146
|
+
interface StartAndEnd {
|
|
147
|
+
start: number;
|
|
148
|
+
end: number;
|
|
149
|
+
}
|
|
150
|
+
type IParts = {
|
|
151
|
+
text: string;
|
|
152
|
+
index: number;
|
|
153
|
+
} & StartAndEnd;
|
|
154
|
+
type RenderedRunNode = {
|
|
155
|
+
text: string;
|
|
156
|
+
parts: readonly IParts[];
|
|
157
|
+
index: number;
|
|
158
|
+
} & StartAndEnd;
|
|
159
|
+
declare function createRunRenderer(ns: XmlNamespaceConfig): (node: ElementWrapper) => RenderedParagraphNode;
|
|
160
|
+
//#endregion
|
|
161
|
+
//#region src/patch/xml-traverser.d.ts
|
|
162
|
+
declare function createTraverser(ns: XmlNamespaceConfig): {
|
|
163
|
+
traverse: (node: Element) => readonly RenderedParagraphNode[];
|
|
164
|
+
findLocationOfText: (node: Element, text: string) => readonly RenderedParagraphNode[];
|
|
165
|
+
};
|
|
166
|
+
//#endregion
|
|
167
|
+
//#region src/patch/paragraph-token-replacer.d.ts
|
|
168
|
+
declare function createTokenReplacer(createTextElementContents: (text: string) => Element[], options?: {
|
|
169
|
+
readonly preserveSpace?: boolean;
|
|
170
|
+
}): ({
|
|
171
|
+
paragraphElement,
|
|
172
|
+
renderedParagraph,
|
|
173
|
+
originalText,
|
|
174
|
+
replacementText
|
|
175
|
+
}: {
|
|
176
|
+
paragraphElement: Element;
|
|
177
|
+
renderedParagraph: RenderedParagraphNode;
|
|
178
|
+
originalText: string;
|
|
179
|
+
replacementText: string;
|
|
180
|
+
}) => Element;
|
|
181
|
+
//#endregion
|
|
182
|
+
//#region src/patch/paragraph-split-inject.d.ts
|
|
183
|
+
declare class TokenNotFoundError extends Error {
|
|
184
|
+
constructor(token: string);
|
|
185
|
+
}
|
|
186
|
+
declare function createSplitInject(ns: XmlNamespaceConfig, createTextElementContents: (text: string) => Element[], options?: {
|
|
187
|
+
readonly preserveSpace?: boolean;
|
|
188
|
+
}): {
|
|
189
|
+
findRunElementIndexWithToken: (paragraphElement: Element, token: string) => number;
|
|
190
|
+
splitRunElement: (runElement: Element, token: string) => {
|
|
191
|
+
readonly left: Element;
|
|
192
|
+
readonly right: Element;
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
//#endregion
|
|
196
|
+
//#region src/patch/xml-patch-utils.d.ts
|
|
197
|
+
declare const toJson: (xmlData: string) => Element;
|
|
198
|
+
/**
|
|
199
|
+
* Creates the inner content of a text element (`w:t` / `a:t`).
|
|
200
|
+
*
|
|
201
|
+
* Returns `[{ type: "text", text }]` for non-empty text, `[]` for empty.
|
|
202
|
+
* The `xml:space` attribute is handled separately by `patchSpaceAttribute`.
|
|
203
|
+
*/
|
|
204
|
+
declare const createTextElementContents: (text: string) => Element[];
|
|
205
|
+
declare const patchSpaceAttribute: (element: Element) => Element;
|
|
206
|
+
declare const getFirstLevelElements: (relationships: Element, id: string) => Element[];
|
|
207
|
+
//#endregion
|
|
208
|
+
//#region src/patch/content-types-manager.d.ts
|
|
209
|
+
declare const appendContentType: (element: Element, contentType: string, extension: string) => void;
|
|
210
|
+
//#endregion
|
|
211
|
+
//#region src/patch/relationship-manager.d.ts
|
|
212
|
+
declare const getNextRelationshipIndex: (relationships: Element) => number;
|
|
213
|
+
declare const appendRelationship: (relationships: Element, id: number | string, type: string, target: string, targetMode?: string) => readonly Element[];
|
|
214
|
+
//#endregion
|
|
215
|
+
//#region src/patch/core-properties-override.d.ts
|
|
216
|
+
declare function applyCorePropertiesOverride(corePropsDoc: Element, overrides: Partial<CorePropertiesOptions>): string;
|
|
217
|
+
//#endregion
|
|
218
|
+
//#region src/patch/types.d.ts
|
|
219
|
+
/** Placeholder delimiter pair surrounding a patch key (e.g. `{{` / `}}`). */
|
|
220
|
+
interface PlaceholderDelimiters {
|
|
221
|
+
start: string;
|
|
222
|
+
end: string;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Shared base options for patch operations.
|
|
226
|
+
*
|
|
227
|
+
* Format-specific patch functions extend this with their `patches` field
|
|
228
|
+
* (and any format-specific options like `keepOriginalStyles`).
|
|
229
|
+
*/
|
|
230
|
+
interface BasePatchOptions<T extends OutputType = OutputType> {
|
|
231
|
+
/** Source document bytes (Buffer / Uint8Array / ArrayBuffer / base64 data URL / …). */
|
|
232
|
+
data: DataType;
|
|
233
|
+
/** Output container type — controls the return type via OutputByType. */
|
|
234
|
+
outputType: T;
|
|
235
|
+
/** Custom placeholder delimiters (default `{{` / `}}`). */
|
|
236
|
+
placeholderDelimiters?: PlaceholderDelimiters;
|
|
237
|
+
}
|
|
238
|
+
//#endregion
|
|
239
|
+
export { DataType as A, OutputByType as C, buildCorePropertiesXml as D, CorePropertiesOptions as E, toUint8Array as M, buildCorePropertiesXmlString as O, OoxmlMimeType as S, convertOutput as T, ReplacerConfig as _, getNextRelationshipIndex as a, PPTX_NS as b, getFirstLevelElements as c, TokenNotFoundError as d, createSplitInject as f, createRunRenderer as g, RenderedParagraphNode as h, appendRelationship as i, isBase64DataURL as j, parseCorePropsElement as k, patchSpaceAttribute as l, createTraverser as m, PlaceholderDelimiters as n, appendContentType as o, createTokenReplacer as p, applyCorePropertiesOverride as r, createTextElementContents as s, BasePatchOptions as t, toJson as u, createReplacer as v, OutputType as w, XmlNamespaceConfig as x, DOCX_NS as y };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { _ as ChartCollection, a as ChartSpaceOptions, c as DataLabelsOptions, d as ErrorBarType, f as ErrorValueType, g as View3DOptions, h as TrendlineType, i as ChartSeriesData, l as ErrorBarDirection, m as TrendlineOptions, n as AxisChartType, o as ChartType, p as TimeUnit, r as BubbleSeriesData, s as DataLabelPosition, t as chartSpaceDesc, u as ErrorBarOptions, v as ChartData } from "./index-BEQ12eyX.mjs";
|
|
2
2
|
import { _ as CustomDescriptor, a as diffTagSets, b as WriteContext, c as FIELD_SPECS, d as boolDecode, f as boolEncode, g as stringify, h as parse, i as checkOrder, l as findFieldSpec, m as enumEncode, n as OrderViolation, o as roundTripFields, p as enumDecode, r as RoundTripResult, s as DescriptorFieldSpec, t as FieldConsistencyReport, u as DescriptorRegistry, v as Descriptor, y as ReadContext } from "./index-L82O3q6V.mjs";
|
|
3
|
-
import { $ as createLineColorList, $a as
|
|
3
|
+
import { $ as createLineColorList, $a as TileOptions, $i as parseArchive, $n as calculateEffectExtent, $r as xsdLineCap, $t as TableStyleListOptions, A as rgbColorDesc, Aa as TargetModeType, Ai as convertPointsToEmu, An as stringifyAdjustmentValues, Ar as createCustomDash, At as PresentationLayoutVariablesOptions, B as createDiagramTextProperties, Ba as buildFill, Bi as OpcCode, Bn as LightRigOptions, Br as hasPlaceholders, Bt as GraphicFrameLockingOptions, C as fillDesc, Ca as appPropertiesDesc, Ci as convertEmuToInches, Cn as PathCommand, Co as ColorTransformOptions, Cr as createOutline, Ct as AnimationLevelOptions, D as hslColorDesc, Da as createOverride, Di as convertInchesToTwip, Dn as PresetGeometryOptions, Dr as LineEndWidth, Dt as MaxChildrenOptions, E as getColorDescriptor, Ea as createDefault, Ei as convertInchesToEmu, En as createCustomGeometry, Er as LineEndType, Et as HierBranchStyle, F as DiagramExtensionListOptions, Fa as createNoFill, Fi as convertUniversalMeasureToTwip, Fn as BevelPresetType, Fr as findAndReplaceImagePlaceholders, Ft as createHierBranch, G as DiagramStyleLabelOptions, Ga as LinearShadeOptions, Gi as DOCX_PARTS, Gn as createScene3D, Gr as replaceMediaPlaceholders, Gt as createGroupLocking, H as createDiagramRelationshipIds, Ha as GradientFillOptions, Hi as OpcSeverity, Hn as Scene3DOptions, Hr as replaceChartPlaceholders, Ht as PictureLockingOptions, I as DiagramExtensionOptions, Ia as BlipFillConfigOptions, Ii as parseUniversalMeasure, In as createBevel, Ir as formatId, It as createMaxChildren, J as HueDirection, Ja as RelativeRect, Ji as PackagePartRegistry, Jn as EffectDagOptions, Jr as replaceVideoPlaceholders, Jt as OnOffStyleType, K as DiagramStyleOptions, Ka as PathShadeOptions, Ki as PART_REGISTRIES, Kn as createSoftEdgeEffect, Kr as replaceNumberingPlaceholders, Kt as createPictureLocking, L as DiagramTextPropertiesOptions, La as BlipFillMediaData, Li as compileMapping, Ln as createBottomBevel, Lr as getMediaRefs, Lt as createOrgChart, M as schemeColorDesc, Ma as PatternFillOptions, Mi as convertToEmu, Mn as Shape3DOptions, Mr as SmartArtRelOptions, Mt as createAdjustList, N as solidFillDesc, Na as PresetPattern, Ni as convertToTwip, Nn as createShape3D, Nr as addSmartArtRelationships, Nt as createAnimateOneByOne, O as parseColorChoice, Oa as RelationshipType, Oi as convertMillimetersToTwip, On as stringifyPresetGeometry, Or as createLineEnd, Ot as OrgChartOptions, P as systemColorDesc, Pa as createPatternFill, Pi as convertUniversalMeasureToEmu, Pn as BevelOptions, Pr as collectPlaceholderKeys, Pt as createAnimationLevel, Q as createFillColorList, Qa as TileAlignment, Qi as ParsedArchive, Qn as EffectListOptions, Qr as xsdEffectContainer, Qt as TablePartStyleOptions, R as createDiagramExtensionList, Ra as FillOptions, Ri as ContentTypeOverrideEntry, Rn as BackdropOptions, Rr as getReferencedMedia, Rt as createPreferredChildren, S as outlineDesc, Sa as AppPropertiesOptions, Si as PixelPosition, Sn as GeomRect, So as createHslColor, Sr as PresetDash, St as AnimateOneByOneValue, T as patternFillDesc, Ta as OverrideAttributes, Ti as convertEmuToPoints, Tn as PathOptions, Tr as LineEndOptions, Tt as HierBranchOptions, U as ColorListOptions, Ua as GradientShadeOptions, Ui as summarizeOpcIssues, Un as SphereCoords, Ur as replaceHyperlinkPlaceholders, Ut as ShapeLockingOptions, V as DiagramRelationshipIdsOptions, Va as extractBlipFillMedia, Vi as OpcIssue, Vn as Point3D, Vr as replaceAllPlaceholders, Vt as GroupLockingOptions, W as ColorMethod, Wa as GradientStop, Wi as validateOpcConsistency, Wn as Vector3D, Wr as replaceImagePlaceholders, Wt as createGraphicFrameLocking, X as createDiagramStyle, Xa as createGradientFill, Xi as PartPresence, Xn as BlurEffectOptions, Xr as xsdBlendMode, Xt as TableCellBorderOptions, Y as StyleMatrixIndex, Ya as TileFlipMode, Yi as PartDef, Yn as createEffectDag, Yr as invertMap, Yt as StyleMatrixReferenceOptions, Z as createEffectColorList, Za as createGradientStop, Zi as XLSX_PARTS, Zn as EffectExtent, Zr as xsdCompoundLine, Zt as TableCellStyleOptions, _ as graphicFrameLockingDesc, _a as zipSyncAndConvert, _i as uniqueUuid, _n as createBlipFill, _o as createRgbColor, _r as LineCap, _t as createStyleDefinitionHeader, a as blipDesc, aa as PackerOptions, ai as xsdPresetShadow, an as createTableStyleList, ao as SolidFillOptions, ar as createPresetShadowEffect, at as ColorsDefinitionHeaderOptions, b as shapeLockingDesc, ba as customPropertiesDesc, bi as randomBytes, bn as ConnectionSite, bo as createPresetColor, br as OutlineOptions, bt as AdjustOptions, c as stretchDesc, ca as ZIP_STORED_LEVEL, ci as xsdTextAlign, cn as MediaTransformation, co as SystemColor, cr as createOuterShadowEffect, ct as DiagramNameOptions, d as scene3DDesc, da as createPacker, di as xsdUnderlineStyle, dn as Transform2DOptions, do as SchemeColor, dr as GlowEffectOptions, dt as StyleDefinitionHeaderListOptions, ea as decodeBase64, ei as xsdLineEndSize, en as TableStyleOptions, eo as createTileInfo, er as createEffectList, et as createStyleLabel, f as shape3DDesc, fa as createZipStream, fi as xsdVerticalMergeRev, fn as createGroupTransform2D, fo as SchemeColorOptions, fr as createGlowEffect, ft as StyleDefinitionHeaderOptions, g as presetGeometryDesc, ga as zipAndConvert, gi as uniqueNumericIdCreator, gn as BlipFillOptions, go as RgbColorOptions, gr as CompoundLine, gt as createLayoutDefinitionHeaderList, h as customGeometryDesc, ha as unzipSync, hi as uniqueId, hn as createExtentionList, ho as createScRgbColor, hr as createFillOverlayEffect, ht as createLayoutDefinitionHeader, i as presentationLayoutVariablesDesc, ia as Packer, ii as xsdPenAlignment, in as createTableStyle, io as createBlipEffects, ir as PresetShadowVal, it as ColorsDefinitionHeaderListOptions, j as scRgbColorDesc, ja as createGroupFill, ji as convertPositionToEmu, jn as PresetMaterialType, jr as IdFormat, jt as createAdjust, k as presetColorDesc, ka as Relationships, ki as convertPixelsToEmu, kn as GeometryGuide, kr as DashStop, kt as PreferredChildrenOptions, l as tileDesc, la as ZipOptions, li as xsdTextAnchor, ln as createTransformation, lo as SystemColorOptions, lr as InnerShadowEffectOptions, lt as LayoutDefinitionHeaderListOptions, m as transform2DDesc, ma as strFromU8, mi as hashedId, mn as stringifyStretch, mo as ScRgbColorOptions, mr as FillOverlayEffectOptions, mt as createColorsDefinitionHeaderList, n as diagramRelationshipIdsDesc, na as CompileFn, ni as xsdPathFillMode, nn as TableTextStyleOptions, no as createSourceRectangle, nr as createReflectionEffect, nt as createTextFillColorList, o as blipFillDesc, oa as XmlifyedFile, oi as xsdRectAlignment, on as parseTableStyleList, oo as createColorElement, or as OuterShadowEffectOptions, ot as DiagramCategoryOptions, p as groupTransform2DDesc, pa as levelForMediaName, pi as UniqueNumericIdCreator, pn as createTransform2D, po as createSchemeColor, pr as BlendMode, pt as createColorsDefinitionHeader, q as FontCollectionIndex, qa as PathShadeType, qi as PPTX_PARTS, qn as EffectContainerType, qr as replaceSmartArtPlaceholders, qt as createShapeLocking, r as diagramStyleDesc, ra as CompressionOptions, ri as xsdPattern, rn as ThemeableLineStyleOptions, ro as BlipEffectsOptions, rr as PresetShadowEffectOptions, rt as createTextLineColorList, s as sourceRectangleDesc, sa as ZIP_DEFLATE_LEVEL, si as xsdStrikeStyle, sn as MediaDataTransformation, so as createSolidFill, sr as RectAlignment, st as DiagramDescriptionOptions, t as diagramExtensionListDesc, ta as encodeBase64, ti as xsdMaterialType, tn as TableStyleRegion, to as SourceRectangleOptions, tr as ReflectionEffectOptions, tt as createTextEffectColorList, u as bevelDesc, ua as Zippable, ui as xsdTextCaps, un as GroupTransform2DOptions, uo as createSystemColor, ur as createInnerShadowEffect, ut as LayoutDefinitionHeaderOptions, v as groupLockingDesc, va as CustomPropertiesInput, vi as derivePasswordHash, vn as BlipOptions, vo as PresetColor, vr as LineJoin, vt as createStyleDefinitionHeaderList, w as gradientFillDesc, wa as DefaultAttributes, wi as convertEmuToPixels, wn as PathFillMode, wo as createColorTransforms, wr as LineEndLength, wt as AnimationLevelValue, x as effectListDesc, xa as AppPropertiesInput, xi as EmuPosition, xn as CustomGeometryOptions, xo as HslColorOptions, xr as PenAlignment, xt as AnimateOneByOneOptions, y as pictureLockingDesc, ya as CustomPropertyOptions, yi as hashPasswordAgile, yn as createBlip, yo as PresetColorOptions, yr as OutlineFillProperties, yt as AdjustListOptions, z as createDiagramShape3D, za as GradientStopOptions, zi as buildContentTypeOverrides, zn as CameraOptions, zr as getVideoRefs, zt as createPresentationLayoutVariables } from "./index-Bpw3LFuI.mjs";
|
|
4
|
+
import { A as DataType, C as OutputByType, D as buildCorePropertiesXml, E as CorePropertiesOptions, M as toUint8Array, O as buildCorePropertiesXmlString, S as OoxmlMimeType, T as convertOutput, _ as ReplacerConfig, a as getNextRelationshipIndex, b as PPTX_NS, c as getFirstLevelElements, d as TokenNotFoundError, f as createSplitInject, g as createRunRenderer, h as RenderedParagraphNode, i as appendRelationship, j as isBase64DataURL, k as parseCorePropsElement, l as patchSpaceAttribute, m as createTraverser, n as PlaceholderDelimiters, o as appendContentType, p as createTokenReplacer, r as applyCorePropertiesOverride, s as createTextElementContents, t as BasePatchOptions, u as toJson, v as createReplacer, w as OutputType, x as XmlNamespaceConfig, y as DOCX_NS } from "./index-DEeO4sOq.mjs";
|
|
4
5
|
import { a as PointPropertySetOptions, c as stringifyDataModel, d as getColorXml, f as getLayoutXml, g as STYLE_CATEGORIES, h as LAYOUT_CATEGORIES, i as SmartArtData, l as stringifyConnection, m as COLOR_CATEGORIES, n as createDataModel, o as stringifyPoint, p as getStyleXml, r as SmartArtCollection, s as stringifyTransPoint, t as TreeNode, u as DEFAULT_DRAWING_XML } from "./index-CsQP7Cl4.mjs";
|
|
5
|
-
import { _ as PPTX_NS, a as getFirstLevelElements, c as TokenNotFoundError, d as createTraverser, f as RenderedParagraphNode, g as DOCX_NS, h as createReplacer, i as createTextElementContents, l as createSplitInject, m as ReplacerConfig, n as getNextRelationshipIndex, o as patchSpaceAttribute, p as createRunRenderer, r as appendContentType, s as toJson, t as appendRelationship, u as createTokenReplacer, v as XmlNamespaceConfig } from "./index-DYy8l709.mjs";
|
|
6
6
|
import { a as ColorSchemeOptions, i as createThemeXml, n as DEFAULT_COLORS, o as FontSchemeOptions, r as buildThemeXml, s as ThemeOptions, t as themeDesc } from "./index-vEeWkbm5.mjs";
|
|
7
7
|
import { C as uCharHexNumber, S as twipsMeasureValue, T as unsignedDecimalNumber, _ as pointMeasureValue, a as ThemeColor, b as signedHpsMeasureValue, c as dateTimeValue, d as hexBinary, f as hexColorValue, g as percentageValue, h as measurementOrPercentValue, i as RelativeMeasure, l as decimalNumber, m as longHexNumber, n as PositivePercentage, o as ThemeFont, p as hpsMeasureValue, r as PositiveUniversalMeasure, s as UniversalMeasure, t as Percentage, u as eighthPointMeasureValue, v as positiveUniversalMeasureValue, w as universalMeasureValue, x as signedTwipsMeasureValue, y as shortHexNumber } from "./values-Dqj8cbcy.mjs";
|
|
8
|
-
export {
|
|
8
|
+
export { type AdjustListOptions, type AdjustOptions, type AnimateOneByOneOptions, AnimateOneByOneValue, type AnimationLevelOptions, AnimationLevelValue, type AppPropertiesInput, type AppPropertiesOptions, AxisChartType, type BackdropOptions, type BasePatchOptions, type BevelOptions, BevelPresetType, BlendMode, type BlipEffectsOptions, type BlipFillConfigOptions, type BlipFillMediaData, type BlipFillOptions, type BlipOptions, type BlurEffectOptions, BubbleSeriesData, COLOR_CATEGORIES, type CameraOptions, ChartCollection, ChartData, ChartSeriesData, ChartSpaceOptions, ChartType, type ColorListOptions, ColorMethod, type ColorSchemeOptions, type ColorTransformOptions, type ColorsDefinitionHeaderListOptions, type ColorsDefinitionHeaderOptions, type CompileFn, CompoundLine, type CompressionOptions, type ConnectionSite, type ContentTypeOverrideEntry, type CorePropertiesOptions, type CustomDescriptor, type CustomGeometryOptions, type CustomPropertiesInput, type CustomPropertyOptions, DEFAULT_COLORS, DEFAULT_DRAWING_XML, DOCX_NS, DOCX_PARTS, type DashStop, DataLabelPosition, DataLabelsOptions, DataType, type DefaultAttributes, type Descriptor, type DescriptorFieldSpec, DescriptorRegistry, type DiagramCategoryOptions, type DiagramDescriptionOptions, type DiagramExtensionListOptions, type DiagramExtensionOptions, type DiagramNameOptions, type DiagramRelationshipIdsOptions, type DiagramStyleLabelOptions, type DiagramStyleOptions, type DiagramTextPropertiesOptions, type EffectContainerType, type EffectDagOptions, type EffectExtent, type EffectListOptions, EmuPosition, ErrorBarDirection, ErrorBarOptions, ErrorBarType, ErrorValueType, FIELD_SPECS, type FieldConsistencyReport, type FillOptions, type FillOverlayEffectOptions, FontCollectionIndex, type FontSchemeOptions, type GeomRect, type GeometryGuide, type GlowEffectOptions, type GradientFillOptions, type GradientShadeOptions, type GradientStop, type GradientStopOptions, type GraphicFrameLockingOptions, type GroupLockingOptions, type GroupTransform2DOptions, type HierBranchOptions, HierBranchStyle, type HslColorOptions, HueDirection, IdFormat, type InnerShadowEffectOptions, LAYOUT_CATEGORIES, type LayoutDefinitionHeaderListOptions, type LayoutDefinitionHeaderOptions, type LightRigOptions, LineCap, LineEndLength, type LineEndOptions, LineEndType, LineEndWidth, LineJoin, type LinearShadeOptions, type MaxChildrenOptions, type MediaDataTransformation, type MediaTransformation, type OnOffStyleType, OoxmlMimeType, type OpcCode, type OpcIssue, type OpcSeverity, type OrderViolation, type OrgChartOptions, type OuterShadowEffectOptions, type OutlineFillProperties, type OutlineOptions, type OutputByType, type OutputType, type OverrideAttributes, PART_REGISTRIES, PPTX_NS, PPTX_PARTS, type PackagePartRegistry, type Packer, type PackerOptions, ParsedArchive, type PartDef, type PartPresence, type PathCommand, type PathFillMode, type PathOptions, type PathShadeOptions, PathShadeType, type PatternFillOptions, PenAlignment, Percentage, type PictureLockingOptions, PixelPosition, type PlaceholderDelimiters, type Point3D, PointPropertySetOptions, PositivePercentage, PositiveUniversalMeasure, type PreferredChildrenOptions, type PresentationLayoutVariablesOptions, PresetColor, type PresetColorOptions, PresetDash, type PresetGeometryOptions, PresetMaterialType, PresetPattern, type PresetShadowEffectOptions, PresetShadowVal, type ReadContext, RectAlignment, type ReflectionEffectOptions, type RelationshipType, Relationships, RelativeMeasure, type RelativeRect, type RenderedParagraphNode, type ReplacerConfig, type RgbColorOptions, type RoundTripResult, STYLE_CATEGORIES, type ScRgbColorOptions, type Scene3DOptions, SchemeColor, type SchemeColorOptions, type Shape3DOptions, type ShapeLockingOptions, SmartArtCollection, SmartArtData, SmartArtRelOptions, type SolidFillOptions, type SourceRectangleOptions, type SphereCoords, type StyleDefinitionHeaderListOptions, type StyleDefinitionHeaderOptions, StyleMatrixIndex, type StyleMatrixReferenceOptions, SystemColor, type SystemColorOptions, type TableCellBorderOptions, type TableCellStyleOptions, type TablePartStyleOptions, type TableStyleListOptions, type TableStyleOptions, type TableStyleRegion, type TableTextStyleOptions, TargetModeType, ThemeColor, ThemeFont, type ThemeOptions, type ThemeableLineStyleOptions, TileAlignment, TileFlipMode, type TileOptions, TimeUnit, TokenNotFoundError, type Transform2DOptions, TreeNode, TrendlineOptions, TrendlineType, UniqueNumericIdCreator, UniversalMeasure, type Vector3D, View3DOptions, type WriteContext, XLSX_PARTS, type XmlNamespaceConfig, type XmlifyedFile, ZIP_DEFLATE_LEVEL, ZIP_STORED_LEVEL, type ZipOptions, type Zippable, addSmartArtRelationships, appPropertiesDesc, appendContentType, appendRelationship, applyCorePropertiesOverride, bevelDesc, blipDesc, blipFillDesc, boolDecode, boolEncode, buildContentTypeOverrides, buildCorePropertiesXml, buildCorePropertiesXmlString, buildFill, buildThemeXml, calculateEffectExtent, chartSpaceDesc, checkOrder, collectPlaceholderKeys, compileMapping, convertEmuToInches, convertEmuToPixels, convertEmuToPoints, convertInchesToEmu, convertInchesToTwip, convertMillimetersToTwip, convertOutput, convertPixelsToEmu, convertPointsToEmu, convertPositionToEmu, convertToEmu, convertToTwip, convertUniversalMeasureToEmu, convertUniversalMeasureToTwip, createAdjust, createAdjustList, createAnimateOneByOne, createAnimationLevel, createBevel, createBlip, createBlipEffects, createBlipFill, createBottomBevel, createColorElement, createColorTransforms, createColorsDefinitionHeader, createColorsDefinitionHeaderList, createCustomDash, createCustomGeometry, createDataModel, createDefault, createDiagramExtensionList, createDiagramRelationshipIds, createDiagramShape3D, createDiagramStyle, createDiagramTextProperties, createEffectColorList, createEffectDag, createEffectList, createExtentionList, createFillColorList, createFillOverlayEffect, createGlowEffect, createGradientFill, createGradientStop, createGraphicFrameLocking, createGroupFill, createGroupLocking, createGroupTransform2D, createHierBranch, createHslColor, createInnerShadowEffect, createLayoutDefinitionHeader, createLayoutDefinitionHeaderList, createLineColorList, createLineEnd, createMaxChildren, createNoFill, createOrgChart, createOuterShadowEffect, createOutline, createOverride, createPacker, createPatternFill, createPictureLocking, createPreferredChildren, createPresentationLayoutVariables, createPresetColor, createPresetShadowEffect, createReflectionEffect, createReplacer, createRgbColor, createRunRenderer, createScRgbColor, createScene3D, createSchemeColor, createShape3D, createShapeLocking, createSoftEdgeEffect, createSolidFill, createSourceRectangle, createSplitInject, createStyleDefinitionHeader, createStyleDefinitionHeaderList, createStyleLabel, createSystemColor, createTableStyle, createTableStyleList, createTextEffectColorList, createTextElementContents, createTextFillColorList, createTextLineColorList, createThemeXml, createTileInfo, createTokenReplacer, createTransform2D, createTransformation, createTraverser, createZipStream, customGeometryDesc, customPropertiesDesc, dateTimeValue, decimalNumber, decodeBase64, derivePasswordHash, diagramExtensionListDesc, diagramRelationshipIdsDesc, diagramStyleDesc, diffTagSets, effectListDesc, eighthPointMeasureValue, encodeBase64, enumDecode, enumEncode, extractBlipFillMedia, fillDesc, findAndReplaceImagePlaceholders, findFieldSpec, formatId, getColorDescriptor, getColorXml, getFirstLevelElements, getLayoutXml, getMediaRefs, getNextRelationshipIndex, getReferencedMedia, getStyleXml, getVideoRefs, gradientFillDesc, graphicFrameLockingDesc, groupLockingDesc, groupTransform2DDesc, hasPlaceholders, hashPasswordAgile, hashedId, hexBinary, hexColorValue, hpsMeasureValue, hslColorDesc, invertMap, isBase64DataURL, levelForMediaName, longHexNumber, measurementOrPercentValue, outlineDesc, parse, parseArchive, parseColorChoice, parseCorePropsElement, parseTableStyleList, parseUniversalMeasure, patchSpaceAttribute, patternFillDesc, percentageValue, pictureLockingDesc, pointMeasureValue, positiveUniversalMeasureValue, presentationLayoutVariablesDesc, presetColorDesc, presetGeometryDesc, randomBytes, replaceAllPlaceholders, replaceChartPlaceholders, replaceHyperlinkPlaceholders, replaceImagePlaceholders, replaceMediaPlaceholders, replaceNumberingPlaceholders, replaceSmartArtPlaceholders, replaceVideoPlaceholders, rgbColorDesc, roundTripFields, scRgbColorDesc, scene3DDesc, schemeColorDesc, shape3DDesc, shapeLockingDesc, shortHexNumber, signedHpsMeasureValue, signedTwipsMeasureValue, solidFillDesc, sourceRectangleDesc, strFromU8, stretchDesc, stringify, stringifyAdjustmentValues, stringifyConnection, stringifyDataModel, stringifyPoint, stringifyPresetGeometry, stringifyStretch, stringifyTransPoint, summarizeOpcIssues, systemColorDesc, themeDesc, tileDesc, toJson, toUint8Array, transform2DDesc, twipsMeasureValue, uCharHexNumber, uniqueId, uniqueNumericIdCreator, uniqueUuid, universalMeasureValue, unsignedDecimalNumber, unzipSync, validateOpcConsistency, xsdBlendMode, xsdCompoundLine, xsdEffectContainer, xsdLineCap, xsdLineEndSize, xsdMaterialType, xsdPathFillMode, xsdPattern, xsdPenAlignment, xsdPresetShadow, xsdRectAlignment, xsdStrikeStyle, xsdTextAlign, xsdTextAnchor, xsdTextCaps, xsdUnderlineStyle, xsdVerticalMergeRev, zipAndConvert, zipSyncAndConvert };
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { $ as solidFillDesc, $n as createTileInfo, $r as
|
|
1
|
+
import { $ as solidFillDesc, $n as createTileInfo, $r as unzipSync, $t as convertToTwip, A as bevelDesc, An as createFillOverlayEffect, Ar as SchemeColor, At as createHierBranch, B as shapeLockingDesc, Bn as createLineEnd, Br as PART_REGISTRIES, Bt as createTableStyleList, C as diagramStyleDesc, Cn as PresetShadowVal, Cr as uniqueUuid, Ct as AnimateOneByOneValue, D as sourceRectangleDesc, Dn as createInnerShadowEffect, Dr as createSolidFill, Dt as createAdjustList, E as blipFillDesc, En as createOuterShadowEffect, Er as createColorElement, Et as createAdjust, F as customGeometryDesc, Fn as PresetDash, Fr as createPresetColor, Ft as createGraphicFrameLocking, G as patternFillDesc, Gn as extractBlipFillMedia, Gr as ParsedArchive, Gt as convertEmuToPoints, H as outlineDesc, Hn as createGroupFill, Hr as XLSX_PARTS, Ht as createTransformation, I as presetGeometryDesc, In as createOutline, Ir as createHslColor, It as createGroupLocking, J as parseColorChoice, Jn as PathShadeType, Jr as ZIP_STORED_LEVEL, Jt as convertMillimetersToTwip, K as getColorDescriptor, Kn as PresetPattern, Kr as parseArchive, Kt as convertInchesToEmu, L as graphicFrameLockingDesc, Ln as LineEndLength, Lr as createColorTransforms, Lt as createPictureLocking, M as shape3DDesc, Mn as LineCap, Mr as createScRgbColor, Mt as createOrgChart, N as groupTransform2DDesc, Nn as LineJoin, Nr as createRgbColor, Nt as createPreferredChildren, O as stretchDesc, On as createGlowEffect, Or as SystemColor, Ot as createAnimateOneByOne, P as transform2DDesc, Pn as PenAlignment, Pr as PresetColor, Pt as createPresentationLayoutVariables, Q as schemeColorDesc, Qn as TileAlignment, Qr as strFromU8, Qt as convertToEmu, R as groupLockingDesc, Rn as LineEndType, Rr as buildContentTypeOverrides, Rt as createShapeLocking, S as diagramRelationshipIdsDesc, Sn as createReflectionEffect, Sr as uniqueNumericIdCreator, St as createStyleDefinitionHeaderList, T as blipDesc, Tn as RectAlignment, Tr as toUint8Array, Tt as HierBranchStyle, U as fillDesc, Un as createNoFill, Ur as summarizeOpcIssues, Ut as convertEmuToInches, V as effectListDesc, Vn as createCustomDash, Vr as PPTX_PARTS, Vt as parseTableStyleList, W as gradientFillDesc, Wn as buildFill, Wr as validateOpcConsistency, Wt as convertEmuToPixels, X as rgbColorDesc, Xn as createGradientFill, Xr as createZipStream, Xt as convertPointsToEmu, Y as presetColorDesc, Yn as TileFlipMode, Yr as createPacker, Yt as convertPixelsToEmu, Z as scRgbColorDesc, Zn as createGradientStop, Zr as levelForMediaName, Zt as convertPositionToEmu, _ as derivePasswordHash, _n as createScene3D, _r as xsdVerticalMergeRev, _t as createColorsDefinitionHeader, a as getMediaRefs, ai as encodeBase64, an as stringifyStretch, ar as xsdLineEndSize, at as ColorMethod, b as compileMapping, bn as createEffectList, br as hashedId, bt as createLayoutDefinitionHeaderList, c as hasPlaceholders, ci as createDefault, cn as createExtentionList, cr as xsdPattern, ct as StyleMatrixIndex, d as replaceHyperlinkPlaceholders, di as TargetModeType, dn as stringifyAdjustmentValues, dr as xsdRectAlignment, dt as createFillColorList, ei as zipAndConvert, en as convertUniversalMeasureToEmu, er as invertMap, et as systemColorDesc, f as replaceImagePlaceholders, fn as PresetMaterialType, fr as xsdStrikeStyle, ft as createLineColorList, g as replaceVideoPlaceholders, gn as createBottomBevel, gr as xsdUnderlineStyle, gt as createTextLineColorList, h as replaceSmartArtPlaceholders, hn as createBevel, hr as xsdTextCaps, ht as createTextFillColorList, i as formatId, ii as decodeBase64, in as createTransform2D, ir as xsdLineCap, it as createDiagramRelationshipIds, j as scene3DDesc, jn as CompoundLine, jr as createSchemeColor, jt as createMaxChildren, k as tileDesc, kn as BlendMode, kr as createSystemColor, kt as createAnimationLevel, l as replaceAllPlaceholders, li as createOverride, ln as createCustomGeometry, lr as xsdPenAlignment, lt as createDiagramStyle, m as replaceNumberingPlaceholders, mn as BevelPresetType, mr as xsdTextAnchor, mt as createTextEffectColorList, n as collectPlaceholderKeys, ni as OoxmlMimeType, nn as parseUniversalMeasure, nr as xsdCompoundLine, nt as createDiagramShape3D, o as getReferencedMedia, oi as customPropertiesDesc, on as createBlipFill, or as xsdMaterialType, ot as FontCollectionIndex, p as replaceMediaPlaceholders, pn as createShape3D, pr as xsdTextAlign, pt as createStyleLabel, q as hslColorDesc, qn as createPatternFill, qr as ZIP_DEFLATE_LEVEL, qt as convertInchesToTwip, r as findAndReplaceImagePlaceholders, ri as convertOutput, rn as createGroupTransform2D, rr as xsdEffectContainer, rt as createDiagramTextProperties, s as getVideoRefs, si as appPropertiesDesc, sn as createBlip, sr as xsdPathFillMode, st as HueDirection, t as addSmartArtRelationships, ti as zipSyncAndConvert, tn as convertUniversalMeasureToTwip, tr as xsdBlendMode, tt as createDiagramExtensionList, u as replaceChartPlaceholders, ui as Relationships, un as stringifyPresetGeometry, ur as xsdPresetShadow, ut as createEffectColorList, v as hashPasswordAgile, vn as createEffectDag, vr as createSourceRectangle, vt as createColorsDefinitionHeaderList, w as presentationLayoutVariablesDesc, wn as createPresetShadowEffect, wr as isBase64DataURL, wt as AnimationLevelValue, x as diagramExtensionListDesc, xn as createSoftEdgeEffect, xr as uniqueId, xt as createStyleDefinitionHeader, y as randomBytes, yn as calculateEffectExtent, yr as createBlipEffects, yt as createLayoutDefinitionHeader, z as pictureLockingDesc, zn as LineEndWidth, zr as DOCX_PARTS, zt as createTableStyle } from "./src-DaZbVB3f.mjs";
|
|
2
|
+
import { _ as buildCorePropertiesXml, a as createReplacer, c as createTokenReplacer, d as createTextElementContents, f as getFirstLevelElements, g as PPTX_NS, h as DOCX_NS, i as appendContentType, l as TokenNotFoundError, m as toJson, n as appendRelationship, o as createTraverser, p as patchSpaceAttribute, r as getNextRelationshipIndex, s as createRunRenderer, t as applyCorePropertiesOverride, u as createSplitInject, v as buildCorePropertiesXmlString, y as parseCorePropsElement } from "./patch-DocIv0Sn.mjs";
|
|
2
3
|
import { a as stringifyDataModel, c as getColorXml, d as COLOR_CATEGORIES, f as LAYOUT_CATEGORIES, i as stringifyTransPoint, l as getLayoutXml, n as SmartArtCollection, o as stringifyConnection, p as STYLE_CATEGORIES, r as stringifyPoint, s as DEFAULT_DRAWING_XML, t as createDataModel, u as getStyleXml } from "./smartart-DCY-Vdv7.mjs";
|
|
3
4
|
import { a as TimeUnit, c as ChartCollection, i as ErrorValueType, n as ErrorBarDirection, o as TrendlineType, r as ErrorBarType, s as chartSpaceDesc, t as DataLabelPosition } from "./chart-DwE8FCFk.mjs";
|
|
4
|
-
import { a as roundTripFields, c as boolEncode, d as parse, f as stringify, i as diffTagSets, l as enumDecode, n as findFieldSpec, o as DescriptorRegistry, r as checkOrder, s as boolDecode, t as FIELD_SPECS, u as enumEncode } from "./descriptor-
|
|
5
|
-
import { a as createTraverser, c as TokenNotFoundError, d as getFirstLevelElements, f as patchSpaceAttribute, h as PPTX_NS, i as createReplacer, l as createSplitInject, m as DOCX_NS, n as getNextRelationshipIndex, o as createRunRenderer, p as toJson, r as appendContentType, s as createTokenReplacer, t as appendRelationship, u as createTextElementContents } from "./patch-ilNZTQmG.mjs";
|
|
5
|
+
import { a as roundTripFields, c as boolEncode, d as parse, f as stringify, i as diffTagSets, l as enumDecode, n as findFieldSpec, o as DescriptorRegistry, r as checkOrder, s as boolDecode, t as FIELD_SPECS, u as enumEncode } from "./descriptor-BdWTH1vv.mjs";
|
|
6
6
|
import { i as DEFAULT_COLORS, n as createThemeXml, r as buildThemeXml, t as themeDesc } from "./theme-CiNzdl-9.mjs";
|
|
7
7
|
import { _ as twipsMeasureValue, a as eighthPointMeasureValue, b as unsignedDecimalNumber, c as hpsMeasureValue, d as percentageValue, f as pointMeasureValue, g as signedTwipsMeasureValue, h as signedHpsMeasureValue, i as decimalNumber, l as longHexNumber, m as shortHexNumber, n as ThemeFont, o as hexBinary, p as positiveUniversalMeasureValue, r as dateTimeValue, s as hexColorValue, t as ThemeColor, u as measurementOrPercentValue, v as uCharHexNumber, y as universalMeasureValue } from "./values-CVIZcTRw.mjs";
|
|
8
|
-
export {
|
|
8
|
+
export { AnimateOneByOneValue, AnimationLevelValue, BevelPresetType, BlendMode, COLOR_CATEGORIES, ChartCollection, ColorMethod, CompoundLine, DEFAULT_COLORS, DEFAULT_DRAWING_XML, DOCX_NS, DOCX_PARTS, DataLabelPosition, DescriptorRegistry, ErrorBarDirection, ErrorBarType, ErrorValueType, FIELD_SPECS, FontCollectionIndex, HierBranchStyle, HueDirection, LAYOUT_CATEGORIES, LineCap, LineEndLength, LineEndType, LineEndWidth, LineJoin, OoxmlMimeType, PART_REGISTRIES, PPTX_NS, PPTX_PARTS, ParsedArchive, PathShadeType, PenAlignment, PresetColor, PresetDash, PresetMaterialType, PresetPattern, PresetShadowVal, RectAlignment, Relationships, STYLE_CATEGORIES, SchemeColor, SmartArtCollection, StyleMatrixIndex, SystemColor, TargetModeType, ThemeColor, ThemeFont, TileAlignment, TileFlipMode, TimeUnit, TokenNotFoundError, TrendlineType, XLSX_PARTS, ZIP_DEFLATE_LEVEL, ZIP_STORED_LEVEL, addSmartArtRelationships, appPropertiesDesc, appendContentType, appendRelationship, applyCorePropertiesOverride, bevelDesc, blipDesc, blipFillDesc, boolDecode, boolEncode, buildContentTypeOverrides, buildCorePropertiesXml, buildCorePropertiesXmlString, buildFill, buildThemeXml, calculateEffectExtent, chartSpaceDesc, checkOrder, collectPlaceholderKeys, compileMapping, convertEmuToInches, convertEmuToPixels, convertEmuToPoints, convertInchesToEmu, convertInchesToTwip, convertMillimetersToTwip, convertOutput, convertPixelsToEmu, convertPointsToEmu, convertPositionToEmu, convertToEmu, convertToTwip, convertUniversalMeasureToEmu, convertUniversalMeasureToTwip, createAdjust, createAdjustList, createAnimateOneByOne, createAnimationLevel, createBevel, createBlip, createBlipEffects, createBlipFill, createBottomBevel, createColorElement, createColorTransforms, createColorsDefinitionHeader, createColorsDefinitionHeaderList, createCustomDash, createCustomGeometry, createDataModel, createDefault, createDiagramExtensionList, createDiagramRelationshipIds, createDiagramShape3D, createDiagramStyle, createDiagramTextProperties, createEffectColorList, createEffectDag, createEffectList, createExtentionList, createFillColorList, createFillOverlayEffect, createGlowEffect, createGradientFill, createGradientStop, createGraphicFrameLocking, createGroupFill, createGroupLocking, createGroupTransform2D, createHierBranch, createHslColor, createInnerShadowEffect, createLayoutDefinitionHeader, createLayoutDefinitionHeaderList, createLineColorList, createLineEnd, createMaxChildren, createNoFill, createOrgChart, createOuterShadowEffect, createOutline, createOverride, createPacker, createPatternFill, createPictureLocking, createPreferredChildren, createPresentationLayoutVariables, createPresetColor, createPresetShadowEffect, createReflectionEffect, createReplacer, createRgbColor, createRunRenderer, createScRgbColor, createScene3D, createSchemeColor, createShape3D, createShapeLocking, createSoftEdgeEffect, createSolidFill, createSourceRectangle, createSplitInject, createStyleDefinitionHeader, createStyleDefinitionHeaderList, createStyleLabel, createSystemColor, createTableStyle, createTableStyleList, createTextEffectColorList, createTextElementContents, createTextFillColorList, createTextLineColorList, createThemeXml, createTileInfo, createTokenReplacer, createTransform2D, createTransformation, createTraverser, createZipStream, customGeometryDesc, customPropertiesDesc, dateTimeValue, decimalNumber, decodeBase64, derivePasswordHash, diagramExtensionListDesc, diagramRelationshipIdsDesc, diagramStyleDesc, diffTagSets, effectListDesc, eighthPointMeasureValue, encodeBase64, enumDecode, enumEncode, extractBlipFillMedia, fillDesc, findAndReplaceImagePlaceholders, findFieldSpec, formatId, getColorDescriptor, getColorXml, getFirstLevelElements, getLayoutXml, getMediaRefs, getNextRelationshipIndex, getReferencedMedia, getStyleXml, getVideoRefs, gradientFillDesc, graphicFrameLockingDesc, groupLockingDesc, groupTransform2DDesc, hasPlaceholders, hashPasswordAgile, hashedId, hexBinary, hexColorValue, hpsMeasureValue, hslColorDesc, invertMap, isBase64DataURL, levelForMediaName, longHexNumber, measurementOrPercentValue, outlineDesc, parse, parseArchive, parseColorChoice, parseCorePropsElement, parseTableStyleList, parseUniversalMeasure, patchSpaceAttribute, patternFillDesc, percentageValue, pictureLockingDesc, pointMeasureValue, positiveUniversalMeasureValue, presentationLayoutVariablesDesc, presetColorDesc, presetGeometryDesc, randomBytes, replaceAllPlaceholders, replaceChartPlaceholders, replaceHyperlinkPlaceholders, replaceImagePlaceholders, replaceMediaPlaceholders, replaceNumberingPlaceholders, replaceSmartArtPlaceholders, replaceVideoPlaceholders, rgbColorDesc, roundTripFields, scRgbColorDesc, scene3DDesc, schemeColorDesc, shape3DDesc, shapeLockingDesc, shortHexNumber, signedHpsMeasureValue, signedTwipsMeasureValue, solidFillDesc, sourceRectangleDesc, strFromU8, stretchDesc, stringify, stringifyAdjustmentValues, stringifyConnection, stringifyDataModel, stringifyPoint, stringifyPresetGeometry, stringifyStretch, stringifyTransPoint, summarizeOpcIssues, systemColorDesc, themeDesc, tileDesc, toJson, toUint8Array, transform2DDesc, twipsMeasureValue, uCharHexNumber, uniqueId, uniqueNumericIdCreator, uniqueUuid, universalMeasureValue, unsignedDecimalNumber, unzipSync, validateOpcConsistency, xsdBlendMode, xsdCompoundLine, xsdEffectContainer, xsdLineCap, xsdLineEndSize, xsdMaterialType, xsdPathFillMode, xsdPattern, xsdPenAlignment, xsdPresetShadow, xsdRectAlignment, xsdStrikeStyle, xsdTextAlign, xsdTextAnchor, xsdTextCaps, xsdUnderlineStyle, xsdVerticalMergeRev, zipAndConvert, zipSyncAndConvert };
|
package/dist/patch/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
export { DOCX_NS, PPTX_NS, type RenderedParagraphNode, type ReplacerConfig, TokenNotFoundError, type XmlNamespaceConfig, appendContentType, appendRelationship, createReplacer, createRunRenderer, createSplitInject, createTextElementContents, createTokenReplacer, createTraverser, getFirstLevelElements, getNextRelationshipIndex, patchSpaceAttribute, toJson };
|
|
1
|
+
import { _ as ReplacerConfig, a as getNextRelationshipIndex, b as PPTX_NS, c as getFirstLevelElements, d as TokenNotFoundError, f as createSplitInject, g as createRunRenderer, h as RenderedParagraphNode, i as appendRelationship, l as patchSpaceAttribute, m as createTraverser, n as PlaceholderDelimiters, o as appendContentType, p as createTokenReplacer, r as applyCorePropertiesOverride, s as createTextElementContents, t as BasePatchOptions, u as toJson, v as createReplacer, x as XmlNamespaceConfig, y as DOCX_NS } from "../index-DEeO4sOq.mjs";
|
|
2
|
+
export { type BasePatchOptions, DOCX_NS, PPTX_NS, type PlaceholderDelimiters, type RenderedParagraphNode, type ReplacerConfig, TokenNotFoundError, type XmlNamespaceConfig, appendContentType, appendRelationship, applyCorePropertiesOverride, createReplacer, createRunRenderer, createSplitInject, createTextElementContents, createTokenReplacer, createTraverser, getFirstLevelElements, getNextRelationshipIndex, patchSpaceAttribute, toJson };
|
package/dist/patch/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { DOCX_NS, PPTX_NS, TokenNotFoundError, appendContentType, appendRelationship, createReplacer, createRunRenderer, createSplitInject, createTextElementContents, createTokenReplacer, createTraverser, getFirstLevelElements, getNextRelationshipIndex, patchSpaceAttribute, toJson };
|
|
1
|
+
import { a as createReplacer, c as createTokenReplacer, d as createTextElementContents, f as getFirstLevelElements, g as PPTX_NS, h as DOCX_NS, i as appendContentType, l as TokenNotFoundError, m as toJson, n as appendRelationship, o as createTraverser, p as patchSpaceAttribute, r as getNextRelationshipIndex, s as createRunRenderer, t as applyCorePropertiesOverride, u as createSplitInject } from "../patch-DocIv0Sn.mjs";
|
|
2
|
+
export { DOCX_NS, PPTX_NS, TokenNotFoundError, appendContentType, appendRelationship, applyCorePropertiesOverride, createReplacer, createRunRenderer, createSplitInject, createTextElementContents, createTokenReplacer, createTraverser, getFirstLevelElements, getNextRelationshipIndex, patchSpaceAttribute, toJson };
|
|
@@ -1,4 +1,118 @@
|
|
|
1
|
-
import { xml2js } from "@office-open/xml";
|
|
1
|
+
import { escapeXml, textOf, xml2js } from "@office-open/xml";
|
|
2
|
+
//#region src/opc/core.ts
|
|
3
|
+
const FIELD_MAP = [
|
|
4
|
+
{
|
|
5
|
+
name: "dc:title",
|
|
6
|
+
key: "title"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
name: "dc:subject",
|
|
10
|
+
key: "subject"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: "dc:creator",
|
|
14
|
+
key: "creator"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: "dc:description",
|
|
18
|
+
key: "description"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "cp:keywords",
|
|
22
|
+
key: "keywords"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: "cp:lastModifiedBy",
|
|
26
|
+
key: "lastModifiedBy"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "cp:lastPrinted",
|
|
30
|
+
key: "lastPrinted"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "dcterms:created",
|
|
34
|
+
key: "created"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: "dcterms:modified",
|
|
38
|
+
key: "modified"
|
|
39
|
+
}
|
|
40
|
+
];
|
|
41
|
+
/**
|
|
42
|
+
* Parse core properties from an already-parsed XML element.
|
|
43
|
+
* Shared by docx/pptx/xlsx to extract Dublin Core metadata into the unified
|
|
44
|
+
* {@link CorePropertiesOptions} shape.
|
|
45
|
+
*/
|
|
46
|
+
function parseCorePropsElement(el) {
|
|
47
|
+
if (!el) return {};
|
|
48
|
+
const props = {};
|
|
49
|
+
for (const field of FIELD_MAP) {
|
|
50
|
+
const child = el.elements?.find((e) => e.name === field.name);
|
|
51
|
+
const value = textOf(child) || void 0;
|
|
52
|
+
if (value) props[field.key] = value;
|
|
53
|
+
}
|
|
54
|
+
const revEl = el.elements?.find((e) => e.name === "cp:revision");
|
|
55
|
+
if (revEl) {
|
|
56
|
+
const rev = textOf(revEl);
|
|
57
|
+
if (rev) {
|
|
58
|
+
const n = Number(rev);
|
|
59
|
+
if (!Number.isNaN(n)) props.revision = n;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return props;
|
|
63
|
+
}
|
|
64
|
+
const CORE_PROPS_NS = Object.freeze({ _attr: Object.freeze({
|
|
65
|
+
"xmlns:cp": "http://schemas.openxmlformats.org/package/2006/metadata/core-properties",
|
|
66
|
+
"xmlns:dc": "http://purl.org/dc/elements/1.1/",
|
|
67
|
+
"xmlns:dcmitype": "http://purl.org/dcmitype/",
|
|
68
|
+
"xmlns:dcterms": "http://purl.org/dc/terms/",
|
|
69
|
+
"xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance"
|
|
70
|
+
}) });
|
|
71
|
+
const W3CDTF_ATTR = Object.freeze({ _attr: Object.freeze({ "xsi:type": "dcterms:W3CDTF" }) });
|
|
72
|
+
/**
|
|
73
|
+
* Build a cp:coreProperties XML object from metadata.
|
|
74
|
+
*
|
|
75
|
+
* Shared by docx and pptx to avoid duplicating namespace declarations
|
|
76
|
+
* and Dublin Core property construction.
|
|
77
|
+
*/
|
|
78
|
+
function buildCorePropertiesXml(opts) {
|
|
79
|
+
const children = [CORE_PROPS_NS];
|
|
80
|
+
if (opts.title) children.push({ "dc:title": [opts.title] });
|
|
81
|
+
if (opts.subject) children.push({ "dc:subject": [opts.subject] });
|
|
82
|
+
if (opts.creator) children.push({ "dc:creator": [opts.creator] });
|
|
83
|
+
if (opts.keywords) children.push({ "cp:keywords": [opts.keywords] });
|
|
84
|
+
if (opts.description) children.push({ "dc:description": [opts.description] });
|
|
85
|
+
children.push({ "cp:lastModifiedBy": [opts.lastModifiedBy || opts.creator || "Unknown"] });
|
|
86
|
+
if (opts.revision) children.push({ "cp:revision": [String(opts.revision)] });
|
|
87
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
88
|
+
children.push({ "dcterms:created": [W3CDTF_ATTR, now] });
|
|
89
|
+
children.push({ "dcterms:modified": [W3CDTF_ATTR, now] });
|
|
90
|
+
return { "cp:coreProperties": children };
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Build a cp:coreProperties XML string directly (fast path).
|
|
94
|
+
*
|
|
95
|
+
* Shared by pptx and xlsx to bypass the toXml() → xml() pipeline.
|
|
96
|
+
* created/modified default to now when not supplied; all other fields emit
|
|
97
|
+
* only when present.
|
|
98
|
+
*/
|
|
99
|
+
function buildCorePropertiesXmlString(opts) {
|
|
100
|
+
const p = ["<cp:coreProperties xmlns:cp=\"http://schemas.openxmlformats.org/package/2006/metadata/core-properties\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcmitype=\"http://purl.org/dcmitype/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">"];
|
|
101
|
+
if (opts.title) p.push(`<dc:title>${escapeXml(opts.title)}</dc:title>`);
|
|
102
|
+
if (opts.subject) p.push(`<dc:subject>${escapeXml(opts.subject)}</dc:subject>`);
|
|
103
|
+
if (opts.creator) p.push(`<dc:creator>${escapeXml(opts.creator)}</dc:creator>`);
|
|
104
|
+
if (opts.keywords) p.push(`<cp:keywords>${escapeXml(opts.keywords)}</cp:keywords>`);
|
|
105
|
+
if (opts.description) p.push(`<dc:description>${escapeXml(opts.description)}</dc:description>`);
|
|
106
|
+
if (opts.lastPrinted) p.push(`<cp:lastPrinted>${escapeXml(opts.lastPrinted)}</cp:lastPrinted>`);
|
|
107
|
+
p.push(`<cp:lastModifiedBy>${escapeXml(opts.lastModifiedBy || opts.creator || "Unknown")}</cp:lastModifiedBy>`);
|
|
108
|
+
if (opts.revision !== void 0) p.push(`<cp:revision>${opts.revision}</cp:revision>`);
|
|
109
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
110
|
+
p.push(`<dcterms:created xsi:type="dcterms:W3CDTF">${opts.created ?? now}</dcterms:created>`);
|
|
111
|
+
p.push(`<dcterms:modified xsi:type="dcterms:W3CDTF">${opts.modified ?? now}</dcterms:modified>`);
|
|
112
|
+
p.push("</cp:coreProperties>");
|
|
113
|
+
return p.join("");
|
|
114
|
+
}
|
|
115
|
+
//#endregion
|
|
2
116
|
//#region src/patch/xml-namespace.ts
|
|
3
117
|
const DOCX_NS = {
|
|
4
118
|
paragraph: "w:p",
|
|
@@ -266,7 +380,7 @@ function createReplacer(config) {
|
|
|
266
380
|
for (const renderedParagraph of renderedParagraphs) {
|
|
267
381
|
const textJson = patch.children.flatMap((c) => formatChild(c, context));
|
|
268
382
|
switch (patch.type) {
|
|
269
|
-
case "
|
|
383
|
+
case "document": {
|
|
270
384
|
const parentElement = goToParentElementFromPath(json, renderedParagraph.pathToParagraph);
|
|
271
385
|
const elementIndex = getLastElementIndexFromPath(renderedParagraph.pathToParagraph);
|
|
272
386
|
parentElement.elements.splice(elementIndex, 1, ...textJson);
|
|
@@ -359,4 +473,12 @@ const appendRelationship = (relationships, id, type, target, targetMode) => {
|
|
|
359
473
|
return relationshipElements;
|
|
360
474
|
};
|
|
361
475
|
//#endregion
|
|
362
|
-
|
|
476
|
+
//#region src/patch/core-properties-override.ts
|
|
477
|
+
function applyCorePropertiesOverride(corePropsDoc, overrides) {
|
|
478
|
+
return buildCorePropertiesXmlString({
|
|
479
|
+
...parseCorePropsElement(corePropsDoc.elements?.find((e) => e.name === "cp:coreProperties") ?? corePropsDoc),
|
|
480
|
+
...overrides
|
|
481
|
+
});
|
|
482
|
+
}
|
|
483
|
+
//#endregion
|
|
484
|
+
export { buildCorePropertiesXml as _, createReplacer as a, createTokenReplacer as c, createTextElementContents as d, getFirstLevelElements as f, PPTX_NS as g, DOCX_NS as h, appendContentType as i, TokenNotFoundError as l, toJson as m, appendRelationship as n, createTraverser as o, patchSpaceAttribute as p, getNextRelationshipIndex as r, createRunRenderer as s, applyCorePropertiesOverride as t, createSplitInject as u, buildCorePropertiesXmlString as v, parseCorePropsElement as y };
|