pptx-react-viewer 4.6.0 → 4.8.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 +86 -0
- package/dist/{AiChatPanel-3C7GM6ZF.js → AiChatPanel-4LMJIJUU.js} +28 -28
- package/dist/AiChatPanel-4LMJIJUU.js.br +0 -0
- package/dist/AiChatPanel-4LMJIJUU.js.gz +0 -0
- package/dist/{AiChatPanel-L7DBCWE3.mjs → AiChatPanel-XWYLYN26.mjs} +4 -4
- package/dist/AiChatPanel-XWYLYN26.mjs.br +0 -0
- package/dist/AiChatPanel-XWYLYN26.mjs.gz +0 -0
- package/dist/{Model3DScene-IJ7YYTYU.mjs → Model3DScene-N6IZ7Q57.mjs} +1 -1
- package/dist/Model3DScene-N6IZ7Q57.mjs.br +0 -0
- package/dist/Model3DScene-N6IZ7Q57.mjs.gz +0 -0
- package/dist/{Model3DScene-USKNPWWH.js → Model3DScene-YAPQ5BCI.js} +2 -2
- package/dist/{Model3DScene-USKNPWWH.js.br → Model3DScene-YAPQ5BCI.js.br} +0 -0
- package/dist/Model3DScene-YAPQ5BCI.js.gz +0 -0
- package/dist/{chunk-ZAQFTO4P.mjs → chunk-KHEJXP4I.mjs} +1175 -149
- package/dist/chunk-KHEJXP4I.mjs.br +0 -0
- package/dist/chunk-KHEJXP4I.mjs.gz +0 -0
- package/dist/{chunk-3JUZOKFI.js → chunk-LTBTG2QB.js} +108 -96
- package/dist/chunk-LTBTG2QB.js.br +0 -0
- package/dist/chunk-LTBTG2QB.js.gz +0 -0
- package/dist/{chunk-ICEZL4TM.mjs → chunk-NPZOVIHG.mjs} +40855 -16211
- package/dist/chunk-NPZOVIHG.mjs.br +0 -0
- package/dist/chunk-NPZOVIHG.mjs.gz +0 -0
- package/dist/{chunk-DFSWCVRW.js → chunk-NV2H57Q4.js} +3083 -2057
- package/dist/chunk-NV2H57Q4.js.br +0 -0
- package/dist/chunk-NV2H57Q4.js.gz +0 -0
- package/dist/{chunk-VCAQSSGD.mjs → chunk-Q4XJSJYI.mjs} +1 -1
- package/dist/chunk-Q4XJSJYI.mjs.br +0 -0
- package/dist/chunk-Q4XJSJYI.mjs.gz +0 -0
- package/dist/{chunk-IBHIXBC5.js → chunk-Q7NWWIPQ.js} +890 -1091
- package/dist/chunk-Q7NWWIPQ.js.br +0 -0
- package/dist/chunk-Q7NWWIPQ.js.gz +0 -0
- package/dist/{chunk-Y4QUVWZC.js → chunk-SAYZSUNQ.js} +315 -274
- package/dist/chunk-SAYZSUNQ.js.br +0 -0
- package/dist/chunk-SAYZSUNQ.js.gz +0 -0
- package/dist/{chunk-INX3E37P.mjs → chunk-SOMUGI3Y.mjs} +84 -286
- package/dist/chunk-SOMUGI3Y.mjs.br +0 -0
- package/dist/chunk-SOMUGI3Y.mjs.gz +0 -0
- package/dist/{chunk-K6QHGABT.mjs → chunk-SSXGPYBF.mjs} +109 -68
- package/dist/chunk-SSXGPYBF.mjs.br +0 -0
- package/dist/chunk-SSXGPYBF.mjs.gz +0 -0
- package/dist/{chunk-5V5SMT5A.js → chunk-UTP22QYH.js} +5 -5
- package/dist/chunk-UTP22QYH.js.br +0 -0
- package/dist/chunk-UTP22QYH.js.gz +0 -0
- package/dist/{chunk-FZSYLXJT.js → chunk-YF2BQIW3.js} +40903 -16217
- package/dist/chunk-YF2BQIW3.js.br +0 -0
- package/dist/chunk-YF2BQIW3.js.gz +0 -0
- package/dist/{chunk-OOO4JL2N.mjs → chunk-YPDPSXPK.mjs} +108 -96
- package/dist/chunk-YPDPSXPK.mjs.br +0 -0
- package/dist/chunk-YPDPSXPK.mjs.gz +0 -0
- package/dist/i18n/de.cjs +134 -117
- package/dist/i18n/de.cjs.br +0 -0
- package/dist/i18n/de.cjs.gz +0 -0
- package/dist/i18n/de.mjs +134 -117
- package/dist/i18n/de.mjs.br +0 -0
- package/dist/i18n/de.mjs.gz +0 -0
- package/dist/i18n/es.cjs +134 -117
- package/dist/i18n/es.cjs.br +0 -0
- package/dist/i18n/es.cjs.gz +0 -0
- package/dist/i18n/es.mjs +134 -117
- package/dist/i18n/es.mjs.br +0 -0
- package/dist/i18n/es.mjs.gz +0 -0
- package/dist/i18n/fr.cjs +134 -117
- package/dist/i18n/fr.cjs.br +0 -0
- package/dist/i18n/fr.cjs.gz +0 -0
- package/dist/i18n/fr.mjs +134 -117
- package/dist/i18n/fr.mjs.br +0 -0
- package/dist/i18n/fr.mjs.gz +0 -0
- package/dist/i18n/zh-CN.cjs +111 -99
- package/dist/i18n/zh-CN.cjs.br +0 -0
- package/dist/i18n/zh-CN.cjs.gz +0 -0
- package/dist/i18n/zh-CN.mjs +111 -99
- 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 +276 -18
- package/dist/index.js +63 -63
- 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 +329 -18
- 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 +231 -16
- 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 +2 -3
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-3C7GM6ZF.js.br +0 -0
- package/dist/AiChatPanel-3C7GM6ZF.js.gz +0 -0
- package/dist/AiChatPanel-L7DBCWE3.mjs.br +0 -0
- package/dist/AiChatPanel-L7DBCWE3.mjs.gz +0 -0
- package/dist/Model3DScene-IJ7YYTYU.mjs.br +0 -0
- package/dist/Model3DScene-IJ7YYTYU.mjs.gz +0 -0
- package/dist/Model3DScene-USKNPWWH.js.gz +0 -0
- package/dist/chunk-3JUZOKFI.js.br +0 -0
- package/dist/chunk-3JUZOKFI.js.gz +0 -0
- package/dist/chunk-5V5SMT5A.js.br +0 -0
- package/dist/chunk-5V5SMT5A.js.gz +0 -0
- package/dist/chunk-DFSWCVRW.js.br +0 -0
- package/dist/chunk-DFSWCVRW.js.gz +0 -0
- package/dist/chunk-FZSYLXJT.js.br +0 -0
- package/dist/chunk-FZSYLXJT.js.gz +0 -0
- package/dist/chunk-IBHIXBC5.js.br +0 -0
- package/dist/chunk-IBHIXBC5.js.gz +0 -0
- package/dist/chunk-ICEZL4TM.mjs.br +0 -0
- package/dist/chunk-ICEZL4TM.mjs.gz +0 -0
- package/dist/chunk-INX3E37P.mjs.br +0 -0
- package/dist/chunk-INX3E37P.mjs.gz +0 -0
- package/dist/chunk-K6QHGABT.mjs.br +0 -0
- package/dist/chunk-K6QHGABT.mjs.gz +0 -0
- package/dist/chunk-OOO4JL2N.mjs.br +0 -0
- package/dist/chunk-OOO4JL2N.mjs.gz +0 -0
- package/dist/chunk-VCAQSSGD.mjs.br +0 -0
- package/dist/chunk-VCAQSSGD.mjs.gz +0 -0
- package/dist/chunk-Y4QUVWZC.js.br +0 -0
- package/dist/chunk-Y4QUVWZC.js.gz +0 -0
- package/dist/chunk-ZAQFTO4P.mjs.br +0 -0
- package/dist/chunk-ZAQFTO4P.mjs.gz +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
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, authoredLetterSpacingPx, 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, splitEastAsianBreaks, splitRunByScriptFont } from './chunk-NPZOVIHG.mjs';
|
|
2
|
+
import { translationsEn } from './chunk-YPDPSXPK.mjs';
|
|
3
3
|
import { clsx } from 'clsx';
|
|
4
4
|
import { twMerge } from 'tailwind-merge';
|
|
5
|
-
import
|
|
5
|
+
import React8, { 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';
|
|
@@ -88,7 +88,7 @@ var SHAPE_PRESETS = SHAPE_PRESET_DEFS.map(
|
|
|
88
88
|
type: def.type,
|
|
89
89
|
label: def.label,
|
|
90
90
|
i18nKey: def.i18nKey,
|
|
91
|
-
icon:
|
|
91
|
+
icon: React8.createElement(GLYPH_COMPONENTS[def.glyph], {
|
|
92
92
|
className: def.glyphClass ? `w-3.5 h-3.5 ${def.glyphClass}` : "w-3.5 h-3.5"
|
|
93
93
|
})
|
|
94
94
|
})
|
|
@@ -1045,7 +1045,7 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1045
1045
|
return spec.spans.map((span, index) => {
|
|
1046
1046
|
const content = span.style && renderPiece ? renderPiece(span.style, span.text, String(index)) : span.text;
|
|
1047
1047
|
if (!span.animId) {
|
|
1048
|
-
return /* @__PURE__ */ jsx(
|
|
1048
|
+
return /* @__PURE__ */ jsx(React8.Fragment, { children: content }, `ws-${index}`);
|
|
1049
1049
|
}
|
|
1050
1050
|
return /* @__PURE__ */ jsx(
|
|
1051
1051
|
"span",
|
|
@@ -1073,7 +1073,7 @@ function renderUnderlineWords(text, isUnderlineWords, wordDecoration, metric, ke
|
|
|
1073
1073
|
return pieces.map((piece, i) => {
|
|
1074
1074
|
const key = `${keyPrefix}-u${i}`;
|
|
1075
1075
|
if (!piece.underline) {
|
|
1076
|
-
return /* @__PURE__ */ jsx(
|
|
1076
|
+
return /* @__PURE__ */ jsx(React8.Fragment, { children: inner(piece.text, key, gapMetric) }, key);
|
|
1077
1077
|
}
|
|
1078
1078
|
return /* @__PURE__ */ jsx("span", { style: wordDecoration, children: inner(piece.text, key, metric) }, key);
|
|
1079
1079
|
});
|
|
@@ -1110,12 +1110,39 @@ function renderTabbedLine(line, ctx, keyPrefix, renderPiece, nestedStyle, underl
|
|
|
1110
1110
|
);
|
|
1111
1111
|
return /* @__PURE__ */ jsx("span", { style: { display: "inline-block", whiteSpace: "nowrap" }, children: lineLayout.pieces.map((piece, i) => {
|
|
1112
1112
|
const key = `${keyPrefix}-tab-${i}`;
|
|
1113
|
-
return /* @__PURE__ */ jsxs(
|
|
1113
|
+
return /* @__PURE__ */ jsxs(React8.Fragment, { children: [
|
|
1114
1114
|
piece.leaderStyle ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", style: piece.leaderStyle, children: piece.leaderText }) : null,
|
|
1115
1115
|
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) })
|
|
1116
1116
|
] }, key);
|
|
1117
1117
|
}) });
|
|
1118
1118
|
}
|
|
1119
|
+
function renderEastAsianPieces(text, metric, keyPrefix, inner, baseStyle) {
|
|
1120
|
+
const parts = splitEastAsianBreaks(text, metric.eastAsian, metric.font);
|
|
1121
|
+
if (parts.length === 1 && !parts[0].style) {
|
|
1122
|
+
return inner(parts[0].text, keyPrefix);
|
|
1123
|
+
}
|
|
1124
|
+
return parts.map((part, i) => {
|
|
1125
|
+
const key = `${keyPrefix}-e${i}`;
|
|
1126
|
+
return part.style ? /* @__PURE__ */ jsx("span", { style: { ...baseStyle ?? metric.nestedStyle, ...part.style }, children: inner(part.text, key) }, key) : /* @__PURE__ */ jsx(React8.Fragment, { children: inner(part.text, key) }, key);
|
|
1127
|
+
});
|
|
1128
|
+
}
|
|
1129
|
+
function renderMetricPieces(text, metric, keyPrefix, inner) {
|
|
1130
|
+
if (!metric || !text) {
|
|
1131
|
+
return inner(text, keyPrefix);
|
|
1132
|
+
}
|
|
1133
|
+
const pieces = splitRunForMetrics(text, metric.font);
|
|
1134
|
+
if (pieces.length <= 1) {
|
|
1135
|
+
return renderEastAsianPieces(text, metric, keyPrefix, inner, void 0);
|
|
1136
|
+
}
|
|
1137
|
+
return pieces.map((piece, i) => {
|
|
1138
|
+
const key = `${keyPrefix}-w${i}`;
|
|
1139
|
+
const style = {
|
|
1140
|
+
...metric.nestedStyle,
|
|
1141
|
+
letterSpacing: pieceLetterSpacing(metric.authoredPx, piece.tracking)
|
|
1142
|
+
};
|
|
1143
|
+
return /* @__PURE__ */ jsx("span", { style, children: renderEastAsianPieces(piece.text, metric, key, inner, style) }, key);
|
|
1144
|
+
});
|
|
1145
|
+
}
|
|
1119
1146
|
function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFamily, keyPrefix, nestedStyle) {
|
|
1120
1147
|
if (!needsScriptFonts || !text) {
|
|
1121
1148
|
return text;
|
|
@@ -1130,29 +1157,9 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1130
1157
|
return text;
|
|
1131
1158
|
}
|
|
1132
1159
|
return pieces.map(
|
|
1133
|
-
(piece, i) => piece.style ? /* @__PURE__ */ jsx("span", { style: piece.style, children: piece.text }, `${keyPrefix}-r${i}`) : /* @__PURE__ */ jsx(
|
|
1160
|
+
(piece, i) => piece.style ? /* @__PURE__ */ jsx("span", { style: piece.style, children: piece.text }, `${keyPrefix}-r${i}`) : /* @__PURE__ */ jsx(React8.Fragment, { children: piece.text }, `${keyPrefix}-r${i}`)
|
|
1134
1161
|
);
|
|
1135
1162
|
}
|
|
1136
|
-
function renderMetricPieces(text, metric, keyPrefix, inner) {
|
|
1137
|
-
if (!metric || !text) {
|
|
1138
|
-
return inner(text, keyPrefix);
|
|
1139
|
-
}
|
|
1140
|
-
const pieces = splitRunForMetrics(text, metric.font);
|
|
1141
|
-
if (pieces.length <= 1) {
|
|
1142
|
-
return inner(text, keyPrefix);
|
|
1143
|
-
}
|
|
1144
|
-
return pieces.map((piece, i) => /* @__PURE__ */ jsx(
|
|
1145
|
-
"span",
|
|
1146
|
-
{
|
|
1147
|
-
style: {
|
|
1148
|
-
...metric.nestedStyle,
|
|
1149
|
-
letterSpacing: pieceLetterSpacing(metric.authoredPx, piece.tracking)
|
|
1150
|
-
},
|
|
1151
|
-
children: inner(piece.text, `${keyPrefix}-w${i}`)
|
|
1152
|
-
},
|
|
1153
|
-
`${keyPrefix}-w${i}`
|
|
1154
|
-
));
|
|
1155
|
-
}
|
|
1156
1163
|
function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsScriptFonts, scriptFonts, baseFontFamily, findHighlights, tabContext, metric, isUnderlineWords = false, wordDecoration) {
|
|
1157
1164
|
const segHl = findHighlights?.get(segmentIndex);
|
|
1158
1165
|
const renderLeaf = makeSegmentPieceRenderer(
|
|
@@ -1166,7 +1173,7 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1166
1173
|
if (!segHl || segHl.length === 0) {
|
|
1167
1174
|
return lines.map((line, lineIndex) => {
|
|
1168
1175
|
const lineKey = `${elementId}-seg-${segmentIndex}-line-${lineIndex}`;
|
|
1169
|
-
return /* @__PURE__ */ jsxs(
|
|
1176
|
+
return /* @__PURE__ */ jsxs(React8.Fragment, { children: [
|
|
1170
1177
|
tabContext && line.includes(" ") ? renderTabbedLine(
|
|
1171
1178
|
line,
|
|
1172
1179
|
tabContext,
|
|
@@ -1218,7 +1225,7 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1218
1225
|
children: renderLeaf(chunk.text, chunkKey)
|
|
1219
1226
|
},
|
|
1220
1227
|
chunkKey
|
|
1221
|
-
) : /* @__PURE__ */ jsx(
|
|
1228
|
+
) : /* @__PURE__ */ jsx(React8.Fragment, { children: renderLeaf(chunk.text, chunkKey) }, chunkKey);
|
|
1222
1229
|
});
|
|
1223
1230
|
}
|
|
1224
1231
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber, fontSize) {
|
|
@@ -1387,7 +1394,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1387
1394
|
) : DEFAULT_FONT_FAMILY2;
|
|
1388
1395
|
const scriptFonts = resolveScriptFontSet(segmentStyle, element.textStyle, baseFontFamily);
|
|
1389
1396
|
const needsScriptFonts = hasDistinctScriptFonts(scriptFonts);
|
|
1390
|
-
const authoredLetterSpacing =
|
|
1397
|
+
const authoredLetterSpacing = authoredLetterSpacingPx(segmentStyle);
|
|
1391
1398
|
const metricFont = {
|
|
1392
1399
|
fontFamily: baseFontFamily,
|
|
1393
1400
|
fontSizePx: baseFontSize * baselineFontScale,
|
|
@@ -1395,7 +1402,12 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1395
1402
|
italic: Boolean(segmentStyle.italic)
|
|
1396
1403
|
};
|
|
1397
1404
|
const nestedStyle = nestedTextDecorationStyle(run.style);
|
|
1398
|
-
const metricContext = {
|
|
1405
|
+
const metricContext = {
|
|
1406
|
+
font: metricFont,
|
|
1407
|
+
authoredPx: authoredLetterSpacing,
|
|
1408
|
+
nestedStyle,
|
|
1409
|
+
eastAsian: ctx.eastAsianBreaks
|
|
1410
|
+
};
|
|
1399
1411
|
const spanStyle = { ...run.style };
|
|
1400
1412
|
spanStyle.color = resolvedSegmentColor;
|
|
1401
1413
|
spanStyle.fontSize = baseFontSize * baselineFontScale;
|
|
@@ -1418,7 +1430,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1418
1430
|
spanStyle.direction = runRtl ? "rtl" : "ltr";
|
|
1419
1431
|
spanStyle.unicodeBidi = runRtl !== ctx.paragraphRtl ? "bidi-override" : "embed";
|
|
1420
1432
|
}
|
|
1421
|
-
const isUnderlineWords =
|
|
1433
|
+
const isUnderlineWords = splitsUnderlineIntoWords(segmentStyle);
|
|
1422
1434
|
const wordDecoration = isUnderlineWords ? nestedStyle ?? run.underlineWordPieces?.find((piece) => piece.style)?.style : void 0;
|
|
1423
1435
|
if (isUnderlineWords) {
|
|
1424
1436
|
const stripped = stripUnderlineDecoration(spanStyle);
|
|
@@ -1443,7 +1455,8 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1443
1455
|
baseFontSize,
|
|
1444
1456
|
baseFontFamily,
|
|
1445
1457
|
Boolean(segmentStyle.bold),
|
|
1446
|
-
Boolean(segmentStyle.italic)
|
|
1458
|
+
Boolean(segmentStyle.italic),
|
|
1459
|
+
{ language: segmentStyle.language, rtl: ctx.paragraphRtl === true }
|
|
1447
1460
|
),
|
|
1448
1461
|
metricContext,
|
|
1449
1462
|
isUnderlineWords,
|
|
@@ -1482,10 +1495,10 @@ function renderSeededListRun(seed, runs, segments, context) {
|
|
|
1482
1495
|
segmentIndex: seed.segmentIndex
|
|
1483
1496
|
};
|
|
1484
1497
|
const rendered = renderParagraphRun(run, resolvedSegment, context);
|
|
1485
|
-
if (!
|
|
1498
|
+
if (!React8.isValidElement(rendered)) {
|
|
1486
1499
|
return rendered;
|
|
1487
1500
|
}
|
|
1488
|
-
return
|
|
1501
|
+
return React8.cloneElement(rendered, {
|
|
1489
1502
|
"data-pptx-list-run": seed.token,
|
|
1490
1503
|
...seed.text === "" ? { children: /* @__PURE__ */ jsx("br", {}) } : {}
|
|
1491
1504
|
});
|
|
@@ -1501,12 +1514,10 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
1501
1514
|
}
|
|
1502
1515
|
return element.text || emptyFallback || "";
|
|
1503
1516
|
}
|
|
1504
|
-
const paragraphs = buildParagraphs(
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
inlineListSeed ? { preserveTrailingEmpty: true } : void 0
|
|
1509
|
-
);
|
|
1517
|
+
const paragraphs = buildParagraphs(element, fieldContext, segmentOverrides, {
|
|
1518
|
+
preserveTrailingEmpty: inlineListSeed ? true : void 0,
|
|
1519
|
+
eastAsianRunPieces: false
|
|
1520
|
+
});
|
|
1510
1521
|
const ctx = {
|
|
1511
1522
|
element,
|
|
1512
1523
|
fallbackColor,
|
|
@@ -1540,7 +1551,11 @@ function joinRunsBySegment(runs) {
|
|
|
1540
1551
|
}
|
|
1541
1552
|
function renderParagraph(para, paraIndex, paraCount, segments, ctx, subElementAnimStates, inlineListSeed) {
|
|
1542
1553
|
const element = ctx.element;
|
|
1543
|
-
const runCtx = {
|
|
1554
|
+
const runCtx = {
|
|
1555
|
+
...ctx,
|
|
1556
|
+
paragraphRtl: para.rtl,
|
|
1557
|
+
eastAsianBreaks: para.eastAsianBreaks
|
|
1558
|
+
};
|
|
1544
1559
|
const runs = joinRunsBySegment(para.runs);
|
|
1545
1560
|
const listParagraph = inlineListSeed?.paragraphs[paraIndex];
|
|
1546
1561
|
const renderedRuns = listParagraph ? listParagraph.runs.map((run) => renderSeededListRun(run, runs, segments, runCtx)) : runs.map((run) => renderParagraphRun(run, segments[run.segmentIndex ?? -1], runCtx));
|
|
@@ -1590,7 +1605,7 @@ function renderParagraph(para, paraIndex, paraCount, segments, ctx, subElementAn
|
|
|
1590
1605
|
);
|
|
1591
1606
|
const needsWrapper = Boolean(listParagraph) || Object.keys(paraStyle).length > 0 || marker !== null;
|
|
1592
1607
|
if (!needsWrapper) {
|
|
1593
|
-
return /* @__PURE__ */ jsxs(
|
|
1608
|
+
return /* @__PURE__ */ jsxs(React8.Fragment, { children: [
|
|
1594
1609
|
wrappedContent,
|
|
1595
1610
|
paraIndex < paraCount - 1 ? /* @__PURE__ */ jsx("br", {}) : null
|
|
1596
1611
|
] }, `${element.id}-para-${paraIndex}`);
|
|
@@ -2027,7 +2042,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2027
2042
|
"svg",
|
|
2028
2043
|
{
|
|
2029
2044
|
viewBox: `0 0 ${pathWidth} ${pathHeight}`,
|
|
2030
|
-
className: "w-full h-full pointer-events-none",
|
|
2045
|
+
className: "absolute inset-0 w-full h-full pointer-events-none",
|
|
2031
2046
|
preserveAspectRatio: "none",
|
|
2032
2047
|
children: [
|
|
2033
2048
|
animatesFill ? null : renderSvgGradientDefs(gradient),
|
|
@@ -3422,6 +3437,9 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3422
3437
|
}
|
|
3423
3438
|
);
|
|
3424
3439
|
}
|
|
3440
|
+
function renderGradientStops(stops) {
|
|
3441
|
+
return stops.map((stop, i) => /* @__PURE__ */ jsx("stop", { offset: stop.offset, stopColor: stop.color, stopOpacity: stop.opacity }, i));
|
|
3442
|
+
}
|
|
3425
3443
|
function partAttrs(part) {
|
|
3426
3444
|
return part ? chartPartToAttrs(part) : void 0;
|
|
3427
3445
|
}
|
|
@@ -3599,29 +3617,52 @@ function renderChartViewModel(elementId, vm, preserveAspectRatio = "none") {
|
|
|
3599
3617
|
viewBox: `0 0 ${vm.svgWidth} ${vm.svgHeight}`,
|
|
3600
3618
|
preserveAspectRatio,
|
|
3601
3619
|
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
|
-
|
|
3620
|
+
vm.defs && vm.defs.length > 0 && /* @__PURE__ */ jsx("defs", { children: vm.defs.map(
|
|
3621
|
+
(def, i) => def.kind === "linearGradient" ? /* @__PURE__ */ jsx(
|
|
3622
|
+
"linearGradient",
|
|
3623
|
+
{
|
|
3624
|
+
id: def.id,
|
|
3625
|
+
x1: def.x1,
|
|
3626
|
+
y1: def.y1,
|
|
3627
|
+
x2: def.x2,
|
|
3628
|
+
y2: def.y2,
|
|
3629
|
+
children: renderGradientStops(def.stops)
|
|
3630
|
+
},
|
|
3631
|
+
`${elementId}-def-${i}`
|
|
3632
|
+
) : def.kind === "radialGradient" ? /* @__PURE__ */ jsx(
|
|
3633
|
+
"radialGradient",
|
|
3634
|
+
{
|
|
3635
|
+
id: def.id,
|
|
3636
|
+
cx: def.cx,
|
|
3637
|
+
cy: def.cy,
|
|
3638
|
+
r: def.r,
|
|
3639
|
+
children: renderGradientStops(def.stops)
|
|
3640
|
+
},
|
|
3641
|
+
`${elementId}-def-${i}`
|
|
3642
|
+
) : /* @__PURE__ */ jsx(
|
|
3643
|
+
"pattern",
|
|
3644
|
+
{
|
|
3645
|
+
id: def.id,
|
|
3646
|
+
patternUnits: def.patternUnits,
|
|
3647
|
+
x: def.x,
|
|
3648
|
+
y: def.y,
|
|
3649
|
+
width: def.width,
|
|
3650
|
+
height: def.height,
|
|
3651
|
+
children: /* @__PURE__ */ jsx(
|
|
3652
|
+
"image",
|
|
3653
|
+
{
|
|
3654
|
+
href: def.href,
|
|
3655
|
+
x: 0,
|
|
3656
|
+
y: 0,
|
|
3657
|
+
width: def.width,
|
|
3658
|
+
height: def.height,
|
|
3659
|
+
preserveAspectRatio: def.preserveAspectRatio
|
|
3660
|
+
}
|
|
3661
|
+
)
|
|
3662
|
+
},
|
|
3663
|
+
`${elementId}-def-${i}`
|
|
3664
|
+
)
|
|
3665
|
+
) }),
|
|
3625
3666
|
vm.areaFill && /* @__PURE__ */ jsx(
|
|
3626
3667
|
"rect",
|
|
3627
3668
|
{
|
|
Binary file
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkYF2BQIW3_js = require('./chunk-YF2BQIW3.js');
|
|
4
4
|
var chunk4VNS5WPM_js = require('./chunk-4VNS5WPM.js');
|
|
5
5
|
var mcp = require('pptx-viewer-mcp');
|
|
6
6
|
var mcpSchemas = require('pptx-viewer-mcp/schemas');
|
|
@@ -19079,7 +19079,7 @@ async function buildSlideMarkdown(slides, slideIndex2, meta3, options = {}) {
|
|
|
19079
19079
|
};
|
|
19080
19080
|
let markdown;
|
|
19081
19081
|
try {
|
|
19082
|
-
const converter = new
|
|
19082
|
+
const converter = new chunkYF2BQIW3_js.PptxMarkdownConverter(
|
|
19083
19083
|
"",
|
|
19084
19084
|
{
|
|
19085
19085
|
sourceName: meta3.title ?? "deck.pptx",
|
|
@@ -19671,7 +19671,7 @@ var getTheme = (ctx) => {
|
|
|
19671
19671
|
name: theme?.name,
|
|
19672
19672
|
colorScheme: theme?.colorScheme,
|
|
19673
19673
|
fontScheme: theme?.fontScheme,
|
|
19674
|
-
availablePresets: Object.keys(
|
|
19674
|
+
availablePresets: Object.keys(chunkYF2BQIW3_js.ThemePresets)
|
|
19675
19675
|
};
|
|
19676
19676
|
};
|
|
19677
19677
|
var readExecutors = {
|
|
@@ -20801,7 +20801,7 @@ function applyElementUpdate(el, u) {
|
|
|
20801
20801
|
applyShapeStyleUpdate(el, u);
|
|
20802
20802
|
}
|
|
20803
20803
|
function applyTextUpdate(el, u) {
|
|
20804
|
-
if (!
|
|
20804
|
+
if (!chunkYF2BQIW3_js.hasTextProperties(el)) {
|
|
20805
20805
|
return;
|
|
20806
20806
|
}
|
|
20807
20807
|
const textEl = el;
|
|
@@ -20847,7 +20847,7 @@ function applyShapeStyleUpdate(el, u) {
|
|
|
20847
20847
|
if (u.fillColor === void 0 && u.strokeColor === void 0 && u.strokeWidth === void 0) {
|
|
20848
20848
|
return;
|
|
20849
20849
|
}
|
|
20850
|
-
if (!
|
|
20850
|
+
if (!chunkYF2BQIW3_js.hasShapeProperties(el)) {
|
|
20851
20851
|
return;
|
|
20852
20852
|
}
|
|
20853
20853
|
const holder = el;
|
|
Binary file
|
|
Binary file
|