@office-open/core 0.3.6 → 0.4.1
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/_chunks/index-B3rs5exK.d.mts +87 -0
- package/dist/_chunks/{index-eOE0yRGG.d.mts → index-hmJg8TDw.d.mts} +1 -1
- package/dist/_chunks/smartart-D_qXltR5.mjs +336 -0
- package/dist/chart/index.d.mts +42 -12
- package/dist/chart/index.mjs +263 -12
- package/dist/drawingml/index.d.mts +105 -76
- package/dist/drawingml/index.mjs +225 -123
- package/dist/index.d.mts +75 -17
- package/dist/index.mjs +167 -7
- package/dist/smartart/index.d.mts +2 -69
- package/dist/smartart/index.mjs +2 -304
- package/dist/values.d.mts +1 -1
- package/package.json +3 -3
- /package/dist/_chunks/{values--NnXAmqa.d.mts → values-COMdgNmb.d.mts} +0 -0
package/dist/drawingml/index.mjs
CHANGED
|
@@ -233,11 +233,11 @@ const createHslColor = (options) => {
|
|
|
233
233
|
},
|
|
234
234
|
lum: {
|
|
235
235
|
key: "lum",
|
|
236
|
-
value: options.
|
|
236
|
+
value: options.luminance
|
|
237
237
|
},
|
|
238
238
|
sat: {
|
|
239
239
|
key: "sat",
|
|
240
|
-
value: options.
|
|
240
|
+
value: options.saturation
|
|
241
241
|
}
|
|
242
242
|
},
|
|
243
243
|
children: [...transforms],
|
|
@@ -726,7 +726,7 @@ const SYSTEM_COLOR_VALUES = new Set(Object.values(SystemColor));
|
|
|
726
726
|
const PRESET_COLOR_VALUES = new Set(Object.values(PresetColor));
|
|
727
727
|
const SCHEME_COLOR_VALUES = new Set(Object.values(SchemeColor));
|
|
728
728
|
const createColorElement = (color) => {
|
|
729
|
-
if ("hue" in color && "
|
|
729
|
+
if ("hue" in color && "saturation" in color && "luminance" in color) return createHslColor(color);
|
|
730
730
|
if ("r" in color && "g" in color && "b" in color) return createScRgbColor(color);
|
|
731
731
|
const colorValue = color.value;
|
|
732
732
|
if (SYSTEM_COLOR_VALUES.has(colorValue)) return createSystemColor(color);
|
|
@@ -758,7 +758,7 @@ const createColorElement = (color) => {
|
|
|
758
758
|
* value: SchemeColor.ACCENT1, transforms: { tint: 40000 },
|
|
759
759
|
* });
|
|
760
760
|
* // HSL solid fill
|
|
761
|
-
* const hslFill = createSolidFill({ hue: 120000,
|
|
761
|
+
* const hslFill = createSolidFill({ hue: 120000, saturation: 100000, luminance: 50000 });
|
|
762
762
|
* ```
|
|
763
763
|
*/
|
|
764
764
|
const createSolidFill = (options) => new BuilderElement({
|
|
@@ -807,13 +807,13 @@ const createBlipEffects = (options) => {
|
|
|
807
807
|
key: "hue",
|
|
808
808
|
value: String(options.hsl.hue)
|
|
809
809
|
};
|
|
810
|
-
if (options.hsl.
|
|
810
|
+
if (options.hsl.saturation !== void 0) attrs.sat = {
|
|
811
811
|
key: "sat",
|
|
812
|
-
value: `${options.hsl.
|
|
812
|
+
value: `${options.hsl.saturation}%`
|
|
813
813
|
};
|
|
814
|
-
if (options.hsl.
|
|
814
|
+
if (options.hsl.luminance !== void 0) attrs.lum = {
|
|
815
815
|
key: "lum",
|
|
816
|
-
value: `${options.hsl.
|
|
816
|
+
value: `${options.hsl.luminance}%`
|
|
817
817
|
};
|
|
818
818
|
children.push(new BuilderElement({
|
|
819
819
|
attributes: attrs,
|
|
@@ -826,9 +826,9 @@ const createBlipEffects = (options) => {
|
|
|
826
826
|
key: "hue",
|
|
827
827
|
value: String(options.tint.hue)
|
|
828
828
|
};
|
|
829
|
-
if (options.tint.
|
|
829
|
+
if (options.tint.amount !== void 0) attrs.amt = {
|
|
830
830
|
key: "amt",
|
|
831
|
-
value: `${options.tint.
|
|
831
|
+
value: `${options.tint.amount}%`
|
|
832
832
|
};
|
|
833
833
|
children.push(new BuilderElement({
|
|
834
834
|
attributes: attrs,
|
|
@@ -842,7 +842,7 @@ const createBlipEffects = (options) => {
|
|
|
842
842
|
if (options.biLevel) children.push(new BuilderElement({
|
|
843
843
|
attributes: { thresh: {
|
|
844
844
|
key: "thresh",
|
|
845
|
-
value: `${options.biLevel.
|
|
845
|
+
value: `${options.biLevel.threshold}%`
|
|
846
846
|
} },
|
|
847
847
|
name: "a:biLevel"
|
|
848
848
|
}));
|
|
@@ -873,7 +873,7 @@ const createBlipEffects = (options) => {
|
|
|
873
873
|
if (options.alphaBiLevel) children.push(new BuilderElement({
|
|
874
874
|
attributes: { thresh: {
|
|
875
875
|
key: "thresh",
|
|
876
|
-
value: `${options.alphaBiLevel.
|
|
876
|
+
value: `${options.alphaBiLevel.threshold}%`
|
|
877
877
|
} },
|
|
878
878
|
name: "a:alphaBiLevel"
|
|
879
879
|
}));
|
|
@@ -901,9 +901,9 @@ const createBlipEffects = (options) => {
|
|
|
901
901
|
}));
|
|
902
902
|
if (options.blur) {
|
|
903
903
|
const attrs = {};
|
|
904
|
-
if (options.blur.
|
|
904
|
+
if (options.blur.radius !== void 0) attrs.rad = {
|
|
905
905
|
key: "rad",
|
|
906
|
-
value: options.blur.
|
|
906
|
+
value: options.blur.radius
|
|
907
907
|
};
|
|
908
908
|
if (options.blur.grow === false) attrs.grow = {
|
|
909
909
|
key: "grow",
|
|
@@ -2022,14 +2022,14 @@ const createFillOverlayEffect = (options) => {
|
|
|
2022
2022
|
* ```
|
|
2023
2023
|
*/
|
|
2024
2024
|
const createGlowEffect = (options) => {
|
|
2025
|
-
if (options.
|
|
2025
|
+
if (options.radius === void 0) return new BuilderElement({
|
|
2026
2026
|
children: [createColorElement(options.color)],
|
|
2027
2027
|
name: "a:glow"
|
|
2028
2028
|
});
|
|
2029
2029
|
return new BuilderElement({
|
|
2030
2030
|
attributes: { rad: {
|
|
2031
2031
|
key: "rad",
|
|
2032
|
-
value: options.
|
|
2032
|
+
value: options.radius
|
|
2033
2033
|
} },
|
|
2034
2034
|
children: [createColorElement(options.color)],
|
|
2035
2035
|
name: "a:glow"
|
|
@@ -2060,23 +2060,23 @@ const createGlowEffect = (options) => {
|
|
|
2060
2060
|
* ```
|
|
2061
2061
|
*/
|
|
2062
2062
|
const createInnerShadowEffect = (options) => {
|
|
2063
|
-
if (!(options.
|
|
2063
|
+
if (!(options.blurRadius !== void 0 || options.distance !== void 0 || options.direction !== void 0)) return new BuilderElement({
|
|
2064
2064
|
children: [createColorElement(options.color)],
|
|
2065
2065
|
name: "a:innerShdw"
|
|
2066
2066
|
});
|
|
2067
2067
|
return new BuilderElement({
|
|
2068
2068
|
attributes: {
|
|
2069
|
-
...options.
|
|
2069
|
+
...options.blurRadius !== void 0 && { blurRad: {
|
|
2070
2070
|
key: "blurRad",
|
|
2071
|
-
value: options.
|
|
2071
|
+
value: options.blurRadius
|
|
2072
2072
|
} },
|
|
2073
|
-
...options.
|
|
2073
|
+
...options.distance !== void 0 && { dist: {
|
|
2074
2074
|
key: "dist",
|
|
2075
|
-
value: options.
|
|
2075
|
+
value: options.distance
|
|
2076
2076
|
} },
|
|
2077
|
-
...options.
|
|
2077
|
+
...options.direction !== void 0 && { dir: {
|
|
2078
2078
|
key: "dir",
|
|
2079
|
-
value: options.
|
|
2079
|
+
value: options.direction
|
|
2080
2080
|
} }
|
|
2081
2081
|
},
|
|
2082
2082
|
children: [createColorElement(options.color)],
|
|
@@ -2129,37 +2129,37 @@ const RectAlignment = {
|
|
|
2129
2129
|
*/
|
|
2130
2130
|
const createOuterShadowEffect = (options) => {
|
|
2131
2131
|
const attributes = {};
|
|
2132
|
-
if (options.
|
|
2132
|
+
if (options.blurRadius !== void 0) attributes.blurRad = {
|
|
2133
2133
|
key: "blurRad",
|
|
2134
|
-
value: options.
|
|
2134
|
+
value: options.blurRadius
|
|
2135
2135
|
};
|
|
2136
|
-
if (options.
|
|
2136
|
+
if (options.distance !== void 0) attributes.dist = {
|
|
2137
2137
|
key: "dist",
|
|
2138
|
-
value: options.
|
|
2138
|
+
value: options.distance
|
|
2139
2139
|
};
|
|
2140
|
-
if (options.
|
|
2140
|
+
if (options.direction !== void 0) attributes.dir = {
|
|
2141
2141
|
key: "dir",
|
|
2142
|
-
value: options.
|
|
2142
|
+
value: options.direction
|
|
2143
2143
|
};
|
|
2144
|
-
if (options.
|
|
2144
|
+
if (options.scaleX !== void 0) attributes.sx = {
|
|
2145
2145
|
key: "sx",
|
|
2146
|
-
value: options.
|
|
2146
|
+
value: options.scaleX
|
|
2147
2147
|
};
|
|
2148
|
-
if (options.
|
|
2148
|
+
if (options.scaleY !== void 0) attributes.sy = {
|
|
2149
2149
|
key: "sy",
|
|
2150
|
-
value: options.
|
|
2150
|
+
value: options.scaleY
|
|
2151
2151
|
};
|
|
2152
|
-
if (options.
|
|
2152
|
+
if (options.skewX !== void 0) attributes.kx = {
|
|
2153
2153
|
key: "kx",
|
|
2154
|
-
value: options.
|
|
2154
|
+
value: options.skewX
|
|
2155
2155
|
};
|
|
2156
|
-
if (options.
|
|
2156
|
+
if (options.skewY !== void 0) attributes.ky = {
|
|
2157
2157
|
key: "ky",
|
|
2158
|
-
value: options.
|
|
2158
|
+
value: options.skewY
|
|
2159
2159
|
};
|
|
2160
|
-
if (options.
|
|
2160
|
+
if (options.alignment !== void 0) attributes.algn = {
|
|
2161
2161
|
key: "algn",
|
|
2162
|
-
value: RectAlignment[options.
|
|
2162
|
+
value: RectAlignment[options.alignment]
|
|
2163
2163
|
};
|
|
2164
2164
|
if (options.rotWithShape === false) attributes.rotWithShape = {
|
|
2165
2165
|
key: "rotWithShape",
|
|
@@ -2225,15 +2225,15 @@ const PresetShadowVal = {
|
|
|
2225
2225
|
const createPresetShadowEffect = (options) => {
|
|
2226
2226
|
const attributes = { prst: {
|
|
2227
2227
|
key: "prst",
|
|
2228
|
-
value: PresetShadowVal[options.
|
|
2228
|
+
value: PresetShadowVal[options.preset]
|
|
2229
2229
|
} };
|
|
2230
|
-
if (options.
|
|
2230
|
+
if (options.distance !== void 0) attributes.dist = {
|
|
2231
2231
|
key: "dist",
|
|
2232
|
-
value: options.
|
|
2232
|
+
value: options.distance
|
|
2233
2233
|
};
|
|
2234
|
-
if (options.
|
|
2234
|
+
if (options.direction !== void 0) attributes.dir = {
|
|
2235
2235
|
key: "dir",
|
|
2236
|
-
value: options.
|
|
2236
|
+
value: options.direction
|
|
2237
2237
|
};
|
|
2238
2238
|
return new BuilderElement({
|
|
2239
2239
|
attributes,
|
|
@@ -2276,57 +2276,57 @@ const createPresetShadowEffect = (options) => {
|
|
|
2276
2276
|
const createReflectionEffect = (options) => {
|
|
2277
2277
|
if (!options) return new BuilderElement({ name: "a:reflection" });
|
|
2278
2278
|
const attributes = {};
|
|
2279
|
-
if (options.
|
|
2279
|
+
if (options.blurRadius !== void 0) attributes.blurRad = {
|
|
2280
2280
|
key: "blurRad",
|
|
2281
|
-
value: options.
|
|
2281
|
+
value: options.blurRadius
|
|
2282
2282
|
};
|
|
2283
|
-
if (options.
|
|
2283
|
+
if (options.startAlpha !== void 0) attributes.stA = {
|
|
2284
2284
|
key: "stA",
|
|
2285
|
-
value: options.
|
|
2285
|
+
value: options.startAlpha
|
|
2286
2286
|
};
|
|
2287
|
-
if (options.
|
|
2287
|
+
if (options.startPosition !== void 0) attributes.stPos = {
|
|
2288
2288
|
key: "stPos",
|
|
2289
|
-
value: options.
|
|
2289
|
+
value: options.startPosition
|
|
2290
2290
|
};
|
|
2291
|
-
if (options.
|
|
2291
|
+
if (options.endAlpha !== void 0) attributes.endA = {
|
|
2292
2292
|
key: "endA",
|
|
2293
|
-
value: options.
|
|
2293
|
+
value: options.endAlpha
|
|
2294
2294
|
};
|
|
2295
|
-
if (options.
|
|
2295
|
+
if (options.endPosition !== void 0) attributes.endPos = {
|
|
2296
2296
|
key: "endPos",
|
|
2297
|
-
value: options.
|
|
2297
|
+
value: options.endPosition
|
|
2298
2298
|
};
|
|
2299
|
-
if (options.
|
|
2299
|
+
if (options.distance !== void 0) attributes.dist = {
|
|
2300
2300
|
key: "dist",
|
|
2301
|
-
value: options.
|
|
2301
|
+
value: options.distance
|
|
2302
2302
|
};
|
|
2303
|
-
if (options.
|
|
2303
|
+
if (options.direction !== void 0) attributes.dir = {
|
|
2304
2304
|
key: "dir",
|
|
2305
|
-
value: options.
|
|
2305
|
+
value: options.direction
|
|
2306
2306
|
};
|
|
2307
|
-
if (options.
|
|
2307
|
+
if (options.fadeDirection !== void 0) attributes.fadeDir = {
|
|
2308
2308
|
key: "fadeDir",
|
|
2309
|
-
value: options.
|
|
2309
|
+
value: options.fadeDirection
|
|
2310
2310
|
};
|
|
2311
|
-
if (options.
|
|
2311
|
+
if (options.scaleX !== void 0) attributes.sx = {
|
|
2312
2312
|
key: "sx",
|
|
2313
|
-
value: options.
|
|
2313
|
+
value: options.scaleX
|
|
2314
2314
|
};
|
|
2315
|
-
if (options.
|
|
2315
|
+
if (options.scaleY !== void 0) attributes.sy = {
|
|
2316
2316
|
key: "sy",
|
|
2317
|
-
value: options.
|
|
2317
|
+
value: options.scaleY
|
|
2318
2318
|
};
|
|
2319
|
-
if (options.
|
|
2319
|
+
if (options.skewX !== void 0) attributes.kx = {
|
|
2320
2320
|
key: "kx",
|
|
2321
|
-
value: options.
|
|
2321
|
+
value: options.skewX
|
|
2322
2322
|
};
|
|
2323
|
-
if (options.
|
|
2323
|
+
if (options.skewY !== void 0) attributes.ky = {
|
|
2324
2324
|
key: "ky",
|
|
2325
|
-
value: options.
|
|
2325
|
+
value: options.skewY
|
|
2326
2326
|
};
|
|
2327
|
-
if (options.
|
|
2327
|
+
if (options.alignment !== void 0) attributes.algn = {
|
|
2328
2328
|
key: "algn",
|
|
2329
|
-
value: options.
|
|
2329
|
+
value: options.alignment
|
|
2330
2330
|
};
|
|
2331
2331
|
if (options.rotWithShape === false) attributes.rotWithShape = {
|
|
2332
2332
|
key: "rotWithShape",
|
|
@@ -2386,12 +2386,12 @@ const createSoftEdgeEffect = (rad) => new BuilderElement({
|
|
|
2386
2386
|
* ```
|
|
2387
2387
|
*/
|
|
2388
2388
|
const createBlurEffect$1 = (options) => {
|
|
2389
|
-
if (!(options.
|
|
2389
|
+
if (!(options.radius !== void 0 || options.grow === false)) return new BuilderElement({ name: "a:blur" });
|
|
2390
2390
|
return new BuilderElement({
|
|
2391
2391
|
attributes: {
|
|
2392
|
-
...options.
|
|
2392
|
+
...options.radius !== void 0 && { rad: {
|
|
2393
2393
|
key: "rad",
|
|
2394
|
-
value: options.
|
|
2394
|
+
value: options.radius
|
|
2395
2395
|
} },
|
|
2396
2396
|
...options.grow === false && { grow: {
|
|
2397
2397
|
key: "grow",
|
|
@@ -2463,7 +2463,7 @@ const createAlphaBiLevelEffect = (options) => new BuilderElement({
|
|
|
2463
2463
|
name: "a:alphaBiLevel",
|
|
2464
2464
|
attributes: { thresh: {
|
|
2465
2465
|
key: "thresh",
|
|
2466
|
-
value: options.
|
|
2466
|
+
value: options.threshold
|
|
2467
2467
|
} }
|
|
2468
2468
|
});
|
|
2469
2469
|
const createAlphaCeilingEffect = () => new BuilderElement({ name: "a:alphaCeiling" });
|
|
@@ -2473,22 +2473,22 @@ const createAlphaInverseEffect = (options) => new BuilderElement({
|
|
|
2473
2473
|
children: options?.color ? [createColorElement(options.color)] : void 0
|
|
2474
2474
|
});
|
|
2475
2475
|
const createAlphaModulateFixedEffect = (options) => {
|
|
2476
|
-
if (options?.
|
|
2476
|
+
if (options?.amount === void 0) return new BuilderElement({ name: "a:alphaModFix" });
|
|
2477
2477
|
return new BuilderElement({
|
|
2478
2478
|
name: "a:alphaModFix",
|
|
2479
2479
|
attributes: { amt: {
|
|
2480
2480
|
key: "amt",
|
|
2481
|
-
value: options.
|
|
2481
|
+
value: options.amount
|
|
2482
2482
|
} }
|
|
2483
2483
|
});
|
|
2484
2484
|
};
|
|
2485
2485
|
const createAlphaOutsetEffect = (options) => {
|
|
2486
|
-
if (options?.
|
|
2486
|
+
if (options?.radius === void 0) return new BuilderElement({ name: "a:alphaOutset" });
|
|
2487
2487
|
return new BuilderElement({
|
|
2488
2488
|
name: "a:alphaOutset",
|
|
2489
2489
|
attributes: { rad: {
|
|
2490
2490
|
key: "rad",
|
|
2491
|
-
value: options.
|
|
2491
|
+
value: options.radius
|
|
2492
2492
|
} }
|
|
2493
2493
|
});
|
|
2494
2494
|
};
|
|
@@ -2496,7 +2496,7 @@ const createAlphaReplaceEffect = (options) => new BuilderElement({
|
|
|
2496
2496
|
name: "a:alphaRepl",
|
|
2497
2497
|
attributes: { a: {
|
|
2498
2498
|
key: "a",
|
|
2499
|
-
value: options.
|
|
2499
|
+
value: options.alpha
|
|
2500
2500
|
} }
|
|
2501
2501
|
});
|
|
2502
2502
|
const createBiLevelEffect = (thresh) => new BuilderElement({
|
|
@@ -2562,8 +2562,8 @@ const createHSLEffect = (options) => {
|
|
|
2562
2562
|
name: "a:hsl",
|
|
2563
2563
|
attributes: buildOptionalAttributes({
|
|
2564
2564
|
hue: options?.hue,
|
|
2565
|
-
sat: options?.
|
|
2566
|
-
lum: options?.
|
|
2565
|
+
sat: options?.saturation,
|
|
2566
|
+
lum: options?.luminance
|
|
2567
2567
|
})
|
|
2568
2568
|
});
|
|
2569
2569
|
};
|
|
@@ -2581,7 +2581,7 @@ const createTintEffect = (options) => {
|
|
|
2581
2581
|
name: "a:tint",
|
|
2582
2582
|
attributes: buildOptionalAttributes({
|
|
2583
2583
|
hue: options?.hue,
|
|
2584
|
-
amt: options?.
|
|
2584
|
+
amt: options?.amount
|
|
2585
2585
|
})
|
|
2586
2586
|
});
|
|
2587
2587
|
};
|
|
@@ -2589,8 +2589,8 @@ const createRelativeOffsetEffect = (options) => {
|
|
|
2589
2589
|
return new BuilderElement({
|
|
2590
2590
|
name: "a:relOff",
|
|
2591
2591
|
attributes: buildOptionalAttributes({
|
|
2592
|
-
tx: options?.
|
|
2593
|
-
ty: options?.
|
|
2592
|
+
tx: options?.translateX,
|
|
2593
|
+
ty: options?.translateY
|
|
2594
2594
|
})
|
|
2595
2595
|
});
|
|
2596
2596
|
};
|
|
@@ -2598,12 +2598,12 @@ const createTransformEffect = (options) => {
|
|
|
2598
2598
|
return new BuilderElement({
|
|
2599
2599
|
name: "a:xfrm",
|
|
2600
2600
|
attributes: buildOptionalAttributes({
|
|
2601
|
-
sx: options?.
|
|
2602
|
-
sy: options?.
|
|
2603
|
-
kx: options?.
|
|
2604
|
-
ky: options?.
|
|
2605
|
-
tx: options?.
|
|
2606
|
-
ty: options?.
|
|
2601
|
+
sx: options?.scaleX,
|
|
2602
|
+
sy: options?.scaleY,
|
|
2603
|
+
kx: options?.skewX,
|
|
2604
|
+
ky: options?.skewY,
|
|
2605
|
+
tx: options?.translateX,
|
|
2606
|
+
ty: options?.translateY
|
|
2607
2607
|
})
|
|
2608
2608
|
});
|
|
2609
2609
|
};
|
|
@@ -2615,12 +2615,12 @@ const createEffectReference = (options) => new BuilderElement({
|
|
|
2615
2615
|
} }
|
|
2616
2616
|
});
|
|
2617
2617
|
const createBlurEffect = (options) => {
|
|
2618
|
-
if (!(options.
|
|
2618
|
+
if (!(options.radius !== void 0 || options.grow === false)) return new BuilderElement({ name: "a:blur" });
|
|
2619
2619
|
return new BuilderElement({
|
|
2620
2620
|
attributes: {
|
|
2621
|
-
...options.
|
|
2621
|
+
...options.radius !== void 0 && { rad: {
|
|
2622
2622
|
key: "rad",
|
|
2623
|
-
value: options.
|
|
2623
|
+
value: options.radius
|
|
2624
2624
|
} },
|
|
2625
2625
|
...options.grow === false && { grow: {
|
|
2626
2626
|
key: "grow",
|
|
@@ -2675,7 +2675,7 @@ const createEffectContainer = (options, elementName = "a:cont") => {
|
|
|
2675
2675
|
if (options.alphaModulateFixed) children.push(createAlphaModulateFixedEffect(options.alphaModulateFixed));
|
|
2676
2676
|
if (options.alphaOutset) children.push(createAlphaOutsetEffect(options.alphaOutset));
|
|
2677
2677
|
if (options.alphaReplace) children.push(createAlphaReplaceEffect(options.alphaReplace));
|
|
2678
|
-
if (options.biLevel) children.push(createBiLevelEffect(options.biLevel.
|
|
2678
|
+
if (options.biLevel) children.push(createBiLevelEffect(options.biLevel.threshold));
|
|
2679
2679
|
if (options.blend) children.push(createBlendEffect(options.blend));
|
|
2680
2680
|
if (options.colorChange) children.push(createColorChangeEffect(options.colorChange));
|
|
2681
2681
|
if (options.colorReplace) children.push(createColorReplaceEffect(options.colorReplace));
|
|
@@ -2703,14 +2703,14 @@ const createEffectContainer = (options, elementName = "a:cont") => {
|
|
|
2703
2703
|
* ```typescript
|
|
2704
2704
|
* // Simple effect DAG with glow and outer shadow
|
|
2705
2705
|
* createEffectDag({
|
|
2706
|
-
* glow: {
|
|
2707
|
-
* outerShadow: { color: { value: "000000" },
|
|
2706
|
+
* glow: { radius: 50800, color: { value: "FF0000" } },
|
|
2707
|
+
* outerShadow: { color: { value: "000000" }, blurRadius: 76200 },
|
|
2708
2708
|
* });
|
|
2709
2709
|
*
|
|
2710
2710
|
* // DAG with alpha effects and nested container
|
|
2711
2711
|
* createEffectDag({
|
|
2712
2712
|
* type: "tree",
|
|
2713
|
-
* alphaBiLevel: {
|
|
2713
|
+
* alphaBiLevel: { threshold: 50000 },
|
|
2714
2714
|
* containers: [{
|
|
2715
2715
|
* glow: { color: { value: "FF0000" } },
|
|
2716
2716
|
* }],
|
|
@@ -3222,19 +3222,19 @@ const createPathCommand = (cmd) => {
|
|
|
3222
3222
|
attributes: {
|
|
3223
3223
|
wR: {
|
|
3224
3224
|
key: "wR",
|
|
3225
|
-
value: cmd.
|
|
3225
|
+
value: cmd.widthRadius
|
|
3226
3226
|
},
|
|
3227
3227
|
hR: {
|
|
3228
3228
|
key: "hR",
|
|
3229
|
-
value: cmd.
|
|
3229
|
+
value: cmd.heightRadius
|
|
3230
3230
|
},
|
|
3231
3231
|
stAng: {
|
|
3232
3232
|
key: "stAng",
|
|
3233
|
-
value: cmd.
|
|
3233
|
+
value: cmd.startAngle
|
|
3234
3234
|
},
|
|
3235
3235
|
swAng: {
|
|
3236
3236
|
key: "swAng",
|
|
3237
|
-
value: cmd.
|
|
3237
|
+
value: cmd.sweepAngle
|
|
3238
3238
|
}
|
|
3239
3239
|
}
|
|
3240
3240
|
});
|
|
@@ -3316,9 +3316,9 @@ const createAdjustHandlePos = (position) => new BuilderElement({
|
|
|
3316
3316
|
});
|
|
3317
3317
|
const createXYAdjustHandle = (handle) => {
|
|
3318
3318
|
const attrs = {};
|
|
3319
|
-
if (handle.
|
|
3319
|
+
if (handle.guideRefX !== void 0) attrs.gdRefX = {
|
|
3320
3320
|
key: "gdRefX",
|
|
3321
|
-
value: handle.
|
|
3321
|
+
value: handle.guideRefX
|
|
3322
3322
|
};
|
|
3323
3323
|
if (handle.minX !== void 0) attrs.minX = {
|
|
3324
3324
|
key: "minX",
|
|
@@ -3328,9 +3328,9 @@ const createXYAdjustHandle = (handle) => {
|
|
|
3328
3328
|
key: "maxX",
|
|
3329
3329
|
value: handle.maxX
|
|
3330
3330
|
};
|
|
3331
|
-
if (handle.
|
|
3331
|
+
if (handle.guideRefY !== void 0) attrs.gdRefY = {
|
|
3332
3332
|
key: "gdRefY",
|
|
3333
|
-
value: handle.
|
|
3333
|
+
value: handle.guideRefY
|
|
3334
3334
|
};
|
|
3335
3335
|
if (handle.minY !== void 0) attrs.minY = {
|
|
3336
3336
|
key: "minY",
|
|
@@ -3348,29 +3348,29 @@ const createXYAdjustHandle = (handle) => {
|
|
|
3348
3348
|
};
|
|
3349
3349
|
const createPolarAdjustHandle = (handle) => {
|
|
3350
3350
|
const attrs = {};
|
|
3351
|
-
if (handle.
|
|
3351
|
+
if (handle.guideRefRadius !== void 0) attrs.gdRefR = {
|
|
3352
3352
|
key: "gdRefR",
|
|
3353
|
-
value: handle.
|
|
3353
|
+
value: handle.guideRefRadius
|
|
3354
3354
|
};
|
|
3355
|
-
if (handle.
|
|
3355
|
+
if (handle.minRadius !== void 0) attrs.minR = {
|
|
3356
3356
|
key: "minR",
|
|
3357
|
-
value: handle.
|
|
3357
|
+
value: handle.minRadius
|
|
3358
3358
|
};
|
|
3359
|
-
if (handle.
|
|
3359
|
+
if (handle.maxRadius !== void 0) attrs.maxR = {
|
|
3360
3360
|
key: "maxR",
|
|
3361
|
-
value: handle.
|
|
3361
|
+
value: handle.maxRadius
|
|
3362
3362
|
};
|
|
3363
|
-
if (handle.
|
|
3363
|
+
if (handle.guideRefAngle !== void 0) attrs.gdRefAng = {
|
|
3364
3364
|
key: "gdRefAng",
|
|
3365
|
-
value: handle.
|
|
3365
|
+
value: handle.guideRefAngle
|
|
3366
3366
|
};
|
|
3367
|
-
if (handle.
|
|
3367
|
+
if (handle.minAngle !== void 0) attrs.minAng = {
|
|
3368
3368
|
key: "minAng",
|
|
3369
|
-
value: handle.
|
|
3369
|
+
value: handle.minAngle
|
|
3370
3370
|
};
|
|
3371
|
-
if (handle.
|
|
3371
|
+
if (handle.maxAngle !== void 0) attrs.maxAng = {
|
|
3372
3372
|
key: "maxAng",
|
|
3373
|
-
value: handle.
|
|
3373
|
+
value: handle.maxAngle
|
|
3374
3374
|
};
|
|
3375
3375
|
return new BuilderElement({
|
|
3376
3376
|
name: "a:ahPolar",
|
|
@@ -3382,7 +3382,7 @@ const createConnectionSite = (site) => new BuilderElement({
|
|
|
3382
3382
|
name: "a:cxn",
|
|
3383
3383
|
attributes: { ang: {
|
|
3384
3384
|
key: "ang",
|
|
3385
|
-
value: site.
|
|
3385
|
+
value: site.angle
|
|
3386
3386
|
} },
|
|
3387
3387
|
children: [createAdjustHandlePos(site.position)]
|
|
3388
3388
|
});
|
|
@@ -3391,19 +3391,19 @@ const createGeomRect = (rect) => new BuilderElement({
|
|
|
3391
3391
|
attributes: {
|
|
3392
3392
|
l: {
|
|
3393
3393
|
key: "l",
|
|
3394
|
-
value: rect.
|
|
3394
|
+
value: rect.left
|
|
3395
3395
|
},
|
|
3396
3396
|
t: {
|
|
3397
3397
|
key: "t",
|
|
3398
|
-
value: rect.
|
|
3398
|
+
value: rect.top
|
|
3399
3399
|
},
|
|
3400
3400
|
r: {
|
|
3401
3401
|
key: "r",
|
|
3402
|
-
value: rect.
|
|
3402
|
+
value: rect.right
|
|
3403
3403
|
},
|
|
3404
3404
|
b: {
|
|
3405
3405
|
key: "b",
|
|
3406
|
-
value: rect.
|
|
3406
|
+
value: rect.bottom
|
|
3407
3407
|
}
|
|
3408
3408
|
}
|
|
3409
3409
|
});
|
|
@@ -3423,6 +3423,7 @@ const createGeomRect = (rect) => new BuilderElement({
|
|
|
3423
3423
|
* { command: "close" },
|
|
3424
3424
|
* ],
|
|
3425
3425
|
* }],
|
|
3426
|
+
* textRect: { left: "2000000", top: "2000000", right: "8000000", bottom: "8000000" },
|
|
3426
3427
|
* });
|
|
3427
3428
|
* ```
|
|
3428
3429
|
*/
|
|
@@ -3656,6 +3657,107 @@ const createBlipFill = (blipOptions, fillOptions) => {
|
|
|
3656
3657
|
});
|
|
3657
3658
|
};
|
|
3658
3659
|
//#endregion
|
|
3660
|
+
//#region src/drawingml/transform.ts
|
|
3661
|
+
/**
|
|
3662
|
+
* 2D transform for DrawingML shapes.
|
|
3663
|
+
*
|
|
3664
|
+
* This module provides factory functions for creating transform elements
|
|
3665
|
+
* (a:xfrm) used in shape properties, picture properties, and group shapes.
|
|
3666
|
+
*
|
|
3667
|
+
* Reference: ISO/IEC 29500-4, dml-main.xsd, CT_Transform2D / CT_GroupTransform2D
|
|
3668
|
+
*
|
|
3669
|
+
* @module
|
|
3670
|
+
*/
|
|
3671
|
+
function buildXfrmAttrs(options) {
|
|
3672
|
+
const attrs = {};
|
|
3673
|
+
if (options.flipHorizontal !== void 0) attrs.flipH = {
|
|
3674
|
+
key: "flipH",
|
|
3675
|
+
value: options.flipHorizontal
|
|
3676
|
+
};
|
|
3677
|
+
if (options.flipVertical !== void 0) attrs.flipV = {
|
|
3678
|
+
key: "flipV",
|
|
3679
|
+
value: options.flipVertical
|
|
3680
|
+
};
|
|
3681
|
+
if (options.rotation !== void 0) attrs.rot = {
|
|
3682
|
+
key: "rot",
|
|
3683
|
+
value: options.rotation
|
|
3684
|
+
};
|
|
3685
|
+
return Object.keys(attrs).length > 0 ? attrs : void 0;
|
|
3686
|
+
}
|
|
3687
|
+
/**
|
|
3688
|
+
* Creates a 2D transform element (a:xfrm).
|
|
3689
|
+
*
|
|
3690
|
+
* @param options - Transform options including position, size, rotation, and flip.
|
|
3691
|
+
* @param elementName - Element name, defaults to "a:xfrm".
|
|
3692
|
+
*/
|
|
3693
|
+
const createTransform2D = (options, elementName = "a:xfrm") => {
|
|
3694
|
+
const children = [];
|
|
3695
|
+
if (options.x !== void 0 || options.y !== void 0) children.push(new BuilderElement({
|
|
3696
|
+
name: "a:off",
|
|
3697
|
+
attributes: {
|
|
3698
|
+
x: {
|
|
3699
|
+
key: "x",
|
|
3700
|
+
value: options.x ?? 0
|
|
3701
|
+
},
|
|
3702
|
+
y: {
|
|
3703
|
+
key: "y",
|
|
3704
|
+
value: options.y ?? 0
|
|
3705
|
+
}
|
|
3706
|
+
}
|
|
3707
|
+
}));
|
|
3708
|
+
if (options.width !== void 0 || options.height !== void 0) children.push(new BuilderElement({
|
|
3709
|
+
name: "a:ext",
|
|
3710
|
+
attributes: {
|
|
3711
|
+
cx: {
|
|
3712
|
+
key: "cx",
|
|
3713
|
+
value: options.width ?? 0
|
|
3714
|
+
},
|
|
3715
|
+
cy: {
|
|
3716
|
+
key: "cy",
|
|
3717
|
+
value: options.height ?? 0
|
|
3718
|
+
}
|
|
3719
|
+
}
|
|
3720
|
+
}));
|
|
3721
|
+
return new BuilderElement({
|
|
3722
|
+
name: elementName,
|
|
3723
|
+
attributes: buildXfrmAttrs(options),
|
|
3724
|
+
children: children.length > 0 ? children : void 0
|
|
3725
|
+
});
|
|
3726
|
+
};
|
|
3727
|
+
/**
|
|
3728
|
+
* Creates a group transform element (a:xfrm with chOff/chExt children).
|
|
3729
|
+
*/
|
|
3730
|
+
const createGroupTransform2D = (options, elementName = "a:xfrm") => {
|
|
3731
|
+
const base = createTransform2D(options, elementName);
|
|
3732
|
+
base["root"].push(new BuilderElement({
|
|
3733
|
+
name: "a:chOff",
|
|
3734
|
+
attributes: {
|
|
3735
|
+
x: {
|
|
3736
|
+
key: "x",
|
|
3737
|
+
value: options.childOffsetX ?? 0
|
|
3738
|
+
},
|
|
3739
|
+
y: {
|
|
3740
|
+
key: "y",
|
|
3741
|
+
value: options.childOffsetY ?? 0
|
|
3742
|
+
}
|
|
3743
|
+
}
|
|
3744
|
+
}));
|
|
3745
|
+
base["root"].push(new BuilderElement({
|
|
3746
|
+
name: "a:chExt",
|
|
3747
|
+
attributes: {
|
|
3748
|
+
cx: {
|
|
3749
|
+
key: "cx",
|
|
3750
|
+
value: options.childExtentWidth ?? 0
|
|
3751
|
+
},
|
|
3752
|
+
cy: {
|
|
3753
|
+
key: "cy",
|
|
3754
|
+
value: options.childExtentHeight ?? 0
|
|
3755
|
+
}
|
|
3756
|
+
}
|
|
3757
|
+
}));
|
|
3758
|
+
return base;
|
|
3759
|
+
};
|
|
3760
|
+
//#endregion
|
|
3659
3761
|
//#region src/drawingml/media/transformation.ts
|
|
3660
3762
|
/**
|
|
3661
3763
|
* Media transformation utilities for DrawingML.
|
|
@@ -3695,4 +3797,4 @@ const createTransformation = (options) => ({
|
|
|
3695
3797
|
rotation: options.rotation ? options.rotation * 6e4 : void 0
|
|
3696
3798
|
});
|
|
3697
3799
|
//#endregion
|
|
3698
|
-
export { BevelPresetType, BlendMode, CompoundLine, LineCap, LineEndLength, LineEndType, LineEndWidth, LineJoin, PathShadeType, PenAlignment, PresetColor, PresetDash, PresetGeometry, PresetGeometryAttributes, PresetMaterialType, PresetPattern, PresetShadowVal, RectAlignment, SchemeColor, Stretch, SystemColor, TileAlignment, TileFlipMode, buildFill, createAdjustmentValues, createBevel, createBlip, createBlipEffects, createBlipFill, createBottomBevel, createColorElement, createColorTransforms, createCustomDash, createCustomGeometry, createEffectDag, createEffectList, createExtentionList, createFillOverlayEffect, createGlowEffect, createGradientFill, createGradientStop, createGroupFill, createHslColor, createInnerShadowEffect, createLineEnd, createNoFill, createOuterShadowEffect, createOutline, createPatternFill, createPresetColor, createPresetShadowEffect, createReflectionEffect, createRgbColor, createScRgbColor, createScene3D, createSchemeColor, createShape3D, createSoftEdgeEffect, createSolidFill, createSourceRectangle, createSystemColor, createTileInfo, createTransformation, extractBlipFillMedia };
|
|
3800
|
+
export { BevelPresetType, BlendMode, CompoundLine, LineCap, LineEndLength, LineEndType, LineEndWidth, LineJoin, PathShadeType, PenAlignment, PresetColor, PresetDash, PresetGeometry, PresetGeometryAttributes, PresetMaterialType, PresetPattern, PresetShadowVal, RectAlignment, SchemeColor, Stretch, SystemColor, TileAlignment, TileFlipMode, buildFill, createAdjustmentValues, createBevel, createBlip, createBlipEffects, createBlipFill, createBottomBevel, createColorElement, createColorTransforms, createCustomDash, createCustomGeometry, createEffectDag, createEffectList, createExtentionList, createFillOverlayEffect, createGlowEffect, createGradientFill, createGradientStop, createGroupFill, createGroupTransform2D, createHslColor, createInnerShadowEffect, createLineEnd, createNoFill, createOuterShadowEffect, createOutline, createPatternFill, createPresetColor, createPresetShadowEffect, createReflectionEffect, createRgbColor, createScRgbColor, createScene3D, createSchemeColor, createShape3D, createSoftEdgeEffect, createSolidFill, createSourceRectangle, createSystemColor, createTileInfo, createTransform2D, createTransformation, extractBlipFillMedia };
|