@office-open/core 0.6.7 → 0.6.8
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 -1
- package/dist/chart/index.mjs +1 -1
- package/dist/{chart-DO9i3S1G.mjs → chart-jj57bDdC.mjs} +1 -1
- package/dist/drawingml/index.d.mts +1 -1
- package/dist/drawingml/index.mjs +1 -1
- package/dist/{drawingml-DzU9sEb0.mjs → drawingml-C0t3mzSK.mjs} +2 -2
- package/dist/{index-Bf86IyeY.d.mts → index-18VktT2t.d.mts} +2 -2
- package/dist/{index-CCGNb26x.d.mts → index-BaL8Sbrf.d.mts} +2 -2
- package/dist/{index-BCjRiF78.d.mts → index-CEFUwJ2F.d.mts} +1 -1
- package/dist/{index-bZQnCpM1.d.mts → index-DP97S6un.d.mts} +24 -39
- package/dist/index.d.mts +13 -12
- package/dist/index.mjs +9 -24
- package/dist/smartart/index.d.mts +1 -1
- package/dist/smartart/index.mjs +1 -1
- package/dist/{smartart-vyDm6U1_.mjs → smartart-BKz8xM1k.mjs} +1 -1
- package/dist/{xml-components-ctIqansl.mjs → xml-components-Cfvn_mId.mjs} +32 -76
- package/package.json +2 -2
package/dist/chart/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
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-
|
|
1
|
+
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-18VktT2t.mjs";
|
|
2
2
|
export { AreaChart, BarChart, CatAx, ChartCollection, ChartData, ChartSeriesData, ChartSpace, ChartSpaceOptions, ChartTitle, ChartType, ChartTypeOptions, LineChart, PieChart, ScatterChart, ValAx, createChartType, createNumRef, createStrRef };
|
package/dist/chart/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
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-
|
|
1
|
+
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-jj57bDdC.mjs";
|
|
2
2
|
export { AreaChart, BarChart, CatAx, ChartCollection, ChartSpace, ChartTitle, LineChart, PieChart, ScatterChart, ValAx, createChartType, createNumRef, createStrRef };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as BuilderElement,
|
|
1
|
+
import { a as BuilderElement, g as wrapEl, l as chartAttr, o as EmptyElement, y as XmlComponent } from "./xml-components-Cfvn_mId.mjs";
|
|
2
2
|
//#region src/chart/axes.ts
|
|
3
3
|
/**
|
|
4
4
|
* c:scaling — axis scaling configuration (minOccurs=1 in EG_AxShared).
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
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-
|
|
1
|
+
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-BaL8Sbrf.mjs";
|
|
2
2
|
export { BackdropOptions, BevelOptions, BevelPresetType, BlendMode, BlipEffectsOptions, BlipFillConfigOptions, BlipFillMediaData, BlipFillOptions, BlipOptions, BlurEffectOptions, CameraOptions, ColorTransformOptions, CompoundLine, ConnectionSite, CustomGeometryOptions, DashStop, EffectContainerType, EffectDagOptions, EffectListOptions, FillOptions, FillOverlayEffectOptions, GeomRect, GeometryGuide, GlowEffectOptions, GradientFillOptions, GradientShadeOptions, GradientStop, GradientStopOptions, GroupTransform2DOptions, HslColorOptions, InnerShadowEffectOptions, LightRigOptions, LineCap, LineEndLength, LineEndOptions, LineEndType, LineEndWidth, LineJoin, LinearShadeOptions, MediaDataTransformation, MediaTransformation, OuterShadowEffectOptions, OutlineFillProperties, OutlineOptions, PathCommand, PathFillMode, PathOptions, PathShadeOptions, PathShadeType, PatternFillOptions, PenAlignment, Point3D, PresetColor, PresetColorOptions, PresetDash, PresetGeometry, PresetGeometryOptions, PresetMaterialType, PresetPattern, PresetShadowEffectOptions, PresetShadowVal, RectAlignment, ReflectionEffectOptions, RelativeRect, RgbColorOptions, ScRgbColorOptions, Scene3DOptions, SchemeColor, SchemeColorOptions, Shape3DOptions, SolidFillOptions, SourceRectangleOptions, SphereCoords, Stretch, SystemColor, SystemColorOptions, TileAlignment, TileFlipMode, TileOptions, Transform2DOptions, Vector3D, buildFill, createAdjustmentValues, createBevel, createBlip, createBlipEffects, createBlipFill, createBottomBevel, createColorElement, createColorTransforms, createCustomDash, createCustomGeometry, createEffectDag, createEffectList, createExtentionList, createFillOverlayEffect, createGlowEffect, createGradientFill, createGradientStop, createGroupFill, createGroupTransform2D, createHslColor, createInnerShadowEffect, createLineEnd, createNoFill, createOuterShadowEffect, createOutline, createPatternFill, createPresetColor, createPresetShadowEffect, createReflectionEffect, createRgbColor, createScRgbColor, createScene3D, createSchemeColor, createShape3D, createSoftEdgeEffect, createSolidFill, createSourceRectangle, createSystemColor, createTileInfo, createTransform2D, createTransformation, extractBlipFillMedia };
|
package/dist/drawingml/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as LineJoin, B as createNoFill, C as createOuterShadowEffect, Ct as createSchemeColor, D as createFillOverlayEffect, Dt as createPresetColor, E as BlendMode, Et as PresetColor, F as LineEndType, G as PathShadeType, H as extractBlipFillMedia, I as LineEndWidth, J as createGradientStop, K as TileFlipMode, L as createLineEnd, M as PresetDash, N as createOutline, O as CompoundLine, Ot as createHslColor, P as LineEndLength, R as createCustomDash, S as RectAlignment, St as SchemeColor, T as createGlowEffect, Tt as createRgbColor, U as PresetPattern, V as buildFill, W as createPatternFill, X as createTileInfo, Y as TileAlignment, _ as createEffectList, _t as createBlipEffects, a as createBlip, b as PresetShadowVal, bt as SystemColor, c as PresetGeometry, d as createShape3D, f as BevelPresetType, g as createEffectDag, gt as createSourceRectangle, h as createScene3D, ht as Stretch, i as createBlipFill, j as PenAlignment, k as LineCap, kt as createColorTransforms, l as createAdjustmentValues, m as createBottomBevel, n as createGroupTransform2D, o as createExtentionList, p as createBevel, q as createGradientFill, r as createTransform2D, s as createCustomGeometry, t as createTransformation, u as PresetMaterialType, 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 } from "../drawingml-
|
|
1
|
+
import { A as LineJoin, B as createNoFill, C as createOuterShadowEffect, Ct as createSchemeColor, D as createFillOverlayEffect, Dt as createPresetColor, E as BlendMode, Et as PresetColor, F as LineEndType, G as PathShadeType, H as extractBlipFillMedia, I as LineEndWidth, J as createGradientStop, K as TileFlipMode, L as createLineEnd, M as PresetDash, N as createOutline, O as CompoundLine, Ot as createHslColor, P as LineEndLength, R as createCustomDash, S as RectAlignment, St as SchemeColor, T as createGlowEffect, Tt as createRgbColor, U as PresetPattern, V as buildFill, W as createPatternFill, X as createTileInfo, Y as TileAlignment, _ as createEffectList, _t as createBlipEffects, a as createBlip, b as PresetShadowVal, bt as SystemColor, c as PresetGeometry, d as createShape3D, f as BevelPresetType, g as createEffectDag, gt as createSourceRectangle, h as createScene3D, ht as Stretch, i as createBlipFill, j as PenAlignment, k as LineCap, kt as createColorTransforms, l as createAdjustmentValues, m as createBottomBevel, n as createGroupTransform2D, o as createExtentionList, p as createBevel, q as createGradientFill, r as createTransform2D, s as createCustomGeometry, t as createTransformation, u as PresetMaterialType, 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 } from "../drawingml-C0t3mzSK.mjs";
|
|
2
2
|
export { BevelPresetType, BlendMode, CompoundLine, LineCap, LineEndLength, LineEndType, LineEndWidth, LineJoin, PathShadeType, PenAlignment, PresetColor, PresetDash, PresetGeometry, PresetMaterialType, PresetPattern, PresetShadowVal, RectAlignment, SchemeColor, Stretch, SystemColor, TileAlignment, TileFlipMode, buildFill, createAdjustmentValues, createBevel, createBlip, createBlipEffects, createBlipFill, createBottomBevel, createColorElement, createColorTransforms, createCustomDash, createCustomGeometry, createEffectDag, createEffectList, createExtentionList, createFillOverlayEffect, createGlowEffect, createGradientFill, createGradientStop, createGroupFill, createGroupTransform2D, createHslColor, createInnerShadowEffect, createLineEnd, createNoFill, createOuterShadowEffect, createOutline, createPatternFill, createPresetColor, createPresetShadowEffect, createReflectionEffect, createRgbColor, createScRgbColor, createScene3D, createSchemeColor, createShape3D, createSoftEdgeEffect, createSolidFill, createSourceRectangle, createSystemColor, createTileInfo, createTransform2D, createTransformation, extractBlipFillMedia };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as BuilderElement,
|
|
1
|
+
import { a as BuilderElement, y as XmlComponent } from "./xml-components-Cfvn_mId.mjs";
|
|
2
2
|
import hash from "hash.js";
|
|
3
3
|
import { customAlphabet, nanoid } from "nanoid/non-secure";
|
|
4
4
|
//#region src/converters.ts
|
|
@@ -1797,7 +1797,7 @@ function toUint8Array(data) {
|
|
|
1797
1797
|
* Returns undefined for non-blip fills.
|
|
1798
1798
|
*
|
|
1799
1799
|
* The returned data should be registered with the document's media store
|
|
1800
|
-
* during
|
|
1800
|
+
* during serialization so the packer can resolve the `{fileName}` placeholder.
|
|
1801
1801
|
*/
|
|
1802
1802
|
const extractBlipFillMedia = (fill) => {
|
|
1803
1803
|
if (typeof fill === "string" || fill.type !== "blip") return void 0;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as XmlComponent } from "./index-DP97S6un.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/chart/axes.d.ts
|
|
4
4
|
/**
|
|
@@ -77,7 +77,7 @@ interface ChartTypeOptions {
|
|
|
77
77
|
readonly series: readonly ChartSeriesData[];
|
|
78
78
|
readonly categories: readonly string[];
|
|
79
79
|
}
|
|
80
|
-
declare const createChartType: (options: ChartTypeOptions) => ScatterChart |
|
|
80
|
+
declare const createChartType: (options: ChartTypeOptions) => ScatterChart | AreaChart | PieChart | BarChart | LineChart;
|
|
81
81
|
//#endregion
|
|
82
82
|
//#region src/chart/chart-space.d.ts
|
|
83
83
|
interface ChartSpaceOptions {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as BuilderElement, b as XmlComponent } from "./index-DP97S6un.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/drawingml/color/color-transform.d.ts
|
|
4
4
|
/**
|
|
@@ -1130,7 +1130,7 @@ type FillOptions = string | {
|
|
|
1130
1130
|
* Returns undefined for non-blip fills.
|
|
1131
1131
|
*
|
|
1132
1132
|
* The returned data should be registered with the document's media store
|
|
1133
|
-
* during
|
|
1133
|
+
* during serialization so the packer can resolve the `{fileName}` placeholder.
|
|
1134
1134
|
*/
|
|
1135
1135
|
declare const extractBlipFillMedia: (fill: FillOptions) => BlipFillMediaData | undefined;
|
|
1136
1136
|
/**
|
|
@@ -36,17 +36,13 @@ declare abstract class BaseXmlComponent {
|
|
|
36
36
|
protected readonly rootKey: string;
|
|
37
37
|
constructor(rootKey: string);
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* @param context - The serialization context
|
|
42
|
-
* @returns The XML-serializable object, or undefined to exclude from output
|
|
39
|
+
* @deprecated Use `toXml()` instead.
|
|
43
40
|
*/
|
|
44
|
-
|
|
41
|
+
prepForXml(_context: Context): IXmlableObject | undefined;
|
|
45
42
|
/**
|
|
46
43
|
* Direct XML serialization. Override in subclasses for zero-allocation output.
|
|
47
|
-
* Default falls back to prepForXml() + xml().
|
|
48
44
|
*/
|
|
49
|
-
toXml(
|
|
45
|
+
toXml(_context: Context): string;
|
|
50
46
|
}
|
|
51
47
|
//#endregion
|
|
52
48
|
//#region src/xml-components/component.d.ts
|
|
@@ -71,7 +67,7 @@ declare abstract class XmlComponent extends BaseXmlComponent {
|
|
|
71
67
|
root: (BaseXmlComponent | IXmlableObject | string)[];
|
|
72
68
|
constructor(rootKey: string);
|
|
73
69
|
/**
|
|
74
|
-
*
|
|
70
|
+
* @deprecated Use `toXml()` instead.
|
|
75
71
|
*/
|
|
76
72
|
prepForXml(context: Context): IXmlableObject | undefined;
|
|
77
73
|
/**
|
|
@@ -90,6 +86,9 @@ declare abstract class XmlComponent extends BaseXmlComponent {
|
|
|
90
86
|
declare abstract class IgnoreIfEmptyXmlComponent extends XmlComponent {
|
|
91
87
|
private readonly includeIfEmpty;
|
|
92
88
|
constructor(rootKey: string, includeIfEmpty?: boolean);
|
|
89
|
+
/**
|
|
90
|
+
* @deprecated Use `toXml()` instead.
|
|
91
|
+
*/
|
|
93
92
|
prepForXml(context: Context): IXmlableObject | undefined;
|
|
94
93
|
/**
|
|
95
94
|
* Suppress empty elements — super.toXml() produces a self-closing tag
|
|
@@ -102,13 +101,10 @@ declare abstract class IgnoreIfEmptyXmlComponent extends XmlComponent {
|
|
|
102
101
|
//#endregion
|
|
103
102
|
//#region src/xml-components/attributes.d.ts
|
|
104
103
|
/**
|
|
105
|
-
*
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Simple attribute data as a key-value record.
|
|
104
|
+
* XML attribute types for OOXML document generation.
|
|
105
|
+
*
|
|
106
|
+
* @module
|
|
110
107
|
*/
|
|
111
|
-
type AttributeData = Record<string, boolean | number | string>;
|
|
112
108
|
/**
|
|
113
109
|
* Structured attribute payload with explicit key-value mapping.
|
|
114
110
|
*/
|
|
@@ -116,26 +112,6 @@ type AttributePayload<T> = { readonly [P in keyof T]: {
|
|
|
116
112
|
readonly key: string;
|
|
117
113
|
readonly value: T[P];
|
|
118
114
|
} };
|
|
119
|
-
/**
|
|
120
|
-
* Base class for creating XML attributes with automatic name mapping.
|
|
121
|
-
*/
|
|
122
|
-
declare abstract class XmlAttributeComponent<T extends Record<string, any>> extends BaseXmlComponent {
|
|
123
|
-
private readonly root;
|
|
124
|
-
/** Optional mapping from property names to XML attribute names. */
|
|
125
|
-
protected readonly xmlKeys?: AttributeMap<T>;
|
|
126
|
-
constructor(root: T);
|
|
127
|
-
prepForXml(_: Context): IXmlableObject;
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Next-generation attribute component with explicit key-value pairs.
|
|
131
|
-
*/
|
|
132
|
-
declare class NextAttributeComponent<T> extends BaseXmlComponent {
|
|
133
|
-
private readonly root;
|
|
134
|
-
constructor(root: AttributePayload<T>);
|
|
135
|
-
prepForXml(_: Context): IXmlableObject;
|
|
136
|
-
/** Attribute components produce no XML output — attrs are inlined by the parent. */
|
|
137
|
-
toXml(_context: Context): string;
|
|
138
|
-
}
|
|
139
115
|
//#endregion
|
|
140
116
|
//#region src/xml-components/elements.d.ts
|
|
141
117
|
/**
|
|
@@ -186,13 +162,17 @@ declare class BuilderElement<T = {}> extends XmlComponent {
|
|
|
186
162
|
});
|
|
187
163
|
}
|
|
188
164
|
/**
|
|
189
|
-
*
|
|
165
|
+
* Builds an attribute-only IXmlableObject from a plain key-value record.
|
|
190
166
|
*/
|
|
191
|
-
declare
|
|
167
|
+
declare function buildAttrObject(attrs: Record<string, string | number | boolean>): IXmlableObject;
|
|
168
|
+
/**
|
|
169
|
+
* Creates an attribute IXmlableObject for chart elements.
|
|
170
|
+
*/
|
|
171
|
+
declare const chartAttr: (attrs: Record<string, string | number | boolean>) => IXmlableObject;
|
|
192
172
|
/**
|
|
193
173
|
* Wraps a component in a named XmlComponent element.
|
|
194
174
|
*/
|
|
195
|
-
declare function wrapEl(elementName: string, child: BaseXmlComponent): XmlComponent;
|
|
175
|
+
declare function wrapEl(elementName: string, child: BaseXmlComponent | IXmlableObject): XmlComponent;
|
|
196
176
|
//#endregion
|
|
197
177
|
//#region src/xml-components/imported.d.ts
|
|
198
178
|
/**
|
|
@@ -212,11 +192,16 @@ declare class ImportedXmlComponent extends XmlComponent {
|
|
|
212
192
|
}
|
|
213
193
|
/**
|
|
214
194
|
* Represents attributes for imported root elements.
|
|
195
|
+
* The { _attr } in root is consumed by the parent's toXml() serialization.
|
|
215
196
|
*/
|
|
216
197
|
declare class ImportedRootElementAttributes extends XmlComponent {
|
|
217
198
|
private readonly _attr;
|
|
218
199
|
constructor(_attr: any);
|
|
219
|
-
|
|
200
|
+
/**
|
|
201
|
+
* @deprecated Use `toXml()` instead.
|
|
202
|
+
*/
|
|
203
|
+
prepForXml(_context: Context): IXmlableObject;
|
|
204
|
+
toXml(_context: Context): string;
|
|
220
205
|
}
|
|
221
206
|
//#endregion
|
|
222
207
|
//#region src/xml-components/initializable.d.ts
|
|
@@ -227,4 +212,4 @@ declare abstract class InitializableXmlComponent extends XmlComponent {
|
|
|
227
212
|
constructor(rootKey: string, initComponent?: XmlComponent);
|
|
228
213
|
}
|
|
229
214
|
//#endregion
|
|
230
|
-
export {
|
|
215
|
+
export { IXmlAttribute as C, Context as S, AttributePayload as _, BuilderElement as a, XmlComponent as b, buildAttrObject as c, numberValObj as d, onOffObj as f, wrapEl as g, stringValObj as h, convertToXmlComponent as i, chartAttr as l, stringEnumValObj as m, ImportedRootElementAttributes as n, EmptyElement as o, stringContainerObj as p, ImportedXmlComponent as r, attrObj as s, InitializableXmlComponent as t, hpsMeasureObj as u, EMPTY_OBJECT as v, IXmlableObject as w, BaseXmlComponent as x, IgnoreIfEmptyXmlComponent as y };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as
|
|
1
|
+
import { C as IXmlAttribute, S as Context, _ as AttributePayload, a as BuilderElement, b as XmlComponent, c as buildAttrObject, d as numberValObj, f as onOffObj, g as wrapEl, h as stringValObj, i as convertToXmlComponent, l as chartAttr, m as stringEnumValObj, n as ImportedRootElementAttributes, o as EmptyElement, p as stringContainerObj, r as ImportedXmlComponent, s as attrObj, t as InitializableXmlComponent, u as hpsMeasureObj, v as EMPTY_OBJECT, w as IXmlableObject, x as BaseXmlComponent, y as IgnoreIfEmptyXmlComponent } from "./index-DP97S6un.mjs";
|
|
2
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-
|
|
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-
|
|
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-
|
|
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-18VktT2t.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-BaL8Sbrf.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-CEFUwJ2F.mjs";
|
|
6
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";
|
|
7
7
|
import { Element } from "@office-open/xml";
|
|
8
8
|
import { ZipOptions, Zippable, Zippable as Zippable$1, strFromU8, unzipSync } from "fflate";
|
|
@@ -186,7 +186,6 @@ declare const createPacker: <TFile>(options: {
|
|
|
186
186
|
declare class AppProperties extends ImportedXmlComponent {
|
|
187
187
|
private static instance;
|
|
188
188
|
constructor();
|
|
189
|
-
prepForXml(): Readonly<Record<string, any>> | undefined;
|
|
190
189
|
toXml(_context: Context): string;
|
|
191
190
|
}
|
|
192
191
|
//#endregion
|
|
@@ -205,7 +204,6 @@ declare class Relationships extends BaseXmlComponent {
|
|
|
205
204
|
* Bypasses the IXmlableObject intermediate tree entirely.
|
|
206
205
|
*/
|
|
207
206
|
toXml(_context: Context): string;
|
|
208
|
-
prepForXml(_context: Context): IXmlableObject;
|
|
209
207
|
}
|
|
210
208
|
//#endregion
|
|
211
209
|
//#region src/opc/content-types.d.ts
|
|
@@ -231,6 +229,9 @@ declare const createOverride: (contentType: string, partName?: string) => XmlCom
|
|
|
231
229
|
* Converts an XmlComponent tree into a serializable XML object or string.
|
|
232
230
|
*/
|
|
233
231
|
declare class Formatter {
|
|
232
|
+
/**
|
|
233
|
+
* @deprecated Use `component.toXml(context)` or `formatToXml()` instead.
|
|
234
|
+
*/
|
|
234
235
|
format<T extends Context = Context>(input: BaseXmlComponent, context?: T): Record<string, any>;
|
|
235
236
|
/**
|
|
236
237
|
* Serialize a component directly to XML string via the toXml() fast path.
|
|
@@ -274,7 +275,7 @@ declare function buildCorePropertiesXml(opts: {
|
|
|
274
275
|
/**
|
|
275
276
|
* Build a cp:coreProperties XML string directly (fast path).
|
|
276
277
|
*
|
|
277
|
-
* Shared by pptx and xlsx to bypass
|
|
278
|
+
* Shared by pptx and xlsx to bypass the toXml() → xml() pipeline.
|
|
278
279
|
*/
|
|
279
280
|
declare function buildCorePropertiesXmlString(opts: {
|
|
280
281
|
readonly title?: string;
|
|
@@ -419,14 +420,14 @@ declare const xsdLineEndSize: {
|
|
|
419
420
|
declare const xsdBlendMode: {
|
|
420
421
|
/** User-friendly value → XSD value */to: (key: string) => string; /** XSD value → user-friendly value */
|
|
421
422
|
from: (xsd: string) => string; /** The forward map (user → XSD) */
|
|
422
|
-
forward: Record<"
|
|
423
|
-
reverse: Record<"
|
|
423
|
+
forward: Record<"over" | "multiply" | "screen" | "darken" | "lighten", "over" | "screen" | "darken" | "lighten" | "mult">; /** The reverse map (XSD → user) */
|
|
424
|
+
reverse: Record<"over" | "screen" | "darken" | "lighten" | "mult", "over" | "multiply" | "screen" | "darken" | "lighten">;
|
|
424
425
|
};
|
|
425
426
|
declare const xsdPathFillMode: {
|
|
426
427
|
/** User-friendly value → XSD value */to: (key: string) => string; /** XSD value → user-friendly value */
|
|
427
428
|
from: (xsd: string) => string; /** The forward map (user → XSD) */
|
|
428
|
-
forward: Record<"none" | "
|
|
429
|
-
reverse: Record<"none" | "
|
|
429
|
+
forward: Record<"none" | "darken" | "lighten" | "normal" | "lightenLess" | "darkenLess", "none" | "darken" | "lighten" | "lightenLess" | "darkenLess" | "norm">; /** The reverse map (XSD → user) */
|
|
430
|
+
reverse: Record<"none" | "darken" | "lighten" | "lightenLess" | "darkenLess" | "norm", "none" | "darken" | "lighten" | "normal" | "lightenLess" | "darkenLess">;
|
|
430
431
|
};
|
|
431
432
|
declare const xsdEffectContainer: {
|
|
432
433
|
/** User-friendly value → XSD value */to: (key: string) => string; /** XSD value → user-friendly value */
|
|
@@ -491,4 +492,4 @@ declare function compileMapping(mapping: Record<string, {
|
|
|
491
492
|
path: string;
|
|
492
493
|
}[]): Zippable;
|
|
493
494
|
//#endregion
|
|
494
|
-
export { AppProperties, AreaChart,
|
|
495
|
+
export { AppProperties, AreaChart, 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, 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, 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, XmlComponent, XmlNamespaceConfig, XmlifyedFile, ZIP_DEFLATE_LEVEL, ZIP_STORED_LEVEL, type ZipOptions, type Zippable, addSmartArtRelationships, appendContentType, appendRelationship, attrObj, buildAttrObject, buildCorePropertiesXml, buildCorePropertiesXmlString, buildFill, chartAttr, collectPlaceholderKeys, compileMapping, convertEmuToInches, convertEmuToPixels, convertEmuToPoints, convertInchesToEmu, convertInchesToTwip, convertMillimetersToTwip, convertOutput, convertPixelsToEmu, convertPointsToEmu, 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, 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,8 +1,8 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { _ as EMPTY_OBJECT, a as BuilderElement, b as BaseXmlComponent, c as buildAttrObject, d as numberValObj, f as onOffObj, g as wrapEl, h as stringValObj, i as convertToXmlComponent, l as chartAttr, m as stringEnumValObj, n as ImportedRootElementAttributes, o as EmptyElement, p as stringContainerObj, r as ImportedXmlComponent, s as attrObj, t as InitializableXmlComponent, u as hpsMeasureObj, v as IgnoreIfEmptyXmlComponent, y as XmlComponent } from "./xml-components-Cfvn_mId.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 { $ 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-
|
|
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 { 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-
|
|
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-C0t3mzSK.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-BKz8xM1k.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-jj57bDdC.mjs";
|
|
6
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-O6SD_BaJ.mjs";
|
|
7
7
|
import { escapeXml, js2xml, textOf, xml2js } from "@office-open/xml";
|
|
8
8
|
import { AsyncZipDeflate, Zip, ZipPassThrough, strFromU8, strFromU8 as strFromU8$1, strToU8, unzipSync, unzipSync as unzipSync$1, zip, zipSync } from "fflate";
|
|
@@ -166,9 +166,6 @@ var AppProperties = class AppProperties extends ImportedXmlComponent {
|
|
|
166
166
|
constructor() {
|
|
167
167
|
super("Properties");
|
|
168
168
|
}
|
|
169
|
-
prepForXml() {
|
|
170
|
-
return AppProperties.instance.prepForXml({ stack: [] });
|
|
171
|
-
}
|
|
172
169
|
toXml(_context) {
|
|
173
170
|
return AppProperties.instance.toXml(_context);
|
|
174
171
|
}
|
|
@@ -176,7 +173,6 @@ var AppProperties = class AppProperties extends ImportedXmlComponent {
|
|
|
176
173
|
//#endregion
|
|
177
174
|
//#region src/opc/relationships.ts
|
|
178
175
|
const TargetModeType = { EXTERNAL: "External" };
|
|
179
|
-
const RELS_ATTRS = { _attr: { xmlns: "http://schemas.openxmlformats.org/package/2006/relationships" } };
|
|
180
176
|
var Relationships = class extends BaseXmlComponent {
|
|
181
177
|
entries = [];
|
|
182
178
|
constructor() {
|
|
@@ -206,20 +202,6 @@ var Relationships = class extends BaseXmlComponent {
|
|
|
206
202
|
p.push("</Relationships>");
|
|
207
203
|
return p.join("");
|
|
208
204
|
}
|
|
209
|
-
prepForXml(_context) {
|
|
210
|
-
const children = [RELS_ATTRS];
|
|
211
|
-
for (const e of this.entries) {
|
|
212
|
-
const attrs = {
|
|
213
|
-
Id: e.id,
|
|
214
|
-
Type: e.type,
|
|
215
|
-
Target: e.target
|
|
216
|
-
};
|
|
217
|
-
if (e.targetMode) attrs.TargetMode = e.targetMode;
|
|
218
|
-
children.push({ Relationship: { _attr: attrs } });
|
|
219
|
-
}
|
|
220
|
-
if (children.length === 1 && "_attr" in children[0]) return { Relationships: children[0] };
|
|
221
|
-
return { Relationships: children };
|
|
222
|
-
}
|
|
223
205
|
};
|
|
224
206
|
//#endregion
|
|
225
207
|
//#region src/opc/content-types.ts
|
|
@@ -272,6 +254,9 @@ const XML_DECL = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"
|
|
|
272
254
|
* Converts an XmlComponent tree into a serializable XML object or string.
|
|
273
255
|
*/
|
|
274
256
|
var Formatter = class {
|
|
257
|
+
/**
|
|
258
|
+
* @deprecated Use `component.toXml(context)` or `formatToXml()` instead.
|
|
259
|
+
*/
|
|
275
260
|
format(input, context = { stack: [] }) {
|
|
276
261
|
const output = input.prepForXml(context);
|
|
277
262
|
if (output) return output;
|
|
@@ -367,7 +352,7 @@ function buildCorePropertiesXml(opts) {
|
|
|
367
352
|
/**
|
|
368
353
|
* Build a cp:coreProperties XML string directly (fast path).
|
|
369
354
|
*
|
|
370
|
-
* Shared by pptx and xlsx to bypass
|
|
355
|
+
* Shared by pptx and xlsx to bypass the toXml() → xml() pipeline.
|
|
371
356
|
*/
|
|
372
357
|
function buildCorePropertiesXmlString(opts) {
|
|
373
358
|
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/dc/dcmitype/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">"];
|
|
@@ -615,4 +600,4 @@ function compileMapping(mapping, overrides, media) {
|
|
|
615
600
|
return files;
|
|
616
601
|
}
|
|
617
602
|
//#endregion
|
|
618
|
-
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,
|
|
603
|
+
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, OoxmlMimeType, PPTX_NS, ParsedArchive, PathShadeType, PenAlignment, PieChart, Point, PresetColor, PresetDash, PresetGeometry, PresetMaterialType, PresetPattern, PresetShadowVal, RawPassthrough, RectAlignment, Relationships, STYLE_CATEGORIES, ScatterChart, SchemeColor, SmartArtCollection, Stretch, SystemColor, TargetModeType, ThemeColor, ThemeFont, TileAlignment, TileFlipMode, TokenNotFoundError, TransPoint, ValAx, XmlComponent, ZIP_DEFLATE_LEVEL, ZIP_STORED_LEVEL, addSmartArtRelationships, appendContentType, appendRelationship, attrObj, buildAttrObject, buildCorePropertiesXml, buildCorePropertiesXmlString, buildFill, chartAttr, collectPlaceholderKeys, compileMapping, convertEmuToInches, convertEmuToPixels, convertEmuToPoints, convertInchesToEmu, convertInchesToTwip, convertMillimetersToTwip, convertOutput, convertPixelsToEmu, convertPointsToEmu, 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, 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 };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
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-
|
|
1
|
+
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-CEFUwJ2F.mjs";
|
|
2
2
|
export { COLOR_CATEGORIES, Connection, DEFAULT_DRAWING_XML, DataModel, LAYOUT_CATEGORIES, Point, STYLE_CATEGORIES, SmartArtCollection, SmartArtData, TransPoint, TreeNode, createDataModel, getColorXml, getLayoutXml, getStyleXml };
|
package/dist/smartart/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
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-
|
|
1
|
+
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-BKz8xM1k.mjs";
|
|
2
2
|
export { COLOR_CATEGORIES, Connection, DEFAULT_DRAWING_XML, DataModel, LAYOUT_CATEGORIES, Point, STYLE_CATEGORIES, SmartArtCollection, TransPoint, createDataModel, getColorXml, getLayoutXml, getStyleXml };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { l as chartAttr, y as XmlComponent } from "./xml-components-Cfvn_mId.mjs";
|
|
2
2
|
//#region src/smartart/categories.ts
|
|
3
3
|
/** Layout ID → OOXML category type */
|
|
4
4
|
const LAYOUT_CATEGORIES = {
|
|
@@ -2,11 +2,6 @@ import { hpsMeasureValue } from "./values.mjs";
|
|
|
2
2
|
import { escapeXml, xml, xml2js } from "@office-open/xml";
|
|
3
3
|
//#region src/xml-components/base.ts
|
|
4
4
|
/**
|
|
5
|
-
* Base XML Component infrastructure for OOXML document generation.
|
|
6
|
-
*
|
|
7
|
-
* @module
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
5
|
* Abstract base class for all XML components.
|
|
11
6
|
*/
|
|
12
7
|
var BaseXmlComponent = class {
|
|
@@ -16,12 +11,14 @@ var BaseXmlComponent = class {
|
|
|
16
11
|
this.rootKey = rootKey;
|
|
17
12
|
}
|
|
18
13
|
/**
|
|
14
|
+
* @deprecated Use `toXml()` instead.
|
|
15
|
+
*/
|
|
16
|
+
prepForXml(_context) {}
|
|
17
|
+
/**
|
|
19
18
|
* Direct XML serialization. Override in subclasses for zero-allocation output.
|
|
20
|
-
* Default falls back to prepForXml() + xml().
|
|
21
19
|
*/
|
|
22
|
-
toXml(
|
|
23
|
-
|
|
24
|
-
return obj ? xml(obj) : "";
|
|
20
|
+
toXml(_context) {
|
|
21
|
+
return "";
|
|
25
22
|
}
|
|
26
23
|
};
|
|
27
24
|
//#endregion
|
|
@@ -55,7 +52,7 @@ var XmlComponent = class extends BaseXmlComponent {
|
|
|
55
52
|
this.root = [];
|
|
56
53
|
}
|
|
57
54
|
/**
|
|
58
|
-
*
|
|
55
|
+
* @deprecated Use `toXml()` instead.
|
|
59
56
|
*/
|
|
60
57
|
prepForXml(context) {
|
|
61
58
|
context.stack.push(this);
|
|
@@ -77,13 +74,6 @@ var XmlComponent = class extends BaseXmlComponent {
|
|
|
77
74
|
for (const child of this.root) if (child instanceof BaseXmlComponent) {
|
|
78
75
|
const s = child.toXml(context);
|
|
79
76
|
if (s) childParts.push(s);
|
|
80
|
-
if (!s && child.constructor.name === "NextAttributeComponent") {
|
|
81
|
-
const prepped = child.prepForXml(context);
|
|
82
|
-
if (prepped && typeof prepped === "object" && "_attr" in prepped) {
|
|
83
|
-
const a = prepped._attr;
|
|
84
|
-
for (const key of Object.keys(a)) attrParts.push(`${key}="${escapeXml(String(a[key]))}"`);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
77
|
} else if (typeof child === "string") childParts.push(escapeXml(child));
|
|
88
78
|
else if (child != null && typeof child === "object") if ("_attr" in child) {
|
|
89
79
|
const a = child._attr;
|
|
@@ -113,10 +103,13 @@ var IgnoreIfEmptyXmlComponent = class extends XmlComponent {
|
|
|
113
103
|
super(rootKey);
|
|
114
104
|
this.includeIfEmpty = includeIfEmpty;
|
|
115
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* @deprecated Use `toXml()` instead.
|
|
108
|
+
*/
|
|
116
109
|
prepForXml(context) {
|
|
110
|
+
if (this.includeIfEmpty) return super.prepForXml(context);
|
|
117
111
|
const result = super.prepForXml(context);
|
|
118
|
-
|
|
119
|
-
if (result && (typeof result[this.rootKey] !== "object" || Object.keys(result[this.rootKey]).length)) return result;
|
|
112
|
+
return result && result[this.rootKey] === EMPTY_OBJECT ? void 0 : result;
|
|
120
113
|
}
|
|
121
114
|
/**
|
|
122
115
|
* Suppress empty elements — super.toXml() produces a self-closing tag
|
|
@@ -131,56 +124,6 @@ var IgnoreIfEmptyXmlComponent = class extends XmlComponent {
|
|
|
131
124
|
}
|
|
132
125
|
};
|
|
133
126
|
//#endregion
|
|
134
|
-
//#region src/xml-components/attributes.ts
|
|
135
|
-
/**
|
|
136
|
-
* XML attribute components for OOXML document generation.
|
|
137
|
-
*
|
|
138
|
-
* @module
|
|
139
|
-
*/
|
|
140
|
-
/**
|
|
141
|
-
* Base class for creating XML attributes with automatic name mapping.
|
|
142
|
-
*/
|
|
143
|
-
var XmlAttributeComponent = class extends BaseXmlComponent {
|
|
144
|
-
/** Optional mapping from property names to XML attribute names. */
|
|
145
|
-
xmlKeys;
|
|
146
|
-
constructor(root) {
|
|
147
|
-
super("_attr");
|
|
148
|
-
this.root = root;
|
|
149
|
-
}
|
|
150
|
-
prepForXml(_) {
|
|
151
|
-
const attrs = {};
|
|
152
|
-
Object.entries(this.root).forEach(([key, value]) => {
|
|
153
|
-
if (value !== void 0) {
|
|
154
|
-
const newKey = this.xmlKeys && this.xmlKeys[key] || key;
|
|
155
|
-
attrs[newKey] = value;
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
return { _attr: attrs };
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
/**
|
|
162
|
-
* Next-generation attribute component with explicit key-value pairs.
|
|
163
|
-
*/
|
|
164
|
-
var NextAttributeComponent = class extends BaseXmlComponent {
|
|
165
|
-
constructor(root) {
|
|
166
|
-
super("_attr");
|
|
167
|
-
this.root = root;
|
|
168
|
-
}
|
|
169
|
-
prepForXml(_) {
|
|
170
|
-
const attrs = {};
|
|
171
|
-
const values = Object.values(this.root);
|
|
172
|
-
for (let i = 0; i < values.length; i++) {
|
|
173
|
-
const { key, value } = values[i];
|
|
174
|
-
if (value !== void 0) attrs[key] = value;
|
|
175
|
-
}
|
|
176
|
-
return { _attr: attrs };
|
|
177
|
-
}
|
|
178
|
-
/** Attribute components produce no XML output — attrs are inlined by the parent. */
|
|
179
|
-
toXml(_context) {
|
|
180
|
-
return "";
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
//#endregion
|
|
184
127
|
//#region src/xml-components/elements.ts
|
|
185
128
|
/**
|
|
186
129
|
* Simple XML element types for common OOXML patterns.
|
|
@@ -269,12 +212,17 @@ var BuilderElement = class extends XmlComponent {
|
|
|
269
212
|
}
|
|
270
213
|
};
|
|
271
214
|
/**
|
|
272
|
-
*
|
|
215
|
+
* Builds an attribute-only IXmlableObject from a plain key-value record.
|
|
273
216
|
*/
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
value
|
|
277
|
-
}
|
|
217
|
+
function buildAttrObject(attrs) {
|
|
218
|
+
const result = {};
|
|
219
|
+
for (const [key, value] of Object.entries(attrs)) if (value !== void 0) result[key] = value;
|
|
220
|
+
return Object.keys(result).length > 0 ? { _attr: result } : EMPTY_OBJECT;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Creates an attribute IXmlableObject for chart elements.
|
|
224
|
+
*/
|
|
225
|
+
const chartAttr = (attrs) => buildAttrObject(attrs);
|
|
278
226
|
/**
|
|
279
227
|
* Wraps a component in a named XmlComponent element.
|
|
280
228
|
*/
|
|
@@ -340,15 +288,23 @@ var ImportedXmlComponent = class extends XmlComponent {
|
|
|
340
288
|
};
|
|
341
289
|
/**
|
|
342
290
|
* Represents attributes for imported root elements.
|
|
291
|
+
* The { _attr } in root is consumed by the parent's toXml() serialization.
|
|
343
292
|
*/
|
|
344
293
|
var ImportedRootElementAttributes = class extends XmlComponent {
|
|
345
294
|
constructor(_attr) {
|
|
346
295
|
super("");
|
|
347
296
|
this._attr = _attr;
|
|
297
|
+
if (_attr) this.root.push({ _attr });
|
|
348
298
|
}
|
|
349
|
-
|
|
299
|
+
/**
|
|
300
|
+
* @deprecated Use `toXml()` instead.
|
|
301
|
+
*/
|
|
302
|
+
prepForXml(_context) {
|
|
350
303
|
return { _attr: this._attr };
|
|
351
304
|
}
|
|
305
|
+
toXml(_context) {
|
|
306
|
+
return "";
|
|
307
|
+
}
|
|
352
308
|
};
|
|
353
309
|
//#endregion
|
|
354
310
|
//#region src/xml-components/initializable.ts
|
|
@@ -367,4 +323,4 @@ var InitializableXmlComponent = class extends XmlComponent {
|
|
|
367
323
|
}
|
|
368
324
|
};
|
|
369
325
|
//#endregion
|
|
370
|
-
export {
|
|
326
|
+
export { EMPTY_OBJECT as _, BuilderElement as a, BaseXmlComponent as b, buildAttrObject as c, numberValObj as d, onOffObj as f, wrapEl as g, stringValObj as h, convertToXmlComponent as i, chartAttr as l, stringEnumValObj as m, ImportedRootElementAttributes as n, EmptyElement as o, stringContainerObj as p, ImportedXmlComponent as r, attrObj as s, InitializableXmlComponent as t, hpsMeasureObj as u, IgnoreIfEmptyXmlComponent as v, XmlComponent as y };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@office-open/core",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.8",
|
|
4
4
|
"description": "Shared OOXML infrastructure: XmlComponent, value validators, unit converters",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"core",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"fflate": "0.8.3",
|
|
56
56
|
"hash.js": "1.1.7",
|
|
57
57
|
"nanoid": "5.1.11",
|
|
58
|
-
"@office-open/xml": "0.6.
|
|
58
|
+
"@office-open/xml": "0.6.8"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"dev": "basis build --stub",
|