pptx-react-viewer 3.0.3 → 3.1.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.
Files changed (155) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/{AiChatPanel-DYOBY6OG.mjs → AiChatPanel-5LCCN7FG.mjs} +4 -4
  3. package/dist/AiChatPanel-5LCCN7FG.mjs.br +0 -0
  4. package/dist/AiChatPanel-5LCCN7FG.mjs.gz +0 -0
  5. package/dist/{AiChatPanel-235ZZA3Y.js → AiChatPanel-WVORGKRT.js} +24 -24
  6. package/dist/AiChatPanel-WVORGKRT.js.br +0 -0
  7. package/dist/AiChatPanel-WVORGKRT.js.gz +0 -0
  8. package/dist/Area3DChartScene-DY5CSLE2.js +47 -0
  9. package/dist/Area3DChartScene-DY5CSLE2.js.br +0 -0
  10. package/dist/Area3DChartScene-DY5CSLE2.js.gz +0 -0
  11. package/dist/Area3DChartScene-W6UZTRDP.mjs +45 -0
  12. package/dist/Area3DChartScene-W6UZTRDP.mjs.br +0 -0
  13. package/dist/Area3DChartScene-W6UZTRDP.mjs.gz +0 -0
  14. package/dist/Bar3DChartScene-7HZSPYG4.js +47 -0
  15. package/dist/Bar3DChartScene-7HZSPYG4.js.br +0 -0
  16. package/dist/Bar3DChartScene-7HZSPYG4.js.gz +0 -0
  17. package/dist/Bar3DChartScene-FCWQEQLH.mjs +45 -0
  18. package/dist/Bar3DChartScene-FCWQEQLH.mjs.br +0 -0
  19. package/dist/Bar3DChartScene-FCWQEQLH.mjs.gz +0 -0
  20. package/dist/Line3DChartScene-BKO24WYO.js +47 -0
  21. package/dist/Line3DChartScene-BKO24WYO.js.br +0 -0
  22. package/dist/Line3DChartScene-BKO24WYO.js.gz +0 -0
  23. package/dist/Line3DChartScene-EPPWQOHS.mjs +45 -0
  24. package/dist/Line3DChartScene-EPPWQOHS.mjs.br +0 -0
  25. package/dist/Line3DChartScene-EPPWQOHS.mjs.gz +0 -0
  26. package/dist/{Model3DScene-A3652H7T.mjs → Model3DScene-IAY33GO2.mjs} +1 -1
  27. package/dist/Model3DScene-IAY33GO2.mjs.br +0 -0
  28. package/dist/Model3DScene-IAY33GO2.mjs.gz +0 -0
  29. package/dist/{Model3DScene-5QDYQF55.js → Model3DScene-JFVRE5VL.js} +2 -2
  30. package/dist/Model3DScene-JFVRE5VL.js.br +0 -0
  31. package/dist/Model3DScene-JFVRE5VL.js.gz +0 -0
  32. package/dist/PieChart3DScene-IPH7GLKU.js +47 -0
  33. package/dist/PieChart3DScene-IPH7GLKU.js.br +0 -0
  34. package/dist/PieChart3DScene-IPH7GLKU.js.gz +0 -0
  35. package/dist/PieChart3DScene-ZP5TSL62.mjs +45 -0
  36. package/dist/PieChart3DScene-ZP5TSL62.mjs.br +0 -0
  37. package/dist/PieChart3DScene-ZP5TSL62.mjs.gz +0 -0
  38. package/dist/{PowerPointViewer-SkkxAGKa.d.ts → PowerPointViewer-Cl6jBPNw.d.ts} +2 -2
  39. package/dist/PowerPointViewer-Cl6jBPNw.d.ts.map +1 -0
  40. package/dist/{SurfaceChart3DScene-N66TY4SW.mjs → SurfaceChart3DScene-DOMJGPAD.mjs} +1 -1
  41. package/dist/SurfaceChart3DScene-DOMJGPAD.mjs.br +0 -0
  42. package/dist/SurfaceChart3DScene-DOMJGPAD.mjs.gz +0 -0
  43. package/dist/{SurfaceChart3DScene-QHENN3AF.js → SurfaceChart3DScene-TGDBVJSW.js} +2 -2
  44. package/dist/SurfaceChart3DScene-TGDBVJSW.js.br +0 -0
  45. package/dist/SurfaceChart3DScene-TGDBVJSW.js.gz +0 -0
  46. package/dist/{audience-content-store-Bx4Yj2pN.d.ts → audience-content-store-bR7Gs_1S.d.ts} +2 -2
  47. package/dist/{audience-content-store-Bx4Yj2pN.d.ts.map → audience-content-store-bR7Gs_1S.d.ts.map} +1 -1
  48. package/dist/{chunk-UU6NFFRR.js → chunk-7JZLE56X.js} +170 -169
  49. package/dist/chunk-7JZLE56X.js.br +0 -0
  50. package/dist/chunk-7JZLE56X.js.gz +0 -0
  51. package/dist/{chunk-Z4RY432D.js → chunk-A5EUD6UU.js} +2575 -1965
  52. package/dist/chunk-A5EUD6UU.js.br +0 -0
  53. package/dist/chunk-A5EUD6UU.js.gz +0 -0
  54. package/dist/{chunk-M2TISD4A.mjs → chunk-BP2L2KOZ.mjs} +6183 -2447
  55. package/dist/chunk-BP2L2KOZ.mjs.br +0 -0
  56. package/dist/chunk-BP2L2KOZ.mjs.gz +0 -0
  57. package/dist/{chunk-L5MNLIQF.mjs → chunk-MKPSUHUH.mjs} +25 -0
  58. package/dist/chunk-MKPSUHUH.mjs.br +0 -0
  59. package/dist/chunk-MKPSUHUH.mjs.gz +0 -0
  60. package/dist/{chunk-U6A5FWWE.js → chunk-PIUB7R2K.js} +25 -0
  61. package/dist/chunk-PIUB7R2K.js.br +0 -0
  62. package/dist/chunk-PIUB7R2K.js.gz +0 -0
  63. package/dist/{chunk-7HUYHWQS.js → chunk-POAZ53L5.js} +480 -532
  64. package/dist/chunk-POAZ53L5.js.br +0 -0
  65. package/dist/chunk-POAZ53L5.js.gz +0 -0
  66. package/dist/{chunk-EVXT7HLY.mjs → chunk-PQNZCSB7.mjs} +1 -1
  67. package/dist/chunk-PQNZCSB7.mjs.br +0 -0
  68. package/dist/{chunk-EVXT7HLY.mjs.gz → chunk-PQNZCSB7.mjs.gz} +0 -0
  69. package/dist/{chunk-QG7TXWXP.mjs → chunk-SNWAM2XJ.mjs} +17 -16
  70. package/dist/chunk-SNWAM2XJ.mjs.br +0 -0
  71. package/dist/chunk-SNWAM2XJ.mjs.gz +0 -0
  72. package/dist/{chunk-35YJ5RLU.js → chunk-T7BAPZBY.js} +6214 -2447
  73. package/dist/chunk-T7BAPZBY.js.br +0 -0
  74. package/dist/chunk-T7BAPZBY.js.gz +0 -0
  75. package/dist/{chunk-CY24IMMZ.mjs → chunk-TIEUZCYQ.mjs} +761 -151
  76. package/dist/chunk-TIEUZCYQ.mjs.br +0 -0
  77. package/dist/chunk-TIEUZCYQ.mjs.gz +0 -0
  78. package/dist/{chunk-YISXETNN.mjs → chunk-VMLKJDA5.mjs} +97 -149
  79. package/dist/chunk-VMLKJDA5.mjs.br +0 -0
  80. package/dist/chunk-VMLKJDA5.mjs.gz +0 -0
  81. package/dist/{chunk-GJ7E44BG.js → chunk-VQVC27WL.js} +3 -3
  82. package/dist/chunk-VQVC27WL.js.br +0 -0
  83. package/dist/chunk-VQVC27WL.js.gz +0 -0
  84. package/dist/i18n.js +4 -4
  85. package/dist/i18n.js.br +0 -0
  86. package/dist/i18n.js.gz +0 -0
  87. package/dist/i18n.mjs +1 -1
  88. package/dist/i18n.mjs.br +0 -0
  89. package/dist/i18n.mjs.gz +0 -0
  90. package/dist/index.d.ts +202 -9
  91. package/dist/index.js +47 -47
  92. package/dist/index.js.br +0 -0
  93. package/dist/index.js.gz +0 -0
  94. package/dist/index.mjs +6 -6
  95. package/dist/index.mjs.br +0 -0
  96. package/dist/index.mjs.gz +0 -0
  97. package/dist/internals.d.ts +164 -20
  98. package/dist/internals.d.ts.map +1 -1
  99. package/dist/internals.js +79 -79
  100. package/dist/internals.js.br +7 -3
  101. package/dist/internals.js.gz +0 -0
  102. package/dist/internals.mjs +4 -4
  103. package/dist/internals.mjs.br +0 -0
  104. package/dist/internals.mjs.gz +0 -0
  105. package/dist/pptx-viewer.css +1 -1
  106. package/dist/pptx-viewer.css.br +0 -0
  107. package/dist/pptx-viewer.css.gz +0 -0
  108. package/dist/{types-kLpvSPxq.d.ts → types-Bzdkiakq.d.ts} +44 -1
  109. package/dist/{types-kLpvSPxq.d.ts.map → types-Bzdkiakq.d.ts.map} +1 -1
  110. package/dist/{useViewerBuildingBlocks-fh7rq4jc.d.ts → useViewerBuildingBlocks-DC1O_op4.d.ts} +2 -2
  111. package/dist/{useViewerBuildingBlocks-fh7rq4jc.d.ts.map → useViewerBuildingBlocks-DC1O_op4.d.ts.map} +1 -1
  112. package/dist/viewer/index.d.ts +196 -6
  113. package/dist/viewer/index.js +27 -27
  114. package/dist/viewer/index.js.br +0 -0
  115. package/dist/viewer/index.js.gz +0 -0
  116. package/dist/viewer/index.mjs +6 -6
  117. package/dist/viewer/index.mjs.br +0 -0
  118. package/dist/viewer/index.mjs.gz +0 -0
  119. package/package.json +5 -5
  120. package/dist/AiChatPanel-235ZZA3Y.js.br +0 -0
  121. package/dist/AiChatPanel-235ZZA3Y.js.gz +0 -0
  122. package/dist/AiChatPanel-DYOBY6OG.mjs.br +0 -0
  123. package/dist/AiChatPanel-DYOBY6OG.mjs.gz +0 -0
  124. package/dist/Model3DScene-5QDYQF55.js.br +0 -0
  125. package/dist/Model3DScene-5QDYQF55.js.gz +0 -0
  126. package/dist/Model3DScene-A3652H7T.mjs.br +0 -0
  127. package/dist/Model3DScene-A3652H7T.mjs.gz +0 -0
  128. package/dist/PowerPointViewer-SkkxAGKa.d.ts.map +0 -1
  129. package/dist/SurfaceChart3DScene-N66TY4SW.mjs.br +0 -0
  130. package/dist/SurfaceChart3DScene-N66TY4SW.mjs.gz +0 -0
  131. package/dist/SurfaceChart3DScene-QHENN3AF.js.br +0 -0
  132. package/dist/SurfaceChart3DScene-QHENN3AF.js.gz +0 -0
  133. package/dist/chunk-35YJ5RLU.js.br +0 -0
  134. package/dist/chunk-35YJ5RLU.js.gz +0 -0
  135. package/dist/chunk-7HUYHWQS.js.br +0 -0
  136. package/dist/chunk-7HUYHWQS.js.gz +0 -0
  137. package/dist/chunk-CY24IMMZ.mjs.br +0 -0
  138. package/dist/chunk-CY24IMMZ.mjs.gz +0 -0
  139. package/dist/chunk-EVXT7HLY.mjs.br +0 -0
  140. package/dist/chunk-GJ7E44BG.js.br +0 -0
  141. package/dist/chunk-GJ7E44BG.js.gz +0 -0
  142. package/dist/chunk-L5MNLIQF.mjs.br +0 -0
  143. package/dist/chunk-L5MNLIQF.mjs.gz +0 -0
  144. package/dist/chunk-M2TISD4A.mjs.br +0 -0
  145. package/dist/chunk-M2TISD4A.mjs.gz +0 -0
  146. package/dist/chunk-QG7TXWXP.mjs.br +0 -0
  147. package/dist/chunk-QG7TXWXP.mjs.gz +0 -0
  148. package/dist/chunk-U6A5FWWE.js.br +0 -0
  149. package/dist/chunk-U6A5FWWE.js.gz +0 -0
  150. package/dist/chunk-UU6NFFRR.js.br +0 -0
  151. package/dist/chunk-UU6NFFRR.js.gz +0 -0
  152. package/dist/chunk-YISXETNN.mjs.br +0 -0
  153. package/dist/chunk-YISXETNN.mjs.gz +0 -0
  154. package/dist/chunk-Z4RY432D.js.br +0 -0
  155. package/dist/chunk-Z4RY432D.js.gz +0 -0
