@office-open/core 0.10.11 → 0.10.13

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.
Files changed (62) hide show
  1. package/README.md +10 -9
  2. package/dist/chart/index.d.mts +1 -1
  3. package/dist/chart/index.mjs +1 -1
  4. package/dist/{chart-DwE8FCFk.mjs → chart-DOO1st0K.mjs} +3 -1
  5. package/dist/chart-DOO1st0K.mjs.map +1 -0
  6. package/dist/converters-C_Y2QX1w.mjs +1789 -0
  7. package/dist/converters-C_Y2QX1w.mjs.map +1 -0
  8. package/dist/data-type-CZMKVaaT.d.mts +10 -0
  9. package/dist/data-type-CZMKVaaT.d.mts.map +1 -0
  10. package/dist/descriptor/index.d.mts +2 -2
  11. package/dist/descriptor/index.mjs +2 -2
  12. package/dist/{descriptor-DAER86Rt.mjs → descriptor-BjNkn5jo.mjs} +3 -33
  13. package/dist/descriptor-BjNkn5jo.mjs.map +1 -0
  14. package/dist/drawingml/index.d.mts +2 -2
  15. package/dist/drawingml/index.mjs +2 -2
  16. package/dist/{src-zBJYrHrv.mjs → drawingml-sj1J3lb0.mjs} +22 -3728
  17. package/dist/drawingml-sj1J3lb0.mjs.map +1 -0
  18. package/dist/index-BVK2dv6C.d.mts +63 -0
  19. package/dist/index-BVK2dv6C.d.mts.map +1 -0
  20. package/dist/index-BfHfKuKy.d.mts +275 -0
  21. package/dist/index-BfHfKuKy.d.mts.map +1 -0
  22. package/dist/index-CE53SwpZ.d.mts +1463 -0
  23. package/dist/index-CE53SwpZ.d.mts.map +1 -0
  24. package/dist/{index-3STznXzZ.d.mts → index-D6VE-MnJ.d.mts} +3 -15
  25. package/dist/index-D6VE-MnJ.d.mts.map +1 -0
  26. package/dist/{index-CN0YjNSx.d.mts → index-DDyd2ErZ.d.mts} +3 -15
  27. package/dist/index-DDyd2ErZ.d.mts.map +1 -0
  28. package/dist/{index-CsQP7Cl4.d.mts → index-DlPA26cw.d.mts} +2 -47
  29. package/dist/index-DlPA26cw.d.mts.map +1 -0
  30. package/dist/index-k8WKLXnA.d.mts +150 -0
  31. package/dist/index-k8WKLXnA.d.mts.map +1 -0
  32. package/dist/index.d.mts +650 -8
  33. package/dist/index.d.mts.map +1 -0
  34. package/dist/index.mjs +1271 -7
  35. package/dist/index.mjs.map +1 -0
  36. package/dist/output-D_G_JR_8.d.mts +24 -0
  37. package/dist/output-D_G_JR_8.d.mts.map +1 -0
  38. package/dist/patch/index.d.mts +2 -2
  39. package/dist/patch/index.mjs +1 -1
  40. package/dist/{patch-DEPPafeB.mjs → patch-BmRfghOo.mjs} +67 -86
  41. package/dist/patch-BmRfghOo.mjs.map +1 -0
  42. package/dist/smartart/index.d.mts +1 -1
  43. package/dist/smartart/index.mjs +1 -1
  44. package/dist/{smartart-DCY-Vdv7.mjs → smartart-B7ukZ-Tw.mjs} +5 -3
  45. package/dist/smartart-B7ukZ-Tw.mjs.map +1 -0
  46. package/dist/theme/index.d.mts +1 -1
  47. package/dist/theme-CiNzdl-9.mjs +2 -0
  48. package/dist/theme-CiNzdl-9.mjs.map +1 -0
  49. package/dist/util/index.d.mts +4 -0
  50. package/dist/util/index.mjs +3 -0
  51. package/dist/util-Tq9PSjK0.mjs +1113 -0
  52. package/dist/util-Tq9PSjK0.mjs.map +1 -0
  53. package/dist/values-8di32lIe.d.mts +56 -0
  54. package/dist/values-8di32lIe.d.mts.map +1 -0
  55. package/package.json +7 -6
  56. package/dist/index-CHGFwCCQ.d.mts +0 -266
  57. package/dist/index-CpNwAcem.d.mts +0 -169
  58. package/dist/index-DdXU1_sq.d.mts +0 -5029
  59. package/dist/util/values.d.mts +0 -2
  60. package/dist/util/values.mjs +0 -2
  61. package/dist/values-CVIZcTRw.mjs +0 -371
  62. package/dist/values-DQfI1FSg.d.mts +0 -426
