pptx-react-viewer 2.8.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 +4 -0
- package/dist/{AiChatPanel-UXPHPUQV.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-GTCK35EI.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-HDUHTKPF.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-USPBP3KE.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-7SLM73XC.mjs → SurfaceChart3DScene-GKRDDN2U.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-7SLM73XC.mjs.br → SurfaceChart3DScene-GKRDDN2U.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-GKRDDN2U.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-NZ3K5CC6.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-KGXDCDA5.js → chunk-A7HLINZU.js} +414 -472
- package/dist/chunk-A7HLINZU.js.br +0 -0
- package/dist/chunk-A7HLINZU.js.gz +0 -0
- package/dist/{chunk-AHPZGUL7.mjs → chunk-FY2AFXKP.mjs} +140 -174
- package/dist/chunk-FY2AFXKP.mjs.br +0 -0
- package/dist/chunk-FY2AFXKP.mjs.gz +0 -0
- package/dist/{chunk-MZJMOEEX.js → chunk-H74UXL4Q.js} +2914 -832
- package/dist/chunk-H74UXL4Q.js.br +0 -0
- package/dist/chunk-H74UXL4Q.js.gz +0 -0
- package/dist/{chunk-SMW4QYGK.js → chunk-IJVDNQLG.js} +374 -407
- package/dist/chunk-IJVDNQLG.js.br +0 -0
- package/dist/chunk-IJVDNQLG.js.gz +0 -0
- package/dist/{chunk-SOBKYMMR.js → chunk-JWMXOYSX.js} +5739 -3092
- package/dist/chunk-JWMXOYSX.js.br +0 -0
- package/dist/chunk-JWMXOYSX.js.gz +0 -0
- package/dist/{chunk-TJ5QMUUJ.mjs → chunk-LCG7WBAG.mjs} +4245 -1598
- package/dist/chunk-LCG7WBAG.mjs.br +0 -0
- package/dist/chunk-LCG7WBAG.mjs.gz +0 -0
- package/dist/{chunk-PVCUYPU7.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-25VSL2BB.js → chunk-MMK4K3QI.js} +260 -17
- package/dist/chunk-MMK4K3QI.js.br +0 -0
- package/dist/chunk-MMK4K3QI.js.gz +0 -0
- package/dist/{chunk-OIH753PJ.mjs → chunk-OHPF2HTP.mjs} +102 -160
- package/dist/chunk-OHPF2HTP.mjs.br +0 -0
- package/dist/chunk-OHPF2HTP.mjs.gz +0 -0
- package/dist/{chunk-Z6HIZWIQ.mjs → chunk-SL3XPERE.mjs} +260 -17
- package/dist/chunk-SL3XPERE.mjs.br +0 -0
- package/dist/chunk-SL3XPERE.mjs.gz +0 -0
- package/dist/{chunk-VFLBLJ4G.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-VH2QF5CT.mjs → chunk-TJ55KUWH.mjs} +2829 -824
- package/dist/chunk-TJ55KUWH.mjs.br +0 -0
- package/dist/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 +36 -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 +48 -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-CpUwhBD5.d.ts} +17 -2
- package/dist/useViewerBuildingBlocks-CpUwhBD5.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-GTCK35EI.js.br +0 -0
- package/dist/AiChatPanel-GTCK35EI.js.gz +0 -0
- package/dist/AiChatPanel-UXPHPUQV.mjs.br +0 -0
- package/dist/AiChatPanel-UXPHPUQV.mjs.gz +0 -0
- package/dist/Model3DScene-HDUHTKPF.mjs.br +0 -0
- package/dist/Model3DScene-HDUHTKPF.mjs.gz +0 -0
- package/dist/Model3DScene-USPBP3KE.js.br +0 -0
- package/dist/Model3DScene-USPBP3KE.js.gz +0 -0
- package/dist/SurfaceChart3DScene-7SLM73XC.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-NZ3K5CC6.js.br +0 -0
- package/dist/SurfaceChart3DScene-NZ3K5CC6.js.gz +0 -0
- package/dist/chunk-25VSL2BB.js.br +0 -0
- package/dist/chunk-25VSL2BB.js.gz +0 -0
- package/dist/chunk-AHPZGUL7.mjs.br +0 -0
- package/dist/chunk-AHPZGUL7.mjs.gz +0 -0
- package/dist/chunk-KGXDCDA5.js.br +0 -0
- package/dist/chunk-KGXDCDA5.js.gz +0 -0
- package/dist/chunk-MZJMOEEX.js.br +0 -0
- package/dist/chunk-MZJMOEEX.js.gz +0 -0
- package/dist/chunk-OIH753PJ.mjs.br +0 -0
- package/dist/chunk-OIH753PJ.mjs.gz +0 -0
- package/dist/chunk-PVCUYPU7.mjs.br +0 -0
- package/dist/chunk-PVCUYPU7.mjs.gz +0 -0
- package/dist/chunk-SMW4QYGK.js.br +0 -0
- package/dist/chunk-SMW4QYGK.js.gz +0 -0
- package/dist/chunk-SOBKYMMR.js.br +0 -0
- package/dist/chunk-SOBKYMMR.js.gz +0 -0
- package/dist/chunk-TJ5QMUUJ.mjs.br +0 -0
- package/dist/chunk-TJ5QMUUJ.mjs.gz +0 -0
- package/dist/chunk-VFLBLJ4G.js.br +0 -0
- package/dist/chunk-VFLBLJ4G.js.gz +0 -0
- package/dist/chunk-VH2QF5CT.mjs.br +0 -0
- package/dist/chunk-VH2QF5CT.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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkMMK4K3QI_js = require('./chunk-MMK4K3QI.js');
|
|
4
|
+
var chunkH74UXL4Q_js = require('./chunk-H74UXL4Q.js');
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var tailwindMerge = require('tailwind-merge');
|
|
7
7
|
var React6 = require('react');
|
|
@@ -15,7 +15,7 @@ var React6__default = /*#__PURE__*/_interopDefault(React6);
|
|
|
15
15
|
|
|
16
16
|
// src/viewer/utils/animation-effects.ts
|
|
17
17
|
function getAnimationInitialStyle2(preset, nativeAnimation) {
|
|
18
|
-
return
|
|
18
|
+
return chunkH74UXL4Q_js.getAnimationInitialStyle(preset, nativeAnimation);
|
|
19
19
|
}
|
|
20
20
|
function cn(...inputs) {
|
|
21
21
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
@@ -23,7 +23,7 @@ function cn(...inputs) {
|
|
|
23
23
|
|
|
24
24
|
// src/viewer/utils/clone.ts
|
|
25
25
|
function cloneHistorySnapshot2(snapshot) {
|
|
26
|
-
return
|
|
26
|
+
return chunkH74UXL4Q_js.cloneHistorySnapshot(snapshot);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
// src/viewer/constants/scalar.ts
|
|
@@ -31,7 +31,6 @@ var DEFAULT_CANVAS_WIDTH = 1280;
|
|
|
31
31
|
var DEFAULT_CANVAS_HEIGHT = 720;
|
|
32
32
|
var MIN_ELEMENT_SIZE = 12;
|
|
33
33
|
var EMU_PER_PX = 9525;
|
|
34
|
-
var DEFAULT_BODY_INSET_LR_PX = 91440 / 9525;
|
|
35
34
|
var DEFAULT_BODY_INSET_TB_PX = 45720 / 9525;
|
|
36
35
|
var DEFAULT_TEXT_COLOR = "#111827";
|
|
37
36
|
var DEFAULT_FILL_COLOR = "#3b82f6";
|
|
@@ -44,8 +43,6 @@ var DEFAULT_TABLE_COLUMNS = 3;
|
|
|
44
43
|
var SHAPE_ADJUSTMENT_MIN = 0;
|
|
45
44
|
var SHAPE_ADJUSTMENT_MAX = 5e4;
|
|
46
45
|
var DEFAULT_ROUND_RECT_ADJUSTMENT = 16667;
|
|
47
|
-
var MIN_ZOOM_SCALE = 0.2;
|
|
48
|
-
var MAX_ZOOM_SCALE = 5;
|
|
49
46
|
var ZOOM_TO_SELECTION_PADDING = 96;
|
|
50
47
|
var GRID_SIZE = 8;
|
|
51
48
|
var SLIDE_NAV_THUMBNAIL_WIDTH = 156;
|
|
@@ -66,48 +63,25 @@ var TOOLBAR_SECTIONS = [
|
|
|
66
63
|
{ id: "view", labelKey: "pptx.ribbon.tab.view" },
|
|
67
64
|
{ id: "help", labelKey: "pptx.ribbon.tab.help" }
|
|
68
65
|
];
|
|
69
|
-
var SHORTCUT_REFERENCE_ITEMS =
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
66
|
+
var SHORTCUT_REFERENCE_ITEMS = chunkH74UXL4Q_js.VIEWER_SHORTCUT_REFERENCE;
|
|
67
|
+
|
|
68
|
+
// src/viewer/constants/theme.ts
|
|
69
|
+
var THEME_COLOR_SWATCHES = [
|
|
70
|
+
"#000000",
|
|
71
|
+
"#FFFFFF",
|
|
72
|
+
"#1F497D",
|
|
73
|
+
"#EEECE1",
|
|
74
|
+
"#4472C4",
|
|
75
|
+
"#ED7D31",
|
|
76
|
+
"#A5A5A5",
|
|
77
|
+
"#FFC000",
|
|
78
|
+
"#5B9BD5",
|
|
79
|
+
"#70AD47",
|
|
80
|
+
"#0563C1",
|
|
81
|
+
"#954F72"
|
|
82
82
|
];
|
|
83
83
|
|
|
84
84
|
// src/viewer/constants/transitions-animations.ts
|
|
85
|
-
var SLIDE_TRANSITION_OPTIONS = [
|
|
86
|
-
{ value: "none", label: "None", i18nKey: "pptx.transition.none" },
|
|
87
|
-
{ value: "cut", label: "Cut", i18nKey: "pptx.ribbon.transition.cut" },
|
|
88
|
-
{ value: "fade", label: "Fade", i18nKey: "pptx.ribbon.transition.fade" },
|
|
89
|
-
{ value: "push", label: "Push", i18nKey: "pptx.ribbon.transition.push" },
|
|
90
|
-
{ value: "wipe", label: "Wipe", i18nKey: "pptx.ribbon.transition.wipe" },
|
|
91
|
-
{ value: "split", label: "Split", i18nKey: "pptx.ribbon.transition.split" },
|
|
92
|
-
{ value: "randomBar", label: "Random Bars", i18nKey: "pptx.transitionPresets.randomBars" },
|
|
93
|
-
{ value: "blinds", label: "Blinds", i18nKey: "pptx.transitionPresets.blinds" },
|
|
94
|
-
{ value: "checker", label: "Checker", i18nKey: "pptx.transitionPresets.checker" },
|
|
95
|
-
{ value: "circle", label: "Circle", i18nKey: "pptx.transitionPresets.circle" },
|
|
96
|
-
{ value: "comb", label: "Comb", i18nKey: "pptx.transitionPresets.comb" },
|
|
97
|
-
{ value: "cover", label: "Cover", i18nKey: "pptx.ribbon.transition.cover" },
|
|
98
|
-
{ value: "diamond", label: "Diamond", i18nKey: "pptx.transitionPresets.diamond" },
|
|
99
|
-
{ value: "dissolve", label: "Dissolve", i18nKey: "pptx.transitionPresets.dissolve" },
|
|
100
|
-
{ value: "plus", label: "Plus", i18nKey: "pptx.transitionPresets.plus" },
|
|
101
|
-
{ value: "pull", label: "Pull", i18nKey: "pptx.transitionPresets.pull" },
|
|
102
|
-
{ value: "random", label: "Random", i18nKey: "pptx.transitionPresets.random" },
|
|
103
|
-
{ value: "strips", label: "Strips", i18nKey: "pptx.transitionPresets.strips" },
|
|
104
|
-
{ value: "uncover", label: "Uncover", i18nKey: "pptx.ribbon.transition.uncover" },
|
|
105
|
-
{ value: "wedge", label: "Wedge", i18nKey: "pptx.transitionPresets.wedge" },
|
|
106
|
-
{ value: "wheel", label: "Wheel", i18nKey: "pptx.transitionPresets.wheel" },
|
|
107
|
-
{ value: "zoom", label: "Zoom", i18nKey: "pptx.transitionPresets.zoom" },
|
|
108
|
-
{ value: "newsflash", label: "Newsflash", i18nKey: "pptx.transitionPresets.newsflash" },
|
|
109
|
-
{ value: "morph", label: "Morph", i18nKey: "pptx.transitionPresets.morph" }
|
|
110
|
-
];
|
|
111
85
|
var ANIMATION_PRESET_OPTIONS = [
|
|
112
86
|
{ value: "fadeIn", label: "Fade In", i18nKey: "pptx.animation.preset.fadeIn" },
|
|
113
87
|
{ value: "flyIn", label: "Fly In", i18nKey: "pptx.animation.preset.flyIn" },
|
|
@@ -133,7 +107,7 @@ var GLYPH_COMPONENTS = {
|
|
|
133
107
|
plus: lu.LuPlus,
|
|
134
108
|
triangle: lu.LuTriangle
|
|
135
109
|
};
|
|
136
|
-
var SHAPE_PRESETS =
|
|
110
|
+
var SHAPE_PRESETS = chunkH74UXL4Q_js.SHAPE_PRESET_DEFS.map(
|
|
137
111
|
(def) => ({
|
|
138
112
|
type: def.type,
|
|
139
113
|
label: def.label,
|
|
@@ -144,6 +118,47 @@ var SHAPE_PRESETS = chunkMZJMOEEX_js.SHAPE_PRESET_DEFS.map(
|
|
|
144
118
|
})
|
|
145
119
|
);
|
|
146
120
|
|
|
121
|
+
// src/viewer/constants/connectors-strokes.ts
|
|
122
|
+
var CONNECTOR_ARROW_OPTIONS = [
|
|
123
|
+
{ value: "none", label: "None", i18nKey: "pptx.arrowhead.none" },
|
|
124
|
+
{ value: "triangle", label: "Triangle", i18nKey: "pptx.arrowhead.triangle" },
|
|
125
|
+
{ value: "stealth", label: "Stealth", i18nKey: "pptx.arrowhead.stealth" },
|
|
126
|
+
{ value: "diamond", label: "Diamond", i18nKey: "pptx.arrowhead.diamond" },
|
|
127
|
+
{ value: "oval", label: "Oval", i18nKey: "pptx.arrowhead.oval" },
|
|
128
|
+
{ value: "arrow", label: "Open Arrow", i18nKey: "pptx.arrowhead.openArrow" }
|
|
129
|
+
];
|
|
130
|
+
var ARROW_SIZE_OPTIONS = [
|
|
131
|
+
{ value: "sm", label: "Small", i18nKey: "pptx.connectorOptions.sizeSmall" },
|
|
132
|
+
{ value: "med", label: "Medium", i18nKey: "pptx.connectorOptions.sizeMedium" },
|
|
133
|
+
{ value: "lg", label: "Large", i18nKey: "pptx.connectorOptions.sizeLarge" }
|
|
134
|
+
];
|
|
135
|
+
var STROKE_DASH_OPTIONS = [
|
|
136
|
+
{ value: "solid", label: "Solid", i18nKey: "pptx.stroke.dashSolid" },
|
|
137
|
+
{ value: "dot", label: "Dot", i18nKey: "pptx.stroke.dashDot" },
|
|
138
|
+
{ value: "dash", label: "Dash", i18nKey: "pptx.stroke.dashDash" },
|
|
139
|
+
{ value: "dashDot", label: "Dash Dot", i18nKey: "pptx.stroke.dashDashDot" },
|
|
140
|
+
{ value: "lgDash", label: "Long Dash", i18nKey: "pptx.connectorOptions.dashLongDash" },
|
|
141
|
+
{ value: "lgDashDot", label: "Long Dash Dot", i18nKey: "pptx.connectorOptions.dashLongDashDot" },
|
|
142
|
+
{
|
|
143
|
+
value: "lgDashDotDot",
|
|
144
|
+
label: "Long Dash Dot Dot",
|
|
145
|
+
i18nKey: "pptx.connectorOptions.dashLongDashDotDot"
|
|
146
|
+
},
|
|
147
|
+
{ value: "sysDot", label: "System Dot", i18nKey: "pptx.stroke.dashSysDot" },
|
|
148
|
+
{ value: "sysDash", label: "System Dash", i18nKey: "pptx.stroke.dashSysDash" },
|
|
149
|
+
{
|
|
150
|
+
value: "sysDashDot",
|
|
151
|
+
label: "System Dash Dot",
|
|
152
|
+
i18nKey: "pptx.connectorOptions.dashSysDashDot"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
value: "sysDashDotDot",
|
|
156
|
+
label: "System Dash Dot Dot",
|
|
157
|
+
i18nKey: "pptx.connectorOptions.dashSysDashDotDot"
|
|
158
|
+
},
|
|
159
|
+
{ value: "custom", label: "Custom", i18nKey: "pptx.documentProperties.tabs.custom" }
|
|
160
|
+
];
|
|
161
|
+
|
|
147
162
|
// src/viewer/utils/shape-types.tsx
|
|
148
163
|
function getShapeType(shapeType) {
|
|
149
164
|
if (!shapeType) {
|
|
@@ -251,7 +266,7 @@ function isConnectorOrLineElement(element) {
|
|
|
251
266
|
if (element.type === "connector") {
|
|
252
267
|
return true;
|
|
253
268
|
}
|
|
254
|
-
if (!
|
|
269
|
+
if (!chunkH74UXL4Q_js.hasShapeProperties(element)) {
|
|
255
270
|
return false;
|
|
256
271
|
}
|
|
257
272
|
const st = getShapeType(element.shapeType);
|
|
@@ -262,12 +277,12 @@ function isConnectorOrLineElement(element) {
|
|
|
262
277
|
function partitionTemplateElements(slides) {
|
|
263
278
|
const templateElementsBySlideId = {};
|
|
264
279
|
const nextSlides = slides.map((slide) => {
|
|
265
|
-
const template = slide.elements.filter((el) =>
|
|
280
|
+
const template = slide.elements.filter((el) => chunkH74UXL4Q_js.isTemplateElement(el));
|
|
266
281
|
if (template.length === 0) {
|
|
267
282
|
return slide;
|
|
268
283
|
}
|
|
269
284
|
templateElementsBySlideId[slide.id] = template;
|
|
270
|
-
return { ...slide, elements: slide.elements.filter((el) => !
|
|
285
|
+
return { ...slide, elements: slide.elements.filter((el) => !chunkH74UXL4Q_js.isTemplateElement(el)) };
|
|
271
286
|
});
|
|
272
287
|
return { slides: nextSlides, templateElementsBySlideId };
|
|
273
288
|
}
|
|
@@ -283,7 +298,7 @@ function buildSaveSlides(slides, templateElementsBySlideId) {
|
|
|
283
298
|
|
|
284
299
|
// src/viewer/utils/image-style.ts
|
|
285
300
|
function getImageMaskStyle(element) {
|
|
286
|
-
if (!
|
|
301
|
+
if (!chunkH74UXL4Q_js.hasShapeProperties(element)) {
|
|
287
302
|
return void 0;
|
|
288
303
|
}
|
|
289
304
|
const shapeType = element.shapeType;
|
|
@@ -292,7 +307,7 @@ function getImageMaskStyle(element) {
|
|
|
292
307
|
}
|
|
293
308
|
const normalized = shapeType.toLowerCase();
|
|
294
309
|
if (normalized === "roundrect" || normalized === "round1rect" || normalized === "round2samerect" || normalized === "round2diagrect" || normalized === "sniproundrect" || normalized === "snip1rect" || normalized === "snip2diagrect") {
|
|
295
|
-
const radiusPx =
|
|
310
|
+
const radiusPx = chunkH74UXL4Q_js.getRoundRectRadiusPx(element);
|
|
296
311
|
if (radiusPx <= 0.01) {
|
|
297
312
|
return void 0;
|
|
298
313
|
}
|
|
@@ -304,7 +319,7 @@ function getImageMaskStyle(element) {
|
|
|
304
319
|
if (normalized === "can" || normalized === "cylinder") {
|
|
305
320
|
return { borderRadius: "48% / 12%" };
|
|
306
321
|
}
|
|
307
|
-
const clipPath =
|
|
322
|
+
const clipPath = chunkH74UXL4Q_js.getResolvedShapeClipPath(element);
|
|
308
323
|
if (!clipPath) {
|
|
309
324
|
return void 0;
|
|
310
325
|
}
|
|
@@ -312,7 +327,7 @@ function getImageMaskStyle(element) {
|
|
|
312
327
|
}
|
|
313
328
|
function getImageRenderStyle(element) {
|
|
314
329
|
const maskStyle = getImageMaskStyle(element) || {};
|
|
315
|
-
if (!
|
|
330
|
+
if (!chunkH74UXL4Q_js.isImageLikeElement(element)) {
|
|
316
331
|
return {
|
|
317
332
|
...maskStyle,
|
|
318
333
|
width: "100%",
|
|
@@ -320,10 +335,10 @@ function getImageRenderStyle(element) {
|
|
|
320
335
|
objectFit: "cover"
|
|
321
336
|
};
|
|
322
337
|
}
|
|
323
|
-
const cropLeft =
|
|
324
|
-
const cropTop =
|
|
325
|
-
const cropRight =
|
|
326
|
-
const cropBottom =
|
|
338
|
+
const cropLeft = chunkH74UXL4Q_js.clampCropValue(element.cropLeft);
|
|
339
|
+
const cropTop = chunkH74UXL4Q_js.clampCropValue(element.cropTop);
|
|
340
|
+
const cropRight = chunkH74UXL4Q_js.clampCropValue(element.cropRight);
|
|
341
|
+
const cropBottom = chunkH74UXL4Q_js.clampCropValue(element.cropBottom);
|
|
327
342
|
const hasCrop = cropLeft + cropRight > 1e-4 || cropTop + cropBottom > 1e-4;
|
|
328
343
|
if (!hasCrop) {
|
|
329
344
|
return {
|
|
@@ -335,10 +350,10 @@ function getImageRenderStyle(element) {
|
|
|
335
350
|
}
|
|
336
351
|
const safeHorizontalScale = cropLeft + cropRight >= 0.99 ? 0.99 / (cropLeft + cropRight) : 1;
|
|
337
352
|
const safeVerticalScale = cropTop + cropBottom >= 0.99 ? 0.99 / (cropTop + cropBottom) : 1;
|
|
338
|
-
const normalizedLeft =
|
|
339
|
-
const normalizedRight =
|
|
340
|
-
const normalizedTop =
|
|
341
|
-
const normalizedBottom =
|
|
353
|
+
const normalizedLeft = chunkH74UXL4Q_js.clampCropValue(cropLeft * safeHorizontalScale);
|
|
354
|
+
const normalizedRight = chunkH74UXL4Q_js.clampCropValue(cropRight * safeHorizontalScale);
|
|
355
|
+
const normalizedTop = chunkH74UXL4Q_js.clampCropValue(cropTop * safeVerticalScale);
|
|
356
|
+
const normalizedBottom = chunkH74UXL4Q_js.clampCropValue(cropBottom * safeVerticalScale);
|
|
342
357
|
const remainingWidth = Math.max(0.01, 1 - normalizedLeft - normalizedRight);
|
|
343
358
|
const remainingHeight = Math.max(0.01, 1 - normalizedTop - normalizedBottom);
|
|
344
359
|
const tx = Math.round(-normalizedLeft / remainingWidth * 1e4) / 100;
|
|
@@ -367,7 +382,7 @@ var CROP_SHAPE_CLIP_PATHS = {
|
|
|
367
382
|
star: "polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)"
|
|
368
383
|
};
|
|
369
384
|
function getCropShapeClipPath(element) {
|
|
370
|
-
if (!
|
|
385
|
+
if (!chunkH74UXL4Q_js.isImageLikeElement(element)) {
|
|
371
386
|
return void 0;
|
|
372
387
|
}
|
|
373
388
|
const shape = element.cropShape;
|
|
@@ -377,7 +392,7 @@ function getCropShapeClipPath(element) {
|
|
|
377
392
|
return CROP_SHAPE_CLIP_PATHS[shape];
|
|
378
393
|
}
|
|
379
394
|
function isImageTiled(element) {
|
|
380
|
-
if (!
|
|
395
|
+
if (!chunkH74UXL4Q_js.isImageLikeElement(element)) {
|
|
381
396
|
return false;
|
|
382
397
|
}
|
|
383
398
|
return typeof element.tileScaleX === "number" || typeof element.tileScaleY === "number";
|
|
@@ -435,7 +450,7 @@ function buildMirrorTiledBackground(src, flip, scaleX, scaleY) {
|
|
|
435
450
|
};
|
|
436
451
|
}
|
|
437
452
|
function getImageTilingStyle(element) {
|
|
438
|
-
if (!
|
|
453
|
+
if (!chunkH74UXL4Q_js.isImageLikeElement(element) || !isImageTiled(element)) {
|
|
439
454
|
return void 0;
|
|
440
455
|
}
|
|
441
456
|
const scaleX = typeof element.tileScaleX === "number" ? element.tileScaleX * 100 : 100;
|
|
@@ -714,50 +729,11 @@ function registerMediaElement(elementId, el) {
|
|
|
714
729
|
}
|
|
715
730
|
};
|
|
716
731
|
}
|
|
717
|
-
function executeMediaCommand(command) {
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
const parsed = chunkMZJMOEEX_js.parseMediaCommand(command.command);
|
|
723
|
-
if (!parsed) {
|
|
724
|
-
return false;
|
|
725
|
-
}
|
|
726
|
-
const safePlay = () => {
|
|
727
|
-
void el.play().catch(() => {
|
|
728
|
-
});
|
|
729
|
-
};
|
|
730
|
-
const safeSeek = (seconds) => {
|
|
731
|
-
try {
|
|
732
|
-
el.currentTime = seconds;
|
|
733
|
-
} catch {
|
|
734
|
-
}
|
|
735
|
-
};
|
|
736
|
-
switch (parsed.verb) {
|
|
737
|
-
case "playFrom":
|
|
738
|
-
safeSeek(parsed.seekSeconds ?? 0);
|
|
739
|
-
safePlay();
|
|
740
|
-
return true;
|
|
741
|
-
case "play":
|
|
742
|
-
safePlay();
|
|
743
|
-
return true;
|
|
744
|
-
case "pause":
|
|
745
|
-
el.pause();
|
|
746
|
-
return true;
|
|
747
|
-
case "stop":
|
|
748
|
-
el.pause();
|
|
749
|
-
safeSeek(0);
|
|
750
|
-
return true;
|
|
751
|
-
case "togglePlay":
|
|
752
|
-
if (el.paused) {
|
|
753
|
-
safePlay();
|
|
754
|
-
} else {
|
|
755
|
-
el.pause();
|
|
756
|
-
}
|
|
757
|
-
return true;
|
|
758
|
-
default:
|
|
759
|
-
return false;
|
|
760
|
-
}
|
|
732
|
+
function executeMediaCommand(command, frameRoot) {
|
|
733
|
+
return chunkH74UXL4Q_js.runMediaCommand(
|
|
734
|
+
command,
|
|
735
|
+
(targetId) => registry.get(targetId) ?? chunkH74UXL4Q_js.findMediaElementByElementId(targetId, frameRoot?.())
|
|
736
|
+
);
|
|
761
737
|
}
|
|
762
738
|
function PresentationMediaController({
|
|
763
739
|
element,
|
|
@@ -990,7 +966,7 @@ function PresentationMediaController({
|
|
|
990
966
|
}
|
|
991
967
|
function renderMediaElement(element, mediaDataUrls, options) {
|
|
992
968
|
if (element.type !== "media") {
|
|
993
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
969
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkMMK4K3QI_js.translationsEn["pptx.media.title"] });
|
|
994
970
|
}
|
|
995
971
|
const mediaType = element.mediaType;
|
|
996
972
|
const mediaPath = element.mediaPath;
|
|
@@ -1020,7 +996,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1020
996
|
"img",
|
|
1021
997
|
{
|
|
1022
998
|
src: posterUrl,
|
|
1023
|
-
alt:
|
|
999
|
+
alt: chunkMMK4K3QI_js.translationsEn["pptx.media.posterAlt"],
|
|
1024
1000
|
className: "w-full h-full object-contain opacity-50"
|
|
1025
1001
|
}
|
|
1026
1002
|
),
|
|
@@ -1041,7 +1017,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1041
1017
|
]
|
|
1042
1018
|
}
|
|
1043
1019
|
),
|
|
1044
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children:
|
|
1020
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: chunkMMK4K3QI_js.translationsEn["pptx.media.notFound"] })
|
|
1045
1021
|
] })
|
|
1046
1022
|
] });
|
|
1047
1023
|
}
|
|
@@ -1082,7 +1058,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1082
1058
|
"img",
|
|
1083
1059
|
{
|
|
1084
1060
|
src: posterUrl,
|
|
1085
|
-
alt:
|
|
1061
|
+
alt: chunkMMK4K3QI_js.translationsEn["pptx.media.videoPosterAlt"],
|
|
1086
1062
|
className: "w-full h-full object-contain"
|
|
1087
1063
|
}
|
|
1088
1064
|
),
|
|
@@ -1171,76 +1147,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1171
1147
|
|
|
1172
1148
|
// src/viewer/utils/text-utils.tsx
|
|
1173
1149
|
function getTextStyleForElement(element, fallbackColor) {
|
|
1174
|
-
|
|
1175
|
-
return { color: fallbackColor };
|
|
1176
|
-
}
|
|
1177
|
-
const textDecorationTokens = [];
|
|
1178
|
-
if (element.textStyle?.underline || element.textStyle?.hyperlink) {
|
|
1179
|
-
textDecorationTokens.push("underline");
|
|
1180
|
-
}
|
|
1181
|
-
if (element.textStyle?.strikethrough) {
|
|
1182
|
-
textDecorationTokens.push("line-through");
|
|
1183
|
-
}
|
|
1184
|
-
const isDoubleStrike = element.textStyle?.strikethrough && element.textStyle?.strikeType === "dblStrike";
|
|
1185
|
-
const textDecorationStyle = isDoubleStrike ? "double" : void 0;
|
|
1186
|
-
const hasItalicRuns = element.textStyle?.italic || Boolean(element.textSegments?.some((segment) => segment.style?.italic));
|
|
1187
|
-
const isRtl = element.textStyle?.rtl === true;
|
|
1188
|
-
const resolvedTextColor = element.textStyle?.hyperlink ? chunkMZJMOEEX_js.normalizeHexColor(element.textStyle?.color, HYPERLINK_COLOR) : chunkMZJMOEEX_js.normalizeHexColor(element.textStyle?.color, fallbackColor);
|
|
1189
|
-
const bodyTop = element.textStyle?.bodyInsetTop ?? DEFAULT_BODY_INSET_TB_PX;
|
|
1190
|
-
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
1191
|
-
const bodyLeft = element.textStyle?.bodyInsetLeft ?? DEFAULT_BODY_INSET_LR_PX;
|
|
1192
|
-
const bodyRight = element.textStyle?.bodyInsetRight ?? DEFAULT_BODY_INSET_LR_PX;
|
|
1193
|
-
const hasParagraphIndents = (element.paragraphIndents?.length ?? 0) > 0;
|
|
1194
|
-
const bodyIndent = hasParagraphIndents ? 0 : element.textStyle?.paragraphIndent || 0;
|
|
1195
|
-
const bodyMarginLeft = hasParagraphIndents ? 0 : element.textStyle?.paragraphMarginLeft || 0;
|
|
1196
|
-
const bodyMarginRight = hasParagraphIndents ? 0 : element.textStyle?.paragraphMarginRight || 0;
|
|
1197
|
-
const writingMode = chunkMZJMOEEX_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
1198
|
-
const textOrientation = chunkMZJMOEEX_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
1199
|
-
const verticalDirection = chunkMZJMOEEX_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
1200
|
-
const resolvedDirection = verticalDirection || (isRtl ? "rtl" : "ltr");
|
|
1201
|
-
const resolvedUnicodeBidi = isRtl ? "plaintext" : void 0;
|
|
1202
|
-
const hasSegments = (element.textSegments?.length ?? 0) > 0;
|
|
1203
|
-
return {
|
|
1204
|
-
color: resolvedTextColor,
|
|
1205
|
-
backgroundColor: !hasSegments && element.textStyle?.highlightColor ? chunkMZJMOEEX_js.normalizeHexColor(element.textStyle.highlightColor, void 0) : void 0,
|
|
1206
|
-
textAlign: (() => {
|
|
1207
|
-
const a = element.textStyle?.align;
|
|
1208
|
-
if (a === "justLow" || a === "dist" || a === "thaiDist") {
|
|
1209
|
-
return "justify";
|
|
1210
|
-
}
|
|
1211
|
-
return a || (isRtl ? "right" : "left");
|
|
1212
|
-
})(),
|
|
1213
|
-
direction: resolvedDirection,
|
|
1214
|
-
unicodeBidi: resolvedUnicodeBidi,
|
|
1215
|
-
fontSize: element.textStyle?.fontSize || DEFAULT_TEXT_FONT_SIZE,
|
|
1216
|
-
fontWeight: element.textStyle?.bold ? 700 : 400,
|
|
1217
|
-
fontStyle: element.textStyle?.italic ? "italic" : "normal",
|
|
1218
|
-
textDecorationLine: textDecorationTokens.length > 0 ? textDecorationTokens.join(" ") : "none",
|
|
1219
|
-
textDecorationStyle,
|
|
1220
|
-
fontFamily: element.textStyle?.fontFamily || DEFAULT_FONT_FAMILY,
|
|
1221
|
-
lineHeight: chunkMZJMOEEX_js.resolveLineHeight(element.textStyle, hasItalicRuns),
|
|
1222
|
-
paddingTop: bodyTop + (hasItalicRuns ? 1 : 0),
|
|
1223
|
-
paddingBottom: bodyBottom + (hasItalicRuns ? 1 : 0),
|
|
1224
|
-
paddingLeft: bodyLeft + bodyMarginLeft,
|
|
1225
|
-
paddingRight: bodyRight + bodyMarginRight,
|
|
1226
|
-
textIndent: bodyIndent,
|
|
1227
|
-
overflow: "visible",
|
|
1228
|
-
writingMode,
|
|
1229
|
-
textOrientation,
|
|
1230
|
-
...element.textStyle?.textWrap === "none" ? { whiteSpace: "nowrap", overflow: "visible" } : {},
|
|
1231
|
-
// Auto-fit: use OOXML-provided fontScale/lnSpcReduction when available,
|
|
1232
|
-
// otherwise fall back to heuristic estimation. The pure font-scale maths
|
|
1233
|
-
// now lives in pptx-viewer-shared (computeAutoFitTextStyle).
|
|
1234
|
-
...chunkMZJMOEEX_js.computeAutoFitTextStyle({
|
|
1235
|
-
textStyle: element.textStyle,
|
|
1236
|
-
text: element.text ?? "",
|
|
1237
|
-
width: element.width,
|
|
1238
|
-
height: element.height,
|
|
1239
|
-
bodyInsetVertical: bodyTop + bodyBottom,
|
|
1240
|
-
hasItalicRuns,
|
|
1241
|
-
defaultFontSize: DEFAULT_TEXT_FONT_SIZE
|
|
1242
|
-
})
|
|
1243
|
-
};
|
|
1150
|
+
return chunkH74UXL4Q_js.buildTextBlockStyle(element, { fallbackColor });
|
|
1244
1151
|
}
|
|
1245
1152
|
|
|
1246
1153
|
// src/viewer/utils/text-layout.tsx
|
|
@@ -1265,13 +1172,13 @@ function computeTabSize(tabStops, defaultTabSize) {
|
|
|
1265
1172
|
return avgGap > 0 ? `${Math.round(avgGap)}px` : fromDefault;
|
|
1266
1173
|
}
|
|
1267
1174
|
function getTextLayoutStyle(element) {
|
|
1268
|
-
if (!
|
|
1175
|
+
if (!chunkH74UXL4Q_js.hasTextProperties(element)) {
|
|
1269
1176
|
return {};
|
|
1270
1177
|
}
|
|
1271
1178
|
const verticalAlign = element.textStyle?.vAlign || "top";
|
|
1272
|
-
const writingMode =
|
|
1273
|
-
const textOrientation =
|
|
1274
|
-
const verticalDirection =
|
|
1179
|
+
const writingMode = chunkH74UXL4Q_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
1180
|
+
const textOrientation = chunkH74UXL4Q_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
1181
|
+
const verticalDirection = chunkH74UXL4Q_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
1275
1182
|
const parsedColumnCount = Number(element.textStyle?.columnCount);
|
|
1276
1183
|
const columnCount = Number.isFinite(parsedColumnCount) ? Math.max(1, Math.min(16, Math.round(parsedColumnCount))) : 1;
|
|
1277
1184
|
const hasColumns = columnCount > 1;
|
|
@@ -1279,7 +1186,7 @@ function getTextLayoutStyle(element) {
|
|
|
1279
1186
|
const tabStops = element.textStyle?.tabStops;
|
|
1280
1187
|
const tabSize = computeTabSize(tabStops, element.textStyle?.defaultTabSize);
|
|
1281
1188
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
1282
|
-
const hasParagraphIndents =
|
|
1189
|
+
const hasParagraphIndents = chunkH74UXL4Q_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
1283
1190
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
1284
1191
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
1285
1192
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
@@ -1288,7 +1195,7 @@ function getTextLayoutStyle(element) {
|
|
|
1288
1195
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
1289
1196
|
const parsedColumnSpacing = Number(element.textStyle?.columnSpacing);
|
|
1290
1197
|
const columnGap = Number.isFinite(parsedColumnSpacing) && parsedColumnSpacing > 0 ? `${parsedColumnSpacing}px` : "0.75em";
|
|
1291
|
-
const kinsokuStyles =
|
|
1198
|
+
const kinsokuStyles = chunkH74UXL4Q_js.getKinsokuLineBreakStyles(element.textStyle);
|
|
1292
1199
|
if (hasColumns) {
|
|
1293
1200
|
return {
|
|
1294
1201
|
display: "block",
|
|
@@ -1335,10 +1242,10 @@ function getTextLayoutStyle(element) {
|
|
|
1335
1242
|
|
|
1336
1243
|
// src/viewer/utils/text-effects.tsx
|
|
1337
1244
|
function buildTextFillCss2(style) {
|
|
1338
|
-
return
|
|
1245
|
+
return chunkH74UXL4Q_js.buildTextFillCss(style);
|
|
1339
1246
|
}
|
|
1340
1247
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
1341
|
-
return
|
|
1248
|
+
return chunkH74UXL4Q_js.buildTextBody3DSceneStyle(textStyle);
|
|
1342
1249
|
}
|
|
1343
1250
|
|
|
1344
1251
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -1523,13 +1430,13 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1523
1430
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
1524
1431
|
return renderedSegments;
|
|
1525
1432
|
}
|
|
1526
|
-
const paraKey = `${elementId}${
|
|
1433
|
+
const paraKey = `${elementId}${chunkH74UXL4Q_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
1527
1434
|
const paraState = subElementAnimStates.get(paraKey);
|
|
1528
1435
|
if (paraState) {
|
|
1529
1436
|
const style = buildAnimStyle(paraState);
|
|
1530
1437
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
1531
1438
|
}
|
|
1532
|
-
const spec =
|
|
1439
|
+
const spec = chunkH74UXL4Q_js.buildTextBuildSpec(
|
|
1533
1440
|
elementId,
|
|
1534
1441
|
paraIndex,
|
|
1535
1442
|
paraSegments.map((entry) => ({ text: entry.segment.text, style: entry })),
|
|
@@ -1547,7 +1454,7 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1547
1454
|
"span",
|
|
1548
1455
|
{
|
|
1549
1456
|
"data-anim-id": span.animId,
|
|
1550
|
-
style:
|
|
1457
|
+
style: chunkH74UXL4Q_js.textBuildSpanStyle(span),
|
|
1551
1458
|
children: content
|
|
1552
1459
|
},
|
|
1553
1460
|
span.animId
|
|
@@ -1691,10 +1598,10 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1691
1598
|
if (!needsScriptFonts || !text) {
|
|
1692
1599
|
return text;
|
|
1693
1600
|
}
|
|
1694
|
-
const runs =
|
|
1601
|
+
const runs = chunkH74UXL4Q_js.segmentByScript(text);
|
|
1695
1602
|
if (runs.length <= 1) {
|
|
1696
1603
|
if (runs.length === 1) {
|
|
1697
|
-
const font =
|
|
1604
|
+
const font = chunkH74UXL4Q_js.resolveFontForScript(runs[0].script, scriptFonts);
|
|
1698
1605
|
if (font && font !== baseFontFamily) {
|
|
1699
1606
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: text });
|
|
1700
1607
|
}
|
|
@@ -1702,7 +1609,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1702
1609
|
return text;
|
|
1703
1610
|
}
|
|
1704
1611
|
return runs.map((run, i) => {
|
|
1705
|
-
const font =
|
|
1612
|
+
const font = chunkH74UXL4Q_js.resolveFontForScript(run.script, scriptFonts);
|
|
1706
1613
|
if (!font || font === baseFontFamily) {
|
|
1707
1614
|
return /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Fragment, { children: run.text }, `${keyPrefix}-r${i}`);
|
|
1708
1615
|
}
|
|
@@ -1774,8 +1681,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1774
1681
|
);
|
|
1775
1682
|
}
|
|
1776
1683
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
1777
|
-
const mathml =
|
|
1778
|
-
const safeMathml = mathml ?
|
|
1684
|
+
const mathml = chunkH74UXL4Q_js.convertOmmlToMathMl(equationXml);
|
|
1685
|
+
const safeMathml = mathml ? chunkH74UXL4Q_js.sanitizeMathMl(mathml) : "";
|
|
1779
1686
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1780
1687
|
"span",
|
|
1781
1688
|
{
|
|
@@ -1785,7 +1692,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1785
1692
|
},
|
|
1786
1693
|
dangerouslySetInnerHTML: { __html: safeMathml }
|
|
1787
1694
|
}
|
|
1788
|
-
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children:
|
|
1695
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children: chunkMMK4K3QI_js.translationsEn["pptx.textSegment.equationFallback"] });
|
|
1789
1696
|
if (equationNumber) {
|
|
1790
1697
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1791
1698
|
"span",
|
|
@@ -1825,7 +1732,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1825
1732
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: equationContent }, `${elementId}-seg-${segmentIndex}`);
|
|
1826
1733
|
}
|
|
1827
1734
|
function renderPictureBullet(elementId, segmentIndex, bulletInfo, baseFontSize) {
|
|
1828
|
-
const picture =
|
|
1735
|
+
const picture = chunkH74UXL4Q_js.resolvePictureBullet(bulletInfo, baseFontSize) ?? {
|
|
1829
1736
|
sizePx: baseFontSize,
|
|
1830
1737
|
fallbackMarker: "\u2022",
|
|
1831
1738
|
accessibleLabel: "Bullet"
|
|
@@ -1876,7 +1783,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1876
1783
|
}
|
|
1877
1784
|
const segmentStyle = segment.style || {};
|
|
1878
1785
|
const rawText = bulletInfo && typeof bulletHangPx === "number" ? (segment.text || "").trimEnd() : segment.text || "";
|
|
1879
|
-
const textValue =
|
|
1786
|
+
const textValue = chunkH74UXL4Q_js.substituteFieldText(rawText, segment.fieldType, fieldContext);
|
|
1880
1787
|
const lines = textValue.split("\n");
|
|
1881
1788
|
const textDecorationTokens = [];
|
|
1882
1789
|
if (segmentStyle.underline || segmentStyle.hyperlink) {
|
|
@@ -1886,8 +1793,8 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1886
1793
|
textDecorationTokens.push("line-through");
|
|
1887
1794
|
}
|
|
1888
1795
|
const isDoubleStrike = segmentStyle.strikethrough && segmentStyle.strikeType === "dblStrike";
|
|
1889
|
-
const resolvedSegmentColor = segmentStyle.hyperlink ?
|
|
1890
|
-
const underlineDecoration =
|
|
1796
|
+
const resolvedSegmentColor = segmentStyle.hyperlink ? chunkH74UXL4Q_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, HYPERLINK_COLOR) : chunkH74UXL4Q_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, fallbackColor);
|
|
1797
|
+
const underlineDecoration = chunkH74UXL4Q_js.resolveUnderlineDecorationStyle(
|
|
1891
1798
|
Boolean(isDoubleStrike),
|
|
1892
1799
|
segmentStyle.underlineStyle
|
|
1893
1800
|
);
|
|
@@ -1897,20 +1804,20 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1897
1804
|
const letterSpacing = typeof segmentStyle.characterSpacing === "number" && segmentStyle.characterSpacing !== 0 ? `${segmentStyle.characterSpacing / 100 * (96 / 72)}px` : void 0;
|
|
1898
1805
|
const textFillStyles = buildTextFillCss2(segmentStyle);
|
|
1899
1806
|
const rawFontSize = segmentStyle.fontSize || element.textStyle?.fontSize || DEFAULT_TEXT_FONT_SIZE;
|
|
1900
|
-
const autoFitScale =
|
|
1807
|
+
const autoFitScale = chunkH74UXL4Q_js.resolveAutoFitFontScale(element.textStyle);
|
|
1901
1808
|
const baseFontSize = rawFontSize * autoFitScale;
|
|
1902
1809
|
const baselineShift = baselineFraction !== 0 ? `${baselineFraction * baseFontSize}px` : void 0;
|
|
1903
1810
|
const baseFontSizePt = baseFontSize * (72 / 96);
|
|
1904
1811
|
const fontKerning = typeof segmentStyle.kerning === "number" ? segmentStyle.kerning === 0 ? "none" : baseFontSizePt >= segmentStyle.kerning / 100 ? "normal" : "none" : void 0;
|
|
1905
1812
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
1906
|
-
const baseFontFamily = rawFontFamily ?
|
|
1813
|
+
const baseFontFamily = rawFontFamily ? chunkH74UXL4Q_js.getSubstituteFontFamily(rawFontFamily) : DEFAULT_FONT_FAMILY;
|
|
1907
1814
|
const scriptFonts = {
|
|
1908
1815
|
latin: baseFontFamily,
|
|
1909
1816
|
eastAsia: segmentStyle.eastAsiaFont || element.textStyle?.eastAsiaFont || baseFontFamily,
|
|
1910
1817
|
complexScript: segmentStyle.complexScriptFont || element.textStyle?.complexScriptFont || baseFontFamily,
|
|
1911
1818
|
symbol: segmentStyle.symbolFont || element.textStyle?.symbolFont || baseFontFamily
|
|
1912
1819
|
};
|
|
1913
|
-
const needsScriptFonts =
|
|
1820
|
+
const needsScriptFonts = chunkH74UXL4Q_js.hasDistinctScriptFonts(scriptFonts);
|
|
1914
1821
|
const spanStyle = {
|
|
1915
1822
|
color: resolvedSegmentColor,
|
|
1916
1823
|
fontSize: baseFontSize * baselineFontScale,
|
|
@@ -1928,15 +1835,15 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1928
1835
|
fontVariantCaps: segmentStyle.textCaps === "small" ? "small-caps" : void 0,
|
|
1929
1836
|
letterSpacing,
|
|
1930
1837
|
fontKerning,
|
|
1931
|
-
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ?
|
|
1838
|
+
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ? chunkH74UXL4Q_js.normalizeHexColor(segmentStyle.highlightColor, "transparent") : void 0,
|
|
1932
1839
|
...textFillStyles,
|
|
1933
|
-
textDecorationColor: segmentStyle.underlineColor ?
|
|
1934
|
-
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${
|
|
1840
|
+
textDecorationColor: segmentStyle.underlineColor ? chunkH74UXL4Q_js.normalizeHexColor(segmentStyle.underlineColor, void 0) : void 0,
|
|
1841
|
+
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${chunkH74UXL4Q_js.normalizeHexColor(segmentStyle.textOutlineColor, "#000000")}` : segmentStyle.textOutlineWidth ? `${segmentStyle.textOutlineWidth}px currentColor` : void 0,
|
|
1935
1842
|
paintOrder: segmentStyle.textOutlineWidth ? "stroke fill" : void 0,
|
|
1936
|
-
textShadow:
|
|
1937
|
-
filter:
|
|
1938
|
-
opacity:
|
|
1939
|
-
WebkitBoxReflect:
|
|
1843
|
+
textShadow: chunkH74UXL4Q_js.buildTextShadowCss(segmentStyle),
|
|
1844
|
+
filter: chunkH74UXL4Q_js.buildTextRunFilterChain(segmentStyle),
|
|
1845
|
+
opacity: chunkH74UXL4Q_js.getTextAlphaOpacity(segmentStyle),
|
|
1846
|
+
WebkitBoxReflect: chunkH74UXL4Q_js.buildTextReflectionCss(segmentStyle)
|
|
1940
1847
|
};
|
|
1941
1848
|
const runRtl = segmentStyle.rtl;
|
|
1942
1849
|
if (runRtl !== void 0 && runRtl !== paragraphRtl) {
|
|
@@ -1956,7 +1863,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1956
1863
|
spanStyle.fontSize = baseFontSize * (bulletInfo.sizePercent / 100) * baselineFontScale;
|
|
1957
1864
|
}
|
|
1958
1865
|
if (bulletInfo.color) {
|
|
1959
|
-
spanStyle.color =
|
|
1866
|
+
spanStyle.color = chunkH74UXL4Q_js.normalizeHexColor(bulletInfo.color, resolvedSegmentColor);
|
|
1960
1867
|
}
|
|
1961
1868
|
if (typeof bulletHangPx === "number" && bulletHangPx > 0) {
|
|
1962
1869
|
spanStyle.display = "inline-block";
|
|
@@ -2001,7 +1908,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
2001
1908
|
textAlign: segment.rubyAlignment === "l" ? "left" : segment.rubyAlignment === "r" ? "right" : segment.rubyAlignment === "dist" || segment.rubyAlignment === "distCat" || segment.rubyAlignment === "distLetter" ? "justify" : "center"
|
|
2002
1909
|
};
|
|
2003
1910
|
if (segment.rubyStyle?.color) {
|
|
2004
|
-
rubyStyle.color =
|
|
1911
|
+
rubyStyle.color = chunkH74UXL4Q_js.normalizeHexColor(segment.rubyStyle.color, resolvedSegmentColor);
|
|
2005
1912
|
}
|
|
2006
1913
|
innerContent = /* @__PURE__ */ jsxRuntime.jsxs("ruby", { children: [
|
|
2007
1914
|
baseContent,
|
|
@@ -2096,7 +2003,7 @@ function groupSegmentsIntoParagraphs(segments) {
|
|
|
2096
2003
|
return paragraphs;
|
|
2097
2004
|
}
|
|
2098
2005
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick) {
|
|
2099
|
-
if (!
|
|
2006
|
+
if (!chunkH74UXL4Q_js.hasTextProperties(element)) {
|
|
2100
2007
|
return emptyFallback || null;
|
|
2101
2008
|
}
|
|
2102
2009
|
const effectiveSegments = segmentOverrides ?? element.textSegments;
|
|
@@ -2117,10 +2024,10 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2117
2024
|
return element.text || emptyFallback || "";
|
|
2118
2025
|
}
|
|
2119
2026
|
const paragraphs = groupSegmentsIntoParagraphs(effectiveSegments);
|
|
2120
|
-
const paragraphIndents =
|
|
2121
|
-
const elementRtl =
|
|
2122
|
-
const elementAlign =
|
|
2123
|
-
const bodyStyle =
|
|
2027
|
+
const paragraphIndents = chunkH74UXL4Q_js.hasTextProperties(element) ? element.paragraphIndents : void 0;
|
|
2028
|
+
const elementRtl = chunkH74UXL4Q_js.hasTextProperties(element) ? element.textStyle?.rtl : void 0;
|
|
2029
|
+
const elementAlign = chunkH74UXL4Q_js.hasTextProperties(element) ? element.textStyle?.align : void 0;
|
|
2030
|
+
const bodyStyle = chunkH74UXL4Q_js.hasTextProperties(element) ? element.textStyle : void 0;
|
|
2124
2031
|
const spaceFirstLast = bodyStyle?.spaceFirstLastParagraph !== false;
|
|
2125
2032
|
return paragraphs.map(({ entries: paraSegments, terminator }, paraIndex) => {
|
|
2126
2033
|
const paraIndent = paragraphIndents?.[paraIndex];
|
|
@@ -2135,14 +2042,14 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2135
2042
|
return Boolean(segment.text) && segment.text.trim().length > 0;
|
|
2136
2043
|
});
|
|
2137
2044
|
const hasBullet = bulletInfo && !bulletInfo.none && hasVisibleTextContent;
|
|
2138
|
-
const paraRtl =
|
|
2045
|
+
const paraRtl = chunkH74UXL4Q_js.resolveParagraphRtl(paraSegments, elementRtl);
|
|
2139
2046
|
const isRtlParagraph = paraRtl === true;
|
|
2140
|
-
const paraAlign =
|
|
2141
|
-
const cssTextAlign =
|
|
2047
|
+
const paraAlign = chunkH74UXL4Q_js.resolveParagraphAlign(paraSegments, elementAlign);
|
|
2048
|
+
const cssTextAlign = chunkH74UXL4Q_js.resolveCssTextAlign(paraAlign, isRtlParagraph);
|
|
2142
2049
|
const paraMarginLeft = isRtlParagraph ? void 0 : rawMarginLeft;
|
|
2143
2050
|
const paraMarginRight = isRtlParagraph ? rawMarginLeft : void 0;
|
|
2144
2051
|
const paraTextIndent = rawTextIndent;
|
|
2145
|
-
const paraKinsokuStyle =
|
|
2052
|
+
const paraKinsokuStyle = chunkH74UXL4Q_js.getKinsokuLineBreakStyles(firstSeg?.segment.style);
|
|
2146
2053
|
const hasParaKinsoku = Object.keys(paraKinsokuStyle).length > 0;
|
|
2147
2054
|
const paraProps = effectiveSegments[firstSeg?.globalIndex ?? -1]?.paragraphProperties ?? (paraSegments.length === 0 ? terminator?.paragraphProperties : void 0);
|
|
2148
2055
|
const spacing = resolveParagraphSpacing({
|
|
@@ -2152,7 +2059,7 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2152
2059
|
isLast: paraIndex === paragraphs.length - 1,
|
|
2153
2060
|
spaceFirstLast
|
|
2154
2061
|
});
|
|
2155
|
-
const strutFontSize =
|
|
2062
|
+
const strutFontSize = chunkH74UXL4Q_js.resolveParagraphStrutFontSize(
|
|
2156
2063
|
paraSegments.length > 0 ? paraSegments.map(({ segment }) => segment) : terminator ? [terminator] : [],
|
|
2157
2064
|
bodyStyle?.fontSize
|
|
2158
2065
|
);
|
|
@@ -2256,13 +2163,13 @@ function hexToRgbUnit(hex) {
|
|
|
2256
2163
|
};
|
|
2257
2164
|
}
|
|
2258
2165
|
function getDuotoneColors(element) {
|
|
2259
|
-
if (!
|
|
2166
|
+
if (!chunkH74UXL4Q_js.isImageLikeElement(element)) {
|
|
2260
2167
|
return void 0;
|
|
2261
2168
|
}
|
|
2262
2169
|
return element.imageEffects?.duotone;
|
|
2263
2170
|
}
|
|
2264
2171
|
function buildLineShadowCss(element) {
|
|
2265
|
-
if (!
|
|
2172
|
+
if (!chunkH74UXL4Q_js.hasShapeProperties(element)) {
|
|
2266
2173
|
return void 0;
|
|
2267
2174
|
}
|
|
2268
2175
|
const ss = element.shapeStyle;
|
|
@@ -2273,13 +2180,13 @@ function buildLineShadowCss(element) {
|
|
|
2273
2180
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
2274
2181
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
2275
2182
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
2276
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
2277
|
-
|
|
2183
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkH74UXL4Q_js.colorWithOpacity(
|
|
2184
|
+
chunkH74UXL4Q_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
2278
2185
|
opacity
|
|
2279
2186
|
)}`;
|
|
2280
2187
|
}
|
|
2281
2188
|
function buildLineGlowFilter(element) {
|
|
2282
|
-
if (!
|
|
2189
|
+
if (!chunkH74UXL4Q_js.hasShapeProperties(element)) {
|
|
2283
2190
|
return void 0;
|
|
2284
2191
|
}
|
|
2285
2192
|
const ss = element.shapeStyle;
|
|
@@ -2288,7 +2195,7 @@ function buildLineGlowFilter(element) {
|
|
|
2288
2195
|
}
|
|
2289
2196
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
2290
2197
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
2291
|
-
const glowCol =
|
|
2198
|
+
const glowCol = chunkH74UXL4Q_js.colorWithOpacity(chunkH74UXL4Q_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
2292
2199
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
2293
2200
|
}
|
|
2294
2201
|
function mapDagBlendModeToCss(blend) {
|
|
@@ -2312,7 +2219,7 @@ function getDagDuotoneFilterId(elementId) {
|
|
|
2312
2219
|
return `dag-duotone-${elementId}`;
|
|
2313
2220
|
}
|
|
2314
2221
|
function hasDagDuotoneEffect(element) {
|
|
2315
|
-
if (!
|
|
2222
|
+
if (!chunkH74UXL4Q_js.hasShapeProperties(element)) {
|
|
2316
2223
|
return false;
|
|
2317
2224
|
}
|
|
2318
2225
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
@@ -2375,7 +2282,7 @@ function getRoundRectRadiusPx2(element) {
|
|
|
2375
2282
|
|
|
2376
2283
|
// src/viewer/utils/shape-visual-3d.ts
|
|
2377
2284
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
2378
|
-
return
|
|
2285
|
+
return chunkH74UXL4Q_js.build3DExtrusionData(
|
|
2379
2286
|
shape3d,
|
|
2380
2287
|
scene3d,
|
|
2381
2288
|
fillColor,
|
|
@@ -2384,7 +2291,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
2384
2291
|
);
|
|
2385
2292
|
}
|
|
2386
2293
|
function apply3dEffects2(base, scene3d, shape3d, fillColorFallback) {
|
|
2387
|
-
|
|
2294
|
+
chunkH74UXL4Q_js.apply3dEffects(base, scene3d, shape3d, fillColorFallback);
|
|
2388
2295
|
}
|
|
2389
2296
|
|
|
2390
2297
|
// src/viewer/utils/vector-subpath-paint.ts
|
|
@@ -2393,7 +2300,7 @@ function toHexByte(value) {
|
|
|
2393
2300
|
return clamped.toString(16).padStart(2, "0");
|
|
2394
2301
|
}
|
|
2395
2302
|
function shiftHex(hex, factor, towardsWhite) {
|
|
2396
|
-
const channels =
|
|
2303
|
+
const channels = chunkH74UXL4Q_js.hexToRgbChannels(hex);
|
|
2397
2304
|
if (!channels) {
|
|
2398
2305
|
return hex;
|
|
2399
2306
|
}
|
|
@@ -2419,13 +2326,13 @@ function buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity) {
|
|
|
2419
2326
|
const fillOff = subpath.fillMode === "none" || !hasFill;
|
|
2420
2327
|
return {
|
|
2421
2328
|
d: subpath.d,
|
|
2422
|
-
fill: fillOff ? "none" :
|
|
2329
|
+
fill: fillOff ? "none" : chunkH74UXL4Q_js.colorWithOpacity(adjustFillForMode(fillColor, subpath.fillMode), fillOpacity),
|
|
2423
2330
|
stroked: subpath.stroke !== false
|
|
2424
2331
|
};
|
|
2425
2332
|
});
|
|
2426
2333
|
}
|
|
2427
2334
|
function getStrokeOnlyPresetPaths(element) {
|
|
2428
|
-
if (element.type !== "shape" || !
|
|
2335
|
+
if (element.type !== "shape" || !chunkH74UXL4Q_js.hasShapeProperties(element)) {
|
|
2429
2336
|
return void 0;
|
|
2430
2337
|
}
|
|
2431
2338
|
const shapeType = element.shapeType;
|
|
@@ -2435,7 +2342,7 @@ function getStrokeOnlyPresetPaths(element) {
|
|
|
2435
2342
|
if (element.pathData) {
|
|
2436
2343
|
return void 0;
|
|
2437
2344
|
}
|
|
2438
|
-
const result =
|
|
2345
|
+
const result = chunkH74UXL4Q_js.evaluatePresetShape(
|
|
2439
2346
|
shapeType,
|
|
2440
2347
|
Math.max(element.width, 1),
|
|
2441
2348
|
Math.max(element.height, 1),
|
|
@@ -2449,28 +2356,47 @@ function getStrokeOnlyPresetPaths(element) {
|
|
|
2449
2356
|
}
|
|
2450
2357
|
|
|
2451
2358
|
// src/viewer/utils/shape-visual-style.ts
|
|
2359
|
+
function getGradientTilingCss(style) {
|
|
2360
|
+
if (!style || style.fillMode !== "gradient") {
|
|
2361
|
+
return void 0;
|
|
2362
|
+
}
|
|
2363
|
+
const isStructuredLinear = (style.fillGradientType || "linear") === "linear" && chunkH74UXL4Q_js.sanitizeGradientStops(style.fillGradientStops).length > 0;
|
|
2364
|
+
if (isStructuredLinear) {
|
|
2365
|
+
const flip = chunkH74UXL4Q_js.getGradientTileFlipCss(style.fillGradientFlip);
|
|
2366
|
+
if (flip) {
|
|
2367
|
+
return flip;
|
|
2368
|
+
}
|
|
2369
|
+
}
|
|
2370
|
+
return chunkH74UXL4Q_js.getGradientTileRectCss(style.fillGradientTileRect);
|
|
2371
|
+
}
|
|
2452
2372
|
function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2453
|
-
if (!
|
|
2373
|
+
if (!chunkH74UXL4Q_js.hasShapeProperties(element)) {
|
|
2454
2374
|
return {};
|
|
2455
2375
|
}
|
|
2456
2376
|
const normalizedShapeType = getShapeType(element.shapeType);
|
|
2457
|
-
const clipPath =
|
|
2377
|
+
const clipPath = chunkH74UXL4Q_js.getResolvedShapeClipPath(element);
|
|
2458
2378
|
const rendersCustomVectorPath = (element.type === "shape" || element.type === "image" || element.type === "picture") && Boolean(element.pathData) && typeof element.pathWidth === "number" && element.pathWidth > 0 && typeof element.pathHeight === "number" && element.pathHeight > 0;
|
|
2459
2379
|
const rendersStrokeOnlyPreset = Boolean(getStrokeOnlyPresetPaths(element));
|
|
2460
2380
|
const fillOpacity = element.shapeStyle?.fillOpacity;
|
|
2461
2381
|
const strokeOpacity = element.shapeStyle?.strokeOpacity;
|
|
2462
|
-
const strokeDash =
|
|
2463
|
-
const fillGradient =
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2382
|
+
const strokeDash = chunkH74UXL4Q_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2383
|
+
const fillGradient = chunkH74UXL4Q_js.buildCssGradientFromShapeStyle(element.shapeStyle, {
|
|
2384
|
+
rotation: element.rotation,
|
|
2385
|
+
width: element.width,
|
|
2386
|
+
height: element.height
|
|
2387
|
+
}) || element.shapeStyle?.fillGradient;
|
|
2388
|
+
const shadowCss = chunkH74UXL4Q_js.buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
2389
|
+
const innerShadowCss = chunkH74UXL4Q_js.buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
2390
|
+
const resolvedFillColor = chunkH74UXL4Q_js.colorWithOpacity(fillColor, fillOpacity);
|
|
2391
|
+
const resolvedStrokeColor = chunkH74UXL4Q_js.colorWithOpacity(strokeColor, strokeOpacity);
|
|
2468
2392
|
const ss = element.shapeStyle;
|
|
2393
|
+
const gradientTiling = getGradientTilingCss(ss);
|
|
2394
|
+
const paintsGradientOutline = chunkH74UXL4Q_js.suppressesCssBorder(element);
|
|
2469
2395
|
const hasFillOverlayColor = Boolean(
|
|
2470
2396
|
ss?.dagFillOverlayColor && ss.dagFillOverlayColor !== "transparent"
|
|
2471
2397
|
);
|
|
2472
2398
|
const combinedShadowParts = [];
|
|
2473
|
-
const multiLayerShadow =
|
|
2399
|
+
const multiLayerShadow = chunkH74UXL4Q_js.buildMultiLayerShadowCss(element.shapeStyle);
|
|
2474
2400
|
if (multiLayerShadow) {
|
|
2475
2401
|
combinedShadowParts.push(multiLayerShadow);
|
|
2476
2402
|
} else if (shadowCss) {
|
|
@@ -2479,7 +2405,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2479
2405
|
if (innerShadowCss) {
|
|
2480
2406
|
combinedShadowParts.push(innerShadowCss);
|
|
2481
2407
|
}
|
|
2482
|
-
const glowBoxShadow =
|
|
2408
|
+
const glowBoxShadow = chunkH74UXL4Q_js.buildGlowBoxShadow(ss?.glowColor, ss?.glowRadius, ss?.glowOpacity);
|
|
2483
2409
|
if (glowBoxShadow) {
|
|
2484
2410
|
combinedShadowParts.push(glowBoxShadow);
|
|
2485
2411
|
}
|
|
@@ -2487,7 +2413,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2487
2413
|
if (lineShadow) {
|
|
2488
2414
|
combinedShadowParts.push(lineShadow);
|
|
2489
2415
|
}
|
|
2490
|
-
const compoundLineShadow =
|
|
2416
|
+
const compoundLineShadow = chunkH74UXL4Q_js.getCompoundLineBoxShadow(
|
|
2491
2417
|
element.shapeStyle?.compoundLine,
|
|
2492
2418
|
strokeWidth,
|
|
2493
2419
|
resolvedStrokeColor
|
|
@@ -2500,11 +2426,11 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2500
2426
|
if (ss?.glowColor && ss.glowColor !== "transparent" && ss.glowRadius) {
|
|
2501
2427
|
const glowOpacity = typeof ss.glowOpacity === "number" ? ss.glowOpacity : 0.75;
|
|
2502
2428
|
const glowRad = Math.round(Math.max(0, ss.glowRadius));
|
|
2503
|
-
const glowCol =
|
|
2429
|
+
const glowCol = chunkH74UXL4Q_js.colorWithOpacity(chunkH74UXL4Q_js.normalizeHexColor(ss.glowColor, "#ffff00"), glowOpacity);
|
|
2504
2430
|
filterParts.push(`drop-shadow(0 0 ${glowRad}px ${glowCol})`);
|
|
2505
2431
|
}
|
|
2506
2432
|
if (typeof ss?.softEdgeRadius === "number" && ss.softEdgeRadius > 0) {
|
|
2507
|
-
filterParts.push(`url(#${
|
|
2433
|
+
filterParts.push(`url(#${chunkH74UXL4Q_js.getSoftEdgeFilterId(element.id)})`);
|
|
2508
2434
|
}
|
|
2509
2435
|
if (typeof ss?.blurRadius === "number" && ss.blurRadius > 0) {
|
|
2510
2436
|
filterParts.push(`blur(${Math.round(ss.blurRadius)}px)`);
|
|
@@ -2513,13 +2439,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2513
2439
|
if (lineGlowCss) {
|
|
2514
2440
|
filterParts.push(lineGlowCss);
|
|
2515
2441
|
}
|
|
2516
|
-
const dagFilter =
|
|
2442
|
+
const dagFilter = chunkH74UXL4Q_js.getEffectDagFilter(ss, element.id);
|
|
2517
2443
|
if (dagFilter) {
|
|
2518
2444
|
filterParts.push(dagFilter);
|
|
2519
2445
|
}
|
|
2520
2446
|
const lineJoinCss = ss?.lineJoin === "round" ? "round" : ss?.lineJoin === "bevel" ? "bevel" : ss?.lineJoin === "miter" ? "miter" : void 0;
|
|
2521
2447
|
const miterLimitCss = ss?.lineJoin === "miter" && typeof ss?.miterLimit === "number" ? Math.max(ss.miterLimit / 1e5, 1) : void 0;
|
|
2522
|
-
const patternFill =
|
|
2448
|
+
const patternFill = chunkH74UXL4Q_js.buildPatternFillCss(element.shapeStyle);
|
|
2523
2449
|
const imageFillUrl = ss?.fillMode === "image" && ss.fillImageUrl ? ss.fillImageUrl : void 0;
|
|
2524
2450
|
const imageFillMode = ss?.fillImageMode || "stretch";
|
|
2525
2451
|
let reflectCss;
|
|
@@ -2531,7 +2457,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2531
2457
|
const endOpacity = typeof ss.reflectionEndOpacity === "number" ? ss.reflectionEndOpacity : 0;
|
|
2532
2458
|
const fadeLength = typeof ss.reflectionEndPosition === "number" ? Math.round(ss.reflectionEndPosition * Math.max(element.height, 1)) : 100;
|
|
2533
2459
|
const blurRadius = typeof ss.reflectionBlurRadius === "number" ? ss.reflectionBlurRadius : 0;
|
|
2534
|
-
reflectCss =
|
|
2460
|
+
reflectCss = chunkH74UXL4Q_js.buildReflectionCss(distance, startOpacity, endOpacity, fadeLength, blurRadius);
|
|
2535
2461
|
}
|
|
2536
2462
|
}
|
|
2537
2463
|
const base = {
|
|
@@ -2545,8 +2471,8 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2545
2471
|
// `getComputedFillStyle` (image -> gradient -> pattern -> solid).
|
|
2546
2472
|
backgroundColor: imageFillUrl ? "transparent" : patternFill ? patternFill.backgroundColor : hasFill && !fillGradient ? resolvedFillColor : "transparent",
|
|
2547
2473
|
backgroundImage: imageFillUrl ? `url(${imageFillUrl})` : patternFill ? patternFill.backgroundImage : hasFill && fillGradient ? fillGradient : void 0,
|
|
2548
|
-
backgroundRepeat: imageFillUrl ? imageFillMode === "tile" ? "repeat" : "no-repeat" : patternFill ? "repeat" : hasFill && fillGradient ? "no-repeat" : void 0,
|
|
2549
|
-
backgroundSize: imageFillUrl ? imageFillMode === "tile" ? "auto" : "100% 100%" : patternFill ? "auto" : hasFill && fillGradient ? "100% 100%" : void 0,
|
|
2474
|
+
backgroundRepeat: imageFillUrl ? imageFillMode === "tile" ? "repeat" : "no-repeat" : patternFill ? "repeat" : hasFill && fillGradient ? gradientTiling?.backgroundRepeat ?? "no-repeat" : void 0,
|
|
2475
|
+
backgroundSize: imageFillUrl ? imageFillMode === "tile" ? "auto" : "100% 100%" : patternFill ? "auto" : hasFill && fillGradient ? gradientTiling?.backgroundSize ?? "100% 100%" : void 0,
|
|
2550
2476
|
// The container always carries a 1px border (transparent unless the shape
|
|
2551
2477
|
// has a stroke or is hovered) and `box-sizing: border-box`, so the default
|
|
2552
2478
|
// `background-origin: padding-box` sizes the paint 2px smaller than the
|
|
@@ -2555,7 +2481,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2555
2481
|
// edge - a fade-to-transparent overlay grew a hard opaque line down its
|
|
2556
2482
|
// side. Paint from the border box so the fill matches the shape outline.
|
|
2557
2483
|
backgroundOrigin: "border-box",
|
|
2558
|
-
backgroundPosition: imageFillUrl ? "center" : void 0,
|
|
2484
|
+
backgroundPosition: imageFillUrl ? "center" : hasFill && fillGradient ? gradientTiling?.backgroundPosition : void 0,
|
|
2559
2485
|
boxShadow: combinedBoxShadow,
|
|
2560
2486
|
WebkitBoxReflect: reflectCss,
|
|
2561
2487
|
filter: filterParts.length > 0 ? filterParts.join(" ") : void 0,
|
|
@@ -2573,9 +2499,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2573
2499
|
// two adjacent 40px buttons rendered with a 2px gap PowerPoint does not
|
|
2574
2500
|
// draw. The affordance is an `outline` instead (see `ElementRenderer`),
|
|
2575
2501
|
// which paints in the same place without taking part in layout.
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2502
|
+
// A gradient outline is painted by `ShapeEffectOverlay` as a stroked SVG
|
|
2503
|
+
// path following the shape's geometry, because a CSS border can only take
|
|
2504
|
+
// one colour. Keeping the border too would draw the parser's averaged
|
|
2505
|
+
// solid underneath the gradient.
|
|
2506
|
+
borderWidth: strokeWidth > 0 && !paintsGradientOutline ? chunkH74UXL4Q_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : 0,
|
|
2507
|
+
borderColor: strokeWidth > 0 && !paintsGradientOutline ? resolvedStrokeColor : void 0,
|
|
2508
|
+
borderStyle: strokeWidth > 0 && !paintsGradientOutline ? chunkH74UXL4Q_js.getCssBorderDashStyle(strokeDash, ss?.compoundLine) : void 0,
|
|
2579
2509
|
strokeLinejoin: lineJoinCss,
|
|
2580
2510
|
strokeMiterlimit: miterLimitCss,
|
|
2581
2511
|
strokeLinecap: ss?.lineCap === "rnd" ? "round" : ss?.lineCap === "sq" ? "square" : ss?.lineCap === "flat" ? "butt" : void 0
|
|
@@ -2631,7 +2561,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2631
2561
|
borderWidth: 0,
|
|
2632
2562
|
borderTopWidth: Math.max(strokeWidth, 2),
|
|
2633
2563
|
borderTopColor: resolvedStrokeColor,
|
|
2634
|
-
borderTopStyle:
|
|
2564
|
+
borderTopStyle: chunkH74UXL4Q_js.getCssBorderDashStyle(strokeDash)
|
|
2635
2565
|
};
|
|
2636
2566
|
}
|
|
2637
2567
|
if (normalizedShapeType === "cylinder") {
|
|
@@ -2645,13 +2575,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2645
2575
|
function getConnectorAdjustment(element, key, fallback) {
|
|
2646
2576
|
const direct = element.shapeAdjustments?.[key];
|
|
2647
2577
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
2648
|
-
return
|
|
2578
|
+
return chunkH74UXL4Q_js.clampUnitInterval(direct / 1e5);
|
|
2649
2579
|
}
|
|
2650
2580
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
2651
2581
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
2652
|
-
return
|
|
2582
|
+
return chunkH74UXL4Q_js.clampUnitInterval(fallbackKey / 1e5);
|
|
2653
2583
|
}
|
|
2654
|
-
return
|
|
2584
|
+
return chunkH74UXL4Q_js.clampUnitInterval(fallback);
|
|
2655
2585
|
}
|
|
2656
2586
|
function getConnectorPathGeometry(element) {
|
|
2657
2587
|
const width = Math.max(element.width, 1);
|
|
@@ -2788,11 +2718,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
|
|
|
2788
2718
|
strokePaint,
|
|
2789
2719
|
strokeWidth,
|
|
2790
2720
|
dashArray,
|
|
2791
|
-
lineCap:
|
|
2721
|
+
lineCap: chunkH74UXL4Q_js.svgLineCap(shapeStyle?.lineCap),
|
|
2792
2722
|
lineJoin,
|
|
2793
2723
|
miterLimit,
|
|
2794
|
-
offsets:
|
|
2795
|
-
widths:
|
|
2724
|
+
offsets: chunkH74UXL4Q_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
2725
|
+
widths: chunkH74UXL4Q_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
|
|
2796
2726
|
};
|
|
2797
2727
|
}
|
|
2798
2728
|
function strokeStrands(d, keyBase, ctx) {
|
|
@@ -2813,21 +2743,49 @@ function strokeStrands(d, keyBase, ctx) {
|
|
|
2813
2743
|
`${keyBase}-s${idx}`
|
|
2814
2744
|
));
|
|
2815
2745
|
}
|
|
2816
|
-
function
|
|
2746
|
+
function gradientDefs(gradient) {
|
|
2747
|
+
if (!gradient) {
|
|
2748
|
+
return null;
|
|
2749
|
+
}
|
|
2750
|
+
const stops = gradient.stops.map((stop, idx) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2751
|
+
"stop",
|
|
2752
|
+
{
|
|
2753
|
+
offset: stop.offset,
|
|
2754
|
+
stopColor: stop.color,
|
|
2755
|
+
stopOpacity: typeof stop.opacity === "number" ? stop.opacity : void 0
|
|
2756
|
+
},
|
|
2757
|
+
idx
|
|
2758
|
+
));
|
|
2759
|
+
return /* @__PURE__ */ jsxRuntime.jsx("defs", { children: gradient.kind === "radial" ? /* @__PURE__ */ jsxRuntime.jsx("radialGradient", { id: gradient.id, cx: gradient.cx, cy: gradient.cy, r: gradient.r, children: stops }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2760
|
+
"linearGradient",
|
|
2761
|
+
{
|
|
2762
|
+
id: gradient.id,
|
|
2763
|
+
x1: gradient.x1,
|
|
2764
|
+
y1: gradient.y1,
|
|
2765
|
+
x2: gradient.x2,
|
|
2766
|
+
y2: gradient.y2,
|
|
2767
|
+
children: stops
|
|
2768
|
+
}
|
|
2769
|
+
) });
|
|
2770
|
+
}
|
|
2771
|
+
function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredPaths, shapeStyle, hasFill, fillColor, fillOpacity, strokePaint, strokeWidth, dashArray, animatesFill = false, gradient) {
|
|
2817
2772
|
const ctx = strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray);
|
|
2818
|
-
const subpaths = structuredPaths && structuredPaths.length > 0 ?
|
|
2773
|
+
const subpaths = structuredPaths && structuredPaths.length > 0 ? chunkH74UXL4Q_js.customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
2819
2774
|
const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
|
|
2775
|
+
const gradientPaint = gradient ? chunkH74UXL4Q_js.svgGradientFillRef(gradient) : void 0;
|
|
2820
2776
|
const nodes = [];
|
|
2821
2777
|
if (subpaths && needsPerSubpath) {
|
|
2822
2778
|
const paints = buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity);
|
|
2823
2779
|
paints.forEach((paint, idx) => {
|
|
2824
2780
|
if (paint.fill !== "none") {
|
|
2781
|
+
const mode = subpaths[idx]?.fillMode;
|
|
2782
|
+
const useGradient = gradientPaint && (mode === void 0 || mode === "norm");
|
|
2825
2783
|
nodes.push(
|
|
2826
2784
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2827
2785
|
"path",
|
|
2828
2786
|
{
|
|
2829
2787
|
d: paint.d,
|
|
2830
|
-
fill: animatesFill ? "inherit" : paint.fill,
|
|
2788
|
+
fill: animatesFill ? "inherit" : useGradient ? gradientPaint : paint.fill,
|
|
2831
2789
|
stroke: "none",
|
|
2832
2790
|
vectorEffect: "non-scaling-stroke"
|
|
2833
2791
|
},
|
|
@@ -2846,7 +2804,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2846
2804
|
"path",
|
|
2847
2805
|
{
|
|
2848
2806
|
d: pathData,
|
|
2849
|
-
fill: animatesFill ? "inherit" :
|
|
2807
|
+
fill: animatesFill ? "inherit" : gradientPaint ?? chunkH74UXL4Q_js.colorWithOpacity(fillColor, fillOpacity),
|
|
2850
2808
|
stroke: "none",
|
|
2851
2809
|
vectorEffect: "non-scaling-stroke"
|
|
2852
2810
|
},
|
|
@@ -2858,13 +2816,16 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2858
2816
|
nodes.push(...strokeStrands(pathData, "agg", ctx));
|
|
2859
2817
|
}
|
|
2860
2818
|
}
|
|
2861
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
2819
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2862
2820
|
"svg",
|
|
2863
2821
|
{
|
|
2864
2822
|
viewBox: `0 0 ${pathWidth} ${pathHeight}`,
|
|
2865
2823
|
className: "w-full h-full pointer-events-none",
|
|
2866
2824
|
preserveAspectRatio: "none",
|
|
2867
|
-
children:
|
|
2825
|
+
children: [
|
|
2826
|
+
animatesFill ? null : gradientDefs(gradient),
|
|
2827
|
+
nodes
|
|
2828
|
+
]
|
|
2868
2829
|
}
|
|
2869
2830
|
);
|
|
2870
2831
|
}
|
|
@@ -2888,14 +2849,14 @@ function renderStrokeOnlyPreset(presetPaths, width, height, shapeStyle, strokePa
|
|
|
2888
2849
|
);
|
|
2889
2850
|
}
|
|
2890
2851
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2891
|
-
if (!
|
|
2852
|
+
if (!chunkH74UXL4Q_js.hasShapeProperties(element)) {
|
|
2892
2853
|
return null;
|
|
2893
2854
|
}
|
|
2894
2855
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
2895
|
-
const fillPaint = animatesFill ? "inherit" :
|
|
2896
|
-
const strokePaint = animatesStroke ? "inherit" :
|
|
2897
|
-
const dashType =
|
|
2898
|
-
const dashArray =
|
|
2856
|
+
const fillPaint = animatesFill ? "inherit" : chunkH74UXL4Q_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
2857
|
+
const strokePaint = animatesStroke ? "inherit" : chunkH74UXL4Q_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
2858
|
+
const dashType = chunkH74UXL4Q_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2859
|
+
const dashArray = chunkH74UXL4Q_js.getSvgStrokeDasharray(
|
|
2899
2860
|
dashType,
|
|
2900
2861
|
Math.max(strokeWidth, 1),
|
|
2901
2862
|
element.shapeStyle?.customDashSegments
|
|
@@ -2971,21 +2932,26 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2971
2932
|
strokePaint,
|
|
2972
2933
|
strokeWidth,
|
|
2973
2934
|
dashArray,
|
|
2974
|
-
Boolean(animatesFill)
|
|
2935
|
+
Boolean(animatesFill),
|
|
2936
|
+
// A freeform's `a:gradFill` needs a real SVG paint server: the
|
|
2937
|
+
// container's `background-image` is suppressed for custom geometry, so
|
|
2938
|
+
// without this the shape fell back to the parser's representative solid
|
|
2939
|
+
// and lost every fade (issue #132).
|
|
2940
|
+
chunkH74UXL4Q_js.buildSvgGradientDef(element.shapeStyle, element.id)
|
|
2975
2941
|
);
|
|
2976
2942
|
}
|
|
2977
|
-
if (
|
|
2943
|
+
if (chunkH74UXL4Q_js.isCalloutShape(normalizedType)) {
|
|
2978
2944
|
const width = Math.max(element.width, 1);
|
|
2979
2945
|
const height = Math.max(element.height, 1);
|
|
2980
|
-
const geometry =
|
|
2946
|
+
const geometry = chunkH74UXL4Q_js.getCalloutLeaderLineGeometry(
|
|
2981
2947
|
normalizedType,
|
|
2982
2948
|
width,
|
|
2983
2949
|
height,
|
|
2984
2950
|
element.shapeAdjustments
|
|
2985
2951
|
);
|
|
2986
2952
|
if (geometry && geometry.points.length >= 2) {
|
|
2987
|
-
const leaderPath =
|
|
2988
|
-
const bounds =
|
|
2953
|
+
const leaderPath = chunkH74UXL4Q_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
2954
|
+
const bounds = chunkH74UXL4Q_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
2989
2955
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
2990
2956
|
const offsetLeft = bounds.minX;
|
|
2991
2957
|
const offsetTop = bounds.minY;
|
|
@@ -3048,10 +3014,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
3048
3014
|
const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
|
|
3049
3015
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
3050
3016
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
3051
|
-
const connectorLineCap =
|
|
3017
|
+
const connectorLineCap = chunkH74UXL4Q_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
3052
3018
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
3053
|
-
const offsets =
|
|
3054
|
-
const widths =
|
|
3019
|
+
const offsets = chunkH74UXL4Q_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
3020
|
+
const widths = chunkH74UXL4Q_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
3055
3021
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3056
3022
|
"svg",
|
|
3057
3023
|
{
|
|
@@ -3130,15 +3096,15 @@ function parseGradientFillCss(gradFill) {
|
|
|
3130
3096
|
}
|
|
3131
3097
|
const parsed = stops.map((gs) => {
|
|
3132
3098
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
3133
|
-
const color =
|
|
3134
|
-
const opacity =
|
|
3135
|
-
return { pos, color:
|
|
3099
|
+
const color = chunkH74UXL4Q_js.parseDrawingColor(gs) ?? "#888888";
|
|
3100
|
+
const opacity = chunkH74UXL4Q_js.parseDrawingColorOpacity(gs);
|
|
3101
|
+
return { pos, color: chunkH74UXL4Q_js.colorWithOpacity(color, opacity) };
|
|
3136
3102
|
}).sort((a, b) => a.pos - b.pos);
|
|
3137
3103
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
3138
3104
|
const lin = gradFill["a:lin"];
|
|
3139
3105
|
if (lin) {
|
|
3140
3106
|
const angRaw = Number.parseInt(String(lin["@_ang"] || "0"), 10);
|
|
3141
|
-
const angleDeg = Math.round(
|
|
3107
|
+
const angleDeg = Math.round(chunkH74UXL4Q_js.ooxmlGradientAngleToCssDegrees(angRaw / 6e4));
|
|
3142
3108
|
return `linear-gradient(${angleDeg}deg, ${stopStrings})`;
|
|
3143
3109
|
}
|
|
3144
3110
|
const path = gradFill["a:path"];
|
|
@@ -3173,8 +3139,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
3173
3139
|
if (!pattFill) {
|
|
3174
3140
|
return void 0;
|
|
3175
3141
|
}
|
|
3176
|
-
const fgColor =
|
|
3177
|
-
const bgColor =
|
|
3142
|
+
const fgColor = chunkH74UXL4Q_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
3143
|
+
const bgColor = chunkH74UXL4Q_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
3178
3144
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
3179
3145
|
switch (preset) {
|
|
3180
3146
|
case "ltHorz":
|
|
@@ -3285,11 +3251,11 @@ function parseCellBorders(cellProperties) {
|
|
|
3285
3251
|
const prstDash = ln["a:prstDash"];
|
|
3286
3252
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
3287
3253
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
3288
|
-
const color =
|
|
3254
|
+
const color = chunkH74UXL4Q_js.parseDrawingColor(ln["a:solidFill"]);
|
|
3289
3255
|
if (color) {
|
|
3290
|
-
const opacity =
|
|
3256
|
+
const opacity = chunkH74UXL4Q_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
3291
3257
|
const key = `${edge.prefix}`;
|
|
3292
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
3258
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkH74UXL4Q_js.colorWithOpacity(color, opacity)}`;
|
|
3293
3259
|
}
|
|
3294
3260
|
}
|
|
3295
3261
|
return borderStyle;
|
|
@@ -3302,7 +3268,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3302
3268
|
const textShadowParts = [];
|
|
3303
3269
|
const outerShdw = effectLst["a:outerShdw"];
|
|
3304
3270
|
if (outerShdw) {
|
|
3305
|
-
const shdwColor =
|
|
3271
|
+
const shdwColor = chunkH74UXL4Q_js.parseDrawingColor(outerShdw);
|
|
3306
3272
|
if (shdwColor) {
|
|
3307
3273
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
3308
3274
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -3320,7 +3286,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3320
3286
|
}
|
|
3321
3287
|
const glow = effectLst["a:glow"];
|
|
3322
3288
|
if (glow) {
|
|
3323
|
-
const glowColor =
|
|
3289
|
+
const glowColor = chunkH74UXL4Q_js.parseDrawingColor(glow);
|
|
3324
3290
|
if (glowColor) {
|
|
3325
3291
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
3326
3292
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -3399,10 +3365,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3399
3365
|
if (runProps?.["@_u"] !== void 0) {
|
|
3400
3366
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
3401
3367
|
}
|
|
3402
|
-
const runColor =
|
|
3368
|
+
const runColor = chunkH74UXL4Q_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkH74UXL4Q_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
3403
3369
|
if (runColor) {
|
|
3404
|
-
const opacity =
|
|
3405
|
-
cellStyle.color =
|
|
3370
|
+
const opacity = chunkH74UXL4Q_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
3371
|
+
cellStyle.color = chunkH74UXL4Q_js.colorWithOpacity(runColor, opacity);
|
|
3406
3372
|
}
|
|
3407
3373
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
3408
3374
|
if (fontFamily) {
|
|
@@ -3412,15 +3378,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3412
3378
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
3413
3379
|
}
|
|
3414
3380
|
const cellProperties = cellXml["a:tcPr"];
|
|
3415
|
-
const cellFill =
|
|
3381
|
+
const cellFill = chunkH74UXL4Q_js.parseDrawingColor(
|
|
3416
3382
|
cellProperties?.["a:solidFill"],
|
|
3417
3383
|
schemeColorOverrides
|
|
3418
3384
|
);
|
|
3419
3385
|
if (cellFill) {
|
|
3420
|
-
const opacity =
|
|
3386
|
+
const opacity = chunkH74UXL4Q_js.parseDrawingColorOpacity(
|
|
3421
3387
|
cellProperties?.["a:solidFill"]
|
|
3422
3388
|
);
|
|
3423
|
-
cellStyle.backgroundColor =
|
|
3389
|
+
cellStyle.backgroundColor = chunkH74UXL4Q_js.colorWithOpacity(cellFill, opacity);
|
|
3424
3390
|
} else {
|
|
3425
3391
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
3426
3392
|
if (gradCss) {
|
|
@@ -3435,16 +3401,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3435
3401
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
3436
3402
|
Object.assign(cellStyle, edgeBorders);
|
|
3437
3403
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
3438
|
-
const borderColor =
|
|
3404
|
+
const borderColor = chunkH74UXL4Q_js.parseDrawingColor(
|
|
3439
3405
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
3440
3406
|
schemeColorOverrides
|
|
3441
|
-
) ||
|
|
3407
|
+
) || chunkH74UXL4Q_js.parseDrawingColor(
|
|
3442
3408
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
3443
3409
|
schemeColorOverrides
|
|
3444
|
-
) ||
|
|
3410
|
+
) || chunkH74UXL4Q_js.parseDrawingColor(
|
|
3445
3411
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
3446
3412
|
schemeColorOverrides
|
|
3447
|
-
) ||
|
|
3413
|
+
) || chunkH74UXL4Q_js.parseDrawingColor(
|
|
3448
3414
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
3449
3415
|
schemeColorOverrides
|
|
3450
3416
|
);
|
|
@@ -3523,10 +3489,10 @@ function resolveTableStyleFillColor(fill, colorScheme) {
|
|
|
3523
3489
|
}
|
|
3524
3490
|
let color = base;
|
|
3525
3491
|
if (fill.tint !== void 0 && fill.tint > 0) {
|
|
3526
|
-
color =
|
|
3492
|
+
color = chunkH74UXL4Q_js.tintColor2(color, fill.tint / 1e5);
|
|
3527
3493
|
}
|
|
3528
3494
|
if (fill.shade !== void 0 && fill.shade > 0) {
|
|
3529
|
-
color =
|
|
3495
|
+
color = chunkH74UXL4Q_js.shadeColor2(color, 1 - fill.shade / 1e5);
|
|
3530
3496
|
}
|
|
3531
3497
|
return color;
|
|
3532
3498
|
}
|
|
@@ -3551,7 +3517,7 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3551
3517
|
style.fontFamily = text.fontFace;
|
|
3552
3518
|
applied = true;
|
|
3553
3519
|
} else {
|
|
3554
|
-
const refFont =
|
|
3520
|
+
const refFont = chunkH74UXL4Q_js.resolveFontRefIdx(text.fontRefIdx, fontScheme);
|
|
3555
3521
|
if (refFont) {
|
|
3556
3522
|
style.fontFamily = refFont;
|
|
3557
3523
|
applied = true;
|
|
@@ -3562,10 +3528,10 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3562
3528
|
if (base) {
|
|
3563
3529
|
let color = base;
|
|
3564
3530
|
if (text.fontTint !== void 0 && text.fontTint > 0) {
|
|
3565
|
-
color =
|
|
3531
|
+
color = chunkH74UXL4Q_js.tintColor2(color, text.fontTint / 1e5);
|
|
3566
3532
|
}
|
|
3567
3533
|
if (text.fontShade !== void 0 && text.fontShade > 0) {
|
|
3568
|
-
color =
|
|
3534
|
+
color = chunkH74UXL4Q_js.shadeColor2(color, 1 - text.fontShade / 1e5);
|
|
3569
3535
|
}
|
|
3570
3536
|
style.color = color;
|
|
3571
3537
|
applied = true;
|
|
@@ -3754,7 +3720,7 @@ function parseTableElementData(element, fallbackTextStyle) {
|
|
|
3754
3720
|
};
|
|
3755
3721
|
}
|
|
3756
3722
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
3757
|
-
return
|
|
3723
|
+
return chunkH74UXL4Q_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
3758
3724
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
3759
3725
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
3760
3726
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -3902,9 +3868,9 @@ function cellStyleToCss(style) {
|
|
|
3902
3868
|
if (style.gradientFillCss) {
|
|
3903
3869
|
css.background = style.gradientFillCss;
|
|
3904
3870
|
} else if (style.fillMode === "pattern" && style.patternFillPreset) {
|
|
3905
|
-
const fg =
|
|
3906
|
-
const bg =
|
|
3907
|
-
const svgPattern =
|
|
3871
|
+
const fg = chunkH74UXL4Q_js.normalizeHexColor(style.patternFillForeground, "#000000");
|
|
3872
|
+
const bg = chunkH74UXL4Q_js.normalizeHexColor(style.patternFillBackground, "#ffffff");
|
|
3873
|
+
const svgPattern = chunkH74UXL4Q_js.getPatternSvg(style.patternFillPreset, fg, bg);
|
|
3908
3874
|
if (svgPattern) {
|
|
3909
3875
|
const encoded = encodeURIComponent(svgPattern);
|
|
3910
3876
|
css.backgroundImage = `url("data:image/svg+xml,${encoded}")`;
|
|
@@ -3980,7 +3946,7 @@ function cellStyleToCss(style) {
|
|
|
3980
3946
|
if (edge.width || edge.color) {
|
|
3981
3947
|
const w = edge.width ?? 1;
|
|
3982
3948
|
const c = edge.color ?? style.borderColor ?? "#000000";
|
|
3983
|
-
const s =
|
|
3949
|
+
const s = chunkH74UXL4Q_js.ooxmlDashToCssBorderStyle(edge.dash);
|
|
3984
3950
|
css[edge.prefix] = `${w}px ${s} ${c}`;
|
|
3985
3951
|
}
|
|
3986
3952
|
}
|
|
@@ -4011,7 +3977,7 @@ function cellStyleToCss(style) {
|
|
|
4011
3977
|
css.textShadow = textShadowParts.join(", ");
|
|
4012
3978
|
}
|
|
4013
3979
|
if (style.cell3D) {
|
|
4014
|
-
Object.assign(css,
|
|
3980
|
+
Object.assign(css, chunkH74UXL4Q_js.cell3DBevelCss(style.cell3D));
|
|
4015
3981
|
}
|
|
4016
3982
|
return css;
|
|
4017
3983
|
}
|
|
@@ -4025,7 +3991,7 @@ function TableResizeOverlay({
|
|
|
4025
3991
|
const containerRef = React6.useRef(null);
|
|
4026
3992
|
const [rowBounds, setRowBounds] = React6.useState([]);
|
|
4027
3993
|
const dragRef = React6.useRef(null);
|
|
4028
|
-
const colBoundaries = React6.useMemo(() =>
|
|
3994
|
+
const colBoundaries = React6.useMemo(() => chunkH74UXL4Q_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
4029
3995
|
const measureRows = React6.useCallback(() => {
|
|
4030
3996
|
const container = containerRef.current;
|
|
4031
3997
|
if (!container) {
|
|
@@ -4072,11 +4038,11 @@ function TableResizeOverlay({
|
|
|
4072
4038
|
const rect = containerRef.current.getBoundingClientRect();
|
|
4073
4039
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
4074
4040
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
4075
|
-
onResizeColumns(
|
|
4041
|
+
onResizeColumns(chunkH74UXL4Q_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
4076
4042
|
} else if (drag.type === "row" && onResizeRow) {
|
|
4077
4043
|
const deltaY = e.clientY - drag.startPos;
|
|
4078
|
-
const newHeight =
|
|
4079
|
-
drag.initialRowHeight ??
|
|
4044
|
+
const newHeight = chunkH74UXL4Q_js.computeResizedRowHeight(
|
|
4045
|
+
drag.initialRowHeight ?? chunkH74UXL4Q_js.DEFAULT_ROW_HEIGHT,
|
|
4080
4046
|
deltaY
|
|
4081
4047
|
);
|
|
4082
4048
|
onResizeRow(drag.index, newHeight);
|
|
@@ -4114,7 +4080,7 @@ function TableResizeOverlay({
|
|
|
4114
4080
|
e.stopPropagation();
|
|
4115
4081
|
const table = containerRef.current?.querySelector("table");
|
|
4116
4082
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
4117
|
-
const actualHeight = tr?.offsetHeight ??
|
|
4083
|
+
const actualHeight = tr?.offsetHeight ?? chunkH74UXL4Q_js.DEFAULT_ROW_HEIGHT;
|
|
4118
4084
|
document.body.style.cursor = "row-resize";
|
|
4119
4085
|
document.body.style.userSelect = "none";
|
|
4120
4086
|
dragRef.current = {
|
|
@@ -4162,7 +4128,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4162
4128
|
}
|
|
4163
4129
|
const first = selectedCell.selectedCells[0];
|
|
4164
4130
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4165
|
-
return
|
|
4131
|
+
return chunkH74UXL4Q_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
4166
4132
|
})();
|
|
4167
4133
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4168
4134
|
TableResizeOverlay,
|
|
@@ -4195,7 +4161,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4195
4161
|
return null;
|
|
4196
4162
|
}
|
|
4197
4163
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
4198
|
-
const isInMultiSelection =
|
|
4164
|
+
const isInMultiSelection = chunkH74UXL4Q_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
4199
4165
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
4200
4166
|
const diag = getCellDiagonalBorders2(
|
|
4201
4167
|
cell.style,
|
|
@@ -4225,7 +4191,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4225
4191
|
}
|
|
4226
4192
|
event.stopPropagation();
|
|
4227
4193
|
if (event.shiftKey && selectedCell) {
|
|
4228
|
-
const rect =
|
|
4194
|
+
const rect = chunkH74UXL4Q_js.computeSelectionRect(
|
|
4229
4195
|
selectedCell.rowIndex,
|
|
4230
4196
|
selectedCell.columnIndex,
|
|
4231
4197
|
rowIndex,
|
|
@@ -4235,7 +4201,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4235
4201
|
options?.onSelectCell?.({
|
|
4236
4202
|
rowIndex: selectedCell.rowIndex,
|
|
4237
4203
|
columnIndex: selectedCell.columnIndex,
|
|
4238
|
-
selectedCells:
|
|
4204
|
+
selectedCells: chunkH74UXL4Q_js.rectToCells(rect)
|
|
4239
4205
|
});
|
|
4240
4206
|
} else {
|
|
4241
4207
|
options?.onSelectCell?.({
|
|
@@ -4297,7 +4263,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4297
4263
|
if (tableEl2.tableData && tableEl2.tableData.rows.length > 0) {
|
|
4298
4264
|
return renderTableFromTableData(tableEl2, textStyle, options);
|
|
4299
4265
|
}
|
|
4300
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
4266
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkMMK4K3QI_js.translationsEn["pptx.table.title"] });
|
|
4301
4267
|
}
|
|
4302
4268
|
const selectedCell = options?.selectedCell || null;
|
|
4303
4269
|
const isEditable = Boolean(options?.editable);
|
|
@@ -4312,7 +4278,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4312
4278
|
}
|
|
4313
4279
|
const first = selectedCell.selectedCells[0];
|
|
4314
4280
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4315
|
-
return
|
|
4281
|
+
return chunkH74UXL4Q_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
4316
4282
|
})();
|
|
4317
4283
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
4318
4284
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4389,7 +4355,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4389
4355
|
"border px-1 py-0.5 align-top",
|
|
4390
4356
|
isEditable && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
4391
4357
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
4392
|
-
|
|
4358
|
+
chunkH74UXL4Q_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
4393
4359
|
),
|
|
4394
4360
|
colSpan,
|
|
4395
4361
|
rowSpan: rSpan,
|
|
@@ -4400,7 +4366,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4400
4366
|
}
|
|
4401
4367
|
event.stopPropagation();
|
|
4402
4368
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
4403
|
-
const rect =
|
|
4369
|
+
const rect = chunkH74UXL4Q_js.computeSelectionRect(
|
|
4404
4370
|
selectedCell.rowIndex,
|
|
4405
4371
|
selectedCell.columnIndex,
|
|
4406
4372
|
rowIndex,
|
|
@@ -4410,7 +4376,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4410
4376
|
options?.onSelectCell?.({
|
|
4411
4377
|
rowIndex: selectedCell.rowIndex,
|
|
4412
4378
|
columnIndex: selectedCell.columnIndex,
|
|
4413
|
-
selectedCells:
|
|
4379
|
+
selectedCells: chunkH74UXL4Q_js.rectToCells(rect)
|
|
4414
4380
|
});
|
|
4415
4381
|
} else {
|
|
4416
4382
|
options?.onSelectCell?.({
|
|
@@ -4465,24 +4431,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4465
4431
|
}
|
|
4466
4432
|
var LEGEND_ITEM_WIDTH = 80;
|
|
4467
4433
|
function partAttrs(part) {
|
|
4468
|
-
return part ?
|
|
4434
|
+
return part ? chunkH74UXL4Q_js.chartPartToAttrs(part) : void 0;
|
|
4469
4435
|
}
|
|
4470
4436
|
function resolveReactPalette(chartData) {
|
|
4471
4437
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
4472
4438
|
return chartData.colorPalette;
|
|
4473
4439
|
}
|
|
4474
|
-
return [...
|
|
4440
|
+
return [...chunkH74UXL4Q_js.getChartStylePalette(chartData.style?.styleId)];
|
|
4475
4441
|
}
|
|
4476
4442
|
function buildReactChartViewModel(element) {
|
|
4477
4443
|
if (element.type !== "chart" || !element.chartData) {
|
|
4478
|
-
return
|
|
4444
|
+
return chunkH74UXL4Q_js.buildChartViewModel(element);
|
|
4479
4445
|
}
|
|
4480
4446
|
const palette = resolveReactPalette(element.chartData);
|
|
4481
4447
|
const themedElement = {
|
|
4482
4448
|
...element,
|
|
4483
4449
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
4484
4450
|
};
|
|
4485
|
-
return
|
|
4451
|
+
return chunkH74UXL4Q_js.buildChartViewModel(themedElement);
|
|
4486
4452
|
}
|
|
4487
4453
|
function renderPrimitive(prim, key) {
|
|
4488
4454
|
switch (prim.kind) {
|
|
@@ -4871,7 +4837,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4871
4837
|
const unmatchedRows = [];
|
|
4872
4838
|
categories.forEach((cat, i) => {
|
|
4873
4839
|
const value = values[i] ?? 0;
|
|
4874
|
-
const code =
|
|
4840
|
+
const code = chunkH74UXL4Q_js.resolveRegionCode(cat);
|
|
4875
4841
|
if (code) {
|
|
4876
4842
|
regionValueMap.set(code, { value, label: cat });
|
|
4877
4843
|
} else {
|
|
@@ -4909,8 +4875,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4909
4875
|
let fill = "#e2e8f0";
|
|
4910
4876
|
let dataLabel = null;
|
|
4911
4877
|
if (entry) {
|
|
4912
|
-
const t =
|
|
4913
|
-
fill =
|
|
4878
|
+
const t = chunkH74UXL4Q_js.normalizeValue(entry.value, minVal, maxVal);
|
|
4879
|
+
fill = chunkH74UXL4Q_js.sequentialColorScale(t);
|
|
4914
4880
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
4915
4881
|
"text",
|
|
4916
4882
|
{
|
|
@@ -4921,7 +4887,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4921
4887
|
fontWeight: 600,
|
|
4922
4888
|
fill: "#1e293b",
|
|
4923
4889
|
style: { pointerEvents: "none" },
|
|
4924
|
-
children:
|
|
4890
|
+
children: chunkH74UXL4Q_js.formatAxisValue(entry.value)
|
|
4925
4891
|
},
|
|
4926
4892
|
`${element.id}-map-dl-${region.code}`
|
|
4927
4893
|
);
|
|
@@ -4939,7 +4905,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4939
4905
|
opacity: 0.9,
|
|
4940
4906
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
4941
4907
|
region.name,
|
|
4942
|
-
entry ? `: ${
|
|
4908
|
+
entry ? `: ${chunkH74UXL4Q_js.formatAxisValue(entry.value)}` : ""
|
|
4943
4909
|
] })
|
|
4944
4910
|
}
|
|
4945
4911
|
),
|
|
@@ -4977,7 +4943,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4977
4943
|
fontSize: 7,
|
|
4978
4944
|
fill: "#64748b",
|
|
4979
4945
|
textAnchor: "middle",
|
|
4980
|
-
children:
|
|
4946
|
+
children: chunkH74UXL4Q_js.formatAxisValue(minVal)
|
|
4981
4947
|
},
|
|
4982
4948
|
`${element.id}-map-legend-min`
|
|
4983
4949
|
),
|
|
@@ -4989,7 +4955,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4989
4955
|
fontSize: 7,
|
|
4990
4956
|
fill: "#64748b",
|
|
4991
4957
|
textAnchor: "middle",
|
|
4992
|
-
children:
|
|
4958
|
+
children: chunkH74UXL4Q_js.formatAxisValue(maxVal)
|
|
4993
4959
|
},
|
|
4994
4960
|
`${element.id}-map-legend-max`
|
|
4995
4961
|
)
|
|
@@ -5008,7 +4974,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
5008
4974
|
textAnchor: "middle",
|
|
5009
4975
|
fontSize: 7,
|
|
5010
4976
|
fill: "#94a3b8",
|
|
5011
|
-
children:
|
|
4977
|
+
children: chunkMMK4K3QI_js.translationsEn["pptx.chart.additionalRegionsFallback"]
|
|
5012
4978
|
},
|
|
5013
4979
|
`${element.id}-map-ft-hdr`
|
|
5014
4980
|
)
|
|
@@ -5055,7 +5021,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
5055
5021
|
y,
|
|
5056
5022
|
fontSize,
|
|
5057
5023
|
fill: "#475569",
|
|
5058
|
-
children:
|
|
5024
|
+
children: chunkH74UXL4Q_js.formatAxisValue(row.value)
|
|
5059
5025
|
},
|
|
5060
5026
|
`${element.id}-map-ft-val-${i}`
|
|
5061
5027
|
)
|
|
@@ -5126,7 +5092,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
5126
5092
|
|
|
5127
5093
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
5128
5094
|
function sColor(series, idx) {
|
|
5129
|
-
return
|
|
5095
|
+
return chunkH74UXL4Q_js.seriesColor(series, idx);
|
|
5130
5096
|
}
|
|
5131
5097
|
function valToY(val, range, topY, bottomY) {
|
|
5132
5098
|
const usable = bottomY - topY;
|
|
@@ -5665,7 +5631,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5665
5631
|
width: 10,
|
|
5666
5632
|
height: 10,
|
|
5667
5633
|
rx: 2,
|
|
5668
|
-
fill:
|
|
5634
|
+
fill: chunkH74UXL4Q_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5669
5635
|
},
|
|
5670
5636
|
`${id}-leg-r-${i}`
|
|
5671
5637
|
)
|
|
@@ -5689,7 +5655,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5689
5655
|
width: 10,
|
|
5690
5656
|
height: 10,
|
|
5691
5657
|
rx: 2,
|
|
5692
|
-
fill:
|
|
5658
|
+
fill: chunkH74UXL4Q_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5693
5659
|
}
|
|
5694
5660
|
),
|
|
5695
5661
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -5702,9 +5668,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5702
5668
|
}
|
|
5703
5669
|
const lines = [];
|
|
5704
5670
|
if (range.logScale && range.logBase) {
|
|
5705
|
-
const ticks =
|
|
5671
|
+
const ticks = chunkH74UXL4Q_js.generateLogTicks(range);
|
|
5706
5672
|
ticks.forEach((tickVal, i) => {
|
|
5707
|
-
const y =
|
|
5673
|
+
const y = chunkH74UXL4Q_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5708
5674
|
lines.push(
|
|
5709
5675
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5710
5676
|
"line",
|
|
@@ -5725,7 +5691,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5725
5691
|
const steps = 4;
|
|
5726
5692
|
for (let i = 0; i <= steps; i++) {
|
|
5727
5693
|
const val = range.min + range.span * i / steps;
|
|
5728
|
-
const y =
|
|
5694
|
+
const y = chunkH74UXL4Q_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5729
5695
|
lines.push(
|
|
5730
5696
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5731
5697
|
"line",
|
|
@@ -5749,9 +5715,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5749
5715
|
const labels = [];
|
|
5750
5716
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5751
5717
|
if (range.logScale && range.logBase) {
|
|
5752
|
-
const ticks =
|
|
5718
|
+
const ticks = chunkH74UXL4Q_js.generateLogTicks(range);
|
|
5753
5719
|
ticks.forEach((tickVal, i) => {
|
|
5754
|
-
const y =
|
|
5720
|
+
const y = chunkH74UXL4Q_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5755
5721
|
labels.push(
|
|
5756
5722
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5757
5723
|
"text",
|
|
@@ -5761,7 +5727,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5761
5727
|
textAnchor: "end",
|
|
5762
5728
|
fontSize: 8,
|
|
5763
5729
|
fill: "#64748b",
|
|
5764
|
-
children: hasDisplayUnits ?
|
|
5730
|
+
children: hasDisplayUnits ? chunkH74UXL4Q_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunkH74UXL4Q_js.formatAxisValue(tickVal)
|
|
5765
5731
|
},
|
|
5766
5732
|
`${id}-vaxis-log-${i}`
|
|
5767
5733
|
)
|
|
@@ -5771,7 +5737,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5771
5737
|
const steps = 4;
|
|
5772
5738
|
for (let i = 0; i <= steps; i++) {
|
|
5773
5739
|
const val = range.min + range.span * i / steps;
|
|
5774
|
-
const y =
|
|
5740
|
+
const y = chunkH74UXL4Q_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5775
5741
|
labels.push(
|
|
5776
5742
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5777
5743
|
"text",
|
|
@@ -5781,7 +5747,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5781
5747
|
textAnchor: "end",
|
|
5782
5748
|
fontSize: 8,
|
|
5783
5749
|
fill: "#64748b",
|
|
5784
|
-
children: hasDisplayUnits ?
|
|
5750
|
+
children: hasDisplayUnits ? chunkH74UXL4Q_js.formatAxisValueWithUnits(val, axisFormatting) : chunkH74UXL4Q_js.formatAxisValue(val)
|
|
5785
5751
|
},
|
|
5786
5752
|
`${id}-vaxis-${i}`
|
|
5787
5753
|
)
|
|
@@ -5789,7 +5755,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5789
5755
|
}
|
|
5790
5756
|
}
|
|
5791
5757
|
if (hasDisplayUnits) {
|
|
5792
|
-
const unitLabel =
|
|
5758
|
+
const unitLabel = chunkH74UXL4Q_js.getDisplayUnitLabel(
|
|
5793
5759
|
axisFormatting.displayUnits,
|
|
5794
5760
|
axisFormatting.displayUnitsLabel
|
|
5795
5761
|
);
|
|
@@ -5864,7 +5830,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
5864
5830
|
if (range.min >= 0) {
|
|
5865
5831
|
return null;
|
|
5866
5832
|
}
|
|
5867
|
-
const y =
|
|
5833
|
+
const y = chunkH74UXL4Q_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
5868
5834
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5869
5835
|
"line",
|
|
5870
5836
|
{
|
|
@@ -5888,7 +5854,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5888
5854
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5889
5855
|
for (let i = 0; i <= steps; i++) {
|
|
5890
5856
|
const val = range.min + range.span * i / steps;
|
|
5891
|
-
const y =
|
|
5857
|
+
const y = chunkH74UXL4Q_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5892
5858
|
labels.push(
|
|
5893
5859
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5894
5860
|
"text",
|
|
@@ -5900,7 +5866,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5900
5866
|
fontFamily,
|
|
5901
5867
|
fontWeight,
|
|
5902
5868
|
fill: fontColor,
|
|
5903
|
-
children: hasDisplayUnits ?
|
|
5869
|
+
children: hasDisplayUnits ? chunkH74UXL4Q_js.formatAxisValueWithUnits(val, axisFormatting) : chunkH74UXL4Q_js.formatAxisValue(val)
|
|
5904
5870
|
},
|
|
5905
5871
|
`${id}-sec-vaxis-${i}`
|
|
5906
5872
|
)
|
|
@@ -5924,7 +5890,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5924
5890
|
);
|
|
5925
5891
|
}
|
|
5926
5892
|
if (hasDisplayUnits) {
|
|
5927
|
-
const unitLabel =
|
|
5893
|
+
const unitLabel = chunkH74UXL4Q_js.getDisplayUnitLabel(
|
|
5928
5894
|
axisFormatting.displayUnits,
|
|
5929
5895
|
axisFormatting.displayUnitsLabel
|
|
5930
5896
|
);
|
|
@@ -5955,7 +5921,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
5955
5921
|
const ticks = [];
|
|
5956
5922
|
for (let i = 0; i <= steps; i++) {
|
|
5957
5923
|
const val = range.min + range.span * i / steps;
|
|
5958
|
-
const y =
|
|
5924
|
+
const y = chunkH74UXL4Q_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5959
5925
|
ticks.push(
|
|
5960
5926
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5961
5927
|
"line",
|
|
@@ -5982,7 +5948,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
5982
5948
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
5983
5949
|
for (let i = 0; i <= steps; i++) {
|
|
5984
5950
|
const val = range.min + range.span * i / steps;
|
|
5985
|
-
const y =
|
|
5951
|
+
const y = chunkH74UXL4Q_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5986
5952
|
lines.push(
|
|
5987
5953
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5988
5954
|
"line",
|
|
@@ -6100,7 +6066,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6100
6066
|
showK && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6101
6067
|
"th",
|
|
6102
6068
|
{
|
|
6103
|
-
"aria-label":
|
|
6069
|
+
"aria-label": chunkMMK4K3QI_js.translationsEn["pptx.chart.rowLabelsAria"],
|
|
6104
6070
|
style: {
|
|
6105
6071
|
padding: "1px 4px",
|
|
6106
6072
|
fontWeight: 400,
|
|
@@ -6144,7 +6110,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6144
6110
|
width: 8,
|
|
6145
6111
|
height: 8,
|
|
6146
6112
|
borderRadius: 2,
|
|
6147
|
-
backgroundColor:
|
|
6113
|
+
backgroundColor: chunkH74UXL4Q_js.seriesColor(
|
|
6148
6114
|
s,
|
|
6149
6115
|
si,
|
|
6150
6116
|
chartData.style?.styleId,
|
|
@@ -6183,8 +6149,8 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6183
6149
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
6184
6150
|
const style = chartData.style;
|
|
6185
6151
|
const legendPos = style?.legendPosition || "b";
|
|
6186
|
-
const range =
|
|
6187
|
-
const layout =
|
|
6152
|
+
const range = chunkH74UXL4Q_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6153
|
+
const layout = chunkH74UXL4Q_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6188
6154
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6189
6155
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
6190
6156
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -6205,10 +6171,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6205
6171
|
const close = closeSeries.values[ci] ?? high;
|
|
6206
6172
|
const isUp = close >= open;
|
|
6207
6173
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
6208
|
-
const highY =
|
|
6209
|
-
const lowY =
|
|
6210
|
-
const openY =
|
|
6211
|
-
const closeY =
|
|
6174
|
+
const highY = chunkH74UXL4Q_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
6175
|
+
const lowY = chunkH74UXL4Q_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
6176
|
+
const openY = chunkH74UXL4Q_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
6177
|
+
const closeY = chunkH74UXL4Q_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
|
|
6212
6178
|
elements.push(
|
|
6213
6179
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6214
6180
|
"line",
|
|
@@ -6251,7 +6217,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6251
6217
|
textAnchor: "middle",
|
|
6252
6218
|
fontSize: 7,
|
|
6253
6219
|
fill: "#334155",
|
|
6254
|
-
children:
|
|
6220
|
+
children: chunkH74UXL4Q_js.formatAxisValue(close)
|
|
6255
6221
|
},
|
|
6256
6222
|
`${element.id}-stock-dl-${ci}`
|
|
6257
6223
|
)
|
|
@@ -6293,7 +6259,7 @@ function FailedToLoad() {
|
|
|
6293
6259
|
var LazySurfaceChart3DScene = React6__default.default.lazy(
|
|
6294
6260
|
async () => {
|
|
6295
6261
|
try {
|
|
6296
|
-
return await import('./SurfaceChart3DScene-
|
|
6262
|
+
return await import('./SurfaceChart3DScene-KPNP3QD5.js');
|
|
6297
6263
|
} catch {
|
|
6298
6264
|
return { default: FailedToLoad };
|
|
6299
6265
|
}
|
|
@@ -6317,7 +6283,7 @@ var SurfaceChart3DErrorBoundary = class extends React6__default.default.Componen
|
|
|
6317
6283
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
6318
6284
|
const rows = chartData.series.length;
|
|
6319
6285
|
const cols = Math.max(categoryLabels.length, 1);
|
|
6320
|
-
const range =
|
|
6286
|
+
const range = chunkH74UXL4Q_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6321
6287
|
const heightMap = new Float32Array(rows * cols);
|
|
6322
6288
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
6323
6289
|
for (let r = 0; r < rows; r++) {
|
|
@@ -6437,8 +6403,8 @@ function darkenRgb(r, g, b, factor) {
|
|
|
6437
6403
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
6438
6404
|
const style = chartData.style;
|
|
6439
6405
|
const legendPos = style?.legendPosition || "b";
|
|
6440
|
-
const layout =
|
|
6441
|
-
const range =
|
|
6406
|
+
const layout = chunkH74UXL4Q_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6407
|
+
const range = chunkH74UXL4Q_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6442
6408
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6443
6409
|
const seriesCount = chartData.series.length;
|
|
6444
6410
|
const cols = catCount - 1;
|
|
@@ -6528,8 +6494,8 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6528
6494
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
6529
6495
|
const style = chartData.style;
|
|
6530
6496
|
const legendPos = style?.legendPosition || "b";
|
|
6531
|
-
const layout =
|
|
6532
|
-
const range =
|
|
6497
|
+
const layout = chunkH74UXL4Q_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6498
|
+
const range = chunkH74UXL4Q_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6533
6499
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6534
6500
|
const seriesCount = chartData.series.length;
|
|
6535
6501
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -6592,7 +6558,7 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6592
6558
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
6593
6559
|
const style = chartData.style;
|
|
6594
6560
|
const legendPos = style?.legendPosition || "b";
|
|
6595
|
-
const layout =
|
|
6561
|
+
const layout = chunkH74UXL4Q_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6596
6562
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
6597
6563
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
6598
6564
|
const rects = [];
|
|
@@ -6615,7 +6581,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
6615
6581
|
y: curY,
|
|
6616
6582
|
width: Math.max(w - 1, 1),
|
|
6617
6583
|
height: Math.max(h - 1, 1),
|
|
6618
|
-
fill:
|
|
6584
|
+
fill: chunkH74UXL4Q_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
6619
6585
|
rx: 2,
|
|
6620
6586
|
opacity: 0.85
|
|
6621
6587
|
},
|
|
@@ -6668,8 +6634,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6668
6634
|
const style = chartData.style;
|
|
6669
6635
|
const legendPos = style?.legendPosition || "b";
|
|
6670
6636
|
const values = chartData.series[0]?.values ?? [];
|
|
6671
|
-
const range =
|
|
6672
|
-
const layout =
|
|
6637
|
+
const range = chunkH74UXL4Q_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6638
|
+
const layout = chunkH74UXL4Q_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6673
6639
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
6674
6640
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
6675
6641
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -6680,8 +6646,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6680
6646
|
const isLast = i === values.length - 1;
|
|
6681
6647
|
const startVal = isLast ? 0 : runningTotal;
|
|
6682
6648
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
6683
|
-
const barStartY =
|
|
6684
|
-
const barEndY =
|
|
6649
|
+
const barStartY = chunkH74UXL4Q_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
6650
|
+
const barEndY = chunkH74UXL4Q_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
|
|
6685
6651
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
6686
6652
|
const y = Math.min(barStartY, barEndY);
|
|
6687
6653
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -6710,7 +6676,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6710
6676
|
textAnchor: "middle",
|
|
6711
6677
|
fontSize: 7,
|
|
6712
6678
|
fill: "#334155",
|
|
6713
|
-
children:
|
|
6679
|
+
children: chunkH74UXL4Q_js.formatAxisValue(isLast ? endVal : val)
|
|
6714
6680
|
},
|
|
6715
6681
|
`${element.id}-wf-dl-${i}`
|
|
6716
6682
|
)
|
|
@@ -6758,18 +6724,18 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6758
6724
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
6759
6725
|
const style = chartData.style;
|
|
6760
6726
|
const legendPos = style?.legendPosition || "b";
|
|
6761
|
-
const layoutOpts =
|
|
6727
|
+
const layoutOpts = chunkH74UXL4Q_js.computeLayoutOptions(
|
|
6762
6728
|
chartData.axes,
|
|
6763
6729
|
chartData.dataTable,
|
|
6764
6730
|
chartData.series.length
|
|
6765
6731
|
);
|
|
6766
|
-
const layout =
|
|
6767
|
-
const { primary, secondary } =
|
|
6732
|
+
const layout = chunkH74UXL4Q_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
6733
|
+
const { primary, secondary } = chunkH74UXL4Q_js.splitSeriesByAxis(chartData.series, chartData.axes);
|
|
6768
6734
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
6769
6735
|
const secondarySeries = secondary.map((e) => e.series);
|
|
6770
|
-
const range =
|
|
6771
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
6772
|
-
const secondaryAxisFmt =
|
|
6736
|
+
const range = chunkH74UXL4Q_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
6737
|
+
const secondaryRange = secondarySeries.length > 0 ? chunkH74UXL4Q_js.computeValueRange(secondarySeries) : void 0;
|
|
6738
|
+
const secondaryAxisFmt = chunkH74UXL4Q_js.getSecondaryValueAxis(chartData.axes);
|
|
6773
6739
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6774
6740
|
const barSeriesCount = 1;
|
|
6775
6741
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -6785,8 +6751,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6785
6751
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
6786
6752
|
barSeries.values.forEach((val, vi) => {
|
|
6787
6753
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
6788
|
-
const zeroY =
|
|
6789
|
-
const valY =
|
|
6754
|
+
const zeroY = chunkH74UXL4Q_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
6755
|
+
const valY = chunkH74UXL4Q_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
|
|
6790
6756
|
const y = Math.min(zeroY, valY);
|
|
6791
6757
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
6792
6758
|
barElements.push(
|
|
@@ -6797,7 +6763,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6797
6763
|
y,
|
|
6798
6764
|
width: barWidth,
|
|
6799
6765
|
height: h,
|
|
6800
|
-
fill:
|
|
6766
|
+
fill: chunkH74UXL4Q_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
6801
6767
|
rx: 1
|
|
6802
6768
|
},
|
|
6803
6769
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -6813,7 +6779,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6813
6779
|
textAnchor: "middle",
|
|
6814
6780
|
fontSize: 7,
|
|
6815
6781
|
fill: "#334155",
|
|
6816
|
-
children:
|
|
6782
|
+
children: chunkH74UXL4Q_js.formatAxisValue(val)
|
|
6817
6783
|
},
|
|
6818
6784
|
`${element.id}-combo-bar-dl-${vi}`
|
|
6819
6785
|
)
|
|
@@ -6830,10 +6796,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6830
6796
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
6831
6797
|
const points = series.values.map((val, vi) => {
|
|
6832
6798
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
6833
|
-
const y =
|
|
6799
|
+
const y = chunkH74UXL4Q_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
6834
6800
|
return { x, y, val };
|
|
6835
6801
|
});
|
|
6836
|
-
const c =
|
|
6802
|
+
const c = chunkH74UXL4Q_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
6837
6803
|
lineElements.push(
|
|
6838
6804
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6839
6805
|
"polyline",
|
|
@@ -6860,7 +6826,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6860
6826
|
textAnchor: "middle",
|
|
6861
6827
|
fontSize: 7,
|
|
6862
6828
|
fill: "#334155",
|
|
6863
|
-
children:
|
|
6829
|
+
children: chunkH74UXL4Q_js.formatAxisValue(p.val)
|
|
6864
6830
|
},
|
|
6865
6831
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
6866
6832
|
)
|
|
@@ -6898,11 +6864,11 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6898
6864
|
}
|
|
6899
6865
|
function renderChartElement(element) {
|
|
6900
6866
|
if (element.type !== "chart") {
|
|
6901
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
6867
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkMMK4K3QI_js.translationsEn["pptx.chart.heading"] });
|
|
6902
6868
|
}
|
|
6903
6869
|
const chartData = element.chartData;
|
|
6904
6870
|
if (!chartData || chartData.series.length === 0) {
|
|
6905
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
6871
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkMMK4K3QI_js.translationsEn["pptx.chart.heading"] });
|
|
6906
6872
|
}
|
|
6907
6873
|
const longestSeriesLength = chartData.series.reduce(
|
|
6908
6874
|
(maxLength, series) => Math.max(maxLength, series.values.length),
|
|
@@ -8006,14 +7972,14 @@ function buildNotesPdf(pages) {
|
|
|
8006
7972
|
notes: page.notes,
|
|
8007
7973
|
slideNumber: page.slideNumber
|
|
8008
7974
|
}));
|
|
8009
|
-
const bytes =
|
|
7975
|
+
const bytes = chunkH74UXL4Q_js.buildNotesPdfBytes(images, meta);
|
|
8010
7976
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
8011
7977
|
return URL.createObjectURL(blob);
|
|
8012
7978
|
}
|
|
8013
7979
|
|
|
8014
7980
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
8015
7981
|
function buildPdfFromImageData(images) {
|
|
8016
|
-
const bytes =
|
|
7982
|
+
const bytes = chunkH74UXL4Q_js.buildSlidesPdfBytes(images);
|
|
8017
7983
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
8018
7984
|
return URL.createObjectURL(blob);
|
|
8019
7985
|
}
|
|
@@ -8022,7 +7988,7 @@ function buildPdfFromImageData(images) {
|
|
|
8022
7988
|
var activePreview = null;
|
|
8023
7989
|
function startPreviewAnimation(elementId, preset, options) {
|
|
8024
7990
|
stopPreviewAnimation();
|
|
8025
|
-
const descriptor =
|
|
7991
|
+
const descriptor = chunkH74UXL4Q_js.buildPreviewAnimation(preset, options);
|
|
8026
7992
|
if (!descriptor) {
|
|
8027
7993
|
return;
|
|
8028
7994
|
}
|
|
@@ -8070,6 +8036,8 @@ function stopPreviewAnimation() {
|
|
|
8070
8036
|
}
|
|
8071
8037
|
|
|
8072
8038
|
exports.ANIMATION_PRESET_OPTIONS = ANIMATION_PRESET_OPTIONS;
|
|
8039
|
+
exports.ARROW_SIZE_OPTIONS = ARROW_SIZE_OPTIONS;
|
|
8040
|
+
exports.CONNECTOR_ARROW_OPTIONS = CONNECTOR_ARROW_OPTIONS;
|
|
8073
8041
|
exports.DEFAULT_CANVAS_HEIGHT = DEFAULT_CANVAS_HEIGHT;
|
|
8074
8042
|
exports.DEFAULT_CANVAS_WIDTH = DEFAULT_CANVAS_WIDTH;
|
|
8075
8043
|
exports.DEFAULT_FILL_COLOR = DEFAULT_FILL_COLOR;
|
|
@@ -8082,14 +8050,13 @@ exports.DEFAULT_TEXT_FONT_SIZE = DEFAULT_TEXT_FONT_SIZE;
|
|
|
8082
8050
|
exports.EMU_PER_PX = EMU_PER_PX;
|
|
8083
8051
|
exports.GRID_SIZE = GRID_SIZE;
|
|
8084
8052
|
exports.HYPERLINK_COLOR = HYPERLINK_COLOR;
|
|
8085
|
-
exports.MAX_ZOOM_SCALE = MAX_ZOOM_SCALE;
|
|
8086
8053
|
exports.MIN_ELEMENT_SIZE = MIN_ELEMENT_SIZE;
|
|
8087
|
-
exports.MIN_ZOOM_SCALE = MIN_ZOOM_SCALE;
|
|
8088
8054
|
exports.SHAPE_PRESETS = SHAPE_PRESETS;
|
|
8089
8055
|
exports.SHORTCUT_REFERENCE_ITEMS = SHORTCUT_REFERENCE_ITEMS;
|
|
8090
8056
|
exports.SLIDE_NAV_THUMBNAIL_WIDTH = SLIDE_NAV_THUMBNAIL_WIDTH;
|
|
8091
|
-
exports.
|
|
8057
|
+
exports.STROKE_DASH_OPTIONS = STROKE_DASH_OPTIONS;
|
|
8092
8058
|
exports.SmartArtNodeText = SmartArtNodeText;
|
|
8059
|
+
exports.THEME_COLOR_SWATCHES = THEME_COLOR_SWATCHES;
|
|
8093
8060
|
exports.TOOLBAR_SECTIONS = TOOLBAR_SECTIONS;
|
|
8094
8061
|
exports.UNGROUPED_SECTION_ID = UNGROUPED_SECTION_ID;
|
|
8095
8062
|
exports.ZOOM_TO_SELECTION_PADDING = ZOOM_TO_SELECTION_PADDING;
|