pptx-react-viewer 4.2.0 → 4.4.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 +138 -0
- package/dist/{AiChatPanel-SEIRQ3XP.mjs → AiChatPanel-QJHUDIWT.mjs} +4 -4
- package/dist/AiChatPanel-QJHUDIWT.mjs.br +0 -0
- package/dist/AiChatPanel-QJHUDIWT.mjs.gz +0 -0
- package/dist/{AiChatPanel-VVTLQXQ5.js → AiChatPanel-UFMSTNCB.js} +28 -28
- package/dist/AiChatPanel-UFMSTNCB.js.br +0 -0
- package/dist/AiChatPanel-UFMSTNCB.js.gz +0 -0
- package/dist/{Model3DScene-DCTVSK2F.mjs → Model3DScene-3GOC5HUS.mjs} +1 -1
- package/dist/Model3DScene-3GOC5HUS.mjs.br +0 -0
- package/dist/Model3DScene-3GOC5HUS.mjs.gz +0 -0
- package/dist/{Model3DScene-SCWQXMEA.js → Model3DScene-KXNJBAQD.js} +2 -2
- package/dist/Model3DScene-KXNJBAQD.js.br +0 -0
- package/dist/Model3DScene-KXNJBAQD.js.gz +0 -0
- package/dist/{chunk-S65QSO6T.js → chunk-7WWINBGF.js} +17172 -8075
- package/dist/chunk-7WWINBGF.js.br +0 -0
- package/dist/chunk-7WWINBGF.js.gz +0 -0
- package/dist/{chunk-KTSDPBQZ.js → chunk-AI6K5EAE.js} +1270 -1079
- package/dist/chunk-AI6K5EAE.js.br +0 -0
- package/dist/chunk-AI6K5EAE.js.gz +0 -0
- package/dist/{chunk-3WYNGYB6.js → chunk-CSY422LU.js} +5 -5
- package/dist/chunk-CSY422LU.js.br +0 -0
- package/dist/chunk-CSY422LU.js.gz +0 -0
- package/dist/{chunk-VPJOJJ36.mjs → chunk-D3TZOCQP.mjs} +17139 -8067
- package/dist/chunk-D3TZOCQP.mjs.br +0 -0
- package/dist/chunk-D3TZOCQP.mjs.gz +0 -0
- package/dist/{chunk-NXGUR2DO.js → chunk-I4D6JQOI.js} +27 -2
- package/dist/chunk-I4D6JQOI.js.br +0 -0
- package/dist/chunk-I4D6JQOI.js.gz +0 -0
- package/dist/{chunk-PC7H3C5W.mjs → chunk-JQXN6PO7.mjs} +27 -2
- package/dist/chunk-JQXN6PO7.mjs.br +0 -0
- package/dist/chunk-JQXN6PO7.mjs.gz +0 -0
- package/dist/{chunk-ZYIJODUR.mjs → chunk-LUHUYBGW.mjs} +211 -20
- package/dist/chunk-LUHUYBGW.mjs.br +0 -0
- package/dist/chunk-LUHUYBGW.mjs.gz +0 -0
- package/dist/{chunk-5MRNT4V6.js → chunk-OWTHF5N4.js} +209 -187
- package/dist/chunk-OWTHF5N4.js.br +0 -0
- package/dist/chunk-OWTHF5N4.js.gz +0 -0
- package/dist/{chunk-4GTDG2FH.mjs → chunk-WCHKDZP6.mjs} +660 -197
- package/dist/chunk-WCHKDZP6.mjs.br +0 -0
- package/dist/chunk-WCHKDZP6.mjs.gz +0 -0
- package/dist/{chunk-B5YZABYX.mjs → chunk-WNFHFFYE.mjs} +32 -10
- package/dist/chunk-WNFHFFYE.mjs.br +0 -0
- package/dist/chunk-WNFHFFYE.mjs.gz +0 -0
- package/dist/{chunk-L4XBWL7J.mjs → chunk-XMKLY2SE.mjs} +1 -1
- package/dist/chunk-XMKLY2SE.mjs.br +0 -0
- package/dist/chunk-XMKLY2SE.mjs.gz +0 -0
- package/dist/{chunk-P2SBIMYF.js → chunk-YJKR7Z3X.js} +2161 -1698
- package/dist/chunk-YJKR7Z3X.js.br +0 -0
- package/dist/chunk-YJKR7Z3X.js.gz +0 -0
- package/dist/i18n/de.cjs +25 -2
- package/dist/i18n/de.cjs.br +0 -0
- package/dist/i18n/de.cjs.gz +0 -0
- package/dist/i18n/de.mjs +25 -2
- package/dist/i18n/de.mjs.br +0 -0
- package/dist/i18n/de.mjs.gz +0 -0
- package/dist/i18n/es.cjs +25 -2
- package/dist/i18n/es.cjs.br +0 -0
- package/dist/i18n/es.cjs.gz +0 -0
- package/dist/i18n/es.mjs +25 -2
- package/dist/i18n/es.mjs.br +0 -0
- package/dist/i18n/es.mjs.gz +0 -0
- package/dist/i18n/fr.cjs +25 -2
- package/dist/i18n/fr.cjs.br +0 -0
- package/dist/i18n/fr.cjs.gz +0 -0
- package/dist/i18n/fr.mjs +25 -2
- package/dist/i18n/fr.mjs.br +0 -0
- package/dist/i18n/fr.mjs.gz +0 -0
- package/dist/i18n/zh-CN.cjs +25 -2
- package/dist/i18n/zh-CN.cjs.br +0 -0
- package/dist/i18n/zh-CN.cjs.gz +0 -0
- package/dist/i18n/zh-CN.mjs +25 -2
- package/dist/i18n/zh-CN.mjs.br +0 -0
- package/dist/i18n/zh-CN.mjs.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 +311 -6
- package/dist/index.js +49 -49
- 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 +461 -42
- package/dist/internals.js +105 -105
- package/dist/internals.js.br +0 -0
- 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/viewer/index.d.ts +274 -4
- 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 +1 -1
- package/dist/AiChatPanel-SEIRQ3XP.mjs.br +0 -0
- package/dist/AiChatPanel-SEIRQ3XP.mjs.gz +0 -0
- package/dist/AiChatPanel-VVTLQXQ5.js.br +0 -0
- package/dist/AiChatPanel-VVTLQXQ5.js.gz +0 -0
- package/dist/Model3DScene-DCTVSK2F.mjs.br +0 -0
- package/dist/Model3DScene-DCTVSK2F.mjs.gz +0 -0
- package/dist/Model3DScene-SCWQXMEA.js.br +0 -0
- package/dist/Model3DScene-SCWQXMEA.js.gz +0 -0
- package/dist/chunk-3WYNGYB6.js.br +0 -0
- package/dist/chunk-3WYNGYB6.js.gz +0 -0
- package/dist/chunk-4GTDG2FH.mjs.br +0 -0
- package/dist/chunk-4GTDG2FH.mjs.gz +0 -0
- package/dist/chunk-5MRNT4V6.js.br +0 -0
- package/dist/chunk-5MRNT4V6.js.gz +0 -0
- package/dist/chunk-B5YZABYX.mjs.br +0 -0
- package/dist/chunk-B5YZABYX.mjs.gz +0 -0
- package/dist/chunk-KTSDPBQZ.js.br +0 -0
- package/dist/chunk-KTSDPBQZ.js.gz +0 -0
- package/dist/chunk-L4XBWL7J.mjs.br +0 -0
- package/dist/chunk-L4XBWL7J.mjs.gz +0 -0
- package/dist/chunk-NXGUR2DO.js.br +0 -0
- package/dist/chunk-NXGUR2DO.js.gz +0 -0
- package/dist/chunk-P2SBIMYF.js.br +0 -0
- package/dist/chunk-P2SBIMYF.js.gz +0 -0
- package/dist/chunk-PC7H3C5W.mjs.br +0 -0
- package/dist/chunk-PC7H3C5W.mjs.gz +0 -0
- package/dist/chunk-S65QSO6T.js.br +0 -0
- package/dist/chunk-S65QSO6T.js.gz +0 -0
- package/dist/chunk-VPJOJJ36.mjs.br +0 -0
- package/dist/chunk-VPJOJJ36.mjs.gz +0 -0
- package/dist/chunk-ZYIJODUR.mjs.br +0 -0
- package/dist/chunk-ZYIJODUR.mjs.gz +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SHAPE_PRESET_DEFS, VIEWER_SHORTCUT_REFERENCE, STROKE_DASH_OPTIONS, getAnimationInitialStyle, cloneHistorySnapshot, hasShapeProperties, getImageFitStyle, getImageFillCounterTransform, getComputedFillStyle, isImageLikeElement, getCropShapeClipPath, getImageTilingStyle, mediaPlaybackAttributes, buildTextBlockStyle, hasTextProperties, toCssWritingMode, toCssTextOrientation, toCssVerticalDirection, buildTextBodyLayoutStyle, buildTextBody3DSceneStyle, buildParagraphs, colorWithOpacity, normalizeHexColor, hexToRgbUnit, build3DExtrusionData, getComputedEffectStyle, getComputedStrokeStyle, getAnimationColorBaseStyle, isStrokeOnlyPresetElement, resolveShapeGeometry, getConnectorPathGeometry, normalizeStrokeDashType, getSvgStrokeDasharray, buildSvgGradientDef, buildStrokeOutline, getPresetShapeVectorGeometry, isWedgeCalloutPresetShape, svgGradientFillRef, isCalloutShape, getCalloutLeaderLineGeometry, buildCalloutLeaderLineSvgPath, getCalloutViewBoxBounds, svgLineCap, getCompoundLineOffsets, getCompoundLineWidths, canDrillDown, computeSelectionRect, DEFAULT_FONT_FAMILY, cellStyleToCss, rectToCells, isCellInRect, tableContainerCss, buildChartViewModel, resolveChartKind, chartPreserveAspectRatio, buildNotesPdfBytes, buildTiledSlidesPdfBytes, buildPreviewAnimation, buildMotionPathPreview, mediaFallbackVisual, scheduleMediaTrimAndFade, registerCrossSlideAudio, withInlineListDecorationDefaults, segmentStyleToCss, resolveAutoFitFontScale, applyUnderlineVariant, nestedTextDecorationStyle, resolveFontKerning, getSubstituteFontFamily, parsePanoseString, resolveScriptFontSet, hasDistinctScriptFonts, pieceLetterSpacing, resolveMetricTrackingPx, hollowTextFillStyle, stripUnderlineDecoration, buildTabContext, TEXT_BUILD_ID_SEP, buildTextBuildSpec, textBuildSpanStyle, apply3dEffects, customGeometryPathsToSvgSubpaths, buildSubpathPaints, computeColumnBoundaries, getTableCellBandStyle, parseDrawingColor, parseDrawingColorOpacity, getCellDiagonalBorders, xmlText, cellRunStyle, getChartStylePalette, computeChartLegendLayout, mediaFallbackIcon, mediaFallbackLabelKey, MEDIA_CHROME_ATTRIBUTE, convertOmmlToMathMl, sanitizeMathMl, tableCellCss, computeResizedColumnWidths, computeResizedRowHeight, DEFAULT_ROW_HEIGHT, ooxmlGradientAngleToCssDegrees, buildRectPathGradient, buildRunTabLines, chartPartToAttrs, splitWordsForUnderline, splitRunForMetrics, splitRunByScriptFont } from './chunk-
|
|
2
|
-
import { translationsEn } from './chunk-
|
|
1
|
+
import { SHAPE_PRESET_DEFS, VIEWER_SHORTCUT_REFERENCE, STROKE_DASH_OPTIONS, getAnimationInitialStyle, cloneHistorySnapshot, hasShapeProperties, getImageFitStyle, getImageFillCounterTransform, getComputedFillStyle, isImageLikeElement, getCropShapeClipPath, getImageTilingStyle, mediaPlaybackAttributes, getOnlineVideoEmbed, ONLINE_VIDEO_IFRAME_SANDBOX, ONLINE_VIDEO_IFRAME_ALLOW, buildTextBlockStyle, hasTextProperties, toCssWritingMode, toCssTextOrientation, toCssVerticalDirection, buildTextBodyLayoutStyle, buildTextBody3DSceneStyle, buildParagraphs, colorWithOpacity, normalizeHexColor, hexToRgbUnit, build3DExtrusionData, getComputedEffectStyle, getComputedStrokeStyle, getAnimationColorBaseStyle, isStrokeOnlyPresetElement, resolveShapeGeometry, getConnectorPathGeometry, normalizeStrokeDashType, getSvgStrokeDasharray, buildSvgGradientDef, buildStrokeOutline, getPresetShapeVectorGeometry, isWedgeCalloutPresetShape, svgGradientFillRef, isCalloutShape, getCalloutLeaderLineGeometry, buildCalloutLeaderLineSvgPath, getCalloutViewBoxBounds, svgLineCap, getCompoundLineOffsets, getCompoundLineWidths, canDrillDown, computeSelectionRect, DEFAULT_FONT_FAMILY, cellStyleToCss, rectToCells, isCellInRect, tableContainerCss, buildChartViewModel, resolveChartKind, chartPreserveAspectRatio, buildNotesPdfBytes, buildTiledSlidesPdfBytes, buildPreviewAnimation, buildMotionPathPreview, mediaFallbackVisual, scheduleMediaTrimAndFade, registerCrossSlideAudio, shouldShowMediaFullscreenStopButton, withInlineListDecorationDefaults, segmentStyleToCss, resolveAutoFitFontScale, applyUnderlineVariant, nestedTextDecorationStyle, resolveFontKerning, getSubstituteFontFamily, parsePanoseString, resolveScriptFontSet, hasDistinctScriptFonts, pieceLetterSpacing, resolveMetricTrackingPx, hollowTextFillStyle, stripUnderlineDecoration, buildTabContext, TEXT_BUILD_ID_SEP, buildTextBuildSpec, textBuildSpanStyle, apply3dEffects, customGeometryPathsToSvgSubpaths, buildSubpathPaints, computeColumnBoundaries, getTableCellBandStyle, parseDrawingColor, parseDrawingColorOpacity, getCellDiagonalBorders, xmlText, cellRunStyle, getChartStylePalette, computeChartLegendLayout, mediaFallbackIcon, mediaFallbackLabelKey, MEDIA_CHROME_ATTRIBUTE, convertOmmlToMathMl, sanitizeMathMl, tableCellCss, computeResizedColumnWidths, computeResizedRowHeight, DEFAULT_ROW_HEIGHT, ooxmlGradientAngleToCssDegrees, buildRectPathGradient, buildRunTabLines, chartPartToAttrs, splitWordsForUnderline, splitRunForMetrics, splitRunByScriptFont } from './chunk-D3TZOCQP.mjs';
|
|
2
|
+
import { translationsEn } from './chunk-JQXN6PO7.mjs';
|
|
3
3
|
import { clsx } from 'clsx';
|
|
4
4
|
import { twMerge } from 'tailwind-merge';
|
|
5
5
|
import React7, { useRef, useState, useEffect, useCallback, useMemo, useLayoutEffect } from 'react';
|
|
@@ -274,8 +274,8 @@ function getCropShapeClipPath2(element) {
|
|
|
274
274
|
}
|
|
275
275
|
return getCropShapeClipPath(element.cropShape, element.width, element.height);
|
|
276
276
|
}
|
|
277
|
-
function getImageTilingStyle2(element) {
|
|
278
|
-
return getImageTilingStyle(element);
|
|
277
|
+
function getImageTilingStyle2(element, nativeSize) {
|
|
278
|
+
return getImageTilingStyle(element, nativeSize);
|
|
279
279
|
}
|
|
280
280
|
|
|
281
281
|
// src/viewer/utils/geometry-image.ts
|
|
@@ -565,7 +565,11 @@ function PresentationMediaController({
|
|
|
565
565
|
}, []);
|
|
566
566
|
return /* @__PURE__ */ jsxs("div", { className: "w-full h-full", style: wrapperStyle, children: [
|
|
567
567
|
children({ mediaRef, onPlay: noopOnPlay, isMediaPlaying }),
|
|
568
|
-
|
|
568
|
+
shouldShowMediaFullscreenStopButton({
|
|
569
|
+
fullScreen: isFullScreen,
|
|
570
|
+
presenting: isPresentationMode,
|
|
571
|
+
playing: isMediaPlaying
|
|
572
|
+
}) && /* @__PURE__ */ jsx(
|
|
569
573
|
"button",
|
|
570
574
|
{
|
|
571
575
|
type: "button",
|
|
@@ -704,6 +708,20 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
704
708
|
return renderMediaFallback({ element, posterUrl, surface });
|
|
705
709
|
}
|
|
706
710
|
if (mediaType === "video") {
|
|
711
|
+
const onlineVideo = getOnlineVideoEmbed(element);
|
|
712
|
+
if (onlineVideo) {
|
|
713
|
+
return /* @__PURE__ */ jsx(
|
|
714
|
+
"iframe",
|
|
715
|
+
{
|
|
716
|
+
src: onlineVideo.embedUrl,
|
|
717
|
+
title: translationsEn["pptx.media.onlineVideoTitle"],
|
|
718
|
+
className: "w-full h-full border-0 pointer-events-auto",
|
|
719
|
+
allow: ONLINE_VIDEO_IFRAME_ALLOW,
|
|
720
|
+
allowFullScreen: true,
|
|
721
|
+
sandbox: ONLINE_VIDEO_IFRAME_SANDBOX
|
|
722
|
+
}
|
|
723
|
+
);
|
|
724
|
+
}
|
|
707
725
|
if (dataUrl) {
|
|
708
726
|
return /* @__PURE__ */ jsx(
|
|
709
727
|
PresentationMediaController,
|
|
@@ -794,17 +812,17 @@ function getTextLayoutStyle(element) {
|
|
|
794
812
|
const textIndent = !hasParagraphIndents && typeof paragraphIndent === "number" && paragraphIndent !== 0 ? paragraphIndent : void 0;
|
|
795
813
|
const bodyTop = element.textStyle?.bodyInsetTop ?? DEFAULT_BODY_INSET_TB_PX;
|
|
796
814
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
815
|
+
const bodyLayoutStyle = buildTextBodyLayoutStyle(element);
|
|
797
816
|
return {
|
|
798
|
-
|
|
799
|
-
...buildTextBodyLayoutStyle(element),
|
|
817
|
+
...bodyLayoutStyle,
|
|
800
818
|
// Body inset only. Paragraph spacing (spcBef/spcAft) is applied
|
|
801
819
|
// per-paragraph by the paragraph renderer, not collapsed here.
|
|
802
820
|
paddingTop: bodyTop,
|
|
803
821
|
paddingBottom: bodyBottom,
|
|
804
822
|
writingMode,
|
|
805
823
|
textOrientation,
|
|
806
|
-
direction: verticalDirection,
|
|
807
|
-
marginLeft,
|
|
824
|
+
direction: verticalDirection ?? bodyLayoutStyle.direction,
|
|
825
|
+
marginLeft: marginLeft ?? bodyLayoutStyle.marginLeft,
|
|
808
826
|
textIndent,
|
|
809
827
|
...shapeAutoFitTextBox ? {
|
|
810
828
|
width: textWrapNone ? "max-content" : "100%",
|
|
@@ -1349,8 +1367,11 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1349
1367
|
const baseFontSize = rawFontSize * resolveAutoFitFontScale(element.textStyle);
|
|
1350
1368
|
const baselineShift = baselineFraction !== 0 ? `${baselineFraction * baseFontSize}px` : void 0;
|
|
1351
1369
|
const fontKerning = resolveFontKerning(segmentStyle.kerning, baseFontSize);
|
|
1370
|
+
const scriptFallbackWins = Boolean(
|
|
1371
|
+
segmentStyle.scriptFallbackFont && segmentStyle.fontFamilyIsCascadeDefault
|
|
1372
|
+
);
|
|
1352
1373
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
1353
|
-
const baseFontFamily = rawFontFamily ? getSubstituteFontFamily(
|
|
1374
|
+
const baseFontFamily = scriptFallbackWins ? getSubstituteFontFamily(segmentStyle.scriptFallbackFont) : rawFontFamily ? getSubstituteFontFamily(
|
|
1354
1375
|
rawFontFamily,
|
|
1355
1376
|
parsePanoseString(segmentStyle.latinFontPanose ?? element.textStyle?.latinFontPanose)
|
|
1356
1377
|
) : DEFAULT_FONT_FAMILY2;
|
|
@@ -3439,6 +3460,7 @@ function renderPrimitive(prim, key) {
|
|
|
3439
3460
|
fill: p.fill,
|
|
3440
3461
|
stroke: p.stroke ?? "none",
|
|
3441
3462
|
strokeWidth: p.strokeWidth ?? 0,
|
|
3463
|
+
strokeDasharray: p.dashArray,
|
|
3442
3464
|
fillOpacity: p.opacity ?? 1,
|
|
3443
3465
|
...partAttrs(p.part),
|
|
3444
3466
|
children: p.title !== void 0 ? /* @__PURE__ */ jsx("title", { children: p.title }) : null
|
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ThemePresets, PptxMarkdownConverter, hasTextProperties, hasShapeProperties } from './chunk-
|
|
1
|
+
import { ThemePresets, PptxMarkdownConverter, hasTextProperties, hasShapeProperties } from './chunk-D3TZOCQP.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
|