@office-open/core 0.10.15 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/chart/index.d.mts +2 -2
- package/dist/chart/index.mjs +2 -2
- package/dist/chart-DED4tXC9.mjs +2325 -0
- package/dist/chart-DED4tXC9.mjs.map +1 -0
- package/dist/color-mapping-CFF0vRSe.mjs +117 -0
- package/dist/color-mapping-CFF0vRSe.mjs.map +1 -0
- package/dist/data-type-CZMKVaaT.d.mts.map +1 -1
- package/dist/descriptor/index.d.mts +2 -2
- package/dist/descriptor/index.mjs +1 -1
- package/dist/{descriptor-BjNkn5jo.mjs → descriptor-BqaNZrrZ.mjs} +43 -11
- package/dist/{descriptor-BjNkn5jo.mjs.map → descriptor-BqaNZrrZ.mjs.map} +1 -1
- package/dist/drawing/index.d.mts +2 -0
- package/dist/drawing/index.mjs +2 -0
- package/dist/{drawingml-sj1J3lb0.mjs → drawing-BCAyrCCw.mjs} +4456 -3452
- package/dist/drawing-BCAyrCCw.mjs.map +1 -0
- package/dist/{converters-C_Y2QX1w.mjs → ext-uri-BHBcIrW7.mjs} +742 -45
- package/dist/ext-uri-BHBcIrW7.mjs.map +1 -0
- package/dist/index-BAxlDUQ1.d.mts +590 -0
- package/dist/index-BAxlDUQ1.d.mts.map +1 -0
- package/dist/index-BP541uS-.d.mts +489 -0
- package/dist/index-BP541uS-.d.mts.map +1 -0
- package/dist/{index-BVK2dv6C.d.mts → index-BQLIofaF.d.mts} +10 -4
- package/dist/index-BQLIofaF.d.mts.map +1 -0
- package/dist/{index-k8WKLXnA.d.mts → index-CaNwM5_e.d.mts} +19 -20
- package/dist/index-CaNwM5_e.d.mts.map +1 -0
- package/dist/index-DPkf_CtG.d.mts +1578 -0
- package/dist/index-DPkf_CtG.d.mts.map +1 -0
- package/dist/index-DcukVskh.d.mts +31 -0
- package/dist/index-DcukVskh.d.mts.map +1 -0
- package/dist/index-Di6XPdGl.d.mts +322 -0
- package/dist/index-Di6XPdGl.d.mts.map +1 -0
- package/dist/index-L6AXewfV.d.mts +872 -0
- package/dist/index-L6AXewfV.d.mts.map +1 -0
- package/dist/index.d.mts +294 -30
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1327 -112
- package/dist/index.mjs.map +1 -1
- package/dist/{output-D_G_JR_8.d.mts → output-yyxdkG0C.d.mts} +2 -3
- package/dist/output-yyxdkG0C.d.mts.map +1 -0
- package/dist/patch/index.d.mts +2 -2
- package/dist/patch/index.mjs +2 -2
- package/dist/{patch-BmRfghOo.mjs → patch-AkQY17CD.mjs} +73 -28
- package/dist/patch-AkQY17CD.mjs.map +1 -0
- package/dist/smartart/index.d.mts +2 -2
- package/dist/smartart/index.mjs +2 -2
- package/dist/smartart-n1kYJ6Jg.mjs +1650 -0
- package/dist/smartart-n1kYJ6Jg.mjs.map +1 -0
- package/dist/style-matrix-B6jhPAT3.mjs +123 -0
- package/dist/style-matrix-B6jhPAT3.mjs.map +1 -0
- package/dist/theme/index.d.mts +4 -2
- package/dist/theme/index.mjs +4 -2
- package/dist/theme-BKnXRmvn.mjs +426 -0
- package/dist/theme-BKnXRmvn.mjs.map +1 -0
- package/dist/theme-options-kO89NUEX.d.mts +109 -0
- package/dist/theme-options-kO89NUEX.d.mts.map +1 -0
- package/dist/util/index.d.mts +3 -3
- package/dist/util/index.mjs +3 -3
- package/dist/{util-Tq9PSjK0.mjs → util-ptE16MEk.mjs} +237 -459
- package/dist/util-ptE16MEk.mjs.map +1 -0
- package/dist/{values-8di32lIe.d.mts → values-BECDm4zr.d.mts} +17 -31
- package/dist/values-BECDm4zr.d.mts.map +1 -0
- package/dist/vector/index.d.mts +2 -0
- package/dist/vector/index.mjs +2 -0
- package/dist/vector-DhLGZjP5.mjs +3049 -0
- package/dist/vector-DhLGZjP5.mjs.map +1 -0
- package/package.json +16 -8
- package/dist/chart-DIGJna_6.mjs +0 -582
- package/dist/chart-DIGJna_6.mjs.map +0 -1
- package/dist/converters-C_Y2QX1w.mjs.map +0 -1
- package/dist/drawingml/index.d.mts +0 -2
- package/dist/drawingml/index.mjs +0 -2
- package/dist/drawingml-sj1J3lb0.mjs.map +0 -1
- package/dist/index-BVK2dv6C.d.mts.map +0 -1
- package/dist/index-BfHfKuKy.d.mts +0 -275
- package/dist/index-BfHfKuKy.d.mts.map +0 -1
- package/dist/index-CE53SwpZ.d.mts +0 -1463
- package/dist/index-CE53SwpZ.d.mts.map +0 -1
- package/dist/index-D6VE-MnJ.d.mts +0 -43
- package/dist/index-D6VE-MnJ.d.mts.map +0 -1
- package/dist/index-DE4CLElr.d.mts +0 -145
- package/dist/index-DE4CLElr.d.mts.map +0 -1
- package/dist/index-DlPA26cw.d.mts +0 -91
- package/dist/index-DlPA26cw.d.mts.map +0 -1
- package/dist/index-k8WKLXnA.d.mts.map +0 -1
- package/dist/output-D_G_JR_8.d.mts.map +0 -1
- package/dist/patch-BmRfghOo.mjs.map +0 -1
- package/dist/smartart-B7ukZ-Tw.mjs +0 -305
- package/dist/smartart-B7ukZ-Tw.mjs.map +0 -1
- package/dist/theme-CiNzdl-9.mjs +0 -177
- package/dist/theme-CiNzdl-9.mjs.map +0 -1
- package/dist/util-Tq9PSjK0.mjs.map +0 -1
- package/dist/values-8di32lIe.d.mts.map +0 -1
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
import { S as bodyPropertiesDesc, Un as parseColorChoice, Xn as stringifyColorChoice, Zn as systemColorDesc, j as shapePropertiesDesc, u as textListStyleDesc } from "./drawing-BCAyrCCw.mjs";
|
|
2
|
+
import { i as stringifyShapeStyle, n as parseShapeStyle, r as stringifyFormatScheme, t as parseFormatScheme } from "./style-matrix-B6jhPAT3.mjs";
|
|
3
|
+
import { n as parseColorMapping, r as stringifyColorMapping } from "./color-mapping-CFF0vRSe.mjs";
|
|
4
|
+
import { escapeXml, findChild } from "@office-open/xml";
|
|
5
|
+
//#region src/theme/default-colors.ts
|
|
6
|
+
/** Office 2016+ default theme colors (hex without #). */
|
|
7
|
+
const DEFAULT_COLORS = {
|
|
8
|
+
dark1: "000000",
|
|
9
|
+
light1: "FFFFFF",
|
|
10
|
+
dark2: "44546A",
|
|
11
|
+
light2: "E7E6E6",
|
|
12
|
+
accent1: "4472C4",
|
|
13
|
+
accent2: "ED7D31",
|
|
14
|
+
accent3: "A5A5A5",
|
|
15
|
+
accent4: "FFC000",
|
|
16
|
+
accent5: "5B9BD5",
|
|
17
|
+
accent6: "70AD47",
|
|
18
|
+
hyperlink: "0563C1",
|
|
19
|
+
followedHyperlink: "954F72"
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/theme/color-scheme.ts
|
|
23
|
+
/**
|
|
24
|
+
* Color scheme (a:clrScheme / CT_ColorScheme) stringify + parse.
|
|
25
|
+
*
|
|
26
|
+
* Every slot accepts a hex string (emits a:srgbClr) or a structured
|
|
27
|
+
* SystemColorOptions (emits a:sysClr verbatim). dk1/lt1 default to the
|
|
28
|
+
* conventional windowText/window sysClr form; parse reads both forms back
|
|
29
|
+
* losslessly, so a source's sysClr spelling survives round-trip.
|
|
30
|
+
*
|
|
31
|
+
* @module
|
|
32
|
+
*/
|
|
33
|
+
/** clrScheme child tag → ColorSchemeOptions key, in schema order. */
|
|
34
|
+
const COLOR_TAGS = [
|
|
35
|
+
{
|
|
36
|
+
tag: "a:dk1",
|
|
37
|
+
key: "dark1"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
tag: "a:lt1",
|
|
41
|
+
key: "light1"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
tag: "a:dk2",
|
|
45
|
+
key: "dark2"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
tag: "a:lt2",
|
|
49
|
+
key: "light2"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
tag: "a:accent1",
|
|
53
|
+
key: "accent1"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
tag: "a:accent2",
|
|
57
|
+
key: "accent2"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
tag: "a:accent3",
|
|
61
|
+
key: "accent3"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
tag: "a:accent4",
|
|
65
|
+
key: "accent4"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
tag: "a:accent5",
|
|
69
|
+
key: "accent5"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
tag: "a:accent6",
|
|
73
|
+
key: "accent6"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
tag: "a:hlink",
|
|
77
|
+
key: "hyperlink"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
tag: "a:folHlink",
|
|
81
|
+
key: "followedHyperlink"
|
|
82
|
+
}
|
|
83
|
+
];
|
|
84
|
+
/** The conventional dk1/lt1 sysClr forms emitted when a slot is unset. */
|
|
85
|
+
const DEFAULT_SYS_CLR = {
|
|
86
|
+
dark1: "windowText",
|
|
87
|
+
light1: "window"
|
|
88
|
+
};
|
|
89
|
+
function stringifyColorTag(tag, key, opts) {
|
|
90
|
+
const userValue = opts?.[key];
|
|
91
|
+
if (userValue !== void 0) return `<${tag}>${typeof userValue === "string" ? `<a:srgbClr val="${userValue}"/>` : systemColorDesc.stringify(userValue, void 0) ?? ""}</${tag}>`;
|
|
92
|
+
const defaultValue = DEFAULT_COLORS[key];
|
|
93
|
+
const sysClr = DEFAULT_SYS_CLR[key];
|
|
94
|
+
if (sysClr) return `<${tag}><a:sysClr val="${sysClr}" lastClr="${defaultValue}"/></${tag}>`;
|
|
95
|
+
return `<${tag}><a:srgbClr val="${defaultValue}"/></${tag}>`;
|
|
96
|
+
}
|
|
97
|
+
/** Serialize a:clrScheme. Undefined options emit the full default scheme. */
|
|
98
|
+
function stringifyColorScheme(opts, fallbackName) {
|
|
99
|
+
return `<a:clrScheme name="${opts?.name ?? fallbackName}">${COLOR_TAGS.map(({ tag, key }) => stringifyColorTag(tag, key, opts)).join("")}</a:clrScheme>`;
|
|
100
|
+
}
|
|
101
|
+
/** Parse a:clrScheme into the subset of colors explicitly present. */
|
|
102
|
+
function parseColorScheme(el, ctx) {
|
|
103
|
+
if (!el) return void 0;
|
|
104
|
+
const result = {};
|
|
105
|
+
const name = el.attributes?.["name"];
|
|
106
|
+
if (name) result.name = String(name);
|
|
107
|
+
for (const { tag, key } of COLOR_TAGS) {
|
|
108
|
+
const colorEl = findChild(el, tag);
|
|
109
|
+
if (!colorEl) continue;
|
|
110
|
+
const sysClr = findChild(colorEl, "a:sysClr");
|
|
111
|
+
if (sysClr) {
|
|
112
|
+
result[key] = systemColorDesc.parse(sysClr, ctx);
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
const val = findChild(colorEl, "a:srgbClr")?.attributes?.["val"];
|
|
116
|
+
if (val !== void 0) result[key] = String(val);
|
|
117
|
+
}
|
|
118
|
+
return result;
|
|
119
|
+
}
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region src/theme/custom-color.ts
|
|
122
|
+
/** Serialize a:custClrLst. Returns "" when no custom colors set (optional element). */
|
|
123
|
+
function stringifyCustomColors(opts, ctx) {
|
|
124
|
+
if (!opts || opts.length === 0) return "";
|
|
125
|
+
return `<a:custClrLst>${opts.map((c) => {
|
|
126
|
+
return `<a:custClr${c.name ? ` name="${c.name}"` : ""}>${stringifyColorChoice(c.color, ctx)}</a:custClr>`;
|
|
127
|
+
}).join("")}</a:custClrLst>`;
|
|
128
|
+
}
|
|
129
|
+
/** Parse a:custClrLst. */
|
|
130
|
+
function parseCustomColors(el, ctx) {
|
|
131
|
+
if (!el) return void 0;
|
|
132
|
+
const result = [];
|
|
133
|
+
for (const child of el.elements ?? []) {
|
|
134
|
+
if (child.name !== "a:custClr") continue;
|
|
135
|
+
const color = parseColorChoice(child, ctx);
|
|
136
|
+
if (!color) continue;
|
|
137
|
+
const name = child.attributes?.["name"];
|
|
138
|
+
result.push(name !== void 0 ? {
|
|
139
|
+
name: String(name),
|
|
140
|
+
color
|
|
141
|
+
} : { color });
|
|
142
|
+
}
|
|
143
|
+
return result.length > 0 ? result : void 0;
|
|
144
|
+
}
|
|
145
|
+
//#endregion
|
|
146
|
+
//#region src/theme/extra-color-scheme.ts
|
|
147
|
+
/**
|
|
148
|
+
* Extra color scheme (a:extraClrScheme / CT_ExtraColorScheme) stringify + parse.
|
|
149
|
+
*
|
|
150
|
+
* Each entry pairs a color scheme with an optional color mapping. The list
|
|
151
|
+
* wrapper (a:extraClrSchemeLst / CT_ColorSchemeList) holds zero or more entries.
|
|
152
|
+
*
|
|
153
|
+
* @module
|
|
154
|
+
*/
|
|
155
|
+
/** Serialize a:extraClrSchemeLst. Returns an empty element when no schemes set. */
|
|
156
|
+
function stringifyExtraColorSchemes(opts, fallbackName) {
|
|
157
|
+
if (!opts || opts.length === 0) return "<a:extraClrSchemeLst/>";
|
|
158
|
+
return `<a:extraClrSchemeLst>${opts.map((scheme) => {
|
|
159
|
+
return `<a:extraClrScheme>${stringifyColorScheme(scheme.colorScheme, scheme.colorScheme.name ?? fallbackName)}${scheme.colorMapping ? stringifyColorMapping(scheme.colorMapping) : ""}</a:extraClrScheme>`;
|
|
160
|
+
}).join("")}</a:extraClrSchemeLst>`;
|
|
161
|
+
}
|
|
162
|
+
/** Parse a:extraClrSchemeLst. */
|
|
163
|
+
function parseExtraColorSchemes(el, ctx) {
|
|
164
|
+
if (!el) return void 0;
|
|
165
|
+
const result = [];
|
|
166
|
+
for (const child of el.elements ?? []) {
|
|
167
|
+
if (child.name !== "a:extraClrScheme") continue;
|
|
168
|
+
const colorScheme = parseColorScheme(findChild(child, "a:clrScheme"), ctx);
|
|
169
|
+
if (!colorScheme) continue;
|
|
170
|
+
const colorMapping = parseColorMapping(findChild(child, "a:clrMap"));
|
|
171
|
+
result.push(colorMapping ? {
|
|
172
|
+
colorScheme,
|
|
173
|
+
colorMapping
|
|
174
|
+
} : { colorScheme });
|
|
175
|
+
}
|
|
176
|
+
return result.length > 0 ? result : void 0;
|
|
177
|
+
}
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region src/theme/font-scheme.ts
|
|
180
|
+
/**
|
|
181
|
+
* Font scheme (a:fontScheme / CT_FontScheme) stringify + parse.
|
|
182
|
+
*
|
|
183
|
+
* CT_FontCollection order: latin → ea → cs → font[] (supplemental).
|
|
184
|
+
*
|
|
185
|
+
* @module
|
|
186
|
+
*/
|
|
187
|
+
function stringifyTextFont(tag, opts) {
|
|
188
|
+
if (!opts) return "";
|
|
189
|
+
const attrs = [`typeface="${escapeXml(opts.typeface)}"`];
|
|
190
|
+
if (opts.panose !== void 0) attrs.push(`panose="${escapeXml(opts.panose)}"`);
|
|
191
|
+
if (opts.pitchFamily !== void 0) attrs.push(`pitchFamily="${opts.pitchFamily}"`);
|
|
192
|
+
if (opts.charset !== void 0) attrs.push(`charset="${opts.charset}"`);
|
|
193
|
+
return `<${tag} ${attrs.join(" ")}/>`;
|
|
194
|
+
}
|
|
195
|
+
function parseTextFont(el) {
|
|
196
|
+
if (!el?.attributes) return void 0;
|
|
197
|
+
const typeface = el.attributes["typeface"];
|
|
198
|
+
if (typeface === void 0) return void 0;
|
|
199
|
+
const result = { typeface: String(typeface) };
|
|
200
|
+
if (el.attributes["panose"] !== void 0) result.panose = String(el.attributes["panose"]);
|
|
201
|
+
if (el.attributes["pitchFamily"] !== void 0) result.pitchFamily = Number(el.attributes["pitchFamily"]);
|
|
202
|
+
if (el.attributes["charset"] !== void 0) result.charset = Number(el.attributes["charset"]);
|
|
203
|
+
return result;
|
|
204
|
+
}
|
|
205
|
+
function stringifyFontCollection(tag, opts) {
|
|
206
|
+
return `<${tag}>${stringifyTextFont("a:latin", opts?.latin)}${stringifyTextFont("a:ea", opts?.eastAsian)}${stringifyTextFont("a:cs", opts?.complexScript)}${(opts?.supplementalFonts ?? []).map((f) => `<a:font script="${escapeXml(f.script)}" typeface="${escapeXml(f.typeface)}"/>`).join("")}</${tag}>`;
|
|
207
|
+
}
|
|
208
|
+
function parseFontCollection(el) {
|
|
209
|
+
if (!el) return void 0;
|
|
210
|
+
const result = {};
|
|
211
|
+
const latin = parseTextFont(findChild(el, "a:latin"));
|
|
212
|
+
if (latin) result.latin = latin;
|
|
213
|
+
const eastAsian = parseTextFont(findChild(el, "a:ea"));
|
|
214
|
+
if (eastAsian) result.eastAsian = eastAsian;
|
|
215
|
+
const complexScript = parseTextFont(findChild(el, "a:cs"));
|
|
216
|
+
if (complexScript) result.complexScript = complexScript;
|
|
217
|
+
const supplementalFonts = (el.elements ?? []).filter((c) => c.name === "a:font").map((c) => {
|
|
218
|
+
const script = c.attributes?.["script"];
|
|
219
|
+
const typeface = c.attributes?.["typeface"];
|
|
220
|
+
if (script === void 0 || typeface === void 0) return void 0;
|
|
221
|
+
return {
|
|
222
|
+
script: String(script),
|
|
223
|
+
typeface: String(typeface)
|
|
224
|
+
};
|
|
225
|
+
}).filter((v) => v !== void 0);
|
|
226
|
+
if (supplementalFonts.length > 0) result.supplementalFonts = supplementalFonts;
|
|
227
|
+
return Object.keys(result).length > 0 ? result : void 0;
|
|
228
|
+
}
|
|
229
|
+
const DEFAULT_MAJOR_FONT = {
|
|
230
|
+
latin: {
|
|
231
|
+
typeface: "Calibri Light",
|
|
232
|
+
panose: "020F0302020204030204"
|
|
233
|
+
},
|
|
234
|
+
eastAsian: { typeface: "" },
|
|
235
|
+
complexScript: { typeface: "" }
|
|
236
|
+
};
|
|
237
|
+
const DEFAULT_MINOR_FONT = {
|
|
238
|
+
latin: {
|
|
239
|
+
typeface: "Calibri",
|
|
240
|
+
panose: "020F0502020204030204"
|
|
241
|
+
},
|
|
242
|
+
eastAsian: { typeface: "" },
|
|
243
|
+
complexScript: { typeface: "" }
|
|
244
|
+
};
|
|
245
|
+
/** Serialize a:fontScheme. Undefined options emit the Office default scheme. */
|
|
246
|
+
function stringifyFontScheme(opts, fallbackName) {
|
|
247
|
+
const majorFont = stringifyFontCollection("a:majorFont", opts?.majorFont ? {
|
|
248
|
+
...DEFAULT_MAJOR_FONT,
|
|
249
|
+
...opts.majorFont
|
|
250
|
+
} : DEFAULT_MAJOR_FONT);
|
|
251
|
+
const minorFont = stringifyFontCollection("a:minorFont", opts?.minorFont ? {
|
|
252
|
+
...DEFAULT_MINOR_FONT,
|
|
253
|
+
...opts.minorFont
|
|
254
|
+
} : DEFAULT_MINOR_FONT);
|
|
255
|
+
return `<a:fontScheme name="${opts?.name ?? fallbackName}">${majorFont}${minorFont}</a:fontScheme>`;
|
|
256
|
+
}
|
|
257
|
+
/** Parse a:fontScheme. Returns undefined only when neither major nor minor font is present. */
|
|
258
|
+
function parseFontScheme(el) {
|
|
259
|
+
if (!el) return void 0;
|
|
260
|
+
const result = {};
|
|
261
|
+
const name = el.attributes?.["name"];
|
|
262
|
+
if (name) result.name = String(name);
|
|
263
|
+
const majorFont = parseFontCollection(findChild(el, "a:majorFont"));
|
|
264
|
+
if (majorFont) result.majorFont = majorFont;
|
|
265
|
+
const minorFont = parseFontCollection(findChild(el, "a:minorFont"));
|
|
266
|
+
if (minorFont) result.minorFont = minorFont;
|
|
267
|
+
return Object.keys(result).length > 0 ? result : void 0;
|
|
268
|
+
}
|
|
269
|
+
//#endregion
|
|
270
|
+
//#region src/theme/object-defaults.ts
|
|
271
|
+
/**
|
|
272
|
+
* Object defaults (a:objectDefaults / CT_ObjectStyleDefaults) stringify + parse.
|
|
273
|
+
*
|
|
274
|
+
* Each default definition (spDef/lnDef/txDef) holds shape properties, body
|
|
275
|
+
* properties, list style, and an optional shape style. Reuses core descriptors
|
|
276
|
+
* so defaults round-trip through the same machinery as shapes.
|
|
277
|
+
*
|
|
278
|
+
* @module
|
|
279
|
+
*/
|
|
280
|
+
function stringifyDefaultShapeDefinition(tag, opts, ctx) {
|
|
281
|
+
return `<${tag}>${opts.shapeProperties !== void 0 ? `<a:spPr>${shapePropertiesDesc.stringify(opts.shapeProperties, ctx) ?? ""}</a:spPr>` : ""}${opts.bodyProperties !== void 0 ? bodyPropertiesDesc.stringify(opts.bodyProperties, ctx) || "<a:bodyPr/>" : ""}${opts.listStyle !== void 0 ? `<a:lstStyle>${textListStyleDesc.stringify(opts.listStyle, ctx) ?? ""}</a:lstStyle>` : ""}${opts.shapeStyle ? stringifyShapeStyle(opts.shapeStyle, ctx) : ""}</${tag}>`;
|
|
282
|
+
}
|
|
283
|
+
function parseDefaultShapeDefinition(el, ctx) {
|
|
284
|
+
if (!el) return void 0;
|
|
285
|
+
const result = {};
|
|
286
|
+
const spPr = findChild(el, "a:spPr");
|
|
287
|
+
if (spPr) result.shapeProperties = shapePropertiesDesc.parse(spPr, ctx) ?? {};
|
|
288
|
+
const bodyPr = findChild(el, "a:bodyPr");
|
|
289
|
+
if (bodyPr) result.bodyProperties = bodyPropertiesDesc.parse(bodyPr, ctx) ?? {};
|
|
290
|
+
const lstStyle = findChild(el, "a:lstStyle");
|
|
291
|
+
if (lstStyle) result.listStyle = textListStyleDesc.parse(lstStyle, ctx) ?? {};
|
|
292
|
+
const style = findChild(el, "a:style");
|
|
293
|
+
if (style) {
|
|
294
|
+
const shapeStyle = parseShapeStyle(style, ctx);
|
|
295
|
+
if (shapeStyle) result.shapeStyle = shapeStyle;
|
|
296
|
+
}
|
|
297
|
+
return Object.keys(result).length > 0 ? result : void 0;
|
|
298
|
+
}
|
|
299
|
+
/** Serialize a:objectDefaults. Returns an empty element when no defaults set. */
|
|
300
|
+
function stringifyObjectDefaults(opts, ctx) {
|
|
301
|
+
if (!opts) return "<a:objectDefaults/>";
|
|
302
|
+
const spDef = opts.shapeDefault ? stringifyDefaultShapeDefinition("a:spDef", opts.shapeDefault, ctx) : "";
|
|
303
|
+
const lnDef = opts.lineDefault ? stringifyDefaultShapeDefinition("a:lnDef", opts.lineDefault, ctx) : "";
|
|
304
|
+
const txDef = opts.textDefault ? stringifyDefaultShapeDefinition("a:txDef", opts.textDefault, ctx) : "";
|
|
305
|
+
if (!spDef && !lnDef && !txDef) return "<a:objectDefaults/>";
|
|
306
|
+
return `<a:objectDefaults>${spDef}${lnDef}${txDef}</a:objectDefaults>`;
|
|
307
|
+
}
|
|
308
|
+
/** Parse a:objectDefaults. */
|
|
309
|
+
function parseObjectDefaults(el, ctx) {
|
|
310
|
+
if (!el) return void 0;
|
|
311
|
+
const result = {};
|
|
312
|
+
const shapeDefault = parseDefaultShapeDefinition(findChild(el, "a:spDef"), ctx);
|
|
313
|
+
if (shapeDefault) result.shapeDefault = shapeDefault;
|
|
314
|
+
const lineDefault = parseDefaultShapeDefinition(findChild(el, "a:lnDef"), ctx);
|
|
315
|
+
if (lineDefault) result.lineDefault = lineDefault;
|
|
316
|
+
const textDefault = parseDefaultShapeDefinition(findChild(el, "a:txDef"), ctx);
|
|
317
|
+
if (textDefault) result.textDefault = textDefault;
|
|
318
|
+
return Object.keys(result).length > 0 ? result : void 0;
|
|
319
|
+
}
|
|
320
|
+
//#endregion
|
|
321
|
+
//#region src/theme/build-theme-xml.ts
|
|
322
|
+
const DEFAULT_FORMAT_SCHEME_XML = "<a:fmtScheme name=\"Office\"><a:fillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"110000\"/><a:satMod val=\"105000\"/><a:tint val=\"67000\"/></a:schemeClr></a:gs><a:gs pos=\"50000\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"105000\"/><a:satMod val=\"103000\"/><a:tint val=\"73000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"105000\"/><a:satMod val=\"109000\"/><a:tint val=\"81000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"5400000\" scaled=\"0\"/></a:gradFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"102000\"/><a:satMod val=\"103000\"/><a:tint val=\"94000\"/></a:schemeClr></a:gs><a:gs pos=\"50000\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"100000\"/><a:satMod val=\"110000\"/><a:shade val=\"100000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"99000\"/><a:satMod val=\"120000\"/><a:shade val=\"78000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"5400000\" scaled=\"0\"/></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w=\"6350\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/><a:miter lim=\"800000\"/></a:ln><a:ln w=\"12700\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/><a:miter lim=\"800000\"/></a:ln><a:ln w=\"19050\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/><a:miter lim=\"800000\"/></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad=\"57150\" dist=\"19050\" dir=\"5400000\" algn=\"ctr\" rotWithShape=\"0\"><a:srgbClr val=\"000000\"><a:alpha val=\"63000\"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:solidFill><a:schemeClr val=\"phClr\"><a:tint val=\"95000\"/><a:satMod val=\"170000\"/></a:schemeClr></a:solidFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"102000\"/><a:satMod val=\"150000\"/><a:tint val=\"93000\"/><a:shade val=\"98000\"/></a:schemeClr></a:gs><a:gs pos=\"50000\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"103000\"/><a:satMod val=\"130000\"/><a:tint val=\"98000\"/><a:shade val=\"90000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:satMod val=\"120000\"/><a:shade val=\"63000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"5400000\" scaled=\"0\"/></a:gradFill></a:bgFillStyleLst></a:fmtScheme>";
|
|
323
|
+
function requireCtx(ctx, field) {
|
|
324
|
+
if (!ctx) throw new Error(`buildThemeXml: ${field} requires a WriteContext`);
|
|
325
|
+
return ctx;
|
|
326
|
+
}
|
|
327
|
+
function buildThemeXml(options, ctx) {
|
|
328
|
+
const opts = options ?? {};
|
|
329
|
+
const name = opts.name ?? "Office Theme";
|
|
330
|
+
return `<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="${name}"><a:themeElements>${stringifyColorScheme(opts.colorScheme, name)}${stringifyFontScheme(opts.fontScheme, name)}${opts.formatScheme ? stringifyFormatScheme(opts.formatScheme, requireCtx(ctx, "formatScheme")) : DEFAULT_FORMAT_SCHEME_XML}</a:themeElements>${opts.objectDefaults ? stringifyObjectDefaults(opts.objectDefaults, requireCtx(ctx, "objectDefaults")) : "<a:objectDefaults/>"}${stringifyExtraColorSchemes(opts.extraColorSchemes, name)}${opts.customColors ? stringifyCustomColors(opts.customColors, requireCtx(ctx, "customColors")) : ""}</a:theme>`;
|
|
331
|
+
}
|
|
332
|
+
//#endregion
|
|
333
|
+
//#region src/theme/default-theme.ts
|
|
334
|
+
const DEFAULT_XML = buildThemeXml();
|
|
335
|
+
/**
|
|
336
|
+
* Generate theme XML string from options.
|
|
337
|
+
* Returns the pre-computed default when no options are provided.
|
|
338
|
+
*/
|
|
339
|
+
function createThemeXml(options, ctx) {
|
|
340
|
+
if (!options) return DEFAULT_XML;
|
|
341
|
+
return buildThemeXml(options, ctx);
|
|
342
|
+
}
|
|
343
|
+
//#endregion
|
|
344
|
+
//#region src/theme/theme-descriptors.ts
|
|
345
|
+
/**
|
|
346
|
+
* Theme descriptor — bidirectional mapping between ThemeOptions and theme XML.
|
|
347
|
+
*
|
|
348
|
+
* stringify delegates to buildThemeXml (structured driver). parse reads the full
|
|
349
|
+
* CT_BaseStyles surface: colorScheme, fontScheme, formatScheme, objectDefaults,
|
|
350
|
+
* and extraClrSchemeLst — so every part round-trips.
|
|
351
|
+
*
|
|
352
|
+
* @module
|
|
353
|
+
*/
|
|
354
|
+
const themeDesc = {
|
|
355
|
+
kind: "custom",
|
|
356
|
+
stringify(opts, ctx) {
|
|
357
|
+
return buildThemeXml(opts, ctx);
|
|
358
|
+
},
|
|
359
|
+
parse(el, ctx) {
|
|
360
|
+
const result = {};
|
|
361
|
+
const name = el.attributes?.["name"];
|
|
362
|
+
if (name) result.name = String(name);
|
|
363
|
+
const themeElements = findChild(el, "a:themeElements");
|
|
364
|
+
if (themeElements) {
|
|
365
|
+
const colorScheme = parseColorScheme(findChild(themeElements, "a:clrScheme"), ctx);
|
|
366
|
+
if (colorScheme) result.colorScheme = colorScheme;
|
|
367
|
+
const fontScheme = parseFontScheme(findChild(themeElements, "a:fontScheme"));
|
|
368
|
+
if (fontScheme) result.fontScheme = fontScheme;
|
|
369
|
+
const formatScheme = parseFormatScheme(findChild(themeElements, "a:fmtScheme"), ctx);
|
|
370
|
+
if (formatScheme) result.formatScheme = formatScheme;
|
|
371
|
+
}
|
|
372
|
+
const objectDefaults = parseObjectDefaults(findChild(el, "a:objectDefaults"), ctx);
|
|
373
|
+
if (objectDefaults) result.objectDefaults = objectDefaults;
|
|
374
|
+
const extraColorSchemes = parseExtraColorSchemes(findChild(el, "a:extraClrSchemeLst"), ctx);
|
|
375
|
+
if (extraColorSchemes) result.extraColorSchemes = extraColorSchemes;
|
|
376
|
+
const customColors = parseCustomColors(findChild(el, "a:custClrLst"), ctx);
|
|
377
|
+
if (customColors) result.customColors = customColors;
|
|
378
|
+
return result;
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
//#endregion
|
|
382
|
+
//#region src/theme/theme-override.ts
|
|
383
|
+
/**
|
|
384
|
+
* Theme override and theme manager descriptors.
|
|
385
|
+
*
|
|
386
|
+
* a:themeOverride (CT_BaseStylesOverride) is the root of a themeOverride{n}.xml
|
|
387
|
+
* part — an optional subset of the base styles that a slide/layout/master can
|
|
388
|
+
* reference to deviate from its owning theme. a:themeManager (CT_EmptyElement)
|
|
389
|
+
* is the root of the legacy themeManager part; it carries no content.
|
|
390
|
+
*
|
|
391
|
+
* @module
|
|
392
|
+
*/
|
|
393
|
+
const THEME_NS = "xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\"";
|
|
394
|
+
const themeOverrideDesc = {
|
|
395
|
+
kind: "custom",
|
|
396
|
+
stringify(opts, ctx) {
|
|
397
|
+
let content = "";
|
|
398
|
+
if (opts.colorScheme) content += stringifyColorScheme(opts.colorScheme, opts.colorScheme.name ?? "Override");
|
|
399
|
+
if (opts.fontScheme) content += stringifyFontScheme(opts.fontScheme, opts.fontScheme.name ?? "Override");
|
|
400
|
+
if (opts.formatScheme) content += stringifyFormatScheme(opts.formatScheme, ctx);
|
|
401
|
+
return `<a:themeOverride ${THEME_NS}>${content}</a:themeOverride>`;
|
|
402
|
+
},
|
|
403
|
+
parse(el, ctx) {
|
|
404
|
+
const result = {};
|
|
405
|
+
const colorScheme = parseColorScheme(findChild(el, "a:clrScheme"), ctx);
|
|
406
|
+
if (colorScheme) result.colorScheme = colorScheme;
|
|
407
|
+
const fontScheme = parseFontScheme(findChild(el, "a:fontScheme"));
|
|
408
|
+
if (fontScheme) result.fontScheme = fontScheme;
|
|
409
|
+
const formatScheme = parseFormatScheme(findChild(el, "a:fmtScheme"), ctx);
|
|
410
|
+
if (formatScheme) result.formatScheme = formatScheme;
|
|
411
|
+
return result;
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
const themeManagerDesc = {
|
|
415
|
+
kind: "custom",
|
|
416
|
+
stringify(_opts, _ctx) {
|
|
417
|
+
return `<a:themeManager ${THEME_NS}/>`;
|
|
418
|
+
},
|
|
419
|
+
parse(_el, _ctx) {
|
|
420
|
+
return {};
|
|
421
|
+
}
|
|
422
|
+
};
|
|
423
|
+
//#endregion
|
|
424
|
+
export { buildThemeXml as a, createThemeXml as i, themeOverrideDesc as n, DEFAULT_COLORS as o, themeDesc as r, themeManagerDesc as t };
|
|
425
|
+
|
|
426
|
+
//# sourceMappingURL=theme-BKnXRmvn.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-BKnXRmvn.mjs","names":[],"sources":["../src/theme/default-colors.ts","../src/theme/color-scheme.ts","../src/theme/custom-color.ts","../src/theme/extra-color-scheme.ts","../src/theme/font-scheme.ts","../src/theme/object-defaults.ts","../src/theme/build-theme-xml.ts","../src/theme/default-theme.ts","../src/theme/theme-descriptors.ts","../src/theme/theme-override.ts"],"sourcesContent":["/**\n * Default Office 2016+ theme colors.\n *\n * @module\n */\nimport type { ColorSchemeOptions } from \"./theme-options\";\n\n/** Office 2016+ default theme colors (hex without #). */\nexport const DEFAULT_COLORS: Record<Exclude<keyof ColorSchemeOptions, \"name\">, string> = {\n dark1: \"000000\",\n light1: \"FFFFFF\",\n dark2: \"44546A\",\n light2: \"E7E6E6\",\n accent1: \"4472C4\",\n accent2: \"ED7D31\",\n accent3: \"A5A5A5\",\n accent4: \"FFC000\",\n accent5: \"5B9BD5\",\n accent6: \"70AD47\",\n hyperlink: \"0563C1\",\n followedHyperlink: \"954F72\",\n};\n","/**\n * Color scheme (a:clrScheme / CT_ColorScheme) stringify + parse.\n *\n * Every slot accepts a hex string (emits a:srgbClr) or a structured\n * SystemColorOptions (emits a:sysClr verbatim). dk1/lt1 default to the\n * conventional windowText/window sysClr form; parse reads both forms back\n * losslessly, so a source's sysClr spelling survives round-trip.\n *\n * @module\n */\nimport { findChild } from \"@office-open/xml\";\nimport type { Element as XmlElement } from \"@office-open/xml\";\n\nimport type { ReadContext } from \"../descriptor\";\nimport { systemColorDesc } from \"../drawing\";\nimport type { SystemColorOptions } from \"../drawing\";\nimport { DEFAULT_COLORS } from \"./default-colors\";\nimport type { ColorSchemeOptions } from \"./theme-options\";\n\nexport type { SchemeColorValue } from \"./theme-options\";\n\n/** Color keys excluding the clrScheme/`@name` attribute. */\ntype ColorKey = Exclude<keyof ColorSchemeOptions, \"name\">;\n\n/** clrScheme child tag → ColorSchemeOptions key, in schema order. */\nconst COLOR_TAGS: ReadonlyArray<{ tag: string; key: ColorKey }> = [\n { tag: \"a:dk1\", key: \"dark1\" },\n { tag: \"a:lt1\", key: \"light1\" },\n { tag: \"a:dk2\", key: \"dark2\" },\n { tag: \"a:lt2\", key: \"light2\" },\n { tag: \"a:accent1\", key: \"accent1\" },\n { tag: \"a:accent2\", key: \"accent2\" },\n { tag: \"a:accent3\", key: \"accent3\" },\n { tag: \"a:accent4\", key: \"accent4\" },\n { tag: \"a:accent5\", key: \"accent5\" },\n { tag: \"a:accent6\", key: \"accent6\" },\n { tag: \"a:hlink\", key: \"hyperlink\" },\n { tag: \"a:folHlink\", key: \"followedHyperlink\" },\n];\n\n/** The conventional dk1/lt1 sysClr forms emitted when a slot is unset. */\nconst DEFAULT_SYS_CLR: Partial<Record<ColorKey, string>> = {\n dark1: \"windowText\",\n light1: \"window\",\n};\n\nfunction stringifyColorTag(\n tag: string,\n key: ColorKey,\n opts: ColorSchemeOptions | undefined,\n): string {\n const userValue = opts?.[key];\n if (userValue !== undefined) {\n const colorXml =\n typeof userValue === \"string\"\n ? `<a:srgbClr val=\"${userValue}\"/>`\n : (systemColorDesc.stringify(userValue, undefined as never) ?? \"\");\n return `<${tag}>${colorXml}</${tag}>`;\n }\n const defaultValue = DEFAULT_COLORS[key];\n const sysClr = DEFAULT_SYS_CLR[key];\n if (sysClr) {\n return `<${tag}><a:sysClr val=\"${sysClr}\" lastClr=\"${defaultValue}\"/></${tag}>`;\n }\n return `<${tag}><a:srgbClr val=\"${defaultValue}\"/></${tag}>`;\n}\n\n/** Serialize a:clrScheme. Undefined options emit the full default scheme. */\nexport function stringifyColorScheme(\n opts: ColorSchemeOptions | undefined,\n fallbackName: string,\n): string {\n const name = opts?.name ?? fallbackName;\n const tags = COLOR_TAGS.map(({ tag, key }) => stringifyColorTag(tag, key, opts)).join(\"\");\n return `<a:clrScheme name=\"${name}\">${tags}</a:clrScheme>`;\n}\n\n/** Parse a:clrScheme into the subset of colors explicitly present. */\nexport function parseColorScheme(\n el: XmlElement | undefined,\n ctx: ReadContext,\n): ColorSchemeOptions | undefined {\n if (!el) return undefined;\n const result: Partial<ColorSchemeOptions> = {};\n const name = el.attributes?.[\"name\"];\n if (name) result.name = String(name);\n for (const { tag, key } of COLOR_TAGS) {\n const colorEl = findChild(el, tag);\n if (!colorEl) continue;\n const sysClr = findChild(colorEl, \"a:sysClr\");\n if (sysClr) {\n result[key] = systemColorDesc.parse(sysClr, ctx) as SystemColorOptions;\n continue;\n }\n const srgb = findChild(colorEl, \"a:srgbClr\");\n const val = srgb?.attributes?.[\"val\"];\n if (val !== undefined) result[key] = String(val);\n }\n return result;\n}\n","/**\n * Custom colors (a:custClr / CT_CustomColor) stringify + parse.\n *\n * Each entry is a named color choice; the list wrapper (a:custClrLst /\n * CT_CustomColorList) sits after extraClrSchemeLst in a theme.\n *\n * @module\n */\nimport type { Element as XmlElement } from \"@office-open/xml\";\n\nimport type { ReadContext, WriteContext } from \"../descriptor\";\nimport { parseColorChoice, stringifyColorChoice } from \"../drawing\";\nimport type { SolidFillOptions } from \"../drawing\";\nimport type { CustomColorOptions } from \"./theme-options\";\n\n/** Serialize a:custClrLst. Returns \"\" when no custom colors set (optional element). */\nexport function stringifyCustomColors(\n opts: CustomColorOptions[] | undefined,\n ctx: WriteContext,\n): string {\n if (!opts || opts.length === 0) return \"\";\n const items = opts\n .map((c) => {\n const name = c.name ? ` name=\"${c.name}\"` : \"\";\n return `<a:custClr${name}>${stringifyColorChoice(c.color, ctx)}</a:custClr>`;\n })\n .join(\"\");\n return `<a:custClrLst>${items}</a:custClrLst>`;\n}\n\n/** Parse a:custClrLst. */\nexport function parseCustomColors(\n el: XmlElement | undefined,\n ctx: ReadContext,\n): CustomColorOptions[] | undefined {\n if (!el) return undefined;\n const result: CustomColorOptions[] = [];\n for (const child of el.elements ?? []) {\n if (child.name !== \"a:custClr\") continue;\n const color: SolidFillOptions | undefined = parseColorChoice(child, ctx);\n if (!color) continue;\n const name = child.attributes?.[\"name\"];\n result.push(name !== undefined ? { name: String(name), color } : { color });\n }\n return result.length > 0 ? result : undefined;\n}\n","/**\n * Extra color scheme (a:extraClrScheme / CT_ExtraColorScheme) stringify + parse.\n *\n * Each entry pairs a color scheme with an optional color mapping. The list\n * wrapper (a:extraClrSchemeLst / CT_ColorSchemeList) holds zero or more entries.\n *\n * @module\n */\nimport { findChild } from \"@office-open/xml\";\nimport type { Element as XmlElement } from \"@office-open/xml\";\n\nimport type { ReadContext } from \"../descriptor\";\nimport { parseColorMapping, stringifyColorMapping } from \"./color-mapping\";\nimport { parseColorScheme, stringifyColorScheme } from \"./color-scheme\";\nimport type { ExtraColorSchemeOptions } from \"./theme-options\";\n\n/** Serialize a:extraClrSchemeLst. Returns an empty element when no schemes set. */\nexport function stringifyExtraColorSchemes(\n opts: ExtraColorSchemeOptions[] | undefined,\n fallbackName: string,\n): string {\n if (!opts || opts.length === 0) return \"<a:extraClrSchemeLst/>\";\n const items = opts\n .map((scheme) => {\n const clrScheme = stringifyColorScheme(\n scheme.colorScheme,\n scheme.colorScheme.name ?? fallbackName,\n );\n const clrMap = scheme.colorMapping ? stringifyColorMapping(scheme.colorMapping) : \"\";\n return `<a:extraClrScheme>${clrScheme}${clrMap}</a:extraClrScheme>`;\n })\n .join(\"\");\n return `<a:extraClrSchemeLst>${items}</a:extraClrSchemeLst>`;\n}\n\n/** Parse a:extraClrSchemeLst. */\nexport function parseExtraColorSchemes(\n el: XmlElement | undefined,\n ctx: ReadContext,\n): ExtraColorSchemeOptions[] | undefined {\n if (!el) return undefined;\n const result: ExtraColorSchemeOptions[] = [];\n for (const child of el.elements ?? []) {\n if (child.name !== \"a:extraClrScheme\") continue;\n const colorScheme = parseColorScheme(findChild(child, \"a:clrScheme\"), ctx);\n if (!colorScheme) continue;\n const colorMapping = parseColorMapping(findChild(child, \"a:clrMap\"));\n result.push(colorMapping ? { colorScheme, colorMapping } : { colorScheme });\n }\n return result.length > 0 ? result : undefined;\n}\n","/**\n * Font scheme (a:fontScheme / CT_FontScheme) stringify + parse.\n *\n * CT_FontCollection order: latin → ea → cs → font[] (supplemental).\n *\n * @module\n */\nimport { escapeXml } from \"@office-open/xml\";\nimport { findChild } from \"@office-open/xml\";\nimport type { Element as XmlElement } from \"@office-open/xml\";\n\nimport type {\n FontCollectionOptions,\n FontSchemeOptions,\n SupplementalFontOptions,\n TextFontOptions,\n} from \"./theme-options\";\n\n// ── TextFont (a:latin / a:ea / a:cs) ──\n\nfunction stringifyTextFont(tag: string, opts: TextFontOptions | undefined): string {\n if (!opts) return \"\";\n const attrs = [`typeface=\"${escapeXml(opts.typeface)}\"`];\n if (opts.panose !== undefined) attrs.push(`panose=\"${escapeXml(opts.panose)}\"`);\n if (opts.pitchFamily !== undefined) attrs.push(`pitchFamily=\"${opts.pitchFamily}\"`);\n if (opts.charset !== undefined) attrs.push(`charset=\"${opts.charset}\"`);\n return `<${tag} ${attrs.join(\" \")}/>`;\n}\n\nfunction parseTextFont(el: XmlElement | undefined): TextFontOptions | undefined {\n if (!el?.attributes) return undefined;\n const typeface = el.attributes[\"typeface\"];\n if (typeface === undefined) return undefined;\n const result: TextFontOptions = { typeface: String(typeface) };\n if (el.attributes[\"panose\"] !== undefined) result.panose = String(el.attributes[\"panose\"]);\n if (el.attributes[\"pitchFamily\"] !== undefined)\n result.pitchFamily = Number(el.attributes[\"pitchFamily\"]);\n if (el.attributes[\"charset\"] !== undefined) result.charset = Number(el.attributes[\"charset\"]);\n return result;\n}\n\n// ── Font collection (a:majorFont / a:minorFont) ──\n\nfunction stringifyFontCollection(tag: string, opts: FontCollectionOptions | undefined): string {\n const latin = stringifyTextFont(\"a:latin\", opts?.latin);\n const eastAsian = stringifyTextFont(\"a:ea\", opts?.eastAsian);\n const complexScript = stringifyTextFont(\"a:cs\", opts?.complexScript);\n const supplemental = (opts?.supplementalFonts ?? [])\n .map((f) => `<a:font script=\"${escapeXml(f.script)}\" typeface=\"${escapeXml(f.typeface)}\"/>`)\n .join(\"\");\n return `<${tag}>${latin}${eastAsian}${complexScript}${supplemental}</${tag}>`;\n}\n\nfunction parseFontCollection(el: XmlElement | undefined): FontCollectionOptions | undefined {\n if (!el) return undefined;\n const result: FontCollectionOptions = {};\n const latin = parseTextFont(findChild(el, \"a:latin\"));\n if (latin) result.latin = latin;\n const eastAsian = parseTextFont(findChild(el, \"a:ea\"));\n if (eastAsian) result.eastAsian = eastAsian;\n const complexScript = parseTextFont(findChild(el, \"a:cs\"));\n if (complexScript) result.complexScript = complexScript;\n const supplementalFonts = (el.elements ?? [])\n .filter((c) => c.name === \"a:font\")\n .map((c): SupplementalFontOptions | undefined => {\n const script = c.attributes?.[\"script\"];\n const typeface = c.attributes?.[\"typeface\"];\n if (script === undefined || typeface === undefined) return undefined;\n return { script: String(script), typeface: String(typeface) };\n })\n .filter((v): v is SupplementalFontOptions => v !== undefined);\n if (supplementalFonts.length > 0) result.supplementalFonts = supplementalFonts;\n return Object.keys(result).length > 0 ? result : undefined;\n}\n\n// ── Fresh defaults (Office theme major/minor fonts) ──\n\nexport const DEFAULT_MAJOR_FONT: FontCollectionOptions = {\n latin: { typeface: \"Calibri Light\", panose: \"020F0302020204030204\" },\n eastAsian: { typeface: \"\" },\n complexScript: { typeface: \"\" },\n};\n\nexport const DEFAULT_MINOR_FONT: FontCollectionOptions = {\n latin: { typeface: \"Calibri\", panose: \"020F0502020204030204\" },\n eastAsian: { typeface: \"\" },\n complexScript: { typeface: \"\" },\n};\n\n// ── Font scheme (a:fontScheme) ──\n\n/** Serialize a:fontScheme. Undefined options emit the Office default scheme. */\nexport function stringifyFontScheme(\n opts: FontSchemeOptions | undefined,\n fallbackName: string,\n): string {\n // Merge defaults so the XSD-required latin/ea/cs slots are always present,\n // even when the caller only customizes one font (e.g. latin typeface).\n const majorFont = stringifyFontCollection(\n \"a:majorFont\",\n opts?.majorFont ? { ...DEFAULT_MAJOR_FONT, ...opts.majorFont } : DEFAULT_MAJOR_FONT,\n );\n const minorFont = stringifyFontCollection(\n \"a:minorFont\",\n opts?.minorFont ? { ...DEFAULT_MINOR_FONT, ...opts.minorFont } : DEFAULT_MINOR_FONT,\n );\n const name = opts?.name ?? fallbackName;\n return `<a:fontScheme name=\"${name}\">${majorFont}${minorFont}</a:fontScheme>`;\n}\n\n/** Parse a:fontScheme. Returns undefined only when neither major nor minor font is present. */\nexport function parseFontScheme(el: XmlElement | undefined): FontSchemeOptions | undefined {\n if (!el) return undefined;\n const result: FontSchemeOptions = {};\n const name = el.attributes?.[\"name\"];\n if (name) result.name = String(name);\n const majorFont = parseFontCollection(findChild(el, \"a:majorFont\"));\n if (majorFont) result.majorFont = majorFont;\n const minorFont = parseFontCollection(findChild(el, \"a:minorFont\"));\n if (minorFont) result.minorFont = minorFont;\n return Object.keys(result).length > 0 ? result : undefined;\n}\n","/**\n * Object defaults (a:objectDefaults / CT_ObjectStyleDefaults) stringify + parse.\n *\n * Each default definition (spDef/lnDef/txDef) holds shape properties, body\n * properties, list style, and an optional shape style. Reuses core descriptors\n * so defaults round-trip through the same machinery as shapes.\n *\n * @module\n */\nimport { findChild } from \"@office-open/xml\";\nimport type { Element as XmlElement } from \"@office-open/xml\";\n\nimport type { ReadContext, WriteContext } from \"../descriptor\";\nimport { bodyPropertiesDesc, shapePropertiesDesc, textListStyleDesc } from \"../drawing\";\nimport { parseShapeStyle, stringifyShapeStyle } from \"./style-matrix\";\nimport type { DefaultShapeDefinitionOptions, ObjectDefaultsOptions } from \"./theme-options\";\n\nfunction stringifyDefaultShapeDefinition(\n tag: string,\n opts: DefaultShapeDefinitionOptions,\n ctx: WriteContext,\n): string {\n // spPr/bodyPr/lstStyle are minOccurs=1 in CT_DefaultShapeDefinition — a\n // present-but-empty section must still emit its (empty) element. The spPr\n // and lstStyle descriptors return inner content only, so the wrapper tags\n // are added here.\n const spPr =\n opts.shapeProperties !== undefined\n ? `<a:spPr>${shapePropertiesDesc.stringify(opts.shapeProperties, ctx) ?? \"\"}</a:spPr>`\n : \"\";\n const bodyPr =\n opts.bodyProperties !== undefined\n ? bodyPropertiesDesc.stringify(opts.bodyProperties, ctx) || \"<a:bodyPr/>\"\n : \"\";\n const lstStyle =\n opts.listStyle !== undefined\n ? `<a:lstStyle>${textListStyleDesc.stringify(opts.listStyle, ctx) ?? \"\"}</a:lstStyle>`\n : \"\";\n const style = opts.shapeStyle ? stringifyShapeStyle(opts.shapeStyle, ctx) : \"\";\n return `<${tag}>${spPr}${bodyPr}${lstStyle}${style}</${tag}>`;\n}\n\nfunction parseDefaultShapeDefinition(\n el: XmlElement | undefined,\n ctx: ReadContext,\n): DefaultShapeDefinitionOptions | undefined {\n if (!el) return undefined;\n const result: Partial<DefaultShapeDefinitionOptions> = {};\n // An empty element still marks the section present (the stringify leg\n // re-emits the empty marker), so `?? {}` — never drop on empty.\n const spPr = findChild(el, \"a:spPr\");\n if (spPr) result.shapeProperties = shapePropertiesDesc.parse(spPr, ctx) ?? {};\n const bodyPr = findChild(el, \"a:bodyPr\");\n if (bodyPr) result.bodyProperties = bodyPropertiesDesc.parse(bodyPr, ctx) ?? {};\n const lstStyle = findChild(el, \"a:lstStyle\");\n if (lstStyle) result.listStyle = textListStyleDesc.parse(lstStyle, ctx) ?? {};\n const style = findChild(el, \"a:style\");\n if (style) {\n const shapeStyle = parseShapeStyle(style, ctx);\n if (shapeStyle) result.shapeStyle = shapeStyle;\n }\n return Object.keys(result).length > 0 ? (result as DefaultShapeDefinitionOptions) : undefined;\n}\n\n/** Serialize a:objectDefaults. Returns an empty element when no defaults set. */\nexport function stringifyObjectDefaults(\n opts: ObjectDefaultsOptions | undefined,\n ctx: WriteContext,\n): string {\n if (!opts) return \"<a:objectDefaults/>\";\n const spDef = opts.shapeDefault\n ? stringifyDefaultShapeDefinition(\"a:spDef\", opts.shapeDefault, ctx)\n : \"\";\n const lnDef = opts.lineDefault\n ? stringifyDefaultShapeDefinition(\"a:lnDef\", opts.lineDefault, ctx)\n : \"\";\n const txDef = opts.textDefault\n ? stringifyDefaultShapeDefinition(\"a:txDef\", opts.textDefault, ctx)\n : \"\";\n if (!spDef && !lnDef && !txDef) return \"<a:objectDefaults/>\";\n return `<a:objectDefaults>${spDef}${lnDef}${txDef}</a:objectDefaults>`;\n}\n\n/** Parse a:objectDefaults. */\nexport function parseObjectDefaults(\n el: XmlElement | undefined,\n ctx: ReadContext,\n): ObjectDefaultsOptions | undefined {\n if (!el) return undefined;\n const result: Partial<ObjectDefaultsOptions> = {};\n const shapeDefault = parseDefaultShapeDefinition(findChild(el, \"a:spDef\"), ctx);\n if (shapeDefault) result.shapeDefault = shapeDefault;\n const lineDefault = parseDefaultShapeDefinition(findChild(el, \"a:lnDef\"), ctx);\n if (lineDefault) result.lineDefault = lineDefault;\n const textDefault = parseDefaultShapeDefinition(findChild(el, \"a:txDef\"), ctx);\n if (textDefault) result.textDefault = textDefault;\n return Object.keys(result).length > 0 ? (result as ObjectDefaultsOptions) : undefined;\n}\n","/**\n * Build theme XML string — structured driver over the CT_BaseStyles parts.\n *\n * Fresh output stays byte-identical to Office by reusing a pre-extracted\n * default fmtScheme fragment (O(1) fast path) unless the caller supplies a\n * structured formatScheme / objectDefaults / extraColorSchemes, in which case\n * the relevant descriptor serializes them.\n *\n * @module\n */\nimport type { WriteContext } from \"../descriptor\";\nimport { stringifyColorScheme } from \"./color-scheme\";\nimport { stringifyCustomColors } from \"./custom-color\";\nimport { stringifyExtraColorSchemes } from \"./extra-color-scheme\";\nimport { stringifyFontScheme } from \"./font-scheme\";\nimport { stringifyObjectDefaults } from \"./object-defaults\";\nimport { stringifyFormatScheme } from \"./style-matrix\";\nimport type { ThemeOptions } from \"./theme-options\";\n\n// Default Office fmtScheme — byte-identical to fresh output, keeps the common\n// path O(1) without running fill/line/effect descriptors.\nconst DEFAULT_FORMAT_SCHEME_XML =\n '<a:fmtScheme name=\"Office\"><a:fillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill>' +\n '<a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"110000\"/>' +\n '<a:satMod val=\"105000\"/><a:tint val=\"67000\"/></a:schemeClr></a:gs><a:gs pos=\"50000\"><a:schemeClr val=\"phClr\">' +\n '<a:lumMod val=\"105000\"/><a:satMod val=\"103000\"/><a:tint val=\"73000\"/></a:schemeClr></a:gs>' +\n '<a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"105000\"/><a:satMod val=\"109000\"/><a:tint val=\"81000\"/>' +\n '</a:schemeClr></a:gs></a:gsLst><a:lin ang=\"5400000\" scaled=\"0\"/></a:gradFill><a:gradFill rotWithShape=\"1\">' +\n '<a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"102000\"/><a:satMod val=\"103000\"/><a:tint val=\"94000\"/>' +\n '</a:schemeClr></a:gs><a:gs pos=\"50000\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"100000\"/><a:satMod val=\"110000\"/>' +\n '<a:shade val=\"100000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"99000\"/>' +\n '<a:satMod val=\"120000\"/><a:shade val=\"78000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"5400000\" scaled=\"0\"/>' +\n '</a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w=\"6350\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill>' +\n '<a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/><a:miter lim=\"800000\"/></a:ln>' +\n '<a:ln w=\"12700\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill>' +\n '<a:prstDash val=\"solid\"/><a:miter lim=\"800000\"/></a:ln><a:ln w=\"19050\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\">' +\n '<a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/><a:miter lim=\"800000\"/></a:ln>' +\n \"</a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst/>\" +\n '</a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad=\"57150\" dist=\"19050\" dir=\"5400000\" algn=\"ctr\" ' +\n 'rotWithShape=\"0\"><a:srgbClr val=\"000000\"><a:alpha val=\"63000\"/></a:srgbClr></a:outerShdw></a:effectLst>' +\n '</a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill>' +\n '<a:solidFill><a:schemeClr val=\"phClr\"><a:tint val=\"95000\"/><a:satMod val=\"170000\"/></a:schemeClr></a:solidFill>' +\n '<a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:lumMod val=\"102000\"/>' +\n '<a:satMod val=\"150000\"/><a:tint val=\"93000\"/><a:shade val=\"98000\"/></a:schemeClr></a:gs><a:gs pos=\"50000\">' +\n '<a:schemeClr val=\"phClr\"><a:lumMod val=\"103000\"/><a:satMod val=\"130000\"/><a:tint val=\"98000\"/><a:shade val=\"90000\"/>' +\n '</a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:satMod val=\"120000\"/><a:shade val=\"63000\"/>' +\n '</a:schemeClr></a:gs></a:gsLst><a:lin ang=\"5400000\" scaled=\"0\"/></a:gradFill></a:bgFillStyleLst></a:fmtScheme>';\n\nfunction requireCtx(ctx: WriteContext | undefined, field: string): WriteContext {\n if (!ctx) throw new Error(`buildThemeXml: ${field} requires a WriteContext`);\n return ctx;\n}\n\nexport function buildThemeXml(options?: ThemeOptions, ctx?: WriteContext): string {\n const opts = options ?? {};\n const name = opts.name ?? \"Office Theme\";\n\n const clrScheme = stringifyColorScheme(opts.colorScheme, name);\n const fontScheme = stringifyFontScheme(opts.fontScheme, name);\n const fmtScheme = opts.formatScheme\n ? stringifyFormatScheme(opts.formatScheme, requireCtx(ctx, \"formatScheme\"))\n : DEFAULT_FORMAT_SCHEME_XML;\n const objectDefaults = opts.objectDefaults\n ? stringifyObjectDefaults(opts.objectDefaults, requireCtx(ctx, \"objectDefaults\"))\n : \"<a:objectDefaults/>\";\n const extraClrSchemeLst = stringifyExtraColorSchemes(opts.extraColorSchemes, name);\n const custClrLst = opts.customColors\n ? stringifyCustomColors(opts.customColors, requireCtx(ctx, \"customColors\"))\n : \"\";\n\n return (\n `<a:theme xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" name=\"${name}\">` +\n `<a:themeElements>${clrScheme}${fontScheme}${fmtScheme}</a:themeElements>` +\n `${objectDefaults}${extraClrSchemeLst}${custClrLst}</a:theme>`\n );\n}\n","/**\n * Theme XML generation — pure function.\n *\n * Fresh output (no options) returns a pre-computed default; anything else\n * rebuilds via buildThemeXml (simple customizations don't need a WriteContext).\n *\n * @module\n */\nimport type { WriteContext } from \"../descriptor\";\nimport { buildThemeXml } from \"./build-theme-xml\";\nimport type { ThemeOptions } from \"./theme-options\";\n\n// Pre-computed default theme XML — zero allocation for the common case.\nconst DEFAULT_XML = buildThemeXml();\n\n/**\n * Generate theme XML string from options.\n * Returns the pre-computed default when no options are provided.\n */\nexport function createThemeXml(options?: ThemeOptions, ctx?: WriteContext): string {\n if (!options) return DEFAULT_XML;\n return buildThemeXml(options, ctx);\n}\n","/**\n * Theme descriptor — bidirectional mapping between ThemeOptions and theme XML.\n *\n * stringify delegates to buildThemeXml (structured driver). parse reads the full\n * CT_BaseStyles surface: colorScheme, fontScheme, formatScheme, objectDefaults,\n * and extraClrSchemeLst — so every part round-trips.\n *\n * @module\n */\n\nimport { findChild } from \"@office-open/xml\";\nimport type { Element as XmlElement } from \"@office-open/xml\";\n\nimport type { CustomDescriptor, ReadContext, WriteContext } from \"../descriptor\";\nimport { buildThemeXml } from \"./build-theme-xml\";\nimport { parseColorScheme } from \"./color-scheme\";\nimport { parseCustomColors } from \"./custom-color\";\nimport { parseExtraColorSchemes } from \"./extra-color-scheme\";\nimport { parseFontScheme } from \"./font-scheme\";\nimport { parseObjectDefaults } from \"./object-defaults\";\nimport { parseFormatScheme } from \"./style-matrix\";\nimport type { ThemeOptions } from \"./theme-options\";\n\nexport const themeDesc: CustomDescriptor<ThemeOptions, WriteContext, ThemeOptions> = {\n kind: \"custom\",\n\n stringify(opts: ThemeOptions, ctx: WriteContext): string | undefined {\n return buildThemeXml(opts, ctx);\n },\n\n parse(el: XmlElement, ctx: ReadContext): ThemeOptions {\n const result: Partial<ThemeOptions> = {};\n\n const name = el.attributes?.[\"name\"];\n if (name) result.name = String(name);\n\n const themeElements = findChild(el, \"a:themeElements\");\n if (themeElements) {\n const colorScheme = parseColorScheme(findChild(themeElements, \"a:clrScheme\"), ctx);\n if (colorScheme) result.colorScheme = colorScheme;\n const fontScheme = parseFontScheme(findChild(themeElements, \"a:fontScheme\"));\n if (fontScheme) result.fontScheme = fontScheme;\n const formatScheme = parseFormatScheme(findChild(themeElements, \"a:fmtScheme\"), ctx);\n if (formatScheme) result.formatScheme = formatScheme;\n }\n\n const objectDefaults = parseObjectDefaults(findChild(el, \"a:objectDefaults\"), ctx);\n if (objectDefaults) result.objectDefaults = objectDefaults;\n\n const extraColorSchemes = parseExtraColorSchemes(findChild(el, \"a:extraClrSchemeLst\"), ctx);\n if (extraColorSchemes) result.extraColorSchemes = extraColorSchemes;\n\n const customColors = parseCustomColors(findChild(el, \"a:custClrLst\"), ctx);\n if (customColors) result.customColors = customColors;\n\n return result as ThemeOptions;\n },\n};\n","/**\n * Theme override and theme manager descriptors.\n *\n * a:themeOverride (CT_BaseStylesOverride) is the root of a themeOverride{n}.xml\n * part — an optional subset of the base styles that a slide/layout/master can\n * reference to deviate from its owning theme. a:themeManager (CT_EmptyElement)\n * is the root of the legacy themeManager part; it carries no content.\n *\n * @module\n */\n\nimport { findChild } from \"@office-open/xml\";\n\nimport type { CustomDescriptor, WriteContext } from \"../descriptor\";\nimport { parseColorScheme, stringifyColorScheme } from \"./color-scheme\";\nimport { parseFontScheme, stringifyFontScheme } from \"./font-scheme\";\nimport { parseFormatScheme, stringifyFormatScheme } from \"./style-matrix\";\nimport type { ThemeOverrideOptions } from \"./theme-options\";\n\nconst THEME_NS = 'xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\"';\n\nexport const themeOverrideDesc: CustomDescriptor<\n ThemeOverrideOptions,\n WriteContext,\n ThemeOverrideOptions\n> = {\n kind: \"custom\",\n\n stringify(opts, ctx) {\n let content = \"\";\n if (opts.colorScheme) {\n content += stringifyColorScheme(opts.colorScheme, opts.colorScheme.name ?? \"Override\");\n }\n if (opts.fontScheme) {\n content += stringifyFontScheme(opts.fontScheme, opts.fontScheme.name ?? \"Override\");\n }\n if (opts.formatScheme) content += stringifyFormatScheme(opts.formatScheme, ctx);\n return `<a:themeOverride ${THEME_NS}>${content}</a:themeOverride>`;\n },\n\n parse(el, ctx) {\n const result: Partial<ThemeOverrideOptions> = {};\n const colorScheme = parseColorScheme(findChild(el, \"a:clrScheme\"), ctx);\n if (colorScheme) result.colorScheme = colorScheme;\n const fontScheme = parseFontScheme(findChild(el, \"a:fontScheme\"));\n if (fontScheme) result.fontScheme = fontScheme;\n const formatScheme = parseFormatScheme(findChild(el, \"a:fmtScheme\"), ctx);\n if (formatScheme) result.formatScheme = formatScheme;\n return result as ThemeOverrideOptions;\n },\n};\n\n/** Options for a themeManager part — CT_EmptyElement has no content or attributes. */\nexport type ThemeManagerOptions = Record<never, never>;\n\nexport const themeManagerDesc: CustomDescriptor<\n ThemeManagerOptions,\n WriteContext,\n ThemeManagerOptions\n> = {\n kind: \"custom\",\n\n stringify(_opts, _ctx) {\n return `<a:themeManager ${THEME_NS}/>`;\n },\n\n parse(_el, _ctx) {\n return {};\n },\n};\n"],"mappings":";;;;;;AAQA,MAAa,iBAA4E;CACvF,OAAO;CACP,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,SAAS;CACT,SAAS;CACT,SAAS;CACT,SAAS;CACT,SAAS;CACT,SAAS;CACT,WAAW;CACX,mBAAmB;AACrB;;;;;;;;;;;;;;ACIA,MAAM,aAA4D;CAChE;EAAE,KAAK;EAAS,KAAK;CAAQ;CAC7B;EAAE,KAAK;EAAS,KAAK;CAAS;CAC9B;EAAE,KAAK;EAAS,KAAK;CAAQ;CAC7B;EAAE,KAAK;EAAS,KAAK;CAAS;CAC9B;EAAE,KAAK;EAAa,KAAK;CAAU;CACnC;EAAE,KAAK;EAAa,KAAK;CAAU;CACnC;EAAE,KAAK;EAAa,KAAK;CAAU;CACnC;EAAE,KAAK;EAAa,KAAK;CAAU;CACnC;EAAE,KAAK;EAAa,KAAK;CAAU;CACnC;EAAE,KAAK;EAAa,KAAK;CAAU;CACnC;EAAE,KAAK;EAAW,KAAK;CAAY;CACnC;EAAE,KAAK;EAAc,KAAK;CAAoB;AAChD;;AAGA,MAAM,kBAAqD;CACzD,OAAO;CACP,QAAQ;AACV;AAEA,SAAS,kBACP,KACA,KACA,MACQ;CACR,MAAM,YAAY,OAAO;CACzB,IAAI,cAAc,KAAA,GAKhB,OAAO,IAAI,IAAI,GAHb,OAAO,cAAc,WACjB,mBAAmB,UAAU,OAC5B,gBAAgB,UAAU,WAAW,KAAA,CAAkB,KAAK,GACxC,IAAI,IAAI;CAErC,MAAM,eAAe,eAAe;CACpC,MAAM,SAAS,gBAAgB;CAC/B,IAAI,QACF,OAAO,IAAI,IAAI,kBAAkB,OAAO,aAAa,aAAa,OAAO,IAAI;CAE/E,OAAO,IAAI,IAAI,mBAAm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,UAAU;EACd,IAAI,KAAK,aACP,WAAW,qBAAqB,KAAK,aAAa,KAAK,YAAY,QAAQ,UAAU;EAEvF,IAAI,KAAK,YACP,WAAW,oBAAoB,KAAK,YAAY,KAAK,WAAW,QAAQ,UAAU;EAEpF,IAAI,KAAK,cAAc,WAAW,sBAAsB,KAAK,cAAc,GAAG;EAC9E,OAAO,oBAAoB,SAAS,GAAG,QAAQ;CACjD;CAEA,MAAM,IAAI,KAAK;EACb,MAAM,SAAwC,CAAC;EAC/C,MAAM,cAAc,iBAAiB,UAAU,IAAI,aAAa,GAAG,GAAG;EACtE,IAAI,aAAa,OAAO,cAAc;EACtC,MAAM,aAAa,gBAAgB,UAAU,IAAI,cAAc,CAAC;EAChE,IAAI,YAAY,OAAO,aAAa;EACpC,MAAM,eAAe,kBAAkB,UAAU,IAAI,aAAa,GAAG,GAAG;EACxE,IAAI,cAAc,OAAO,eAAe;EACxC,OAAO;CACT;AACF;AAKA,MAAa,mBAIT;CACF,MAAM;CAEN,UAAU,OAAO,MAAM;EACrB,OAAO,mBAAmB,SAAS;CACrC;CAEA,MAAM,KAAK,MAAM;EACf,OAAO,CAAC;CACV;AACF"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { c as Panose } from "./values-BECDm4zr.mjs";
|
|
2
|
+
import { $i as FillOptions, Ka as SolidFillOptions, Ln as StyleMatrixReferenceOptions, Oi as OutlineOptions, Xa as SystemColorOptions, bi as Scene3DOptions, fa as EffectListOptions, mr as TextListStyleOptions, qr as BodyPropertiesOptions, si as ShapePropertiesOptions, ui as Shape3DOptions } from "./index-DPkf_CtG.mjs";
|
|
3
|
+
//#region src/theme/theme-options.d.ts
|
|
4
|
+
interface TextFontOptions {
|
|
5
|
+
typeface: string;
|
|
6
|
+
panose?: Panose;
|
|
7
|
+
pitchFamily?: number;
|
|
8
|
+
charset?: number;
|
|
9
|
+
}
|
|
10
|
+
interface SupplementalFontOptions {
|
|
11
|
+
script: string;
|
|
12
|
+
typeface: string;
|
|
13
|
+
}
|
|
14
|
+
interface FontCollectionOptions {
|
|
15
|
+
latin?: TextFontOptions;
|
|
16
|
+
eastAsian?: TextFontOptions;
|
|
17
|
+
complexScript?: TextFontOptions;
|
|
18
|
+
supplementalFonts?: SupplementalFontOptions[];
|
|
19
|
+
}
|
|
20
|
+
interface FontSchemeOptions {
|
|
21
|
+
majorFont?: FontCollectionOptions;
|
|
22
|
+
minorFont?: FontCollectionOptions;
|
|
23
|
+
name?: string;
|
|
24
|
+
}
|
|
25
|
+
type SchemeColorValue = string | SystemColorOptions;
|
|
26
|
+
interface ColorSchemeOptions {
|
|
27
|
+
dark1?: SchemeColorValue;
|
|
28
|
+
light1?: SchemeColorValue;
|
|
29
|
+
dark2?: SchemeColorValue;
|
|
30
|
+
light2?: SchemeColorValue;
|
|
31
|
+
accent1?: SchemeColorValue;
|
|
32
|
+
accent2?: SchemeColorValue;
|
|
33
|
+
accent3?: SchemeColorValue;
|
|
34
|
+
accent4?: SchemeColorValue;
|
|
35
|
+
accent5?: SchemeColorValue;
|
|
36
|
+
accent6?: SchemeColorValue;
|
|
37
|
+
hyperlink?: SchemeColorValue;
|
|
38
|
+
followedHyperlink?: SchemeColorValue;
|
|
39
|
+
name?: string;
|
|
40
|
+
}
|
|
41
|
+
interface FontReferenceOptions {
|
|
42
|
+
collection: "major" | "minor" | "none";
|
|
43
|
+
color?: SolidFillOptions;
|
|
44
|
+
}
|
|
45
|
+
interface DefaultShapeStyleOptions {
|
|
46
|
+
lineReference: StyleMatrixReferenceOptions;
|
|
47
|
+
fillReference: StyleMatrixReferenceOptions;
|
|
48
|
+
effectReference: StyleMatrixReferenceOptions;
|
|
49
|
+
fontReference: FontReferenceOptions;
|
|
50
|
+
}
|
|
51
|
+
interface EffectStyleOptions {
|
|
52
|
+
effects?: EffectListOptions;
|
|
53
|
+
scene3d?: Scene3DOptions;
|
|
54
|
+
shape3d?: Shape3DOptions;
|
|
55
|
+
}
|
|
56
|
+
interface FormatSchemeOptions {
|
|
57
|
+
fillStyles: FillOptions[];
|
|
58
|
+
lineStyles: OutlineOptions[];
|
|
59
|
+
effectStyles: EffectStyleOptions[];
|
|
60
|
+
backgroundFillStyles: FillOptions[];
|
|
61
|
+
name?: string;
|
|
62
|
+
}
|
|
63
|
+
interface DefaultShapeDefinitionOptions {
|
|
64
|
+
shapeProperties?: ShapePropertiesOptions;
|
|
65
|
+
bodyProperties?: BodyPropertiesOptions;
|
|
66
|
+
listStyle?: TextListStyleOptions;
|
|
67
|
+
shapeStyle?: DefaultShapeStyleOptions;
|
|
68
|
+
}
|
|
69
|
+
interface ObjectDefaultsOptions {
|
|
70
|
+
shapeDefault?: DefaultShapeDefinitionOptions;
|
|
71
|
+
lineDefault?: DefaultShapeDefinitionOptions;
|
|
72
|
+
textDefault?: DefaultShapeDefinitionOptions;
|
|
73
|
+
}
|
|
74
|
+
type ColorSchemeIndex = "dark1" | "light1" | "dark2" | "light2" | "accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6" | "hyperlink" | "followedHyperlink";
|
|
75
|
+
interface ColorMappingOptions {
|
|
76
|
+
background1: ColorSchemeIndex;
|
|
77
|
+
text1: ColorSchemeIndex;
|
|
78
|
+
background2: ColorSchemeIndex;
|
|
79
|
+
text2: ColorSchemeIndex;
|
|
80
|
+
accent1: ColorSchemeIndex;
|
|
81
|
+
accent2: ColorSchemeIndex;
|
|
82
|
+
accent3: ColorSchemeIndex;
|
|
83
|
+
accent4: ColorSchemeIndex;
|
|
84
|
+
accent5: ColorSchemeIndex;
|
|
85
|
+
accent6: ColorSchemeIndex;
|
|
86
|
+
hyperlink: ColorSchemeIndex;
|
|
87
|
+
followedHyperlink: ColorSchemeIndex;
|
|
88
|
+
}
|
|
89
|
+
interface ExtraColorSchemeOptions {
|
|
90
|
+
colorScheme: ColorSchemeOptions;
|
|
91
|
+
colorMapping?: Partial<ColorMappingOptions>;
|
|
92
|
+
}
|
|
93
|
+
interface CustomColorOptions {
|
|
94
|
+
name?: string;
|
|
95
|
+
color: SolidFillOptions;
|
|
96
|
+
}
|
|
97
|
+
interface ThemeOptions {
|
|
98
|
+
name?: string;
|
|
99
|
+
colorScheme?: ColorSchemeOptions;
|
|
100
|
+
fontScheme?: FontSchemeOptions;
|
|
101
|
+
formatScheme?: FormatSchemeOptions;
|
|
102
|
+
objectDefaults?: ObjectDefaultsOptions;
|
|
103
|
+
extraColorSchemes?: ExtraColorSchemeOptions[];
|
|
104
|
+
customColors?: CustomColorOptions[];
|
|
105
|
+
}
|
|
106
|
+
type ThemeOverrideOptions = Pick<ThemeOptions, "colorScheme" | "fontScheme" | "formatScheme">;
|
|
107
|
+
//#endregion
|
|
108
|
+
export { ThemeOverrideOptions as _, DefaultShapeDefinitionOptions as a, ExtraColorSchemeOptions as c, FontSchemeOptions as d, FormatSchemeOptions as f, ThemeOptions as g, TextFontOptions as h, CustomColorOptions as i, FontCollectionOptions as l, SupplementalFontOptions as m, ColorSchemeIndex as n, DefaultShapeStyleOptions as o, ObjectDefaultsOptions as p, ColorSchemeOptions as r, EffectStyleOptions as s, ColorMappingOptions as t, FontReferenceOptions as u };
|
|
109
|
+
//# sourceMappingURL=theme-options-kO89NUEX.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-options-kO89NUEX.d.mts","names":[],"sources":["../src/theme/theme-options.ts"],"mappings":";;;UA4BiB;EACf;EACA,SAAS;EACT;EACA;;UAIe;EACf;EACA;;UAIe;EACf,QAAQ;EAER,YAAY;EAEZ,gBAAgB;EAChB,oBAAoB;;UAIL;EACf,YAAY;EACZ,YAAY;EACZ;;KAOU,4BAA4B;UAGvB;EACf,QAAQ;EACR,SAAS;EACT,QAAQ;EACR,SAAS;EACT,UAAU;EACV,UAAU;EACV,UAAU;EACV,UAAU;EACV,UAAU;EACV,UAAU;EACV,YAAY;EACZ,oBAAoB;EAEpB;;UAIe;EAEf;EACA,QAAQ;;UAIO;EACf,eAAe;EACf,eAAe;EACf,iBAAiB;EACjB,eAAe;;UAIA;EACf,UAAU;EACV,UAAU;EACV,UAAU;;UAIK;EAEf,YAAY;EAEZ,YAAY;EAEZ,cAAc;EAEd,sBAAsB;EACtB;;UAIe;EACf,kBAAkB;EAClB,iBAAiB;EACjB,YAAY;EACZ,aAAa;;UAIE;EAEf,eAAe;EAEf,cAAc;EAEd,cAAc;;KAIJ;UAeK;EACf,aAAa;EACb,OAAO;EACP,aAAa;EACb,OAAO;EACP,SAAS;EACT,SAAS;EACT,SAAS;EACT,SAAS;EACT,SAAS;EACT,SAAS;EACT,WAAW;EACX,mBAAmB;;UAIJ;EACf,aAAa;EACb,eAAe,QAAQ;;UAIR;EAEf;EAEA,OAAO;;UAIQ;EACf;EACA,cAAc;EACd,aAAa;EACb,eAAe;EACf,iBAAiB;EACjB,oBAAoB;EACpB,eAAe;;KAIL,uBAAuB,KACjC"}
|