@@ -1,2 +0,0 @@
1
- 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-DQfI1FSg.mjs";
2
- export { Percentage, PositivePercentage, PositiveUniversalMeasure, RelativeMeasure, ThemeColor, ThemeFont, UniversalMeasure, dateTimeValue, decimalNumber, eighthPointMeasureValue, hexBinary, hexColorValue, hpsMeasureValue, longHexNumber, measurementOrPercentValue, percentageValue, pointMeasureValue, positiveUniversalMeasureValue, shortHexNumber, signedHpsMeasureValue, signedTwipsMeasureValue, twipsMeasureValue, uCharHexNumber, universalMeasureValue, unsignedDecimalNumber };
@@ -1,2 +0,0 @@
1
- import { _ as twipsMeasureValue, a as eighthPointMeasureValue, b as unsignedDecimalNumber, c as hpsMeasureValue, d as percentageValue, f as pointMeasureValue, g as signedTwipsMeasureValue, h as signedHpsMeasureValue, i as decimalNumber, l as longHexNumber, m as shortHexNumber, n as ThemeFont, o as hexBinary, p as positiveUniversalMeasureValue, r as dateTimeValue, s as hexColorValue, t as ThemeColor, u as measurementOrPercentValue, v as uCharHexNumber, y as universalMeasureValue } from "../values-CVIZcTRw.mjs";
2
- export { ThemeColor, ThemeFont, dateTimeValue, decimalNumber, eighthPointMeasureValue, hexBinary, hexColorValue, hpsMeasureValue, longHexNumber, measurementOrPercentValue, percentageValue, pointMeasureValue, positiveUniversalMeasureValue, shortHexNumber, signedHpsMeasureValue, signedTwipsMeasureValue, twipsMeasureValue, uCharHexNumber, universalMeasureValue, unsignedDecimalNumber };
@@ -1,371 +0,0 @@
1
- //#region src/util/values.ts
2
- /**
3
- * Validates and converts a number to an integer (decimal number).
4
- *
5
- * Reference: ST_DecimalNumber in OOXML specification
6
- *
7
- * @param val - The number to validate and convert
8
- * @returns The floored integer value
9
- * @throws Error if the value is NaN
10
- *
11
- * @example
12
- * ```typescript
13
- * const num = decimalNumber(10.7); // Returns 10
14
- * const negative = decimalNumber(-5.3); // Returns -5
15
- * ```
16
- */
17
- const decimalNumber = (val) => {
18
- if (!Number.isFinite(val)) throw new Error(`Invalid value '${val}' specified. Must be a finite number.`);
19
- return Math.floor(val);
20
- };
21
- /**
22
- * Validates and converts a number to a positive integer (unsigned decimal number).
23
- *
24
- * Reference: ST_UnsignedDecimalNumber in OOXML specification
25
- *
26
- * @param val - The number to validate and convert
27
- * @returns The floored positive integer value
28
- * @throws Error if the value is NaN or negative
29
- *
30
- * @example
31
- * ```typescript
32
- * const num = unsignedDecimalNumber(10.7); // Returns 10
33
- * const invalid = unsignedDecimalNumber(-5); // Throws Error
34
- * ```
35
- */
36
- const unsignedDecimalNumber = (val) => {
37
- const value = decimalNumber(val);
38
- if (value < 0) throw new Error(`Invalid value '${val}' specified. Must be a positive integer.`);
39
- return value;
40
- };
41
- /**
42
- * Validates and normalizes a hexadecimal binary value.
43
- *
44
- * The xsd:hexBinary type represents binary data as a sequence of binary octets
45
- * using hexadecimal encoding, where each binary octet is a two-character
46
- * hexadecimal number. Both lowercase and uppercase letters A-F are permitted.
47
- *
48
- * @param val - The hexadecimal string to validate
49
- * @param length - The expected length in bytes (not characters)
50
- * @returns The validated hexadecimal string
51
- * @throws Error if the value is not a valid hex string of the expected length
52
- *
53
- * @example
54
- * ```typescript
55
- * hexBinary("0FB8", 2); // Valid: 2 bytes = 4 characters
56
- * hexBinary("ABC", 2); // Invalid: wrong length
57
- * ```
58
- */
59
- const hexBinary = (val, length) => {
60
- const expectedLength = length * 2;
61
- if (val.length !== expectedLength || isNaN(Number(`0x${val}`))) throw new Error(`Invalid hex value '${val}'. Expected ${expectedLength} digit hex value`);
62
- return val;
63
- };
64
- /**
65
- * Validates a long hexadecimal number (4 bytes / 8 characters).
66
- *
67
- * Reference: ST_LongHexNumber in OOXML specification
68
- *
69
- * @param val - The hexadecimal string to validate
70
- * @returns The validated hexadecimal string
71
- * @throws Error if the value is not a valid 8-character hex string
72
- *
73
- * @example
74
- * ```typescript
75
- * const hex = longHexNumber("ABCD1234"); // Valid
76
- * ```
77
- */
78
- const longHexNumber = (val) => hexBinary(val, 4);
79
- /**
80
- * Validates a short hexadecimal number (2 bytes / 4 characters).
81
- *
82
- * Reference: ST_ShortHexNumber in OOXML specification
83
- *
84
- * @param val - The hexadecimal string to validate
85
- * @returns The validated hexadecimal string
86
- * @throws Error if the value is not a valid 4-character hex string
87
- *
88
- * @example
89
- * ```typescript
90
- * const hex = shortHexNumber("AB12"); // Valid
91
- * ```
92
- */
93
- const shortHexNumber = (val) => hexBinary(val, 2);
94
- /**
95
- * Validates a single-byte hexadecimal number (1 byte / 2 characters).
96
- *
97
- * Reference: ST_UcharHexNumber in OOXML specification
98
- *
99
- * @param val - The hexadecimal string to validate
100
- * @returns The validated hexadecimal string
101
- * @throws Error if the value is not a valid 2-character hex string
102
- *
103
- * @example
104
- * ```typescript
105
- * const hex = uCharHexNumber("FF"); // Valid
106
- * ```
107
- */
108
- const uCharHexNumber = (val) => hexBinary(val, 1);
109
- /**
110
- * Normalizes a universal measure value by parsing and reformatting.
111
- *
112
- * Ensures the numeric portion is properly formatted while preserving the unit.
113
- *
114
- * Reference: ST_UniversalMeasure in OOXML specification
115
- *
116
- * @param val - The universal measure string to normalize
117
- * @returns The normalized universal measure
118
- *
119
- * @example
120
- * ```typescript
121
- * const measure = universalMeasureValue("10.500mm"); // Returns "10.5mm"
122
- * ```
123
- */
124
- const universalMeasureValue = (val) => {
125
- const unit = val.slice(-2);
126
- const amount = val.substring(0, val.length - 2);
127
- return `${Number(amount)}${unit}`;
128
- };
129
- /**
130
- * Validates and normalizes a positive universal measure value.
131
- *
132
- * Reference: ST_PositiveUniversalMeasure in OOXML specification
133
- *
134
- * @param val - The positive universal measure string to validate
135
- * @returns The normalized positive universal measure
136
- * @throws Error if the value is negative
137
- *
138
- * @example
139
- * ```typescript
140
- * const measure = positiveUniversalMeasureValue("10.5mm"); // Valid
141
- * const invalid = positiveUniversalMeasureValue("-5mm"); // Throws Error
142
- * ```
143
- */
144
- const positiveUniversalMeasureValue = (val) => {
145
- const value = universalMeasureValue(val);
146
- if (parseFloat(value) < 0) throw new Error(`Invalid value '${value}' specified. Expected a positive number.`);
147
- return value;
148
- };
149
- /**
150
- * Validates and normalizes a hexadecimal color value.
151
- *
152
- * Accepts either "auto" or a 6-character RGB hex value (with or without # prefix).
153
- * The # prefix is commonly used but technically invalid in OOXML, so it is stripped
154
- * for strict compliance.
155
- *
156
- * Reference: ST_HexColor in OOXML specification
157
- *
158
- * @param val - The color value to validate ("auto" or hex color)
159
- * @returns The normalized color value
160
- * @throws Error if the hex color is invalid
161
- *
162
- * @example
163
- * ```typescript
164
- * const color1 = hexColorValue("auto"); // Returns "auto"
165
- * const color2 = hexColorValue("FF0000"); // Returns "FF0000"
166
- * const color3 = hexColorValue("#00FF00"); // Returns "00FF00" (# stripped)
167
- * ```
168
- */
169
- const hexColorValue = (val) => {
170
- if (val === "auto") return val;
171
- return hexBinary(val.charAt(0) === "#" ? val.substring(1) : val, 3);
172
- };
173
- /**
174
- * Validates a signed TWIP measurement value.
175
- *
176
- * Accepts either a universal measure string or a numeric TWIP value.
177
- *
178
- * Reference: ST_SignedTwipsMeasure in OOXML specification
179
- *
180
- * @param val - The measurement value (universal measure or number)
181
- * @returns The normalized measurement value
182
- *
183
- * @example
184
- * ```typescript
185
- * const measure1 = signedTwipsMeasureValue("10mm");
186
- * const measure2 = signedTwipsMeasureValue(1440); // 1 inch in TWIP
187
- * ```
188
- */
189
- const signedTwipsMeasureValue = (val) => typeof val === "string" ? universalMeasureValue(val) : decimalNumber(val);
190
- /**
191
- * Validates a half-point (HPS) measurement value.
192
- *
193
- * Accepts either a positive universal measure string or a positive number.
194
- * HPS (half-points) are commonly used for font sizes.
195
- *
196
- * Reference: ST_HpsMeasure in OOXML specification
197
- *
198
- * @param val - The measurement value (positive universal measure or number)
199
- * @returns The normalized measurement value
200
- *
201
- * @example
202
- * ```typescript
203
- * const fontSize1 = hpsMeasureValue("12pt");
204
- * const fontSize2 = hpsMeasureValue(24); // 12pt in half-points
205
- * ```
206
- */
207
- const hpsMeasureValue = (val) => typeof val === "string" ? positiveUniversalMeasureValue(val) : unsignedDecimalNumber(val);
208
- /**
209
- * Validates a signed half-point (HPS) measurement value.
210
- *
211
- * Accepts either a universal measure string or a numeric value.
212
- *
213
- * Reference: ST_SignedHpsMeasure in OOXML specification
214
- *
215
- * @param val - The measurement value (universal measure or number)
216
- * @returns The normalized measurement value
217
- *
218
- * @example
219
- * ```typescript
220
- * const spacing1 = signedHpsMeasureValue("6pt");
221
- * const spacing2 = signedHpsMeasureValue(-12); // Negative spacing
222
- * ```
223
- */
224
- const signedHpsMeasureValue = (val) => typeof val === "string" ? universalMeasureValue(val) : decimalNumber(val);
225
- /**
226
- * Validates a positive TWIP measurement value.
227
- *
228
- * Accepts either a positive universal measure string or a positive number.
229
- *
230
- * Reference: ST_TwipsMeasure in OOXML specification
231
- *
232
- * @param val - The measurement value (positive universal measure or number)
233
- * @returns The normalized measurement value
234
- *
235
- * @example
236
- * ```typescript
237
- * const width1 = twipsMeasureValue("25.4mm");
238
- * const width2 = twipsMeasureValue(1440); // 1 inch in TWIP
239
- * ```
240
- */
241
- const twipsMeasureValue = (val) => typeof val === "string" ? positiveUniversalMeasureValue(val) : unsignedDecimalNumber(val);
242
- /**
243
- * Normalizes a percentage value by parsing and reformatting.
244
- *
245
- * Reference: ST_Percentage in OOXML specification
246
- *
247
- * @param val - The percentage string to normalize
248
- * @returns The normalized percentage
249
- *
250
- * @example
251
- * ```typescript
252
- * const percent = percentageValue("50.000%"); // Returns "50%"
253
- * ```
254
- */
255
- const percentageValue = (val) => {
256
- const percent = val.substring(0, val.length - 1);
257
- return `${Number(percent)}%`;
258
- };
259
- /**
260
- * Validates a measurement value that can be expressed as a number, percentage, or universal measure.
261
- *
262
- * Reference: ST_MeasurementOrPercent in OOXML specification
263
- *
264
- * @param val - The measurement value (number, percentage, or universal measure)
265
- * @returns The normalized measurement value
266
- *
267
- * @example
268
- * ```typescript
269
- * const measure1 = measurementOrPercentValue(100); // Unqualified number
270
- * const measure2 = measurementOrPercentValue("50%"); // Percentage
271
- * const measure3 = measurementOrPercentValue("10mm"); // Universal measure
272
- * ```
273
- */
274
- const measurementOrPercentValue = (val) => {
275
- if (typeof val === "number") return decimalNumber(val);
276
- if (val.slice(-1) === "%") return percentageValue(val);
277
- return universalMeasureValue(val);
278
- };
279
- /**
280
- * Validates an eighth-point measurement value.
281
- *
282
- * Eighth-points are used for fine-grained measurements in text formatting.
283
- *
284
- * Reference: ST_EighthPointMeasure in OOXML specification
285
- *
286
- * @param val - The measurement value in eighth-points
287
- * @returns The validated positive integer value
288
- *
289
- * @example
290
- * ```typescript
291
- * const measure = eighthPointMeasureValue(16); // 2 points
292
- * ```
293
- */
294
- const eighthPointMeasureValue = unsignedDecimalNumber;
295
- /**
296
- * Validates a point measurement value.
297
- *
298
- * Reference: ST_PointMeasure in OOXML specification
299
- *
300
- * @param val - The measurement value in points
301
- * @returns The validated positive integer value
302
- *
303
- * @example
304
- * ```typescript
305
- * const fontSize = pointMeasureValue(12); // 12pt
306
- * ```
307
- */
308
- const pointMeasureValue = unsignedDecimalNumber;
309
- /**
310
- * Converts a JavaScript Date object to an ISO 8601 date-time string.
311
- *
312
- * The format is CCYY-MM-DDThh:mm:ss.sssZ where T is a literal and Z indicates UTC.
313
- * This matches the xsd:dateTime format required by OOXML.
314
- *
315
- * Reference: ST_DateTime in OOXML specification
316
- *
317
- * @param val - The Date object to convert
318
- * @returns An ISO 8601 formatted date-time string
319
- *
320
- * @example
321
- * ```typescript
322
- * const now = new Date();
323
- * const timestamp = dateTimeValue(now); // Returns "2024-01-15T10:30:00.000Z"
324
- * ```
325
- */
326
- const dateTimeValue = (val) => val.toISOString();
327
- /**
328
- * Theme color values used throughout OOXML for referencing document theme colors.
329
- *
330
- * Reference: ST_ThemeColor in OOXML specification
331
- *
332
- * @publicApi
333
- */
334
- const ThemeColor = {
335
- DARK1: "dark1",
336
- LIGHT1: "light1",
337
- DARK2: "dark2",
338
- LIGHT2: "light2",
339
- ACCENT1: "accent1",
340
- ACCENT2: "accent2",
341
- ACCENT3: "accent3",
342
- ACCENT4: "accent4",
343
- ACCENT5: "accent5",
344
- ACCENT6: "accent6",
345
- HYPERLINK: "hyperlink",
346
- FOLLOWED_HYPERLINK: "followedHyperlink",
347
- NONE: "none",
348
- BACKGROUND1: "background1",
349
- TEXT1: "text1",
350
- BACKGROUND2: "background2",
351
- TEXT2: "text2"
352
- };
353
- /**
354
- * Theme font values used for referencing document theme fonts.
355
- *
356
- * Reference: ST_Theme in OOXML specification
357
- *
358
- * @publicApi
359
- */
360
- const ThemeFont = {
361
- MAJOR_EAST_ASIA: "majorEastAsia",
362
- MAJOR_BIDI: "majorBidi",
363
- MAJOR_ASCII: "majorAscii",
364
- MAJOR_H_ANSI: "majorHAnsi",
365
- MINOR_EAST_ASIA: "minorEastAsia",
366
- MINOR_BIDI: "minorBidi",
367
- MINOR_ASCII: "minorAscii",
368
- MINOR_H_ANSI: "minorHAnsi"
369
- };
370
- //#endregion
371
- export { twipsMeasureValue as _, eighthPointMeasureValue as a, unsignedDecimalNumber as b, hpsMeasureValue as c, percentageValue as d, pointMeasureValue as f, signedTwipsMeasureValue as g, signedHpsMeasureValue as h, decimalNumber as i, longHexNumber as l, shortHexNumber as m, ThemeFont as n, hexBinary as o, positiveUniversalMeasureValue as p, dateTimeValue as r, hexColorValue as s, ThemeColor as t, measurementOrPercentValue as u, uCharHexNumber as v, universalMeasureValue as y };