pptx-react-viewer 2.7.1 → 2.9.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 +4 -0
- package/dist/{AiChatPanel-YAYQ5KUT.mjs → AiChatPanel-6W6ZBAGU.mjs} +4 -4
- package/dist/AiChatPanel-6W6ZBAGU.mjs.br +0 -0
- package/dist/AiChatPanel-6W6ZBAGU.mjs.gz +0 -0
- package/dist/{AiChatPanel-SRKOMEW6.js → AiChatPanel-MALC32TM.js} +23 -23
- package/dist/AiChatPanel-MALC32TM.js.br +0 -0
- package/dist/AiChatPanel-MALC32TM.js.gz +0 -0
- package/dist/{Model3DScene-HYMOPMAM.mjs → Model3DScene-57HZ4NVD.mjs} +1 -1
- package/dist/Model3DScene-57HZ4NVD.mjs.br +0 -0
- package/dist/Model3DScene-57HZ4NVD.mjs.gz +0 -0
- package/dist/{Model3DScene-ONKC5Z6A.js → Model3DScene-76R2YXSO.js} +2 -2
- package/dist/Model3DScene-76R2YXSO.js.br +0 -0
- package/dist/Model3DScene-76R2YXSO.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-YJFWGG5L.js → SurfaceChart3DScene-2QZZTBV4.js} +2 -2
- package/dist/SurfaceChart3DScene-2QZZTBV4.js.br +0 -0
- package/dist/SurfaceChart3DScene-2QZZTBV4.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-B3FK4Q2U.mjs → SurfaceChart3DScene-JGOQNHSU.mjs} +1 -1
- package/dist/SurfaceChart3DScene-JGOQNHSU.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-JGOQNHSU.mjs.gz +0 -0
- package/dist/{chunk-25VSL2BB.js → chunk-2JDWFMIK.js} +259 -17
- package/dist/chunk-2JDWFMIK.js.br +0 -0
- package/dist/chunk-2JDWFMIK.js.gz +0 -0
- package/dist/{chunk-GRW7HM6X.js → chunk-34BUZNKO.js} +370 -364
- package/dist/chunk-34BUZNKO.js.br +0 -0
- package/dist/chunk-34BUZNKO.js.gz +0 -0
- package/dist/{chunk-IDK6XECR.mjs → chunk-4FO4JMTN.mjs} +103 -172
- package/dist/chunk-4FO4JMTN.mjs.br +0 -0
- package/dist/chunk-4FO4JMTN.mjs.gz +0 -0
- package/dist/{chunk-N7EZIKF4.mjs → chunk-6OLS3EJW.mjs} +1 -1
- package/dist/chunk-6OLS3EJW.mjs.br +0 -0
- package/dist/chunk-6OLS3EJW.mjs.gz +0 -0
- package/dist/{chunk-BVK7K74O.js → chunk-6UXRNLHD.js} +5462 -3150
- package/dist/chunk-6UXRNLHD.js.br +0 -0
- package/dist/chunk-6UXRNLHD.js.gz +0 -0
- package/dist/{chunk-Z6HIZWIQ.mjs → chunk-CD434OFE.mjs} +259 -17
- package/dist/chunk-CD434OFE.mjs.br +0 -0
- package/dist/chunk-CD434OFE.mjs.gz +0 -0
- package/dist/{chunk-JEIMWRKF.js → chunk-D6SHCB4V.js} +414 -483
- package/dist/chunk-D6SHCB4V.js.br +0 -0
- package/dist/chunk-D6SHCB4V.js.gz +0 -0
- package/dist/{chunk-LYS44KMG.js → chunk-IKISUZKE.js} +2605 -816
- package/dist/chunk-IKISUZKE.js.br +0 -0
- package/dist/chunk-IKISUZKE.js.gz +0 -0
- package/dist/{chunk-HQGLKAIY.mjs → chunk-JPTO6P5K.mjs} +135 -130
- package/dist/chunk-JPTO6P5K.mjs.br +0 -0
- package/dist/chunk-JPTO6P5K.mjs.gz +0 -0
- package/dist/{chunk-HEAJOHLJ.mjs → chunk-L47Y62L6.mjs} +2539 -809
- package/dist/chunk-L47Y62L6.mjs.br +0 -0
- package/dist/chunk-L47Y62L6.mjs.gz +0 -0
- package/dist/{chunk-2UCJYJUS.mjs → chunk-NQLVK23T.mjs} +4120 -1808
- package/dist/chunk-NQLVK23T.mjs.br +0 -0
- package/dist/chunk-NQLVK23T.mjs.gz +0 -0
- package/dist/{chunk-JVE7BZ25.js → chunk-YEM2VOAP.js} +3 -3
- package/dist/chunk-YEM2VOAP.js.br +0 -0
- package/dist/chunk-YEM2VOAP.js.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 +34 -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 +44 -1
- 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-DMDZRawe.d.ts → useViewerBuildingBlocks-C59NY1qZ.d.ts} +15 -2
- package/dist/useViewerBuildingBlocks-C59NY1qZ.d.ts.map +1 -0
- package/dist/viewer/index.d.ts +21 -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-SRKOMEW6.js.br +0 -0
- package/dist/AiChatPanel-SRKOMEW6.js.gz +0 -0
- package/dist/AiChatPanel-YAYQ5KUT.mjs.br +0 -0
- package/dist/AiChatPanel-YAYQ5KUT.mjs.gz +0 -0
- package/dist/Model3DScene-HYMOPMAM.mjs.br +0 -0
- package/dist/Model3DScene-HYMOPMAM.mjs.gz +0 -0
- package/dist/Model3DScene-ONKC5Z6A.js.br +0 -0
- package/dist/Model3DScene-ONKC5Z6A.js.gz +0 -0
- package/dist/SurfaceChart3DScene-B3FK4Q2U.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-B3FK4Q2U.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-YJFWGG5L.js.br +0 -0
- package/dist/SurfaceChart3DScene-YJFWGG5L.js.gz +0 -0
- package/dist/chunk-25VSL2BB.js.br +0 -0
- package/dist/chunk-25VSL2BB.js.gz +0 -0
- package/dist/chunk-2UCJYJUS.mjs.br +0 -0
- package/dist/chunk-2UCJYJUS.mjs.gz +0 -0
- package/dist/chunk-BVK7K74O.js.br +0 -0
- package/dist/chunk-BVK7K74O.js.gz +0 -0
- package/dist/chunk-GRW7HM6X.js.br +0 -0
- package/dist/chunk-GRW7HM6X.js.gz +0 -0
- package/dist/chunk-HEAJOHLJ.mjs.br +0 -0
- package/dist/chunk-HEAJOHLJ.mjs.gz +0 -0
- package/dist/chunk-HQGLKAIY.mjs.br +0 -0
- package/dist/chunk-HQGLKAIY.mjs.gz +0 -0
- package/dist/chunk-IDK6XECR.mjs.br +0 -0
- package/dist/chunk-IDK6XECR.mjs.gz +0 -0
- package/dist/chunk-JEIMWRKF.js.br +0 -0
- package/dist/chunk-JEIMWRKF.js.gz +0 -0
- package/dist/chunk-JVE7BZ25.js.br +0 -0
- package/dist/chunk-JVE7BZ25.js.gz +0 -0
- package/dist/chunk-LYS44KMG.js.br +0 -0
- package/dist/chunk-LYS44KMG.js.gz +0 -0
- package/dist/chunk-N7EZIKF4.mjs.br +0 -0
- package/dist/chunk-N7EZIKF4.mjs.gz +0 -0
- package/dist/chunk-Z6HIZWIQ.mjs.br +0 -0
- package/dist/chunk-Z6HIZWIQ.mjs.gz +0 -0
- package/dist/useViewerBuildingBlocks-DMDZRawe.d.ts.map +0 -1
|
Binary file
|
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { translationsEn } from './chunk-
|
|
2
|
-
import { SHAPE_PRESET_DEFS, computeValueRangeForChart, getAnimationInitialStyle, cloneHistorySnapshot, hasShapeProperties, isTemplateElement, isImageLikeElement, clampCropValue, parseMediaCommand,
|
|
1
|
+
import { translationsEn } from './chunk-CD434OFE.mjs';
|
|
2
|
+
import { SHAPE_PRESET_DEFS, computeValueRangeForChart, VIEWER_SHORTCUT_REFERENCE, getAnimationInitialStyle, cloneHistorySnapshot, hasShapeProperties, isTemplateElement, isImageLikeElement, clampCropValue, parseMediaCommand, 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-L47Y62L6.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';
|
|
@@ -25,7 +25,6 @@ var DEFAULT_CANVAS_WIDTH = 1280;
|
|
|
25
25
|
var DEFAULT_CANVAS_HEIGHT = 720;
|
|
26
26
|
var MIN_ELEMENT_SIZE = 12;
|
|
27
27
|
var EMU_PER_PX = 9525;
|
|
28
|
-
var DEFAULT_BODY_INSET_LR_PX = 91440 / 9525;
|
|
29
28
|
var DEFAULT_BODY_INSET_TB_PX = 45720 / 9525;
|
|
30
29
|
var DEFAULT_TEXT_COLOR = "#111827";
|
|
31
30
|
var DEFAULT_FILL_COLOR = "#3b82f6";
|
|
@@ -38,8 +37,6 @@ var DEFAULT_TABLE_COLUMNS = 3;
|
|
|
38
37
|
var SHAPE_ADJUSTMENT_MIN = 0;
|
|
39
38
|
var SHAPE_ADJUSTMENT_MAX = 5e4;
|
|
40
39
|
var DEFAULT_ROUND_RECT_ADJUSTMENT = 16667;
|
|
41
|
-
var MIN_ZOOM_SCALE = 0.2;
|
|
42
|
-
var MAX_ZOOM_SCALE = 5;
|
|
43
40
|
var ZOOM_TO_SELECTION_PADDING = 96;
|
|
44
41
|
var GRID_SIZE = 8;
|
|
45
42
|
var SLIDE_NAV_THUMBNAIL_WIDTH = 156;
|
|
@@ -60,48 +57,25 @@ var TOOLBAR_SECTIONS = [
|
|
|
60
57
|
{ id: "view", labelKey: "pptx.ribbon.tab.view" },
|
|
61
58
|
{ id: "help", labelKey: "pptx.ribbon.tab.help" }
|
|
62
59
|
];
|
|
63
|
-
var SHORTCUT_REFERENCE_ITEMS =
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
60
|
+
var SHORTCUT_REFERENCE_ITEMS = VIEWER_SHORTCUT_REFERENCE;
|
|
61
|
+
|
|
62
|
+
// src/viewer/constants/theme.ts
|
|
63
|
+
var THEME_COLOR_SWATCHES = [
|
|
64
|
+
"#000000",
|
|
65
|
+
"#FFFFFF",
|
|
66
|
+
"#1F497D",
|
|
67
|
+
"#EEECE1",
|
|
68
|
+
"#4472C4",
|
|
69
|
+
"#ED7D31",
|
|
70
|
+
"#A5A5A5",
|
|
71
|
+
"#FFC000",
|
|
72
|
+
"#5B9BD5",
|
|
73
|
+
"#70AD47",
|
|
74
|
+
"#0563C1",
|
|
75
|
+
"#954F72"
|
|
76
76
|
];
|
|
77
77
|
|
|
78
78
|
// src/viewer/constants/transitions-animations.ts
|
|
79
|
-
var SLIDE_TRANSITION_OPTIONS = [
|
|
80
|
-
{ value: "none", label: "None", i18nKey: "pptx.transition.none" },
|
|
81
|
-
{ value: "cut", label: "Cut", i18nKey: "pptx.ribbon.transition.cut" },
|
|
82
|
-
{ value: "fade", label: "Fade", i18nKey: "pptx.ribbon.transition.fade" },
|
|
83
|
-
{ value: "push", label: "Push", i18nKey: "pptx.ribbon.transition.push" },
|
|
84
|
-
{ value: "wipe", label: "Wipe", i18nKey: "pptx.ribbon.transition.wipe" },
|
|
85
|
-
{ value: "split", label: "Split", i18nKey: "pptx.ribbon.transition.split" },
|
|
86
|
-
{ value: "randomBar", label: "Random Bars", i18nKey: "pptx.transitionPresets.randomBars" },
|
|
87
|
-
{ value: "blinds", label: "Blinds", i18nKey: "pptx.transitionPresets.blinds" },
|
|
88
|
-
{ value: "checker", label: "Checker", i18nKey: "pptx.transitionPresets.checker" },
|
|
89
|
-
{ value: "circle", label: "Circle", i18nKey: "pptx.transitionPresets.circle" },
|
|
90
|
-
{ value: "comb", label: "Comb", i18nKey: "pptx.transitionPresets.comb" },
|
|
91
|
-
{ value: "cover", label: "Cover", i18nKey: "pptx.ribbon.transition.cover" },
|
|
92
|
-
{ value: "diamond", label: "Diamond", i18nKey: "pptx.transitionPresets.diamond" },
|
|
93
|
-
{ value: "dissolve", label: "Dissolve", i18nKey: "pptx.transitionPresets.dissolve" },
|
|
94
|
-
{ value: "plus", label: "Plus", i18nKey: "pptx.transitionPresets.plus" },
|
|
95
|
-
{ value: "pull", label: "Pull", i18nKey: "pptx.transitionPresets.pull" },
|
|
96
|
-
{ value: "random", label: "Random", i18nKey: "pptx.transitionPresets.random" },
|
|
97
|
-
{ value: "strips", label: "Strips", i18nKey: "pptx.transitionPresets.strips" },
|
|
98
|
-
{ value: "uncover", label: "Uncover", i18nKey: "pptx.ribbon.transition.uncover" },
|
|
99
|
-
{ value: "wedge", label: "Wedge", i18nKey: "pptx.transitionPresets.wedge" },
|
|
100
|
-
{ value: "wheel", label: "Wheel", i18nKey: "pptx.transitionPresets.wheel" },
|
|
101
|
-
{ value: "zoom", label: "Zoom", i18nKey: "pptx.transitionPresets.zoom" },
|
|
102
|
-
{ value: "newsflash", label: "Newsflash", i18nKey: "pptx.transitionPresets.newsflash" },
|
|
103
|
-
{ value: "morph", label: "Morph", i18nKey: "pptx.transitionPresets.morph" }
|
|
104
|
-
];
|
|
105
79
|
var ANIMATION_PRESET_OPTIONS = [
|
|
106
80
|
{ value: "fadeIn", label: "Fade In", i18nKey: "pptx.animation.preset.fadeIn" },
|
|
107
81
|
{ value: "flyIn", label: "Fly In", i18nKey: "pptx.animation.preset.flyIn" },
|
|
@@ -138,6 +112,47 @@ var SHAPE_PRESETS = SHAPE_PRESET_DEFS.map(
|
|
|
138
112
|
})
|
|
139
113
|
);
|
|
140
114
|
|
|
115
|
+
// src/viewer/constants/connectors-strokes.ts
|
|
116
|
+
var CONNECTOR_ARROW_OPTIONS = [
|
|
117
|
+
{ value: "none", label: "None", i18nKey: "pptx.arrowhead.none" },
|
|
118
|
+
{ value: "triangle", label: "Triangle", i18nKey: "pptx.arrowhead.triangle" },
|
|
119
|
+
{ value: "stealth", label: "Stealth", i18nKey: "pptx.arrowhead.stealth" },
|
|
120
|
+
{ value: "diamond", label: "Diamond", i18nKey: "pptx.arrowhead.diamond" },
|
|
121
|
+
{ value: "oval", label: "Oval", i18nKey: "pptx.arrowhead.oval" },
|
|
122
|
+
{ value: "arrow", label: "Open Arrow", i18nKey: "pptx.arrowhead.openArrow" }
|
|
123
|
+
];
|
|
124
|
+
var ARROW_SIZE_OPTIONS = [
|
|
125
|
+
{ value: "sm", label: "Small", i18nKey: "pptx.connectorOptions.sizeSmall" },
|
|
126
|
+
{ value: "med", label: "Medium", i18nKey: "pptx.connectorOptions.sizeMedium" },
|
|
127
|
+
{ value: "lg", label: "Large", i18nKey: "pptx.connectorOptions.sizeLarge" }
|
|
128
|
+
];
|
|
129
|
+
var STROKE_DASH_OPTIONS = [
|
|
130
|
+
{ value: "solid", label: "Solid", i18nKey: "pptx.stroke.dashSolid" },
|
|
131
|
+
{ value: "dot", label: "Dot", i18nKey: "pptx.stroke.dashDot" },
|
|
132
|
+
{ value: "dash", label: "Dash", i18nKey: "pptx.stroke.dashDash" },
|
|
133
|
+
{ value: "dashDot", label: "Dash Dot", i18nKey: "pptx.stroke.dashDashDot" },
|
|
134
|
+
{ value: "lgDash", label: "Long Dash", i18nKey: "pptx.connectorOptions.dashLongDash" },
|
|
135
|
+
{ value: "lgDashDot", label: "Long Dash Dot", i18nKey: "pptx.connectorOptions.dashLongDashDot" },
|
|
136
|
+
{
|
|
137
|
+
value: "lgDashDotDot",
|
|
138
|
+
label: "Long Dash Dot Dot",
|
|
139
|
+
i18nKey: "pptx.connectorOptions.dashLongDashDotDot"
|
|
140
|
+
},
|
|
141
|
+
{ value: "sysDot", label: "System Dot", i18nKey: "pptx.stroke.dashSysDot" },
|
|
142
|
+
{ value: "sysDash", label: "System Dash", i18nKey: "pptx.stroke.dashSysDash" },
|
|
143
|
+
{
|
|
144
|
+
value: "sysDashDot",
|
|
145
|
+
label: "System Dash Dot",
|
|
146
|
+
i18nKey: "pptx.connectorOptions.dashSysDashDot"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
value: "sysDashDotDot",
|
|
150
|
+
label: "System Dash Dot Dot",
|
|
151
|
+
i18nKey: "pptx.connectorOptions.dashSysDashDotDot"
|
|
152
|
+
},
|
|
153
|
+
{ value: "custom", label: "Custom", i18nKey: "pptx.documentProperties.tabs.custom" }
|
|
154
|
+
];
|
|
155
|
+
|
|
141
156
|
// src/viewer/utils/shape-types.tsx
|
|
142
157
|
function getShapeType(shapeType) {
|
|
143
158
|
if (!shapeType) {
|
|
@@ -1165,76 +1180,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1165
1180
|
|
|
1166
1181
|
// src/viewer/utils/text-utils.tsx
|
|
1167
1182
|
function getTextStyleForElement(element, fallbackColor) {
|
|
1168
|
-
|
|
1169
|
-
return { color: fallbackColor };
|
|
1170
|
-
}
|
|
1171
|
-
const textDecorationTokens = [];
|
|
1172
|
-
if (element.textStyle?.underline || element.textStyle?.hyperlink) {
|
|
1173
|
-
textDecorationTokens.push("underline");
|
|
1174
|
-
}
|
|
1175
|
-
if (element.textStyle?.strikethrough) {
|
|
1176
|
-
textDecorationTokens.push("line-through");
|
|
1177
|
-
}
|
|
1178
|
-
const isDoubleStrike = element.textStyle?.strikethrough && element.textStyle?.strikeType === "dblStrike";
|
|
1179
|
-
const textDecorationStyle = isDoubleStrike ? "double" : void 0;
|
|
1180
|
-
const hasItalicRuns = element.textStyle?.italic || Boolean(element.textSegments?.some((segment) => segment.style?.italic));
|
|
1181
|
-
const isRtl = element.textStyle?.rtl === true;
|
|
1182
|
-
const resolvedTextColor = element.textStyle?.hyperlink ? normalizeHexColor(element.textStyle?.color, HYPERLINK_COLOR) : normalizeHexColor(element.textStyle?.color, fallbackColor);
|
|
1183
|
-
const bodyTop = element.textStyle?.bodyInsetTop ?? DEFAULT_BODY_INSET_TB_PX;
|
|
1184
|
-
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
1185
|
-
const bodyLeft = element.textStyle?.bodyInsetLeft ?? DEFAULT_BODY_INSET_LR_PX;
|
|
1186
|
-
const bodyRight = element.textStyle?.bodyInsetRight ?? DEFAULT_BODY_INSET_LR_PX;
|
|
1187
|
-
const hasParagraphIndents = (element.paragraphIndents?.length ?? 0) > 0;
|
|
1188
|
-
const bodyIndent = hasParagraphIndents ? 0 : element.textStyle?.paragraphIndent || 0;
|
|
1189
|
-
const bodyMarginLeft = hasParagraphIndents ? 0 : element.textStyle?.paragraphMarginLeft || 0;
|
|
1190
|
-
const bodyMarginRight = hasParagraphIndents ? 0 : element.textStyle?.paragraphMarginRight || 0;
|
|
1191
|
-
const writingMode = toCssWritingMode(element.textStyle?.textDirection);
|
|
1192
|
-
const textOrientation = toCssTextOrientation(element.textStyle?.textDirection);
|
|
1193
|
-
const verticalDirection = toCssVerticalDirection(element.textStyle?.textDirection);
|
|
1194
|
-
const resolvedDirection = verticalDirection || (isRtl ? "rtl" : "ltr");
|
|
1195
|
-
const resolvedUnicodeBidi = isRtl ? "plaintext" : void 0;
|
|
1196
|
-
const hasSegments = (element.textSegments?.length ?? 0) > 0;
|
|
1197
|
-
return {
|
|
1198
|
-
color: resolvedTextColor,
|
|
1199
|
-
backgroundColor: !hasSegments && element.textStyle?.highlightColor ? normalizeHexColor(element.textStyle.highlightColor, void 0) : void 0,
|
|
1200
|
-
textAlign: (() => {
|
|
1201
|
-
const a = element.textStyle?.align;
|
|
1202
|
-
if (a === "justLow" || a === "dist" || a === "thaiDist") {
|
|
1203
|
-
return "justify";
|
|
1204
|
-
}
|
|
1205
|
-
return a || (isRtl ? "right" : "left");
|
|
1206
|
-
})(),
|
|
1207
|
-
direction: resolvedDirection,
|
|
1208
|
-
unicodeBidi: resolvedUnicodeBidi,
|
|
1209
|
-
fontSize: element.textStyle?.fontSize || DEFAULT_TEXT_FONT_SIZE,
|
|
1210
|
-
fontWeight: element.textStyle?.bold ? 700 : 400,
|
|
1211
|
-
fontStyle: element.textStyle?.italic ? "italic" : "normal",
|
|
1212
|
-
textDecorationLine: textDecorationTokens.length > 0 ? textDecorationTokens.join(" ") : "none",
|
|
1213
|
-
textDecorationStyle,
|
|
1214
|
-
fontFamily: element.textStyle?.fontFamily || DEFAULT_FONT_FAMILY,
|
|
1215
|
-
lineHeight: resolveLineHeight(element.textStyle, hasItalicRuns),
|
|
1216
|
-
paddingTop: bodyTop + (hasItalicRuns ? 1 : 0),
|
|
1217
|
-
paddingBottom: bodyBottom + (hasItalicRuns ? 1 : 0),
|
|
1218
|
-
paddingLeft: bodyLeft + bodyMarginLeft,
|
|
1219
|
-
paddingRight: bodyRight + bodyMarginRight,
|
|
1220
|
-
textIndent: bodyIndent,
|
|
1221
|
-
overflow: "visible",
|
|
1222
|
-
writingMode,
|
|
1223
|
-
textOrientation,
|
|
1224
|
-
...element.textStyle?.textWrap === "none" ? { whiteSpace: "nowrap", overflow: "visible" } : {},
|
|
1225
|
-
// Auto-fit: use OOXML-provided fontScale/lnSpcReduction when available,
|
|
1226
|
-
// otherwise fall back to heuristic estimation. The pure font-scale maths
|
|
1227
|
-
// now lives in pptx-viewer-shared (computeAutoFitTextStyle).
|
|
1228
|
-
...computeAutoFitTextStyle({
|
|
1229
|
-
textStyle: element.textStyle,
|
|
1230
|
-
text: element.text ?? "",
|
|
1231
|
-
width: element.width,
|
|
1232
|
-
height: element.height,
|
|
1233
|
-
bodyInsetVertical: bodyTop + bodyBottom,
|
|
1234
|
-
hasItalicRuns,
|
|
1235
|
-
defaultFontSize: DEFAULT_TEXT_FONT_SIZE
|
|
1236
|
-
})
|
|
1237
|
-
};
|
|
1183
|
+
return buildTextBlockStyle(element, { fallbackColor });
|
|
1238
1184
|
}
|
|
1239
1185
|
|
|
1240
1186
|
// src/viewer/utils/text-layout.tsx
|
|
@@ -1891,7 +1837,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1891
1837
|
const letterSpacing = typeof segmentStyle.characterSpacing === "number" && segmentStyle.characterSpacing !== 0 ? `${segmentStyle.characterSpacing / 100 * (96 / 72)}px` : void 0;
|
|
1892
1838
|
const textFillStyles = buildTextFillCss2(segmentStyle);
|
|
1893
1839
|
const rawFontSize = segmentStyle.fontSize || element.textStyle?.fontSize || DEFAULT_TEXT_FONT_SIZE;
|
|
1894
|
-
const autoFitScale = element.textStyle
|
|
1840
|
+
const autoFitScale = resolveAutoFitFontScale(element.textStyle);
|
|
1895
1841
|
const baseFontSize = rawFontSize * autoFitScale;
|
|
1896
1842
|
const baselineShift = baselineFraction !== 0 ? `${baselineFraction * baseFontSize}px` : void 0;
|
|
1897
1843
|
const baseFontSizePt = baseFontSize * (72 / 96);
|
|
@@ -2443,6 +2389,19 @@ function getStrokeOnlyPresetPaths(element) {
|
|
|
2443
2389
|
}
|
|
2444
2390
|
|
|
2445
2391
|
// src/viewer/utils/shape-visual-style.ts
|
|
2392
|
+
function getGradientTilingCss(style) {
|
|
2393
|
+
if (!style || style.fillMode !== "gradient") {
|
|
2394
|
+
return void 0;
|
|
2395
|
+
}
|
|
2396
|
+
const isStructuredLinear = (style.fillGradientType || "linear") === "linear" && sanitizeGradientStops(style.fillGradientStops).length > 0;
|
|
2397
|
+
if (isStructuredLinear) {
|
|
2398
|
+
const flip = getGradientTileFlipCss(style.fillGradientFlip);
|
|
2399
|
+
if (flip) {
|
|
2400
|
+
return flip;
|
|
2401
|
+
}
|
|
2402
|
+
}
|
|
2403
|
+
return getGradientTileRectCss(style.fillGradientTileRect);
|
|
2404
|
+
}
|
|
2446
2405
|
function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2447
2406
|
if (!hasShapeProperties(element)) {
|
|
2448
2407
|
return {};
|
|
@@ -2454,12 +2413,18 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2454
2413
|
const fillOpacity = element.shapeStyle?.fillOpacity;
|
|
2455
2414
|
const strokeOpacity = element.shapeStyle?.strokeOpacity;
|
|
2456
2415
|
const strokeDash = normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2457
|
-
const fillGradient = buildCssGradientFromShapeStyle(element.shapeStyle
|
|
2416
|
+
const fillGradient = buildCssGradientFromShapeStyle(element.shapeStyle, {
|
|
2417
|
+
rotation: element.rotation,
|
|
2418
|
+
width: element.width,
|
|
2419
|
+
height: element.height
|
|
2420
|
+
}) || element.shapeStyle?.fillGradient;
|
|
2458
2421
|
const shadowCss = buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
2459
2422
|
const innerShadowCss = buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
2460
2423
|
const resolvedFillColor = colorWithOpacity(fillColor, fillOpacity);
|
|
2461
2424
|
const resolvedStrokeColor = colorWithOpacity(strokeColor, strokeOpacity);
|
|
2462
2425
|
const ss = element.shapeStyle;
|
|
2426
|
+
const gradientTiling = getGradientTilingCss(ss);
|
|
2427
|
+
const paintsGradientOutline = suppressesCssBorder(element);
|
|
2463
2428
|
const hasFillOverlayColor = Boolean(
|
|
2464
2429
|
ss?.dagFillOverlayColor && ss.dagFillOverlayColor !== "transparent"
|
|
2465
2430
|
);
|
|
@@ -2539,8 +2504,8 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2539
2504
|
// `getComputedFillStyle` (image -> gradient -> pattern -> solid).
|
|
2540
2505
|
backgroundColor: imageFillUrl ? "transparent" : patternFill ? patternFill.backgroundColor : hasFill && !fillGradient ? resolvedFillColor : "transparent",
|
|
2541
2506
|
backgroundImage: imageFillUrl ? `url(${imageFillUrl})` : patternFill ? patternFill.backgroundImage : hasFill && fillGradient ? fillGradient : void 0,
|
|
2542
|
-
backgroundRepeat: imageFillUrl ? imageFillMode === "tile" ? "repeat" : "no-repeat" : patternFill ? "repeat" : hasFill && fillGradient ? "no-repeat" : void 0,
|
|
2543
|
-
backgroundSize: imageFillUrl ? imageFillMode === "tile" ? "auto" : "100% 100%" : patternFill ? "auto" : hasFill && fillGradient ? "100% 100%" : void 0,
|
|
2507
|
+
backgroundRepeat: imageFillUrl ? imageFillMode === "tile" ? "repeat" : "no-repeat" : patternFill ? "repeat" : hasFill && fillGradient ? gradientTiling?.backgroundRepeat ?? "no-repeat" : void 0,
|
|
2508
|
+
backgroundSize: imageFillUrl ? imageFillMode === "tile" ? "auto" : "100% 100%" : patternFill ? "auto" : hasFill && fillGradient ? gradientTiling?.backgroundSize ?? "100% 100%" : void 0,
|
|
2544
2509
|
// The container always carries a 1px border (transparent unless the shape
|
|
2545
2510
|
// has a stroke or is hovered) and `box-sizing: border-box`, so the default
|
|
2546
2511
|
// `background-origin: padding-box` sizes the paint 2px smaller than the
|
|
@@ -2549,7 +2514,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2549
2514
|
// edge - a fade-to-transparent overlay grew a hard opaque line down its
|
|
2550
2515
|
// side. Paint from the border box so the fill matches the shape outline.
|
|
2551
2516
|
backgroundOrigin: "border-box",
|
|
2552
|
-
backgroundPosition: imageFillUrl ? "center" : void 0,
|
|
2517
|
+
backgroundPosition: imageFillUrl ? "center" : hasFill && fillGradient ? gradientTiling?.backgroundPosition : void 0,
|
|
2553
2518
|
boxShadow: combinedBoxShadow,
|
|
2554
2519
|
WebkitBoxReflect: reflectCss,
|
|
2555
2520
|
filter: filterParts.length > 0 ? filterParts.join(" ") : void 0,
|
|
@@ -2567,9 +2532,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2567
2532
|
// two adjacent 40px buttons rendered with a 2px gap PowerPoint does not
|
|
2568
2533
|
// draw. The affordance is an `outline` instead (see `ElementRenderer`),
|
|
2569
2534
|
// which paints in the same place without taking part in layout.
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2535
|
+
// A gradient outline is painted by `ShapeEffectOverlay` as a stroked SVG
|
|
2536
|
+
// path following the shape's geometry, because a CSS border can only take
|
|
2537
|
+
// one colour. Keeping the border too would draw the parser's averaged
|
|
2538
|
+
// solid underneath the gradient.
|
|
2539
|
+
borderWidth: strokeWidth > 0 && !paintsGradientOutline ? getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : 0,
|
|
2540
|
+
borderColor: strokeWidth > 0 && !paintsGradientOutline ? resolvedStrokeColor : void 0,
|
|
2541
|
+
borderStyle: strokeWidth > 0 && !paintsGradientOutline ? getCssBorderDashStyle(strokeDash, ss?.compoundLine) : void 0,
|
|
2573
2542
|
strokeLinejoin: lineJoinCss,
|
|
2574
2543
|
strokeMiterlimit: miterLimitCss,
|
|
2575
2544
|
strokeLinecap: ss?.lineCap === "rnd" ? "round" : ss?.lineCap === "sq" ? "square" : ss?.lineCap === "flat" ? "butt" : void 0
|
|
@@ -2807,21 +2776,49 @@ function strokeStrands(d, keyBase, ctx) {
|
|
|
2807
2776
|
`${keyBase}-s${idx}`
|
|
2808
2777
|
));
|
|
2809
2778
|
}
|
|
2810
|
-
function
|
|
2779
|
+
function gradientDefs(gradient) {
|
|
2780
|
+
if (!gradient) {
|
|
2781
|
+
return null;
|
|
2782
|
+
}
|
|
2783
|
+
const stops = gradient.stops.map((stop, idx) => /* @__PURE__ */ jsx(
|
|
2784
|
+
"stop",
|
|
2785
|
+
{
|
|
2786
|
+
offset: stop.offset,
|
|
2787
|
+
stopColor: stop.color,
|
|
2788
|
+
stopOpacity: typeof stop.opacity === "number" ? stop.opacity : void 0
|
|
2789
|
+
},
|
|
2790
|
+
idx
|
|
2791
|
+
));
|
|
2792
|
+
return /* @__PURE__ */ jsx("defs", { children: gradient.kind === "radial" ? /* @__PURE__ */ jsx("radialGradient", { id: gradient.id, cx: gradient.cx, cy: gradient.cy, r: gradient.r, children: stops }) : /* @__PURE__ */ jsx(
|
|
2793
|
+
"linearGradient",
|
|
2794
|
+
{
|
|
2795
|
+
id: gradient.id,
|
|
2796
|
+
x1: gradient.x1,
|
|
2797
|
+
y1: gradient.y1,
|
|
2798
|
+
x2: gradient.x2,
|
|
2799
|
+
y2: gradient.y2,
|
|
2800
|
+
children: stops
|
|
2801
|
+
}
|
|
2802
|
+
) });
|
|
2803
|
+
}
|
|
2804
|
+
function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredPaths, shapeStyle, hasFill, fillColor, fillOpacity, strokePaint, strokeWidth, dashArray, animatesFill = false, gradient) {
|
|
2811
2805
|
const ctx = strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray);
|
|
2812
2806
|
const subpaths = structuredPaths && structuredPaths.length > 0 ? customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
2813
2807
|
const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
|
|
2808
|
+
const gradientPaint = gradient ? svgGradientFillRef(gradient) : void 0;
|
|
2814
2809
|
const nodes = [];
|
|
2815
2810
|
if (subpaths && needsPerSubpath) {
|
|
2816
2811
|
const paints = buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity);
|
|
2817
2812
|
paints.forEach((paint, idx) => {
|
|
2818
2813
|
if (paint.fill !== "none") {
|
|
2814
|
+
const mode = subpaths[idx]?.fillMode;
|
|
2815
|
+
const useGradient = gradientPaint && (mode === void 0 || mode === "norm");
|
|
2819
2816
|
nodes.push(
|
|
2820
2817
|
/* @__PURE__ */ jsx(
|
|
2821
2818
|
"path",
|
|
2822
2819
|
{
|
|
2823
2820
|
d: paint.d,
|
|
2824
|
-
fill: animatesFill ? "inherit" : paint.fill,
|
|
2821
|
+
fill: animatesFill ? "inherit" : useGradient ? gradientPaint : paint.fill,
|
|
2825
2822
|
stroke: "none",
|
|
2826
2823
|
vectorEffect: "non-scaling-stroke"
|
|
2827
2824
|
},
|
|
@@ -2840,7 +2837,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2840
2837
|
"path",
|
|
2841
2838
|
{
|
|
2842
2839
|
d: pathData,
|
|
2843
|
-
fill: animatesFill ? "inherit" : colorWithOpacity(fillColor, fillOpacity),
|
|
2840
|
+
fill: animatesFill ? "inherit" : gradientPaint ?? colorWithOpacity(fillColor, fillOpacity),
|
|
2844
2841
|
stroke: "none",
|
|
2845
2842
|
vectorEffect: "non-scaling-stroke"
|
|
2846
2843
|
},
|
|
@@ -2852,13 +2849,16 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2852
2849
|
nodes.push(...strokeStrands(pathData, "agg", ctx));
|
|
2853
2850
|
}
|
|
2854
2851
|
}
|
|
2855
|
-
return /* @__PURE__ */
|
|
2852
|
+
return /* @__PURE__ */ jsxs(
|
|
2856
2853
|
"svg",
|
|
2857
2854
|
{
|
|
2858
2855
|
viewBox: `0 0 ${pathWidth} ${pathHeight}`,
|
|
2859
2856
|
className: "w-full h-full pointer-events-none",
|
|
2860
2857
|
preserveAspectRatio: "none",
|
|
2861
|
-
children:
|
|
2858
|
+
children: [
|
|
2859
|
+
animatesFill ? null : gradientDefs(gradient),
|
|
2860
|
+
nodes
|
|
2861
|
+
]
|
|
2862
2862
|
}
|
|
2863
2863
|
);
|
|
2864
2864
|
}
|
|
@@ -2965,7 +2965,12 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2965
2965
|
strokePaint,
|
|
2966
2966
|
strokeWidth,
|
|
2967
2967
|
dashArray,
|
|
2968
|
-
Boolean(animatesFill)
|
|
2968
|
+
Boolean(animatesFill),
|
|
2969
|
+
// A freeform's `a:gradFill` needs a real SVG paint server: the
|
|
2970
|
+
// container's `background-image` is suppressed for custom geometry, so
|
|
2971
|
+
// without this the shape fell back to the parser's representative solid
|
|
2972
|
+
// and lost every fade (issue #132).
|
|
2973
|
+
buildSvgGradientDef(element.shapeStyle, element.id)
|
|
2969
2974
|
);
|
|
2970
2975
|
}
|
|
2971
2976
|
if (isCalloutShape(normalizedType)) {
|
|
@@ -6287,7 +6292,7 @@ function FailedToLoad() {
|
|
|
6287
6292
|
var LazySurfaceChart3DScene = React6.lazy(
|
|
6288
6293
|
async () => {
|
|
6289
6294
|
try {
|
|
6290
|
-
return await import('./SurfaceChart3DScene-
|
|
6295
|
+
return await import('./SurfaceChart3DScene-JGOQNHSU.mjs');
|
|
6291
6296
|
} catch {
|
|
6292
6297
|
return { default: FailedToLoad };
|
|
6293
6298
|
}
|
|
@@ -8063,4 +8068,4 @@ function stopPreviewAnimation() {
|
|
|
8063
8068
|
activePreview = null;
|
|
8064
8069
|
}
|
|
8065
8070
|
|
|
8066
|
-
export { ANIMATION_PRESET_OPTIONS, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, DEFAULT_FILL_COLOR, DEFAULT_FONT_FAMILY, DEFAULT_STROKE_COLOR, DEFAULT_TABLE_COLUMNS, DEFAULT_TABLE_ROWS, DEFAULT_TEXT_COLOR, DEFAULT_TEXT_FONT_SIZE, EMU_PER_PX, GRID_SIZE, HYPERLINK_COLOR,
|
|
8071
|
+
export { ANIMATION_PRESET_OPTIONS, ARROW_SIZE_OPTIONS, CONNECTOR_ARROW_OPTIONS, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, DEFAULT_FILL_COLOR, DEFAULT_FONT_FAMILY, DEFAULT_STROKE_COLOR, DEFAULT_TABLE_COLUMNS, DEFAULT_TABLE_ROWS, DEFAULT_TEXT_COLOR, DEFAULT_TEXT_FONT_SIZE, EMU_PER_PX, GRID_SIZE, HYPERLINK_COLOR, MIN_ELEMENT_SIZE, SHAPE_PRESETS, SHORTCUT_REFERENCE_ITEMS, SLIDE_NAV_THUMBNAIL_WIDTH, STROKE_DASH_OPTIONS, SmartArtNodeText, THEME_COLOR_SWATCHES, TOOLBAR_SECTIONS, UNGROUPED_SECTION_ID, ZOOM_TO_SELECTION_PADDING, build3DExtrusionData2 as build3DExtrusionData, buildLineGlowFilter, buildLineShadowCss, buildNotesPdf, buildPdfFromImageData, buildReactChartViewModel, buildSaveSlides, buildTextBody3DSceneStyle2 as buildTextBody3DSceneStyle, buildTree, chevronPoints, cloneHistorySnapshot2 as cloneHistorySnapshot, cn, colour, executeMediaCommand, fitFontSize, gearPath, getAnimationInitialStyle2 as getAnimationInitialStyle, getConnectorPathGeometry, getCropShapeClipPath, getDuotoneColors, getImageRenderStyle, getImageTilingStyle, getShapeVisualStyle, getTextLayoutStyle, getTextStyleForElement, getTextWarpStyle, hasDagDuotoneEffect, isConnectorOrLineElement, isImageTiled, layoutToCategory, nodeOpacity, partitionTemplateElements, renderAccentProcess, renderAlternatingFlow, renderChartElement, renderConnectorMarker, renderDagDuotoneSvgFilter, renderDescendingProcess, renderGroupedList, renderHorizontalPictureList, renderMediaElement, renderPictureAccentList, renderPyramidList, renderStepDownProcess, renderTableElement, renderTextSegments, renderVectorShape, renderVerticalBlockList, renderVerticalChevronList, resolvePalette, resolveSmartArtDataPalette, resolveStyle, shouldRenderFallbackLabel, smartArtNodeGroupProps, startPreviewAnimation, stopAllPersistentAudio, stopPreviewAnimation, styleShadow, styleStroke, treeDepth, treeWidth, truncate, wrapChrome };
|
|
Binary file
|
|
Binary file
|