pptx-react-viewer 4.5.0 → 4.7.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 +62 -0
- package/README.md +34 -33
- package/dist/{AiChatPanel-P2N6X2KB.js → AiChatPanel-3YILWCBX.js} +28 -28
- package/dist/AiChatPanel-3YILWCBX.js.br +0 -0
- package/dist/AiChatPanel-3YILWCBX.js.gz +0 -0
- package/dist/{AiChatPanel-HXGCZPUX.mjs → AiChatPanel-X2MVL5UP.mjs} +4 -4
- package/dist/AiChatPanel-X2MVL5UP.mjs.br +0 -0
- package/dist/AiChatPanel-X2MVL5UP.mjs.gz +0 -0
- package/dist/{Model3DScene-PIFMH2TU.js → Model3DScene-G7P6ZAIO.js} +2 -2
- package/dist/Model3DScene-G7P6ZAIO.js.br +0 -0
- package/dist/Model3DScene-G7P6ZAIO.js.gz +0 -0
- package/dist/{Model3DScene-QXMMJRV3.mjs → Model3DScene-QFWI5CEE.mjs} +1 -1
- package/dist/Model3DScene-QFWI5CEE.mjs.br +0 -0
- package/dist/Model3DScene-QFWI5CEE.mjs.gz +0 -0
- package/dist/{chunk-T35BGKZG.js → chunk-2BM4GBFZ.js} +5 -5
- package/dist/chunk-2BM4GBFZ.js.br +0 -0
- package/dist/chunk-2BM4GBFZ.js.gz +0 -0
- package/dist/{chunk-ZF5S3HHW.mjs → chunk-5J6NW3YS.mjs} +55 -28
- package/dist/chunk-5J6NW3YS.mjs.br +0 -0
- package/dist/chunk-5J6NW3YS.mjs.gz +0 -0
- package/dist/{chunk-LYZQLV7R.js → chunk-AQIXKTAT.js} +13881 -8722
- package/dist/chunk-AQIXKTAT.js.br +0 -0
- package/dist/chunk-AQIXKTAT.js.gz +0 -0
- package/dist/{chunk-DX2JCSQ4.mjs → chunk-E5OIDWHO.mjs} +1 -1
- package/dist/chunk-E5OIDWHO.mjs.br +0 -0
- package/dist/chunk-E5OIDWHO.mjs.gz +0 -0
- package/dist/{chunk-6FVYG27J.js → chunk-FYAOOACZ.js} +241 -214
- package/dist/chunk-FYAOOACZ.js.br +0 -0
- package/dist/chunk-FYAOOACZ.js.gz +0 -0
- package/dist/{chunk-PRXJ3J5W.mjs → chunk-OECUSL2B.mjs} +129 -311
- package/dist/chunk-OECUSL2B.mjs.br +0 -0
- package/dist/chunk-OECUSL2B.mjs.gz +0 -0
- package/dist/{chunk-VZNIVS3X.mjs → chunk-QLDHUKH2.mjs} +13808 -8718
- package/dist/chunk-QLDHUKH2.mjs.br +0 -0
- package/dist/chunk-QLDHUKH2.mjs.gz +0 -0
- package/dist/{chunk-Y4VRYQQS.js → chunk-SR7ETIBF.js} +931 -1112
- package/dist/chunk-SR7ETIBF.js.br +0 -0
- package/dist/chunk-SR7ETIBF.js.gz +0 -0
- package/dist/{chunk-IDV2ITXM.mjs → chunk-UBYFLXAU.mjs} +1383 -208
- package/dist/chunk-UBYFLXAU.mjs.br +0 -0
- package/dist/chunk-UBYFLXAU.mjs.gz +0 -0
- package/dist/{chunk-UMQV2432.js → chunk-UIAU3NR2.js} +45 -0
- package/dist/chunk-UIAU3NR2.js.br +0 -0
- package/dist/chunk-UIAU3NR2.js.gz +0 -0
- package/dist/{chunk-UZFCFYK6.js → chunk-VF4RA27Q.js} +3245 -2070
- package/dist/chunk-VF4RA27Q.js.br +0 -0
- package/dist/chunk-VF4RA27Q.js.gz +0 -0
- package/dist/{chunk-APAVAD2A.mjs → chunk-WIEBQGQI.mjs} +45 -0
- package/dist/chunk-WIEBQGQI.mjs.br +0 -0
- package/dist/chunk-WIEBQGQI.mjs.gz +0 -0
- package/dist/i18n/de.cjs +71 -21
- package/dist/i18n/de.cjs.br +0 -0
- package/dist/i18n/de.cjs.gz +0 -0
- package/dist/i18n/de.mjs +71 -21
- package/dist/i18n/de.mjs.br +0 -0
- package/dist/i18n/de.mjs.gz +0 -0
- package/dist/i18n/es.cjs +71 -21
- package/dist/i18n/es.cjs.br +0 -0
- package/dist/i18n/es.cjs.gz +0 -0
- package/dist/i18n/es.mjs +71 -21
- package/dist/i18n/es.mjs.br +0 -0
- package/dist/i18n/es.mjs.gz +0 -0
- package/dist/i18n/fr.cjs +71 -21
- package/dist/i18n/fr.cjs.br +0 -0
- package/dist/i18n/fr.cjs.gz +0 -0
- package/dist/i18n/fr.mjs +71 -21
- package/dist/i18n/fr.mjs.br +0 -0
- package/dist/i18n/fr.mjs.gz +0 -0
- package/dist/i18n/zh-CN.cjs +49 -4
- package/dist/i18n/zh-CN.cjs.br +0 -0
- package/dist/i18n/zh-CN.cjs.gz +0 -0
- package/dist/i18n/zh-CN.mjs +49 -4
- 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 +438 -13
- package/dist/index.js +105 -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 +501 -15
- 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 +515 -12
- 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 +3 -4
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-HXGCZPUX.mjs.br +0 -0
- package/dist/AiChatPanel-HXGCZPUX.mjs.gz +0 -0
- package/dist/AiChatPanel-P2N6X2KB.js.br +0 -0
- package/dist/AiChatPanel-P2N6X2KB.js.gz +0 -0
- package/dist/Model3DScene-PIFMH2TU.js.br +0 -0
- package/dist/Model3DScene-PIFMH2TU.js.gz +0 -0
- package/dist/Model3DScene-QXMMJRV3.mjs.br +0 -0
- package/dist/Model3DScene-QXMMJRV3.mjs.gz +0 -0
- package/dist/chunk-6FVYG27J.js.br +0 -0
- package/dist/chunk-6FVYG27J.js.gz +0 -0
- package/dist/chunk-APAVAD2A.mjs.br +0 -0
- package/dist/chunk-APAVAD2A.mjs.gz +0 -0
- package/dist/chunk-DX2JCSQ4.mjs.br +0 -0
- package/dist/chunk-DX2JCSQ4.mjs.gz +0 -0
- package/dist/chunk-IDV2ITXM.mjs.br +0 -0
- package/dist/chunk-IDV2ITXM.mjs.gz +0 -0
- package/dist/chunk-LYZQLV7R.js.br +0 -0
- package/dist/chunk-LYZQLV7R.js.gz +0 -0
- package/dist/chunk-PRXJ3J5W.mjs.br +0 -0
- package/dist/chunk-PRXJ3J5W.mjs.gz +0 -0
- package/dist/chunk-T35BGKZG.js.br +0 -0
- package/dist/chunk-T35BGKZG.js.gz +0 -0
- package/dist/chunk-UMQV2432.js.br +0 -0
- package/dist/chunk-UMQV2432.js.gz +0 -0
- package/dist/chunk-UZFCFYK6.js.br +0 -0
- package/dist/chunk-UZFCFYK6.js.gz +0 -0
- package/dist/chunk-VZNIVS3X.mjs.br +0 -0
- package/dist/chunk-VZNIVS3X.mjs.gz +0 -0
- package/dist/chunk-Y4VRYQQS.js.br +0 -0
- package/dist/chunk-Y4VRYQQS.js.gz +0 -0
- package/dist/chunk-ZF5S3HHW.mjs.br +0 -0
- package/dist/chunk-ZF5S3HHW.mjs.gz +0 -0
|
@@ -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, 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, scaleFontSizeForAutoFit, 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, scaleFontSizeForAutoFit, resolveFontKerning, getSubstituteFontFamily, parsePanoseString, resolveScriptFontSet, hasDistinctScriptFonts, pieceLetterSpacing, resolveMetricTrackingPx, hollowTextFillStyle, splitsUnderlineIntoWords, 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-QLDHUKH2.mjs';
|
|
2
|
+
import { translationsEn } from './chunk-WIEBQGQI.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';
|
|
@@ -1418,7 +1418,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1418
1418
|
spanStyle.direction = runRtl ? "rtl" : "ltr";
|
|
1419
1419
|
spanStyle.unicodeBidi = runRtl !== ctx.paragraphRtl ? "bidi-override" : "embed";
|
|
1420
1420
|
}
|
|
1421
|
-
const isUnderlineWords =
|
|
1421
|
+
const isUnderlineWords = splitsUnderlineIntoWords(segmentStyle);
|
|
1422
1422
|
const wordDecoration = isUnderlineWords ? nestedStyle ?? run.underlineWordPieces?.find((piece) => piece.style)?.style : void 0;
|
|
1423
1423
|
if (isUnderlineWords) {
|
|
1424
1424
|
const stripped = stripUnderlineDecoration(spanStyle);
|
|
@@ -1443,7 +1443,8 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1443
1443
|
baseFontSize,
|
|
1444
1444
|
baseFontFamily,
|
|
1445
1445
|
Boolean(segmentStyle.bold),
|
|
1446
|
-
Boolean(segmentStyle.italic)
|
|
1446
|
+
Boolean(segmentStyle.italic),
|
|
1447
|
+
{ language: segmentStyle.language, rtl: ctx.paragraphRtl === true }
|
|
1447
1448
|
),
|
|
1448
1449
|
metricContext,
|
|
1449
1450
|
isUnderlineWords,
|
|
@@ -2027,7 +2028,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2027
2028
|
"svg",
|
|
2028
2029
|
{
|
|
2029
2030
|
viewBox: `0 0 ${pathWidth} ${pathHeight}`,
|
|
2030
|
-
className: "w-full h-full pointer-events-none",
|
|
2031
|
+
className: "absolute inset-0 w-full h-full pointer-events-none",
|
|
2031
2032
|
preserveAspectRatio: "none",
|
|
2032
2033
|
children: [
|
|
2033
2034
|
animatesFill ? null : renderSvgGradientDefs(gradient),
|
|
@@ -3422,6 +3423,9 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3422
3423
|
}
|
|
3423
3424
|
);
|
|
3424
3425
|
}
|
|
3426
|
+
function renderGradientStops(stops) {
|
|
3427
|
+
return stops.map((stop, i) => /* @__PURE__ */ jsx("stop", { offset: stop.offset, stopColor: stop.color, stopOpacity: stop.opacity }, i));
|
|
3428
|
+
}
|
|
3425
3429
|
function partAttrs(part) {
|
|
3426
3430
|
return part ? chartPartToAttrs(part) : void 0;
|
|
3427
3431
|
}
|
|
@@ -3599,29 +3603,52 @@ function renderChartViewModel(elementId, vm, preserveAspectRatio = "none") {
|
|
|
3599
3603
|
viewBox: `0 0 ${vm.svgWidth} ${vm.svgHeight}`,
|
|
3600
3604
|
preserveAspectRatio,
|
|
3601
3605
|
children: [
|
|
3602
|
-
vm.defs && vm.defs.length > 0 && /* @__PURE__ */ jsx("defs", { children: vm.defs.map(
|
|
3603
|
-
"
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3606
|
+
vm.defs && vm.defs.length > 0 && /* @__PURE__ */ jsx("defs", { children: vm.defs.map(
|
|
3607
|
+
(def, i) => def.kind === "linearGradient" ? /* @__PURE__ */ jsx(
|
|
3608
|
+
"linearGradient",
|
|
3609
|
+
{
|
|
3610
|
+
id: def.id,
|
|
3611
|
+
x1: def.x1,
|
|
3612
|
+
y1: def.y1,
|
|
3613
|
+
x2: def.x2,
|
|
3614
|
+
y2: def.y2,
|
|
3615
|
+
children: renderGradientStops(def.stops)
|
|
3616
|
+
},
|
|
3617
|
+
`${elementId}-def-${i}`
|
|
3618
|
+
) : def.kind === "radialGradient" ? /* @__PURE__ */ jsx(
|
|
3619
|
+
"radialGradient",
|
|
3620
|
+
{
|
|
3621
|
+
id: def.id,
|
|
3622
|
+
cx: def.cx,
|
|
3623
|
+
cy: def.cy,
|
|
3624
|
+
r: def.r,
|
|
3625
|
+
children: renderGradientStops(def.stops)
|
|
3626
|
+
},
|
|
3627
|
+
`${elementId}-def-${i}`
|
|
3628
|
+
) : /* @__PURE__ */ jsx(
|
|
3629
|
+
"pattern",
|
|
3630
|
+
{
|
|
3631
|
+
id: def.id,
|
|
3632
|
+
patternUnits: def.patternUnits,
|
|
3633
|
+
x: def.x,
|
|
3634
|
+
y: def.y,
|
|
3635
|
+
width: def.width,
|
|
3636
|
+
height: def.height,
|
|
3637
|
+
children: /* @__PURE__ */ jsx(
|
|
3638
|
+
"image",
|
|
3639
|
+
{
|
|
3640
|
+
href: def.href,
|
|
3641
|
+
x: 0,
|
|
3642
|
+
y: 0,
|
|
3643
|
+
width: def.width,
|
|
3644
|
+
height: def.height,
|
|
3645
|
+
preserveAspectRatio: def.preserveAspectRatio
|
|
3646
|
+
}
|
|
3647
|
+
)
|
|
3648
|
+
},
|
|
3649
|
+
`${elementId}-def-${i}`
|
|
3650
|
+
)
|
|
3651
|
+
) }),
|
|
3625
3652
|
vm.areaFill && /* @__PURE__ */ jsx(
|
|
3626
3653
|
"rect",
|
|
3627
3654
|
{
|
|
Binary file
|
|
Binary file
|