@office-open/core 0.6.4 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chart/index.d.mts +1 -112
- package/dist/chart/index.mjs +1 -610
- package/dist/chart-Bd9E-YhB.mjs +611 -0
- package/dist/drawingml/index.d.mts +2 -3127
- package/dist/drawingml/index.mjs +1 -3877
- package/dist/drawingml-YMdpQfWs.mjs +4155 -0
- package/dist/{index-mjYQ4KiG.d.mts → index-B1wzvu1m.d.mts} +1 -1
- package/dist/{index-DigYTiB_.d.mts → index-CZxcE4Q6.d.mts} +1 -1
- package/dist/index-CuRO3Jmz.d.mts +3127 -0
- package/dist/index-DNLRdIqy.d.mts +127 -0
- package/dist/index-DZobntUT.d.mts +113 -0
- package/dist/index.d.mts +18 -17
- package/dist/index.mjs +15 -19
- package/dist/patch/index.d.mts +2 -0
- package/dist/patch/index.mjs +2 -0
- package/dist/patch-BdMU95aX.mjs +337 -0
- package/dist/smartart/index.d.mts +1 -1
- package/dist/values.d.mts +1 -1
- package/package.json +2 -6
- package/dist/archive.d.mts +0 -58
- package/dist/archive.mjs +0 -135
- package/dist/xsd-mappings-BiTj9yJn.mjs +0 -279
- /package/dist/{values-CIh0bdS1.d.mts → values-QyWq4U4A.d.mts} +0 -0
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
import hash from "hash.js";
|
|
2
|
-
import { customAlphabet, nanoid } from "nanoid/non-secure";
|
|
3
|
-
//#region src/converters.ts
|
|
4
|
-
/**
|
|
5
|
-
* OOXML unit conversion utilities.
|
|
6
|
-
*
|
|
7
|
-
* @module
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Converts millimeters to TWIP (twentieths of a point).
|
|
11
|
-
*/
|
|
12
|
-
const convertMillimetersToTwip = (millimeters) => Math.floor(millimeters / 25.4 * 72 * 20);
|
|
13
|
-
/**
|
|
14
|
-
* Converts inches to TWIP (twentieths of a point).
|
|
15
|
-
*/
|
|
16
|
-
const convertInchesToTwip = (inches) => Math.floor(inches * 72 * 20);
|
|
17
|
-
/**
|
|
18
|
-
* Converts pixels to EMU (96 DPI).
|
|
19
|
-
*/
|
|
20
|
-
const convertPixelsToEmu = (pixels) => Math.round(pixels * 9525);
|
|
21
|
-
/**
|
|
22
|
-
* Converts EMU to pixels (96 DPI).
|
|
23
|
-
*/
|
|
24
|
-
const convertEmuToPixels = (emus) => Math.round(emus / 9525);
|
|
25
|
-
/**
|
|
26
|
-
* Converts inches to EMU.
|
|
27
|
-
*/
|
|
28
|
-
const convertInchesToEmu = (inches) => Math.round(inches * 914400);
|
|
29
|
-
/**
|
|
30
|
-
* Converts EMU to inches.
|
|
31
|
-
*/
|
|
32
|
-
const convertEmuToInches = (emus) => emus / 914400;
|
|
33
|
-
/**
|
|
34
|
-
* Converts points to EMU.
|
|
35
|
-
*/
|
|
36
|
-
const convertPointsToEmu = (points) => Math.round(points * 12700);
|
|
37
|
-
/**
|
|
38
|
-
* Converts EMU to points.
|
|
39
|
-
*/
|
|
40
|
-
const convertEmuToPoints = (emus) => emus / 12700;
|
|
41
|
-
//#endregion
|
|
42
|
-
//#region src/id-generators.ts
|
|
43
|
-
/**
|
|
44
|
-
* Unique ID generation utilities.
|
|
45
|
-
*
|
|
46
|
-
* @module
|
|
47
|
-
*/
|
|
48
|
-
/**
|
|
49
|
-
* Creates a unique numeric ID generator with sequential numbering.
|
|
50
|
-
*/
|
|
51
|
-
const uniqueNumericIdCreator = (initial = 0) => {
|
|
52
|
-
let currentCount = initial;
|
|
53
|
-
return () => ++currentCount;
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* Generates a unique lowercase alphanumeric ID using nanoid.
|
|
57
|
-
*/
|
|
58
|
-
const uniqueId = () => nanoid().toLowerCase();
|
|
59
|
-
/**
|
|
60
|
-
* Generates a SHA-1 hash of the provided data.
|
|
61
|
-
*/
|
|
62
|
-
const hashedId = (data) => hash.sha1().update(data instanceof ArrayBuffer ? new Uint8Array(data) : data).digest("hex");
|
|
63
|
-
/**
|
|
64
|
-
* Generates a random hexadecimal string of specified length.
|
|
65
|
-
*/
|
|
66
|
-
const generateUuidPart = (count) => customAlphabet("1234567890abcdef", count)();
|
|
67
|
-
/**
|
|
68
|
-
* Generates a UUID v4-style unique identifier.
|
|
69
|
-
*/
|
|
70
|
-
const uniqueUuid = () => `${generateUuidPart(8)}-${generateUuidPart(4)}-${generateUuidPart(4)}-${generateUuidPart(4)}-${generateUuidPart(12)}`;
|
|
71
|
-
//#endregion
|
|
72
|
-
//#region src/xsd-mappings.ts
|
|
73
|
-
/**
|
|
74
|
-
* Bidirectional mappings between user-friendly values and XSD abbreviated values.
|
|
75
|
-
*
|
|
76
|
-
* When XSD uses full English words (e.g. "center", "start"), values are used directly — no mapping needed.
|
|
77
|
-
* When XSD uses abbreviations (e.g. "ctr", "l", "rnd"), this module maps them to full words.
|
|
78
|
-
*
|
|
79
|
-
* Usage in generation (Options → XML): xsdAlign.to("center") → "ctr"
|
|
80
|
-
* Usage in parsing (XML → Options): xsdAlign.from("ctr") → "center"
|
|
81
|
-
*/
|
|
82
|
-
/** Invert a Record<K, V> into Record<V, K>. */
|
|
83
|
-
function invertMap(map) {
|
|
84
|
-
const result = {};
|
|
85
|
-
for (const key in map) result[map[key]] = key;
|
|
86
|
-
return result;
|
|
87
|
-
}
|
|
88
|
-
/** Create a bidirectional mapping helper from a single forward map. */
|
|
89
|
-
function bidi(forward) {
|
|
90
|
-
const reverse = invertMap(forward);
|
|
91
|
-
return {
|
|
92
|
-
/** User-friendly value → XSD value */
|
|
93
|
-
to: (key) => forward[key] ?? key,
|
|
94
|
-
/** XSD value → user-friendly value */
|
|
95
|
-
from: (xsd) => reverse[xsd] ?? xsd,
|
|
96
|
-
/** The forward map (user → XSD) */
|
|
97
|
-
forward,
|
|
98
|
-
/** The reverse map (XSD → user) */
|
|
99
|
-
reverse
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
const xsdRectAlignment = bidi({
|
|
103
|
-
topLeft: "tl",
|
|
104
|
-
top: "t",
|
|
105
|
-
topRight: "tr",
|
|
106
|
-
left: "l",
|
|
107
|
-
center: "ctr",
|
|
108
|
-
right: "r",
|
|
109
|
-
bottomLeft: "bl",
|
|
110
|
-
bottom: "b",
|
|
111
|
-
bottomRight: "br"
|
|
112
|
-
});
|
|
113
|
-
const xsdTextAlign = bidi({
|
|
114
|
-
left: "l",
|
|
115
|
-
center: "ctr",
|
|
116
|
-
right: "r",
|
|
117
|
-
justify: "just"
|
|
118
|
-
});
|
|
119
|
-
const xsdTextAnchor = bidi({
|
|
120
|
-
top: "t",
|
|
121
|
-
center: "ctr",
|
|
122
|
-
bottom: "b"
|
|
123
|
-
});
|
|
124
|
-
const xsdLineCap = bidi({
|
|
125
|
-
round: "rnd",
|
|
126
|
-
square: "sq",
|
|
127
|
-
flat: "flat"
|
|
128
|
-
});
|
|
129
|
-
const xsdCompoundLine = bidi({
|
|
130
|
-
single: "sng",
|
|
131
|
-
double: "dbl",
|
|
132
|
-
thickThin: "thickThin",
|
|
133
|
-
thinThick: "thinThick",
|
|
134
|
-
triple: "tri"
|
|
135
|
-
});
|
|
136
|
-
const xsdPenAlignment = bidi({
|
|
137
|
-
center: "ctr",
|
|
138
|
-
inside: "in"
|
|
139
|
-
});
|
|
140
|
-
const xsdLineEndSize = bidi({
|
|
141
|
-
small: "sm",
|
|
142
|
-
medium: "med",
|
|
143
|
-
large: "lg"
|
|
144
|
-
});
|
|
145
|
-
const xsdBlendMode = bidi({
|
|
146
|
-
over: "over",
|
|
147
|
-
multiply: "mult",
|
|
148
|
-
screen: "screen",
|
|
149
|
-
darken: "darken",
|
|
150
|
-
lighten: "lighten"
|
|
151
|
-
});
|
|
152
|
-
const xsdPathFillMode = bidi({
|
|
153
|
-
none: "none",
|
|
154
|
-
normal: "norm",
|
|
155
|
-
lighten: "lighten",
|
|
156
|
-
lightenLess: "lightenLess",
|
|
157
|
-
darken: "darken",
|
|
158
|
-
darkenLess: "darkenLess"
|
|
159
|
-
});
|
|
160
|
-
const xsdEffectContainer = bidi({
|
|
161
|
-
sibling: "sib",
|
|
162
|
-
tree: "tree"
|
|
163
|
-
});
|
|
164
|
-
const xsdPresetShadow = bidi({
|
|
165
|
-
shadow1: "shdw1",
|
|
166
|
-
shadow2: "shdw2",
|
|
167
|
-
shadow3: "shdw3",
|
|
168
|
-
shadow4: "shdw4",
|
|
169
|
-
shadow5: "shdw5",
|
|
170
|
-
shadow6: "shdw6",
|
|
171
|
-
shadow7: "shdw7",
|
|
172
|
-
shadow8: "shdw8",
|
|
173
|
-
shadow9: "shdw9",
|
|
174
|
-
shadow10: "shdw10",
|
|
175
|
-
shadow11: "shdw11",
|
|
176
|
-
shadow12: "shdw12",
|
|
177
|
-
shadow13: "shdw13",
|
|
178
|
-
shadow14: "shdw14",
|
|
179
|
-
shadow15: "shdw15",
|
|
180
|
-
shadow16: "shdw16",
|
|
181
|
-
shadow17: "shdw17",
|
|
182
|
-
shadow18: "shdw18",
|
|
183
|
-
shadow19: "shdw19",
|
|
184
|
-
shadow20: "shdw20"
|
|
185
|
-
});
|
|
186
|
-
const xsdMaterialType = bidi({
|
|
187
|
-
legacyMatte: "legacyMatte",
|
|
188
|
-
legacyPlastic: "legacyPlastic",
|
|
189
|
-
legacyMetal: "legacyMetal",
|
|
190
|
-
legacyWireframe: "legacyWireframe",
|
|
191
|
-
matte: "matte",
|
|
192
|
-
plastic: "plastic",
|
|
193
|
-
metal: "metal",
|
|
194
|
-
warmMatte: "warmMatte",
|
|
195
|
-
translucentPowder: "translucentPowder",
|
|
196
|
-
powder: "powder",
|
|
197
|
-
darkEdge: "dkEdge",
|
|
198
|
-
softEdge: "softEdge",
|
|
199
|
-
clear: "clear",
|
|
200
|
-
flat: "flat",
|
|
201
|
-
softMetal: "softmetal"
|
|
202
|
-
});
|
|
203
|
-
const xsdPattern = bidi({
|
|
204
|
-
percent5: "pct5",
|
|
205
|
-
percent10: "pct10",
|
|
206
|
-
percent20: "pct20",
|
|
207
|
-
percent25: "pct25",
|
|
208
|
-
percent30: "pct30",
|
|
209
|
-
percent40: "pct40",
|
|
210
|
-
percent50: "pct50",
|
|
211
|
-
percent60: "pct60",
|
|
212
|
-
percent70: "pct70",
|
|
213
|
-
percent75: "pct75",
|
|
214
|
-
percent80: "pct80",
|
|
215
|
-
percent90: "pct90",
|
|
216
|
-
horizontal: "horz",
|
|
217
|
-
vertical: "vert",
|
|
218
|
-
lightHorizontal: "ltHorz",
|
|
219
|
-
lightVertical: "ltVert",
|
|
220
|
-
darkHorizontal: "dkHorz",
|
|
221
|
-
darkVertical: "dkVert",
|
|
222
|
-
narrowHorizontal: "narHorz",
|
|
223
|
-
narrowVertical: "narVert",
|
|
224
|
-
dashedHorizontal: "dashHorz",
|
|
225
|
-
dashedVertical: "dashVert",
|
|
226
|
-
cross: "cross",
|
|
227
|
-
downDiagonal: "dnDiag",
|
|
228
|
-
upDiagonal: "upDiag",
|
|
229
|
-
lightDownDiagonal: "ltDnDiag",
|
|
230
|
-
lightUpDiagonal: "ltUpDiag",
|
|
231
|
-
darkDownDiagonal: "dkDnDiag",
|
|
232
|
-
darkUpDiagonal: "dkUpDiag",
|
|
233
|
-
wideDownDiagonal: "wdDnDiag",
|
|
234
|
-
wideUpDiagonal: "wdUpDiag",
|
|
235
|
-
dashedDownDiagonal: "dashDnDiag",
|
|
236
|
-
dashedUpDiagonal: "dashUpDiag",
|
|
237
|
-
diagonalCross: "diagCross",
|
|
238
|
-
smallChecker: "smCheck",
|
|
239
|
-
largeChecker: "lgCheck",
|
|
240
|
-
smallGrid: "smGrid",
|
|
241
|
-
largeGrid: "lgGrid",
|
|
242
|
-
dotGrid: "dotGrid",
|
|
243
|
-
smallConfetti: "smConfetti",
|
|
244
|
-
largeConfetti: "lgConfetti",
|
|
245
|
-
horizontalBrick: "horzBrick",
|
|
246
|
-
diagonalBrick: "diagBrick",
|
|
247
|
-
solidDiamond: "solidDmnd",
|
|
248
|
-
openDiamond: "openDmnd",
|
|
249
|
-
dottedDiamond: "dotDmnd",
|
|
250
|
-
plaid: "plaid",
|
|
251
|
-
sphere: "sphere",
|
|
252
|
-
weave: "weave",
|
|
253
|
-
divot: "divot",
|
|
254
|
-
shingle: "shingle",
|
|
255
|
-
wave: "wave",
|
|
256
|
-
trellis: "trellis",
|
|
257
|
-
zigZag: "zigZag"
|
|
258
|
-
});
|
|
259
|
-
const xsdVerticalMergeRev = bidi({
|
|
260
|
-
continue: "cont",
|
|
261
|
-
restart: "rest"
|
|
262
|
-
});
|
|
263
|
-
const xsdUnderlineStyle = bidi({
|
|
264
|
-
single: "sng",
|
|
265
|
-
double: "dbl",
|
|
266
|
-
none: "none"
|
|
267
|
-
});
|
|
268
|
-
const xsdStrikeStyle = bidi({
|
|
269
|
-
singleStrike: "sngStrike",
|
|
270
|
-
doubleStrike: "dblStrike",
|
|
271
|
-
noStrike: "noStrike"
|
|
272
|
-
});
|
|
273
|
-
const xsdTextCaps = bidi({
|
|
274
|
-
none: "none",
|
|
275
|
-
all: "all",
|
|
276
|
-
small: "small"
|
|
277
|
-
});
|
|
278
|
-
//#endregion
|
|
279
|
-
export { convertPointsToEmu as A, convertEmuToInches as C, convertInchesToTwip as D, convertInchesToEmu as E, convertMillimetersToTwip as O, uniqueUuid as S, convertEmuToPoints as T, xsdUnderlineStyle as _, xsdLineCap as a, uniqueId as b, xsdPathFillMode as c, xsdPresetShadow as d, xsdRectAlignment as f, xsdTextCaps as g, xsdTextAnchor as h, xsdEffectContainer as i, convertPixelsToEmu as k, xsdPattern as l, xsdTextAlign as m, xsdBlendMode as n, xsdLineEndSize as o, xsdStrikeStyle as p, xsdCompoundLine as r, xsdMaterialType as s, invertMap as t, xsdPenAlignment as u, xsdVerticalMergeRev as v, convertEmuToPixels as w, uniqueNumericIdCreator as x, hashedId as y };
|
|
File without changes
|