pptx-react-viewer 3.5.4 → 3.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 +25 -0
- package/dist/{AiChatPanel-CCJNQGER.mjs → AiChatPanel-L5QGWVZK.mjs} +4 -4
- package/dist/AiChatPanel-L5QGWVZK.mjs.br +0 -0
- package/dist/AiChatPanel-L5QGWVZK.mjs.gz +0 -0
- package/dist/{AiChatPanel-LPZWDNVU.js → AiChatPanel-M3AHKYPS.js} +25 -25
- package/dist/AiChatPanel-M3AHKYPS.js.br +0 -0
- package/dist/AiChatPanel-M3AHKYPS.js.gz +0 -0
- package/dist/{Area3DChartScene-P6YM6ZL7.mjs → Area3DChartScene-AE2XYKDW.mjs} +1 -1
- package/dist/Area3DChartScene-AE2XYKDW.mjs.br +1 -0
- package/dist/Area3DChartScene-AE2XYKDW.mjs.gz +0 -0
- package/dist/{Area3DChartScene-LJCWBNQ3.js → Area3DChartScene-ZQLQK6L4.js} +2 -2
- package/dist/Area3DChartScene-ZQLQK6L4.js.br +0 -0
- package/dist/Area3DChartScene-ZQLQK6L4.js.gz +0 -0
- package/dist/{Bar3DChartScene-DIVOJURZ.mjs → Bar3DChartScene-FQV62XOI.mjs} +1 -1
- package/dist/Bar3DChartScene-FQV62XOI.mjs.br +2 -0
- package/dist/Bar3DChartScene-FQV62XOI.mjs.gz +0 -0
- package/dist/{Bar3DChartScene-7DNQ4X5T.js → Bar3DChartScene-TZ6ADFBS.js} +2 -2
- package/dist/Bar3DChartScene-TZ6ADFBS.js.br +0 -0
- package/dist/Bar3DChartScene-TZ6ADFBS.js.gz +0 -0
- package/dist/{Line3DChartScene-UF6DHP36.js → Line3DChartScene-5CKPAX63.js} +2 -2
- package/dist/Line3DChartScene-5CKPAX63.js.br +0 -0
- package/dist/Line3DChartScene-5CKPAX63.js.gz +0 -0
- package/dist/{Line3DChartScene-ZZVNUKIJ.mjs → Line3DChartScene-FEUY3PCE.mjs} +1 -1
- package/dist/Line3DChartScene-FEUY3PCE.mjs.br +1 -0
- package/dist/Line3DChartScene-FEUY3PCE.mjs.gz +0 -0
- package/dist/{Model3DScene-C7MZ22DH.js → Model3DScene-BLXEALM6.js} +2 -2
- package/dist/Model3DScene-BLXEALM6.js.br +0 -0
- package/dist/Model3DScene-BLXEALM6.js.gz +0 -0
- package/dist/{Model3DScene-XXMAAKBR.mjs → Model3DScene-V3DHIISV.mjs} +1 -1
- package/dist/Model3DScene-V3DHIISV.mjs.br +0 -0
- package/dist/Model3DScene-V3DHIISV.mjs.gz +0 -0
- package/dist/{PieChart3DScene-N2Y25VG5.js → PieChart3DScene-GHHT3PDV.js} +2 -2
- package/dist/PieChart3DScene-GHHT3PDV.js.br +0 -0
- package/dist/PieChart3DScene-GHHT3PDV.js.gz +0 -0
- package/dist/{PieChart3DScene-7LX3IL2Q.mjs → PieChart3DScene-VZI2VARG.mjs} +1 -1
- package/dist/{PieChart3DScene-7LX3IL2Q.mjs.br → PieChart3DScene-VZI2VARG.mjs.br} +0 -0
- package/dist/PieChart3DScene-VZI2VARG.mjs.gz +0 -0
- package/dist/PowerPointViewer-Cl6jBPNw.d.ts.map +1 -1
- package/dist/{SurfaceChart3DScene-ADA7NUIW.mjs → SurfaceChart3DScene-T36E2HBA.mjs} +1 -1
- package/dist/SurfaceChart3DScene-T36E2HBA.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-T36E2HBA.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-WXJHYOGJ.js → SurfaceChart3DScene-WWIMQ65D.js} +2 -2
- package/dist/SurfaceChart3DScene-WWIMQ65D.js.br +0 -0
- package/dist/SurfaceChart3DScene-WWIMQ65D.js.gz +0 -0
- package/dist/{chunk-UOMFINNJ.js → chunk-3EJFZ7TE.js} +33 -5
- package/dist/chunk-3EJFZ7TE.js.br +0 -0
- package/dist/chunk-3EJFZ7TE.js.gz +0 -0
- package/dist/{chunk-YQOK4E2A.js → chunk-DCNHUEWQ.js} +35917 -23497
- package/dist/chunk-DCNHUEWQ.js.br +0 -0
- package/dist/chunk-DCNHUEWQ.js.gz +0 -0
- package/dist/{chunk-JCJ3EPG6.mjs → chunk-FGTMS7LR.mjs} +14 -23
- package/dist/chunk-FGTMS7LR.mjs.br +0 -0
- package/dist/chunk-FGTMS7LR.mjs.gz +0 -0
- package/dist/{chunk-U52MKWVA.mjs → chunk-JANUSAEK.mjs} +189 -225
- package/dist/chunk-JANUSAEK.mjs.br +0 -0
- package/dist/chunk-JANUSAEK.mjs.gz +0 -0
- package/dist/{chunk-NM652EZS.mjs → chunk-NV55GU5V.mjs} +35881 -23494
- package/dist/chunk-NV55GU5V.mjs.br +0 -0
- package/dist/chunk-NV55GU5V.mjs.gz +0 -0
- package/dist/{chunk-2FMQ7M3L.js → chunk-OBE4TB76.js} +494 -575
- package/dist/chunk-OBE4TB76.js.br +0 -0
- package/dist/chunk-OBE4TB76.js.gz +0 -0
- package/dist/{chunk-EVVWCF2M.mjs → chunk-PC62KGU3.mjs} +67 -148
- package/dist/chunk-PC62KGU3.mjs.br +0 -0
- package/dist/chunk-PC62KGU3.mjs.gz +0 -0
- package/dist/{chunk-HHJZK26I.js → chunk-TUSALM3A.js} +1603 -1310
- package/dist/chunk-TUSALM3A.js.br +0 -0
- package/dist/chunk-TUSALM3A.js.gz +0 -0
- package/dist/{chunk-IWQSAKPM.mjs → chunk-TXY2E7VQ.mjs} +445 -152
- package/dist/chunk-TXY2E7VQ.mjs.br +0 -0
- package/dist/chunk-TXY2E7VQ.mjs.gz +0 -0
- package/dist/{chunk-UTMTXJGM.js → chunk-VIFDZIVX.js} +375 -412
- package/dist/chunk-VIFDZIVX.js.br +0 -0
- package/dist/chunk-VIFDZIVX.js.gz +0 -0
- package/dist/{chunk-UTIMT5CZ.js → chunk-W24OJ7H5.js} +14 -23
- package/dist/chunk-W24OJ7H5.js.br +0 -0
- package/dist/chunk-W24OJ7H5.js.gz +0 -0
- package/dist/{chunk-IVPT3U5C.mjs → chunk-WKODF5ZU.mjs} +29 -1
- package/dist/chunk-WKODF5ZU.mjs.br +0 -0
- package/dist/chunk-WKODF5ZU.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 +1012 -45
- 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 +1023 -45
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +79 -79
- 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/{useViewerBuildingBlocks-f6oNGKMX.d.ts → useViewerBuildingBlocks-C8F_4Pzb.d.ts} +3 -1
- package/dist/useViewerBuildingBlocks-C8F_4Pzb.d.ts.map +1 -0
- package/dist/viewer/index.d.ts +933 -45
- 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 +2 -2
- package/dist/AiChatPanel-CCJNQGER.mjs.br +0 -0
- package/dist/AiChatPanel-CCJNQGER.mjs.gz +0 -0
- package/dist/AiChatPanel-LPZWDNVU.js.br +0 -0
- package/dist/AiChatPanel-LPZWDNVU.js.gz +0 -0
- package/dist/Area3DChartScene-LJCWBNQ3.js.br +0 -0
- package/dist/Area3DChartScene-LJCWBNQ3.js.gz +0 -0
- package/dist/Area3DChartScene-P6YM6ZL7.mjs.br +0 -0
- package/dist/Area3DChartScene-P6YM6ZL7.mjs.gz +0 -0
- package/dist/Bar3DChartScene-7DNQ4X5T.js.br +0 -1
- package/dist/Bar3DChartScene-7DNQ4X5T.js.gz +0 -0
- package/dist/Bar3DChartScene-DIVOJURZ.mjs.br +0 -0
- package/dist/Bar3DChartScene-DIVOJURZ.mjs.gz +0 -0
- package/dist/Line3DChartScene-UF6DHP36.js.br +0 -0
- package/dist/Line3DChartScene-UF6DHP36.js.gz +0 -0
- package/dist/Line3DChartScene-ZZVNUKIJ.mjs.br +0 -0
- package/dist/Line3DChartScene-ZZVNUKIJ.mjs.gz +0 -0
- package/dist/Model3DScene-C7MZ22DH.js.br +0 -0
- package/dist/Model3DScene-C7MZ22DH.js.gz +0 -0
- package/dist/Model3DScene-XXMAAKBR.mjs.br +0 -0
- package/dist/Model3DScene-XXMAAKBR.mjs.gz +0 -0
- package/dist/PieChart3DScene-7LX3IL2Q.mjs.gz +0 -0
- package/dist/PieChart3DScene-N2Y25VG5.js.br +0 -0
- package/dist/PieChart3DScene-N2Y25VG5.js.gz +0 -0
- package/dist/SurfaceChart3DScene-ADA7NUIW.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-ADA7NUIW.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-WXJHYOGJ.js.br +0 -0
- package/dist/SurfaceChart3DScene-WXJHYOGJ.js.gz +0 -0
- package/dist/chunk-2FMQ7M3L.js.br +0 -0
- package/dist/chunk-2FMQ7M3L.js.gz +0 -0
- package/dist/chunk-EVVWCF2M.mjs.br +0 -0
- package/dist/chunk-EVVWCF2M.mjs.gz +0 -0
- package/dist/chunk-HHJZK26I.js.br +0 -0
- package/dist/chunk-HHJZK26I.js.gz +0 -0
- package/dist/chunk-IVPT3U5C.mjs.br +0 -0
- package/dist/chunk-IVPT3U5C.mjs.gz +0 -0
- package/dist/chunk-IWQSAKPM.mjs.br +0 -0
- package/dist/chunk-IWQSAKPM.mjs.gz +0 -0
- package/dist/chunk-JCJ3EPG6.mjs.br +0 -0
- package/dist/chunk-JCJ3EPG6.mjs.gz +0 -0
- package/dist/chunk-NM652EZS.mjs.br +0 -0
- package/dist/chunk-NM652EZS.mjs.gz +0 -0
- package/dist/chunk-U52MKWVA.mjs.br +0 -0
- package/dist/chunk-U52MKWVA.mjs.gz +0 -0
- package/dist/chunk-UOMFINNJ.js.br +0 -0
- package/dist/chunk-UOMFINNJ.js.gz +0 -0
- package/dist/chunk-UTIMT5CZ.js.br +0 -0
- package/dist/chunk-UTIMT5CZ.js.gz +0 -0
- package/dist/chunk-UTMTXJGM.js.br +0 -0
- package/dist/chunk-UTMTXJGM.js.gz +0 -0
- package/dist/chunk-YQOK4E2A.js.br +0 -0
- package/dist/chunk-YQOK4E2A.js.gz +0 -0
- package/dist/useViewerBuildingBlocks-f6oNGKMX.d.ts.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { SHAPE_PRESET_DEFS, VIEWER_SHORTCUT_REFERENCE, STROKE_DASH_OPTIONS, getAnimationInitialStyle, cloneHistorySnapshot, hasShapeProperties, getImageFitStyle, getComputedFillStyle, isImageLikeElement, getCropShapeClipPath, getImageTilingStyle, mediaPlaybackAttributes, buildTextBlockStyle, hasTextProperties, toCssWritingMode, toCssTextOrientation, toCssVerticalDirection, buildTextBodyLayoutStyle, buildTextBody3DSceneStyle, buildParagraphs, colorWithOpacity, normalizeHexColor, hexToRgbUnit, build3DExtrusionData, getComputedEffectStyle, getComputedStrokeStyle, getAnimationColorBaseStyle, isStrokeOnlyPresetElement, resolveShapeGeometry, normalizeStrokeDashType, getSvgStrokeDasharray, buildSvgGradientDef, buildStrokeOutline, getPresetShapeVectorGeometry, isWedgeCalloutPresetShape, svgGradientFillRef, isCalloutShape, getCalloutLeaderLineGeometry, buildCalloutLeaderLineSvgPath, getCalloutViewBoxBounds, svgLineCap, getCompoundLineOffsets, getCompoundLineWidths, computeSelectionRect, DEFAULT_FONT_FAMILY, cellStyleToCss, rectToCells, isCellInRect, tableContainerCss, buildChartViewModel, resolveChartKind, chartPreserveAspectRatio, buildNotesPdfBytes, buildSlidesPdfBytes, buildPreviewAnimation, buildMotionPathPreview, mediaFallbackVisual, registerCrossSlideAudio, resolveAutoFitFontScale, resolveFontKerning, getSubstituteFontFamily, parsePanoseString, resolveScriptFontSet, hasDistinctScriptFonts, nestedTextDecorationStyle, pieceLetterSpacing, resolveMetricTrackingPx, hollowTextFillStyle, buildTabContext, TEXT_BUILD_ID_SEP, buildTextBuildSpec, textBuildSpanStyle, apply3dEffects, clampUnitInterval, customGeometryPathsToSvgSubpaths, 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-
|
|
2
|
-
import { translationsEn } from './chunk-
|
|
1
|
+
import { SHAPE_PRESET_DEFS, VIEWER_SHORTCUT_REFERENCE, STROKE_DASH_OPTIONS, getAnimationInitialStyle, cloneHistorySnapshot, hasShapeProperties, getImageFitStyle, getComputedFillStyle, isImageLikeElement, getCropShapeClipPath, getImageTilingStyle, mediaPlaybackAttributes, buildTextBlockStyle, hasTextProperties, toCssWritingMode, toCssTextOrientation, toCssVerticalDirection, buildTextBodyLayoutStyle, buildTextBody3DSceneStyle, buildParagraphs, colorWithOpacity, normalizeHexColor, hexToRgbUnit, build3DExtrusionData, getComputedEffectStyle, getComputedStrokeStyle, getAnimationColorBaseStyle, isStrokeOnlyPresetElement, resolveShapeGeometry, 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, buildSlidesPdfBytes, buildPreviewAnimation, buildMotionPathPreview, mediaFallbackVisual, scheduleMediaTrimAndFade, registerCrossSlideAudio, resolveAutoFitFontScale, resolveFontKerning, getSubstituteFontFamily, parsePanoseString, resolveScriptFontSet, hasDistinctScriptFonts, nestedTextDecorationStyle, pieceLetterSpacing, resolveMetricTrackingPx, hollowTextFillStyle, stripUnderlineDecoration, buildTabContext, TEXT_BUILD_ID_SEP, buildTextBuildSpec, textBuildSpanStyle, apply3dEffects, clampUnitInterval, customGeometryPathsToSvgSubpaths, 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, splitWordsForUnderline, splitRunForMetrics, splitRunByScriptFont } from './chunk-NV55GU5V.mjs';
|
|
2
|
+
import { translationsEn } from './chunk-FGTMS7LR.mjs';
|
|
3
3
|
import { clsx } from 'clsx';
|
|
4
4
|
import { twMerge } from 'tailwind-merge';
|
|
5
|
-
import
|
|
5
|
+
import React7, { useRef, useState, useEffect, useCallback, useMemo, useLayoutEffect } from 'react';
|
|
6
6
|
import { LuTriangle, LuPlus, LuMoveRight, LuMinus, LuDiamond, LuDatabase, LuCircle, LuSquare } from 'react-icons/lu';
|
|
7
7
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
8
|
import { useTranslation } from 'react-i18next';
|
|
@@ -57,22 +57,6 @@ var TOOLBAR_SECTIONS = [
|
|
|
57
57
|
];
|
|
58
58
|
var SHORTCUT_REFERENCE_ITEMS = VIEWER_SHORTCUT_REFERENCE;
|
|
59
59
|
|
|
60
|
-
// src/viewer/constants/theme.ts
|
|
61
|
-
var THEME_COLOR_SWATCHES = [
|
|
62
|
-
"#000000",
|
|
63
|
-
"#FFFFFF",
|
|
64
|
-
"#1F497D",
|
|
65
|
-
"#EEECE1",
|
|
66
|
-
"#4472C4",
|
|
67
|
-
"#ED7D31",
|
|
68
|
-
"#A5A5A5",
|
|
69
|
-
"#FFC000",
|
|
70
|
-
"#5B9BD5",
|
|
71
|
-
"#70AD47",
|
|
72
|
-
"#0563C1",
|
|
73
|
-
"#954F72"
|
|
74
|
-
];
|
|
75
|
-
|
|
76
60
|
// src/viewer/constants/transitions-animations.ts
|
|
77
61
|
var ANIMATION_PRESET_OPTIONS = [
|
|
78
62
|
{ value: "fadeIn", label: "Fade In", i18nKey: "pptx.animation.preset.fadeIn" },
|
|
@@ -104,7 +88,7 @@ var SHAPE_PRESETS = SHAPE_PRESET_DEFS.map(
|
|
|
104
88
|
type: def.type,
|
|
105
89
|
label: def.label,
|
|
106
90
|
i18nKey: def.i18nKey,
|
|
107
|
-
icon:
|
|
91
|
+
icon: React7.createElement(GLYPH_COMPONENTS[def.glyph], {
|
|
108
92
|
className: def.glyphClass ? `w-3.5 h-3.5 ${def.glyphClass}` : "w-3.5 h-3.5"
|
|
109
93
|
})
|
|
110
94
|
})
|
|
@@ -330,20 +314,10 @@ function ensureArrayValue(value) {
|
|
|
330
314
|
// src/viewer/utils/media-persistent-audio.tsx
|
|
331
315
|
function buildTrimFragment(element) {
|
|
332
316
|
const start = element.trimStartMs;
|
|
333
|
-
|
|
334
|
-
if (start === void 0 && end === void 0) {
|
|
317
|
+
if (start === void 0 || start <= 0) {
|
|
335
318
|
return "";
|
|
336
319
|
}
|
|
337
|
-
|
|
338
|
-
if (start !== void 0 && start > 0) {
|
|
339
|
-
parts.push((start / 1e3).toFixed(3));
|
|
340
|
-
} else {
|
|
341
|
-
parts.push("");
|
|
342
|
-
}
|
|
343
|
-
if (end !== void 0 && end > 0) {
|
|
344
|
-
parts.push((end / 1e3).toFixed(3));
|
|
345
|
-
}
|
|
346
|
-
return parts.length > 0 ? `#t=${parts.join(",")}` : "";
|
|
320
|
+
return `#t=${(start / 1e3).toFixed(3)}`;
|
|
347
321
|
}
|
|
348
322
|
function useMediaMetadataExtraction(mediaRef, element) {
|
|
349
323
|
const [metadata, setMetadata] = useState(element.metadata);
|
|
@@ -484,25 +458,9 @@ function PresentationMediaController({
|
|
|
484
458
|
}) {
|
|
485
459
|
const { t } = useTranslation();
|
|
486
460
|
const mediaRef = useRef(null);
|
|
487
|
-
const fadeTimerRef = useRef(null);
|
|
488
|
-
const trimTimerRef = useRef(null);
|
|
489
461
|
const [isMediaPlaying, setIsMediaPlaying] = useState(false);
|
|
490
|
-
const volume = element.volume ?? 1;
|
|
491
|
-
const fadeIn = element.fadeInDuration ?? 0;
|
|
492
|
-
const fadeOut = element.fadeOutDuration ?? 0;
|
|
493
462
|
const trimStartSec = element.trimStartMs !== void 0 ? element.trimStartMs / 1e3 : 0;
|
|
494
|
-
const trimEndSec = element.trimEndMs !== void 0 && element.trimEndMs > 0 ? element.trimEndMs / 1e3 : 0;
|
|
495
463
|
const hideWhenNotPlaying = isPresentationMode && element.hideWhenNotPlaying === true;
|
|
496
|
-
useEffect(() => {
|
|
497
|
-
return () => {
|
|
498
|
-
if (fadeTimerRef.current !== null) {
|
|
499
|
-
cancelAnimationFrame(fadeTimerRef.current);
|
|
500
|
-
}
|
|
501
|
-
if (trimTimerRef.current !== null) {
|
|
502
|
-
window.clearTimeout(trimTimerRef.current);
|
|
503
|
-
}
|
|
504
|
-
};
|
|
505
|
-
}, []);
|
|
506
464
|
const { volume: playbackVolume, playbackRate } = mediaPlaybackAttributes({
|
|
507
465
|
loop: element.loop,
|
|
508
466
|
volume: element.volume,
|
|
@@ -525,7 +483,7 @@ function PresentationMediaController({
|
|
|
525
483
|
if (!el) {
|
|
526
484
|
return;
|
|
527
485
|
}
|
|
528
|
-
const
|
|
486
|
+
const handlePlay = () => {
|
|
529
487
|
setIsMediaPlaying(true);
|
|
530
488
|
onPlayStateChange?.(true);
|
|
531
489
|
};
|
|
@@ -537,101 +495,35 @@ function PresentationMediaController({
|
|
|
537
495
|
setIsMediaPlaying(false);
|
|
538
496
|
onPlayStateChange?.(false);
|
|
539
497
|
};
|
|
540
|
-
el.addEventListener("play",
|
|
498
|
+
el.addEventListener("play", handlePlay);
|
|
541
499
|
el.addEventListener("pause", handlePause);
|
|
542
500
|
el.addEventListener("ended", handleEnded);
|
|
543
501
|
return () => {
|
|
544
|
-
el.removeEventListener("play",
|
|
502
|
+
el.removeEventListener("play", handlePlay);
|
|
545
503
|
el.removeEventListener("pause", handlePause);
|
|
546
504
|
el.removeEventListener("ended", handleEnded);
|
|
547
505
|
};
|
|
548
506
|
}, [onPlayStateChange]);
|
|
549
|
-
|
|
550
|
-
const el = mediaRef.current;
|
|
551
|
-
if (!el || fadeIn <= 0) {
|
|
552
|
-
return;
|
|
553
|
-
}
|
|
554
|
-
const startTime = performance.now();
|
|
555
|
-
const durationMs = fadeIn * 1e3;
|
|
556
|
-
el.volume = 0;
|
|
557
|
-
const tick = () => {
|
|
558
|
-
const elapsed = performance.now() - startTime;
|
|
559
|
-
const progress = Math.min(1, elapsed / durationMs);
|
|
560
|
-
el.volume = progress * volume;
|
|
561
|
-
if (progress < 1) {
|
|
562
|
-
fadeTimerRef.current = requestAnimationFrame(tick);
|
|
563
|
-
}
|
|
564
|
-
};
|
|
565
|
-
fadeTimerRef.current = requestAnimationFrame(tick);
|
|
566
|
-
}, [fadeIn, volume]);
|
|
567
|
-
const handlePlay = useCallback(() => {
|
|
507
|
+
useEffect(() => {
|
|
568
508
|
const el = mediaRef.current;
|
|
569
509
|
if (!el || !isPresentationMode) {
|
|
570
510
|
return;
|
|
571
511
|
}
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
const fadeOutTick = () => {
|
|
588
|
-
const elapsed = performance.now() - fadeStartTime;
|
|
589
|
-
const progress = Math.min(1, elapsed / fadeMs);
|
|
590
|
-
el.volume = startVol * (1 - progress);
|
|
591
|
-
if (progress < 1 && !el.paused) {
|
|
592
|
-
fadeTimerRef.current = requestAnimationFrame(fadeOutTick);
|
|
593
|
-
}
|
|
594
|
-
};
|
|
595
|
-
fadeTimerRef.current = requestAnimationFrame(fadeOutTick);
|
|
596
|
-
}, fadeOutStart);
|
|
597
|
-
}
|
|
598
|
-
const stopTimer = window.setTimeout(() => {
|
|
599
|
-
if (!el.paused) {
|
|
600
|
-
el.pause();
|
|
601
|
-
el.currentTime = trimEndSec;
|
|
602
|
-
}
|
|
603
|
-
}, remaining * 1e3);
|
|
604
|
-
const prevTimer = trimTimerRef.current;
|
|
605
|
-
trimTimerRef.current = stopTimer;
|
|
606
|
-
if (prevTimer !== null) {
|
|
607
|
-
window.clearTimeout(prevTimer);
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
} else if (fadeOut > 0) {
|
|
611
|
-
const handleTimeUpdate = () => {
|
|
612
|
-
if (!Number.isFinite(el.duration)) {
|
|
613
|
-
return;
|
|
614
|
-
}
|
|
615
|
-
const timeLeft = el.duration - el.currentTime;
|
|
616
|
-
if (timeLeft <= fadeOut && timeLeft > 0) {
|
|
617
|
-
el.removeEventListener("timeupdate", handleTimeUpdate);
|
|
618
|
-
const fadeStartTime = performance.now();
|
|
619
|
-
const fadeMs = timeLeft * 1e3;
|
|
620
|
-
const startVol = el.volume;
|
|
621
|
-
const fadeOutTick = () => {
|
|
622
|
-
const elapsed = performance.now() - fadeStartTime;
|
|
623
|
-
const progress = Math.min(1, elapsed / fadeMs);
|
|
624
|
-
el.volume = startVol * (1 - progress);
|
|
625
|
-
if (progress < 1 && !el.paused) {
|
|
626
|
-
fadeTimerRef.current = requestAnimationFrame(fadeOutTick);
|
|
627
|
-
}
|
|
628
|
-
};
|
|
629
|
-
fadeTimerRef.current = requestAnimationFrame(fadeOutTick);
|
|
630
|
-
}
|
|
631
|
-
};
|
|
632
|
-
el.addEventListener("timeupdate", handleTimeUpdate);
|
|
633
|
-
}
|
|
634
|
-
}, [applyFadeIn, fadeIn, fadeOut, isPresentationMode, trimEndSec, trimStartSec]);
|
|
512
|
+
return scheduleMediaTrimAndFade(el, {
|
|
513
|
+
trimStartMs: element.trimStartMs,
|
|
514
|
+
trimEndMs: element.trimEndMs,
|
|
515
|
+
fadeInDuration: element.fadeInDuration,
|
|
516
|
+
fadeOutDuration: element.fadeOutDuration,
|
|
517
|
+
volume: playbackVolume
|
|
518
|
+
});
|
|
519
|
+
}, [
|
|
520
|
+
isPresentationMode,
|
|
521
|
+
element.trimStartMs,
|
|
522
|
+
element.trimEndMs,
|
|
523
|
+
element.fadeInDuration,
|
|
524
|
+
element.fadeOutDuration,
|
|
525
|
+
playbackVolume
|
|
526
|
+
]);
|
|
635
527
|
useEffect(() => {
|
|
636
528
|
if (!isPresentationMode || !shouldAutoPlay) {
|
|
637
529
|
return;
|
|
@@ -666,8 +558,10 @@ function PresentationMediaController({
|
|
|
666
558
|
el.pause();
|
|
667
559
|
}
|
|
668
560
|
}, []);
|
|
561
|
+
const noopOnPlay = useCallback(() => {
|
|
562
|
+
}, []);
|
|
669
563
|
return /* @__PURE__ */ jsxs("div", { className: "w-full h-full", style: wrapperStyle, children: [
|
|
670
|
-
children({ mediaRef, onPlay:
|
|
564
|
+
children({ mediaRef, onPlay: noopOnPlay, isMediaPlaying }),
|
|
671
565
|
isFullScreen && isPresentationMode && isMediaPlaying && /* @__PURE__ */ jsx(
|
|
672
566
|
"button",
|
|
673
567
|
{
|
|
@@ -1130,7 +1024,7 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1130
1024
|
return spec.spans.map((span, index) => {
|
|
1131
1025
|
const content = span.style && renderPiece ? renderPiece(span.style, span.text, String(index)) : span.text;
|
|
1132
1026
|
if (!span.animId) {
|
|
1133
|
-
return /* @__PURE__ */ jsx(
|
|
1027
|
+
return /* @__PURE__ */ jsx(React7.Fragment, { children: content }, `ws-${index}`);
|
|
1134
1028
|
}
|
|
1135
1029
|
return /* @__PURE__ */ jsx(
|
|
1136
1030
|
"span",
|
|
@@ -1143,13 +1037,61 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1143
1037
|
);
|
|
1144
1038
|
});
|
|
1145
1039
|
}
|
|
1146
|
-
function
|
|
1147
|
-
|
|
1040
|
+
function renderUnderlineWords(text, isUnderlineWords, wordDecoration, metric, keyPrefix, inner) {
|
|
1041
|
+
if (!isUnderlineWords || !text) {
|
|
1042
|
+
return inner(text, keyPrefix, metric);
|
|
1043
|
+
}
|
|
1044
|
+
const pieces = splitWordsForUnderline(text);
|
|
1045
|
+
if (pieces.length === 0) {
|
|
1046
|
+
return inner(text, keyPrefix, metric);
|
|
1047
|
+
}
|
|
1048
|
+
const gapMetric = metric ? {
|
|
1049
|
+
...metric,
|
|
1050
|
+
nestedStyle: metric.nestedStyle ? stripUnderlineDecoration(metric.nestedStyle) : void 0
|
|
1051
|
+
} : void 0;
|
|
1052
|
+
return pieces.map((piece, i) => {
|
|
1053
|
+
const key = `${keyPrefix}-u${i}`;
|
|
1054
|
+
if (!piece.underline) {
|
|
1055
|
+
return /* @__PURE__ */ jsx(React7.Fragment, { children: inner(piece.text, key, gapMetric) }, key);
|
|
1056
|
+
}
|
|
1057
|
+
return /* @__PURE__ */ jsx("span", { style: wordDecoration, children: inner(piece.text, key, metric) }, key);
|
|
1058
|
+
});
|
|
1059
|
+
}
|
|
1060
|
+
function makeSegmentPieceRenderer(needsScriptFonts, scriptFonts, baseFontFamily, isUnderlineWords, wordDecoration, metric) {
|
|
1061
|
+
return (text, key) => renderUnderlineWords(
|
|
1062
|
+
text,
|
|
1063
|
+
isUnderlineWords,
|
|
1064
|
+
wordDecoration,
|
|
1065
|
+
metric,
|
|
1066
|
+
key,
|
|
1067
|
+
(subText, subKey, subMetric) => renderMetricPieces(
|
|
1068
|
+
subText,
|
|
1069
|
+
subMetric,
|
|
1070
|
+
subKey,
|
|
1071
|
+
(pieceText, pieceKey) => renderScriptAwareText(
|
|
1072
|
+
pieceText,
|
|
1073
|
+
needsScriptFonts,
|
|
1074
|
+
scriptFonts,
|
|
1075
|
+
baseFontFamily,
|
|
1076
|
+
pieceKey,
|
|
1077
|
+
subMetric?.nestedStyle
|
|
1078
|
+
)
|
|
1079
|
+
)
|
|
1080
|
+
);
|
|
1081
|
+
}
|
|
1082
|
+
function renderTabbedLine(line, ctx, keyPrefix, renderPiece, nestedStyle, underlineWords = false) {
|
|
1083
|
+
const [lineLayout] = buildRunTabLines(
|
|
1084
|
+
line,
|
|
1085
|
+
ctx,
|
|
1086
|
+
nestedStyle,
|
|
1087
|
+
void 0,
|
|
1088
|
+
underlineWords
|
|
1089
|
+
);
|
|
1148
1090
|
return /* @__PURE__ */ jsx("span", { style: { display: "inline-block", whiteSpace: "nowrap" }, children: lineLayout.pieces.map((piece, i) => {
|
|
1149
1091
|
const key = `${keyPrefix}-tab-${i}`;
|
|
1150
|
-
return /* @__PURE__ */ jsxs(
|
|
1092
|
+
return /* @__PURE__ */ jsxs(React7.Fragment, { children: [
|
|
1151
1093
|
piece.leaderStyle ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", style: piece.leaderStyle, children: piece.leaderText }) : null,
|
|
1152
|
-
/* @__PURE__ */ jsx("span", { style: piece.style, children: renderPiece(piece.text, key) })
|
|
1094
|
+
piece.words ? piece.words.map((word, w) => /* @__PURE__ */ jsx("span", { style: word.style, children: renderPiece(word.text, `${key}-w${w}`) }, `${key}-w${w}`)) : /* @__PURE__ */ jsx("span", { style: piece.style, children: renderPiece(piece.text, key) })
|
|
1153
1095
|
] }, key);
|
|
1154
1096
|
}) });
|
|
1155
1097
|
}
|
|
@@ -1167,7 +1109,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1167
1109
|
return text;
|
|
1168
1110
|
}
|
|
1169
1111
|
return pieces.map(
|
|
1170
|
-
(piece, i) => piece.style ? /* @__PURE__ */ jsx("span", { style: piece.style, children: piece.text }, `${keyPrefix}-r${i}`) : /* @__PURE__ */ jsx(
|
|
1112
|
+
(piece, i) => piece.style ? /* @__PURE__ */ jsx("span", { style: piece.style, children: piece.text }, `${keyPrefix}-r${i}`) : /* @__PURE__ */ jsx(React7.Fragment, { children: piece.text }, `${keyPrefix}-r${i}`)
|
|
1171
1113
|
);
|
|
1172
1114
|
}
|
|
1173
1115
|
function renderMetricPieces(text, metric, keyPrefix, inner) {
|
|
@@ -1190,26 +1132,28 @@ function renderMetricPieces(text, metric, keyPrefix, inner) {
|
|
|
1190
1132
|
`${keyPrefix}-w${i}`
|
|
1191
1133
|
));
|
|
1192
1134
|
}
|
|
1193
|
-
function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsScriptFonts, scriptFonts, baseFontFamily, findHighlights, tabContext, metric) {
|
|
1135
|
+
function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsScriptFonts, scriptFonts, baseFontFamily, findHighlights, tabContext, metric, isUnderlineWords = false, wordDecoration) {
|
|
1194
1136
|
const segHl = findHighlights?.get(segmentIndex);
|
|
1137
|
+
const renderLeaf = makeSegmentPieceRenderer(
|
|
1138
|
+
needsScriptFonts,
|
|
1139
|
+
scriptFonts,
|
|
1140
|
+
baseFontFamily,
|
|
1141
|
+
isUnderlineWords,
|
|
1142
|
+
wordDecoration,
|
|
1143
|
+
metric
|
|
1144
|
+
);
|
|
1195
1145
|
if (!segHl || segHl.length === 0) {
|
|
1196
1146
|
return lines.map((line, lineIndex) => {
|
|
1197
1147
|
const lineKey = `${elementId}-seg-${segmentIndex}-line-${lineIndex}`;
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
pieceKey,
|
|
1208
|
-
metric?.nestedStyle
|
|
1209
|
-
)
|
|
1210
|
-
);
|
|
1211
|
-
return /* @__PURE__ */ jsxs(React6.Fragment, { children: [
|
|
1212
|
-
tabContext && line.includes(" ") ? renderTabbedLine(line, tabContext, lineKey, renderPiece, metric?.nestedStyle) : renderPiece(line, lineKey),
|
|
1148
|
+
return /* @__PURE__ */ jsxs(React7.Fragment, { children: [
|
|
1149
|
+
tabContext && line.includes(" ") ? renderTabbedLine(
|
|
1150
|
+
line,
|
|
1151
|
+
tabContext,
|
|
1152
|
+
lineKey,
|
|
1153
|
+
renderLeaf,
|
|
1154
|
+
metric?.nestedStyle,
|
|
1155
|
+
isUnderlineWords
|
|
1156
|
+
) : renderLeaf(line, lineKey),
|
|
1213
1157
|
lineIndex < lines.length - 1 ? /* @__PURE__ */ jsx("br", {}) : null
|
|
1214
1158
|
] }, lineKey);
|
|
1215
1159
|
});
|
|
@@ -1239,19 +1183,6 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1239
1183
|
isCurrent: false
|
|
1240
1184
|
});
|
|
1241
1185
|
}
|
|
1242
|
-
const renderChunk = (text, key) => renderMetricPieces(
|
|
1243
|
-
text,
|
|
1244
|
-
metric,
|
|
1245
|
-
key,
|
|
1246
|
-
(pieceText, pieceKey) => renderScriptAwareText(
|
|
1247
|
-
pieceText,
|
|
1248
|
-
needsScriptFonts,
|
|
1249
|
-
scriptFonts,
|
|
1250
|
-
baseFontFamily,
|
|
1251
|
-
pieceKey,
|
|
1252
|
-
metric?.nestedStyle
|
|
1253
|
-
)
|
|
1254
|
-
);
|
|
1255
1186
|
return chunks.map((chunk, ci) => {
|
|
1256
1187
|
const chunkKey = `${elementId}-seg-${segmentIndex}-hl-${ci}`;
|
|
1257
1188
|
return chunk.highlighted ? /* @__PURE__ */ jsx(
|
|
@@ -1263,10 +1194,10 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1263
1194
|
color: "inherit",
|
|
1264
1195
|
borderRadius: 2
|
|
1265
1196
|
},
|
|
1266
|
-
children:
|
|
1197
|
+
children: renderLeaf(chunk.text, chunkKey)
|
|
1267
1198
|
},
|
|
1268
1199
|
chunkKey
|
|
1269
|
-
) : /* @__PURE__ */ jsx(
|
|
1200
|
+
) : /* @__PURE__ */ jsx(React7.Fragment, { children: renderLeaf(chunk.text, chunkKey) }, chunkKey);
|
|
1270
1201
|
});
|
|
1271
1202
|
}
|
|
1272
1203
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
@@ -1328,11 +1259,12 @@ function renderHyperlink(run, spanNode, key, ctx) {
|
|
|
1328
1259
|
}
|
|
1329
1260
|
const requireCtrlClick = ctx.requireCtrlClick;
|
|
1330
1261
|
const displayUrl = url.startsWith("ppaction://") ? url.replace(/^ppaction:\/\//u, "").split("?")[0] : url;
|
|
1262
|
+
const targetFrame = run.hyperlink?.target;
|
|
1331
1263
|
const follow = (modified) => {
|
|
1332
1264
|
if (requireCtrlClick && !modified) {
|
|
1333
1265
|
return false;
|
|
1334
1266
|
}
|
|
1335
|
-
onHyperlinkClick(url);
|
|
1267
|
+
onHyperlinkClick(url, targetFrame);
|
|
1336
1268
|
return true;
|
|
1337
1269
|
};
|
|
1338
1270
|
return /* @__PURE__ */ jsxs(
|
|
@@ -1448,6 +1380,16 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1448
1380
|
spanStyle.direction = runRtl ? "rtl" : "ltr";
|
|
1449
1381
|
spanStyle.unicodeBidi = runRtl !== ctx.paragraphRtl ? "bidi-override" : "embed";
|
|
1450
1382
|
}
|
|
1383
|
+
const isUnderlineWords = Boolean(segmentStyle.underline) && segmentStyle.underlineStyle === "words";
|
|
1384
|
+
const wordDecoration = isUnderlineWords ? nestedStyle ?? run.underlineWordPieces?.find((piece) => piece.style)?.style : void 0;
|
|
1385
|
+
if (isUnderlineWords) {
|
|
1386
|
+
const stripped = stripUnderlineDecoration(spanStyle);
|
|
1387
|
+
spanStyle.textDecoration = stripped.textDecoration;
|
|
1388
|
+
delete spanStyle.textDecorationStyle;
|
|
1389
|
+
delete spanStyle.textDecorationThickness;
|
|
1390
|
+
delete spanStyle.textUnderlineOffset;
|
|
1391
|
+
delete spanStyle.textDecorationColor;
|
|
1392
|
+
}
|
|
1451
1393
|
const baseContent = renderSegmentContent(
|
|
1452
1394
|
element.id,
|
|
1453
1395
|
segmentIndex,
|
|
@@ -1465,7 +1407,9 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1465
1407
|
Boolean(segmentStyle.bold),
|
|
1466
1408
|
Boolean(segmentStyle.italic)
|
|
1467
1409
|
),
|
|
1468
|
-
metricContext
|
|
1410
|
+
metricContext,
|
|
1411
|
+
isUnderlineWords,
|
|
1412
|
+
wordDecoration
|
|
1469
1413
|
);
|
|
1470
1414
|
const spanNode = /* @__PURE__ */ jsx("span", { "data-seg-idx": segmentIndex, style: spanStyle, children: renderRubyOrText(run, baseContent) }, key);
|
|
1471
1415
|
const reflectedNode = wrapWithTextReflection(run, key, spanNode, spanStyle, baseContent);
|
|
@@ -1570,7 +1514,7 @@ function renderParagraph(para, paraIndex, paraCount, segments, ctx, subElementAn
|
|
|
1570
1514
|
);
|
|
1571
1515
|
const needsWrapper = Object.keys(paraStyle).length > 0 || marker !== null;
|
|
1572
1516
|
if (!needsWrapper) {
|
|
1573
|
-
return /* @__PURE__ */ jsxs(
|
|
1517
|
+
return /* @__PURE__ */ jsxs(React7.Fragment, { children: [
|
|
1574
1518
|
wrappedContent,
|
|
1575
1519
|
paraIndex < paraCount - 1 ? /* @__PURE__ */ jsx("br", {}) : null
|
|
1576
1520
|
] }, `${element.id}-para-${paraIndex}`);
|
|
@@ -1959,6 +1903,34 @@ function renderConnectorMarker(markerId, arrowType, color, arrowWidth, arrowLeng
|
|
|
1959
1903
|
}
|
|
1960
1904
|
);
|
|
1961
1905
|
}
|
|
1906
|
+
function renderSvgGradientDefs(gradient) {
|
|
1907
|
+
if (!gradient) {
|
|
1908
|
+
return null;
|
|
1909
|
+
}
|
|
1910
|
+
if (gradient.kind === "rectPath") {
|
|
1911
|
+
return /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("pattern", { id: gradient.id, patternUnits: "objectBoundingBox", width: 1, height: 1, children: /* @__PURE__ */ jsx("image", { href: gradient.href, x: 0, y: 0, width: 1, height: 1, preserveAspectRatio: "none" }) }) });
|
|
1912
|
+
}
|
|
1913
|
+
const stops = gradient.stops.map((stop, index) => /* @__PURE__ */ jsx(
|
|
1914
|
+
"stop",
|
|
1915
|
+
{
|
|
1916
|
+
offset: stop.offset,
|
|
1917
|
+
stopColor: stop.color,
|
|
1918
|
+
stopOpacity: typeof stop.opacity === "number" ? stop.opacity : void 0
|
|
1919
|
+
},
|
|
1920
|
+
index
|
|
1921
|
+
));
|
|
1922
|
+
return /* @__PURE__ */ jsx("defs", { children: gradient.kind === "radial" ? /* @__PURE__ */ jsx("radialGradient", { id: gradient.id, cx: gradient.cx, cy: gradient.cy, r: gradient.r, children: stops }) : /* @__PURE__ */ jsx(
|
|
1923
|
+
"linearGradient",
|
|
1924
|
+
{
|
|
1925
|
+
id: gradient.id,
|
|
1926
|
+
x1: gradient.x1,
|
|
1927
|
+
y1: gradient.y1,
|
|
1928
|
+
x2: gradient.x2,
|
|
1929
|
+
y2: gradient.y2,
|
|
1930
|
+
children: stops
|
|
1931
|
+
}
|
|
1932
|
+
) });
|
|
1933
|
+
}
|
|
1962
1934
|
function joinStyle(shapeStyle) {
|
|
1963
1935
|
const lineJoin = shapeStyle?.lineJoin === "bevel" ? "bevel" : shapeStyle?.lineJoin === "miter" ? "miter" : "round";
|
|
1964
1936
|
const miterLimit = lineJoin === "miter" && typeof shapeStyle?.miterLimit === "number" ? Math.max(shapeStyle.miterLimit / 1e5, 1) : void 0;
|
|
@@ -1995,31 +1967,6 @@ function strokeStrands(d, keyBase, ctx) {
|
|
|
1995
1967
|
`${keyBase}-s${idx}`
|
|
1996
1968
|
));
|
|
1997
1969
|
}
|
|
1998
|
-
function gradientDefs(gradient) {
|
|
1999
|
-
if (!gradient) {
|
|
2000
|
-
return null;
|
|
2001
|
-
}
|
|
2002
|
-
const stops = gradient.stops.map((stop, idx) => /* @__PURE__ */ jsx(
|
|
2003
|
-
"stop",
|
|
2004
|
-
{
|
|
2005
|
-
offset: stop.offset,
|
|
2006
|
-
stopColor: stop.color,
|
|
2007
|
-
stopOpacity: typeof stop.opacity === "number" ? stop.opacity : void 0
|
|
2008
|
-
},
|
|
2009
|
-
idx
|
|
2010
|
-
));
|
|
2011
|
-
return /* @__PURE__ */ jsx("defs", { children: gradient.kind === "radial" ? /* @__PURE__ */ jsx("radialGradient", { id: gradient.id, cx: gradient.cx, cy: gradient.cy, r: gradient.r, children: stops }) : /* @__PURE__ */ jsx(
|
|
2012
|
-
"linearGradient",
|
|
2013
|
-
{
|
|
2014
|
-
id: gradient.id,
|
|
2015
|
-
x1: gradient.x1,
|
|
2016
|
-
y1: gradient.y1,
|
|
2017
|
-
x2: gradient.x2,
|
|
2018
|
-
y2: gradient.y2,
|
|
2019
|
-
children: stops
|
|
2020
|
-
}
|
|
2021
|
-
) });
|
|
2022
|
-
}
|
|
2023
1970
|
function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredPaths, shapeStyle, hasFill, fillColor, fillOpacity, strokePaint, strokeWidth, dashArray, animatesFill = false, gradient) {
|
|
2024
1971
|
const ctx = strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray);
|
|
2025
1972
|
const subpaths = structuredPaths && structuredPaths.length > 0 ? customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
@@ -2075,29 +2022,12 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2075
2022
|
className: "w-full h-full pointer-events-none",
|
|
2076
2023
|
preserveAspectRatio: "none",
|
|
2077
2024
|
children: [
|
|
2078
|
-
animatesFill ? null :
|
|
2025
|
+
animatesFill ? null : renderSvgGradientDefs(gradient),
|
|
2079
2026
|
nodes
|
|
2080
2027
|
]
|
|
2081
2028
|
}
|
|
2082
2029
|
);
|
|
2083
2030
|
}
|
|
2084
|
-
function renderGradientDefs(gradient) {
|
|
2085
|
-
if (!gradient) {
|
|
2086
|
-
return null;
|
|
2087
|
-
}
|
|
2088
|
-
const stops = gradient.stops.map((stop, index) => /* @__PURE__ */ jsx("stop", { offset: stop.offset, stopColor: stop.color, stopOpacity: stop.opacity }, index));
|
|
2089
|
-
return /* @__PURE__ */ jsx("defs", { children: gradient.kind === "radial" ? /* @__PURE__ */ jsx("radialGradient", { id: gradient.id, cx: gradient.cx, cy: gradient.cy, r: gradient.r, children: stops }) : /* @__PURE__ */ jsx(
|
|
2090
|
-
"linearGradient",
|
|
2091
|
-
{
|
|
2092
|
-
id: gradient.id,
|
|
2093
|
-
x1: gradient.x1,
|
|
2094
|
-
y1: gradient.y1,
|
|
2095
|
-
x2: gradient.x2,
|
|
2096
|
-
y2: gradient.y2,
|
|
2097
|
-
children: stops
|
|
2098
|
-
}
|
|
2099
|
-
) });
|
|
2100
|
-
}
|
|
2101
2031
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2102
2032
|
if (!hasShapeProperties(element)) {
|
|
2103
2033
|
return null;
|
|
@@ -2248,7 +2178,7 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2248
2178
|
overflow: "visible"
|
|
2249
2179
|
},
|
|
2250
2180
|
children: [
|
|
2251
|
-
animatesFill ? null :
|
|
2181
|
+
animatesFill ? null : renderSvgGradientDefs(gradient),
|
|
2252
2182
|
/* @__PURE__ */ jsx(
|
|
2253
2183
|
"path",
|
|
2254
2184
|
{
|
|
@@ -3143,7 +3073,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3143
3073
|
const rowCount = tableData.rows.length;
|
|
3144
3074
|
const columnCount = tableData.columnWidths.length;
|
|
3145
3075
|
const selectedCell = options?.selectedCell || null;
|
|
3146
|
-
const isEditable = Boolean(options?.editable);
|
|
3076
|
+
const isEditable = Boolean(options?.editable) && canDrillDown(element);
|
|
3147
3077
|
const hasCellSelectionHandler = typeof options?.onSelectCell === "function";
|
|
3148
3078
|
const sharedCtx = {
|
|
3149
3079
|
tableStyleMap: options?.styleCtx?.tableStyleMap,
|
|
@@ -3308,7 +3238,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3308
3238
|
return /* @__PURE__ */ jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: translationsEn["pptx.table.title"] });
|
|
3309
3239
|
}
|
|
3310
3240
|
const selectedCell = options?.selectedCell || null;
|
|
3311
|
-
const isEditable = Boolean(options?.editable);
|
|
3241
|
+
const isEditable = Boolean(options?.editable) && canDrillDown(element);
|
|
3312
3242
|
const hasCellSelectionHandler = typeof options?.onSelectCell === "function";
|
|
3313
3243
|
const tableEl = element;
|
|
3314
3244
|
const xmlSelectionRect = (() => {
|
|
@@ -3664,16 +3594,50 @@ function renderChartViewModel(elementId, vm, preserveAspectRatio = "none") {
|
|
|
3664
3594
|
viewBox: `0 0 ${vm.svgWidth} ${vm.svgHeight}`,
|
|
3665
3595
|
preserveAspectRatio,
|
|
3666
3596
|
children: [
|
|
3667
|
-
vm.
|
|
3597
|
+
vm.defs && vm.defs.length > 0 && /* @__PURE__ */ jsx("defs", { children: vm.defs.map((def, i) => /* @__PURE__ */ jsx(
|
|
3598
|
+
"pattern",
|
|
3599
|
+
{
|
|
3600
|
+
id: def.id,
|
|
3601
|
+
patternUnits: def.patternUnits,
|
|
3602
|
+
x: def.x,
|
|
3603
|
+
y: def.y,
|
|
3604
|
+
width: def.width,
|
|
3605
|
+
height: def.height,
|
|
3606
|
+
children: /* @__PURE__ */ jsx(
|
|
3607
|
+
"image",
|
|
3608
|
+
{
|
|
3609
|
+
href: def.href,
|
|
3610
|
+
x: 0,
|
|
3611
|
+
y: 0,
|
|
3612
|
+
width: def.width,
|
|
3613
|
+
height: def.height,
|
|
3614
|
+
preserveAspectRatio: def.preserveAspectRatio
|
|
3615
|
+
}
|
|
3616
|
+
)
|
|
3617
|
+
},
|
|
3618
|
+
`${elementId}-def-${i}`
|
|
3619
|
+
)) }),
|
|
3620
|
+
vm.areaFill && /* @__PURE__ */ jsx(
|
|
3621
|
+
"rect",
|
|
3622
|
+
{
|
|
3623
|
+
x: 0,
|
|
3624
|
+
y: 0,
|
|
3625
|
+
width: vm.svgWidth,
|
|
3626
|
+
height: vm.svgHeight,
|
|
3627
|
+
rx: vm.areaRadius,
|
|
3628
|
+
fill: vm.areaFill
|
|
3629
|
+
}
|
|
3630
|
+
),
|
|
3668
3631
|
vm.title && /* @__PURE__ */ jsx(
|
|
3669
3632
|
"text",
|
|
3670
3633
|
{
|
|
3671
3634
|
x: vm.titleX,
|
|
3672
3635
|
y: vm.titleY,
|
|
3673
3636
|
textAnchor: "middle",
|
|
3674
|
-
fontSize: 12,
|
|
3675
|
-
fontWeight: 600,
|
|
3676
|
-
|
|
3637
|
+
fontSize: vm.titleStyle?.fontSize ?? 12,
|
|
3638
|
+
fontWeight: vm.titleStyle?.fontWeight ?? 600,
|
|
3639
|
+
fontFamily: vm.titleStyle?.fontFamily,
|
|
3640
|
+
fill: vm.titleStyle?.fill ?? "#1e293b",
|
|
3677
3641
|
"data-chart-part": "title",
|
|
3678
3642
|
children: vm.title
|
|
3679
3643
|
}
|
|
@@ -3867,4 +3831,4 @@ function stopPreviewAnimation() {
|
|
|
3867
3831
|
activePreview = null;
|
|
3868
3832
|
}
|
|
3869
3833
|
|
|
3870
|
-
export { ANIMATION_PRESET_OPTIONS, ARROW_SIZE_OPTIONS, CONNECTOR_ARROW_OPTIONS, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, DEFAULT_FILL_COLOR, DEFAULT_FONT_FAMILY2 as DEFAULT_FONT_FAMILY, DEFAULT_SECTION_GROUP_ID, DEFAULT_STROKE_COLOR, DEFAULT_TABLE_COLUMNS, DEFAULT_TABLE_ROWS, DEFAULT_TEXT_COLOR, DEFAULT_TEXT_FONT_SIZE, GRID_SIZE, HYPERLINK_COLOR, MIN_ELEMENT_SIZE, SHAPE_PRESETS, SHORTCUT_REFERENCE_ITEMS, SLIDE_NAV_THUMBNAIL_WIDTH, STROKE_DASH_OPTIONS2 as STROKE_DASH_OPTIONS,
|
|
3834
|
+
export { ANIMATION_PRESET_OPTIONS, ARROW_SIZE_OPTIONS, CONNECTOR_ARROW_OPTIONS, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, DEFAULT_FILL_COLOR, DEFAULT_FONT_FAMILY2 as DEFAULT_FONT_FAMILY, DEFAULT_SECTION_GROUP_ID, DEFAULT_STROKE_COLOR, DEFAULT_TABLE_COLUMNS, DEFAULT_TABLE_ROWS, DEFAULT_TEXT_COLOR, DEFAULT_TEXT_FONT_SIZE, GRID_SIZE, HYPERLINK_COLOR, MIN_ELEMENT_SIZE, SHAPE_PRESETS, SHORTCUT_REFERENCE_ITEMS, SLIDE_NAV_THUMBNAIL_WIDTH, STROKE_DASH_OPTIONS2 as STROKE_DASH_OPTIONS, TOOLBAR_SECTIONS, UNGROUPED_SECTION_ID, ZOOM_TO_SELECTION_PADDING, build3DExtrusionData2 as build3DExtrusionData, buildLineGlowFilter, buildLineShadowCss, buildNotesPdf, buildPdfFromImageData, buildReactChartViewModel, buildTextBody3DSceneStyle2 as buildTextBody3DSceneStyle, cloneHistorySnapshot2 as cloneHistorySnapshot, cn, getAnimationInitialStyle2 as getAnimationInitialStyle, getConnectorPathGeometry, getCropShapeClipPath2 as getCropShapeClipPath, getDuotoneColors, getImageRenderStyle, getImageSurfaceMaskStyle, getImageSurfaceStyle, getImageTilingStyle2 as getImageTilingStyle, getShapeVisualStyle, getTextLayoutStyle, getTextStyleForElement, getTextWarpStyle, hasDagDuotoneEffect, isConnectorOrLineElement, renderChartElement, renderConnectorMarker, renderDagDuotoneSvgFilter, renderMediaElement, renderTableElement, renderTextSegments, renderVectorShape, shouldRenderFallbackLabel, startMotionPathPreview, startPreviewAnimation, stopPreviewAnimation };
|
|
Binary file
|
|
Binary file
|