Binary file
Binary file
@@ -1,4 +1,4 @@
1
- import { ThemePresets, PptxMarkdownConverter } from './chunk-M2TISD4A.mjs';
1
+ import { ThemePresets, PptxMarkdownConverter } from './chunk-BP2L2KOZ.mjs';
2
2
  import { __export } from './chunk-XGB3TDIC.mjs';
3
3
  import * as mcp from 'pptx-viewer-mcp';
4
4
  import * as mcpSchemas from 'pptx-viewer-mcp/schemas';
Binary file
@@ -1,5 +1,5 @@
1
- import { translationsEn } from './chunk-L5MNLIQF.mjs';
2
- import { SHAPE_PRESET_DEFS, VIEWER_SHORTCUT_REFERENCE, getAnimationInitialStyle, cloneHistorySnapshot, hasShapeProperties, getImageFitStyle, isImageLikeElement, getImageTilingStyle, runMediaCommand, findMediaElementByElementId, mediaPlaybackAttributes, buildTextBlockStyle, hasTextProperties, toCssWritingMode, toCssTextOrientation, toCssVerticalDirection, buildTextBodyLayoutStyle, buildTextBody3DSceneStyle, buildParagraphs, colorWithOpacity, normalizeHexColor, build3DExtrusionData, getComputedFillStyle, getComputedEffectStyle, getComputedStrokeStyle, isStrokeOnlyPresetElement, resolveShapeGeometry, normalizeStrokeDashType, getSvgStrokeDasharray, buildSvgGradientDef, isCalloutShape, getCalloutLeaderLineGeometry, buildCalloutLeaderLineSvgPath, getCalloutViewBoxBounds, svgLineCap, getCompoundLineOffsets, getCompoundLineWidths, computeSelectionRect, DEFAULT_FONT_FAMILY, cellStyleToCss, rectToCells, isCellInRect, tableContainerCss, buildChartViewModel, resolveChartKind, chartPreserveAspectRatio, buildNotesPdfBytes, buildSlidesPdfBytes, buildPreviewAnimation, buildMotionPathPreview, getRoundRectRadiusPx2, getResolvedShapeClipPath, mediaFallbackVisual, registerPersistentAudio, resolveAutoFitFontScale, resolveFontKerning, getSubstituteFontFamily, parsePanoseString, resolveScriptFontSet, hasDistinctScriptFonts, nestedTextDecorationStyle, pieceLetterSpacing, resolveMetricTrackingPx, hollowTextFillStyle, buildTabContext, TEXT_BUILD_ID_SEP, buildTextBuildSpec, textBuildSpanStyle, apply3dEffects, clampUnitInterval, customGeometryPathsToSvgSubpaths, svgGradientFillRef, buildSubpathPaints, computeColumnBoundaries, getTableCellBandStyle, parseDrawingColor, parseDrawingColorOpacity, getCellDiagonalBorders, cellRunStyle, getChartStylePalette, computeChartLegendLayout, mediaFallbackIcon, mediaFallbackLabelKey, MEDIA_CHROME_ATTRIBUTE, convertOmmlToMathMl, sanitizeMathMl, tableCellCss, computeResizedColumnWidths, computeResizedRowHeight, DEFAULT_ROW_HEIGHT, ooxmlGradientAngleToCssDegrees, buildRunTabLines, chartPartToAttrs, splitRunForMetrics, splitRunByScriptFont } from './chunk-M2TISD4A.mjs';
1
+ import { translationsEn } from './chunk-MKPSUHUH.mjs';
2
+ import { SHAPE_PRESET_DEFS, VIEWER_SHORTCUT_REFERENCE, getAnimationInitialStyle, cloneHistorySnapshot, hasShapeProperties, getImageFitStyle, isImageLikeElement, getImageTilingStyle, runMediaCommand, findMediaElementByElementId, mediaPlaybackAttributes, buildTextBlockStyle, hasTextProperties, toCssWritingMode, toCssTextOrientation, toCssVerticalDirection, buildTextBodyLayoutStyle, buildTextBody3DSceneStyle, buildParagraphs, colorWithOpacity, normalizeHexColor, build3DExtrusionData, getComputedFillStyle, getComputedEffectStyle, getComputedStrokeStyle, isStrokeOnlyPresetElement, resolveShapeGeometry, normalizeStrokeDashType, getSvgStrokeDasharray, buildSvgGradientDef, isCalloutShape, getCalloutLeaderLineGeometry, buildCalloutLeaderLineSvgPath, getCalloutViewBoxBounds, svgLineCap, getCompoundLineOffsets, getCompoundLineWidths, computeSelectionRect, DEFAULT_FONT_FAMILY, cellStyleToCss, rectToCells, isCellInRect, tableContainerCss, buildChartViewModel, resolveChartKind, chartPreserveAspectRatio, buildNotesPdfBytes, buildSlidesPdfBytes, buildPreviewAnimation, buildMotionPathPreview, getRoundRectRadiusPx2, getResolvedShapeClipPath, mediaFallbackVisual, registerPersistentAudio, resolveAutoFitFontScale, resolveFontKerning, getSubstituteFontFamily, parsePanoseString, resolveScriptFontSet, hasDistinctScriptFonts, nestedTextDecorationStyle, pieceLetterSpacing, resolveMetricTrackingPx, hollowTextFillStyle, buildTabContext, TEXT_BUILD_ID_SEP, buildTextBuildSpec, textBuildSpanStyle, apply3dEffects, clampUnitInterval, customGeometryPathsToSvgSubpaths, svgGradientFillRef, 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-BP2L2KOZ.mjs';
3
3
  import { clsx } from 'clsx';
4
4
  import { twMerge } from 'tailwind-merge';
5
5
  import React6, { useRef, useState, useEffect, useCallback, useMemo, useLayoutEffect } from 'react';
@@ -2375,13 +2375,13 @@ function parseGradientFillCss(gradFill) {
2375
2375
  if (stops.length === 0) {
2376
2376
  return void 0;
2377
2377
  }
2378
- const parsed = stops.map((gs) => {
2378
+ const rawStops = stops.map((gs) => {
2379
2379
  const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
2380
2380
  const color = parseDrawingColor(gs) ?? "#888888";
2381
2381
  const opacity = parseDrawingColorOpacity(gs);
2382
- return { pos, color: colorWithOpacity(color, opacity) };
2383
- }).sort((a, b) => a.pos - b.pos);
2384
- const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
2382
+ return { position: pos, color, opacity };
2383
+ }).sort((a, b) => a.position - b.position);
2384
+ const stopStrings = rawStops.map((s) => `${colorWithOpacity(s.color, s.opacity)} ${s.position.toFixed(1)}%`).join(", ");
2385
2385
  const lin = gradFill["a:lin"];
2386
2386
  if (lin) {
2387
2387
  const angRaw = Number.parseInt(String(lin["@_ang"] || "0"), 10);
@@ -2391,24 +2391,25 @@ function parseGradientFillCss(gradFill) {
2391
2391
  const path = gradFill["a:path"];
2392
2392
  if (path) {
2393
2393
  const pathType = String(path["@_path"] || "circle");
2394
- const fillToRect = path["a:fillToRect"];
2394
+ const fillToRectXml = path["a:fillToRect"];
2395
+ const fillToRect = fillToRectXml ? {
2396
+ l: Number.parseInt(String(fillToRectXml["@_l"] || "0"), 10) / 1e5,
2397
+ t: Number.parseInt(String(fillToRectXml["@_t"] || "0"), 10) / 1e5,
2398
+ r: Number.parseInt(String(fillToRectXml["@_r"] || "0"), 10) / 1e5,
2399
+ b: Number.parseInt(String(fillToRectXml["@_b"] || "0"), 10) / 1e5
2400
+ } : void 0;
2401
+ if (pathType === "rect") {
2402
+ return buildRectPathGradient(rawStops, void 0, fillToRect);
2403
+ }
2395
2404
  let cx = 50;
2396
2405
  let cy = 50;
2397
2406
  if (fillToRect) {
2398
- const l = Number.parseInt(String(fillToRect["@_l"] || "0"), 10) / 1e5;
2399
- const t = Number.parseInt(String(fillToRect["@_t"] || "0"), 10) / 1e5;
2400
- const r = Number.parseInt(String(fillToRect["@_r"] || "0"), 10) / 1e5;
2401
- const b = Number.parseInt(String(fillToRect["@_b"] || "0"), 10) / 1e5;
2407
+ const { l, t, r, b } = fillToRect;
2402
2408
  cx = (l + (1 - r)) / 2 * 100;
2403
2409
  cy = (t + (1 - b)) / 2 * 100;
2404
2410
  }
2405
2411
  const posX = `${Math.round(cx)}%`;
2406
2412
  const posY = `${Math.round(cy)}%`;
2407
- if (pathType === "rect") {
2408
- const semiX = Math.max(cx, 100 - cx);
2409
- const semiY = Math.max(cy, 100 - cy);
2410
- return `radial-gradient(${Math.round(semiX)}% ${Math.round(semiY)}% at ${posX} ${posY}, ${stopStrings})`;
2411
- }
2412
2413
  if (pathType === "shape") {
2413
2414
  return `radial-gradient(farthest-side at ${posX} ${posY}, ${stopStrings})`;
2414
2415
  }
Binary file
Binary file