pptx-react-viewer 4.75.0 → 4.77.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 +50 -0
- package/dist/{AiChatPanel-6ML3VLIX.mjs → AiChatPanel-7BPX44IR.mjs} +1 -1
- package/dist/AiChatPanel-7BPX44IR.mjs.br +0 -0
- package/dist/AiChatPanel-7BPX44IR.mjs.gz +0 -0
- package/dist/{AiChatPanel-4V7QB5Z3.js → AiChatPanel-YJ5R7PPW.js} +19 -19
- package/dist/AiChatPanel-YJ5R7PPW.js.br +0 -0
- package/dist/AiChatPanel-YJ5R7PPW.js.gz +0 -0
- package/dist/ai.js +2 -2
- package/dist/ai.js.br +2 -3
- package/dist/ai.js.gz +0 -0
- package/dist/ai.mjs +1 -1
- package/dist/ai.mjs.br +0 -0
- package/dist/ai.mjs.gz +0 -0
- package/dist/{chunk-P2IEKYVG.js → chunk-3T5NEBOR.js} +2 -2
- package/dist/chunk-3T5NEBOR.js.br +0 -0
- package/dist/chunk-3T5NEBOR.js.gz +0 -0
- package/dist/{chunk-3AZ6ESJU.js → chunk-5CJHRYFK.js} +1666 -1249
- package/dist/chunk-5CJHRYFK.js.br +0 -0
- package/dist/chunk-5CJHRYFK.js.gz +0 -0
- package/dist/{chunk-6GFSF2ML.js → chunk-AIA7CY5U.js} +4 -29
- package/dist/chunk-AIA7CY5U.js.br +0 -0
- package/dist/chunk-AIA7CY5U.js.gz +0 -0
- package/dist/{chunk-AZLOOFU2.mjs → chunk-I5WQFYAK.mjs} +680 -273
- package/dist/chunk-I5WQFYAK.mjs.br +0 -0
- package/dist/chunk-I5WQFYAK.mjs.gz +0 -0
- package/dist/{chunk-RMEWSJZU.mjs → chunk-J4NOGC3R.mjs} +1 -1
- package/dist/chunk-J4NOGC3R.mjs.br +0 -0
- package/dist/chunk-J4NOGC3R.mjs.gz +0 -0
- package/dist/{chunk-Y53EC3JU.mjs → chunk-JB37G6GW.mjs} +1 -1
- package/dist/chunk-JB37G6GW.mjs.br +0 -0
- package/dist/chunk-JB37G6GW.mjs.gz +0 -0
- package/dist/{chunk-DE4Y5F4T.mjs → chunk-MMBLGDHD.mjs} +556 -375
- package/dist/chunk-MMBLGDHD.mjs.br +0 -0
- package/dist/chunk-MMBLGDHD.mjs.gz +0 -0
- package/dist/{chunk-N3YK2BCA.mjs → chunk-N6BJW23K.mjs} +5 -30
- package/dist/chunk-N6BJW23K.mjs.br +0 -0
- package/dist/chunk-N6BJW23K.mjs.gz +0 -0
- package/dist/{chunk-RJRDE3C2.js → chunk-USEEERPE.js} +1107 -926
- package/dist/chunk-USEEERPE.js.br +0 -0
- package/dist/chunk-USEEERPE.js.gz +0 -0
- package/dist/{chunk-MU3BIZ2U.js → chunk-VCNDY7HS.js} +1 -1
- package/dist/chunk-VCNDY7HS.js.br +0 -0
- package/dist/chunk-VCNDY7HS.js.gz +0 -0
- package/dist/i18n/de.cjs +5 -0
- package/dist/i18n/de.cjs.br +0 -0
- package/dist/i18n/de.cjs.gz +0 -0
- package/dist/i18n/de.mjs +5 -0
- package/dist/i18n/de.mjs.br +0 -0
- package/dist/i18n/de.mjs.gz +0 -0
- package/dist/i18n/es.cjs +5 -0
- package/dist/i18n/es.cjs.br +0 -0
- package/dist/i18n/es.cjs.gz +0 -0
- package/dist/i18n/es.mjs +5 -0
- package/dist/i18n/es.mjs.br +0 -0
- package/dist/i18n/es.mjs.gz +0 -0
- package/dist/i18n/fr.cjs +5 -0
- package/dist/i18n/fr.cjs.br +0 -0
- package/dist/i18n/fr.cjs.gz +0 -0
- package/dist/i18n/fr.mjs +5 -0
- package/dist/i18n/fr.mjs.br +0 -0
- package/dist/i18n/fr.mjs.gz +0 -0
- package/dist/i18n/zh-CN.cjs +5 -0
- package/dist/i18n/zh-CN.cjs.br +0 -0
- package/dist/i18n/zh-CN.cjs.gz +0 -0
- package/dist/i18n/zh-CN.mjs +5 -0
- package/dist/i18n/zh-CN.mjs.br +0 -0
- package/dist/i18n/zh-CN.mjs.gz +0 -0
- package/dist/index.d.ts +59 -8
- package/dist/index.js +29 -29
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +51 -24
- package/dist/internals.js +82 -82
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +3 -3
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/no-i18next.d.ts +59 -8
- package/dist/no-i18next.js +28 -28
- package/dist/no-i18next.js.br +0 -0
- package/dist/no-i18next.js.gz +0 -0
- package/dist/no-i18next.mjs +4 -4
- package/dist/no-i18next.mjs.br +0 -0
- package/dist/no-i18next.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 +20 -1
- package/dist/viewer/index.js +22 -22
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +5 -5
- package/dist/viewer/index.mjs.br +5 -4
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +3 -3
- package/dist/AiChatPanel-4V7QB5Z3.js.br +0 -0
- package/dist/AiChatPanel-4V7QB5Z3.js.gz +0 -0
- package/dist/AiChatPanel-6ML3VLIX.mjs.br +0 -0
- package/dist/AiChatPanel-6ML3VLIX.mjs.gz +0 -0
- package/dist/chunk-3AZ6ESJU.js.br +0 -0
- package/dist/chunk-3AZ6ESJU.js.gz +0 -0
- package/dist/chunk-6GFSF2ML.js.br +0 -0
- package/dist/chunk-6GFSF2ML.js.gz +0 -0
- package/dist/chunk-AZLOOFU2.mjs.br +0 -0
- package/dist/chunk-AZLOOFU2.mjs.gz +0 -0
- package/dist/chunk-DE4Y5F4T.mjs.br +0 -0
- package/dist/chunk-DE4Y5F4T.mjs.gz +0 -0
- package/dist/chunk-MU3BIZ2U.js.br +0 -0
- package/dist/chunk-MU3BIZ2U.js.gz +0 -0
- package/dist/chunk-N3YK2BCA.mjs.br +0 -0
- package/dist/chunk-N3YK2BCA.mjs.gz +0 -0
- package/dist/chunk-P2IEKYVG.js.br +0 -0
- package/dist/chunk-P2IEKYVG.js.gz +0 -0
- package/dist/chunk-RJRDE3C2.js.br +0 -0
- package/dist/chunk-RJRDE3C2.js.gz +0 -0
- package/dist/chunk-RMEWSJZU.mjs.br +0 -0
- package/dist/chunk-RMEWSJZU.mjs.gz +0 -0
- package/dist/chunk-Y53EC3JU.mjs.br +0 -0
- package/dist/chunk-Y53EC3JU.mjs.gz +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -2,7 +2,7 @@ import { interpolate } from 'ooxml-core/i18n';
|
|
|
2
2
|
import { translationsEn, keyToLabel } from 'ooxml-ui/pptx/i18n';
|
|
3
3
|
import React8, { createContext, useMemo, useContext, useState, useRef, useEffect, useCallback, useLayoutEffect } from 'react';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
|
-
import { VIEWER_SHORTCUT_REFERENCE, getAnimationInitialStyle as getAnimationInitialStyle$1, cloneHistorySnapshot as cloneHistorySnapshot$1, SHAPE_PRESET_DEFS, getImageFitStyle, getImageFillCounterTransform, getComputedFillStyle, getCropShapeClipPath as getCropShapeClipPath$1, getImageTilingStyle as getImageTilingStyle$1, mediaPlaybackAttributes, getOnlineVideoEmbed, ONLINE_VIDEO_IFRAME_SANDBOX, ONLINE_VIDEO_IFRAME_ALLOW, buildTextBlockStyle, toCssWritingMode, toCssTextOrientation, toCssVerticalDirection, buildTextBodyLayoutStyle, buildTextBody3DSceneStyle as buildTextBody3DSceneStyle$1, buildParagraphs, followingText, colorWithOpacity, normalizeHexColor, hexToRgbUnit, build3DExtrusionData as build3DExtrusionData$1, isWedgeCalloutPresetShape, getFrameEffectStyle, getComputedEffectStyle, getComputedStrokeStyle, getAnimationColorBaseStyle, isStrokeOnlyPresetElement, resolveShapeGeometry, screenBorderWidth, markerPath, normalizeStrokeDashType, getSvgStrokeDasharray, buildSvgGradientDef, isArrowedCustomPath, buildStrokeOutline, getPresetShapeVectorGeometry, screenStrokeWidth, svgGradientFillRef, svgLineCap, getCompoundLineOffsets, getCompoundLineWidths, connectorSnapTransform, connectorNeedsPath, connectorStrandScreenWidth, buildChartViewModel, resolveChartKind, chartPreserveAspectRatio, buildNotesPdfBytes, buildTiledSlidesPdfBytes, buildPreviewAnimation, measurePreviewGeometry, buildMotionPathPreview, mediaFallbackVisual, scheduleMediaTrimAndFade, registerCrossSlideAudio, shouldShowMediaFullscreenStopButton, withInlineListDecorationDefaults, segmentStyleToCss, resolveAutoFitFontScale, applyUnderlineVariant, nestedTextDecorationStyle, textRunColor, scaleFontSizeForAutoFit, resolveFontKerning, resolveScriptFontSet, hasDistinctScriptFonts, authoredLetterSpacingPx, eastAsianBreaksForRun, pieceLetterSpacing, resolveMetricTrackingPx, hollowTextFillStyle, splitsUnderlineIntoWords, stripUnderlineDecoration, buildTabContext, TEXT_BUILD_ID_SEP, buildTextBuildSpec, textBuildSpanStyle, apply3dEffects as apply3dEffects$1, buildSubpathPaints, canDrillDown, computeSelectionRect, DEFAULT_FONT_FAMILY as DEFAULT_FONT_FAMILY$1, isCellInRect, rectToCells, tableContainerCss, resolveChartPalette, computeChartLegendLayout, resolveChartSvgDef, mediaFallbackIcon, mediaFallbackLabelKey, MEDIA_CHROME_ATTRIBUTE, attachMediaControlBar, convertOmmlToMathMl, sanitizeMathMl, dashStartPathData, computeColumnBoundaries, computeTableMergeCrossings, columnHandleSegments, rowHandleSegments, getCellDiagonalBorders as getCellDiagonalBorders$1, tableCellCss, cellParagraphBlocks, buildRunTabLines, computeResizedColumnWidths, computeResizedRowHeight, DEFAULT_ROW_HEIGHT, cellRunStyle, chartPartToAttrs, splitWordsForUnderline, splitRunForMetrics, splitEastAsianBreaks, splitRunByScriptFont } from 'ooxml-ui/pptx';
|
|
5
|
+
import { VIEWER_SHORTCUT_REFERENCE, getAnimationInitialStyle as getAnimationInitialStyle$1, cloneHistorySnapshot as cloneHistorySnapshot$1, SHAPE_PRESET_DEFS, getImageFitStyle, getImageFillCounterTransform, getComputedFillStyle, getCropShapeClipPath as getCropShapeClipPath$1, getImageTilingStyle as getImageTilingStyle$1, mediaPlaybackAttributes, getOnlineVideoEmbed, ONLINE_VIDEO_IFRAME_SANDBOX, ONLINE_VIDEO_IFRAME_ALLOW, buildTextBlockStyle, toCssWritingMode, toCssTextOrientation, toCssVerticalDirection, buildTextBodyLayoutStyle, buildTextBody3DSceneStyle as buildTextBody3DSceneStyle$1, buildParagraphs, followingText, colorWithOpacity, normalizeHexColor, hexToRgbUnit, build3DExtrusionData as build3DExtrusionData$1, isWedgeCalloutPresetShape, getFrameEffectStyle, getComputedEffectStyle, getComputedStrokeStyle, getAnimationColorBaseStyle, isStrokeOnlyPresetElement, resolveShapeGeometry, screenBorderWidth, markerPath, normalizeStrokeDashType, getSvgStrokeDasharray, buildSvgGradientDef, isArrowedCustomPath, buildStrokeOutline, getPresetShapeVectorGeometry, screenStrokeWidth, svgGradientFillRef, svgLineCap, getCompoundLineOffsets, getCompoundLineWidths, connectorSnapTransform, connectorNeedsPath, connectorStrandScreenWidth, buildChartViewModel, resolveChartKind, chartPreserveAspectRatio, buildNotesPdfBytes, buildTiledSlidesPdfBytes, buildPreviewAnimation, measurePreviewGeometry, buildMotionPathPreview, mediaFallbackVisual, scheduleMediaTrimAndFade, registerCrossSlideAudio, shouldShowMediaFullscreenStopButton, withInlineListDecorationDefaults, segmentStyleToCss, resolveAutoFitFontScale, applyUnderlineVariant, nestedTextDecorationStyle, textRunColor, scaleFontSizeForAutoFit, resolveFontKerning, resolveScriptFontSet, hasDistinctScriptFonts, authoredLetterSpacingPx, eastAsianBreaksForRun, pieceLetterSpacing, resolveMetricTrackingPx, hollowTextFillStyle, splitsUnderlineIntoWords, stripUnderlineDecoration, buildTabContext, TEXT_BUILD_ID_SEP, buildTextBuildSpec, textBuildSpanStyle, apply3dEffects as apply3dEffects$1, buildSubpathPaints, canDrillDown, computeSelectionRect, DEFAULT_FONT_FAMILY as DEFAULT_FONT_FAMILY$1, isCellInRect, rectToCells, tableContainerCss, resolveChartPalette, computeChartLegendLayout, resolveChartSvgDef, mediaFallbackIcon, mediaFallbackLabelKey, MEDIA_CHROME_ATTRIBUTE, attachMediaControlBar, convertOmmlToMathMl, sanitizeMathMl, splitTextByFindHighlights, findMatchMarkStyle, dashStartPathData, computeColumnBoundaries, computeTableMergeCrossings, columnHandleSegments, rowHandleSegments, getCellDiagonalBorders as getCellDiagonalBorders$1, tableCellCss, cellParagraphBlocks, buildRunTabLines, computeResizedColumnWidths, computeResizedRowHeight, DEFAULT_ROW_HEIGHT, cellRunStyle, chartPartToAttrs, splitWordsForUnderline, splitRunForMetrics, splitEastAsianBreaks, splitRunByScriptFont } from 'ooxml-ui/pptx';
|
|
6
6
|
export { ACTION_BUTTON_PRESETS, DEFAULT_COLOR_CHANGE_TOLERANCE, INK_REPLAY_KEYFRAMES, MAX_ZOOM_SCALE, MIN_ZOOM_SCALE, SLIDE_TRANSITION_OPTIONS, TABLE_STYLE_PRESETS, applyColorChange, applyFormatToElement, applyReroutedConnectors, buildCacheKey, buildContentPartStrokes, buildCssGradientFromShapeStyle, buildInkGroupStrokes, buildSaveSlides, canvasToJpegData, clampCropValue, cloneSlide, cloneTemplateElementsBySlideId, colorWithOpacity, comparePresentation, computeHandoutLayout, copyFormatFromElement, formatCommentTimestamp, generateNoteLineCount, getAriaLabel, getAriaRole, getAriaRoleDescription, getCachedResult, getCompoundLineOffsets, getCompoundLineWidths, getContentPartReplayStyles, getElementLabel, getElementTransform, getElementTransformWithoutRotation, getImageEffectsFilter, getImageEffectsOpacity, getInkReplayStyles, getPatternSvg, getPrintableArea, getShapeAdjustmentHandleDescriptors, getSvgStrokeDasharray, getTextCompensationOrigin, getTextCompensationTransform, hasCopyableFormat, isEditableTextElement, isImageTiled, isPpactionUrl, isTemplateElementId, isUrlSafe, makeCloneId, mergeCells, normalizeHexColor, normalizeStrokeDashType, openNativeEyeDropper, parsePpactionUrl, partitionTemplateElements, rerouteConnectorsForMovedElements, safeOpenUrl, sanitizeGradientStops, setCachedResult, splitCell, stopAllPersistentAudio, substituteFieldText } from 'ooxml-ui/pptx';
|
|
7
7
|
import { clsx } from 'clsx';
|
|
8
8
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -1276,41 +1276,16 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1276
1276
|
] }, lineKey);
|
|
1277
1277
|
});
|
|
1278
1278
|
}
|
|
1279
|
-
const
|
|
1280
|
-
const chunks = [];
|
|
1281
|
-
let cursor = 0;
|
|
1282
|
-
for (const hl of sorted) {
|
|
1283
|
-
if (hl.startOffset > cursor) {
|
|
1284
|
-
chunks.push({
|
|
1285
|
-
text: textValue.slice(cursor, hl.startOffset),
|
|
1286
|
-
highlighted: false,
|
|
1287
|
-
isCurrent: false
|
|
1288
|
-
});
|
|
1289
|
-
}
|
|
1290
|
-
chunks.push({
|
|
1291
|
-
text: textValue.slice(hl.startOffset, hl.startOffset + hl.length),
|
|
1292
|
-
highlighted: true,
|
|
1293
|
-
isCurrent: hl.isCurrent
|
|
1294
|
-
});
|
|
1295
|
-
cursor = hl.startOffset + hl.length;
|
|
1296
|
-
}
|
|
1297
|
-
if (cursor < textValue.length) {
|
|
1298
|
-
chunks.push({
|
|
1299
|
-
text: textValue.slice(cursor),
|
|
1300
|
-
highlighted: false,
|
|
1301
|
-
isCurrent: false
|
|
1302
|
-
});
|
|
1303
|
-
}
|
|
1279
|
+
const chunks = splitTextByFindHighlights(textValue, segHl);
|
|
1304
1280
|
return chunks.map((chunk, ci) => {
|
|
1305
1281
|
const chunkKey = `${elementId}-seg-${segmentIndex}-hl-${ci}`;
|
|
1306
|
-
return chunk.
|
|
1282
|
+
return chunk.match ? /* @__PURE__ */ jsx(
|
|
1307
1283
|
"mark",
|
|
1308
1284
|
{
|
|
1285
|
+
"data-pptx-find-match": chunk.match,
|
|
1309
1286
|
style: {
|
|
1310
1287
|
...metric?.nestedStyle,
|
|
1311
|
-
|
|
1312
|
-
color: "inherit",
|
|
1313
|
-
borderRadius: 2
|
|
1288
|
+
...findMatchMarkStyle(chunk.match)
|
|
1314
1289
|
},
|
|
1315
1290
|
children: renderLeaf(chunk.text, chunkKey, followingText(chunks, ci, metric?.following))
|
|
1316
1291
|
},
|
|
Binary file
|
|
Binary file
|