pptx-react-viewer 3.0.3 → 3.1.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/CHANGELOG.md +19 -0
- package/dist/{AiChatPanel-DYOBY6OG.mjs → AiChatPanel-5LCCN7FG.mjs} +4 -4
- package/dist/AiChatPanel-5LCCN7FG.mjs.br +0 -0
- package/dist/AiChatPanel-5LCCN7FG.mjs.gz +0 -0
- package/dist/{AiChatPanel-235ZZA3Y.js → AiChatPanel-WVORGKRT.js} +24 -24
- package/dist/AiChatPanel-WVORGKRT.js.br +0 -0
- package/dist/AiChatPanel-WVORGKRT.js.gz +0 -0
- package/dist/Area3DChartScene-DY5CSLE2.js +47 -0
- package/dist/Area3DChartScene-DY5CSLE2.js.br +0 -0
- package/dist/Area3DChartScene-DY5CSLE2.js.gz +0 -0
- package/dist/Area3DChartScene-W6UZTRDP.mjs +45 -0
- package/dist/Area3DChartScene-W6UZTRDP.mjs.br +0 -0
- package/dist/Area3DChartScene-W6UZTRDP.mjs.gz +0 -0
- package/dist/Bar3DChartScene-7HZSPYG4.js +47 -0
- package/dist/Bar3DChartScene-7HZSPYG4.js.br +0 -0
- package/dist/Bar3DChartScene-7HZSPYG4.js.gz +0 -0
- package/dist/Bar3DChartScene-FCWQEQLH.mjs +45 -0
- package/dist/Bar3DChartScene-FCWQEQLH.mjs.br +0 -0
- package/dist/Bar3DChartScene-FCWQEQLH.mjs.gz +0 -0
- package/dist/Line3DChartScene-BKO24WYO.js +47 -0
- package/dist/Line3DChartScene-BKO24WYO.js.br +0 -0
- package/dist/Line3DChartScene-BKO24WYO.js.gz +0 -0
- package/dist/Line3DChartScene-EPPWQOHS.mjs +45 -0
- package/dist/Line3DChartScene-EPPWQOHS.mjs.br +0 -0
- package/dist/Line3DChartScene-EPPWQOHS.mjs.gz +0 -0
- package/dist/{Model3DScene-A3652H7T.mjs → Model3DScene-IAY33GO2.mjs} +1 -1
- package/dist/Model3DScene-IAY33GO2.mjs.br +0 -0
- package/dist/Model3DScene-IAY33GO2.mjs.gz +0 -0
- package/dist/{Model3DScene-5QDYQF55.js → Model3DScene-JFVRE5VL.js} +2 -2
- package/dist/Model3DScene-JFVRE5VL.js.br +0 -0
- package/dist/Model3DScene-JFVRE5VL.js.gz +0 -0
- package/dist/PieChart3DScene-IPH7GLKU.js +47 -0
- package/dist/PieChart3DScene-IPH7GLKU.js.br +0 -0
- package/dist/PieChart3DScene-IPH7GLKU.js.gz +0 -0
- package/dist/PieChart3DScene-ZP5TSL62.mjs +45 -0
- package/dist/PieChart3DScene-ZP5TSL62.mjs.br +0 -0
- package/dist/PieChart3DScene-ZP5TSL62.mjs.gz +0 -0
- package/dist/{PowerPointViewer-SkkxAGKa.d.ts → PowerPointViewer-Cl6jBPNw.d.ts} +2 -2
- package/dist/PowerPointViewer-Cl6jBPNw.d.ts.map +1 -0
- package/dist/{SurfaceChart3DScene-N66TY4SW.mjs → SurfaceChart3DScene-DOMJGPAD.mjs} +1 -1
- package/dist/SurfaceChart3DScene-DOMJGPAD.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-DOMJGPAD.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-QHENN3AF.js → SurfaceChart3DScene-TGDBVJSW.js} +2 -2
- package/dist/SurfaceChart3DScene-TGDBVJSW.js.br +0 -0
- package/dist/SurfaceChart3DScene-TGDBVJSW.js.gz +0 -0
- package/dist/{audience-content-store-Bx4Yj2pN.d.ts → audience-content-store-bR7Gs_1S.d.ts} +2 -2
- package/dist/{audience-content-store-Bx4Yj2pN.d.ts.map → audience-content-store-bR7Gs_1S.d.ts.map} +1 -1
- package/dist/{chunk-UU6NFFRR.js → chunk-7JZLE56X.js} +170 -169
- package/dist/chunk-7JZLE56X.js.br +0 -0
- package/dist/chunk-7JZLE56X.js.gz +0 -0
- package/dist/{chunk-Z4RY432D.js → chunk-A5EUD6UU.js} +2575 -1965
- package/dist/chunk-A5EUD6UU.js.br +0 -0
- package/dist/chunk-A5EUD6UU.js.gz +0 -0
- package/dist/{chunk-M2TISD4A.mjs → chunk-BP2L2KOZ.mjs} +6183 -2447
- package/dist/chunk-BP2L2KOZ.mjs.br +0 -0
- package/dist/chunk-BP2L2KOZ.mjs.gz +0 -0
- package/dist/{chunk-L5MNLIQF.mjs → chunk-MKPSUHUH.mjs} +25 -0
- package/dist/chunk-MKPSUHUH.mjs.br +0 -0
- package/dist/chunk-MKPSUHUH.mjs.gz +0 -0
- package/dist/{chunk-U6A5FWWE.js → chunk-PIUB7R2K.js} +25 -0
- package/dist/chunk-PIUB7R2K.js.br +0 -0
- package/dist/chunk-PIUB7R2K.js.gz +0 -0
- package/dist/{chunk-7HUYHWQS.js → chunk-POAZ53L5.js} +480 -532
- package/dist/chunk-POAZ53L5.js.br +0 -0
- package/dist/chunk-POAZ53L5.js.gz +0 -0
- package/dist/{chunk-EVXT7HLY.mjs → chunk-PQNZCSB7.mjs} +1 -1
- package/dist/chunk-PQNZCSB7.mjs.br +0 -0
- package/dist/{chunk-EVXT7HLY.mjs.gz → chunk-PQNZCSB7.mjs.gz} +0 -0
- package/dist/{chunk-QG7TXWXP.mjs → chunk-SNWAM2XJ.mjs} +17 -16
- package/dist/chunk-SNWAM2XJ.mjs.br +0 -0
- package/dist/chunk-SNWAM2XJ.mjs.gz +0 -0
- package/dist/{chunk-35YJ5RLU.js → chunk-T7BAPZBY.js} +6214 -2447
- package/dist/chunk-T7BAPZBY.js.br +0 -0
- package/dist/chunk-T7BAPZBY.js.gz +0 -0
- package/dist/{chunk-CY24IMMZ.mjs → chunk-TIEUZCYQ.mjs} +761 -151
- package/dist/chunk-TIEUZCYQ.mjs.br +0 -0
- package/dist/chunk-TIEUZCYQ.mjs.gz +0 -0
- package/dist/{chunk-YISXETNN.mjs → chunk-VMLKJDA5.mjs} +97 -149
- package/dist/chunk-VMLKJDA5.mjs.br +0 -0
- package/dist/chunk-VMLKJDA5.mjs.gz +0 -0
- package/dist/{chunk-GJ7E44BG.js → chunk-VQVC27WL.js} +3 -3
- package/dist/chunk-VQVC27WL.js.br +0 -0
- package/dist/chunk-VQVC27WL.js.gz +0 -0
- package/dist/i18n.js +4 -4
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.d.ts +202 -9
- package/dist/index.js +47 -47
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +164 -20
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +79 -79
- package/dist/internals.js.br +7 -3
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +4 -4
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/{types-kLpvSPxq.d.ts → types-Bzdkiakq.d.ts} +44 -1
- package/dist/{types-kLpvSPxq.d.ts.map → types-Bzdkiakq.d.ts.map} +1 -1
- package/dist/{useViewerBuildingBlocks-fh7rq4jc.d.ts → useViewerBuildingBlocks-DC1O_op4.d.ts} +2 -2
- package/dist/{useViewerBuildingBlocks-fh7rq4jc.d.ts.map → useViewerBuildingBlocks-DC1O_op4.d.ts.map} +1 -1
- package/dist/viewer/index.d.ts +196 -6
- package/dist/viewer/index.js +27 -27
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +6 -6
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +5 -5
- package/dist/AiChatPanel-235ZZA3Y.js.br +0 -0
- package/dist/AiChatPanel-235ZZA3Y.js.gz +0 -0
- package/dist/AiChatPanel-DYOBY6OG.mjs.br +0 -0
- package/dist/AiChatPanel-DYOBY6OG.mjs.gz +0 -0
- package/dist/Model3DScene-5QDYQF55.js.br +0 -0
- package/dist/Model3DScene-5QDYQF55.js.gz +0 -0
- package/dist/Model3DScene-A3652H7T.mjs.br +0 -0
- package/dist/Model3DScene-A3652H7T.mjs.gz +0 -0
- package/dist/PowerPointViewer-SkkxAGKa.d.ts.map +0 -1
- package/dist/SurfaceChart3DScene-N66TY4SW.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-N66TY4SW.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-QHENN3AF.js.br +0 -0
- package/dist/SurfaceChart3DScene-QHENN3AF.js.gz +0 -0
- package/dist/chunk-35YJ5RLU.js.br +0 -0
- package/dist/chunk-35YJ5RLU.js.gz +0 -0
- package/dist/chunk-7HUYHWQS.js.br +0 -0
- package/dist/chunk-7HUYHWQS.js.gz +0 -0
- package/dist/chunk-CY24IMMZ.mjs.br +0 -0
- package/dist/chunk-CY24IMMZ.mjs.gz +0 -0
- package/dist/chunk-EVXT7HLY.mjs.br +0 -0
- package/dist/chunk-GJ7E44BG.js.br +0 -0
- package/dist/chunk-GJ7E44BG.js.gz +0 -0
- package/dist/chunk-L5MNLIQF.mjs.br +0 -0
- package/dist/chunk-L5MNLIQF.mjs.gz +0 -0
- package/dist/chunk-M2TISD4A.mjs.br +0 -0
- package/dist/chunk-M2TISD4A.mjs.gz +0 -0
- package/dist/chunk-QG7TXWXP.mjs.br +0 -0
- package/dist/chunk-QG7TXWXP.mjs.gz +0 -0
- package/dist/chunk-U6A5FWWE.js.br +0 -0
- package/dist/chunk-U6A5FWWE.js.gz +0 -0
- package/dist/chunk-UU6NFFRR.js.br +0 -0
- package/dist/chunk-UU6NFFRR.js.gz +0 -0
- package/dist/chunk-YISXETNN.mjs.br +0 -0
- package/dist/chunk-YISXETNN.mjs.gz +0 -0
- package/dist/chunk-Z4RY432D.js.br +0 -0
- package/dist/chunk-Z4RY432D.js.gz +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ThemePresets, PptxMarkdownConverter } from './chunk-
|
|
1
|
+
import { ThemePresets, PptxMarkdownConverter } from './chunk-BP2L2KOZ.mjs';
|
|
2
2
|
import { __export } from './chunk-XGB3TDIC.mjs';
|
|
3
3
|
import * as mcp from 'pptx-viewer-mcp';
|
|
4
4
|
import * as mcpSchemas from 'pptx-viewer-mcp/schemas';
|
|
Binary file
|
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { translationsEn } from './chunk-
|
|
2
|
-
import { SHAPE_PRESET_DEFS, VIEWER_SHORTCUT_REFERENCE, getAnimationInitialStyle, cloneHistorySnapshot, hasShapeProperties, getImageFitStyle, isImageLikeElement, getImageTilingStyle, runMediaCommand, findMediaElementByElementId, mediaPlaybackAttributes, buildTextBlockStyle, hasTextProperties, toCssWritingMode, toCssTextOrientation, toCssVerticalDirection, buildTextBodyLayoutStyle, buildTextBody3DSceneStyle, buildParagraphs, colorWithOpacity, normalizeHexColor, build3DExtrusionData, getComputedFillStyle, getComputedEffectStyle, getComputedStrokeStyle, isStrokeOnlyPresetElement, resolveShapeGeometry, normalizeStrokeDashType, getSvgStrokeDasharray, buildSvgGradientDef, isCalloutShape, getCalloutLeaderLineGeometry, buildCalloutLeaderLineSvgPath, getCalloutViewBoxBounds, svgLineCap, getCompoundLineOffsets, getCompoundLineWidths, computeSelectionRect, DEFAULT_FONT_FAMILY, cellStyleToCss, rectToCells, isCellInRect, tableContainerCss, buildChartViewModel, resolveChartKind, chartPreserveAspectRatio, buildNotesPdfBytes, buildSlidesPdfBytes, buildPreviewAnimation, buildMotionPathPreview, getRoundRectRadiusPx2, getResolvedShapeClipPath, mediaFallbackVisual, registerPersistentAudio, resolveAutoFitFontScale, resolveFontKerning, getSubstituteFontFamily, parsePanoseString, resolveScriptFontSet, hasDistinctScriptFonts, nestedTextDecorationStyle, pieceLetterSpacing, resolveMetricTrackingPx, hollowTextFillStyle, buildTabContext, TEXT_BUILD_ID_SEP, buildTextBuildSpec, textBuildSpanStyle, apply3dEffects, clampUnitInterval, customGeometryPathsToSvgSubpaths, svgGradientFillRef, buildSubpathPaints, computeColumnBoundaries, getTableCellBandStyle, parseDrawingColor, parseDrawingColorOpacity, getCellDiagonalBorders, cellRunStyle, getChartStylePalette, computeChartLegendLayout, mediaFallbackIcon, mediaFallbackLabelKey, MEDIA_CHROME_ATTRIBUTE, convertOmmlToMathMl, sanitizeMathMl, tableCellCss, computeResizedColumnWidths, computeResizedRowHeight, DEFAULT_ROW_HEIGHT, ooxmlGradientAngleToCssDegrees, buildRunTabLines, chartPartToAttrs, splitRunForMetrics, splitRunByScriptFont } from './chunk-
|
|
1
|
+
import { translationsEn } from './chunk-MKPSUHUH.mjs';
|
|
2
|
+
import { SHAPE_PRESET_DEFS, VIEWER_SHORTCUT_REFERENCE, getAnimationInitialStyle, cloneHistorySnapshot, hasShapeProperties, getImageFitStyle, isImageLikeElement, getImageTilingStyle, runMediaCommand, findMediaElementByElementId, mediaPlaybackAttributes, buildTextBlockStyle, hasTextProperties, toCssWritingMode, toCssTextOrientation, toCssVerticalDirection, buildTextBodyLayoutStyle, buildTextBody3DSceneStyle, buildParagraphs, colorWithOpacity, normalizeHexColor, build3DExtrusionData, getComputedFillStyle, getComputedEffectStyle, getComputedStrokeStyle, isStrokeOnlyPresetElement, resolveShapeGeometry, normalizeStrokeDashType, getSvgStrokeDasharray, buildSvgGradientDef, isCalloutShape, getCalloutLeaderLineGeometry, buildCalloutLeaderLineSvgPath, getCalloutViewBoxBounds, svgLineCap, getCompoundLineOffsets, getCompoundLineWidths, computeSelectionRect, DEFAULT_FONT_FAMILY, cellStyleToCss, rectToCells, isCellInRect, tableContainerCss, buildChartViewModel, resolveChartKind, chartPreserveAspectRatio, buildNotesPdfBytes, buildSlidesPdfBytes, buildPreviewAnimation, buildMotionPathPreview, getRoundRectRadiusPx2, getResolvedShapeClipPath, mediaFallbackVisual, registerPersistentAudio, resolveAutoFitFontScale, resolveFontKerning, getSubstituteFontFamily, parsePanoseString, resolveScriptFontSet, hasDistinctScriptFonts, nestedTextDecorationStyle, pieceLetterSpacing, resolveMetricTrackingPx, hollowTextFillStyle, buildTabContext, TEXT_BUILD_ID_SEP, buildTextBuildSpec, textBuildSpanStyle, apply3dEffects, clampUnitInterval, customGeometryPathsToSvgSubpaths, svgGradientFillRef, buildSubpathPaints, computeColumnBoundaries, getTableCellBandStyle, parseDrawingColor, parseDrawingColorOpacity, getCellDiagonalBorders, cellRunStyle, getChartStylePalette, computeChartLegendLayout, mediaFallbackIcon, mediaFallbackLabelKey, MEDIA_CHROME_ATTRIBUTE, convertOmmlToMathMl, sanitizeMathMl, tableCellCss, computeResizedColumnWidths, computeResizedRowHeight, DEFAULT_ROW_HEIGHT, ooxmlGradientAngleToCssDegrees, buildRectPathGradient, buildRunTabLines, chartPartToAttrs, splitRunForMetrics, splitRunByScriptFont } from './chunk-BP2L2KOZ.mjs';
|
|
3
3
|
import { clsx } from 'clsx';
|
|
4
4
|
import { twMerge } from 'tailwind-merge';
|
|
5
5
|
import React6, { useRef, useState, useEffect, useCallback, useMemo, useLayoutEffect } from 'react';
|
|
@@ -2375,13 +2375,13 @@ function parseGradientFillCss(gradFill) {
|
|
|
2375
2375
|
if (stops.length === 0) {
|
|
2376
2376
|
return void 0;
|
|
2377
2377
|
}
|
|
2378
|
-
const
|
|
2378
|
+
const rawStops = stops.map((gs) => {
|
|
2379
2379
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
2380
2380
|
const color = parseDrawingColor(gs) ?? "#888888";
|
|
2381
2381
|
const opacity = parseDrawingColorOpacity(gs);
|
|
2382
|
-
return { pos, color
|
|
2383
|
-
}).sort((a, b) => a.
|
|
2384
|
-
const stopStrings =
|
|
2382
|
+
return { position: pos, color, opacity };
|
|
2383
|
+
}).sort((a, b) => a.position - b.position);
|
|
2384
|
+
const stopStrings = rawStops.map((s) => `${colorWithOpacity(s.color, s.opacity)} ${s.position.toFixed(1)}%`).join(", ");
|
|
2385
2385
|
const lin = gradFill["a:lin"];
|
|
2386
2386
|
if (lin) {
|
|
2387
2387
|
const angRaw = Number.parseInt(String(lin["@_ang"] || "0"), 10);
|
|
@@ -2391,24 +2391,25 @@ function parseGradientFillCss(gradFill) {
|
|
|
2391
2391
|
const path = gradFill["a:path"];
|
|
2392
2392
|
if (path) {
|
|
2393
2393
|
const pathType = String(path["@_path"] || "circle");
|
|
2394
|
-
const
|
|
2394
|
+
const fillToRectXml = path["a:fillToRect"];
|
|
2395
|
+
const fillToRect = fillToRectXml ? {
|
|
2396
|
+
l: Number.parseInt(String(fillToRectXml["@_l"] || "0"), 10) / 1e5,
|
|
2397
|
+
t: Number.parseInt(String(fillToRectXml["@_t"] || "0"), 10) / 1e5,
|
|
2398
|
+
r: Number.parseInt(String(fillToRectXml["@_r"] || "0"), 10) / 1e5,
|
|
2399
|
+
b: Number.parseInt(String(fillToRectXml["@_b"] || "0"), 10) / 1e5
|
|
2400
|
+
} : void 0;
|
|
2401
|
+
if (pathType === "rect") {
|
|
2402
|
+
return buildRectPathGradient(rawStops, void 0, fillToRect);
|
|
2403
|
+
}
|
|
2395
2404
|
let cx = 50;
|
|
2396
2405
|
let cy = 50;
|
|
2397
2406
|
if (fillToRect) {
|
|
2398
|
-
const l
|
|
2399
|
-
const t = Number.parseInt(String(fillToRect["@_t"] || "0"), 10) / 1e5;
|
|
2400
|
-
const r = Number.parseInt(String(fillToRect["@_r"] || "0"), 10) / 1e5;
|
|
2401
|
-
const b = Number.parseInt(String(fillToRect["@_b"] || "0"), 10) / 1e5;
|
|
2407
|
+
const { l, t, r, b } = fillToRect;
|
|
2402
2408
|
cx = (l + (1 - r)) / 2 * 100;
|
|
2403
2409
|
cy = (t + (1 - b)) / 2 * 100;
|
|
2404
2410
|
}
|
|
2405
2411
|
const posX = `${Math.round(cx)}%`;
|
|
2406
2412
|
const posY = `${Math.round(cy)}%`;
|
|
2407
|
-
if (pathType === "rect") {
|
|
2408
|
-
const semiX = Math.max(cx, 100 - cx);
|
|
2409
|
-
const semiY = Math.max(cy, 100 - cy);
|
|
2410
|
-
return `radial-gradient(${Math.round(semiX)}% ${Math.round(semiY)}% at ${posX} ${posY}, ${stopStrings})`;
|
|
2411
|
-
}
|
|
2412
2413
|
if (pathType === "shape") {
|
|
2413
2414
|
return `radial-gradient(farthest-side at ${posX} ${posY}, ${stopStrings})`;
|
|
2414
2415
|
}
|
|
Binary file
|
|
Binary file
|