@office-open/core 0.6.3 → 0.6.5
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/chart/index.d.mts +1 -112
- package/dist/chart/index.mjs +1 -610
- package/dist/chart-Bd9E-YhB.mjs +611 -0
- package/dist/drawingml/index.d.mts +2 -3127
- package/dist/drawingml/index.mjs +1 -3893
- package/dist/drawingml-YMdpQfWs.mjs +4155 -0
- package/dist/{index-mjYQ4KiG.d.mts → index-B1wzvu1m.d.mts} +1 -1
- package/dist/{index-DVqYs1vv.d.mts → index-CZxcE4Q6.d.mts} +2 -2
- package/dist/index-CuRO3Jmz.d.mts +3127 -0
- package/dist/index-DNLRdIqy.d.mts +127 -0
- package/dist/index-DZobntUT.d.mts +113 -0
- package/dist/index.d.mts +128 -12
- package/dist/index.mjs +17 -21
- package/dist/patch/index.d.mts +2 -0
- package/dist/patch/index.mjs +2 -0
- package/dist/patch-BdMU95aX.mjs +337 -0
- package/dist/smartart/index.d.mts +1 -1
- package/dist/smartart/index.mjs +1 -1
- package/dist/{smartart-CwzSHTBd.mjs → smartart-DBQ_rRfK.mjs} +1 -1
- package/dist/values.d.mts +1 -1
- package/package.json +2 -6
- package/dist/archive.d.mts +0 -58
- package/dist/archive.mjs +0 -135
- package/dist/id-generators-CM3u923a.mjs +0 -72
- /package/dist/{values-CIh0bdS1.d.mts → values-QyWq4U4A.d.mts} +0 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { Element } from "@office-open/xml";
|
|
2
|
+
|
|
3
|
+
//#region src/patch/xml-namespace.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Namespace configuration for XML patch operations.
|
|
6
|
+
*
|
|
7
|
+
* Parameterises element names so the same patch algorithm works for both
|
|
8
|
+
* DOCX (`w:*`) and PPTX (`a:*`) documents.
|
|
9
|
+
*/
|
|
10
|
+
interface XmlNamespaceConfig {
|
|
11
|
+
readonly paragraph: string;
|
|
12
|
+
readonly run: string;
|
|
13
|
+
readonly text: string;
|
|
14
|
+
readonly runProperties: string;
|
|
15
|
+
}
|
|
16
|
+
declare const DOCX_NS: XmlNamespaceConfig;
|
|
17
|
+
declare const PPTX_NS: XmlNamespaceConfig;
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/patch/xml-replacer.d.ts
|
|
20
|
+
interface ReplacerConfig {
|
|
21
|
+
readonly ns: XmlNamespaceConfig;
|
|
22
|
+
readonly formatChild: (child: unknown, context: unknown) => Element[];
|
|
23
|
+
readonly preserveSpace?: boolean;
|
|
24
|
+
}
|
|
25
|
+
interface ReplacerResult {
|
|
26
|
+
readonly element: Element;
|
|
27
|
+
readonly didFindOccurrence: boolean;
|
|
28
|
+
}
|
|
29
|
+
declare function createReplacer(config: ReplacerConfig): ({
|
|
30
|
+
json,
|
|
31
|
+
patch,
|
|
32
|
+
patchText,
|
|
33
|
+
context,
|
|
34
|
+
keepOriginalStyles
|
|
35
|
+
}: {
|
|
36
|
+
readonly json: Element;
|
|
37
|
+
readonly patch: {
|
|
38
|
+
readonly type: string;
|
|
39
|
+
readonly children: readonly unknown[];
|
|
40
|
+
};
|
|
41
|
+
readonly patchText: string;
|
|
42
|
+
readonly context: unknown;
|
|
43
|
+
readonly keepOriginalStyles?: boolean;
|
|
44
|
+
}) => ReplacerResult;
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/patch/run-renderer.d.ts
|
|
47
|
+
interface ElementWrapper {
|
|
48
|
+
readonly element: Element;
|
|
49
|
+
readonly index: number;
|
|
50
|
+
readonly parent: ElementWrapper | undefined;
|
|
51
|
+
}
|
|
52
|
+
interface RenderedParagraphNode {
|
|
53
|
+
readonly text: string;
|
|
54
|
+
readonly runs: readonly IRenderedRunNode[];
|
|
55
|
+
readonly index: number;
|
|
56
|
+
readonly pathToParagraph: readonly number[];
|
|
57
|
+
}
|
|
58
|
+
interface StartAndEnd {
|
|
59
|
+
readonly start: number;
|
|
60
|
+
readonly end: number;
|
|
61
|
+
}
|
|
62
|
+
type IParts = {
|
|
63
|
+
readonly text: string;
|
|
64
|
+
readonly index: number;
|
|
65
|
+
} & StartAndEnd;
|
|
66
|
+
type IRenderedRunNode = {
|
|
67
|
+
readonly text: string;
|
|
68
|
+
readonly parts: readonly IParts[];
|
|
69
|
+
readonly index: number;
|
|
70
|
+
} & StartAndEnd;
|
|
71
|
+
declare function createRunRenderer(ns: XmlNamespaceConfig): (node: ElementWrapper) => RenderedParagraphNode;
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region src/patch/xml-traverser.d.ts
|
|
74
|
+
declare function createTraverser(ns: XmlNamespaceConfig): {
|
|
75
|
+
traverse: (node: Element) => readonly RenderedParagraphNode[];
|
|
76
|
+
findLocationOfText: (node: Element, text: string) => readonly RenderedParagraphNode[];
|
|
77
|
+
};
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/patch/paragraph-token-replacer.d.ts
|
|
80
|
+
declare function createTokenReplacer(createTextElementContents: (text: string) => Element[], options?: {
|
|
81
|
+
readonly preserveSpace?: boolean;
|
|
82
|
+
}): ({
|
|
83
|
+
paragraphElement,
|
|
84
|
+
renderedParagraph,
|
|
85
|
+
originalText,
|
|
86
|
+
replacementText
|
|
87
|
+
}: {
|
|
88
|
+
readonly paragraphElement: Element;
|
|
89
|
+
readonly renderedParagraph: RenderedParagraphNode;
|
|
90
|
+
readonly originalText: string;
|
|
91
|
+
readonly replacementText: string;
|
|
92
|
+
}) => Element;
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region src/patch/paragraph-split-inject.d.ts
|
|
95
|
+
declare class TokenNotFoundError extends Error {
|
|
96
|
+
constructor(token: string);
|
|
97
|
+
}
|
|
98
|
+
declare function createSplitInject(ns: XmlNamespaceConfig, createTextElementContents: (text: string) => Element[], options?: {
|
|
99
|
+
readonly preserveSpace?: boolean;
|
|
100
|
+
}): {
|
|
101
|
+
findRunElementIndexWithToken: (paragraphElement: Element, token: string) => number;
|
|
102
|
+
splitRunElement: (runElement: Element, token: string) => {
|
|
103
|
+
readonly left: Element;
|
|
104
|
+
readonly right: Element;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
//#endregion
|
|
108
|
+
//#region src/patch/xml-patch-utils.d.ts
|
|
109
|
+
declare const toJson: (xmlData: string) => Element;
|
|
110
|
+
/**
|
|
111
|
+
* Creates the inner content of a text element (`w:t` / `a:t`).
|
|
112
|
+
*
|
|
113
|
+
* Returns `[{ type: "text", text }]` for non-empty text, `[]` for empty.
|
|
114
|
+
* The `xml:space` attribute is handled separately by `patchSpaceAttribute`.
|
|
115
|
+
*/
|
|
116
|
+
declare const createTextElementContents: (text: string) => Element[];
|
|
117
|
+
declare const patchSpaceAttribute: (element: Element) => Element;
|
|
118
|
+
declare const getFirstLevelElements: (relationships: Element, id: string) => Element[];
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region src/patch/content-types-manager.d.ts
|
|
121
|
+
declare const appendContentType: (element: Element, contentType: string, extension: string) => void;
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region src/patch/relationship-manager.d.ts
|
|
124
|
+
declare const getNextRelationshipIndex: (relationships: Element) => number;
|
|
125
|
+
declare const appendRelationship: (relationships: Element, id: number | string, type: string, target: string, targetMode?: string) => readonly Element[];
|
|
126
|
+
//#endregion
|
|
127
|
+
export { PPTX_NS as _, getFirstLevelElements as a, TokenNotFoundError as c, createTraverser as d, RenderedParagraphNode as f, DOCX_NS as g, createReplacer as h, createTextElementContents as i, createSplitInject as l, ReplacerConfig as m, getNextRelationshipIndex as n, patchSpaceAttribute as o, createRunRenderer as p, appendContentType as r, toJson as s, appendRelationship as t, createTokenReplacer as u, XmlNamespaceConfig as v };
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { C as XmlComponent } from "./index-B1wzvu1m.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/chart/axes.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* c:catAx — category axis.
|
|
6
|
+
*/
|
|
7
|
+
declare class CatAx extends XmlComponent {
|
|
8
|
+
constructor(axId: number, crossAx: number);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* c:valAx — value axis.
|
|
12
|
+
*/
|
|
13
|
+
declare class ValAx extends XmlComponent {
|
|
14
|
+
constructor(axId: number, crossAx: number);
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/chart/chart-types/area-chart.d.ts
|
|
18
|
+
interface AreaChartOptions {
|
|
19
|
+
readonly categories: readonly string[];
|
|
20
|
+
readonly series: readonly ChartSeriesData[];
|
|
21
|
+
}
|
|
22
|
+
declare class AreaChart extends XmlComponent {
|
|
23
|
+
constructor(options: AreaChartOptions);
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/chart/chart-types/bar-chart.d.ts
|
|
27
|
+
interface BarChartOptions {
|
|
28
|
+
readonly barDirection: "col" | "bar";
|
|
29
|
+
readonly categories: readonly string[];
|
|
30
|
+
readonly series: readonly ChartSeriesData[];
|
|
31
|
+
}
|
|
32
|
+
declare class BarChart extends XmlComponent {
|
|
33
|
+
constructor(options: BarChartOptions);
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/chart/chart-types/line-chart.d.ts
|
|
37
|
+
interface LineChartOptions {
|
|
38
|
+
readonly categories: readonly string[];
|
|
39
|
+
readonly series: readonly ChartSeriesData[];
|
|
40
|
+
}
|
|
41
|
+
declare class LineChart extends XmlComponent {
|
|
42
|
+
constructor(options: LineChartOptions);
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/chart/chart-types/pie-chart.d.ts
|
|
46
|
+
interface PieChartOptions {
|
|
47
|
+
readonly categories: readonly string[];
|
|
48
|
+
readonly series: readonly ChartSeriesData[];
|
|
49
|
+
}
|
|
50
|
+
declare class PieChart extends XmlComponent {
|
|
51
|
+
constructor(options: PieChartOptions);
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region src/chart/chart-types/scatter-chart.d.ts
|
|
55
|
+
interface ScatterChartOptions {
|
|
56
|
+
readonly categories: readonly string[];
|
|
57
|
+
readonly series: readonly ChartSeriesData[];
|
|
58
|
+
}
|
|
59
|
+
declare class ScatterChart extends XmlComponent {
|
|
60
|
+
constructor(options: ScatterChartOptions);
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region src/chart/create-chart-type.d.ts
|
|
64
|
+
interface ChartSeriesData {
|
|
65
|
+
readonly name: string;
|
|
66
|
+
readonly values: readonly number[];
|
|
67
|
+
}
|
|
68
|
+
type ChartType = "column" | "bar" | "line" | "pie" | "area" | "scatter";
|
|
69
|
+
interface ChartTypeOptions {
|
|
70
|
+
readonly type: ChartType;
|
|
71
|
+
readonly series: readonly ChartSeriesData[];
|
|
72
|
+
readonly categories: readonly string[];
|
|
73
|
+
}
|
|
74
|
+
declare const createChartType: (options: ChartTypeOptions) => BarChart | LineChart | PieChart | AreaChart | ScatterChart;
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/chart/chart-space.d.ts
|
|
77
|
+
interface ChartSpaceOptions {
|
|
78
|
+
readonly title?: string;
|
|
79
|
+
readonly type: ChartType;
|
|
80
|
+
readonly categories: readonly string[];
|
|
81
|
+
readonly series: readonly ChartSeriesData[];
|
|
82
|
+
readonly showLegend?: boolean;
|
|
83
|
+
readonly style?: number;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* c:chartSpace — root element for chart XML parts.
|
|
87
|
+
*/
|
|
88
|
+
declare class ChartSpace extends XmlComponent {
|
|
89
|
+
constructor(options: ChartSpaceOptions);
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region src/chart/chart-collection.d.ts
|
|
93
|
+
interface ChartData {
|
|
94
|
+
readonly key: string;
|
|
95
|
+
readonly chartSpace: XmlComponent;
|
|
96
|
+
}
|
|
97
|
+
declare class ChartCollection {
|
|
98
|
+
private readonly map;
|
|
99
|
+
constructor();
|
|
100
|
+
addChart(key: string, chartData: ChartData): void;
|
|
101
|
+
get array(): readonly ChartData[];
|
|
102
|
+
}
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region src/chart/series/series-data.d.ts
|
|
105
|
+
declare const createStrRef: (values: string | readonly string[]) => XmlComponent;
|
|
106
|
+
declare const createNumRef: (values: readonly number[]) => XmlComponent;
|
|
107
|
+
//#endregion
|
|
108
|
+
//#region src/chart/title.d.ts
|
|
109
|
+
declare class ChartTitle extends XmlComponent {
|
|
110
|
+
constructor(title: string);
|
|
111
|
+
}
|
|
112
|
+
//#endregion
|
|
113
|
+
export { CatAx as _, ChartData as a, ChartSeriesData as c, createChartType as d, ScatterChart as f, AreaChart as g, BarChart as h, ChartCollection as i, ChartType as l, LineChart as m, createNumRef as n, ChartSpace as o, PieChart as p, createStrRef as r, ChartSpaceOptions as s, ChartTitle as t, ChartTypeOptions as u, ValAx as v };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as
|
|
3
|
-
import {
|
|
4
|
-
import { a as
|
|
1
|
+
import { C as XmlComponent, D as IXmlableObject, E as IXmlAttribute, S as IgnoreIfEmptyXmlComponent, T as Context, _ as AttributeMap, a as BuilderElement, b as XmlAttributeComponent, c as chartAttr, d as onOffObj, f as stringContainerObj, g as AttributeData, h as wrapEl, i as convertToXmlComponent, l as hpsMeasureObj, m as stringValObj, n as ImportedRootElementAttributes, o as EmptyElement, p as stringEnumValObj, r as ImportedXmlComponent, s as attrObj, t as InitializableXmlComponent, u as numberValObj, v as AttributePayload, w as BaseXmlComponent, x as EMPTY_OBJECT, y as NextAttributeComponent } from "./index-B1wzvu1m.mjs";
|
|
2
|
+
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-QyWq4U4A.mjs";
|
|
3
|
+
import { _ as CatAx, a as ChartData, c as ChartSeriesData, d as createChartType, f as ScatterChart, g as AreaChart, h as BarChart, i as ChartCollection, l as ChartType, m as LineChart, n as createNumRef, o as ChartSpace, p as PieChart, r as createStrRef, s as ChartSpaceOptions, t as ChartTitle, u as ChartTypeOptions, v as ValAx } from "./index-DZobntUT.mjs";
|
|
4
|
+
import { $ as RectAlignment, $t as createSolidFill, A as createBevel, At as FillOptions, B as createSoftEdgeEffect, Bt as RelativeRect, C as GeometryGuide, Ct as createGroupFill, D as createShape3D, Dt as createNoFill, E as Shape3DOptions, Et as createPatternFill, F as Point3D, Ft as GradientShadeOptions, G as EffectListOptions, Gt as TileOptions, H as EffectDagOptions, Ht as createGradientFill, I as Scene3DOptions, It as GradientStop, J as createReflectionEffect, Jt as createSourceRectangle, K as createEffectList, Kt as createTileInfo, L as SphereCoords, Lt as LinearShadeOptions, M as BackdropOptions, Mt as buildFill, N as CameraOptions, Nt as extractBlipFillMedia, O as BevelOptions, Ot as BlipFillConfigOptions, P as LightRigOptions, Pt as GradientFillOptions, Q as OuterShadowEffectOptions, Qt as createColorElement, R as Vector3D, Rt as PathShadeOptions, S as PresetGeometryOptions, St as createCustomDash, T as PresetMaterialType, Tt as PresetPattern, U as createEffectDag, Ut as createGradientStop, V as EffectContainerType, Vt as TileFlipMode, W as BlurEffectOptions, Wt as TileAlignment, X as PresetShadowVal, Xt as createBlipEffects, Y as PresetShadowEffectOptions, Yt as BlipEffectsOptions, Z as createPresetShadowEffect, Zt as SolidFillOptions, _ as PathCommand, _t as LineEndOptions, a as Transform2DOptions, an as createSchemeColor, at as BlendMode, b as createCustomGeometry, bt as createLineEnd, c as Stretch, cn as RgbColorOptions, ct as CompoundLine, d as createBlipFill, dn as PresetColorOptions, dt as OutlineFillProperties, en as SystemColor, et as createOuterShadowEffect, f as BlipOptions, fn as createPresetColor, ft as OutlineOptions, g as GeomRect, gn as createColorTransforms, gt as LineEndLength, h as CustomGeometryOptions, hn as ColorTransformOptions, ht as createOutline, i as GroupTransform2DOptions, in as SchemeColorOptions, it as createGlowEffect, j as createBottomBevel, jt as GradientStopOptions, k as BevelPresetType, kt as BlipFillMediaData, l as createExtentionList, ln as createRgbColor, lt as LineCap, m as ConnectionSite, mn as createHslColor, mt as PresetDash, n as MediaTransformation, nn as createSystemColor, nt as createInnerShadowEffect, o as createGroupTransform2D, on as ScRgbColorOptions, ot as FillOverlayEffectOptions, p as createBlip, pn as HslColorOptions, pt as PenAlignment, q as ReflectionEffectOptions, qt as SourceRectangleOptions, r as createTransformation, rn as SchemeColor, rt as GlowEffectOptions, s as createTransform2D, sn as createScRgbColor, st as createFillOverlayEffect, t as MediaDataTransformation, tn as SystemColorOptions, tt as InnerShadowEffectOptions, u as BlipFillOptions, un as PresetColor, ut as LineJoin, v as PathFillMode, vt as LineEndType, w as createAdjustmentValues, wt as PatternFillOptions, x as PresetGeometry, xt as DashStop, y as PathOptions, yt as LineEndWidth, z as createScene3D, zt as PathShadeType } from "./index-CuRO3Jmz.mjs";
|
|
5
|
+
import { a as Point, c as Connection, d as getLayoutXml, f as getStyleXml, h as STYLE_CATEGORIES, i as SmartArtData, l as DEFAULT_DRAWING_XML, m as LAYOUT_CATEGORIES, n as createDataModel, o as TransPoint, p as COLOR_CATEGORIES, r as SmartArtCollection, s as DataModel, t as TreeNode, u as getColorXml } from "./index-CZxcE4Q6.mjs";
|
|
6
|
+
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-DNLRdIqy.mjs";
|
|
5
7
|
import { Element } from "@office-open/xml";
|
|
6
8
|
import { ZipOptions, Zippable, Zippable as Zippable$1, strFromU8, unzipSync } from "fflate";
|
|
7
9
|
import { Readable } from "stream";
|
|
@@ -204,7 +206,7 @@ declare class Relationships extends BaseXmlComponent {
|
|
|
204
206
|
private entries;
|
|
205
207
|
constructor();
|
|
206
208
|
addRelationship(id: number | string, type: RelationshipType, target: string, targetMode?: (typeof TargetModeType)[keyof typeof TargetModeType]): void;
|
|
207
|
-
get
|
|
209
|
+
get relationshipCount(): number;
|
|
208
210
|
prepForXml(_context: Context): IXmlableObject;
|
|
209
211
|
}
|
|
210
212
|
//#endregion
|
|
@@ -247,7 +249,6 @@ interface CoreProperties {
|
|
|
247
249
|
created?: string;
|
|
248
250
|
modified?: string;
|
|
249
251
|
}
|
|
250
|
-
declare function parseCoreProperties(zip: Map<string, Uint8Array>): CoreProperties;
|
|
251
252
|
/**
|
|
252
253
|
* Parse core properties from an already-parsed XML element.
|
|
253
254
|
* Shared by docx and pptx to extract Dublin Core metadata.
|
|
@@ -271,16 +272,16 @@ declare function buildCorePropertiesXml(opts: {
|
|
|
271
272
|
//#endregion
|
|
272
273
|
//#region src/parser.d.ts
|
|
273
274
|
/**
|
|
274
|
-
* Parsed OOXML
|
|
275
|
+
* Parsed OOXML archive backed by an unzipped ZIP map.
|
|
275
276
|
*
|
|
276
277
|
* Provides unstorage-style API (get/set/getRaw/setRaw/remove/has/keys)
|
|
277
278
|
* for reading and modifying individual parts, then serializing back to a ZIP buffer.
|
|
278
279
|
*/
|
|
279
|
-
declare class
|
|
280
|
+
declare class ParsedArchive {
|
|
280
281
|
private readonly zip;
|
|
281
282
|
private readonly modified;
|
|
282
283
|
private readonly wrapperCache;
|
|
283
|
-
constructor(
|
|
284
|
+
constructor(data: Uint8Array);
|
|
284
285
|
/** Read an XML part as an Element tree. */
|
|
285
286
|
get(path: string): Element | undefined;
|
|
286
287
|
/** Write an XML part (Element → XML string). */
|
|
@@ -298,8 +299,8 @@ declare class ParsedDocument {
|
|
|
298
299
|
/** Serialize back to a ZIP buffer, merging original zip + modifications. */
|
|
299
300
|
save(): Uint8Array;
|
|
300
301
|
}
|
|
301
|
-
/** Parse an OOXML archive (.docx, .pptx, .xlsx) into a
|
|
302
|
-
declare function parseArchive(data: Uint8Array):
|
|
302
|
+
/** Parse an OOXML archive (.docx, .pptx, .xlsx) into a ParsedArchive. */
|
|
303
|
+
declare function parseArchive(data: Uint8Array): ParsedArchive;
|
|
303
304
|
//#endregion
|
|
304
305
|
//#region src/raw-passthrough.d.ts
|
|
305
306
|
/**
|
|
@@ -346,4 +347,119 @@ interface SmartArtRelOptions {
|
|
|
346
347
|
declare function replaceSmartArtPlaceholders(xml: string, keys: readonly string[], dataOffset: number, idFormat?: IdFormat): string;
|
|
347
348
|
declare function addSmartArtRelationships(keys: readonly string[], addRel: (id: number, type: RelationshipType, target: string, targetMode?: string) => void, baseOffset: number, globalStartIndex: number, options: SmartArtRelOptions): void;
|
|
348
349
|
//#endregion
|
|
349
|
-
|
|
350
|
+
//#region src/xsd-mappings.d.ts
|
|
351
|
+
/**
|
|
352
|
+
* Bidirectional mappings between user-friendly values and XSD abbreviated values.
|
|
353
|
+
*
|
|
354
|
+
* When XSD uses full English words (e.g. "center", "start"), values are used directly — no mapping needed.
|
|
355
|
+
* When XSD uses abbreviations (e.g. "ctr", "l", "rnd"), this module maps them to full words.
|
|
356
|
+
*
|
|
357
|
+
* Usage in generation (Options → XML): xsdAlign.to("center") → "ctr"
|
|
358
|
+
* Usage in parsing (XML → Options): xsdAlign.from("ctr") → "center"
|
|
359
|
+
*/
|
|
360
|
+
/** Invert a Record<K, V> into Record<V, K>. */
|
|
361
|
+
declare function invertMap<K extends string, V extends string>(map: Record<K, V>): Record<V, K>;
|
|
362
|
+
declare const xsdRectAlignment: {
|
|
363
|
+
/** User-friendly value → XSD value */to: (key: string) => string; /** XSD value → user-friendly value */
|
|
364
|
+
from: (xsd: string) => string; /** The forward map (user → XSD) */
|
|
365
|
+
forward: Record<"topLeft" | "top" | "topRight" | "left" | "center" | "right" | "bottomLeft" | "bottom" | "bottomRight", "tl" | "t" | "tr" | "l" | "ctr" | "r" | "bl" | "b" | "br">; /** The reverse map (XSD → user) */
|
|
366
|
+
reverse: Record<"tl" | "t" | "tr" | "l" | "ctr" | "r" | "bl" | "b" | "br", "topLeft" | "top" | "topRight" | "left" | "center" | "right" | "bottomLeft" | "bottom" | "bottomRight">;
|
|
367
|
+
};
|
|
368
|
+
declare const xsdTextAlign: {
|
|
369
|
+
/** User-friendly value → XSD value */to: (key: string) => string; /** XSD value → user-friendly value */
|
|
370
|
+
from: (xsd: string) => string; /** The forward map (user → XSD) */
|
|
371
|
+
forward: Record<"left" | "center" | "right" | "justify", "l" | "ctr" | "r" | "just">; /** The reverse map (XSD → user) */
|
|
372
|
+
reverse: Record<"l" | "ctr" | "r" | "just", "left" | "center" | "right" | "justify">;
|
|
373
|
+
};
|
|
374
|
+
declare const xsdTextAnchor: {
|
|
375
|
+
/** User-friendly value → XSD value */to: (key: string) => string; /** XSD value → user-friendly value */
|
|
376
|
+
from: (xsd: string) => string; /** The forward map (user → XSD) */
|
|
377
|
+
forward: Record<"top" | "center" | "bottom", "t" | "ctr" | "b">; /** The reverse map (XSD → user) */
|
|
378
|
+
reverse: Record<"t" | "ctr" | "b", "top" | "center" | "bottom">;
|
|
379
|
+
};
|
|
380
|
+
declare const xsdLineCap: {
|
|
381
|
+
/** User-friendly value → XSD value */to: (key: string) => string; /** XSD value → user-friendly value */
|
|
382
|
+
from: (xsd: string) => string; /** The forward map (user → XSD) */
|
|
383
|
+
forward: Record<"flat" | "round" | "square", "flat" | "rnd" | "sq">; /** The reverse map (XSD → user) */
|
|
384
|
+
reverse: Record<"flat" | "rnd" | "sq", "flat" | "round" | "square">;
|
|
385
|
+
};
|
|
386
|
+
declare const xsdCompoundLine: {
|
|
387
|
+
/** User-friendly value → XSD value */to: (key: string) => string; /** XSD value → user-friendly value */
|
|
388
|
+
from: (xsd: string) => string; /** The forward map (user → XSD) */
|
|
389
|
+
forward: Record<"single" | "double" | "thickThin" | "thinThick" | "triple", "thickThin" | "thinThick" | "sng" | "dbl" | "tri">; /** The reverse map (XSD → user) */
|
|
390
|
+
reverse: Record<"thickThin" | "thinThick" | "sng" | "dbl" | "tri", "single" | "double" | "thickThin" | "thinThick" | "triple">;
|
|
391
|
+
};
|
|
392
|
+
declare const xsdPenAlignment: {
|
|
393
|
+
/** User-friendly value → XSD value */to: (key: string) => string; /** XSD value → user-friendly value */
|
|
394
|
+
from: (xsd: string) => string; /** The forward map (user → XSD) */
|
|
395
|
+
forward: Record<"center" | "inside", "in" | "ctr">; /** The reverse map (XSD → user) */
|
|
396
|
+
reverse: Record<"in" | "ctr", "center" | "inside">;
|
|
397
|
+
};
|
|
398
|
+
declare const xsdLineEndSize: {
|
|
399
|
+
/** User-friendly value → XSD value */to: (key: string) => string; /** XSD value → user-friendly value */
|
|
400
|
+
from: (xsd: string) => string; /** The forward map (user → XSD) */
|
|
401
|
+
forward: Record<"small" | "medium" | "large", "sm" | "med" | "lg">; /** The reverse map (XSD → user) */
|
|
402
|
+
reverse: Record<"sm" | "med" | "lg", "small" | "medium" | "large">;
|
|
403
|
+
};
|
|
404
|
+
declare const xsdBlendMode: {
|
|
405
|
+
/** User-friendly value → XSD value */to: (key: string) => string; /** XSD value → user-friendly value */
|
|
406
|
+
from: (xsd: string) => string; /** The forward map (user → XSD) */
|
|
407
|
+
forward: Record<"lighten" | "darken" | "over" | "multiply" | "screen", "lighten" | "darken" | "over" | "screen" | "mult">; /** The reverse map (XSD → user) */
|
|
408
|
+
reverse: Record<"lighten" | "darken" | "over" | "screen" | "mult", "lighten" | "darken" | "over" | "multiply" | "screen">;
|
|
409
|
+
};
|
|
410
|
+
declare const xsdPathFillMode: {
|
|
411
|
+
/** User-friendly value → XSD value */to: (key: string) => string; /** XSD value → user-friendly value */
|
|
412
|
+
from: (xsd: string) => string; /** The forward map (user → XSD) */
|
|
413
|
+
forward: Record<"none" | "normal" | "lighten" | "lightenLess" | "darken" | "darkenLess", "none" | "lighten" | "lightenLess" | "darken" | "darkenLess" | "norm">; /** The reverse map (XSD → user) */
|
|
414
|
+
reverse: Record<"none" | "lighten" | "lightenLess" | "darken" | "darkenLess" | "norm", "none" | "normal" | "lighten" | "lightenLess" | "darken" | "darkenLess">;
|
|
415
|
+
};
|
|
416
|
+
declare const xsdEffectContainer: {
|
|
417
|
+
/** User-friendly value → XSD value */to: (key: string) => string; /** XSD value → user-friendly value */
|
|
418
|
+
from: (xsd: string) => string; /** The forward map (user → XSD) */
|
|
419
|
+
forward: Record<"sibling" | "tree", "tree" | "sib">; /** The reverse map (XSD → user) */
|
|
420
|
+
reverse: Record<"tree" | "sib", "sibling" | "tree">;
|
|
421
|
+
};
|
|
422
|
+
declare const xsdPresetShadow: {
|
|
423
|
+
/** User-friendly value → XSD value */to: (key: string) => string; /** XSD value → user-friendly value */
|
|
424
|
+
from: (xsd: string) => string; /** The forward map (user → XSD) */
|
|
425
|
+
forward: Record<"shadow1" | "shadow2" | "shadow3" | "shadow4" | "shadow5" | "shadow6" | "shadow7" | "shadow8" | "shadow9" | "shadow10" | "shadow11" | "shadow12" | "shadow13" | "shadow14" | "shadow15" | "shadow16" | "shadow17" | "shadow18" | "shadow19" | "shadow20", "shdw1" | "shdw2" | "shdw3" | "shdw4" | "shdw5" | "shdw6" | "shdw7" | "shdw8" | "shdw9" | "shdw10" | "shdw11" | "shdw12" | "shdw13" | "shdw14" | "shdw15" | "shdw16" | "shdw17" | "shdw18" | "shdw19" | "shdw20">; /** The reverse map (XSD → user) */
|
|
426
|
+
reverse: Record<"shdw1" | "shdw2" | "shdw3" | "shdw4" | "shdw5" | "shdw6" | "shdw7" | "shdw8" | "shdw9" | "shdw10" | "shdw11" | "shdw12" | "shdw13" | "shdw14" | "shdw15" | "shdw16" | "shdw17" | "shdw18" | "shdw19" | "shdw20", "shadow1" | "shadow2" | "shadow3" | "shadow4" | "shadow5" | "shadow6" | "shadow7" | "shadow8" | "shadow9" | "shadow10" | "shadow11" | "shadow12" | "shadow13" | "shadow14" | "shadow15" | "shadow16" | "shadow17" | "shadow18" | "shadow19" | "shadow20">;
|
|
427
|
+
};
|
|
428
|
+
declare const xsdMaterialType: {
|
|
429
|
+
/** User-friendly value → XSD value */to: (key: string) => string; /** XSD value → user-friendly value */
|
|
430
|
+
from: (xsd: string) => string; /** The forward map (user → XSD) */
|
|
431
|
+
forward: Record<"legacyMatte" | "legacyPlastic" | "legacyMetal" | "legacyWireframe" | "matte" | "plastic" | "metal" | "warmMatte" | "translucentPowder" | "powder" | "darkEdge" | "softEdge" | "clear" | "flat" | "softMetal", "legacyMatte" | "legacyPlastic" | "legacyMetal" | "legacyWireframe" | "matte" | "plastic" | "metal" | "warmMatte" | "translucentPowder" | "powder" | "softEdge" | "clear" | "flat" | "dkEdge" | "softmetal">; /** The reverse map (XSD → user) */
|
|
432
|
+
reverse: Record<"legacyMatte" | "legacyPlastic" | "legacyMetal" | "legacyWireframe" | "matte" | "plastic" | "metal" | "warmMatte" | "translucentPowder" | "powder" | "softEdge" | "clear" | "flat" | "dkEdge" | "softmetal", "legacyMatte" | "legacyPlastic" | "legacyMetal" | "legacyWireframe" | "matte" | "plastic" | "metal" | "warmMatte" | "translucentPowder" | "powder" | "darkEdge" | "softEdge" | "clear" | "flat" | "softMetal">;
|
|
433
|
+
};
|
|
434
|
+
declare const xsdPattern: {
|
|
435
|
+
/** User-friendly value → XSD value */to: (key: string) => string; /** XSD value → user-friendly value */
|
|
436
|
+
from: (xsd: string) => string; /** The forward map (user → XSD) */
|
|
437
|
+
forward: Record<"percent5" | "percent10" | "percent20" | "percent25" | "percent30" | "percent40" | "percent50" | "percent60" | "percent70" | "percent75" | "percent80" | "percent90" | "horizontal" | "vertical" | "lightHorizontal" | "lightVertical" | "darkHorizontal" | "darkVertical" | "narrowHorizontal" | "narrowVertical" | "dashedHorizontal" | "dashedVertical" | "cross" | "downDiagonal" | "upDiagonal" | "lightDownDiagonal" | "lightUpDiagonal" | "darkDownDiagonal" | "darkUpDiagonal" | "wideDownDiagonal" | "wideUpDiagonal" | "dashedDownDiagonal" | "dashedUpDiagonal" | "diagonalCross" | "smallChecker" | "largeChecker" | "smallGrid" | "largeGrid" | "dotGrid" | "smallConfetti" | "largeConfetti" | "horizontalBrick" | "diagonalBrick" | "solidDiamond" | "openDiamond" | "dottedDiamond" | "plaid" | "sphere" | "weave" | "divot" | "shingle" | "wave" | "trellis" | "zigZag", "cross" | "dotGrid" | "plaid" | "sphere" | "weave" | "divot" | "shingle" | "wave" | "trellis" | "zigZag" | "pct5" | "pct10" | "pct20" | "pct25" | "pct30" | "pct40" | "pct50" | "pct60" | "pct70" | "pct75" | "pct80" | "pct90" | "horz" | "vert" | "ltHorz" | "ltVert" | "dkHorz" | "dkVert" | "narHorz" | "narVert" | "dashHorz" | "dashVert" | "dnDiag" | "upDiag" | "ltDnDiag" | "ltUpDiag" | "dkDnDiag" | "dkUpDiag" | "wdDnDiag" | "wdUpDiag" | "dashDnDiag" | "dashUpDiag" | "diagCross" | "smCheck" | "lgCheck" | "smGrid" | "lgGrid" | "smConfetti" | "lgConfetti" | "horzBrick" | "diagBrick" | "solidDmnd" | "openDmnd" | "dotDmnd">; /** The reverse map (XSD → user) */
|
|
438
|
+
reverse: Record<"cross" | "dotGrid" | "plaid" | "sphere" | "weave" | "divot" | "shingle" | "wave" | "trellis" | "zigZag" | "pct5" | "pct10" | "pct20" | "pct25" | "pct30" | "pct40" | "pct50" | "pct60" | "pct70" | "pct75" | "pct80" | "pct90" | "horz" | "vert" | "ltHorz" | "ltVert" | "dkHorz" | "dkVert" | "narHorz" | "narVert" | "dashHorz" | "dashVert" | "dnDiag" | "upDiag" | "ltDnDiag" | "ltUpDiag" | "dkDnDiag" | "dkUpDiag" | "wdDnDiag" | "wdUpDiag" | "dashDnDiag" | "dashUpDiag" | "diagCross" | "smCheck" | "lgCheck" | "smGrid" | "lgGrid" | "smConfetti" | "lgConfetti" | "horzBrick" | "diagBrick" | "solidDmnd" | "openDmnd" | "dotDmnd", "percent5" | "percent10" | "percent20" | "percent25" | "percent30" | "percent40" | "percent50" | "percent60" | "percent70" | "percent75" | "percent80" | "percent90" | "horizontal" | "vertical" | "lightHorizontal" | "lightVertical" | "darkHorizontal" | "darkVertical" | "narrowHorizontal" | "narrowVertical" | "dashedHorizontal" | "dashedVertical" | "cross" | "downDiagonal" | "upDiagonal" | "lightDownDiagonal" | "lightUpDiagonal" | "darkDownDiagonal" | "darkUpDiagonal" | "wideDownDiagonal" | "wideUpDiagonal" | "dashedDownDiagonal" | "dashedUpDiagonal" | "diagonalCross" | "smallChecker" | "largeChecker" | "smallGrid" | "largeGrid" | "dotGrid" | "smallConfetti" | "largeConfetti" | "horizontalBrick" | "diagonalBrick" | "solidDiamond" | "openDiamond" | "dottedDiamond" | "plaid" | "sphere" | "weave" | "divot" | "shingle" | "wave" | "trellis" | "zigZag">;
|
|
439
|
+
};
|
|
440
|
+
declare const xsdVerticalMergeRev: {
|
|
441
|
+
/** User-friendly value → XSD value */to: (key: string) => string; /** XSD value → user-friendly value */
|
|
442
|
+
from: (xsd: string) => string; /** The forward map (user → XSD) */
|
|
443
|
+
forward: Record<"continue" | "restart", "cont" | "rest">; /** The reverse map (XSD → user) */
|
|
444
|
+
reverse: Record<"cont" | "rest", "continue" | "restart">;
|
|
445
|
+
};
|
|
446
|
+
declare const xsdUnderlineStyle: {
|
|
447
|
+
/** User-friendly value → XSD value */to: (key: string) => string; /** XSD value → user-friendly value */
|
|
448
|
+
from: (xsd: string) => string; /** The forward map (user → XSD) */
|
|
449
|
+
forward: Record<"none" | "single" | "double", "none" | "sng" | "dbl">; /** The reverse map (XSD → user) */
|
|
450
|
+
reverse: Record<"none" | "sng" | "dbl", "none" | "single" | "double">;
|
|
451
|
+
};
|
|
452
|
+
declare const xsdStrikeStyle: {
|
|
453
|
+
/** User-friendly value → XSD value */to: (key: string) => string; /** XSD value → user-friendly value */
|
|
454
|
+
from: (xsd: string) => string; /** The forward map (user → XSD) */
|
|
455
|
+
forward: Record<"singleStrike" | "doubleStrike" | "noStrike", "sngStrike" | "dblStrike" | "noStrike">; /** The reverse map (XSD → user) */
|
|
456
|
+
reverse: Record<"sngStrike" | "dblStrike" | "noStrike", "singleStrike" | "doubleStrike" | "noStrike">;
|
|
457
|
+
};
|
|
458
|
+
declare const xsdTextCaps: {
|
|
459
|
+
/** User-friendly value → XSD value */to: (key: string) => string; /** XSD value → user-friendly value */
|
|
460
|
+
from: (xsd: string) => string; /** The forward map (user → XSD) */
|
|
461
|
+
forward: Record<"none" | "small" | "all", "none" | "small" | "all">; /** The reverse map (XSD → user) */
|
|
462
|
+
reverse: Record<"none" | "small" | "all", "none" | "small" | "all">;
|
|
463
|
+
};
|
|
464
|
+
//#endregion
|
|
465
|
+
export { AppProperties, AreaChart, AttributeData, AttributeMap, AttributePayload, BackdropOptions, BarChart, BaseXmlComponent, BevelOptions, BevelPresetType, BlendMode, BlipEffectsOptions, BlipFillConfigOptions, BlipFillMediaData, BlipFillOptions, BlipOptions, BlurEffectOptions, BuilderElement, COLOR_CATEGORIES, CameraOptions, CatAx, ChartCollection, ChartData, ChartSeriesData, ChartSpace, ChartSpaceOptions, ChartTitle, ChartType, ChartTypeOptions, ColorTransformOptions, CompileFn, CompoundLine, Connection, ConnectionSite, Context, CoreProperties, CustomGeometryOptions, DEFAULT_DRAWING_XML, DOCX_NS, DashStop, DataModel, type DefaultAttributes, EMPTY_OBJECT, EffectContainerType, EffectDagOptions, EffectListOptions, EmptyElement, FillOptions, FillOverlayEffectOptions, Formatter, GeomRect, GeometryGuide, GlowEffectOptions, GradientFillOptions, GradientShadeOptions, GradientStop, GradientStopOptions, GroupTransform2DOptions, HslColorOptions, IXmlAttribute, IXmlableObject, IdFormat, IgnoreIfEmptyXmlComponent, ImportedRootElementAttributes, ImportedXmlComponent, InitializableXmlComponent, InnerShadowEffectOptions, LAYOUT_CATEGORIES, LightRigOptions, LineCap, LineChart, LineEndLength, LineEndOptions, LineEndType, LineEndWidth, LineJoin, LinearShadeOptions, MediaDataTransformation, MediaTransformation, NextAttributeComponent, OoxmlMimeType, OuterShadowEffectOptions, OutlineFillProperties, OutlineOptions, OutputByType, OutputType, type OverrideAttributes, PPTX_NS, Packer, ParsedArchive, PathCommand, PathFillMode, PathOptions, PathShadeOptions, PathShadeType, PatternFillOptions, PenAlignment, Percentage, PieChart, Point, Point3D, PositivePercentage, PositiveUniversalMeasure, PresetColor, PresetColorOptions, PresetDash, PresetGeometry, PresetGeometryOptions, PresetMaterialType, PresetPattern, PresetShadowEffectOptions, PresetShadowVal, PrettifyType, RawPassthrough, RectAlignment, ReflectionEffectOptions, type RelationshipType, Relationships, RelativeMeasure, RelativeRect, RenderedParagraphNode, ReplacerConfig, RgbColorOptions, STYLE_CATEGORIES, ScRgbColorOptions, ScatterChart, Scene3DOptions, SchemeColor, SchemeColorOptions, Shape3DOptions, SmartArtCollection, SmartArtData, SmartArtRelOptions, SolidFillOptions, SourceRectangleOptions, SphereCoords, Stretch, SystemColor, SystemColorOptions, TargetModeType, ThemeColor, ThemeFont, TileAlignment, TileFlipMode, TileOptions, TokenNotFoundError, TransPoint, Transform2DOptions, TreeNode, UniqueNumericIdCreator, UniversalMeasure, ValAx, Vector3D, XmlAttributeComponent, XmlComponent, XmlNamespaceConfig, XmlifyedFile, ZIP_DEFLATE_LEVEL, ZIP_STORED_LEVEL, type ZipOptions, type Zippable, addSmartArtRelationships, appendContentType, appendRelationship, attrObj, buildCorePropertiesXml, buildFill, chartAttr, collectPlaceholderKeys, convertEmuToInches, convertEmuToPixels, convertEmuToPoints, convertInchesToEmu, convertInchesToTwip, convertMillimetersToTwip, convertOutput, convertPixelsToEmu, convertPointsToEmu, convertPrettifyType, convertToXmlComponent, createAdjustmentValues, createBevel, createBlip, createBlipEffects, createBlipFill, createBottomBevel, createChartType, createColorElement, createColorTransforms, createCustomDash, createCustomGeometry, createDataModel, createDefault, createEffectDag, createEffectList, createExtentionList, createFillOverlayEffect, createGlowEffect, createGradientFill, createGradientStop, createGroupFill, createGroupTransform2D, createHslColor, createInnerShadowEffect, createLineEnd, createNoFill, createNumRef, createOuterShadowEffect, createOutline, createOverride, createPacker, createPatternFill, createPresetColor, createPresetShadowEffect, createReflectionEffect, createReplacer, createRgbColor, createRunRenderer, createScRgbColor, createScene3D, createSchemeColor, createShape3D, createSoftEdgeEffect, createSolidFill, createSourceRectangle, createSplitInject, createStrRef, createSystemColor, createTextElementContents, createTileInfo, createTokenReplacer, createTransform2D, createTransformation, createTraverser, createZipStream, dateTimeValue, decimalNumber, eighthPointMeasureValue, elementToCompact, escapeRegex, extractBlipFillMedia, formatId, getColorXml, getFirstLevelElements, getLayoutXml, getNextRelationshipIndex, getReferencedMedia, getStyleXml, hasPlaceholders, hashedId, hexBinary, hexColorValue, hpsMeasureObj, hpsMeasureValue, invertMap, longHexNumber, measurementOrPercentValue, numberValObj, onOffObj, parseArchive, parseCorePropsElement, patchSpaceAttribute, percentageValue, pointMeasureValue, positiveUniversalMeasureValue, replaceChartPlaceholders, replaceImagePlaceholders, replaceSmartArtPlaceholders, shortHexNumber, signedHpsMeasureValue, signedTwipsMeasureValue, strFromU8, stringContainerObj, stringEnumValObj, stringValObj, toJson, twipsMeasureValue, uCharHexNumber, uniqueId, uniqueNumericIdCreator, uniqueUuid, universalMeasureValue, unsignedDecimalNumber, unzipSync, wrapEl, 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,10 +1,11 @@
|
|
|
1
1
|
import { _ as XmlAttributeComponent, a as BuilderElement, b as XmlComponent, c as chartAttr, d as onOffObj, f as stringContainerObj, g as NextAttributeComponent, h as wrapEl, i as convertToXmlComponent, l as hpsMeasureObj, m as stringValObj, n as ImportedRootElementAttributes, o as EmptyElement, p as stringEnumValObj, r as ImportedXmlComponent, s as attrObj, t as InitializableXmlComponent, u as numberValObj, v as EMPTY_OBJECT, x as BaseXmlComponent, y as IgnoreIfEmptyXmlComponent } from "./xml-components-CADgke8j.mjs";
|
|
2
2
|
import { ThemeColor, ThemeFont, dateTimeValue, decimalNumber, eighthPointMeasureValue, hexBinary, hexColorValue, hpsMeasureValue, longHexNumber, measurementOrPercentValue, percentageValue, pointMeasureValue, positiveUniversalMeasureValue, shortHexNumber, signedHpsMeasureValue, signedTwipsMeasureValue, twipsMeasureValue, uCharHexNumber, universalMeasureValue, unsignedDecimalNumber } from "./values.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { a as DataModel, c as getColorXml, d as COLOR_CATEGORIES, f as LAYOUT_CATEGORIES, i as TransPoint, l as getLayoutXml, n as SmartArtCollection, o as Connection, p as STYLE_CATEGORIES, r as Point, s as DEFAULT_DRAWING_XML, t as createDataModel, u as getStyleXml } from "./smartart-
|
|
5
|
-
import {
|
|
3
|
+
import { $ as xsdCompoundLine, A as LineJoin, At as hashedId, B as createNoFill, Bt as convertPixelsToEmu, C as createOuterShadowEffect, Ct as createSchemeColor, D as createFillOverlayEffect, Dt as createPresetColor, E as BlendMode, Et as PresetColor, F as LineEndType, Ft as convertEmuToPixels, G as PathShadeType, H as extractBlipFillMedia, I as LineEndWidth, It as convertEmuToPoints, J as createGradientStop, K as TileFlipMode, L as createLineEnd, Lt as convertInchesToEmu, M as PresetDash, Mt as uniqueNumericIdCreator, N as createOutline, Nt as uniqueUuid, O as CompoundLine, Ot as createHslColor, P as LineEndLength, Pt as convertEmuToInches, Q as xsdBlendMode, R as createCustomDash, Rt as convertInchesToTwip, S as RectAlignment, St as SchemeColor, T as createGlowEffect, Tt as createRgbColor, U as PresetPattern, V as buildFill, Vt as convertPointsToEmu, W as createPatternFill, X as createTileInfo, Y as TileAlignment, Z as invertMap, _ as createEffectList, _t as createBlipEffects, a as createBlip, at as xsdPattern, b as PresetShadowVal, bt as SystemColor, c as PresetGeometry, ct as xsdRectAlignment, d as createShape3D, dt as xsdTextAnchor, et as xsdEffectContainer, f as BevelPresetType, ft as xsdTextCaps, g as createEffectDag, gt as createSourceRectangle, h as createScene3D, ht as Stretch, i as createBlipFill, it as xsdPathFillMode, j as PenAlignment, jt as uniqueId, k as LineCap, kt as createColorTransforms, l as createAdjustmentValues, lt as xsdStrikeStyle, m as createBottomBevel, mt as xsdVerticalMergeRev, n as createGroupTransform2D, nt as xsdLineEndSize, o as createExtentionList, ot as xsdPenAlignment, p as createBevel, pt as xsdUnderlineStyle, q as createGradientFill, r as createTransform2D, rt as xsdMaterialType, s as createCustomGeometry, st as xsdPresetShadow, t as createTransformation, tt as xsdLineCap, u as PresetMaterialType, ut as xsdTextAlign, v as createSoftEdgeEffect, vt as createColorElement, w as createInnerShadowEffect, wt as createScRgbColor, x as createPresetShadowEffect, xt as createSystemColor, y as createReflectionEffect, yt as createSolidFill, z as createGroupFill, zt as convertMillimetersToTwip } from "./drawingml-YMdpQfWs.mjs";
|
|
4
|
+
import { a as DataModel, c as getColorXml, d as COLOR_CATEGORIES, f as LAYOUT_CATEGORIES, i as TransPoint, l as getLayoutXml, n as SmartArtCollection, o as Connection, p as STYLE_CATEGORIES, r as Point, s as DEFAULT_DRAWING_XML, t as createDataModel, u as getStyleXml } from "./smartart-DBQ_rRfK.mjs";
|
|
5
|
+
import { a as ScatterChart, c as BarChart, d as createStrRef, f as CatAx, i as createChartType, l as AreaChart, n as ChartSpace, o as PieChart, p as ValAx, r as ChartTitle, s as LineChart, t as ChartCollection, u as createNumRef } from "./chart-Bd9E-YhB.mjs";
|
|
6
|
+
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-BdMU95aX.mjs";
|
|
6
7
|
import { js2xml, textOf, xml2js } from "@office-open/xml";
|
|
7
|
-
import { AsyncZipDeflate, Zip, ZipPassThrough, strFromU8, strFromU8 as strFromU8$1, strToU8, unzipSync, zip, zipSync } from "fflate";
|
|
8
|
+
import { AsyncZipDeflate, Zip, ZipPassThrough, strFromU8, strFromU8 as strFromU8$1, strToU8, unzipSync, unzipSync as unzipSync$1, zip, zipSync } from "fflate";
|
|
8
9
|
import { Readable } from "stream";
|
|
9
10
|
//#region src/output-type.ts
|
|
10
11
|
/**
|
|
@@ -190,7 +191,7 @@ var Relationships = class extends BaseXmlComponent {
|
|
|
190
191
|
targetMode
|
|
191
192
|
});
|
|
192
193
|
}
|
|
193
|
-
get
|
|
194
|
+
get relationshipCount() {
|
|
194
195
|
return this.entries.length;
|
|
195
196
|
}
|
|
196
197
|
prepForXml(_context) {
|
|
@@ -297,11 +298,6 @@ const FIELD_MAP = [
|
|
|
297
298
|
key: "lastModifiedBy"
|
|
298
299
|
}
|
|
299
300
|
];
|
|
300
|
-
function parseCoreProperties(zip) {
|
|
301
|
-
const xml = readXmlFromZip(zip, "docProps/core.xml");
|
|
302
|
-
if (!xml) return {};
|
|
303
|
-
return parseCorePropsElement(xml);
|
|
304
|
-
}
|
|
305
301
|
/**
|
|
306
302
|
* Parse core properties from an already-parsed XML element.
|
|
307
303
|
* Shared by docx and pptx to extract Dublin Core metadata.
|
|
@@ -359,17 +355,17 @@ const XML_PARSE_OPTIONS = {
|
|
|
359
355
|
captureSpacesBetweenElements: true
|
|
360
356
|
};
|
|
361
357
|
/**
|
|
362
|
-
* Parsed OOXML
|
|
358
|
+
* Parsed OOXML archive backed by an unzipped ZIP map.
|
|
363
359
|
*
|
|
364
360
|
* Provides unstorage-style API (get/set/getRaw/setRaw/remove/has/keys)
|
|
365
361
|
* for reading and modifying individual parts, then serializing back to a ZIP buffer.
|
|
366
362
|
*/
|
|
367
|
-
var
|
|
363
|
+
var ParsedArchive = class {
|
|
368
364
|
zip;
|
|
369
365
|
modified = /* @__PURE__ */ new Map();
|
|
370
366
|
wrapperCache = /* @__PURE__ */ new Map();
|
|
371
|
-
constructor(
|
|
372
|
-
this.zip =
|
|
367
|
+
constructor(data) {
|
|
368
|
+
this.zip = new Map(Object.entries(unzipSync$1(data)));
|
|
373
369
|
}
|
|
374
370
|
/** Read an XML part as an Element tree. */
|
|
375
371
|
get(path) {
|
|
@@ -429,15 +425,15 @@ var ParsedDocument = class {
|
|
|
429
425
|
}
|
|
430
426
|
/** Serialize back to a ZIP buffer, merging original zip + modifications. */
|
|
431
427
|
save() {
|
|
432
|
-
const files =
|
|
433
|
-
for (const [path, data] of this.zip) if (!this.modified.has(path)) files
|
|
434
|
-
for (const [path, data] of this.modified) files
|
|
435
|
-
return
|
|
428
|
+
const files = {};
|
|
429
|
+
for (const [path, data] of this.zip) if (!this.modified.has(path)) files[path] = data;
|
|
430
|
+
for (const [path, data] of this.modified) files[path] = data;
|
|
431
|
+
return zipSync(files);
|
|
436
432
|
}
|
|
437
433
|
};
|
|
438
|
-
/** Parse an OOXML archive (.docx, .pptx, .xlsx) into a
|
|
434
|
+
/** Parse an OOXML archive (.docx, .pptx, .xlsx) into a ParsedArchive. */
|
|
439
435
|
function parseArchive(data) {
|
|
440
|
-
return new
|
|
436
|
+
return new ParsedArchive(data);
|
|
441
437
|
}
|
|
442
438
|
//#endregion
|
|
443
439
|
//#region src/raw-passthrough.ts
|
|
@@ -545,4 +541,4 @@ function addSmartArtRelationships(keys, addRel, baseOffset, globalStartIndex, op
|
|
|
545
541
|
});
|
|
546
542
|
}
|
|
547
543
|
//#endregion
|
|
548
|
-
export { AppProperties, BaseXmlComponent, BuilderElement, COLOR_CATEGORIES, Connection, DEFAULT_DRAWING_XML, DataModel, EMPTY_OBJECT, EmptyElement, Formatter, IgnoreIfEmptyXmlComponent, ImportedRootElementAttributes, ImportedXmlComponent, InitializableXmlComponent, LAYOUT_CATEGORIES, NextAttributeComponent, OoxmlMimeType,
|
|
544
|
+
export { AppProperties, AreaChart, BarChart, BaseXmlComponent, BevelPresetType, BlendMode, BuilderElement, COLOR_CATEGORIES, CatAx, ChartCollection, ChartSpace, ChartTitle, CompoundLine, Connection, DEFAULT_DRAWING_XML, DOCX_NS, DataModel, EMPTY_OBJECT, EmptyElement, Formatter, IgnoreIfEmptyXmlComponent, ImportedRootElementAttributes, ImportedXmlComponent, InitializableXmlComponent, LAYOUT_CATEGORIES, LineCap, LineChart, LineEndLength, LineEndType, LineEndWidth, LineJoin, NextAttributeComponent, OoxmlMimeType, PPTX_NS, ParsedArchive, PathShadeType, PenAlignment, PieChart, Point, PresetColor, PresetDash, PresetGeometry, PresetMaterialType, PresetPattern, PresetShadowVal, PrettifyType, RawPassthrough, RectAlignment, Relationships, STYLE_CATEGORIES, ScatterChart, SchemeColor, SmartArtCollection, Stretch, SystemColor, TargetModeType, ThemeColor, ThemeFont, TileAlignment, TileFlipMode, TokenNotFoundError, TransPoint, ValAx, XmlAttributeComponent, XmlComponent, ZIP_DEFLATE_LEVEL, ZIP_STORED_LEVEL, addSmartArtRelationships, appendContentType, appendRelationship, attrObj, buildCorePropertiesXml, buildFill, chartAttr, collectPlaceholderKeys, convertEmuToInches, convertEmuToPixels, convertEmuToPoints, convertInchesToEmu, convertInchesToTwip, convertMillimetersToTwip, convertOutput, convertPixelsToEmu, convertPointsToEmu, convertPrettifyType, convertToXmlComponent, createAdjustmentValues, createBevel, createBlip, createBlipEffects, createBlipFill, createBottomBevel, createChartType, createColorElement, createColorTransforms, createCustomDash, createCustomGeometry, createDataModel, createDefault, createEffectDag, createEffectList, createExtentionList, createFillOverlayEffect, createGlowEffect, createGradientFill, createGradientStop, createGroupFill, createGroupTransform2D, createHslColor, createInnerShadowEffect, createLineEnd, createNoFill, createNumRef, createOuterShadowEffect, createOutline, createOverride, createPacker, createPatternFill, createPresetColor, createPresetShadowEffect, createReflectionEffect, createReplacer, createRgbColor, createRunRenderer, createScRgbColor, createScene3D, createSchemeColor, createShape3D, createSoftEdgeEffect, createSolidFill, createSourceRectangle, createSplitInject, createStrRef, createSystemColor, createTextElementContents, createTileInfo, createTokenReplacer, createTransform2D, createTransformation, createTraverser, createZipStream, dateTimeValue, decimalNumber, eighthPointMeasureValue, elementToCompact, escapeRegex, extractBlipFillMedia, formatId, getColorXml, getFirstLevelElements, getLayoutXml, getNextRelationshipIndex, getReferencedMedia, getStyleXml, hasPlaceholders, hashedId, hexBinary, hexColorValue, hpsMeasureObj, hpsMeasureValue, invertMap, longHexNumber, measurementOrPercentValue, numberValObj, onOffObj, parseArchive, parseCorePropsElement, patchSpaceAttribute, percentageValue, pointMeasureValue, positiveUniversalMeasureValue, replaceChartPlaceholders, replaceImagePlaceholders, replaceSmartArtPlaceholders, shortHexNumber, signedHpsMeasureValue, signedTwipsMeasureValue, strFromU8, stringContainerObj, stringEnumValObj, stringValObj, toJson, twipsMeasureValue, uCharHexNumber, uniqueId, uniqueNumericIdCreator, uniqueUuid, universalMeasureValue, unsignedDecimalNumber, unzipSync, wrapEl, xsdBlendMode, xsdCompoundLine, xsdEffectContainer, xsdLineCap, xsdLineEndSize, xsdMaterialType, xsdPathFillMode, xsdPattern, xsdPenAlignment, xsdPresetShadow, xsdRectAlignment, xsdStrikeStyle, xsdTextAlign, xsdTextAnchor, xsdTextCaps, xsdUnderlineStyle, xsdVerticalMergeRev, zipAndConvert, zipSyncAndConvert };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
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-DNLRdIqy.mjs";
|
|
2
|
+
export { DOCX_NS, PPTX_NS, RenderedParagraphNode, ReplacerConfig, TokenNotFoundError, XmlNamespaceConfig, appendContentType, appendRelationship, createReplacer, createRunRenderer, createSplitInject, createTextElementContents, createTokenReplacer, createTraverser, getFirstLevelElements, getNextRelationshipIndex, patchSpaceAttribute, toJson };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
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-BdMU95aX.mjs";
|
|
2
|
+
export { DOCX_NS, PPTX_NS, TokenNotFoundError, appendContentType, appendRelationship, createReplacer, createRunRenderer, createSplitInject, createTextElementContents, createTokenReplacer, createTraverser, getFirstLevelElements, getNextRelationshipIndex, patchSpaceAttribute, toJson };
|