pptx-react-viewer 2.9.0 → 2.10.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 +2 -0
- package/dist/{AiChatPanel-6W6ZBAGU.mjs → AiChatPanel-35CHYS5N.mjs} +4 -4
- package/dist/AiChatPanel-35CHYS5N.mjs.br +0 -0
- package/dist/AiChatPanel-35CHYS5N.mjs.gz +0 -0
- package/dist/{AiChatPanel-MALC32TM.js → AiChatPanel-KTMWRUD5.js} +23 -23
- package/dist/AiChatPanel-KTMWRUD5.js.br +0 -0
- package/dist/AiChatPanel-KTMWRUD5.js.gz +0 -0
- package/dist/{Model3DScene-57HZ4NVD.mjs → Model3DScene-2VMN3B65.mjs} +1 -1
- package/dist/Model3DScene-2VMN3B65.mjs.br +0 -0
- package/dist/Model3DScene-2VMN3B65.mjs.gz +0 -0
- package/dist/{Model3DScene-76R2YXSO.js → Model3DScene-TMNUKCL6.js} +2 -2
- package/dist/Model3DScene-TMNUKCL6.js.br +0 -0
- package/dist/Model3DScene-TMNUKCL6.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-JGOQNHSU.mjs → SurfaceChart3DScene-GKRDDN2U.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-JGOQNHSU.mjs.br → SurfaceChart3DScene-GKRDDN2U.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-GKRDDN2U.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-2QZZTBV4.js → SurfaceChart3DScene-KPNP3QD5.js} +2 -2
- package/dist/SurfaceChart3DScene-KPNP3QD5.js.br +0 -0
- package/dist/SurfaceChart3DScene-KPNP3QD5.js.gz +0 -0
- package/dist/{chunk-D6SHCB4V.js → chunk-A7HLINZU.js} +328 -324
- package/dist/chunk-A7HLINZU.js.br +0 -0
- package/dist/chunk-A7HLINZU.js.gz +0 -0
- package/dist/{chunk-JPTO6P5K.mjs → chunk-FY2AFXKP.mjs} +8 -47
- package/dist/chunk-FY2AFXKP.mjs.br +0 -0
- package/dist/chunk-FY2AFXKP.mjs.gz +0 -0
- package/dist/{chunk-IKISUZKE.js → chunk-H74UXL4Q.js} +340 -17
- package/dist/chunk-H74UXL4Q.js.br +0 -0
- package/dist/{chunk-IKISUZKE.js.gz → chunk-H74UXL4Q.js.gz} +0 -0
- package/dist/{chunk-34BUZNKO.js → chunk-IJVDNQLG.js} +252 -291
- package/dist/chunk-IJVDNQLG.js.br +0 -0
- package/dist/chunk-IJVDNQLG.js.gz +0 -0
- package/dist/{chunk-6UXRNLHD.js → chunk-JWMXOYSX.js} +1330 -968
- package/dist/chunk-JWMXOYSX.js.br +0 -0
- package/dist/chunk-JWMXOYSX.js.gz +0 -0
- package/dist/{chunk-NQLVK23T.mjs → chunk-LCG7WBAG.mjs} +403 -41
- package/dist/chunk-LCG7WBAG.mjs.br +0 -0
- package/dist/chunk-LCG7WBAG.mjs.gz +0 -0
- package/dist/{chunk-6OLS3EJW.mjs → chunk-LXTKPSIG.mjs} +1 -1
- package/dist/chunk-LXTKPSIG.mjs.br +0 -0
- package/dist/chunk-LXTKPSIG.mjs.gz +0 -0
- package/dist/{chunk-2JDWFMIK.js → chunk-MMK4K3QI.js} +1 -0
- package/dist/chunk-MMK4K3QI.js.br +0 -0
- package/dist/{chunk-2JDWFMIK.js.gz → chunk-MMK4K3QI.js.gz} +0 -0
- package/dist/{chunk-4FO4JMTN.mjs → chunk-OHPF2HTP.mjs} +7 -3
- package/dist/chunk-OHPF2HTP.mjs.br +0 -0
- package/dist/chunk-OHPF2HTP.mjs.gz +0 -0
- package/dist/{chunk-CD434OFE.mjs → chunk-SL3XPERE.mjs} +1 -0
- package/dist/chunk-SL3XPERE.mjs.br +0 -0
- package/dist/{chunk-CD434OFE.mjs.gz → chunk-SL3XPERE.mjs.gz} +0 -0
- package/dist/{chunk-YEM2VOAP.js → chunk-SPJR6MPI.js} +3 -3
- package/dist/chunk-SPJR6MPI.js.br +0 -0
- package/dist/chunk-SPJR6MPI.js.gz +0 -0
- package/dist/{chunk-L47Y62L6.mjs → chunk-TJ55KUWH.mjs} +320 -17
- package/dist/chunk-TJ55KUWH.mjs.br +0 -0
- package/dist/{chunk-L47Y62L6.mjs.gz → chunk-TJ55KUWH.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 +2 -0
- package/dist/index.js +36 -36
- 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 +4 -0
- 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/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/{useViewerBuildingBlocks-C59NY1qZ.d.ts → useViewerBuildingBlocks-CpUwhBD5.d.ts} +3 -1
- package/dist/useViewerBuildingBlocks-CpUwhBD5.d.ts.map +1 -0
- 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 +6 -6
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-6W6ZBAGU.mjs.br +0 -0
- package/dist/AiChatPanel-6W6ZBAGU.mjs.gz +0 -0
- package/dist/AiChatPanel-MALC32TM.js.br +0 -0
- package/dist/AiChatPanel-MALC32TM.js.gz +0 -0
- package/dist/Model3DScene-57HZ4NVD.mjs.br +0 -0
- package/dist/Model3DScene-57HZ4NVD.mjs.gz +0 -0
- package/dist/Model3DScene-76R2YXSO.js.br +0 -0
- package/dist/Model3DScene-76R2YXSO.js.gz +0 -0
- package/dist/SurfaceChart3DScene-2QZZTBV4.js.br +0 -0
- package/dist/SurfaceChart3DScene-2QZZTBV4.js.gz +0 -0
- package/dist/SurfaceChart3DScene-JGOQNHSU.mjs.gz +0 -0
- package/dist/chunk-2JDWFMIK.js.br +0 -0
- package/dist/chunk-34BUZNKO.js.br +0 -0
- package/dist/chunk-34BUZNKO.js.gz +0 -0
- package/dist/chunk-4FO4JMTN.mjs.br +0 -0
- package/dist/chunk-4FO4JMTN.mjs.gz +0 -0
- package/dist/chunk-6OLS3EJW.mjs.br +0 -0
- package/dist/chunk-6OLS3EJW.mjs.gz +0 -0
- package/dist/chunk-6UXRNLHD.js.br +0 -0
- package/dist/chunk-6UXRNLHD.js.gz +0 -0
- package/dist/chunk-CD434OFE.mjs.br +0 -0
- package/dist/chunk-D6SHCB4V.js.br +0 -0
- package/dist/chunk-D6SHCB4V.js.gz +0 -0
- package/dist/chunk-IKISUZKE.js.br +0 -0
- package/dist/chunk-JPTO6P5K.mjs.br +0 -0
- package/dist/chunk-JPTO6P5K.mjs.gz +0 -0
- package/dist/chunk-L47Y62L6.mjs.br +0 -0
- package/dist/chunk-NQLVK23T.mjs.br +0 -0
- package/dist/chunk-NQLVK23T.mjs.gz +0 -0
- package/dist/chunk-YEM2VOAP.js.br +0 -0
- package/dist/chunk-YEM2VOAP.js.gz +0 -0
- package/dist/useViewerBuildingBlocks-C59NY1qZ.d.ts.map +0 -1
|
Binary file
|
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { translationsEn } from './chunk-
|
|
2
|
-
import { SHAPE_PRESET_DEFS, computeValueRangeForChart, VIEWER_SHORTCUT_REFERENCE, getAnimationInitialStyle, cloneHistorySnapshot, hasShapeProperties, isTemplateElement, isImageLikeElement, clampCropValue,
|
|
1
|
+
import { translationsEn } from './chunk-SL3XPERE.mjs';
|
|
2
|
+
import { SHAPE_PRESET_DEFS, computeValueRangeForChart, VIEWER_SHORTCUT_REFERENCE, getAnimationInitialStyle, cloneHistorySnapshot, hasShapeProperties, isTemplateElement, isImageLikeElement, clampCropValue, runMediaCommand, findMediaElementByElementId, buildTextBlockStyle, hasTextProperties, toCssWritingMode, toCssTextOrientation, toCssVerticalDirection, getKinsokuLineBreakStyles, buildTextBody3DSceneStyle, resolveParagraphRtl, resolveParagraphAlign, resolveCssTextAlign, resolveParagraphStrutFontSize, colorWithOpacity, normalizeHexColor, build3DExtrusionData, getResolvedShapeClipPath, normalizeStrokeDashType, buildCssGradientFromShapeStyle, buildShadowCssFromShapeStyle, buildInnerShadowCssFromShapeStyle, suppressesCssBorder, buildMultiLayerShadowCss, buildGlowBoxShadow, getCompoundLineBoxShadow, getSoftEdgeFilterId, getEffectDagFilter, buildPatternFillCss, buildReflectionCss, getCssBorderDashStyle, getCompoundLineBorderWidth, getSvgStrokeDasharray, buildSvgGradientDef, isCalloutShape, getCalloutLeaderLineGeometry, buildCalloutLeaderLineSvgPath, getCalloutViewBoxBounds, svgLineCap, getCompoundLineOffsets, getCompoundLineWidths, computeSelectionRect, rectToCells, isCellInRect, buildChartViewModel, buildNotesPdfBytes, buildSlidesPdfBytes, buildPreviewAnimation, getRoundRectRadiusPx, substituteFieldText, resolveUnderlineDecorationStyle, resolveAutoFitFontScale, getSubstituteFontFamily, hasDistinctScriptFonts, buildTextReflectionCss, getTextAlphaOpacity, buildTextRunFilterChain, buildTextShadowCss, TEXT_BUILD_ID_SEP, buildTextBuildSpec, textBuildSpanStyle, evaluatePresetShape, sanitizeGradientStops, getGradientTileFlipCss, getGradientTileRectCss, apply3dEffects, clampUnitInterval, customGeometryPathsToSvgSubpaths, svgGradientFillRef, computeColumnBoundaries, parseDrawingColor, parseDrawingColorOpacity, getCellDiagonalBorders, getPatternSvg, ooxmlDashToCssBorderStyle, cell3DBevelCss, getChartStylePalette, computeLayout, valueToY, formatAxisValue, computeLayoutOptions, splitSeriesByAxis, computeValueRange, getSecondaryValueAxis, seriesColor, paletteColor, resolveRegionCode, normalizeValue, sequentialColorScale, convertOmmlToMathMl, sanitizeMathMl, buildTextFillCss, resolvePictureBullet, computeResizedColumnWidths, computeResizedRowHeight, DEFAULT_ROW_HEIGHT, resolveFontRefIdx, tintColor2, shadeColor2, ooxmlGradientAngleToCssDegrees, segmentByScript, resolveFontForScript, generateLogTicks, formatAxisValueWithUnits, getDisplayUnitLabel, hexToRgbChannels, chartPartToAttrs } from './chunk-TJ55KUWH.mjs';
|
|
3
3
|
import { clsx } from 'clsx';
|
|
4
4
|
import { twMerge } from 'tailwind-merge';
|
|
5
5
|
import React6, { useState, useEffect, useMemo, Suspense, useRef, useCallback, useLayoutEffect } from 'react';
|
|
@@ -723,50 +723,11 @@ function registerMediaElement(elementId, el) {
|
|
|
723
723
|
}
|
|
724
724
|
};
|
|
725
725
|
}
|
|
726
|
-
function executeMediaCommand(command) {
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
const parsed = parseMediaCommand(command.command);
|
|
732
|
-
if (!parsed) {
|
|
733
|
-
return false;
|
|
734
|
-
}
|
|
735
|
-
const safePlay = () => {
|
|
736
|
-
void el.play().catch(() => {
|
|
737
|
-
});
|
|
738
|
-
};
|
|
739
|
-
const safeSeek = (seconds) => {
|
|
740
|
-
try {
|
|
741
|
-
el.currentTime = seconds;
|
|
742
|
-
} catch {
|
|
743
|
-
}
|
|
744
|
-
};
|
|
745
|
-
switch (parsed.verb) {
|
|
746
|
-
case "playFrom":
|
|
747
|
-
safeSeek(parsed.seekSeconds ?? 0);
|
|
748
|
-
safePlay();
|
|
749
|
-
return true;
|
|
750
|
-
case "play":
|
|
751
|
-
safePlay();
|
|
752
|
-
return true;
|
|
753
|
-
case "pause":
|
|
754
|
-
el.pause();
|
|
755
|
-
return true;
|
|
756
|
-
case "stop":
|
|
757
|
-
el.pause();
|
|
758
|
-
safeSeek(0);
|
|
759
|
-
return true;
|
|
760
|
-
case "togglePlay":
|
|
761
|
-
if (el.paused) {
|
|
762
|
-
safePlay();
|
|
763
|
-
} else {
|
|
764
|
-
el.pause();
|
|
765
|
-
}
|
|
766
|
-
return true;
|
|
767
|
-
default:
|
|
768
|
-
return false;
|
|
769
|
-
}
|
|
726
|
+
function executeMediaCommand(command, frameRoot) {
|
|
727
|
+
return runMediaCommand(
|
|
728
|
+
command,
|
|
729
|
+
(targetId) => registry.get(targetId) ?? findMediaElementByElementId(targetId, frameRoot?.())
|
|
730
|
+
);
|
|
770
731
|
}
|
|
771
732
|
function PresentationMediaController({
|
|
772
733
|
element,
|
|
@@ -6292,7 +6253,7 @@ function FailedToLoad() {
|
|
|
6292
6253
|
var LazySurfaceChart3DScene = React6.lazy(
|
|
6293
6254
|
async () => {
|
|
6294
6255
|
try {
|
|
6295
|
-
return await import('./SurfaceChart3DScene-
|
|
6256
|
+
return await import('./SurfaceChart3DScene-GKRDDN2U.mjs');
|
|
6296
6257
|
} catch {
|
|
6297
6258
|
return { default: FailedToLoad };
|
|
6298
6259
|
}
|
|
Binary file
|
|
Binary file
|
|
@@ -86655,6 +86655,43 @@ var EQUATION_TEMPLATES = [
|
|
|
86655
86655
|
i18nKey: "pptx.equation.template.trigIdentity"
|
|
86656
86656
|
}
|
|
86657
86657
|
];
|
|
86658
|
+
function purifyFn() {
|
|
86659
|
+
const purify = DOMPurify__default.default;
|
|
86660
|
+
return typeof purify.sanitize === "function" ? purify.sanitize : void 0;
|
|
86661
|
+
}
|
|
86662
|
+
function sanitizeMarkupOrEmpty(markup, config) {
|
|
86663
|
+
const sanitize = purifyFn();
|
|
86664
|
+
return sanitize ? sanitize(markup, config) : "";
|
|
86665
|
+
}
|
|
86666
|
+
function sanitizeMathMl(markup) {
|
|
86667
|
+
const sanitized = sanitizeMarkupOrEmpty(markup, { USE_PROFILES: { mathMl: true, svg: true } });
|
|
86668
|
+
if (/<math(?:\s|>)/iu.test(markup) && !/<math(?:\s|>)/iu.test(sanitized) && sanitized) {
|
|
86669
|
+
return `<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline">${sanitized}</math>`;
|
|
86670
|
+
}
|
|
86671
|
+
return sanitized;
|
|
86672
|
+
}
|
|
86673
|
+
function emptyResult() {
|
|
86674
|
+
return { mathml: "", omml: {} };
|
|
86675
|
+
}
|
|
86676
|
+
function compileLatexEquation(source) {
|
|
86677
|
+
const trimmed = source.trim();
|
|
86678
|
+
if (!trimmed) {
|
|
86679
|
+
return emptyResult();
|
|
86680
|
+
}
|
|
86681
|
+
try {
|
|
86682
|
+
const omml = convertLatexToOmml(trimmed);
|
|
86683
|
+
const raw = convertOmmlToMathMl(omml);
|
|
86684
|
+
return { mathml: raw ? sanitizeMathMl(raw) : "", omml };
|
|
86685
|
+
} catch {
|
|
86686
|
+
return emptyResult();
|
|
86687
|
+
}
|
|
86688
|
+
}
|
|
86689
|
+
function latexToMathMl(source) {
|
|
86690
|
+
return compileLatexEquation(source).mathml;
|
|
86691
|
+
}
|
|
86692
|
+
function compileEquationTemplateMathMl() {
|
|
86693
|
+
return EQUATION_TEMPLATES.map((tmpl) => latexToMathMl(tmpl.latex));
|
|
86694
|
+
}
|
|
86658
86695
|
var ACCENT1 = "#4472C4";
|
|
86659
86696
|
var ACCENT2 = "#ED7D31";
|
|
86660
86697
|
var ACCENT3 = "#A5A5A5";
|
|
@@ -94976,6 +95013,76 @@ var PresentationAnimationController = class _PresentationAnimationController {
|
|
|
94976
95013
|
return ids;
|
|
94977
95014
|
}
|
|
94978
95015
|
};
|
|
95016
|
+
function applyMediaCommandVerb(el, parsed) {
|
|
95017
|
+
const safePlay = () => {
|
|
95018
|
+
void el.play().catch(() => {
|
|
95019
|
+
});
|
|
95020
|
+
};
|
|
95021
|
+
const safeSeek = (seconds) => {
|
|
95022
|
+
try {
|
|
95023
|
+
el.currentTime = seconds;
|
|
95024
|
+
} catch {
|
|
95025
|
+
}
|
|
95026
|
+
};
|
|
95027
|
+
switch (parsed.verb) {
|
|
95028
|
+
case "playFrom":
|
|
95029
|
+
safeSeek(parsed.seekSeconds ?? 0);
|
|
95030
|
+
safePlay();
|
|
95031
|
+
return true;
|
|
95032
|
+
case "play":
|
|
95033
|
+
safePlay();
|
|
95034
|
+
return true;
|
|
95035
|
+
case "pause":
|
|
95036
|
+
el.pause();
|
|
95037
|
+
return true;
|
|
95038
|
+
case "stop":
|
|
95039
|
+
el.pause();
|
|
95040
|
+
safeSeek(0);
|
|
95041
|
+
return true;
|
|
95042
|
+
case "togglePlay":
|
|
95043
|
+
if (el.paused) {
|
|
95044
|
+
safePlay();
|
|
95045
|
+
} else {
|
|
95046
|
+
el.pause();
|
|
95047
|
+
}
|
|
95048
|
+
return true;
|
|
95049
|
+
default:
|
|
95050
|
+
return false;
|
|
95051
|
+
}
|
|
95052
|
+
}
|
|
95053
|
+
function findMediaElementByElementId(targetId, root) {
|
|
95054
|
+
if (typeof HTMLMediaElement === "undefined") {
|
|
95055
|
+
return void 0;
|
|
95056
|
+
}
|
|
95057
|
+
const scope = root ?? (typeof document === "undefined" ? null : document);
|
|
95058
|
+
if (!scope) {
|
|
95059
|
+
return void 0;
|
|
95060
|
+
}
|
|
95061
|
+
for (const wrapper of scope.querySelectorAll("[data-element-id]")) {
|
|
95062
|
+
if (wrapper.dataset["elementId"] !== targetId) {
|
|
95063
|
+
continue;
|
|
95064
|
+
}
|
|
95065
|
+
if (wrapper instanceof HTMLMediaElement) {
|
|
95066
|
+
return wrapper;
|
|
95067
|
+
}
|
|
95068
|
+
const media = wrapper.querySelector("video, audio");
|
|
95069
|
+
if (media instanceof HTMLMediaElement) {
|
|
95070
|
+
return media;
|
|
95071
|
+
}
|
|
95072
|
+
}
|
|
95073
|
+
return void 0;
|
|
95074
|
+
}
|
|
95075
|
+
function runMediaCommand(command, resolve) {
|
|
95076
|
+
const el = resolve(command.targetId);
|
|
95077
|
+
if (!el) {
|
|
95078
|
+
return false;
|
|
95079
|
+
}
|
|
95080
|
+
const parsed = parseMediaCommand(command.command);
|
|
95081
|
+
if (!parsed) {
|
|
95082
|
+
return false;
|
|
95083
|
+
}
|
|
95084
|
+
return applyMediaCommandVerb(el, parsed);
|
|
95085
|
+
}
|
|
94979
95086
|
var PRESET_TO_EFFECT = {
|
|
94980
95087
|
fadeIn: "fadeIn",
|
|
94981
95088
|
flyIn: "flyInBottom",
|
|
@@ -96511,6 +96618,110 @@ function deleteTableColumn(tableData, colIdx) {
|
|
|
96511
96618
|
const newWidths = normalizeWidths(tableData.columnWidths.filter((_, i) => i !== colIdx));
|
|
96512
96619
|
return { ...tableData, rows: newRows, columnWidths: newWidths };
|
|
96513
96620
|
}
|
|
96621
|
+
function setCellText(element, rowIndex, colIndex, text2) {
|
|
96622
|
+
const tableData = element.tableData;
|
|
96623
|
+
if (!tableData) {
|
|
96624
|
+
return element;
|
|
96625
|
+
}
|
|
96626
|
+
const rows = tableData.rows.map((row, ri) => {
|
|
96627
|
+
if (ri !== rowIndex) {
|
|
96628
|
+
return row;
|
|
96629
|
+
}
|
|
96630
|
+
return {
|
|
96631
|
+
...row,
|
|
96632
|
+
cells: row.cells.map((cell, ci) => ci === colIndex ? { ...cell, text: text2 } : cell)
|
|
96633
|
+
};
|
|
96634
|
+
});
|
|
96635
|
+
return { ...element, tableData: { ...tableData, rows } };
|
|
96636
|
+
}
|
|
96637
|
+
function buildTableDataGrid(element) {
|
|
96638
|
+
const tableData = element.tableData;
|
|
96639
|
+
const sourceRows = tableData?.rows ?? [];
|
|
96640
|
+
const colCount = tableData?.columnWidths.length ?? 0;
|
|
96641
|
+
const colIndices = Array.from({ length: colCount }, (_unused, index) => index);
|
|
96642
|
+
const rows = sourceRows.map((row, rowIndex) => ({
|
|
96643
|
+
rowIndex,
|
|
96644
|
+
cells: colIndices.map((colIndex) => ({
|
|
96645
|
+
rowIndex,
|
|
96646
|
+
colIndex,
|
|
96647
|
+
text: row.cells[colIndex]?.text ?? ""
|
|
96648
|
+
}))
|
|
96649
|
+
}));
|
|
96650
|
+
return {
|
|
96651
|
+
rowCount: sourceRows.length,
|
|
96652
|
+
colCount,
|
|
96653
|
+
colIndices,
|
|
96654
|
+
rows,
|
|
96655
|
+
canRemoveRow: sourceRows.length > 1,
|
|
96656
|
+
canRemoveColumn: colCount > 1
|
|
96657
|
+
};
|
|
96658
|
+
}
|
|
96659
|
+
function withTableData(element, transform) {
|
|
96660
|
+
const tableData = element.tableData;
|
|
96661
|
+
if (!tableData) {
|
|
96662
|
+
return element;
|
|
96663
|
+
}
|
|
96664
|
+
const next = transform(tableData);
|
|
96665
|
+
if (next === tableData) {
|
|
96666
|
+
return element;
|
|
96667
|
+
}
|
|
96668
|
+
const updated = { ...element, tableData: next };
|
|
96669
|
+
if (element.rawXml) {
|
|
96670
|
+
const rawXml = rebuildTableStructureInRawXml(element, next);
|
|
96671
|
+
if (rawXml) {
|
|
96672
|
+
updated.rawXml = rawXml;
|
|
96673
|
+
}
|
|
96674
|
+
}
|
|
96675
|
+
return updated;
|
|
96676
|
+
}
|
|
96677
|
+
function setTableElementCellText(element, rowIndex, colIndex, text2) {
|
|
96678
|
+
const updated = setCellText(element, rowIndex, colIndex, text2);
|
|
96679
|
+
if (updated === element || !element.rawXml) {
|
|
96680
|
+
return updated;
|
|
96681
|
+
}
|
|
96682
|
+
const rawXml = updateCellTextInRawXml(element, rowIndex, colIndex, text2);
|
|
96683
|
+
return rawXml ? { ...updated, rawXml } : updated;
|
|
96684
|
+
}
|
|
96685
|
+
function insertTableElementRow(element, rowIdx, position2) {
|
|
96686
|
+
return withTableData(element, (data) => insertTableRow(data, rowIdx, position2));
|
|
96687
|
+
}
|
|
96688
|
+
function removeTableElementRow(element, rowIdx) {
|
|
96689
|
+
return withTableData(element, (data) => deleteTableRow(data, rowIdx));
|
|
96690
|
+
}
|
|
96691
|
+
function insertTableElementColumn(element, colIdx, position2) {
|
|
96692
|
+
return withTableData(element, (data) => insertTableColumn(data, colIdx, position2));
|
|
96693
|
+
}
|
|
96694
|
+
function removeTableElementColumn(element, colIdx) {
|
|
96695
|
+
return withTableData(element, (data) => deleteTableColumn(data, colIdx));
|
|
96696
|
+
}
|
|
96697
|
+
function appendTableElementRow(element) {
|
|
96698
|
+
const rowCount = element.tableData?.rows.length ?? 0;
|
|
96699
|
+
if (rowCount === 0) {
|
|
96700
|
+
return element;
|
|
96701
|
+
}
|
|
96702
|
+
return insertTableElementRow(element, rowCount - 1, "below");
|
|
96703
|
+
}
|
|
96704
|
+
function removeLastTableElementRow(element) {
|
|
96705
|
+
const rowCount = element.tableData?.rows.length ?? 0;
|
|
96706
|
+
if (rowCount === 0) {
|
|
96707
|
+
return element;
|
|
96708
|
+
}
|
|
96709
|
+
return removeTableElementRow(element, rowCount - 1);
|
|
96710
|
+
}
|
|
96711
|
+
function appendTableElementColumn(element) {
|
|
96712
|
+
const colCount = element.tableData?.columnWidths.length ?? 0;
|
|
96713
|
+
if (colCount === 0) {
|
|
96714
|
+
return element;
|
|
96715
|
+
}
|
|
96716
|
+
return insertTableElementColumn(element, colCount - 1, "right");
|
|
96717
|
+
}
|
|
96718
|
+
function removeLastTableElementColumn(element) {
|
|
96719
|
+
const colCount = element.tableData?.columnWidths.length ?? 0;
|
|
96720
|
+
if (colCount === 0) {
|
|
96721
|
+
return element;
|
|
96722
|
+
}
|
|
96723
|
+
return removeTableElementColumn(element, colCount - 1);
|
|
96724
|
+
}
|
|
96514
96725
|
function computeMergeCellRight(td, rowIndex, columnIndex) {
|
|
96515
96726
|
const row = td.rows[rowIndex];
|
|
96516
96727
|
if (!row) {
|
|
@@ -97984,14 +98195,43 @@ function computeAutoFitTextStyle(input) {
|
|
|
97984
98195
|
}
|
|
97985
98196
|
return result;
|
|
97986
98197
|
}
|
|
98198
|
+
var MAX_GROUP_DEPTH2 = 64;
|
|
97987
98199
|
function isLinkedTextBox(element) {
|
|
97988
98200
|
return hasTextProperties(element) && element.linkedTxbxId !== void 0;
|
|
97989
98201
|
}
|
|
98202
|
+
function flattenForChainResolution(elements) {
|
|
98203
|
+
if (!elements.some((el) => el.type === "group")) {
|
|
98204
|
+
return elements;
|
|
98205
|
+
}
|
|
98206
|
+
const flat = [];
|
|
98207
|
+
const seen = /* @__PURE__ */ new Set();
|
|
98208
|
+
const walk2 = (list, depth) => {
|
|
98209
|
+
for (const el of list) {
|
|
98210
|
+
if (el.type !== "group") {
|
|
98211
|
+
flat.push(el);
|
|
98212
|
+
continue;
|
|
98213
|
+
}
|
|
98214
|
+
if (seen.has(el)) {
|
|
98215
|
+
continue;
|
|
98216
|
+
}
|
|
98217
|
+
seen.add(el);
|
|
98218
|
+
flat.push(el);
|
|
98219
|
+
if (depth < MAX_GROUP_DEPTH2) {
|
|
98220
|
+
walk2(el.children ?? [], depth + 1);
|
|
98221
|
+
}
|
|
98222
|
+
}
|
|
98223
|
+
};
|
|
98224
|
+
walk2(elements, 0);
|
|
98225
|
+
return flat;
|
|
98226
|
+
}
|
|
97990
98227
|
function getOverflowSegments(element, slideElements) {
|
|
97991
98228
|
if (!slideElements || slideElements.length === 0) {
|
|
97992
98229
|
return void 0;
|
|
97993
98230
|
}
|
|
97994
|
-
|
|
98231
|
+
if (!isLinkedTextBox(element)) {
|
|
98232
|
+
return void 0;
|
|
98233
|
+
}
|
|
98234
|
+
return getLinkedTextBoxSegments(element, flattenForChainResolution(slideElements));
|
|
97995
98235
|
}
|
|
97996
98236
|
function resolveParagraphRtl(paraSegments, elementRtl) {
|
|
97997
98237
|
for (const entry2 of paraSegments) {
|
|
@@ -98771,21 +99011,6 @@ function buildTextRunFilterChain(style) {
|
|
|
98771
99011
|
}
|
|
98772
99012
|
return parts.length > 0 ? parts.join(" ") : void 0;
|
|
98773
99013
|
}
|
|
98774
|
-
function purifyFn() {
|
|
98775
|
-
const purify = DOMPurify__default.default;
|
|
98776
|
-
return typeof purify.sanitize === "function" ? purify.sanitize : void 0;
|
|
98777
|
-
}
|
|
98778
|
-
function sanitizeMarkupOrEmpty(markup, config) {
|
|
98779
|
-
const sanitize = purifyFn();
|
|
98780
|
-
return sanitize ? sanitize(markup, config) : "";
|
|
98781
|
-
}
|
|
98782
|
-
function sanitizeMathMl(markup) {
|
|
98783
|
-
const sanitized = sanitizeMarkupOrEmpty(markup, { USE_PROFILES: { mathMl: true, svg: true } });
|
|
98784
|
-
if (/<math(?:\s|>)/iu.test(markup) && !/<math(?:\s|>)/iu.test(sanitized) && sanitized) {
|
|
98785
|
-
return `<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline">${sanitized}</math>`;
|
|
98786
|
-
}
|
|
98787
|
-
return sanitized;
|
|
98788
|
-
}
|
|
98789
99014
|
function resolveParagraphStrutFontSize(segments, bodyFontSize) {
|
|
98790
99015
|
let largest;
|
|
98791
99016
|
for (const segment of segments) {
|
|
@@ -106900,6 +107125,84 @@ function mapPresentationKey(input, buffer = createPresentationKeyBuffer()) {
|
|
|
106900
107125
|
}
|
|
106901
107126
|
return { action: "none" };
|
|
106902
107127
|
}
|
|
107128
|
+
var READING_VIEW_ATTR = "data-pptx-reading-view";
|
|
107129
|
+
var READING_VIEW_COUNTER_ATTR = "data-pptx-reading-view-counter";
|
|
107130
|
+
var READING_VIEW_STAGE_ATTR = "data-pptx-reading-view-stage";
|
|
107131
|
+
var CLOSED_READING_VIEW = { open: false, slideIndex: 0 };
|
|
107132
|
+
function openReadingView(slideIndex, slideCount) {
|
|
107133
|
+
return { open: true, slideIndex: clampIndex(slideIndex, slideCount) };
|
|
107134
|
+
}
|
|
107135
|
+
function mapReadingViewKey(input, buffer) {
|
|
107136
|
+
const mapped = mapPresentationKey(input, buffer);
|
|
107137
|
+
switch (mapped.action) {
|
|
107138
|
+
case "next":
|
|
107139
|
+
return { command: "next" };
|
|
107140
|
+
case "previous":
|
|
107141
|
+
return { command: "previous" };
|
|
107142
|
+
case "first":
|
|
107143
|
+
return { command: "first" };
|
|
107144
|
+
case "last":
|
|
107145
|
+
return { command: "last" };
|
|
107146
|
+
case "goto":
|
|
107147
|
+
return { command: "goto", slideIndex: mapped.slideNumber - 1 };
|
|
107148
|
+
case "end":
|
|
107149
|
+
return { command: "exit" };
|
|
107150
|
+
default:
|
|
107151
|
+
return { command: "none" };
|
|
107152
|
+
}
|
|
107153
|
+
}
|
|
107154
|
+
function handleReadingViewKey(input, buffer) {
|
|
107155
|
+
const command = mapReadingViewKey(input, buffer);
|
|
107156
|
+
if (command.command !== "none") {
|
|
107157
|
+
return { command, swallow: true, preventDefault: true };
|
|
107158
|
+
}
|
|
107159
|
+
const isChord = Boolean(input.ctrlKey || input.metaKey || input.altKey);
|
|
107160
|
+
return { command, swallow: !isChord, preventDefault: false };
|
|
107161
|
+
}
|
|
107162
|
+
function applyReadingViewCommand(state, command, slideCount) {
|
|
107163
|
+
if (!state.open || slideCount <= 0) {
|
|
107164
|
+
return state.open ? CLOSED_READING_VIEW : state;
|
|
107165
|
+
}
|
|
107166
|
+
const last = slideCount - 1;
|
|
107167
|
+
switch (command.command) {
|
|
107168
|
+
case "next":
|
|
107169
|
+
return state.slideIndex >= last ? CLOSED_READING_VIEW : { open: true, slideIndex: state.slideIndex + 1 };
|
|
107170
|
+
case "previous":
|
|
107171
|
+
return { open: true, slideIndex: Math.max(0, state.slideIndex - 1) };
|
|
107172
|
+
case "first":
|
|
107173
|
+
return { open: true, slideIndex: 0 };
|
|
107174
|
+
case "last":
|
|
107175
|
+
return { open: true, slideIndex: last };
|
|
107176
|
+
case "goto":
|
|
107177
|
+
return { open: true, slideIndex: clampIndex(command.slideIndex, slideCount) };
|
|
107178
|
+
case "exit":
|
|
107179
|
+
return CLOSED_READING_VIEW;
|
|
107180
|
+
default:
|
|
107181
|
+
return state;
|
|
107182
|
+
}
|
|
107183
|
+
}
|
|
107184
|
+
function canGoPrevious(state) {
|
|
107185
|
+
return state.open && state.slideIndex > 0;
|
|
107186
|
+
}
|
|
107187
|
+
function canGoNext(state, slideCount) {
|
|
107188
|
+
return state.open && slideCount > 0;
|
|
107189
|
+
}
|
|
107190
|
+
function readingViewFitScale(canvas, viewport, padding = 0) {
|
|
107191
|
+
const available = {
|
|
107192
|
+
width: viewport.width - padding * 2,
|
|
107193
|
+
height: viewport.height - padding * 2
|
|
107194
|
+
};
|
|
107195
|
+
if (canvas.width <= 0 || canvas.height <= 0 || available.width <= 0 || available.height <= 0) {
|
|
107196
|
+
return 0;
|
|
107197
|
+
}
|
|
107198
|
+
return Math.min(available.width / canvas.width, available.height / canvas.height);
|
|
107199
|
+
}
|
|
107200
|
+
function clampIndex(index, slideCount) {
|
|
107201
|
+
if (!Number.isFinite(index) || slideCount <= 0) {
|
|
107202
|
+
return 0;
|
|
107203
|
+
}
|
|
107204
|
+
return Math.min(Math.max(Math.trunc(index), 0), slideCount - 1);
|
|
107205
|
+
}
|
|
106903
107206
|
var NUDGE_SMALL = 1;
|
|
106904
107207
|
var NUDGE_LARGE = 10;
|
|
106905
107208
|
var GUARD_DEFAULTS = {
|
|
@@ -112637,6 +112940,9 @@ exports.PptxHandler = PptxHandler;
|
|
|
112637
112940
|
exports.PptxMarkdownConverter = PptxMarkdownConverter;
|
|
112638
112941
|
exports.PresentationAnimationController = PresentationAnimationController;
|
|
112639
112942
|
exports.QUICK_ACCESS_COMMAND_CATALOG = QUICK_ACCESS_COMMAND_CATALOG;
|
|
112943
|
+
exports.READING_VIEW_ATTR = READING_VIEW_ATTR;
|
|
112944
|
+
exports.READING_VIEW_COUNTER_ATTR = READING_VIEW_COUNTER_ATTR;
|
|
112945
|
+
exports.READING_VIEW_STAGE_ATTR = READING_VIEW_STAGE_ATTR;
|
|
112640
112946
|
exports.RULER_FONT_SIZE = RULER_FONT_SIZE;
|
|
112641
112947
|
exports.RULER_THICKNESS = RULER_THICKNESS;
|
|
112642
112948
|
exports.SECTION_HEADING = SECTION_HEADING;
|
|
@@ -112681,6 +112987,8 @@ exports.addSmartArtNodeAsChild = addSmartArtNodeAsChild;
|
|
|
112681
112987
|
exports.addTagToCollections = addTagToCollections;
|
|
112682
112988
|
exports.alignElements = alignElements;
|
|
112683
112989
|
exports.appendPresentationInkPoint = appendPresentationInkPoint;
|
|
112990
|
+
exports.appendTableElementColumn = appendTableElementColumn;
|
|
112991
|
+
exports.appendTableElementRow = appendTableElementRow;
|
|
112684
112992
|
exports.apply3dEffects = apply3dEffects;
|
|
112685
112993
|
exports.applyAcceptAllSlides = applyAcceptAllSlides;
|
|
112686
112994
|
exports.applyAcceptSlide = applyAcceptSlide;
|
|
@@ -112690,6 +112998,7 @@ exports.applyColorChange = applyColorChange;
|
|
|
112690
112998
|
exports.applyDuotone = applyDuotone;
|
|
112691
112999
|
exports.applyFormatToElement = applyFormatToElement;
|
|
112692
113000
|
exports.applyPreferenceToOptions = applyPreferenceToOptions;
|
|
113001
|
+
exports.applyReadingViewCommand = applyReadingViewCommand;
|
|
112693
113002
|
exports.applyRehearsalTimings = applyRehearsalTimings;
|
|
112694
113003
|
exports.applyReroutedConnectors = applyReroutedConnectors;
|
|
112695
113004
|
exports.applyResize = applyResize;
|
|
@@ -112739,6 +113048,7 @@ exports.buildSmartArtPresetData = buildSmartArtPresetData;
|
|
|
112739
113048
|
exports.buildStrokeOutline = buildStrokeOutline;
|
|
112740
113049
|
exports.buildSummaryZoomView = buildSummaryZoomView;
|
|
112741
113050
|
exports.buildSvgGradientDef = buildSvgGradientDef;
|
|
113051
|
+
exports.buildTableDataGrid = buildTableDataGrid;
|
|
112742
113052
|
exports.buildTextBlockStyle = buildTextBlockStyle;
|
|
112743
113053
|
exports.buildTextBody3DSceneStyle = buildTextBody3DSceneStyle;
|
|
112744
113054
|
exports.buildTextBuildSpec = buildTextBuildSpec;
|
|
@@ -112750,6 +113060,8 @@ exports.buildThemeColorGrid = buildThemeColorGrid;
|
|
|
112750
113060
|
exports.buildThemeColorMap = buildThemeColorMap;
|
|
112751
113061
|
exports.buildUserFontFaceStyles = buildUserFontFaceStyles;
|
|
112752
113062
|
exports.canCommitActionType = canCommitActionType;
|
|
113063
|
+
exports.canGoNext = canGoNext;
|
|
113064
|
+
exports.canGoPrevious = canGoPrevious;
|
|
112753
113065
|
exports.canvasToJpegData = canvasToJpegData;
|
|
112754
113066
|
exports.cell3DBevelCss = cell3DBevelCss;
|
|
112755
113067
|
exports.chartDataChangeType = chartDataChangeType;
|
|
@@ -112773,6 +113085,8 @@ exports.collectMediaElements = collectMediaElements;
|
|
|
112773
113085
|
exports.collectUsedFonts = collectUsedFonts;
|
|
112774
113086
|
exports.colorWithOpacity = colorWithOpacity;
|
|
112775
113087
|
exports.comparePresentation = comparePresentation;
|
|
113088
|
+
exports.compileEquationTemplateMathMl = compileEquationTemplateMathMl;
|
|
113089
|
+
exports.compileLatexEquation = compileLatexEquation;
|
|
112776
113090
|
exports.computeAllNotesPages = computeAllNotesPages;
|
|
112777
113091
|
exports.computeColumnBoundaries = computeColumnBoundaries;
|
|
112778
113092
|
exports.computeEntranceAnimationDelay = computeEntranceAnimationDelay;
|
|
@@ -112839,6 +113153,7 @@ exports.extractPathPoints = extractPathPoints;
|
|
|
112839
113153
|
exports.filterCommands = filterCommands;
|
|
112840
113154
|
exports.filterRenderedElements = filterRenderedElements;
|
|
112841
113155
|
exports.findChartPartTarget = findChartPartTarget;
|
|
113156
|
+
exports.findMediaElementByElementId = findMediaElementByElementId;
|
|
112842
113157
|
exports.findSmartArtNodeText = findSmartArtNodeText;
|
|
112843
113158
|
exports.flattenTagCollections = flattenTagCollections;
|
|
112844
113159
|
exports.formatAxisValue = formatAxisValue;
|
|
@@ -112923,6 +113238,7 @@ exports.groupElements = groupElements;
|
|
|
112923
113238
|
exports.groupIntoParagraphs = groupIntoParagraphs;
|
|
112924
113239
|
exports.groupSlidesBySection = groupSlidesBySection;
|
|
112925
113240
|
exports.guidePxToEmu = guidePxToEmu;
|
|
113241
|
+
exports.handleReadingViewKey = handleReadingViewKey;
|
|
112926
113242
|
exports.hasCopyableFormat = hasCopyableFormat;
|
|
112927
113243
|
exports.hasDistinctScriptFonts = hasDistinctScriptFonts;
|
|
112928
113244
|
exports.hasPressureVariation = hasPressureVariation;
|
|
@@ -112988,11 +113304,11 @@ exports.ooxmlDashToCssBorderStyle = ooxmlDashToCssBorderStyle;
|
|
|
112988
113304
|
exports.ooxmlGradientAngleToCssDegrees = ooxmlGradientAngleToCssDegrees;
|
|
112989
113305
|
exports.openNativeEyeDropper = openNativeEyeDropper;
|
|
112990
113306
|
exports.openPptxFile = openPptxFile;
|
|
113307
|
+
exports.openReadingView = openReadingView;
|
|
112991
113308
|
exports.openUrlInNewTab = openUrlInNewTab;
|
|
112992
113309
|
exports.paletteColor = paletteColor;
|
|
112993
113310
|
exports.parseDrawingColor = parseDrawingColor;
|
|
112994
113311
|
exports.parseDrawingColorOpacity = parseDrawingColorOpacity;
|
|
112995
|
-
exports.parseMediaCommand = parseMediaCommand;
|
|
112996
113312
|
exports.parsePpactionUrl = parsePpactionUrl;
|
|
112997
113313
|
exports.pickSupportedMimeType = pickSupportedMimeType;
|
|
112998
113314
|
exports.placeAudienceWindow = placeAudienceWindow;
|
|
@@ -113014,6 +113330,7 @@ exports.readBackstageRecentFile = readBackstageRecentFile;
|
|
|
113014
113330
|
exports.readSlidesFromYDoc = readSlidesFromYDoc;
|
|
113015
113331
|
exports.readStoredViewerPrefs = readStoredViewerPrefs;
|
|
113016
113332
|
exports.readViewportMetrics = readViewportMetrics;
|
|
113333
|
+
exports.readingViewFitScale = readingViewFitScale;
|
|
113017
113334
|
exports.rebuildDrawingShapesIfCleared = rebuildDrawingShapesIfCleared;
|
|
113018
113335
|
exports.rebuildTableStructureInRawXml = rebuildTableStructureInRawXml;
|
|
113019
113336
|
exports.reconcileSlidesInYDoc = reconcileSlidesInYDoc;
|
|
@@ -113023,8 +113340,12 @@ exports.registerCollaborationTeardown = registerCollaborationTeardown;
|
|
|
113023
113340
|
exports.remapTextToSegments = remapTextToSegments;
|
|
113024
113341
|
exports.removeChartCategory = removeChartCategory;
|
|
113025
113342
|
exports.removeChartSeries = removeChartSeries;
|
|
113343
|
+
exports.removeLastTableElementColumn = removeLastTableElementColumn;
|
|
113344
|
+
exports.removeLastTableElementRow = removeLastTableElementRow;
|
|
113026
113345
|
exports.removeQuickAccessCommand = removeQuickAccessCommand;
|
|
113027
113346
|
exports.removeSmartArtNode = removeSmartArtNode;
|
|
113347
|
+
exports.removeTableElementColumn = removeTableElementColumn;
|
|
113348
|
+
exports.removeTableElementRow = removeTableElementRow;
|
|
113028
113349
|
exports.renameSection = renameSection;
|
|
113029
113350
|
exports.reorderSmartArtNode = reorderSmartArtNode;
|
|
113030
113351
|
exports.rerouteConnectorsForMovedElements = rerouteConnectorsForMovedElements;
|
|
@@ -113057,6 +113378,7 @@ exports.resolveViewerAddinRows = resolveViewerAddinRows;
|
|
|
113057
113378
|
exports.restoreSegmentSelection = restoreSegmentSelection;
|
|
113058
113379
|
exports.revealedSmartArtNodeCount = revealedSmartArtNodeCount;
|
|
113059
113380
|
exports.rulerDragToGuidePosition = rulerDragToGuidePosition;
|
|
113381
|
+
exports.runMediaCommand = runMediaCommand;
|
|
113060
113382
|
exports.safeOpenUrl = safeOpenUrl;
|
|
113061
113383
|
exports.sanitizeColor = sanitizeColor;
|
|
113062
113384
|
exports.sanitizeDownloadFilename = sanitizeDownloadFilename;
|
|
@@ -113086,6 +113408,7 @@ exports.setChartSeriesMarker = setChartSeriesMarker;
|
|
|
113086
113408
|
exports.setDuotoneCachedResult = setDuotoneCachedResult;
|
|
113087
113409
|
exports.setPendingSelectionRestore = setPendingSelectionRestore;
|
|
113088
113410
|
exports.setSmartArtNodeStyle = setSmartArtNodeStyle;
|
|
113411
|
+
exports.setTableElementCellText = setTableElementCellText;
|
|
113089
113412
|
exports.shadeColor2 = shadeColor2;
|
|
113090
113413
|
exports.shouldAutoFollowBroadcaster = shouldAutoFollowBroadcaster;
|
|
113091
113414
|
exports.shouldCommitSmartArtNodeText = shouldCommitSmartArtNodeText;
|
|
Binary file
|
|
Binary file
|