ooxml-core 1.40.0 → 1.41.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/dist/{PptxHandler-2WYH66TS.mjs → PptxHandler-3AGIITR7.mjs} +2 -2
- package/dist/PptxHandler-EL4E4SPH.mjs +5 -0
- package/dist/PptxHandler-OIZ3R3DJ.cjs +14 -0
- package/dist/{PresentationBuilder-RTHLLHLE.mjs → PresentationBuilder-5DPKFUXP.mjs} +3 -3
- package/dist/{PresentationBuilder-VHDHLGIK.mjs → PresentationBuilder-JNID4B4Z.mjs} +2 -2
- package/dist/{PresentationBuilder-BUUVVMNI.cjs → PresentationBuilder-MZBKYOYD.cjs} +6 -6
- package/dist/automation/index.cjs +5336 -3452
- package/dist/automation/index.mjs +5336 -3452
- package/dist/{chunk-U6FMLGWH.cjs → chunk-3BIFRTU4.cjs} +1300 -1269
- package/dist/{chunk-HLBIT5H4.mjs → chunk-6LGRRQ3K.mjs} +1 -1
- package/dist/{chunk-SEGPDD5W.cjs → chunk-75KBNUKS.cjs} +4932 -3048
- package/dist/{chunk-AZNF3IOI.mjs → chunk-DD7COXWR.mjs} +69 -5
- package/dist/{chunk-NHV47JOE.mjs → chunk-HTELXT2N.mjs} +36 -5
- package/dist/{chunk-OGD5OQK2.mjs → chunk-JXR6YWBW.mjs} +6689 -4805
- package/dist/{chunk-3E4GSBC7.mjs → chunk-KKVD3R6O.mjs} +4 -4
- package/dist/{chunk-EXSPNK6W.cjs → chunk-LRBWCRQ3.cjs} +3 -3
- package/dist/{chunk-6XAAJTA3.mjs → chunk-P3WAKBVS.mjs} +4932 -3048
- package/dist/{chunk-5BVSDSJZ.mjs → chunk-UE23HF2N.mjs} +1 -1
- package/dist/{chunk-725QJW4K.mjs → chunk-ZYCBJKAE.mjs} +1 -1
- package/dist/color/index.cjs +36 -0
- package/dist/color/index.d.ts +1 -0
- package/dist/color/index.d.ts.map +1 -1
- package/dist/color/index.mjs +35 -1
- package/dist/color/office-gradient-stops.d.ts +27 -0
- package/dist/color/office-gradient-stops.d.ts.map +1 -0
- package/dist/diagram/index.cjs +4858 -2934
- package/dist/diagram/index.mjs +4858 -2935
- package/dist/docx/embedded.cjs +4884 -3000
- package/dist/docx/embedded.mjs +4884 -3000
- package/dist/docx/index.cjs +4942 -3056
- package/dist/docx/index.mjs +4942 -3056
- package/dist/docx/layout/index.cjs +4924 -3038
- package/dist/docx/layout/index.mjs +4924 -3038
- package/dist/docx/load/index.cjs +5021 -3137
- package/dist/docx/load/index.mjs +5021 -3137
- package/dist/docx/ui/index.cjs +4925 -3041
- package/dist/docx/ui/index.mjs +4925 -3041
- package/dist/drawingml/index.cjs +76 -16
- package/dist/drawingml/index.mjs +76 -17
- package/dist/drawingml/path-data.d.ts.map +1 -1
- package/dist/drawingml/rect-path-gradient.d.ts +12 -0
- package/dist/drawingml/rect-path-gradient.d.ts.map +1 -1
- package/dist/geometry/index.cjs +4138 -2253
- package/dist/geometry/index.mjs +4138 -2254
- package/dist/geometry/ooxml-arc.d.ts +10 -1
- package/dist/geometry/ooxml-arc.d.ts.map +1 -1
- package/dist/geometry/preset-shape-definitions-action-buttons.d.ts +7 -36
- package/dist/geometry/preset-shape-definitions-action-buttons.d.ts.map +1 -1
- package/dist/geometry/preset-shape-definitions-connectors-brackets.d.ts.map +1 -1
- package/dist/geometry/preset-shape-definitions-exact-action-buttons.d.ts +19 -0
- package/dist/geometry/preset-shape-definitions-exact-action-buttons.d.ts.map +1 -0
- package/dist/geometry/preset-shape-definitions-exact-arcs.d.ts +14 -0
- package/dist/geometry/preset-shape-definitions-exact-arcs.d.ts.map +1 -0
- package/dist/geometry/preset-shape-definitions-exact-arrows.d.ts +11 -0
- package/dist/geometry/preset-shape-definitions-exact-arrows.d.ts.map +1 -0
- package/dist/geometry/preset-shape-definitions-exact-basic.d.ts +12 -0
- package/dist/geometry/preset-shape-definitions-exact-basic.d.ts.map +1 -0
- package/dist/geometry/preset-shape-definitions-exact-circular.d.ts +18 -0
- package/dist/geometry/preset-shape-definitions-exact-circular.d.ts.map +1 -0
- package/dist/geometry/preset-shape-definitions-exact-ellipse-ribbons.d.ts +16 -0
- package/dist/geometry/preset-shape-definitions-exact-ellipse-ribbons.d.ts.map +1 -0
- package/dist/geometry/preset-shape-definitions-exact-funnel.d.ts +13 -0
- package/dist/geometry/preset-shape-definitions-exact-funnel.d.ts.map +1 -0
- package/dist/geometry/preset-shape-definitions-exact-left-right-ribbon.d.ts +13 -0
- package/dist/geometry/preset-shape-definitions-exact-left-right-ribbon.d.ts.map +1 -0
- package/dist/geometry/preset-shape-definitions-exact-math.d.ts +14 -0
- package/dist/geometry/preset-shape-definitions-exact-math.d.ts.map +1 -0
- package/dist/geometry/preset-shape-definitions-exact-misc.d.ts +11 -0
- package/dist/geometry/preset-shape-definitions-exact-misc.d.ts.map +1 -0
- package/dist/geometry/preset-shape-definitions-exact-ribbons.d.ts +12 -0
- package/dist/geometry/preset-shape-definitions-exact-ribbons.d.ts.map +1 -0
- package/dist/geometry/preset-shape-definitions-exact-scrolls.d.ts +13 -0
- package/dist/geometry/preset-shape-definitions-exact-scrolls.d.ts.map +1 -0
- package/dist/geometry/preset-shape-definitions-flowchart.d.ts.map +1 -1
- package/dist/geometry/preset-shape-definitions-misc.d.ts.map +1 -1
- package/dist/geometry/preset-shape-definitions-table.d.ts.map +1 -1
- package/dist/geometry/preset-shape-exact-dsl.d.ts +30 -0
- package/dist/geometry/preset-shape-exact-dsl.d.ts.map +1 -0
- package/dist/index.cjs +7091 -4867
- package/dist/index.mjs +7091 -4867
- package/dist/pptx/automation/index.cjs +5419 -3408
- package/dist/pptx/automation/index.d.ts +5 -5
- package/dist/pptx/automation/index.mjs +5 -5
- package/dist/pptx/chunks/{elements-DheCTwi0.d.ts → elements-6BMEOo7i.d.ts} +27 -2
- package/dist/pptx/chunks/{elements-DheCTwi0.d.ts.map → elements-6BMEOo7i.d.ts.map} +1 -1
- package/dist/pptx/chunks/{index-Jcce8TlI.d.ts → index-BbXLv6As.d.ts} +4 -4
- package/dist/pptx/chunks/{index-Jcce8TlI.d.ts.map → index-BbXLv6As.d.ts.map} +1 -1
- package/dist/pptx/chunks/{index-B4ofjG6_.d.ts → index-Dija_Wth.d.ts} +3 -3
- package/dist/pptx/chunks/{index-B4ofjG6_.d.ts.map → index-Dija_Wth.d.ts.map} +1 -1
- package/dist/pptx/chunks/{index-CYukxWbl.d.ts → index-DvN0TkJJ.d.ts} +23 -8
- package/dist/pptx/chunks/index-DvN0TkJJ.d.ts.map +1 -0
- package/dist/pptx/chunks/{text-operations-CdgEnFuK.d.ts → text-operations-DorONr3h.d.ts} +2 -2
- package/dist/pptx/chunks/{text-operations-CdgEnFuK.d.ts.map → text-operations-DorONr3h.d.ts.map} +1 -1
- package/dist/pptx/cli/index.cjs +5341 -3330
- package/dist/pptx/cli/index.d.ts +1 -1
- package/dist/pptx/cli/index.mjs +4 -4
- package/dist/pptx/converter/index.cjs +4958 -2978
- package/dist/pptx/converter/index.d.ts +1 -1
- package/dist/pptx/converter/index.mjs +2 -2
- package/dist/pptx/editor/render/custom-show-operations.cjs +2 -2
- package/dist/pptx/editor/render/custom-show-operations.mjs +1 -1
- package/dist/pptx/editor/render/find-replace.cjs +15 -15
- package/dist/pptx/editor/render/find-replace.d.ts +2 -2
- package/dist/pptx/editor/render/find-replace.mjs +2 -2
- package/dist/pptx/editor/render/slide-operations.cjs +9 -9
- package/dist/pptx/editor/render/slide-operations.mjs +3 -3
- package/dist/pptx/editor/render/text-runs-style-patch.d.ts +1 -1
- package/dist/pptx/editor/render/text-style-scope.d.ts +1 -1
- package/dist/pptx/index.cjs +7176 -5125
- package/dist/pptx/index.d.ts +6 -6
- package/dist/pptx/index.mjs +5 -5
- package/dist/pptx/node/index.d.ts +1 -1
- package/dist/teams/index.cjs +5287 -3307
- package/dist/teams/index.mjs +5287 -3307
- package/dist/text/font-metrics/office-font-metrics.generated.d.ts +23 -0
- package/dist/text/font-metrics/office-font-metrics.generated.d.ts.map +1 -0
- package/dist/text/font-metrics/vertical-metrics.d.ts +35 -0
- package/dist/text/font-metrics/vertical-metrics.d.ts.map +1 -0
- package/dist/text/index.cjs +260 -0
- package/dist/text/index.d.ts +1 -0
- package/dist/text/index.d.ts.map +1 -1
- package/dist/text/index.mjs +259 -1
- package/dist/xlsx/collab/index.cjs +5106 -3222
- package/dist/xlsx/collab/index.mjs +5106 -3222
- package/dist/xlsx/index.cjs +5272 -3386
- package/dist/xlsx/index.mjs +5272 -3386
- package/dist/xlsx/load/index.cjs +5125 -3241
- package/dist/xlsx/load/index.mjs +5125 -3241
- package/dist/xlsx/ui/index.cjs +5279 -3395
- package/dist/xlsx/ui/index.mjs +5279 -3395
- package/package.json +1 -1
- package/dist/PptxHandler-SD6VWF3I.mjs +0 -5
- package/dist/PptxHandler-ZHWWOO2X.cjs +0 -14
- package/dist/pptx/chunks/index-CYukxWbl.d.ts.map +0 -1
package/dist/color/index.cjs
CHANGED
|
@@ -601,6 +601,40 @@ function straightAlphaGradientStops(stops) {
|
|
|
601
601
|
return out;
|
|
602
602
|
}
|
|
603
603
|
|
|
604
|
+
// color/office-gradient-stops.ts
|
|
605
|
+
var SIGMA_SAMPLE_STEP = 8;
|
|
606
|
+
function round42(value) {
|
|
607
|
+
return Math.round(value * 1e4) / 1e4;
|
|
608
|
+
}
|
|
609
|
+
function officeTwoStopGradientStops(stops) {
|
|
610
|
+
const [from, to] = stops;
|
|
611
|
+
if (stops.length !== 2 || !from || !to || from.position !== 0 || to.position !== 100) {
|
|
612
|
+
return void 0;
|
|
613
|
+
}
|
|
614
|
+
const a = hexToRgbChannels(from.color);
|
|
615
|
+
const b = hexToRgbChannels(to.color);
|
|
616
|
+
if (!a || !b || a.r === b.r && a.g === b.g && a.b === b.b) return void 0;
|
|
617
|
+
const fromAlpha = from.opacity ?? 1;
|
|
618
|
+
const toAlpha = to.opacity ?? 1;
|
|
619
|
+
const last = OFFICE_SIGMA_FACTORS.length - 1;
|
|
620
|
+
const indices = [];
|
|
621
|
+
for (let index = 0; index < last; index += SIGMA_SAMPLE_STEP) indices.push(index);
|
|
622
|
+
indices.push(last);
|
|
623
|
+
return indices.map((index) => {
|
|
624
|
+
const t = index / last;
|
|
625
|
+
const weight = (OFFICE_SIGMA_FACTORS[index] ?? 0) / 65536;
|
|
626
|
+
const mix = (x, y) => toHex(255 * ((x / 255) ** 2.2 * (1 - weight) + (y / 255) ** 2.2 * weight) ** (1 / 2.2));
|
|
627
|
+
return {
|
|
628
|
+
color: `#${mix(a.r, b.r)}${mix(a.g, b.g)}${mix(a.b, b.b)}`,
|
|
629
|
+
position: round42(t * 100),
|
|
630
|
+
...fromAlpha === 1 && toAlpha === 1 ? {} : { opacity: round42(fromAlpha + (toAlpha - fromAlpha) * t) }
|
|
631
|
+
};
|
|
632
|
+
});
|
|
633
|
+
}
|
|
634
|
+
function officeGradientStops(stops) {
|
|
635
|
+
return officeTwoStopGradientStops(stops) ?? straightAlphaGradientStops(stops);
|
|
636
|
+
}
|
|
637
|
+
|
|
604
638
|
exports.OFFICE_STANDARD_COLORS = OFFICE_STANDARD_COLORS;
|
|
605
639
|
exports.OFFICE_THEME_PALETTE_COLORS = OFFICE_THEME_PALETTE_COLORS;
|
|
606
640
|
exports.THEME_PALETTE_COLUMN_NAMES = THEME_PALETTE_COLUMN_NAMES;
|
|
@@ -617,6 +651,8 @@ exports.hslToRgb = hslToRgb;
|
|
|
617
651
|
exports.linearToSrgb255 = linearToSrgb255;
|
|
618
652
|
exports.normalizeHexColor = normalizeHexColor;
|
|
619
653
|
exports.normalizePaletteHex = normalizePaletteHex;
|
|
654
|
+
exports.officeGradientStops = officeGradientStops;
|
|
655
|
+
exports.officeTwoStopGradientStops = officeTwoStopGradientStops;
|
|
620
656
|
exports.parseArgbHex = parseArgbHex;
|
|
621
657
|
exports.parseDrawingFraction = parseDrawingFraction;
|
|
622
658
|
exports.parseDrawingHueDegrees = parseDrawingHueDegrees;
|
package/dist/color/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../color/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../color/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC"}
|
package/dist/color/index.mjs
CHANGED
|
@@ -599,4 +599,38 @@ function straightAlphaGradientStops(stops) {
|
|
|
599
599
|
return out;
|
|
600
600
|
}
|
|
601
601
|
|
|
602
|
-
|
|
602
|
+
// color/office-gradient-stops.ts
|
|
603
|
+
var SIGMA_SAMPLE_STEP = 8;
|
|
604
|
+
function round42(value) {
|
|
605
|
+
return Math.round(value * 1e4) / 1e4;
|
|
606
|
+
}
|
|
607
|
+
function officeTwoStopGradientStops(stops) {
|
|
608
|
+
const [from, to] = stops;
|
|
609
|
+
if (stops.length !== 2 || !from || !to || from.position !== 0 || to.position !== 100) {
|
|
610
|
+
return void 0;
|
|
611
|
+
}
|
|
612
|
+
const a = hexToRgbChannels(from.color);
|
|
613
|
+
const b = hexToRgbChannels(to.color);
|
|
614
|
+
if (!a || !b || a.r === b.r && a.g === b.g && a.b === b.b) return void 0;
|
|
615
|
+
const fromAlpha = from.opacity ?? 1;
|
|
616
|
+
const toAlpha = to.opacity ?? 1;
|
|
617
|
+
const last = OFFICE_SIGMA_FACTORS.length - 1;
|
|
618
|
+
const indices = [];
|
|
619
|
+
for (let index = 0; index < last; index += SIGMA_SAMPLE_STEP) indices.push(index);
|
|
620
|
+
indices.push(last);
|
|
621
|
+
return indices.map((index) => {
|
|
622
|
+
const t = index / last;
|
|
623
|
+
const weight = (OFFICE_SIGMA_FACTORS[index] ?? 0) / 65536;
|
|
624
|
+
const mix = (x, y) => toHex(255 * ((x / 255) ** 2.2 * (1 - weight) + (y / 255) ** 2.2 * weight) ** (1 / 2.2));
|
|
625
|
+
return {
|
|
626
|
+
color: `#${mix(a.r, b.r)}${mix(a.g, b.g)}${mix(a.b, b.b)}`,
|
|
627
|
+
position: round42(t * 100),
|
|
628
|
+
...fromAlpha === 1 && toAlpha === 1 ? {} : { opacity: round42(fromAlpha + (toAlpha - fromAlpha) * t) }
|
|
629
|
+
};
|
|
630
|
+
});
|
|
631
|
+
}
|
|
632
|
+
function officeGradientStops(stops) {
|
|
633
|
+
return officeTwoStopGradientStops(stops) ?? straightAlphaGradientStops(stops);
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
export { OFFICE_STANDARD_COLORS, OFFICE_THEME_PALETTE_COLORS, THEME_PALETTE_COLUMN_NAMES, applyThemePaletteVariant, blendColorOntoWhite, buildThemePalette, clampUnitInterval, colorWithOpacity, contrastTextColor, describeThemePaletteSwatch, hexToRgbChannels, hexToRgbUnit, hslToRgb, linearToSrgb255, normalizeHexColor, normalizePaletteHex, officeGradientStops, officeTwoStopGradientStops, parseArgbHex, parseDrawingFraction, parseDrawingHueDegrees, parseDrawingPercent, parseHex, parseOoxmlPercent, pushRecentColor, rgbToHsl, rgbToUpperHex, scrgbLinearToSrgb8, sigmaGradientStops, srgb255ToLinear, straightAlphaGradientStops, themePaletteVariantLuminance, themePaletteVariantsForLuminance, toHex };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type StraightAlphaStop } from './straight-alpha-stops.js';
|
|
2
|
+
/**
|
|
3
|
+
* Office's paint for a two-stop gradient whose stops sit at 0% and 100%, as
|
|
4
|
+
* stops a plain sRGB interpolator can reproduce.
|
|
5
|
+
*
|
|
6
|
+
* Measured in PowerPoint 16 (COM `Slide.Export`): such a gradient is not a
|
|
7
|
+
* linear sRGB blend. The colour weight follows the GDI+ sigma bell curve
|
|
8
|
+
* (`OFFICE_SIGMA_FACTORS`) and the blend happens in gamma 2.2 light, so a
|
|
9
|
+
* white to black ramp is already 186 (not 128) at the midpoint and 236 (not
|
|
10
|
+
* 189) a quarter in. The same holds for linear (scaled or not), circle, rect
|
|
11
|
+
* and shape paths, with or without alpha; alpha itself stays a straight linear
|
|
12
|
+
* ramp. Gradients with three or more stops, or two stops that do not span the
|
|
13
|
+
* full range, are blended plainly in sRGB per segment.
|
|
14
|
+
*
|
|
15
|
+
* Returns `undefined` when the stops are not such a pair, or when the colour
|
|
16
|
+
* does not change (only alpha varies, which a plain interpolator already draws
|
|
17
|
+
* correctly).
|
|
18
|
+
*/
|
|
19
|
+
export declare function officeTwoStopGradientStops(stops: readonly StraightAlphaStop[]): StraightAlphaStop[] | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Stops that make a CSS gradient (premultiplied, plain sRGB) paint what Office
|
|
22
|
+
* paints: the two-stop sigma profile when it applies, else the straight-alpha
|
|
23
|
+
* re-sampling. The sigma samples are dense enough that premultiplied blending
|
|
24
|
+
* between neighbours stays within a level of the straight ramp.
|
|
25
|
+
*/
|
|
26
|
+
export declare function officeGradientStops(stops: readonly StraightAlphaStop[]): StraightAlphaStop[];
|
|
27
|
+
//# sourceMappingURL=office-gradient-stops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"office-gradient-stops.d.ts","sourceRoot":"","sources":["../../color/office-gradient-stops.ts"],"names":[],"mappings":"AAEA,OAAO,EAA8B,KAAK,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAS5F;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,0BAA0B,CACzC,KAAK,EAAE,SAAS,iBAAiB,EAAE,GACjC,iBAAiB,EAAE,GAAG,SAAS,CA2BjC;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,iBAAiB,EAAE,GAAG,iBAAiB,EAAE,CAE5F"}
|