pptx-kit-preview 0.3.0 → 0.3.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/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/node.js +5 -3
- package/dist/node.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getSlideSize, getPresentationTheme, getEffectiveColorMap, getSlideBackground, getSlideLayout, getSlideLayoutBackground, getSlideMasterBackground, getSlideBackgroundGradientFill, getSlideLayoutBackgroundGradientFill, getSlideMasterBackgroundGradientFill, getSlideBackgroundPatternFill, getSlideLayoutBackgroundPatternFill, getSlideMasterBackgroundPatternFill, getSlideBackgroundImageBytes, getSlideLayoutBackgroundImageBytes, getSlideMasterBackgroundImageBytes, getSlideMasterShapes, getSlideLayoutShapes, getSlideShapes, getShapeBoundsResolved, getShapeKind, getShapeFillEffective, getShapeStrokeEffective, getShapeRotation, getShapeFlip, getShapePlaceholderType, getShapeImageFormat, getShapeImageBytes, getShapeImageFillBytes, getShapePreset, getGroupTransform, getGroupChildren, isChartShape, isTableShape, getTableDimensions, getShapeCustomGeometry, getShapeXmlString, getShapeAdjustValues, getShapeHyperlink, getShapeHyperlinkTooltip, getShapeName, getShapeAltTitle, getShapeDescription, getShapeClickAction, getSlideIndex, getShapeParagraphCount, getPresentationFonts, getShapeBodyPrEffective, getShapeTextMargins, getShapeTextDirection, getShapeTextAnchor, isShapePlaceholder, isShapeTextBox, getParagraphPropertiesEffective, getParagraphLevel, getParagraphAlignment, getParagraphBullet, getParagraphBulletStyle, isParagraphBulletPicture, getParagraphBulletImageBytes, getParagraphSpacing, getParagraphIndent, getShapeParagraphElements, getShapeRunFormatEffective, getShapeRunFormat, getShapeRunHyperlink, getShapeRunClickAction, getShapeRunHyperlinkTooltip, getShapeTextAutoFitParams, getShapeTextColumns, getShapeTextBodyRotationDeg, getShapeImagePartName, getShapeImageCrop, getShapeImageBrightness, getShapeImageContrast, getShapeImageOpacity, isShapeImageGrayscale, getShapeImageBiLevelThreshold, getShapeImageDuotone, getShapeImageLinkUrl, getShapeFillColorResolved, getShapeGradientFillEffective, getShapeGradientFill, getShapePatternFill, getShapeStrokeColorResolved, getShapeStrokeDash, getShapeStrokeCap, getShapeStrokeJoin, getShapeStrokeCompound, getShapeStrokeArrow, getShapeChartSpec, getTableColumnWidths, getTableRowHeights, getTableCells, getTableStyleFlags, getTableCellSpan, getTableCellFill, getTableCellBorders, getTableCellParagraphs, getTableCellAnchor, getTableCellMargins, getShapeEffectsEffective } from 'pptx-kit';
|
|
1
|
+
import { getSlideSize, getPresentationTheme, getEffectiveColorMap, resolveDeckBodyTextColor, getSlideBackground, getSlideLayout, getSlideLayoutBackground, getSlideMasterBackground, getSlideBackgroundGradientFill, getSlideLayoutBackgroundGradientFill, getSlideMasterBackgroundGradientFill, getSlideBackgroundPatternFill, getSlideLayoutBackgroundPatternFill, getSlideMasterBackgroundPatternFill, getSlideBackgroundImageBytes, getSlideLayoutBackgroundImageBytes, getSlideMasterBackgroundImageBytes, getSlideMasterShapes, getSlideLayoutShapes, getSlideShapes, getShapeBoundsResolved, getShapeKind, getShapeFillEffective, getShapeStrokeEffective, getShapeRotation, getShapeFlip, getShapePlaceholderType, getShapeImageFormat, getShapeImageBytes, getShapeImageFillBytes, getShapePreset, getGroupTransform, getGroupChildren, isChartShape, isTableShape, getTableDimensions, getShapeCustomGeometry, getShapeXmlString, getShapeAdjustValues, getShapeHyperlink, getShapeHyperlinkTooltip, getShapeName, getShapeAltTitle, getShapeDescription, getShapeClickAction, getSlideIndex, getShapeParagraphCount, getPresentationFonts, getShapeBodyPrEffective, getShapeTextMargins, getShapeTextDirection, getShapeTextAnchor, isShapePlaceholder, isShapeTextBox, getParagraphPropertiesEffective, getParagraphLevel, getParagraphAlignment, getParagraphBullet, getParagraphBulletStyle, isParagraphBulletPicture, getParagraphBulletImageBytes, getParagraphSpacing, getParagraphIndent, getShapeParagraphElements, getShapeRunFormatEffective, getShapeRunFormat, getShapeRunHyperlink, getShapeRunClickAction, getShapeRunHyperlinkTooltip, getShapeTextAutoFitParams, getShapeTextColumns, getShapeTextBodyRotationDeg, getShapeImagePartName, getShapeImageCrop, getShapeImageBrightness, getShapeImageContrast, getShapeImageOpacity, isShapeImageGrayscale, getShapeImageBiLevelThreshold, getShapeImageDuotone, getShapeImageLinkUrl, getShapeFillColorResolved, getShapeGradientFillEffective, getShapeGradientFill, getShapePatternFill, getShapeStrokeColorResolved, getShapeStrokeDash, getShapeStrokeCap, getShapeStrokeJoin, getShapeStrokeCompound, getShapeStrokeArrow, getShapeChartSpec, getTableColumnWidths, getTableRowHeights, getTableCells, getTableStyleFlags, getTableCellSpan, getTableCellFill, getTableCellBorders, getTableCellParagraphs, getTableCellAnchor, getTableCellMargins, getShapeEffectsEffective } from 'pptx-kit';
|
|
2
2
|
|
|
3
3
|
// src/render-slide.ts
|
|
4
4
|
|
|
@@ -560,6 +560,7 @@ var resolveColor = (c, theme, fallback = "#1F2937") => {
|
|
|
560
560
|
var nextDefId = 0;
|
|
561
561
|
var mintId = () => `pkdef-${(nextDefId++).toString(36)}`;
|
|
562
562
|
var activeColorMap = null;
|
|
563
|
+
var activeDeckTextColor = "#000000";
|
|
563
564
|
var gradientDef = (grad, theme) => {
|
|
564
565
|
const id = mintId();
|
|
565
566
|
const stops = grad.stops.map(
|
|
@@ -2321,7 +2322,7 @@ var renderTextBody = (pres, shape, bounds, theme, phType, ctx) => {
|
|
|
2321
2322
|
);
|
|
2322
2323
|
}
|
|
2323
2324
|
const justify = ANCHOR_TO_CSS[anchor] ?? "flex-start";
|
|
2324
|
-
const defaultColor =
|
|
2325
|
+
const defaultColor = activeDeckTextColor;
|
|
2325
2326
|
if (ctx.mode === "svg") {
|
|
2326
2327
|
const svgScale = authoredAutofit?.fontScale ?? 1;
|
|
2327
2328
|
const svgLineScale = 1 - (authoredAutofit?.lnSpcReduction ?? 0);
|
|
@@ -3879,7 +3880,7 @@ var renderTable = (shape, pres, x, y, w, h, transform, theme, ctx) => {
|
|
|
3879
3880
|
const accent = theme ? normalizeHex(theme.accent1) : "#4472C4";
|
|
3880
3881
|
const headerFill = accent;
|
|
3881
3882
|
const bandFill = mixHex(accent, "#FFFFFF", 0.92);
|
|
3882
|
-
const textColor =
|
|
3883
|
+
const textColor = activeDeckTextColor;
|
|
3883
3884
|
const tableThemeFace = getPresentationFonts(pres)?.minorLatin ?? null;
|
|
3884
3885
|
const out = [];
|
|
3885
3886
|
out.push(`<g${transform}>`);
|
|
@@ -4459,6 +4460,7 @@ var renderSlideSvg = (pres, slide, opts = {}) => {
|
|
|
4459
4460
|
const H = size.height;
|
|
4460
4461
|
const theme = getPresentationTheme(pres);
|
|
4461
4462
|
activeColorMap = getEffectiveColorMap(slide);
|
|
4463
|
+
activeDeckTextColor = resolveDeckBodyTextColor(slide) ?? "#000000";
|
|
4462
4464
|
const ctx = {
|
|
4463
4465
|
mode: opts.textLayout ?? "foreignObject",
|
|
4464
4466
|
measure: opts.measureText ?? defaultMeasurer
|