pptx-react-viewer 2.17.0 → 2.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/README.md +14 -14
- package/dist/{AiChatPanel-RZ4A7P4H.mjs → AiChatPanel-SSSBERWJ.mjs} +4 -4
- package/dist/AiChatPanel-SSSBERWJ.mjs.br +0 -0
- package/dist/AiChatPanel-SSSBERWJ.mjs.gz +0 -0
- package/dist/{AiChatPanel-HCHCVQN2.js → AiChatPanel-UN5DHPZY.js} +24 -24
- package/dist/AiChatPanel-UN5DHPZY.js.br +0 -0
- package/dist/AiChatPanel-UN5DHPZY.js.gz +0 -0
- package/dist/{Model3DScene-LK7LSQNH.js → Model3DScene-4RPYKC2I.js} +2 -2
- package/dist/Model3DScene-4RPYKC2I.js.br +0 -0
- package/dist/Model3DScene-4RPYKC2I.js.gz +0 -0
- package/dist/{Model3DScene-I7FR74AD.mjs → Model3DScene-LYEESYAI.mjs} +1 -1
- package/dist/Model3DScene-LYEESYAI.mjs.br +0 -0
- package/dist/Model3DScene-LYEESYAI.mjs.gz +0 -0
- package/dist/{PowerPointViewer-Du7u4INi.d.ts → PowerPointViewer-Cf4YHjdF.d.ts} +2 -2
- package/dist/{PowerPointViewer-Du7u4INi.d.ts.map → PowerPointViewer-Cf4YHjdF.d.ts.map} +1 -1
- package/dist/{SurfaceChart3DScene-ODQY77SZ.js → SurfaceChart3DScene-ACPKCWLJ.js} +2 -2
- package/dist/SurfaceChart3DScene-ACPKCWLJ.js.br +0 -0
- package/dist/SurfaceChart3DScene-ACPKCWLJ.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-DEQP5O3U.mjs → SurfaceChart3DScene-JR62SOYO.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-DEQP5O3U.mjs.br → SurfaceChart3DScene-JR62SOYO.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-JR62SOYO.mjs.gz +0 -0
- package/dist/{audience-content-store-BvqKy7Hf.d.ts → audience-content-store-CyS0oP6t.d.ts} +2 -2
- package/dist/{audience-content-store-BvqKy7Hf.d.ts.map → audience-content-store-CyS0oP6t.d.ts.map} +1 -1
- package/dist/{chunk-5BXATG54.js → chunk-4LWGAVAP.js} +239 -293
- package/dist/chunk-4LWGAVAP.js.br +0 -0
- package/dist/chunk-4LWGAVAP.js.gz +0 -0
- package/dist/{chunk-FXJOTEPO.mjs → chunk-7XF6S4AM.mjs} +1 -1
- package/dist/chunk-7XF6S4AM.mjs.br +0 -0
- package/dist/chunk-7XF6S4AM.mjs.gz +0 -0
- package/dist/{chunk-TCGXGD6E.js → chunk-ASKYZ5ZY.js} +544 -426
- package/dist/chunk-ASKYZ5ZY.js.br +0 -0
- package/dist/chunk-ASKYZ5ZY.js.gz +0 -0
- package/dist/{chunk-MQHC5TXI.mjs → chunk-BZOL6FXF.mjs} +25 -80
- package/dist/chunk-BZOL6FXF.mjs.br +0 -0
- package/dist/chunk-BZOL6FXF.mjs.gz +0 -0
- package/dist/{chunk-K2QU73KB.mjs → chunk-GODW6RNR.mjs} +9801 -6455
- package/dist/chunk-GODW6RNR.mjs.br +0 -0
- package/dist/chunk-GODW6RNR.mjs.gz +0 -0
- package/dist/{chunk-NQJPPIVH.js → chunk-ICZDMFF2.js} +1444 -1131
- package/dist/chunk-ICZDMFF2.js.br +0 -0
- package/dist/chunk-ICZDMFF2.js.gz +0 -0
- package/dist/{chunk-ATOUVRRQ.js → chunk-MAVLV56S.js} +3 -3
- package/dist/chunk-MAVLV56S.js.br +0 -0
- package/dist/chunk-MAVLV56S.js.gz +0 -0
- package/dist/{chunk-422DF424.mjs → chunk-O7FTUUXP.mjs} +464 -151
- package/dist/chunk-O7FTUUXP.mjs.br +0 -0
- package/dist/chunk-O7FTUUXP.mjs.gz +0 -0
- package/dist/{chunk-ZA5JONCW.mjs → chunk-QUB5OSKY.mjs} +193 -75
- package/dist/chunk-QUB5OSKY.mjs.br +0 -0
- package/dist/chunk-QUB5OSKY.mjs.gz +0 -0
- package/dist/{chunk-AONFHTTJ.js → chunk-RTUGI4HQ.js} +27 -4
- package/dist/chunk-RTUGI4HQ.js.br +0 -0
- package/dist/chunk-RTUGI4HQ.js.gz +0 -0
- package/dist/{chunk-S64T7C4V.mjs → chunk-SNL6LBRX.mjs} +27 -4
- package/dist/chunk-SNL6LBRX.mjs.br +0 -0
- package/dist/{chunk-S64T7C4V.mjs.gz → chunk-SNL6LBRX.mjs.gz} +0 -0
- package/dist/{chunk-7JPLVECA.js → chunk-WVDM36ZM.js} +9838 -6458
- package/dist/chunk-WVDM36ZM.js.br +0 -0
- package/dist/chunk-WVDM36ZM.js.gz +0 -0
- package/dist/i18n.js +4 -4
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.d.ts +497 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +65 -41
- 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 +543 -32
- 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/{types-DU35aAJK.d.ts → types-C_CTI-QE.d.ts} +3 -31
- package/dist/types-C_CTI-QE.d.ts.map +1 -0
- package/dist/{useViewerBuildingBlocks-C9-prKYB.d.ts → useViewerBuildingBlocks-DItilDbP.d.ts} +16 -3
- package/dist/useViewerBuildingBlocks-DItilDbP.d.ts.map +1 -0
- package/dist/viewer/index.d.ts +427 -39
- package/dist/viewer/index.js +27 -27
- 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 +2 -2
- package/dist/AiChatPanel-HCHCVQN2.js.br +0 -0
- package/dist/AiChatPanel-HCHCVQN2.js.gz +0 -0
- package/dist/AiChatPanel-RZ4A7P4H.mjs.br +0 -0
- package/dist/AiChatPanel-RZ4A7P4H.mjs.gz +0 -0
- package/dist/Model3DScene-I7FR74AD.mjs.br +0 -0
- package/dist/Model3DScene-I7FR74AD.mjs.gz +0 -0
- package/dist/Model3DScene-LK7LSQNH.js.br +0 -0
- package/dist/Model3DScene-LK7LSQNH.js.gz +0 -0
- package/dist/SurfaceChart3DScene-DEQP5O3U.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-ODQY77SZ.js.br +0 -0
- package/dist/SurfaceChart3DScene-ODQY77SZ.js.gz +0 -0
- package/dist/chunk-422DF424.mjs.br +0 -0
- package/dist/chunk-422DF424.mjs.gz +0 -0
- package/dist/chunk-5BXATG54.js.br +0 -0
- package/dist/chunk-5BXATG54.js.gz +0 -0
- package/dist/chunk-7JPLVECA.js.br +0 -0
- package/dist/chunk-7JPLVECA.js.gz +0 -0
- package/dist/chunk-AONFHTTJ.js.br +0 -0
- package/dist/chunk-AONFHTTJ.js.gz +0 -0
- package/dist/chunk-ATOUVRRQ.js.br +0 -0
- package/dist/chunk-ATOUVRRQ.js.gz +0 -0
- package/dist/chunk-FXJOTEPO.mjs.br +0 -0
- package/dist/chunk-FXJOTEPO.mjs.gz +0 -0
- package/dist/chunk-K2QU73KB.mjs.br +0 -0
- package/dist/chunk-K2QU73KB.mjs.gz +0 -0
- package/dist/chunk-MQHC5TXI.mjs.br +0 -0
- package/dist/chunk-MQHC5TXI.mjs.gz +0 -0
- package/dist/chunk-NQJPPIVH.js.br +0 -0
- package/dist/chunk-NQJPPIVH.js.gz +0 -0
- package/dist/chunk-S64T7C4V.mjs.br +0 -0
- package/dist/chunk-TCGXGD6E.js.br +0 -0
- package/dist/chunk-TCGXGD6E.js.gz +0 -0
- package/dist/chunk-ZA5JONCW.mjs.br +0 -0
- package/dist/chunk-ZA5JONCW.mjs.gz +0 -0
- package/dist/types-DU35aAJK.d.ts.map +0 -1
- package/dist/useViewerBuildingBlocks-C9-prKYB.d.ts.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkRTUGI4HQ_js = require('./chunk-RTUGI4HQ.js');
|
|
4
|
+
var chunkWVDM36ZM_js = require('./chunk-WVDM36ZM.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 chunkWVDM36ZM_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 chunkWVDM36ZM_js.cloneHistorySnapshot(snapshot);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
// src/viewer/constants/scalar.ts
|
|
@@ -44,6 +44,7 @@ var ZOOM_TO_SELECTION_PADDING = 96;
|
|
|
44
44
|
var GRID_SIZE = 8;
|
|
45
45
|
var SLIDE_NAV_THUMBNAIL_WIDTH = 156;
|
|
46
46
|
var UNGROUPED_SECTION_ID = "__ungrouped__";
|
|
47
|
+
var DEFAULT_SECTION_GROUP_ID = "default";
|
|
47
48
|
|
|
48
49
|
// src/viewer/constants/toolbar.ts
|
|
49
50
|
var TOOLBAR_SECTIONS = [
|
|
@@ -60,7 +61,7 @@ var TOOLBAR_SECTIONS = [
|
|
|
60
61
|
{ id: "view", labelKey: "pptx.ribbon.tab.view" },
|
|
61
62
|
{ id: "help", labelKey: "pptx.ribbon.tab.help" }
|
|
62
63
|
];
|
|
63
|
-
var SHORTCUT_REFERENCE_ITEMS =
|
|
64
|
+
var SHORTCUT_REFERENCE_ITEMS = chunkWVDM36ZM_js.VIEWER_SHORTCUT_REFERENCE;
|
|
64
65
|
|
|
65
66
|
// src/viewer/constants/theme.ts
|
|
66
67
|
var THEME_COLOR_SWATCHES = [
|
|
@@ -104,7 +105,7 @@ var GLYPH_COMPONENTS = {
|
|
|
104
105
|
plus: lu.LuPlus,
|
|
105
106
|
triangle: lu.LuTriangle
|
|
106
107
|
};
|
|
107
|
-
var SHAPE_PRESETS =
|
|
108
|
+
var SHAPE_PRESETS = chunkWVDM36ZM_js.SHAPE_PRESET_DEFS.map(
|
|
108
109
|
(def) => ({
|
|
109
110
|
type: def.type,
|
|
110
111
|
label: def.label,
|
|
@@ -263,7 +264,7 @@ function isConnectorOrLineElement(element) {
|
|
|
263
264
|
if (element.type === "connector") {
|
|
264
265
|
return true;
|
|
265
266
|
}
|
|
266
|
-
if (!
|
|
267
|
+
if (!chunkWVDM36ZM_js.hasShapeProperties(element)) {
|
|
267
268
|
return false;
|
|
268
269
|
}
|
|
269
270
|
const st = getShapeType(element.shapeType);
|
|
@@ -272,7 +273,7 @@ function isConnectorOrLineElement(element) {
|
|
|
272
273
|
|
|
273
274
|
// src/viewer/utils/image-style.ts
|
|
274
275
|
function getImageMaskStyle(element) {
|
|
275
|
-
if (!
|
|
276
|
+
if (!chunkWVDM36ZM_js.hasShapeProperties(element)) {
|
|
276
277
|
return void 0;
|
|
277
278
|
}
|
|
278
279
|
const shapeType = element.shapeType;
|
|
@@ -281,7 +282,7 @@ function getImageMaskStyle(element) {
|
|
|
281
282
|
}
|
|
282
283
|
const normalized = shapeType.toLowerCase();
|
|
283
284
|
if (normalized === "roundrect" || normalized === "round1rect" || normalized === "round2samerect" || normalized === "round2diagrect" || normalized === "sniproundrect" || normalized === "snip1rect" || normalized === "snip2diagrect") {
|
|
284
|
-
const radiusPx =
|
|
285
|
+
const radiusPx = chunkWVDM36ZM_js.getRoundRectRadiusPx2(element);
|
|
285
286
|
if (radiusPx <= 0.01) {
|
|
286
287
|
return void 0;
|
|
287
288
|
}
|
|
@@ -293,7 +294,7 @@ function getImageMaskStyle(element) {
|
|
|
293
294
|
if (normalized === "can" || normalized === "cylinder") {
|
|
294
295
|
return { borderRadius: "48% / 12%" };
|
|
295
296
|
}
|
|
296
|
-
const clipPath =
|
|
297
|
+
const clipPath = chunkWVDM36ZM_js.getResolvedShapeClipPath(element);
|
|
297
298
|
if (!clipPath) {
|
|
298
299
|
return void 0;
|
|
299
300
|
}
|
|
@@ -302,7 +303,7 @@ function getImageMaskStyle(element) {
|
|
|
302
303
|
function getImageRenderStyle(element) {
|
|
303
304
|
return {
|
|
304
305
|
...getImageMaskStyle(element) || {},
|
|
305
|
-
...
|
|
306
|
+
...chunkWVDM36ZM_js.getImageFitStyle(element)
|
|
306
307
|
};
|
|
307
308
|
}
|
|
308
309
|
var CROP_SHAPE_CLIP_PATHS = {
|
|
@@ -315,7 +316,7 @@ var CROP_SHAPE_CLIP_PATHS = {
|
|
|
315
316
|
star: "polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)"
|
|
316
317
|
};
|
|
317
318
|
function getCropShapeClipPath(element) {
|
|
318
|
-
if (!
|
|
319
|
+
if (!chunkWVDM36ZM_js.isImageLikeElement(element)) {
|
|
319
320
|
return void 0;
|
|
320
321
|
}
|
|
321
322
|
const shape = element.cropShape;
|
|
@@ -325,7 +326,7 @@ function getCropShapeClipPath(element) {
|
|
|
325
326
|
return CROP_SHAPE_CLIP_PATHS[shape];
|
|
326
327
|
}
|
|
327
328
|
function getImageTilingStyle2(element) {
|
|
328
|
-
return
|
|
329
|
+
return chunkWVDM36ZM_js.getImageTilingStyle(element);
|
|
329
330
|
}
|
|
330
331
|
|
|
331
332
|
// src/viewer/utils/geometry-image.ts
|
|
@@ -525,9 +526,9 @@ function registerMediaElement(elementId, el) {
|
|
|
525
526
|
};
|
|
526
527
|
}
|
|
527
528
|
function executeMediaCommand(command, frameRoot) {
|
|
528
|
-
return
|
|
529
|
+
return chunkWVDM36ZM_js.runMediaCommand(
|
|
529
530
|
command,
|
|
530
|
-
(targetId) => registry.get(targetId) ??
|
|
531
|
+
(targetId) => registry.get(targetId) ?? chunkWVDM36ZM_js.findMediaElementByElementId(targetId, frameRoot?.())
|
|
531
532
|
);
|
|
532
533
|
}
|
|
533
534
|
function PresentationMediaController({
|
|
@@ -571,7 +572,7 @@ function PresentationMediaController({
|
|
|
571
572
|
loop: shouldLoop,
|
|
572
573
|
volume: playbackVolume,
|
|
573
574
|
playbackRate
|
|
574
|
-
} =
|
|
575
|
+
} = chunkWVDM36ZM_js.mediaPlaybackAttributes({
|
|
575
576
|
loop: element.loop,
|
|
576
577
|
volume: element.volume,
|
|
577
578
|
playbackSpeed: element.playbackSpeed
|
|
@@ -707,7 +708,7 @@ function PresentationMediaController({
|
|
|
707
708
|
if (element.playAcrossSlides && element.mediaType === "audio") {
|
|
708
709
|
const dataUrl = element.mediaData ?? resolvedDataUrl;
|
|
709
710
|
if (dataUrl) {
|
|
710
|
-
|
|
711
|
+
chunkWVDM36ZM_js.registerPersistentAudio(
|
|
711
712
|
element.id,
|
|
712
713
|
dataUrl,
|
|
713
714
|
element.mediaMimeType,
|
|
@@ -769,7 +770,7 @@ function PresentationMediaController({
|
|
|
769
770
|
] });
|
|
770
771
|
}
|
|
771
772
|
function label(key) {
|
|
772
|
-
return key === void 0 ? void 0 :
|
|
773
|
+
return key === void 0 ? void 0 : chunkRTUGI4HQ_js.translationsEn[key];
|
|
773
774
|
}
|
|
774
775
|
function FallbackIcon({
|
|
775
776
|
paths,
|
|
@@ -805,17 +806,17 @@ function Badge({
|
|
|
805
806
|
"div",
|
|
806
807
|
{
|
|
807
808
|
className: `absolute inset-0 flex flex-col items-center justify-center ${isMissing ? "gap-1" : ""}`,
|
|
808
|
-
...{ [
|
|
809
|
+
...{ [chunkWVDM36ZM_js.MEDIA_CHROME_ATTRIBUTE]: visual.badge },
|
|
809
810
|
children: [
|
|
810
811
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
811
812
|
FallbackIcon,
|
|
812
813
|
{
|
|
813
|
-
paths:
|
|
814
|
+
paths: chunkWVDM36ZM_js.mediaFallbackIcon(visual, element.mediaType),
|
|
814
815
|
size: isMissing ? 32 : 48,
|
|
815
816
|
className: isMissing ? "text-white/60" : "text-white/80 drop-shadow-md"
|
|
816
817
|
}
|
|
817
818
|
),
|
|
818
|
-
isMissing && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: label(
|
|
819
|
+
isMissing && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: label(chunkWVDM36ZM_js.mediaFallbackLabelKey(visual, element.mediaType)) })
|
|
819
820
|
]
|
|
820
821
|
}
|
|
821
822
|
);
|
|
@@ -832,17 +833,17 @@ function Placeholder({
|
|
|
832
833
|
"div",
|
|
833
834
|
{
|
|
834
835
|
className: `w-full h-full flex flex-col items-center justify-center gap-1 pointer-events-none rounded ${isMissing ? "bg-black/30 border border-dashed border-white/20" : element.mediaType === "audio" ? "bg-black/10" : "bg-black/20"}`,
|
|
835
|
-
...{ [
|
|
836
|
+
...{ [chunkWVDM36ZM_js.MEDIA_CHROME_ATTRIBUTE]: visual.placeholder },
|
|
836
837
|
children: [
|
|
837
838
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
838
839
|
FallbackIcon,
|
|
839
840
|
{
|
|
840
|
-
paths:
|
|
841
|
+
paths: chunkWVDM36ZM_js.mediaFallbackIcon(visual, element.mediaType),
|
|
841
842
|
size: isMissing ? 36 : element.mediaType === "audio" ? 24 : 32,
|
|
842
843
|
className: isMissing ? "text-white/50" : "text-white/70"
|
|
843
844
|
}
|
|
844
845
|
),
|
|
845
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `text-[10px] ${isMissing ? "text-white/50" : "text-white/70"}`, children: label(
|
|
846
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `text-[10px] ${isMissing ? "text-white/50" : "text-white/70"}`, children: label(chunkWVDM36ZM_js.mediaFallbackLabelKey(visual, element.mediaType)) })
|
|
846
847
|
]
|
|
847
848
|
}
|
|
848
849
|
);
|
|
@@ -852,7 +853,7 @@ function renderMediaFallback({
|
|
|
852
853
|
posterUrl,
|
|
853
854
|
surface
|
|
854
855
|
}) {
|
|
855
|
-
const visual =
|
|
856
|
+
const visual = chunkWVDM36ZM_js.mediaFallbackVisual(surface, {
|
|
856
857
|
hasPoster: Boolean(posterUrl),
|
|
857
858
|
missing: element.mediaMissing === true
|
|
858
859
|
});
|
|
@@ -862,7 +863,7 @@ function renderMediaFallback({
|
|
|
862
863
|
"img",
|
|
863
864
|
{
|
|
864
865
|
src: posterUrl,
|
|
865
|
-
alt: visual.dimPoster ?
|
|
866
|
+
alt: visual.dimPoster ? chunkRTUGI4HQ_js.translationsEn["pptx.media.posterAlt"] : chunkRTUGI4HQ_js.translationsEn["pptx.media.videoPosterAlt"],
|
|
866
867
|
className: `w-full h-full object-contain${visual.dimPoster ? " opacity-50" : ""}`
|
|
867
868
|
}
|
|
868
869
|
),
|
|
@@ -873,7 +874,7 @@ function renderMediaFallback({
|
|
|
873
874
|
}
|
|
874
875
|
function renderMediaElement(element, mediaDataUrls, options) {
|
|
875
876
|
if (element.type !== "media") {
|
|
876
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
877
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkRTUGI4HQ_js.translationsEn["pptx.media.title"] });
|
|
877
878
|
}
|
|
878
879
|
const mediaType = element.mediaType;
|
|
879
880
|
const mediaPath = element.mediaPath;
|
|
@@ -881,7 +882,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
881
882
|
const dataUrl = element.mediaData ?? (mediaPath ? mediaDataUrls.get(mediaPath) : void 0);
|
|
882
883
|
const trimFragment = buildTrimFragment(element);
|
|
883
884
|
const posterUrl = element.posterFrameData ?? void 0;
|
|
884
|
-
const shouldLoop =
|
|
885
|
+
const shouldLoop = chunkWVDM36ZM_js.mediaPlaybackAttributes(element).loop;
|
|
885
886
|
const shouldAutoPlay = options?.autoPlay === true || element.autoPlay === true;
|
|
886
887
|
const isFullScreen = options?.fullScreen === true;
|
|
887
888
|
const isPresentationMode = options?.isPresentationMode === true;
|
|
@@ -959,86 +960,33 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
959
960
|
if (surface.presenting || surface.preview) {
|
|
960
961
|
return null;
|
|
961
962
|
}
|
|
962
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
963
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkRTUGI4HQ_js.translationsEn["pptx.media.title"] });
|
|
963
964
|
}
|
|
964
965
|
|
|
965
966
|
// src/viewer/utils/text-utils.tsx
|
|
966
967
|
function getTextStyleForElement(element, fallbackColor) {
|
|
967
|
-
return
|
|
968
|
+
return chunkWVDM36ZM_js.buildTextBlockStyle(element, { fallbackColor });
|
|
968
969
|
}
|
|
969
970
|
|
|
970
971
|
// src/viewer/utils/text-layout.tsx
|
|
971
|
-
function computeTabSize(tabStops, defaultTabSize) {
|
|
972
|
-
const fromDefault = typeof defaultTabSize === "number" && defaultTabSize > 0 ? `${Math.round(defaultTabSize)}px` : void 0;
|
|
973
|
-
if (!tabStops || tabStops.length === 0) {
|
|
974
|
-
return fromDefault;
|
|
975
|
-
}
|
|
976
|
-
if (tabStops.length === 1) {
|
|
977
|
-
const pos = tabStops[0].position;
|
|
978
|
-
return typeof pos === "number" && pos > 0 ? `${Math.round(pos)}px` : fromDefault;
|
|
979
|
-
}
|
|
980
|
-
const positions = tabStops.map((t) => t.position).filter((p) => typeof p === "number" && p > 0).sort((a, b) => a - b);
|
|
981
|
-
if (positions.length < 2) {
|
|
982
|
-
return positions.length === 1 ? `${Math.round(positions[0])}px` : fromDefault;
|
|
983
|
-
}
|
|
984
|
-
let totalGap = 0;
|
|
985
|
-
for (let i = 1; i < positions.length; i++) {
|
|
986
|
-
totalGap += positions[i] - positions[i - 1];
|
|
987
|
-
}
|
|
988
|
-
const avgGap = totalGap / (positions.length - 1);
|
|
989
|
-
return avgGap > 0 ? `${Math.round(avgGap)}px` : fromDefault;
|
|
990
|
-
}
|
|
991
972
|
function getTextLayoutStyle(element) {
|
|
992
|
-
if (!
|
|
973
|
+
if (!chunkWVDM36ZM_js.hasTextProperties(element)) {
|
|
993
974
|
return {};
|
|
994
975
|
}
|
|
995
|
-
const
|
|
996
|
-
const
|
|
997
|
-
const
|
|
998
|
-
const verticalDirection = chunk7JPLVECA_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
999
|
-
const parsedColumnCount = Number(element.textStyle?.columnCount);
|
|
1000
|
-
const columnCount = Number.isFinite(parsedColumnCount) ? Math.max(1, Math.min(16, Math.round(parsedColumnCount))) : 1;
|
|
1001
|
-
const hasColumns = columnCount > 1;
|
|
1002
|
-
const justifyContent = verticalAlign === "middle" ? "center" : verticalAlign === "bottom" ? "flex-end" : "flex-start";
|
|
1003
|
-
const tabStops = element.textStyle?.tabStops;
|
|
1004
|
-
const tabSize = computeTabSize(tabStops, element.textStyle?.defaultTabSize);
|
|
976
|
+
const writingMode = chunkWVDM36ZM_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
977
|
+
const textOrientation = chunkWVDM36ZM_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
978
|
+
const verticalDirection = chunkWVDM36ZM_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
1005
979
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
1006
|
-
const hasParagraphIndents =
|
|
980
|
+
const hasParagraphIndents = chunkWVDM36ZM_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
1007
981
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
1008
982
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
1009
983
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
1010
984
|
const textIndent = !hasParagraphIndents && typeof paragraphIndent === "number" && paragraphIndent !== 0 ? paragraphIndent : void 0;
|
|
1011
985
|
const bodyTop = element.textStyle?.bodyInsetTop ?? DEFAULT_BODY_INSET_TB_PX;
|
|
1012
986
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
1013
|
-
const parsedColumnSpacing = Number(element.textStyle?.columnSpacing);
|
|
1014
|
-
const columnGap = Number.isFinite(parsedColumnSpacing) && parsedColumnSpacing > 0 ? `${parsedColumnSpacing}px` : "0.75em";
|
|
1015
|
-
const kinsokuStyles = chunk7JPLVECA_js.getKinsokuLineBreakStyles(element.textStyle);
|
|
1016
|
-
if (hasColumns) {
|
|
1017
|
-
return {
|
|
1018
|
-
display: "block",
|
|
1019
|
-
columnCount,
|
|
1020
|
-
columnGap,
|
|
1021
|
-
// Body inset only. Paragraph spacing (spcBef/spcAft) is applied
|
|
1022
|
-
// per-paragraph by the paragraph renderer, not collapsed here.
|
|
1023
|
-
paddingTop: bodyTop,
|
|
1024
|
-
paddingBottom: bodyBottom,
|
|
1025
|
-
writingMode,
|
|
1026
|
-
textOrientation,
|
|
1027
|
-
direction: verticalDirection,
|
|
1028
|
-
tabSize,
|
|
1029
|
-
marginLeft,
|
|
1030
|
-
textIndent,
|
|
1031
|
-
...kinsokuStyles,
|
|
1032
|
-
...textWrapNone ? {
|
|
1033
|
-
whiteSpace: "nowrap",
|
|
1034
|
-
overflow: "visible"
|
|
1035
|
-
} : {}
|
|
1036
|
-
};
|
|
1037
|
-
}
|
|
1038
987
|
return {
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
justifyContent,
|
|
988
|
+
// Columns / flex anchoring / anchorCtr / tab-size / kinsoku, from shared.
|
|
989
|
+
...chunkWVDM36ZM_js.buildTextBodyLayoutStyle(element),
|
|
1042
990
|
// Body inset only. Paragraph spacing (spcBef/spcAft) is applied
|
|
1043
991
|
// per-paragraph by the paragraph renderer, not collapsed here.
|
|
1044
992
|
paddingTop: bodyTop,
|
|
@@ -1046,10 +994,8 @@ function getTextLayoutStyle(element) {
|
|
|
1046
994
|
writingMode,
|
|
1047
995
|
textOrientation,
|
|
1048
996
|
direction: verticalDirection,
|
|
1049
|
-
tabSize,
|
|
1050
997
|
marginLeft,
|
|
1051
998
|
textIndent,
|
|
1052
|
-
...kinsokuStyles,
|
|
1053
999
|
...textWrapNone ? {
|
|
1054
1000
|
whiteSpace: "nowrap",
|
|
1055
1001
|
overflow: "visible"
|
|
@@ -1059,7 +1005,7 @@ function getTextLayoutStyle(element) {
|
|
|
1059
1005
|
|
|
1060
1006
|
// src/viewer/utils/text-effects.tsx
|
|
1061
1007
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
1062
|
-
return
|
|
1008
|
+
return chunkWVDM36ZM_js.buildTextBody3DSceneStyle(textStyle);
|
|
1063
1009
|
}
|
|
1064
1010
|
|
|
1065
1011
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -1244,13 +1190,13 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1244
1190
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
1245
1191
|
return renderedSegments;
|
|
1246
1192
|
}
|
|
1247
|
-
const paraKey = `${elementId}${
|
|
1193
|
+
const paraKey = `${elementId}${chunkWVDM36ZM_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
1248
1194
|
const paraState = subElementAnimStates.get(paraKey);
|
|
1249
1195
|
if (paraState) {
|
|
1250
1196
|
const style = buildAnimStyle(paraState);
|
|
1251
1197
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
1252
1198
|
}
|
|
1253
|
-
const spec =
|
|
1199
|
+
const spec = chunkWVDM36ZM_js.buildTextBuildSpec(
|
|
1254
1200
|
elementId,
|
|
1255
1201
|
paraIndex,
|
|
1256
1202
|
paraRuns.map((run) => ({ text: run.text, style: run })),
|
|
@@ -1268,7 +1214,7 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1268
1214
|
"span",
|
|
1269
1215
|
{
|
|
1270
1216
|
"data-anim-id": span.animId,
|
|
1271
|
-
style:
|
|
1217
|
+
style: chunkWVDM36ZM_js.textBuildSpanStyle(span),
|
|
1272
1218
|
children: content
|
|
1273
1219
|
},
|
|
1274
1220
|
span.animId
|
|
@@ -1412,10 +1358,10 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1412
1358
|
if (!needsScriptFonts || !text) {
|
|
1413
1359
|
return text;
|
|
1414
1360
|
}
|
|
1415
|
-
const runs =
|
|
1361
|
+
const runs = chunkWVDM36ZM_js.segmentByScript(text);
|
|
1416
1362
|
if (runs.length <= 1) {
|
|
1417
1363
|
if (runs.length === 1) {
|
|
1418
|
-
const font =
|
|
1364
|
+
const font = chunkWVDM36ZM_js.resolveFontForScript(runs[0].script, scriptFonts);
|
|
1419
1365
|
if (font && font !== baseFontFamily) {
|
|
1420
1366
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: text });
|
|
1421
1367
|
}
|
|
@@ -1423,7 +1369,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1423
1369
|
return text;
|
|
1424
1370
|
}
|
|
1425
1371
|
return runs.map((run, i) => {
|
|
1426
|
-
const font =
|
|
1372
|
+
const font = chunkWVDM36ZM_js.resolveFontForScript(run.script, scriptFonts);
|
|
1427
1373
|
if (!font || font === baseFontFamily) {
|
|
1428
1374
|
return /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Fragment, { children: run.text }, `${keyPrefix}-r${i}`);
|
|
1429
1375
|
}
|
|
@@ -1434,14 +1380,14 @@ function renderMetricPieces(text, metric, keyPrefix, inner) {
|
|
|
1434
1380
|
if (!metric || !text) {
|
|
1435
1381
|
return inner(text, keyPrefix);
|
|
1436
1382
|
}
|
|
1437
|
-
const pieces =
|
|
1383
|
+
const pieces = chunkWVDM36ZM_js.splitRunForMetrics(text, metric.font);
|
|
1438
1384
|
if (pieces.length <= 1) {
|
|
1439
1385
|
return inner(text, keyPrefix);
|
|
1440
1386
|
}
|
|
1441
1387
|
return pieces.map((piece, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1442
1388
|
"span",
|
|
1443
1389
|
{
|
|
1444
|
-
style: { letterSpacing:
|
|
1390
|
+
style: { letterSpacing: chunkWVDM36ZM_js.pieceLetterSpacing(metric.authoredPx, piece.tracking) },
|
|
1445
1391
|
children: inner(piece.text, `${keyPrefix}-w${i}`)
|
|
1446
1392
|
},
|
|
1447
1393
|
`${keyPrefix}-w${i}`
|
|
@@ -1512,8 +1458,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1512
1458
|
});
|
|
1513
1459
|
}
|
|
1514
1460
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
1515
|
-
const mathml =
|
|
1516
|
-
const safeMathml = mathml ?
|
|
1461
|
+
const mathml = chunkWVDM36ZM_js.convertOmmlToMathMl(equationXml);
|
|
1462
|
+
const safeMathml = mathml ? chunkWVDM36ZM_js.sanitizeMathMl(mathml) : "";
|
|
1517
1463
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1518
1464
|
"span",
|
|
1519
1465
|
{
|
|
@@ -1523,7 +1469,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1523
1469
|
},
|
|
1524
1470
|
dangerouslySetInnerHTML: { __html: safeMathml }
|
|
1525
1471
|
}
|
|
1526
|
-
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children:
|
|
1472
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children: chunkRTUGI4HQ_js.translationsEn["pptx.textSegment.equationFallback"] });
|
|
1527
1473
|
if (equationNumber) {
|
|
1528
1474
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1529
1475
|
"span",
|
|
@@ -1573,7 +1519,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1573
1519
|
const segmentStyle = segment?.style ?? {};
|
|
1574
1520
|
const textValue = run.text;
|
|
1575
1521
|
const lines = textValue.split("\n");
|
|
1576
|
-
const resolvedSegmentColor =
|
|
1522
|
+
const resolvedSegmentColor = chunkWVDM36ZM_js.normalizeHexColor(
|
|
1577
1523
|
segmentStyle.color || element.textStyle?.color,
|
|
1578
1524
|
run.hyperlink ? HYPERLINK_COLOR : fallbackColor
|
|
1579
1525
|
);
|
|
@@ -1581,16 +1527,16 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1581
1527
|
const baselineFraction = rawBaseline === 0 ? 0 : Math.abs(rawBaseline) >= 1e3 ? rawBaseline / 1e5 : rawBaseline / 100;
|
|
1582
1528
|
const baselineFontScale = baselineFraction !== 0 ? BASELINE_FONT_SCALE : 1;
|
|
1583
1529
|
const rawFontSize = segmentStyle.fontSize || element.textStyle?.fontSize || DEFAULT_TEXT_FONT_SIZE;
|
|
1584
|
-
const baseFontSize = rawFontSize *
|
|
1530
|
+
const baseFontSize = rawFontSize * chunkWVDM36ZM_js.resolveAutoFitFontScale(element.textStyle);
|
|
1585
1531
|
const baselineShift = baselineFraction !== 0 ? `${baselineFraction * baseFontSize}px` : void 0;
|
|
1586
1532
|
const baseFontSizePt = baseFontSize * (72 / 96);
|
|
1587
1533
|
const fontKerning = typeof segmentStyle.kerning === "number" ? segmentStyle.kerning === 0 ? "none" : baseFontSizePt >= segmentStyle.kerning / 100 ? "normal" : "none" : void 0;
|
|
1588
1534
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
1589
|
-
const baseFontFamily = rawFontFamily ?
|
|
1535
|
+
const baseFontFamily = rawFontFamily ? chunkWVDM36ZM_js.getSubstituteFontFamily(
|
|
1590
1536
|
rawFontFamily,
|
|
1591
|
-
|
|
1537
|
+
chunkWVDM36ZM_js.parsePanoseString(segmentStyle.latinFontPanose ?? element.textStyle?.latinFontPanose)
|
|
1592
1538
|
) : DEFAULT_FONT_FAMILY2;
|
|
1593
|
-
const scriptFont = (name, panose) => name ?
|
|
1539
|
+
const scriptFont = (name, panose) => name ? chunkWVDM36ZM_js.getSubstituteFontFamily(name, chunkWVDM36ZM_js.parsePanoseString(panose)) : baseFontFamily;
|
|
1594
1540
|
const scriptFonts = {
|
|
1595
1541
|
latin: baseFontFamily,
|
|
1596
1542
|
eastAsia: scriptFont(
|
|
@@ -1606,7 +1552,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1606
1552
|
segmentStyle.symbolFontPanose ?? element.textStyle?.symbolFontPanose
|
|
1607
1553
|
)
|
|
1608
1554
|
};
|
|
1609
|
-
const needsScriptFonts =
|
|
1555
|
+
const needsScriptFonts = chunkWVDM36ZM_js.hasDistinctScriptFonts(scriptFonts);
|
|
1610
1556
|
const authoredLetterSpacing = typeof segmentStyle.characterSpacing === "number" && segmentStyle.characterSpacing !== 0 ? segmentStyle.characterSpacing / 100 * (96 / 72) : 0;
|
|
1611
1557
|
const metricFont = {
|
|
1612
1558
|
fontFamily: baseFontFamily,
|
|
@@ -1621,9 +1567,9 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1621
1567
|
spanStyle.fontFamily = baseFontFamily;
|
|
1622
1568
|
spanStyle.verticalAlign = baselineShift;
|
|
1623
1569
|
spanStyle.fontKerning = fontKerning;
|
|
1624
|
-
spanStyle.letterSpacing =
|
|
1570
|
+
spanStyle.letterSpacing = chunkWVDM36ZM_js.pieceLetterSpacing(
|
|
1625
1571
|
authoredLetterSpacing,
|
|
1626
|
-
|
|
1572
|
+
chunkWVDM36ZM_js.resolveMetricTrackingPx(textValue, metricFont)
|
|
1627
1573
|
);
|
|
1628
1574
|
const runRtl = segmentStyle.rtl;
|
|
1629
1575
|
if (runRtl !== void 0) {
|
|
@@ -1649,26 +1595,17 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1649
1595
|
),
|
|
1650
1596
|
metricContext
|
|
1651
1597
|
);
|
|
1652
|
-
const spanNode = /* @__PURE__ */ jsxRuntime.jsx("span", { "data-seg-idx": segmentIndex, style: spanStyle, children: renderRubyOrText(
|
|
1598
|
+
const spanNode = /* @__PURE__ */ jsxRuntime.jsx("span", { "data-seg-idx": segmentIndex, style: spanStyle, children: renderRubyOrText(run, baseContent) }, key);
|
|
1653
1599
|
return run.hyperlink && onHyperlinkClick ? renderHyperlink(run, spanNode, key, ctx) : spanNode;
|
|
1654
1600
|
}
|
|
1655
|
-
function renderRubyOrText(
|
|
1656
|
-
|
|
1657
|
-
if (typeof rubyText !== "string" || rubyText.length === 0) {
|
|
1601
|
+
function renderRubyOrText(run, baseContent) {
|
|
1602
|
+
if (!run.ruby) {
|
|
1658
1603
|
return baseContent;
|
|
1659
1604
|
}
|
|
1660
|
-
const rubyStyle = {
|
|
1661
|
-
fontSize: segment?.rubyFontSize ?? baseFontSize * 0.5,
|
|
1662
|
-
fontFamily: segment?.rubyStyle?.fontFamily ?? baseFontFamily,
|
|
1663
|
-
textAlign: segment?.rubyAlignment === "l" ? "left" : segment?.rubyAlignment === "r" ? "right" : segment?.rubyAlignment === "dist" || segment?.rubyAlignment === "distCat" || segment?.rubyAlignment === "distLetter" ? "justify" : "center"
|
|
1664
|
-
};
|
|
1665
|
-
if (segment?.rubyStyle?.color) {
|
|
1666
|
-
rubyStyle.color = chunk7JPLVECA_js.normalizeHexColor(segment.rubyStyle.color, resolvedColor);
|
|
1667
|
-
}
|
|
1668
1605
|
return /* @__PURE__ */ jsxRuntime.jsxs("ruby", { children: [
|
|
1669
1606
|
baseContent,
|
|
1670
1607
|
/* @__PURE__ */ jsxRuntime.jsx("rp", { children: "(" }),
|
|
1671
|
-
/* @__PURE__ */ jsxRuntime.jsx("rt", { style:
|
|
1608
|
+
/* @__PURE__ */ jsxRuntime.jsx("rt", { style: run.ruby.style, children: run.ruby.text }),
|
|
1672
1609
|
/* @__PURE__ */ jsxRuntime.jsx("rp", { children: ")" })
|
|
1673
1610
|
] });
|
|
1674
1611
|
}
|
|
@@ -1724,7 +1661,7 @@ function renderHyperlink(run, spanNode, key, ctx) {
|
|
|
1724
1661
|
);
|
|
1725
1662
|
}
|
|
1726
1663
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick) {
|
|
1727
|
-
if (!
|
|
1664
|
+
if (!chunkWVDM36ZM_js.hasTextProperties(element)) {
|
|
1728
1665
|
return emptyFallback || null;
|
|
1729
1666
|
}
|
|
1730
1667
|
const segments = segmentOverrides ?? element.textSegments;
|
|
@@ -1734,7 +1671,7 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
1734
1671
|
}
|
|
1735
1672
|
return element.text || emptyFallback || "";
|
|
1736
1673
|
}
|
|
1737
|
-
const paragraphs =
|
|
1674
|
+
const paragraphs = chunkWVDM36ZM_js.buildParagraphs(element, fieldContext, segmentOverrides);
|
|
1738
1675
|
const ctx = {
|
|
1739
1676
|
element,
|
|
1740
1677
|
fallbackColor,
|
|
@@ -1867,13 +1804,13 @@ function hexToRgbUnit(hex) {
|
|
|
1867
1804
|
};
|
|
1868
1805
|
}
|
|
1869
1806
|
function getDuotoneColors(element) {
|
|
1870
|
-
if (!
|
|
1807
|
+
if (!chunkWVDM36ZM_js.isImageLikeElement(element)) {
|
|
1871
1808
|
return void 0;
|
|
1872
1809
|
}
|
|
1873
1810
|
return element.imageEffects?.duotone;
|
|
1874
1811
|
}
|
|
1875
1812
|
function buildLineShadowCss(element) {
|
|
1876
|
-
if (!
|
|
1813
|
+
if (!chunkWVDM36ZM_js.hasShapeProperties(element)) {
|
|
1877
1814
|
return void 0;
|
|
1878
1815
|
}
|
|
1879
1816
|
const ss = element.shapeStyle;
|
|
@@ -1884,13 +1821,13 @@ function buildLineShadowCss(element) {
|
|
|
1884
1821
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
1885
1822
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
1886
1823
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
1887
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
1888
|
-
|
|
1824
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkWVDM36ZM_js.colorWithOpacity(
|
|
1825
|
+
chunkWVDM36ZM_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
1889
1826
|
opacity
|
|
1890
1827
|
)}`;
|
|
1891
1828
|
}
|
|
1892
1829
|
function buildLineGlowFilter(element) {
|
|
1893
|
-
if (!
|
|
1830
|
+
if (!chunkWVDM36ZM_js.hasShapeProperties(element)) {
|
|
1894
1831
|
return void 0;
|
|
1895
1832
|
}
|
|
1896
1833
|
const ss = element.shapeStyle;
|
|
@@ -1899,14 +1836,14 @@ function buildLineGlowFilter(element) {
|
|
|
1899
1836
|
}
|
|
1900
1837
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
1901
1838
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
1902
|
-
const glowCol =
|
|
1839
|
+
const glowCol = chunkWVDM36ZM_js.colorWithOpacity(chunkWVDM36ZM_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
1903
1840
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
1904
1841
|
}
|
|
1905
1842
|
function getDagDuotoneFilterId(elementId) {
|
|
1906
1843
|
return `dag-duotone-${elementId}`;
|
|
1907
1844
|
}
|
|
1908
1845
|
function hasDagDuotoneEffect(element) {
|
|
1909
|
-
if (!
|
|
1846
|
+
if (!chunkWVDM36ZM_js.hasShapeProperties(element)) {
|
|
1910
1847
|
return false;
|
|
1911
1848
|
}
|
|
1912
1849
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
@@ -1958,7 +1895,7 @@ function renderDagDuotoneSvgFilter(elementId, color1, color2) {
|
|
|
1958
1895
|
|
|
1959
1896
|
// src/viewer/utils/shape-visual-3d.ts
|
|
1960
1897
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
1961
|
-
return
|
|
1898
|
+
return chunkWVDM36ZM_js.build3DExtrusionData(
|
|
1962
1899
|
shape3d,
|
|
1963
1900
|
scene3d,
|
|
1964
1901
|
fillColor,
|
|
@@ -1967,7 +1904,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
1967
1904
|
);
|
|
1968
1905
|
}
|
|
1969
1906
|
function apply3dEffects2(base, scene3d, shape3d, fillColorFallback) {
|
|
1970
|
-
|
|
1907
|
+
chunkWVDM36ZM_js.apply3dEffects(base, scene3d, shape3d, fillColorFallback);
|
|
1971
1908
|
}
|
|
1972
1909
|
|
|
1973
1910
|
// src/viewer/utils/shape-visual-style.ts
|
|
@@ -1975,13 +1912,13 @@ function rendersCustomVectorPath(element) {
|
|
|
1975
1912
|
return (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;
|
|
1976
1913
|
}
|
|
1977
1914
|
function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _strokeColor, animatesFill, animatesStroke, parentGroupFill) {
|
|
1978
|
-
if (!
|
|
1915
|
+
if (!chunkWVDM36ZM_js.hasShapeProperties(element)) {
|
|
1979
1916
|
return {};
|
|
1980
1917
|
}
|
|
1981
1918
|
const ss = element.shapeStyle;
|
|
1982
|
-
const fill = animatesFill ? void 0 :
|
|
1983
|
-
const fx =
|
|
1984
|
-
const stroke =
|
|
1919
|
+
const fill = animatesFill ? void 0 : chunkWVDM36ZM_js.getComputedFillStyle(element, parentGroupFill);
|
|
1920
|
+
const fx = chunkWVDM36ZM_js.getComputedEffectStyle(element);
|
|
1921
|
+
const stroke = chunkWVDM36ZM_js.getComputedStrokeStyle(element);
|
|
1985
1922
|
const base = {
|
|
1986
1923
|
// A gradient fill REPLACES the solid fill, it does not sit on top of it;
|
|
1987
1924
|
// the whole precedence lives in shared's `getComputedFillStyle`.
|
|
@@ -2016,7 +1953,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
2016
1953
|
strokeLinecap: stroke.strokeLinecap
|
|
2017
1954
|
};
|
|
2018
1955
|
apply3dEffects2(base, ss?.scene3d, ss?.shape3d, ss?.fillColor ?? fillColor);
|
|
2019
|
-
if (rendersCustomVectorPath(element) ||
|
|
1956
|
+
if (rendersCustomVectorPath(element) || chunkWVDM36ZM_js.isStrokeOnlyPresetElement(element)) {
|
|
2020
1957
|
base.backgroundColor = "transparent";
|
|
2021
1958
|
base.backgroundImage = void 0;
|
|
2022
1959
|
base.borderWidth = void 0;
|
|
@@ -2027,7 +1964,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
2027
1964
|
base.backgroundColor = void 0;
|
|
2028
1965
|
base.backgroundImage = void 0;
|
|
2029
1966
|
}
|
|
2030
|
-
const geometry =
|
|
1967
|
+
const geometry = chunkWVDM36ZM_js.resolveShapeGeometry(element);
|
|
2031
1968
|
switch (geometry.kind) {
|
|
2032
1969
|
case "bare":
|
|
2033
1970
|
return { backgroundColor: "transparent", borderWidth: 0, borderStyle: "none" };
|
|
@@ -2053,13 +1990,13 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
2053
1990
|
function getConnectorAdjustment(element, key, fallback) {
|
|
2054
1991
|
const direct = element.shapeAdjustments?.[key];
|
|
2055
1992
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
2056
|
-
return
|
|
1993
|
+
return chunkWVDM36ZM_js.clampUnitInterval(direct / 1e5);
|
|
2057
1994
|
}
|
|
2058
1995
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
2059
1996
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
2060
|
-
return
|
|
1997
|
+
return chunkWVDM36ZM_js.clampUnitInterval(fallbackKey / 1e5);
|
|
2061
1998
|
}
|
|
2062
|
-
return
|
|
1999
|
+
return chunkWVDM36ZM_js.clampUnitInterval(fallback);
|
|
2063
2000
|
}
|
|
2064
2001
|
function getConnectorPathGeometry(element) {
|
|
2065
2002
|
const width = Math.max(element.width, 0);
|
|
@@ -2192,7 +2129,7 @@ function toHexByte(value) {
|
|
|
2192
2129
|
return clamped.toString(16).padStart(2, "0");
|
|
2193
2130
|
}
|
|
2194
2131
|
function shiftHex(hex, factor, towardsWhite) {
|
|
2195
|
-
const channels =
|
|
2132
|
+
const channels = chunkWVDM36ZM_js.hexToRgbChannels(hex);
|
|
2196
2133
|
if (!channels) {
|
|
2197
2134
|
return hex;
|
|
2198
2135
|
}
|
|
@@ -2218,7 +2155,7 @@ function buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity) {
|
|
|
2218
2155
|
const fillOff = subpath.fillMode === "none" || !hasFill;
|
|
2219
2156
|
return {
|
|
2220
2157
|
d: subpath.d,
|
|
2221
|
-
fill: fillOff ? "none" :
|
|
2158
|
+
fill: fillOff ? "none" : chunkWVDM36ZM_js.colorWithOpacity(adjustFillForMode(fillColor, subpath.fillMode), fillOpacity),
|
|
2222
2159
|
stroked: subpath.stroke !== false
|
|
2223
2160
|
};
|
|
2224
2161
|
});
|
|
@@ -2234,11 +2171,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
|
|
|
2234
2171
|
strokePaint,
|
|
2235
2172
|
strokeWidth,
|
|
2236
2173
|
dashArray,
|
|
2237
|
-
lineCap:
|
|
2174
|
+
lineCap: chunkWVDM36ZM_js.svgLineCap(shapeStyle?.lineCap),
|
|
2238
2175
|
lineJoin,
|
|
2239
2176
|
miterLimit,
|
|
2240
|
-
offsets:
|
|
2241
|
-
widths:
|
|
2177
|
+
offsets: chunkWVDM36ZM_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
2178
|
+
widths: chunkWVDM36ZM_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
|
|
2242
2179
|
};
|
|
2243
2180
|
}
|
|
2244
2181
|
function strokeStrands(d, keyBase, ctx) {
|
|
@@ -2286,9 +2223,9 @@ function gradientDefs(gradient) {
|
|
|
2286
2223
|
}
|
|
2287
2224
|
function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredPaths, shapeStyle, hasFill, fillColor, fillOpacity, strokePaint, strokeWidth, dashArray, animatesFill = false, gradient) {
|
|
2288
2225
|
const ctx = strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray);
|
|
2289
|
-
const subpaths = structuredPaths && structuredPaths.length > 0 ?
|
|
2226
|
+
const subpaths = structuredPaths && structuredPaths.length > 0 ? chunkWVDM36ZM_js.customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
2290
2227
|
const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
|
|
2291
|
-
const gradientPaint = gradient ?
|
|
2228
|
+
const gradientPaint = gradient ? chunkWVDM36ZM_js.svgGradientFillRef(gradient) : void 0;
|
|
2292
2229
|
const nodes = [];
|
|
2293
2230
|
if (subpaths && needsPerSubpath) {
|
|
2294
2231
|
const paints = buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity);
|
|
@@ -2320,7 +2257,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2320
2257
|
"path",
|
|
2321
2258
|
{
|
|
2322
2259
|
d: pathData,
|
|
2323
|
-
fill: animatesFill ? "inherit" : gradientPaint ??
|
|
2260
|
+
fill: animatesFill ? "inherit" : gradientPaint ?? chunkWVDM36ZM_js.colorWithOpacity(fillColor, fillOpacity),
|
|
2324
2261
|
stroke: "none",
|
|
2325
2262
|
vectorEffect: "non-scaling-stroke"
|
|
2326
2263
|
},
|
|
@@ -2346,14 +2283,14 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2346
2283
|
);
|
|
2347
2284
|
}
|
|
2348
2285
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2349
|
-
if (!
|
|
2286
|
+
if (!chunkWVDM36ZM_js.hasShapeProperties(element)) {
|
|
2350
2287
|
return null;
|
|
2351
2288
|
}
|
|
2352
2289
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
2353
|
-
const fillPaint = animatesFill ? "inherit" :
|
|
2354
|
-
const strokePaint = animatesStroke ? "inherit" :
|
|
2355
|
-
const dashType =
|
|
2356
|
-
const dashArray =
|
|
2290
|
+
const fillPaint = animatesFill ? "inherit" : chunkWVDM36ZM_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
2291
|
+
const strokePaint = animatesStroke ? "inherit" : chunkWVDM36ZM_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
2292
|
+
const dashType = chunkWVDM36ZM_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2293
|
+
const dashArray = chunkWVDM36ZM_js.getSvgStrokeDasharray(
|
|
2357
2294
|
dashType,
|
|
2358
2295
|
Math.max(strokeWidth, 1),
|
|
2359
2296
|
element.shapeStyle?.customDashSegments
|
|
@@ -2434,21 +2371,21 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2434
2371
|
// container's `background-image` is suppressed for custom geometry, so
|
|
2435
2372
|
// without this the shape fell back to the parser's representative solid
|
|
2436
2373
|
// and lost every fade (issue #132).
|
|
2437
|
-
|
|
2374
|
+
chunkWVDM36ZM_js.buildSvgGradientDef(element.shapeStyle, element.id)
|
|
2438
2375
|
);
|
|
2439
2376
|
}
|
|
2440
|
-
if (
|
|
2377
|
+
if (chunkWVDM36ZM_js.isCalloutShape(normalizedType)) {
|
|
2441
2378
|
const width = Math.max(element.width, 1);
|
|
2442
2379
|
const height = Math.max(element.height, 1);
|
|
2443
|
-
const geometry =
|
|
2380
|
+
const geometry = chunkWVDM36ZM_js.getCalloutLeaderLineGeometry(
|
|
2444
2381
|
normalizedType,
|
|
2445
2382
|
width,
|
|
2446
2383
|
height,
|
|
2447
2384
|
element.shapeAdjustments
|
|
2448
2385
|
);
|
|
2449
2386
|
if (geometry && geometry.points.length >= 2) {
|
|
2450
|
-
const leaderPath =
|
|
2451
|
-
const bounds =
|
|
2387
|
+
const leaderPath = chunkWVDM36ZM_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
2388
|
+
const bounds = chunkWVDM36ZM_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
2452
2389
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
2453
2390
|
const offsetLeft = bounds.minX;
|
|
2454
2391
|
const offsetTop = bounds.minY;
|
|
@@ -2511,10 +2448,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2511
2448
|
const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
|
|
2512
2449
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
2513
2450
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
2514
|
-
const connectorLineCap =
|
|
2451
|
+
const connectorLineCap = chunkWVDM36ZM_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
2515
2452
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
2516
|
-
const offsets =
|
|
2517
|
-
const widths =
|
|
2453
|
+
const offsets = chunkWVDM36ZM_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
2454
|
+
const widths = chunkWVDM36ZM_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
2518
2455
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2519
2456
|
"svg",
|
|
2520
2457
|
{
|
|
@@ -2581,15 +2518,15 @@ function parseGradientFillCss(gradFill) {
|
|
|
2581
2518
|
}
|
|
2582
2519
|
const parsed = stops.map((gs) => {
|
|
2583
2520
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
2584
|
-
const color =
|
|
2585
|
-
const opacity =
|
|
2586
|
-
return { pos, color:
|
|
2521
|
+
const color = chunkWVDM36ZM_js.parseDrawingColor(gs) ?? "#888888";
|
|
2522
|
+
const opacity = chunkWVDM36ZM_js.parseDrawingColorOpacity(gs);
|
|
2523
|
+
return { pos, color: chunkWVDM36ZM_js.colorWithOpacity(color, opacity) };
|
|
2587
2524
|
}).sort((a, b) => a.pos - b.pos);
|
|
2588
2525
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
2589
2526
|
const lin = gradFill["a:lin"];
|
|
2590
2527
|
if (lin) {
|
|
2591
2528
|
const angRaw = Number.parseInt(String(lin["@_ang"] || "0"), 10);
|
|
2592
|
-
const angleDeg = Math.round(
|
|
2529
|
+
const angleDeg = Math.round(chunkWVDM36ZM_js.ooxmlGradientAngleToCssDegrees(angRaw / 6e4));
|
|
2593
2530
|
return `linear-gradient(${angleDeg}deg, ${stopStrings})`;
|
|
2594
2531
|
}
|
|
2595
2532
|
const path = gradFill["a:path"];
|
|
@@ -2624,8 +2561,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
2624
2561
|
if (!pattFill) {
|
|
2625
2562
|
return void 0;
|
|
2626
2563
|
}
|
|
2627
|
-
const fgColor =
|
|
2628
|
-
const bgColor =
|
|
2564
|
+
const fgColor = chunkWVDM36ZM_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
2565
|
+
const bgColor = chunkWVDM36ZM_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
2629
2566
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
2630
2567
|
switch (preset) {
|
|
2631
2568
|
case "ltHorz":
|
|
@@ -2736,11 +2673,11 @@ function parseCellBorders(cellProperties) {
|
|
|
2736
2673
|
const prstDash = ln["a:prstDash"];
|
|
2737
2674
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
2738
2675
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
2739
|
-
const color =
|
|
2676
|
+
const color = chunkWVDM36ZM_js.parseDrawingColor(ln["a:solidFill"]);
|
|
2740
2677
|
if (color) {
|
|
2741
|
-
const opacity =
|
|
2678
|
+
const opacity = chunkWVDM36ZM_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
2742
2679
|
const key = `${edge.prefix}`;
|
|
2743
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
2680
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkWVDM36ZM_js.colorWithOpacity(color, opacity)}`;
|
|
2744
2681
|
}
|
|
2745
2682
|
}
|
|
2746
2683
|
return borderStyle;
|
|
@@ -2753,7 +2690,7 @@ function parseCellTextEffects(runProps) {
|
|
|
2753
2690
|
const textShadowParts = [];
|
|
2754
2691
|
const outerShdw = effectLst["a:outerShdw"];
|
|
2755
2692
|
if (outerShdw) {
|
|
2756
|
-
const shdwColor =
|
|
2693
|
+
const shdwColor = chunkWVDM36ZM_js.parseDrawingColor(outerShdw);
|
|
2757
2694
|
if (shdwColor) {
|
|
2758
2695
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
2759
2696
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -2771,7 +2708,7 @@ function parseCellTextEffects(runProps) {
|
|
|
2771
2708
|
}
|
|
2772
2709
|
const glow = effectLst["a:glow"];
|
|
2773
2710
|
if (glow) {
|
|
2774
|
-
const glowColor =
|
|
2711
|
+
const glowColor = chunkWVDM36ZM_js.parseDrawingColor(glow);
|
|
2775
2712
|
if (glowColor) {
|
|
2776
2713
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
2777
2714
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -2850,10 +2787,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2850
2787
|
if (runProps?.["@_u"] !== void 0) {
|
|
2851
2788
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
2852
2789
|
}
|
|
2853
|
-
const runColor =
|
|
2790
|
+
const runColor = chunkWVDM36ZM_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkWVDM36ZM_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
2854
2791
|
if (runColor) {
|
|
2855
|
-
const opacity =
|
|
2856
|
-
cellStyle.color =
|
|
2792
|
+
const opacity = chunkWVDM36ZM_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
2793
|
+
cellStyle.color = chunkWVDM36ZM_js.colorWithOpacity(runColor, opacity);
|
|
2857
2794
|
}
|
|
2858
2795
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
2859
2796
|
if (fontFamily) {
|
|
@@ -2863,15 +2800,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2863
2800
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
2864
2801
|
}
|
|
2865
2802
|
const cellProperties = cellXml["a:tcPr"];
|
|
2866
|
-
const cellFill =
|
|
2803
|
+
const cellFill = chunkWVDM36ZM_js.parseDrawingColor(
|
|
2867
2804
|
cellProperties?.["a:solidFill"],
|
|
2868
2805
|
schemeColorOverrides
|
|
2869
2806
|
);
|
|
2870
2807
|
if (cellFill) {
|
|
2871
|
-
const opacity =
|
|
2808
|
+
const opacity = chunkWVDM36ZM_js.parseDrawingColorOpacity(
|
|
2872
2809
|
cellProperties?.["a:solidFill"]
|
|
2873
2810
|
);
|
|
2874
|
-
cellStyle.backgroundColor =
|
|
2811
|
+
cellStyle.backgroundColor = chunkWVDM36ZM_js.colorWithOpacity(cellFill, opacity);
|
|
2875
2812
|
} else {
|
|
2876
2813
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
2877
2814
|
if (gradCss) {
|
|
@@ -2886,16 +2823,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2886
2823
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
2887
2824
|
Object.assign(cellStyle, edgeBorders);
|
|
2888
2825
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
2889
|
-
const borderColor =
|
|
2826
|
+
const borderColor = chunkWVDM36ZM_js.parseDrawingColor(
|
|
2890
2827
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
2891
2828
|
schemeColorOverrides
|
|
2892
|
-
) ||
|
|
2829
|
+
) || chunkWVDM36ZM_js.parseDrawingColor(
|
|
2893
2830
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
2894
2831
|
schemeColorOverrides
|
|
2895
|
-
) ||
|
|
2832
|
+
) || chunkWVDM36ZM_js.parseDrawingColor(
|
|
2896
2833
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
2897
2834
|
schemeColorOverrides
|
|
2898
|
-
) ||
|
|
2835
|
+
) || chunkWVDM36ZM_js.parseDrawingColor(
|
|
2899
2836
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
2900
2837
|
schemeColorOverrides
|
|
2901
2838
|
);
|
|
@@ -2967,7 +2904,7 @@ function getTableCellBandStyle2(element, rowIndex, cellIndex, rowCount, columnCo
|
|
|
2967
2904
|
if (element.type !== "table") {
|
|
2968
2905
|
return void 0;
|
|
2969
2906
|
}
|
|
2970
|
-
return
|
|
2907
|
+
return chunkWVDM36ZM_js.getTableCellBandStyle(element.tableData, rowIndex, cellIndex, rowCount, columnCount, {
|
|
2971
2908
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
2972
2909
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
2973
2910
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -3043,7 +2980,7 @@ function renderTableCellContent(cell, fallbackText) {
|
|
|
3043
2980
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3044
2981
|
"span",
|
|
3045
2982
|
{
|
|
3046
|
-
style: { position: "relative", ...
|
|
2983
|
+
style: { position: "relative", ...chunkWVDM36ZM_js.cellRunStyle(run) },
|
|
3047
2984
|
children: run.text
|
|
3048
2985
|
},
|
|
3049
2986
|
`r-${index}`
|
|
@@ -3051,7 +2988,7 @@ function renderTableCellContent(cell, fallbackText) {
|
|
|
3051
2988
|
});
|
|
3052
2989
|
}
|
|
3053
2990
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
3054
|
-
return
|
|
2991
|
+
return chunkWVDM36ZM_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
3055
2992
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
3056
2993
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
3057
2994
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -3184,7 +3121,7 @@ function TableResizeOverlay({
|
|
|
3184
3121
|
const containerRef = React6.useRef(null);
|
|
3185
3122
|
const [rowBounds, setRowBounds] = React6.useState([]);
|
|
3186
3123
|
const dragRef = React6.useRef(null);
|
|
3187
|
-
const colBoundaries = React6.useMemo(() =>
|
|
3124
|
+
const colBoundaries = React6.useMemo(() => chunkWVDM36ZM_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
3188
3125
|
const measureRows = React6.useCallback(() => {
|
|
3189
3126
|
const container = containerRef.current;
|
|
3190
3127
|
if (!container) {
|
|
@@ -3231,11 +3168,11 @@ function TableResizeOverlay({
|
|
|
3231
3168
|
const rect = containerRef.current.getBoundingClientRect();
|
|
3232
3169
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
3233
3170
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
3234
|
-
onResizeColumns(
|
|
3171
|
+
onResizeColumns(chunkWVDM36ZM_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
3235
3172
|
} else if (drag.type === "row" && onResizeRow) {
|
|
3236
3173
|
const deltaY = e.clientY - drag.startPos;
|
|
3237
|
-
const newHeight =
|
|
3238
|
-
drag.initialRowHeight ??
|
|
3174
|
+
const newHeight = chunkWVDM36ZM_js.computeResizedRowHeight(
|
|
3175
|
+
drag.initialRowHeight ?? chunkWVDM36ZM_js.DEFAULT_ROW_HEIGHT,
|
|
3239
3176
|
deltaY
|
|
3240
3177
|
);
|
|
3241
3178
|
onResizeRow(drag.index, newHeight);
|
|
@@ -3273,7 +3210,7 @@ function TableResizeOverlay({
|
|
|
3273
3210
|
e.stopPropagation();
|
|
3274
3211
|
const table = containerRef.current?.querySelector("table");
|
|
3275
3212
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
3276
|
-
const actualHeight = tr?.offsetHeight ??
|
|
3213
|
+
const actualHeight = tr?.offsetHeight ?? chunkWVDM36ZM_js.DEFAULT_ROW_HEIGHT;
|
|
3277
3214
|
document.body.style.cursor = "row-resize";
|
|
3278
3215
|
document.body.style.userSelect = "none";
|
|
3279
3216
|
dragRef.current = {
|
|
@@ -3315,13 +3252,25 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3315
3252
|
const selectedCell = options?.selectedCell || null;
|
|
3316
3253
|
const isEditable = Boolean(options?.editable);
|
|
3317
3254
|
const hasCellSelectionHandler = typeof options?.onSelectCell === "function";
|
|
3255
|
+
const sharedCtx = {
|
|
3256
|
+
tableStyleMap: options?.styleCtx?.tableStyleMap,
|
|
3257
|
+
colorScheme: options?.styleCtx?.theme?.colorScheme,
|
|
3258
|
+
fontScheme: options?.styleCtx?.theme?.fontScheme
|
|
3259
|
+
};
|
|
3260
|
+
const cellCss = (cell, rowIndex, cellIndex) => chunkWVDM36ZM_js.tableCellCss(
|
|
3261
|
+
tableData,
|
|
3262
|
+
cell,
|
|
3263
|
+
{ rowIndex, cellIndex, rowCount, columnCount },
|
|
3264
|
+
sharedCtx,
|
|
3265
|
+
textStyle
|
|
3266
|
+
);
|
|
3318
3267
|
const selectionRect = (() => {
|
|
3319
3268
|
if (!selectedCell?.selectedCells || selectedCell.selectedCells.length < 2) {
|
|
3320
3269
|
return void 0;
|
|
3321
3270
|
}
|
|
3322
3271
|
const first = selectedCell.selectedCells[0];
|
|
3323
3272
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
3324
|
-
return
|
|
3273
|
+
return chunkWVDM36ZM_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
3325
3274
|
})();
|
|
3326
3275
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3327
3276
|
TableResizeOverlay,
|
|
@@ -3342,9 +3291,9 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3342
3291
|
{
|
|
3343
3292
|
className: "w-full h-full border-collapse table-fixed",
|
|
3344
3293
|
style: {
|
|
3345
|
-
fontFamily:
|
|
3294
|
+
fontFamily: chunkWVDM36ZM_js.DEFAULT_FONT_FAMILY,
|
|
3346
3295
|
// `a:tblPr@rtl` mirrors the column order for RTL decks.
|
|
3347
|
-
...
|
|
3296
|
+
...chunkWVDM36ZM_js.tableContainerCss(tableData)
|
|
3348
3297
|
},
|
|
3349
3298
|
children: [
|
|
3350
3299
|
tableData.columnWidths.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: tableData.columnWidths.map((w, ci) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3363,7 +3312,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3363
3312
|
return null;
|
|
3364
3313
|
}
|
|
3365
3314
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
3366
|
-
const isInMultiSelection =
|
|
3315
|
+
const isInMultiSelection = chunkWVDM36ZM_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
3367
3316
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
3368
3317
|
const diag = getCellDiagonalBorders2(
|
|
3369
3318
|
cell.style,
|
|
@@ -3383,8 +3332,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3383
3332
|
colSpan: cell.gridSpan && cell.gridSpan > 1 ? cell.gridSpan : void 0,
|
|
3384
3333
|
rowSpan: cell.rowSpan && cell.rowSpan > 1 ? cell.rowSpan : void 0,
|
|
3385
3334
|
style: {
|
|
3386
|
-
...
|
|
3387
|
-
...chunk7JPLVECA_js.cellStyleToCss(cell.style),
|
|
3335
|
+
...cellCss(cell, rowIndex, cellIndex),
|
|
3388
3336
|
...diag ? { position: "relative" } : void 0
|
|
3389
3337
|
},
|
|
3390
3338
|
onClick: (event) => {
|
|
@@ -3393,7 +3341,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3393
3341
|
}
|
|
3394
3342
|
event.stopPropagation();
|
|
3395
3343
|
if (event.shiftKey && selectedCell) {
|
|
3396
|
-
const rect =
|
|
3344
|
+
const rect = chunkWVDM36ZM_js.computeSelectionRect(
|
|
3397
3345
|
selectedCell.rowIndex,
|
|
3398
3346
|
selectedCell.columnIndex,
|
|
3399
3347
|
rowIndex,
|
|
@@ -3403,7 +3351,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3403
3351
|
options?.onSelectCell?.({
|
|
3404
3352
|
rowIndex: selectedCell.rowIndex,
|
|
3405
3353
|
columnIndex: selectedCell.columnIndex,
|
|
3406
|
-
selectedCells:
|
|
3354
|
+
selectedCells: chunkWVDM36ZM_js.rectToCells(rect)
|
|
3407
3355
|
});
|
|
3408
3356
|
} else {
|
|
3409
3357
|
options?.onSelectCell?.({
|
|
@@ -3429,10 +3377,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3429
3377
|
TableCellInput,
|
|
3430
3378
|
{
|
|
3431
3379
|
initialText: cell.text ?? "",
|
|
3432
|
-
style:
|
|
3433
|
-
...textStyle,
|
|
3434
|
-
...chunk7JPLVECA_js.cellStyleToCss(cell.style)
|
|
3435
|
-
},
|
|
3380
|
+
style: cellCss(cell, rowIndex, cellIndex),
|
|
3436
3381
|
onCommit: (text) => {
|
|
3437
3382
|
options?.onCommitCellEdit?.(rowIndex, cellIndex, text);
|
|
3438
3383
|
},
|
|
@@ -3467,7 +3412,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3467
3412
|
if (tableEl2.tableData && tableEl2.tableData.rows.length > 0) {
|
|
3468
3413
|
return renderTableFromTableData(tableEl2, textStyle, options);
|
|
3469
3414
|
}
|
|
3470
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
3415
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkRTUGI4HQ_js.translationsEn["pptx.table.title"] });
|
|
3471
3416
|
}
|
|
3472
3417
|
const selectedCell = options?.selectedCell || null;
|
|
3473
3418
|
const isEditable = Boolean(options?.editable);
|
|
@@ -3482,7 +3427,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3482
3427
|
}
|
|
3483
3428
|
const first = selectedCell.selectedCells[0];
|
|
3484
3429
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
3485
|
-
return
|
|
3430
|
+
return chunkWVDM36ZM_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
3486
3431
|
})();
|
|
3487
3432
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
3488
3433
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3504,9 +3449,9 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3504
3449
|
{
|
|
3505
3450
|
className: "w-full h-full border-collapse table-fixed",
|
|
3506
3451
|
style: {
|
|
3507
|
-
fontFamily:
|
|
3452
|
+
fontFamily: chunkWVDM36ZM_js.DEFAULT_FONT_FAMILY,
|
|
3508
3453
|
// `a:tblPr@rtl` mirrors the column order for RTL decks.
|
|
3509
|
-
...
|
|
3454
|
+
...chunkWVDM36ZM_js.tableContainerCss(tableEl.tableData)
|
|
3510
3455
|
},
|
|
3511
3456
|
children: [
|
|
3512
3457
|
parsedTable.columnPercentages.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: parsedTable.columnPercentages.map((percentage, columnIndex) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3558,7 +3503,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3558
3503
|
const mergedStyle = {
|
|
3559
3504
|
...bandStyle,
|
|
3560
3505
|
...xmlCellStyle,
|
|
3561
|
-
...tdCellOverride ?
|
|
3506
|
+
...tdCellOverride ? chunkWVDM36ZM_js.cellStyleToCss(tdCellOverride) : void 0,
|
|
3562
3507
|
...diag ? { position: "relative" } : void 0
|
|
3563
3508
|
};
|
|
3564
3509
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3568,7 +3513,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3568
3513
|
"border px-1 py-0.5 align-top",
|
|
3569
3514
|
isEditable && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
3570
3515
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
3571
|
-
|
|
3516
|
+
chunkWVDM36ZM_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
3572
3517
|
),
|
|
3573
3518
|
colSpan,
|
|
3574
3519
|
rowSpan: rSpan,
|
|
@@ -3579,7 +3524,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3579
3524
|
}
|
|
3580
3525
|
event.stopPropagation();
|
|
3581
3526
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
3582
|
-
const rect =
|
|
3527
|
+
const rect = chunkWVDM36ZM_js.computeSelectionRect(
|
|
3583
3528
|
selectedCell.rowIndex,
|
|
3584
3529
|
selectedCell.columnIndex,
|
|
3585
3530
|
rowIndex,
|
|
@@ -3589,7 +3534,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3589
3534
|
options?.onSelectCell?.({
|
|
3590
3535
|
rowIndex: selectedCell.rowIndex,
|
|
3591
3536
|
columnIndex: selectedCell.columnIndex,
|
|
3592
|
-
selectedCells:
|
|
3537
|
+
selectedCells: chunkWVDM36ZM_js.rectToCells(rect)
|
|
3593
3538
|
});
|
|
3594
3539
|
} else {
|
|
3595
3540
|
options?.onSelectCell?.({
|
|
@@ -3649,24 +3594,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3649
3594
|
}
|
|
3650
3595
|
var LEGEND_ITEM_WIDTH = 80;
|
|
3651
3596
|
function partAttrs(part) {
|
|
3652
|
-
return part ?
|
|
3597
|
+
return part ? chunkWVDM36ZM_js.chartPartToAttrs(part) : void 0;
|
|
3653
3598
|
}
|
|
3654
3599
|
function resolveReactPalette(chartData) {
|
|
3655
3600
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
3656
3601
|
return chartData.colorPalette;
|
|
3657
3602
|
}
|
|
3658
|
-
return [...
|
|
3603
|
+
return [...chunkWVDM36ZM_js.getChartStylePalette(chartData.style?.styleId)];
|
|
3659
3604
|
}
|
|
3660
3605
|
function buildReactChartViewModel(element) {
|
|
3661
3606
|
if (element.type !== "chart" || !element.chartData) {
|
|
3662
|
-
return
|
|
3607
|
+
return chunkWVDM36ZM_js.buildChartViewModel(element);
|
|
3663
3608
|
}
|
|
3664
3609
|
const palette = resolveReactPalette(element.chartData);
|
|
3665
3610
|
const themedElement = {
|
|
3666
3611
|
...element,
|
|
3667
3612
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
3668
3613
|
};
|
|
3669
|
-
return
|
|
3614
|
+
return chunkWVDM36ZM_js.buildChartViewModel(themedElement);
|
|
3670
3615
|
}
|
|
3671
3616
|
function renderPrimitive(prim, key) {
|
|
3672
3617
|
switch (prim.kind) {
|
|
@@ -4055,7 +4000,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4055
4000
|
const unmatchedRows = [];
|
|
4056
4001
|
categories.forEach((cat, i) => {
|
|
4057
4002
|
const value = values[i] ?? 0;
|
|
4058
|
-
const code =
|
|
4003
|
+
const code = chunkWVDM36ZM_js.resolveRegionCode(cat);
|
|
4059
4004
|
if (code) {
|
|
4060
4005
|
regionValueMap.set(code, { value, label: cat });
|
|
4061
4006
|
} else {
|
|
@@ -4093,8 +4038,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4093
4038
|
let fill = "#e2e8f0";
|
|
4094
4039
|
let dataLabel = null;
|
|
4095
4040
|
if (entry) {
|
|
4096
|
-
const t =
|
|
4097
|
-
fill =
|
|
4041
|
+
const t = chunkWVDM36ZM_js.normalizeValue(entry.value, minVal, maxVal);
|
|
4042
|
+
fill = chunkWVDM36ZM_js.sequentialColorScale(t);
|
|
4098
4043
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
4099
4044
|
"text",
|
|
4100
4045
|
{
|
|
@@ -4105,7 +4050,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4105
4050
|
fontWeight: 600,
|
|
4106
4051
|
fill: "#1e293b",
|
|
4107
4052
|
style: { pointerEvents: "none" },
|
|
4108
|
-
children:
|
|
4053
|
+
children: chunkWVDM36ZM_js.formatAxisValue(entry.value)
|
|
4109
4054
|
},
|
|
4110
4055
|
`${element.id}-map-dl-${region.code}`
|
|
4111
4056
|
);
|
|
@@ -4123,7 +4068,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4123
4068
|
opacity: 0.9,
|
|
4124
4069
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
4125
4070
|
region.name,
|
|
4126
|
-
entry ? `: ${
|
|
4071
|
+
entry ? `: ${chunkWVDM36ZM_js.formatAxisValue(entry.value)}` : ""
|
|
4127
4072
|
] })
|
|
4128
4073
|
}
|
|
4129
4074
|
),
|
|
@@ -4161,7 +4106,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4161
4106
|
fontSize: 7,
|
|
4162
4107
|
fill: "#64748b",
|
|
4163
4108
|
textAnchor: "middle",
|
|
4164
|
-
children:
|
|
4109
|
+
children: chunkWVDM36ZM_js.formatAxisValue(minVal)
|
|
4165
4110
|
},
|
|
4166
4111
|
`${element.id}-map-legend-min`
|
|
4167
4112
|
),
|
|
@@ -4173,7 +4118,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4173
4118
|
fontSize: 7,
|
|
4174
4119
|
fill: "#64748b",
|
|
4175
4120
|
textAnchor: "middle",
|
|
4176
|
-
children:
|
|
4121
|
+
children: chunkWVDM36ZM_js.formatAxisValue(maxVal)
|
|
4177
4122
|
},
|
|
4178
4123
|
`${element.id}-map-legend-max`
|
|
4179
4124
|
)
|
|
@@ -4192,7 +4137,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4192
4137
|
textAnchor: "middle",
|
|
4193
4138
|
fontSize: 7,
|
|
4194
4139
|
fill: "#94a3b8",
|
|
4195
|
-
children:
|
|
4140
|
+
children: chunkRTUGI4HQ_js.translationsEn["pptx.chart.additionalRegionsFallback"]
|
|
4196
4141
|
},
|
|
4197
4142
|
`${element.id}-map-ft-hdr`
|
|
4198
4143
|
)
|
|
@@ -4239,7 +4184,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4239
4184
|
y,
|
|
4240
4185
|
fontSize,
|
|
4241
4186
|
fill: "#475569",
|
|
4242
|
-
children:
|
|
4187
|
+
children: chunkWVDM36ZM_js.formatAxisValue(row.value)
|
|
4243
4188
|
},
|
|
4244
4189
|
`${element.id}-map-ft-val-${i}`
|
|
4245
4190
|
)
|
|
@@ -4310,7 +4255,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
4310
4255
|
|
|
4311
4256
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
4312
4257
|
function sColor(series, idx) {
|
|
4313
|
-
return
|
|
4258
|
+
return chunkWVDM36ZM_js.seriesColor(series, idx);
|
|
4314
4259
|
}
|
|
4315
4260
|
function valToY(val, range, topY, bottomY) {
|
|
4316
4261
|
const usable = bottomY - topY;
|
|
@@ -4849,7 +4794,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
4849
4794
|
width: 10,
|
|
4850
4795
|
height: 10,
|
|
4851
4796
|
rx: 2,
|
|
4852
|
-
fill:
|
|
4797
|
+
fill: chunkWVDM36ZM_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
4853
4798
|
},
|
|
4854
4799
|
`${id}-leg-r-${i}`
|
|
4855
4800
|
)
|
|
@@ -4873,7 +4818,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
4873
4818
|
width: 10,
|
|
4874
4819
|
height: 10,
|
|
4875
4820
|
rx: 2,
|
|
4876
|
-
fill:
|
|
4821
|
+
fill: chunkWVDM36ZM_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
4877
4822
|
}
|
|
4878
4823
|
),
|
|
4879
4824
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -4886,9 +4831,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
4886
4831
|
}
|
|
4887
4832
|
const lines = [];
|
|
4888
4833
|
if (range.logScale && range.logBase) {
|
|
4889
|
-
const ticks =
|
|
4834
|
+
const ticks = chunkWVDM36ZM_js.generateLogTicks(range);
|
|
4890
4835
|
ticks.forEach((tickVal, i) => {
|
|
4891
|
-
const y =
|
|
4836
|
+
const y = chunkWVDM36ZM_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
4892
4837
|
lines.push(
|
|
4893
4838
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4894
4839
|
"line",
|
|
@@ -4909,7 +4854,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
4909
4854
|
const steps = 4;
|
|
4910
4855
|
for (let i = 0; i <= steps; i++) {
|
|
4911
4856
|
const val = range.min + range.span * i / steps;
|
|
4912
|
-
const y =
|
|
4857
|
+
const y = chunkWVDM36ZM_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
4913
4858
|
lines.push(
|
|
4914
4859
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4915
4860
|
"line",
|
|
@@ -4933,9 +4878,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
4933
4878
|
const labels = [];
|
|
4934
4879
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
4935
4880
|
if (range.logScale && range.logBase) {
|
|
4936
|
-
const ticks =
|
|
4881
|
+
const ticks = chunkWVDM36ZM_js.generateLogTicks(range);
|
|
4937
4882
|
ticks.forEach((tickVal, i) => {
|
|
4938
|
-
const y =
|
|
4883
|
+
const y = chunkWVDM36ZM_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
4939
4884
|
labels.push(
|
|
4940
4885
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4941
4886
|
"text",
|
|
@@ -4945,7 +4890,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
4945
4890
|
textAnchor: "end",
|
|
4946
4891
|
fontSize: 8,
|
|
4947
4892
|
fill: "#64748b",
|
|
4948
|
-
children: hasDisplayUnits ?
|
|
4893
|
+
children: hasDisplayUnits ? chunkWVDM36ZM_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunkWVDM36ZM_js.formatAxisValue(tickVal)
|
|
4949
4894
|
},
|
|
4950
4895
|
`${id}-vaxis-log-${i}`
|
|
4951
4896
|
)
|
|
@@ -4955,7 +4900,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
4955
4900
|
const steps = 4;
|
|
4956
4901
|
for (let i = 0; i <= steps; i++) {
|
|
4957
4902
|
const val = range.min + range.span * i / steps;
|
|
4958
|
-
const y =
|
|
4903
|
+
const y = chunkWVDM36ZM_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
4959
4904
|
labels.push(
|
|
4960
4905
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4961
4906
|
"text",
|
|
@@ -4965,7 +4910,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
4965
4910
|
textAnchor: "end",
|
|
4966
4911
|
fontSize: 8,
|
|
4967
4912
|
fill: "#64748b",
|
|
4968
|
-
children: hasDisplayUnits ?
|
|
4913
|
+
children: hasDisplayUnits ? chunkWVDM36ZM_js.formatAxisValueWithUnits(val, axisFormatting) : chunkWVDM36ZM_js.formatAxisValue(val)
|
|
4969
4914
|
},
|
|
4970
4915
|
`${id}-vaxis-${i}`
|
|
4971
4916
|
)
|
|
@@ -4973,7 +4918,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
4973
4918
|
}
|
|
4974
4919
|
}
|
|
4975
4920
|
if (hasDisplayUnits) {
|
|
4976
|
-
const unitLabel =
|
|
4921
|
+
const unitLabel = chunkWVDM36ZM_js.getDisplayUnitLabel(
|
|
4977
4922
|
axisFormatting.displayUnits,
|
|
4978
4923
|
axisFormatting.displayUnitsLabel
|
|
4979
4924
|
);
|
|
@@ -5048,7 +4993,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
5048
4993
|
if (range.min >= 0) {
|
|
5049
4994
|
return null;
|
|
5050
4995
|
}
|
|
5051
|
-
const y =
|
|
4996
|
+
const y = chunkWVDM36ZM_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
5052
4997
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5053
4998
|
"line",
|
|
5054
4999
|
{
|
|
@@ -5072,7 +5017,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5072
5017
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5073
5018
|
for (let i = 0; i <= steps; i++) {
|
|
5074
5019
|
const val = range.min + range.span * i / steps;
|
|
5075
|
-
const y =
|
|
5020
|
+
const y = chunkWVDM36ZM_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5076
5021
|
labels.push(
|
|
5077
5022
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5078
5023
|
"text",
|
|
@@ -5084,7 +5029,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5084
5029
|
fontFamily,
|
|
5085
5030
|
fontWeight,
|
|
5086
5031
|
fill: fontColor,
|
|
5087
|
-
children: hasDisplayUnits ?
|
|
5032
|
+
children: hasDisplayUnits ? chunkWVDM36ZM_js.formatAxisValueWithUnits(val, axisFormatting) : chunkWVDM36ZM_js.formatAxisValue(val)
|
|
5088
5033
|
},
|
|
5089
5034
|
`${id}-sec-vaxis-${i}`
|
|
5090
5035
|
)
|
|
@@ -5108,7 +5053,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5108
5053
|
);
|
|
5109
5054
|
}
|
|
5110
5055
|
if (hasDisplayUnits) {
|
|
5111
|
-
const unitLabel =
|
|
5056
|
+
const unitLabel = chunkWVDM36ZM_js.getDisplayUnitLabel(
|
|
5112
5057
|
axisFormatting.displayUnits,
|
|
5113
5058
|
axisFormatting.displayUnitsLabel
|
|
5114
5059
|
);
|
|
@@ -5139,7 +5084,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
5139
5084
|
const ticks = [];
|
|
5140
5085
|
for (let i = 0; i <= steps; i++) {
|
|
5141
5086
|
const val = range.min + range.span * i / steps;
|
|
5142
|
-
const y =
|
|
5087
|
+
const y = chunkWVDM36ZM_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5143
5088
|
ticks.push(
|
|
5144
5089
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5145
5090
|
"line",
|
|
@@ -5166,7 +5111,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
5166
5111
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
5167
5112
|
for (let i = 0; i <= steps; i++) {
|
|
5168
5113
|
const val = range.min + range.span * i / steps;
|
|
5169
|
-
const y =
|
|
5114
|
+
const y = chunkWVDM36ZM_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5170
5115
|
lines.push(
|
|
5171
5116
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5172
5117
|
"line",
|
|
@@ -5284,7 +5229,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
5284
5229
|
showK && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5285
5230
|
"th",
|
|
5286
5231
|
{
|
|
5287
|
-
"aria-label":
|
|
5232
|
+
"aria-label": chunkRTUGI4HQ_js.translationsEn["pptx.chart.rowLabelsAria"],
|
|
5288
5233
|
style: {
|
|
5289
5234
|
padding: "1px 4px",
|
|
5290
5235
|
fontWeight: 400,
|
|
@@ -5328,7 +5273,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
5328
5273
|
width: 8,
|
|
5329
5274
|
height: 8,
|
|
5330
5275
|
borderRadius: 2,
|
|
5331
|
-
backgroundColor:
|
|
5276
|
+
backgroundColor: chunkWVDM36ZM_js.seriesColor(
|
|
5332
5277
|
s,
|
|
5333
5278
|
si,
|
|
5334
5279
|
chartData.style?.styleId,
|
|
@@ -5366,10 +5311,10 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
5366
5311
|
}
|
|
5367
5312
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
5368
5313
|
const style = chartData.style;
|
|
5369
|
-
const areaFill =
|
|
5314
|
+
const areaFill = chunkWVDM36ZM_js.chartAreaFill(chartData);
|
|
5370
5315
|
const legendPos = style?.legendPosition || "b";
|
|
5371
|
-
const range =
|
|
5372
|
-
const layout =
|
|
5316
|
+
const range = chunkWVDM36ZM_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
5317
|
+
const layout = chunkWVDM36ZM_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
5373
5318
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
5374
5319
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
5375
5320
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -5390,10 +5335,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
5390
5335
|
const close = closeSeries.values[ci] ?? high;
|
|
5391
5336
|
const isUp = close >= open;
|
|
5392
5337
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
5393
|
-
const highY =
|
|
5394
|
-
const lowY =
|
|
5395
|
-
const openY =
|
|
5396
|
-
const closeY =
|
|
5338
|
+
const highY = chunkWVDM36ZM_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
5339
|
+
const lowY = chunkWVDM36ZM_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
5340
|
+
const openY = chunkWVDM36ZM_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
5341
|
+
const closeY = chunkWVDM36ZM_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
|
|
5397
5342
|
elements.push(
|
|
5398
5343
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5399
5344
|
"line",
|
|
@@ -5436,7 +5381,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
5436
5381
|
textAnchor: "middle",
|
|
5437
5382
|
fontSize: 7,
|
|
5438
5383
|
fill: "#334155",
|
|
5439
|
-
children:
|
|
5384
|
+
children: chunkWVDM36ZM_js.formatAxisValue(close)
|
|
5440
5385
|
},
|
|
5441
5386
|
`${element.id}-stock-dl-${ci}`
|
|
5442
5387
|
)
|
|
@@ -5478,7 +5423,7 @@ function FailedToLoad() {
|
|
|
5478
5423
|
var LazySurfaceChart3DScene = React6__default.default.lazy(
|
|
5479
5424
|
async () => {
|
|
5480
5425
|
try {
|
|
5481
|
-
return await import('./SurfaceChart3DScene-
|
|
5426
|
+
return await import('./SurfaceChart3DScene-ACPKCWLJ.js');
|
|
5482
5427
|
} catch {
|
|
5483
5428
|
return { default: FailedToLoad };
|
|
5484
5429
|
}
|
|
@@ -5502,7 +5447,7 @@ var SurfaceChart3DErrorBoundary = class extends React6__default.default.Componen
|
|
|
5502
5447
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
5503
5448
|
const rows = chartData.series.length;
|
|
5504
5449
|
const cols = Math.max(categoryLabels.length, 1);
|
|
5505
|
-
const range =
|
|
5450
|
+
const range = chunkWVDM36ZM_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
5506
5451
|
const heightMap = new Float32Array(rows * cols);
|
|
5507
5452
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
5508
5453
|
for (let r = 0; r < rows; r++) {
|
|
@@ -5621,10 +5566,10 @@ function darkenRgb(r, g, b, factor) {
|
|
|
5621
5566
|
}
|
|
5622
5567
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
5623
5568
|
const style = chartData.style;
|
|
5624
|
-
const areaFill =
|
|
5569
|
+
const areaFill = chunkWVDM36ZM_js.chartAreaFill(chartData);
|
|
5625
5570
|
const legendPos = style?.legendPosition || "b";
|
|
5626
|
-
const layout =
|
|
5627
|
-
const range =
|
|
5571
|
+
const layout = chunkWVDM36ZM_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
5572
|
+
const range = chunkWVDM36ZM_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
5628
5573
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
5629
5574
|
const seriesCount = chartData.series.length;
|
|
5630
5575
|
const cols = catCount - 1;
|
|
@@ -5713,10 +5658,10 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
5713
5658
|
}
|
|
5714
5659
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
5715
5660
|
const style = chartData.style;
|
|
5716
|
-
const areaFill =
|
|
5661
|
+
const areaFill = chunkWVDM36ZM_js.chartAreaFill(chartData);
|
|
5717
5662
|
const legendPos = style?.legendPosition || "b";
|
|
5718
|
-
const layout =
|
|
5719
|
-
const range =
|
|
5663
|
+
const layout = chunkWVDM36ZM_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
5664
|
+
const range = chunkWVDM36ZM_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
5720
5665
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
5721
5666
|
const seriesCount = chartData.series.length;
|
|
5722
5667
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -5778,9 +5723,9 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
5778
5723
|
}
|
|
5779
5724
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
5780
5725
|
const style = chartData.style;
|
|
5781
|
-
const areaFill =
|
|
5726
|
+
const areaFill = chunkWVDM36ZM_js.chartAreaFill(chartData);
|
|
5782
5727
|
const legendPos = style?.legendPosition || "b";
|
|
5783
|
-
const layout =
|
|
5728
|
+
const layout = chunkWVDM36ZM_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
5784
5729
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
5785
5730
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
5786
5731
|
const rects = [];
|
|
@@ -5803,7 +5748,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
5803
5748
|
y: curY,
|
|
5804
5749
|
width: Math.max(w - 1, 1),
|
|
5805
5750
|
height: Math.max(h - 1, 1),
|
|
5806
|
-
fill:
|
|
5751
|
+
fill: chunkWVDM36ZM_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
5807
5752
|
rx: 2,
|
|
5808
5753
|
opacity: 0.85
|
|
5809
5754
|
},
|
|
@@ -5854,11 +5799,11 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
5854
5799
|
}
|
|
5855
5800
|
function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
5856
5801
|
const style = chartData.style;
|
|
5857
|
-
const areaFill =
|
|
5802
|
+
const areaFill = chunkWVDM36ZM_js.chartAreaFill(chartData);
|
|
5858
5803
|
const legendPos = style?.legendPosition || "b";
|
|
5859
5804
|
const values = chartData.series[0]?.values ?? [];
|
|
5860
|
-
const range =
|
|
5861
|
-
const layout =
|
|
5805
|
+
const range = chunkWVDM36ZM_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
5806
|
+
const layout = chunkWVDM36ZM_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
5862
5807
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
5863
5808
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
5864
5809
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -5869,8 +5814,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
5869
5814
|
const isLast = i === values.length - 1;
|
|
5870
5815
|
const startVal = isLast ? 0 : runningTotal;
|
|
5871
5816
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
5872
|
-
const barStartY =
|
|
5873
|
-
const barEndY =
|
|
5817
|
+
const barStartY = chunkWVDM36ZM_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
5818
|
+
const barEndY = chunkWVDM36ZM_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
|
|
5874
5819
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
5875
5820
|
const y = Math.min(barStartY, barEndY);
|
|
5876
5821
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -5899,7 +5844,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
5899
5844
|
textAnchor: "middle",
|
|
5900
5845
|
fontSize: 7,
|
|
5901
5846
|
fill: "#334155",
|
|
5902
|
-
children:
|
|
5847
|
+
children: chunkWVDM36ZM_js.formatAxisValue(isLast ? endVal : val)
|
|
5903
5848
|
},
|
|
5904
5849
|
`${element.id}-wf-dl-${i}`
|
|
5905
5850
|
)
|
|
@@ -5946,20 +5891,20 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
5946
5891
|
}
|
|
5947
5892
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
5948
5893
|
const style = chartData.style;
|
|
5949
|
-
const areaFill =
|
|
5894
|
+
const areaFill = chunkWVDM36ZM_js.chartAreaFill(chartData);
|
|
5950
5895
|
const legendPos = style?.legendPosition || "b";
|
|
5951
|
-
const layoutOpts =
|
|
5896
|
+
const layoutOpts = chunkWVDM36ZM_js.computeLayoutOptions(
|
|
5952
5897
|
chartData.axes,
|
|
5953
5898
|
chartData.dataTable,
|
|
5954
5899
|
chartData.series.length
|
|
5955
5900
|
);
|
|
5956
|
-
const layout =
|
|
5957
|
-
const { primary, secondary } =
|
|
5901
|
+
const layout = chunkWVDM36ZM_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
5902
|
+
const { primary, secondary } = chunkWVDM36ZM_js.splitSeriesByAxis(chartData.series, chartData.axes);
|
|
5958
5903
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
5959
5904
|
const secondarySeries = secondary.map((e) => e.series);
|
|
5960
|
-
const range =
|
|
5961
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
5962
|
-
const secondaryAxisFmt =
|
|
5905
|
+
const range = chunkWVDM36ZM_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
5906
|
+
const secondaryRange = secondarySeries.length > 0 ? chunkWVDM36ZM_js.computeValueRange(secondarySeries) : void 0;
|
|
5907
|
+
const secondaryAxisFmt = chunkWVDM36ZM_js.getSecondaryValueAxis(chartData.axes);
|
|
5963
5908
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
5964
5909
|
const barSeriesCount = 1;
|
|
5965
5910
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -5975,8 +5920,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
5975
5920
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
5976
5921
|
barSeries.values.forEach((val, vi) => {
|
|
5977
5922
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
5978
|
-
const zeroY =
|
|
5979
|
-
const valY =
|
|
5923
|
+
const zeroY = chunkWVDM36ZM_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
5924
|
+
const valY = chunkWVDM36ZM_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
|
|
5980
5925
|
const y = Math.min(zeroY, valY);
|
|
5981
5926
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
5982
5927
|
barElements.push(
|
|
@@ -5987,7 +5932,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
5987
5932
|
y,
|
|
5988
5933
|
width: barWidth,
|
|
5989
5934
|
height: h,
|
|
5990
|
-
fill:
|
|
5935
|
+
fill: chunkWVDM36ZM_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
5991
5936
|
rx: 1
|
|
5992
5937
|
},
|
|
5993
5938
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -6003,7 +5948,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6003
5948
|
textAnchor: "middle",
|
|
6004
5949
|
fontSize: 7,
|
|
6005
5950
|
fill: "#334155",
|
|
6006
|
-
children:
|
|
5951
|
+
children: chunkWVDM36ZM_js.formatAxisValue(val)
|
|
6007
5952
|
},
|
|
6008
5953
|
`${element.id}-combo-bar-dl-${vi}`
|
|
6009
5954
|
)
|
|
@@ -6020,10 +5965,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6020
5965
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
6021
5966
|
const points = series.values.map((val, vi) => {
|
|
6022
5967
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
6023
|
-
const y =
|
|
5968
|
+
const y = chunkWVDM36ZM_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
6024
5969
|
return { x, y, val };
|
|
6025
5970
|
});
|
|
6026
|
-
const c =
|
|
5971
|
+
const c = chunkWVDM36ZM_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
6027
5972
|
lineElements.push(
|
|
6028
5973
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6029
5974
|
"polyline",
|
|
@@ -6050,7 +5995,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6050
5995
|
textAnchor: "middle",
|
|
6051
5996
|
fontSize: 7,
|
|
6052
5997
|
fill: "#334155",
|
|
6053
|
-
children:
|
|
5998
|
+
children: chunkWVDM36ZM_js.formatAxisValue(p.val)
|
|
6054
5999
|
},
|
|
6055
6000
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
6056
6001
|
)
|
|
@@ -6088,11 +6033,11 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6088
6033
|
}
|
|
6089
6034
|
function renderChartElement(element) {
|
|
6090
6035
|
if (element.type !== "chart") {
|
|
6091
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
6036
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkRTUGI4HQ_js.translationsEn["pptx.chart.heading"] });
|
|
6092
6037
|
}
|
|
6093
6038
|
const chartData = element.chartData;
|
|
6094
6039
|
if (!chartData || chartData.series.length === 0) {
|
|
6095
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
6040
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkRTUGI4HQ_js.translationsEn["pptx.chart.heading"] });
|
|
6096
6041
|
}
|
|
6097
6042
|
const longestSeriesLength = chartData.series.reduce(
|
|
6098
6043
|
(maxLength, series) => Math.max(maxLength, series.values.length),
|
|
@@ -6170,14 +6115,14 @@ function buildNotesPdf(pages) {
|
|
|
6170
6115
|
notes: page.notes,
|
|
6171
6116
|
slideNumber: page.slideNumber
|
|
6172
6117
|
}));
|
|
6173
|
-
const bytes =
|
|
6118
|
+
const bytes = chunkWVDM36ZM_js.buildNotesPdfBytes(images, meta);
|
|
6174
6119
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
6175
6120
|
return URL.createObjectURL(blob);
|
|
6176
6121
|
}
|
|
6177
6122
|
|
|
6178
6123
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
6179
6124
|
function buildPdfFromImageData(images) {
|
|
6180
|
-
const bytes =
|
|
6125
|
+
const bytes = chunkWVDM36ZM_js.buildSlidesPdfBytes(images);
|
|
6181
6126
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
6182
6127
|
return URL.createObjectURL(blob);
|
|
6183
6128
|
}
|
|
@@ -6186,7 +6131,7 @@ function buildPdfFromImageData(images) {
|
|
|
6186
6131
|
var activePreview = null;
|
|
6187
6132
|
function startPreviewAnimation(elementId, preset, options) {
|
|
6188
6133
|
stopPreviewAnimation();
|
|
6189
|
-
const descriptor =
|
|
6134
|
+
const descriptor = chunkWVDM36ZM_js.buildPreviewAnimation(preset, options);
|
|
6190
6135
|
if (!descriptor) {
|
|
6191
6136
|
return;
|
|
6192
6137
|
}
|
|
@@ -6199,7 +6144,7 @@ function startMotionPathPreview(elementId, path, options) {
|
|
|
6199
6144
|
return;
|
|
6200
6145
|
}
|
|
6201
6146
|
const stage = domEl.offsetParent;
|
|
6202
|
-
const descriptor =
|
|
6147
|
+
const descriptor = chunkWVDM36ZM_js.buildMotionPathPreview({
|
|
6203
6148
|
path,
|
|
6204
6149
|
slideWidth: stage?.offsetWidth || DEFAULT_PREVIEW_SLIDE_WIDTH,
|
|
6205
6150
|
slideHeight: stage?.offsetHeight || DEFAULT_PREVIEW_SLIDE_HEIGHT,
|
|
@@ -6265,6 +6210,7 @@ exports.DEFAULT_CANVAS_HEIGHT = DEFAULT_CANVAS_HEIGHT;
|
|
|
6265
6210
|
exports.DEFAULT_CANVAS_WIDTH = DEFAULT_CANVAS_WIDTH;
|
|
6266
6211
|
exports.DEFAULT_FILL_COLOR = DEFAULT_FILL_COLOR;
|
|
6267
6212
|
exports.DEFAULT_FONT_FAMILY = DEFAULT_FONT_FAMILY2;
|
|
6213
|
+
exports.DEFAULT_SECTION_GROUP_ID = DEFAULT_SECTION_GROUP_ID;
|
|
6268
6214
|
exports.DEFAULT_STROKE_COLOR = DEFAULT_STROKE_COLOR;
|
|
6269
6215
|
exports.DEFAULT_TABLE_COLUMNS = DEFAULT_TABLE_COLUMNS;
|
|
6270
6216
|
exports.DEFAULT_TABLE_ROWS = DEFAULT_TABLE_ROWS;
|