pptx-react-viewer 2.16.0 → 2.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/{AiChatPanel-VKGWK23E.js → AiChatPanel-MCGNCS7Q.js} +22 -22
- package/dist/AiChatPanel-MCGNCS7Q.js.br +0 -0
- package/dist/AiChatPanel-MCGNCS7Q.js.gz +0 -0
- package/dist/{AiChatPanel-TYU52HDW.mjs → AiChatPanel-WJXPCHQK.mjs} +3 -3
- package/dist/AiChatPanel-WJXPCHQK.mjs.br +0 -0
- package/dist/AiChatPanel-WJXPCHQK.mjs.gz +0 -0
- package/dist/{Model3DScene-267BHD5T.mjs → Model3DScene-IXW2AKAU.mjs} +1 -1
- package/dist/{Model3DScene-267BHD5T.mjs.br → Model3DScene-IXW2AKAU.mjs.br} +0 -0
- package/dist/Model3DScene-IXW2AKAU.mjs.gz +0 -0
- package/dist/{Model3DScene-TG7OSR6V.js → Model3DScene-Q2DTGVQ7.js} +2 -2
- package/dist/Model3DScene-Q2DTGVQ7.js.br +0 -0
- package/dist/Model3DScene-Q2DTGVQ7.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-GK4JHZAC.js → SurfaceChart3DScene-AD43LAOO.js} +2 -2
- package/dist/SurfaceChart3DScene-AD43LAOO.js.br +0 -0
- package/dist/SurfaceChart3DScene-AD43LAOO.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-RPRVXRQZ.mjs → SurfaceChart3DScene-MODEHQ6G.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-RPRVXRQZ.mjs.br → SurfaceChart3DScene-MODEHQ6G.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-MODEHQ6G.mjs.gz +0 -0
- package/dist/{chunk-P3Y3OMAD.js → chunk-4GX347MG.js} +517 -65
- package/dist/chunk-4GX347MG.js.br +0 -0
- package/dist/{chunk-P3Y3OMAD.js.gz → chunk-4GX347MG.js.gz} +0 -0
- package/dist/{chunk-PILJZ5OE.js → chunk-CIK6XUOH.js} +3 -3
- package/dist/chunk-CIK6XUOH.js.br +0 -0
- package/dist/{chunk-PILJZ5OE.js.gz → chunk-CIK6XUOH.js.gz} +0 -0
- package/dist/{chunk-7W5MCYBN.js → chunk-JV6DI7AK.js} +1100 -1073
- package/dist/chunk-JV6DI7AK.js.br +0 -0
- package/dist/chunk-JV6DI7AK.js.gz +0 -0
- package/dist/{chunk-VNVURLZM.mjs → chunk-LDD2UVCV.mjs} +54 -27
- package/dist/chunk-LDD2UVCV.mjs.br +0 -0
- package/dist/chunk-LDD2UVCV.mjs.gz +0 -0
- package/dist/{chunk-OIITLGKQ.mjs → chunk-MDFCBYEM.mjs} +510 -65
- package/dist/chunk-MDFCBYEM.mjs.br +0 -0
- package/dist/{chunk-OIITLGKQ.mjs.gz → chunk-MDFCBYEM.mjs.gz} +0 -0
- package/dist/{chunk-GOPIG4VW.js → chunk-NKE64XVV.js} +348 -344
- package/dist/chunk-NKE64XVV.js.br +0 -0
- package/dist/chunk-NKE64XVV.js.gz +0 -0
- package/dist/{chunk-AX75ONFY.js → chunk-P6KM7RO5.js} +415 -396
- package/dist/chunk-P6KM7RO5.js.br +0 -0
- package/dist/chunk-P6KM7RO5.js.gz +0 -0
- package/dist/{chunk-ULB35HMJ.mjs → chunk-QI2JCXTH.mjs} +1 -1
- package/dist/chunk-QI2JCXTH.mjs.br +0 -0
- package/dist/chunk-QI2JCXTH.mjs.gz +0 -0
- package/dist/{chunk-TWPZJXLC.mjs → chunk-UWYHBCLM.mjs} +11 -7
- package/dist/chunk-UWYHBCLM.mjs.br +0 -0
- package/dist/chunk-UWYHBCLM.mjs.gz +0 -0
- package/dist/{chunk-FFBY2TKD.mjs → chunk-Z4CS2ZYN.mjs} +173 -154
- package/dist/chunk-Z4CS2ZYN.mjs.br +0 -0
- package/dist/chunk-Z4CS2ZYN.mjs.gz +0 -0
- package/dist/index.js +39 -39
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +43 -0
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +78 -78
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +3 -3
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/viewer/index.js +26 -26
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +5 -5
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-TYU52HDW.mjs.br +0 -0
- package/dist/AiChatPanel-TYU52HDW.mjs.gz +0 -0
- package/dist/AiChatPanel-VKGWK23E.js.br +0 -0
- package/dist/AiChatPanel-VKGWK23E.js.gz +0 -0
- package/dist/Model3DScene-267BHD5T.mjs.gz +0 -0
- package/dist/Model3DScene-TG7OSR6V.js.br +0 -0
- package/dist/Model3DScene-TG7OSR6V.js.gz +0 -0
- package/dist/SurfaceChart3DScene-GK4JHZAC.js.br +0 -0
- package/dist/SurfaceChart3DScene-GK4JHZAC.js.gz +0 -0
- package/dist/SurfaceChart3DScene-RPRVXRQZ.mjs.gz +0 -0
- package/dist/chunk-7W5MCYBN.js.br +0 -0
- package/dist/chunk-7W5MCYBN.js.gz +0 -0
- package/dist/chunk-AX75ONFY.js.br +0 -0
- package/dist/chunk-AX75ONFY.js.gz +0 -0
- package/dist/chunk-FFBY2TKD.mjs.br +0 -0
- package/dist/chunk-FFBY2TKD.mjs.gz +0 -0
- package/dist/chunk-GOPIG4VW.js.br +0 -0
- package/dist/chunk-GOPIG4VW.js.gz +0 -0
- package/dist/chunk-OIITLGKQ.mjs.br +0 -0
- package/dist/chunk-P3Y3OMAD.js.br +0 -0
- package/dist/chunk-PILJZ5OE.js.br +0 -0
- package/dist/chunk-TWPZJXLC.mjs.br +0 -0
- package/dist/chunk-TWPZJXLC.mjs.gz +0 -0
- package/dist/chunk-ULB35HMJ.mjs.br +0 -0
- package/dist/chunk-ULB35HMJ.mjs.gz +0 -0
- package/dist/chunk-VNVURLZM.mjs.br +0 -0
- package/dist/chunk-VNVURLZM.mjs.gz +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunk3ISYPBSX_js = require('./chunk-3ISYPBSX.js');
|
|
4
|
-
var
|
|
4
|
+
var chunk4GX347MG_js = require('./chunk-4GX347MG.js');
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var tailwindMerge = require('tailwind-merge');
|
|
7
7
|
var React6 = require('react');
|
|
8
8
|
var lu = require('react-icons/lu');
|
|
9
|
-
var reactI18next = require('react-i18next');
|
|
10
9
|
var jsxRuntime = require('react/jsx-runtime');
|
|
10
|
+
var reactI18next = require('react-i18next');
|
|
11
11
|
|
|
12
12
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
13
|
|
|
@@ -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 chunk4GX347MG_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 chunk4GX347MG_js.cloneHistorySnapshot(snapshot);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
// src/viewer/constants/scalar.ts
|
|
@@ -63,7 +63,7 @@ var TOOLBAR_SECTIONS = [
|
|
|
63
63
|
{ id: "view", labelKey: "pptx.ribbon.tab.view" },
|
|
64
64
|
{ id: "help", labelKey: "pptx.ribbon.tab.help" }
|
|
65
65
|
];
|
|
66
|
-
var SHORTCUT_REFERENCE_ITEMS =
|
|
66
|
+
var SHORTCUT_REFERENCE_ITEMS = chunk4GX347MG_js.VIEWER_SHORTCUT_REFERENCE;
|
|
67
67
|
|
|
68
68
|
// src/viewer/constants/theme.ts
|
|
69
69
|
var THEME_COLOR_SWATCHES = [
|
|
@@ -107,7 +107,7 @@ var GLYPH_COMPONENTS = {
|
|
|
107
107
|
plus: lu.LuPlus,
|
|
108
108
|
triangle: lu.LuTriangle
|
|
109
109
|
};
|
|
110
|
-
var SHAPE_PRESETS =
|
|
110
|
+
var SHAPE_PRESETS = chunk4GX347MG_js.SHAPE_PRESET_DEFS.map(
|
|
111
111
|
(def) => ({
|
|
112
112
|
type: def.type,
|
|
113
113
|
label: def.label,
|
|
@@ -266,7 +266,7 @@ function isConnectorOrLineElement(element) {
|
|
|
266
266
|
if (element.type === "connector") {
|
|
267
267
|
return true;
|
|
268
268
|
}
|
|
269
|
-
if (!
|
|
269
|
+
if (!chunk4GX347MG_js.hasShapeProperties(element)) {
|
|
270
270
|
return false;
|
|
271
271
|
}
|
|
272
272
|
const st = getShapeType(element.shapeType);
|
|
@@ -277,12 +277,12 @@ function isConnectorOrLineElement(element) {
|
|
|
277
277
|
function partitionTemplateElements(slides) {
|
|
278
278
|
const templateElementsBySlideId = {};
|
|
279
279
|
const nextSlides = slides.map((slide) => {
|
|
280
|
-
const template = slide.elements.filter((el) =>
|
|
280
|
+
const template = slide.elements.filter((el) => chunk4GX347MG_js.isTemplateElement(el));
|
|
281
281
|
if (template.length === 0) {
|
|
282
282
|
return slide;
|
|
283
283
|
}
|
|
284
284
|
templateElementsBySlideId[slide.id] = template;
|
|
285
|
-
return { ...slide, elements: slide.elements.filter((el) => !
|
|
285
|
+
return { ...slide, elements: slide.elements.filter((el) => !chunk4GX347MG_js.isTemplateElement(el)) };
|
|
286
286
|
});
|
|
287
287
|
return { slides: nextSlides, templateElementsBySlideId };
|
|
288
288
|
}
|
|
@@ -298,7 +298,7 @@ function buildSaveSlides(slides, templateElementsBySlideId) {
|
|
|
298
298
|
|
|
299
299
|
// src/viewer/utils/image-style.ts
|
|
300
300
|
function getImageMaskStyle(element) {
|
|
301
|
-
if (!
|
|
301
|
+
if (!chunk4GX347MG_js.hasShapeProperties(element)) {
|
|
302
302
|
return void 0;
|
|
303
303
|
}
|
|
304
304
|
const shapeType = element.shapeType;
|
|
@@ -307,7 +307,7 @@ function getImageMaskStyle(element) {
|
|
|
307
307
|
}
|
|
308
308
|
const normalized = shapeType.toLowerCase();
|
|
309
309
|
if (normalized === "roundrect" || normalized === "round1rect" || normalized === "round2samerect" || normalized === "round2diagrect" || normalized === "sniproundrect" || normalized === "snip1rect" || normalized === "snip2diagrect") {
|
|
310
|
-
const radiusPx =
|
|
310
|
+
const radiusPx = chunk4GX347MG_js.getRoundRectRadiusPx2(element);
|
|
311
311
|
if (radiusPx <= 0.01) {
|
|
312
312
|
return void 0;
|
|
313
313
|
}
|
|
@@ -319,7 +319,7 @@ function getImageMaskStyle(element) {
|
|
|
319
319
|
if (normalized === "can" || normalized === "cylinder") {
|
|
320
320
|
return { borderRadius: "48% / 12%" };
|
|
321
321
|
}
|
|
322
|
-
const clipPath =
|
|
322
|
+
const clipPath = chunk4GX347MG_js.getResolvedShapeClipPath(element);
|
|
323
323
|
if (!clipPath) {
|
|
324
324
|
return void 0;
|
|
325
325
|
}
|
|
@@ -328,7 +328,7 @@ function getImageMaskStyle(element) {
|
|
|
328
328
|
function getImageRenderStyle(element) {
|
|
329
329
|
return {
|
|
330
330
|
...getImageMaskStyle(element) || {},
|
|
331
|
-
...
|
|
331
|
+
...chunk4GX347MG_js.getImageFitStyle(element)
|
|
332
332
|
};
|
|
333
333
|
}
|
|
334
334
|
var CROP_SHAPE_CLIP_PATHS = {
|
|
@@ -341,7 +341,7 @@ var CROP_SHAPE_CLIP_PATHS = {
|
|
|
341
341
|
star: "polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)"
|
|
342
342
|
};
|
|
343
343
|
function getCropShapeClipPath(element) {
|
|
344
|
-
if (!
|
|
344
|
+
if (!chunk4GX347MG_js.isImageLikeElement(element)) {
|
|
345
345
|
return void 0;
|
|
346
346
|
}
|
|
347
347
|
const shape = element.cropShape;
|
|
@@ -351,7 +351,7 @@ function getCropShapeClipPath(element) {
|
|
|
351
351
|
return CROP_SHAPE_CLIP_PATHS[shape];
|
|
352
352
|
}
|
|
353
353
|
function isImageTiled(element) {
|
|
354
|
-
if (!
|
|
354
|
+
if (!chunk4GX347MG_js.isImageLikeElement(element)) {
|
|
355
355
|
return false;
|
|
356
356
|
}
|
|
357
357
|
return typeof element.tileScaleX === "number" || typeof element.tileScaleY === "number";
|
|
@@ -409,7 +409,7 @@ function buildMirrorTiledBackground(src, flip, scaleX, scaleY) {
|
|
|
409
409
|
};
|
|
410
410
|
}
|
|
411
411
|
function getImageTilingStyle(element) {
|
|
412
|
-
if (!
|
|
412
|
+
if (!chunk4GX347MG_js.isImageLikeElement(element) || !isImageTiled(element)) {
|
|
413
413
|
return void 0;
|
|
414
414
|
}
|
|
415
415
|
const scaleX = typeof element.tileScaleX === "number" ? element.tileScaleX * 100 : 100;
|
|
@@ -550,36 +550,6 @@ function CaptionTrackRenderer({
|
|
|
550
550
|
);
|
|
551
551
|
}) });
|
|
552
552
|
}
|
|
553
|
-
function MediaNotFoundPlaceholder({
|
|
554
|
-
mediaType
|
|
555
|
-
}) {
|
|
556
|
-
const { t } = reactI18next.useTranslation();
|
|
557
|
-
const isVideo = mediaType === "video";
|
|
558
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full h-full flex flex-col items-center justify-center gap-2 pointer-events-none bg-black/30 rounded border border-dashed border-white/20", children: [
|
|
559
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
560
|
-
"svg",
|
|
561
|
-
{
|
|
562
|
-
width: "36",
|
|
563
|
-
height: "36",
|
|
564
|
-
viewBox: "0 0 24 24",
|
|
565
|
-
fill: "none",
|
|
566
|
-
stroke: "currentColor",
|
|
567
|
-
strokeWidth: "1.5",
|
|
568
|
-
className: "text-white/50",
|
|
569
|
-
children: isVideo ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
570
|
-
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "2", y: "4", width: "20", height: "16", rx: "2" }),
|
|
571
|
-
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "2", y1: "4", x2: "22", y2: "20" })
|
|
572
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
573
|
-
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
574
|
-
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "4", y1: "4", x2: "20", y2: "20" })
|
|
575
|
-
] })
|
|
576
|
-
}
|
|
577
|
-
),
|
|
578
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/50", children: t("pptx.media.typeNotFound", {
|
|
579
|
-
type: isVideo ? t("pptx.file.video") : t("pptx.file.audio")
|
|
580
|
-
}) })
|
|
581
|
-
] });
|
|
582
|
-
}
|
|
583
553
|
function VideoWithMetadata({
|
|
584
554
|
element,
|
|
585
555
|
mediaRef,
|
|
@@ -659,9 +629,9 @@ function registerMediaElement(elementId, el) {
|
|
|
659
629
|
};
|
|
660
630
|
}
|
|
661
631
|
function executeMediaCommand(command, frameRoot) {
|
|
662
|
-
return
|
|
632
|
+
return chunk4GX347MG_js.runMediaCommand(
|
|
663
633
|
command,
|
|
664
|
-
(targetId) => registry.get(targetId) ??
|
|
634
|
+
(targetId) => registry.get(targetId) ?? chunk4GX347MG_js.findMediaElementByElementId(targetId, frameRoot?.())
|
|
665
635
|
);
|
|
666
636
|
}
|
|
667
637
|
function PresentationMediaController({
|
|
@@ -705,7 +675,7 @@ function PresentationMediaController({
|
|
|
705
675
|
loop: shouldLoop,
|
|
706
676
|
volume: playbackVolume,
|
|
707
677
|
playbackRate
|
|
708
|
-
} =
|
|
678
|
+
} = chunk4GX347MG_js.mediaPlaybackAttributes({
|
|
709
679
|
loop: element.loop,
|
|
710
680
|
volume: element.volume,
|
|
711
681
|
playbackSpeed: element.playbackSpeed
|
|
@@ -841,7 +811,7 @@ function PresentationMediaController({
|
|
|
841
811
|
if (element.playAcrossSlides && element.mediaType === "audio") {
|
|
842
812
|
const dataUrl = element.mediaData ?? resolvedDataUrl;
|
|
843
813
|
if (dataUrl) {
|
|
844
|
-
|
|
814
|
+
chunk4GX347MG_js.registerPersistentAudio(
|
|
845
815
|
element.id,
|
|
846
816
|
dataUrl,
|
|
847
817
|
element.mediaMimeType,
|
|
@@ -902,6 +872,109 @@ function PresentationMediaController({
|
|
|
902
872
|
)
|
|
903
873
|
] });
|
|
904
874
|
}
|
|
875
|
+
function label(key) {
|
|
876
|
+
return key === void 0 ? void 0 : chunk3ISYPBSX_js.translationsEn[key];
|
|
877
|
+
}
|
|
878
|
+
function FallbackIcon({
|
|
879
|
+
paths,
|
|
880
|
+
size,
|
|
881
|
+
className
|
|
882
|
+
}) {
|
|
883
|
+
if (paths.length === 0) {
|
|
884
|
+
return null;
|
|
885
|
+
}
|
|
886
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
887
|
+
"svg",
|
|
888
|
+
{
|
|
889
|
+
width: size,
|
|
890
|
+
height: size,
|
|
891
|
+
viewBox: "0 0 24 24",
|
|
892
|
+
fill: "none",
|
|
893
|
+
stroke: "currentColor",
|
|
894
|
+
strokeWidth: "1.5",
|
|
895
|
+
className,
|
|
896
|
+
children: paths.map((d) => /* @__PURE__ */ jsxRuntime.jsx("path", { d }, d))
|
|
897
|
+
}
|
|
898
|
+
);
|
|
899
|
+
}
|
|
900
|
+
function Badge({
|
|
901
|
+
visual,
|
|
902
|
+
element
|
|
903
|
+
}) {
|
|
904
|
+
if (visual.badge === "none") {
|
|
905
|
+
return null;
|
|
906
|
+
}
|
|
907
|
+
const isMissing = visual.badge === "missing";
|
|
908
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
909
|
+
"div",
|
|
910
|
+
{
|
|
911
|
+
className: `absolute inset-0 flex flex-col items-center justify-center ${isMissing ? "gap-1" : ""}`,
|
|
912
|
+
...{ [chunk4GX347MG_js.MEDIA_CHROME_ATTRIBUTE]: visual.badge },
|
|
913
|
+
children: [
|
|
914
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
915
|
+
FallbackIcon,
|
|
916
|
+
{
|
|
917
|
+
paths: chunk4GX347MG_js.mediaFallbackIcon(visual, element.mediaType),
|
|
918
|
+
size: isMissing ? 32 : 48,
|
|
919
|
+
className: isMissing ? "text-white/60" : "text-white/80 drop-shadow-md"
|
|
920
|
+
}
|
|
921
|
+
),
|
|
922
|
+
isMissing && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: label(chunk4GX347MG_js.mediaFallbackLabelKey(visual, element.mediaType)) })
|
|
923
|
+
]
|
|
924
|
+
}
|
|
925
|
+
);
|
|
926
|
+
}
|
|
927
|
+
function Placeholder({
|
|
928
|
+
visual,
|
|
929
|
+
element
|
|
930
|
+
}) {
|
|
931
|
+
if (visual.placeholder === "none") {
|
|
932
|
+
return null;
|
|
933
|
+
}
|
|
934
|
+
const isMissing = visual.placeholder === "missing";
|
|
935
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
936
|
+
"div",
|
|
937
|
+
{
|
|
938
|
+
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"}`,
|
|
939
|
+
...{ [chunk4GX347MG_js.MEDIA_CHROME_ATTRIBUTE]: visual.placeholder },
|
|
940
|
+
children: [
|
|
941
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
942
|
+
FallbackIcon,
|
|
943
|
+
{
|
|
944
|
+
paths: chunk4GX347MG_js.mediaFallbackIcon(visual, element.mediaType),
|
|
945
|
+
size: isMissing ? 36 : element.mediaType === "audio" ? 24 : 32,
|
|
946
|
+
className: isMissing ? "text-white/50" : "text-white/70"
|
|
947
|
+
}
|
|
948
|
+
),
|
|
949
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `text-[10px] ${isMissing ? "text-white/50" : "text-white/70"}`, children: label(chunk4GX347MG_js.mediaFallbackLabelKey(visual, element.mediaType)) })
|
|
950
|
+
]
|
|
951
|
+
}
|
|
952
|
+
);
|
|
953
|
+
}
|
|
954
|
+
function renderMediaFallback({
|
|
955
|
+
element,
|
|
956
|
+
posterUrl,
|
|
957
|
+
surface
|
|
958
|
+
}) {
|
|
959
|
+
const visual = chunk4GX347MG_js.mediaFallbackVisual(surface, {
|
|
960
|
+
hasPoster: Boolean(posterUrl),
|
|
961
|
+
missing: element.mediaMissing === true
|
|
962
|
+
});
|
|
963
|
+
if (visual.poster && posterUrl) {
|
|
964
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full h-full relative pointer-events-none", children: [
|
|
965
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
966
|
+
"img",
|
|
967
|
+
{
|
|
968
|
+
src: posterUrl,
|
|
969
|
+
alt: visual.dimPoster ? chunk3ISYPBSX_js.translationsEn["pptx.media.posterAlt"] : chunk3ISYPBSX_js.translationsEn["pptx.media.videoPosterAlt"],
|
|
970
|
+
className: `w-full h-full object-contain${visual.dimPoster ? " opacity-50" : ""}`
|
|
971
|
+
}
|
|
972
|
+
),
|
|
973
|
+
/* @__PURE__ */ jsxRuntime.jsx(Badge, { visual, element })
|
|
974
|
+
] });
|
|
975
|
+
}
|
|
976
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Placeholder, { visual, element });
|
|
977
|
+
}
|
|
905
978
|
function renderMediaElement(element, mediaDataUrls, options) {
|
|
906
979
|
if (element.type !== "media") {
|
|
907
980
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunk3ISYPBSX_js.translationsEn["pptx.media.title"] });
|
|
@@ -912,44 +985,17 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
912
985
|
const dataUrl = element.mediaData ?? (mediaPath ? mediaDataUrls.get(mediaPath) : void 0);
|
|
913
986
|
const trimFragment = buildTrimFragment(element);
|
|
914
987
|
const posterUrl = element.posterFrameData ?? void 0;
|
|
915
|
-
const shouldLoop =
|
|
988
|
+
const shouldLoop = chunk4GX347MG_js.mediaPlaybackAttributes(element).loop;
|
|
916
989
|
const shouldAutoPlay = options?.autoPlay === true || element.autoPlay === true;
|
|
917
990
|
const isFullScreen = options?.fullScreen === true;
|
|
918
991
|
const isPresentationMode = options?.isPresentationMode === true;
|
|
919
992
|
const showTransport = options?.showTransport ?? !isPresentationMode;
|
|
993
|
+
const surface = {
|
|
994
|
+
presenting: isPresentationMode,
|
|
995
|
+
preview: options?.preview === true
|
|
996
|
+
};
|
|
920
997
|
if (element.mediaMissing) {
|
|
921
|
-
|
|
922
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full h-full relative pointer-events-none", children: [
|
|
923
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
924
|
-
"img",
|
|
925
|
-
{
|
|
926
|
-
src: posterUrl,
|
|
927
|
-
alt: chunk3ISYPBSX_js.translationsEn["pptx.media.posterAlt"],
|
|
928
|
-
className: "w-full h-full object-contain opacity-50"
|
|
929
|
-
}
|
|
930
|
-
),
|
|
931
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 flex flex-col items-center justify-center gap-1", children: [
|
|
932
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
933
|
-
"svg",
|
|
934
|
-
{
|
|
935
|
-
width: "32",
|
|
936
|
-
height: "32",
|
|
937
|
-
viewBox: "0 0 24 24",
|
|
938
|
-
fill: "none",
|
|
939
|
-
stroke: "currentColor",
|
|
940
|
-
strokeWidth: "1.5",
|
|
941
|
-
className: "text-white/60",
|
|
942
|
-
children: [
|
|
943
|
-
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
944
|
-
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "4", y1: "4", x2: "20", y2: "20" })
|
|
945
|
-
]
|
|
946
|
-
}
|
|
947
|
-
),
|
|
948
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: chunk3ISYPBSX_js.translationsEn["pptx.media.notFound"] })
|
|
949
|
-
] })
|
|
950
|
-
] });
|
|
951
|
-
}
|
|
952
|
-
return /* @__PURE__ */ jsxRuntime.jsx(MediaNotFoundPlaceholder, { mediaType: mediaType ?? "video" });
|
|
998
|
+
return renderMediaFallback({ element, posterUrl, surface });
|
|
953
999
|
}
|
|
954
1000
|
if (mediaType === "video") {
|
|
955
1001
|
if (dataUrl) {
|
|
@@ -982,47 +1028,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
982
1028
|
}
|
|
983
1029
|
);
|
|
984
1030
|
}
|
|
985
|
-
|
|
986
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full h-full relative pointer-events-none", children: [
|
|
987
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
988
|
-
"img",
|
|
989
|
-
{
|
|
990
|
-
src: posterUrl,
|
|
991
|
-
alt: chunk3ISYPBSX_js.translationsEn["pptx.media.videoPosterAlt"],
|
|
992
|
-
className: "w-full h-full object-contain"
|
|
993
|
-
}
|
|
994
|
-
),
|
|
995
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
996
|
-
"svg",
|
|
997
|
-
{
|
|
998
|
-
width: "48",
|
|
999
|
-
height: "48",
|
|
1000
|
-
viewBox: "0 0 24 24",
|
|
1001
|
-
fill: "none",
|
|
1002
|
-
stroke: "currentColor",
|
|
1003
|
-
strokeWidth: "1.5",
|
|
1004
|
-
className: "text-white/80 drop-shadow-md",
|
|
1005
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("polygon", { points: "5 3 19 12 5 21 5 3" })
|
|
1006
|
-
}
|
|
1007
|
-
) })
|
|
1008
|
-
] });
|
|
1009
|
-
}
|
|
1010
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full h-full flex flex-col items-center justify-center gap-1 pointer-events-none bg-black/20 rounded", children: [
|
|
1011
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1012
|
-
"svg",
|
|
1013
|
-
{
|
|
1014
|
-
width: "32",
|
|
1015
|
-
height: "32",
|
|
1016
|
-
viewBox: "0 0 24 24",
|
|
1017
|
-
fill: "none",
|
|
1018
|
-
stroke: "currentColor",
|
|
1019
|
-
strokeWidth: "1.5",
|
|
1020
|
-
className: "text-white/70",
|
|
1021
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("polygon", { points: "5 3 19 12 5 21 5 3" })
|
|
1022
|
-
}
|
|
1023
|
-
),
|
|
1024
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/70", children: "Video" })
|
|
1025
|
-
] });
|
|
1031
|
+
return renderMediaFallback({ element, posterUrl, surface });
|
|
1026
1032
|
}
|
|
1027
1033
|
if (mediaType === "audio") {
|
|
1028
1034
|
if (dataUrl) {
|
|
@@ -1052,33 +1058,17 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1052
1058
|
}
|
|
1053
1059
|
);
|
|
1054
1060
|
}
|
|
1055
|
-
return
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
width: "24",
|
|
1060
|
-
height: "24",
|
|
1061
|
-
viewBox: "0 0 24 24",
|
|
1062
|
-
fill: "none",
|
|
1063
|
-
stroke: "currentColor",
|
|
1064
|
-
strokeWidth: "1.5",
|
|
1065
|
-
className: "text-white/70",
|
|
1066
|
-
children: [
|
|
1067
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 18V5l12-2v13" }),
|
|
1068
|
-
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "6", cy: "18", r: "3" }),
|
|
1069
|
-
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "18", cy: "16", r: "3" })
|
|
1070
|
-
]
|
|
1071
|
-
}
|
|
1072
|
-
),
|
|
1073
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/70", children: "Audio" })
|
|
1074
|
-
] });
|
|
1061
|
+
return renderMediaFallback({ element, posterUrl, surface });
|
|
1062
|
+
}
|
|
1063
|
+
if (surface.presenting || surface.preview) {
|
|
1064
|
+
return null;
|
|
1075
1065
|
}
|
|
1076
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: "
|
|
1066
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunk3ISYPBSX_js.translationsEn["pptx.media.title"] });
|
|
1077
1067
|
}
|
|
1078
1068
|
|
|
1079
1069
|
// src/viewer/utils/text-utils.tsx
|
|
1080
1070
|
function getTextStyleForElement(element, fallbackColor) {
|
|
1081
|
-
return
|
|
1071
|
+
return chunk4GX347MG_js.buildTextBlockStyle(element, { fallbackColor });
|
|
1082
1072
|
}
|
|
1083
1073
|
|
|
1084
1074
|
// src/viewer/utils/text-layout.tsx
|
|
@@ -1103,13 +1093,13 @@ function computeTabSize(tabStops, defaultTabSize) {
|
|
|
1103
1093
|
return avgGap > 0 ? `${Math.round(avgGap)}px` : fromDefault;
|
|
1104
1094
|
}
|
|
1105
1095
|
function getTextLayoutStyle(element) {
|
|
1106
|
-
if (!
|
|
1096
|
+
if (!chunk4GX347MG_js.hasTextProperties(element)) {
|
|
1107
1097
|
return {};
|
|
1108
1098
|
}
|
|
1109
1099
|
const verticalAlign = element.textStyle?.vAlign || "top";
|
|
1110
|
-
const writingMode =
|
|
1111
|
-
const textOrientation =
|
|
1112
|
-
const verticalDirection =
|
|
1100
|
+
const writingMode = chunk4GX347MG_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
1101
|
+
const textOrientation = chunk4GX347MG_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
1102
|
+
const verticalDirection = chunk4GX347MG_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
1113
1103
|
const parsedColumnCount = Number(element.textStyle?.columnCount);
|
|
1114
1104
|
const columnCount = Number.isFinite(parsedColumnCount) ? Math.max(1, Math.min(16, Math.round(parsedColumnCount))) : 1;
|
|
1115
1105
|
const hasColumns = columnCount > 1;
|
|
@@ -1117,7 +1107,7 @@ function getTextLayoutStyle(element) {
|
|
|
1117
1107
|
const tabStops = element.textStyle?.tabStops;
|
|
1118
1108
|
const tabSize = computeTabSize(tabStops, element.textStyle?.defaultTabSize);
|
|
1119
1109
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
1120
|
-
const hasParagraphIndents =
|
|
1110
|
+
const hasParagraphIndents = chunk4GX347MG_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
1121
1111
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
1122
1112
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
1123
1113
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
@@ -1126,7 +1116,7 @@ function getTextLayoutStyle(element) {
|
|
|
1126
1116
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
1127
1117
|
const parsedColumnSpacing = Number(element.textStyle?.columnSpacing);
|
|
1128
1118
|
const columnGap = Number.isFinite(parsedColumnSpacing) && parsedColumnSpacing > 0 ? `${parsedColumnSpacing}px` : "0.75em";
|
|
1129
|
-
const kinsokuStyles =
|
|
1119
|
+
const kinsokuStyles = chunk4GX347MG_js.getKinsokuLineBreakStyles(element.textStyle);
|
|
1130
1120
|
if (hasColumns) {
|
|
1131
1121
|
return {
|
|
1132
1122
|
display: "block",
|
|
@@ -1173,10 +1163,10 @@ function getTextLayoutStyle(element) {
|
|
|
1173
1163
|
|
|
1174
1164
|
// src/viewer/utils/text-effects.tsx
|
|
1175
1165
|
function buildTextFillCss2(style) {
|
|
1176
|
-
return
|
|
1166
|
+
return chunk4GX347MG_js.buildTextFillCss(style);
|
|
1177
1167
|
}
|
|
1178
1168
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
1179
|
-
return
|
|
1169
|
+
return chunk4GX347MG_js.buildTextBody3DSceneStyle(textStyle);
|
|
1180
1170
|
}
|
|
1181
1171
|
|
|
1182
1172
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -1361,13 +1351,13 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1361
1351
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
1362
1352
|
return renderedSegments;
|
|
1363
1353
|
}
|
|
1364
|
-
const paraKey = `${elementId}${
|
|
1354
|
+
const paraKey = `${elementId}${chunk4GX347MG_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
1365
1355
|
const paraState = subElementAnimStates.get(paraKey);
|
|
1366
1356
|
if (paraState) {
|
|
1367
1357
|
const style = buildAnimStyle(paraState);
|
|
1368
1358
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
1369
1359
|
}
|
|
1370
|
-
const spec =
|
|
1360
|
+
const spec = chunk4GX347MG_js.buildTextBuildSpec(
|
|
1371
1361
|
elementId,
|
|
1372
1362
|
paraIndex,
|
|
1373
1363
|
paraSegments.map((entry) => ({ text: entry.segment.text, style: entry })),
|
|
@@ -1385,7 +1375,7 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1385
1375
|
"span",
|
|
1386
1376
|
{
|
|
1387
1377
|
"data-anim-id": span.animId,
|
|
1388
|
-
style:
|
|
1378
|
+
style: chunk4GX347MG_js.textBuildSpanStyle(span),
|
|
1389
1379
|
children: content
|
|
1390
1380
|
},
|
|
1391
1381
|
span.animId
|
|
@@ -1529,10 +1519,10 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1529
1519
|
if (!needsScriptFonts || !text) {
|
|
1530
1520
|
return text;
|
|
1531
1521
|
}
|
|
1532
|
-
const runs =
|
|
1522
|
+
const runs = chunk4GX347MG_js.segmentByScript(text);
|
|
1533
1523
|
if (runs.length <= 1) {
|
|
1534
1524
|
if (runs.length === 1) {
|
|
1535
|
-
const font =
|
|
1525
|
+
const font = chunk4GX347MG_js.resolveFontForScript(runs[0].script, scriptFonts);
|
|
1536
1526
|
if (font && font !== baseFontFamily) {
|
|
1537
1527
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: text });
|
|
1538
1528
|
}
|
|
@@ -1540,19 +1530,41 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1540
1530
|
return text;
|
|
1541
1531
|
}
|
|
1542
1532
|
return runs.map((run, i) => {
|
|
1543
|
-
const font =
|
|
1533
|
+
const font = chunk4GX347MG_js.resolveFontForScript(run.script, scriptFonts);
|
|
1544
1534
|
if (!font || font === baseFontFamily) {
|
|
1545
1535
|
return /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Fragment, { children: run.text }, `${keyPrefix}-r${i}`);
|
|
1546
1536
|
}
|
|
1547
1537
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: run.text }, `${keyPrefix}-r${i}`);
|
|
1548
1538
|
});
|
|
1549
1539
|
}
|
|
1550
|
-
function
|
|
1540
|
+
function renderMetricPieces(text, metric, keyPrefix, inner) {
|
|
1541
|
+
if (!metric || !text) {
|
|
1542
|
+
return inner(text, keyPrefix);
|
|
1543
|
+
}
|
|
1544
|
+
const pieces = chunk4GX347MG_js.splitRunForMetrics(text, metric.font);
|
|
1545
|
+
if (pieces.length <= 1) {
|
|
1546
|
+
return inner(text, keyPrefix);
|
|
1547
|
+
}
|
|
1548
|
+
return pieces.map((piece, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1549
|
+
"span",
|
|
1550
|
+
{
|
|
1551
|
+
style: { letterSpacing: chunk4GX347MG_js.pieceLetterSpacing(metric.authoredPx, piece.tracking) },
|
|
1552
|
+
children: inner(piece.text, `${keyPrefix}-w${i}`)
|
|
1553
|
+
},
|
|
1554
|
+
`${keyPrefix}-w${i}`
|
|
1555
|
+
));
|
|
1556
|
+
}
|
|
1557
|
+
function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsScriptFonts, scriptFonts, baseFontFamily, findHighlights, tabContext, metric) {
|
|
1551
1558
|
const segHl = findHighlights?.get(segmentIndex);
|
|
1552
1559
|
if (!segHl || segHl.length === 0) {
|
|
1553
1560
|
return lines.map((line, lineIndex) => {
|
|
1554
1561
|
const lineKey = `${elementId}-seg-${segmentIndex}-line-${lineIndex}`;
|
|
1555
|
-
const renderPiece = (text, key) =>
|
|
1562
|
+
const renderPiece = (text, key) => renderMetricPieces(
|
|
1563
|
+
text,
|
|
1564
|
+
metric,
|
|
1565
|
+
key,
|
|
1566
|
+
(pieceText, pieceKey) => renderScriptAwareText(pieceText, needsScriptFonts, scriptFonts, baseFontFamily, pieceKey)
|
|
1567
|
+
);
|
|
1556
1568
|
return /* @__PURE__ */ jsxRuntime.jsxs(React6__default.default.Fragment, { children: [
|
|
1557
1569
|
tabContext && line.includes(" ") ? renderTabbedLine(line, tabContext, lineKey, renderPiece) : renderPiece(line, lineKey),
|
|
1558
1570
|
lineIndex < lines.length - 1 ? /* @__PURE__ */ jsxRuntime.jsx("br", {}) : null
|
|
@@ -1584,8 +1596,15 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1584
1596
|
isCurrent: false
|
|
1585
1597
|
});
|
|
1586
1598
|
}
|
|
1587
|
-
|
|
1588
|
-
|
|
1599
|
+
const renderChunk = (text, key) => renderMetricPieces(
|
|
1600
|
+
text,
|
|
1601
|
+
metric,
|
|
1602
|
+
key,
|
|
1603
|
+
(pieceText, pieceKey) => renderScriptAwareText(pieceText, needsScriptFonts, scriptFonts, baseFontFamily, pieceKey)
|
|
1604
|
+
);
|
|
1605
|
+
return chunks.map((chunk, ci) => {
|
|
1606
|
+
const chunkKey = `${elementId}-seg-${segmentIndex}-hl-${ci}`;
|
|
1607
|
+
return chunk.highlighted ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1589
1608
|
"mark",
|
|
1590
1609
|
{
|
|
1591
1610
|
style: {
|
|
@@ -1593,27 +1612,15 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1593
1612
|
color: "inherit",
|
|
1594
1613
|
borderRadius: 2
|
|
1595
1614
|
},
|
|
1596
|
-
children:
|
|
1597
|
-
chunk.text,
|
|
1598
|
-
needsScriptFonts,
|
|
1599
|
-
scriptFonts,
|
|
1600
|
-
baseFontFamily,
|
|
1601
|
-
`${elementId}-seg-${segmentIndex}-hl-${ci}`
|
|
1602
|
-
)
|
|
1615
|
+
children: renderChunk(chunk.text, chunkKey)
|
|
1603
1616
|
},
|
|
1604
|
-
|
|
1605
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Fragment, { children:
|
|
1606
|
-
|
|
1607
|
-
needsScriptFonts,
|
|
1608
|
-
scriptFonts,
|
|
1609
|
-
baseFontFamily,
|
|
1610
|
-
`${elementId}-seg-${segmentIndex}-hl-${ci}`
|
|
1611
|
-
) }, `${elementId}-seg-${segmentIndex}-hl-${ci}`)
|
|
1612
|
-
);
|
|
1617
|
+
chunkKey
|
|
1618
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Fragment, { children: renderChunk(chunk.text, chunkKey) }, chunkKey);
|
|
1619
|
+
});
|
|
1613
1620
|
}
|
|
1614
1621
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
1615
|
-
const mathml =
|
|
1616
|
-
const safeMathml = mathml ?
|
|
1622
|
+
const mathml = chunk4GX347MG_js.convertOmmlToMathMl(equationXml);
|
|
1623
|
+
const safeMathml = mathml ? chunk4GX347MG_js.sanitizeMathMl(mathml) : "";
|
|
1617
1624
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1618
1625
|
"span",
|
|
1619
1626
|
{
|
|
@@ -1663,7 +1670,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1663
1670
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: equationContent }, `${elementId}-seg-${segmentIndex}`);
|
|
1664
1671
|
}
|
|
1665
1672
|
function renderPictureBullet(elementId, segmentIndex, bulletInfo, baseFontSize) {
|
|
1666
|
-
const picture =
|
|
1673
|
+
const picture = chunk4GX347MG_js.resolvePictureBullet(bulletInfo, baseFontSize) ?? {
|
|
1667
1674
|
sizePx: baseFontSize,
|
|
1668
1675
|
fallbackMarker: "\u2022",
|
|
1669
1676
|
accessibleLabel: "Bullet"
|
|
@@ -1714,7 +1721,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1714
1721
|
}
|
|
1715
1722
|
const segmentStyle = segment.style || {};
|
|
1716
1723
|
const rawText = bulletInfo && typeof bulletHangPx === "number" ? (segment.text || "").trimEnd() : segment.text || "";
|
|
1717
|
-
const textValue =
|
|
1724
|
+
const textValue = chunk4GX347MG_js.substituteFieldText(rawText, segment.fieldType, fieldContext);
|
|
1718
1725
|
const lines = textValue.split("\n");
|
|
1719
1726
|
const textDecorationTokens = [];
|
|
1720
1727
|
if (segmentStyle.underline || segmentStyle.hyperlink) {
|
|
@@ -1724,28 +1731,28 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1724
1731
|
textDecorationTokens.push("line-through");
|
|
1725
1732
|
}
|
|
1726
1733
|
const isDoubleStrike = segmentStyle.strikethrough && segmentStyle.strikeType === "dblStrike";
|
|
1727
|
-
const resolvedSegmentColor = segmentStyle.hyperlink ?
|
|
1728
|
-
const underlineDecoration =
|
|
1734
|
+
const resolvedSegmentColor = segmentStyle.hyperlink ? chunk4GX347MG_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, HYPERLINK_COLOR) : chunk4GX347MG_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, fallbackColor);
|
|
1735
|
+
const underlineDecoration = chunk4GX347MG_js.resolveUnderlineDecorationStyle(
|
|
1729
1736
|
Boolean(isDoubleStrike),
|
|
1730
1737
|
segmentStyle.underlineStyle
|
|
1731
1738
|
);
|
|
1732
1739
|
const rawBaseline = typeof segmentStyle.baseline === "number" ? segmentStyle.baseline : 0;
|
|
1733
1740
|
const baselineFraction = rawBaseline === 0 ? 0 : Math.abs(rawBaseline) >= 1e3 ? rawBaseline / 1e5 : rawBaseline / 100;
|
|
1734
1741
|
const baselineFontScale = baselineFraction !== 0 ? 0.65 : 1;
|
|
1735
|
-
const
|
|
1742
|
+
const authoredLetterSpacing = typeof segmentStyle.characterSpacing === "number" && segmentStyle.characterSpacing !== 0 ? segmentStyle.characterSpacing / 100 * (96 / 72) : 0;
|
|
1736
1743
|
const textFillStyles = buildTextFillCss2(segmentStyle);
|
|
1737
1744
|
const rawFontSize = segmentStyle.fontSize || element.textStyle?.fontSize || DEFAULT_TEXT_FONT_SIZE;
|
|
1738
|
-
const autoFitScale =
|
|
1745
|
+
const autoFitScale = chunk4GX347MG_js.resolveAutoFitFontScale(element.textStyle);
|
|
1739
1746
|
const baseFontSize = rawFontSize * autoFitScale;
|
|
1740
1747
|
const baselineShift = baselineFraction !== 0 ? `${baselineFraction * baseFontSize}px` : void 0;
|
|
1741
1748
|
const baseFontSizePt = baseFontSize * (72 / 96);
|
|
1742
1749
|
const fontKerning = typeof segmentStyle.kerning === "number" ? segmentStyle.kerning === 0 ? "none" : baseFontSizePt >= segmentStyle.kerning / 100 ? "normal" : "none" : void 0;
|
|
1743
1750
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
1744
|
-
const baseFontFamily = rawFontFamily ?
|
|
1751
|
+
const baseFontFamily = rawFontFamily ? chunk4GX347MG_js.getSubstituteFontFamily(
|
|
1745
1752
|
rawFontFamily,
|
|
1746
|
-
|
|
1753
|
+
chunk4GX347MG_js.parsePanoseString(segmentStyle.latinFontPanose ?? element.textStyle?.latinFontPanose)
|
|
1747
1754
|
) : DEFAULT_FONT_FAMILY2;
|
|
1748
|
-
const scriptFont = (name, panose) => name ?
|
|
1755
|
+
const scriptFont = (name, panose) => name ? chunk4GX347MG_js.getSubstituteFontFamily(name, chunk4GX347MG_js.parsePanoseString(panose)) : baseFontFamily;
|
|
1749
1756
|
const scriptFonts = {
|
|
1750
1757
|
latin: baseFontFamily,
|
|
1751
1758
|
eastAsia: scriptFont(
|
|
@@ -1761,7 +1768,18 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1761
1768
|
segmentStyle.symbolFontPanose ?? element.textStyle?.symbolFontPanose
|
|
1762
1769
|
)
|
|
1763
1770
|
};
|
|
1764
|
-
const needsScriptFonts =
|
|
1771
|
+
const needsScriptFonts = chunk4GX347MG_js.hasDistinctScriptFonts(scriptFonts);
|
|
1772
|
+
const metricFont = {
|
|
1773
|
+
fontFamily: baseFontFamily,
|
|
1774
|
+
fontSizePx: baseFontSize * baselineFontScale,
|
|
1775
|
+
bold: Boolean(segmentStyle.bold),
|
|
1776
|
+
italic: Boolean(segmentStyle.italic)
|
|
1777
|
+
};
|
|
1778
|
+
const metricContext = { font: metricFont, authoredPx: authoredLetterSpacing };
|
|
1779
|
+
const letterSpacing = chunk4GX347MG_js.pieceLetterSpacing(
|
|
1780
|
+
authoredLetterSpacing,
|
|
1781
|
+
chunk4GX347MG_js.resolveMetricTrackingPx(textValue, metricFont)
|
|
1782
|
+
);
|
|
1765
1783
|
const spanStyle = {
|
|
1766
1784
|
color: resolvedSegmentColor,
|
|
1767
1785
|
fontSize: baseFontSize * baselineFontScale,
|
|
@@ -1779,15 +1797,15 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1779
1797
|
fontVariantCaps: segmentStyle.textCaps === "small" ? "small-caps" : void 0,
|
|
1780
1798
|
letterSpacing,
|
|
1781
1799
|
fontKerning,
|
|
1782
|
-
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ?
|
|
1800
|
+
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ? chunk4GX347MG_js.normalizeHexColor(segmentStyle.highlightColor, "transparent") : void 0,
|
|
1783
1801
|
...textFillStyles,
|
|
1784
|
-
textDecorationColor: segmentStyle.underlineColor ?
|
|
1785
|
-
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${
|
|
1802
|
+
textDecorationColor: segmentStyle.underlineColor ? chunk4GX347MG_js.normalizeHexColor(segmentStyle.underlineColor, void 0) : void 0,
|
|
1803
|
+
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${chunk4GX347MG_js.normalizeHexColor(segmentStyle.textOutlineColor, "#000000")}` : segmentStyle.textOutlineWidth ? `${segmentStyle.textOutlineWidth}px currentColor` : void 0,
|
|
1786
1804
|
paintOrder: segmentStyle.textOutlineWidth ? "stroke fill" : void 0,
|
|
1787
|
-
textShadow:
|
|
1788
|
-
filter:
|
|
1789
|
-
opacity:
|
|
1790
|
-
WebkitBoxReflect:
|
|
1805
|
+
textShadow: chunk4GX347MG_js.buildTextShadowCss(segmentStyle),
|
|
1806
|
+
filter: chunk4GX347MG_js.buildTextRunFilterChain(segmentStyle),
|
|
1807
|
+
opacity: chunk4GX347MG_js.getTextAlphaOpacity(segmentStyle),
|
|
1808
|
+
WebkitBoxReflect: chunk4GX347MG_js.buildTextReflectionCss(segmentStyle)
|
|
1791
1809
|
};
|
|
1792
1810
|
const runRtl = segmentStyle.rtl;
|
|
1793
1811
|
if (runRtl !== void 0 && runRtl !== paragraphRtl) {
|
|
@@ -1807,7 +1825,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1807
1825
|
spanStyle.fontSize = baseFontSize * (bulletInfo.sizePercent / 100) * baselineFontScale;
|
|
1808
1826
|
}
|
|
1809
1827
|
if (bulletInfo.color) {
|
|
1810
|
-
spanStyle.color =
|
|
1828
|
+
spanStyle.color = chunk4GX347MG_js.normalizeHexColor(bulletInfo.color, resolvedSegmentColor);
|
|
1811
1829
|
}
|
|
1812
1830
|
if (typeof bulletHangPx === "number" && bulletHangPx > 0) {
|
|
1813
1831
|
spanStyle.display = "inline-block";
|
|
@@ -1841,7 +1859,8 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1841
1859
|
baseFontFamily,
|
|
1842
1860
|
Boolean(segmentStyle.bold),
|
|
1843
1861
|
Boolean(segmentStyle.italic)
|
|
1844
|
-
)
|
|
1862
|
+
),
|
|
1863
|
+
metricContext
|
|
1845
1864
|
);
|
|
1846
1865
|
let innerContent;
|
|
1847
1866
|
if (hasRuby) {
|
|
@@ -1852,7 +1871,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1852
1871
|
textAlign: segment.rubyAlignment === "l" ? "left" : segment.rubyAlignment === "r" ? "right" : segment.rubyAlignment === "dist" || segment.rubyAlignment === "distCat" || segment.rubyAlignment === "distLetter" ? "justify" : "center"
|
|
1853
1872
|
};
|
|
1854
1873
|
if (segment.rubyStyle?.color) {
|
|
1855
|
-
rubyStyle.color =
|
|
1874
|
+
rubyStyle.color = chunk4GX347MG_js.normalizeHexColor(segment.rubyStyle.color, resolvedSegmentColor);
|
|
1856
1875
|
}
|
|
1857
1876
|
innerContent = /* @__PURE__ */ jsxRuntime.jsxs("ruby", { children: [
|
|
1858
1877
|
baseContent,
|
|
@@ -1925,7 +1944,7 @@ function resolveParagraphSpacing(input) {
|
|
|
1925
1944
|
if (typeof exactPt === "number" && exactPt > 0) {
|
|
1926
1945
|
result.lineHeight = `${exactPt * PT_TO_PX}px`;
|
|
1927
1946
|
} else if (typeof multiplier === "number" && multiplier > 0) {
|
|
1928
|
-
result.lineHeight =
|
|
1947
|
+
result.lineHeight = chunk4GX347MG_js.proportionalLineHeight(multiplier);
|
|
1929
1948
|
}
|
|
1930
1949
|
return result;
|
|
1931
1950
|
}
|
|
@@ -1947,7 +1966,7 @@ function groupSegmentsIntoParagraphs(segments) {
|
|
|
1947
1966
|
return paragraphs;
|
|
1948
1967
|
}
|
|
1949
1968
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick) {
|
|
1950
|
-
if (!
|
|
1969
|
+
if (!chunk4GX347MG_js.hasTextProperties(element)) {
|
|
1951
1970
|
return emptyFallback || null;
|
|
1952
1971
|
}
|
|
1953
1972
|
const effectiveSegments = segmentOverrides ?? element.textSegments;
|
|
@@ -1968,10 +1987,10 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
1968
1987
|
return element.text || emptyFallback || "";
|
|
1969
1988
|
}
|
|
1970
1989
|
const paragraphs = groupSegmentsIntoParagraphs(effectiveSegments);
|
|
1971
|
-
const paragraphIndents =
|
|
1972
|
-
const elementRtl =
|
|
1973
|
-
const elementAlign =
|
|
1974
|
-
const bodyStyle =
|
|
1990
|
+
const paragraphIndents = chunk4GX347MG_js.hasTextProperties(element) ? element.paragraphIndents : void 0;
|
|
1991
|
+
const elementRtl = chunk4GX347MG_js.hasTextProperties(element) ? element.textStyle?.rtl : void 0;
|
|
1992
|
+
const elementAlign = chunk4GX347MG_js.hasTextProperties(element) ? element.textStyle?.align : void 0;
|
|
1993
|
+
const bodyStyle = chunk4GX347MG_js.hasTextProperties(element) ? element.textStyle : void 0;
|
|
1975
1994
|
const spaceFirstLast = bodyStyle?.spaceFirstLastParagraph !== false;
|
|
1976
1995
|
return paragraphs.map(({ entries: paraSegments, terminator }, paraIndex) => {
|
|
1977
1996
|
const paraIndent = paragraphIndents?.[paraIndex];
|
|
@@ -1986,14 +2005,14 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
1986
2005
|
return Boolean(segment.text) && segment.text.trim().length > 0;
|
|
1987
2006
|
});
|
|
1988
2007
|
const hasBullet = bulletInfo && !bulletInfo.none && hasVisibleTextContent;
|
|
1989
|
-
const paraRtl =
|
|
2008
|
+
const paraRtl = chunk4GX347MG_js.resolveParagraphRtl(paraSegments, elementRtl);
|
|
1990
2009
|
const isRtlParagraph = paraRtl === true;
|
|
1991
|
-
const paraAlign =
|
|
1992
|
-
const cssTextAlign =
|
|
2010
|
+
const paraAlign = chunk4GX347MG_js.resolveParagraphAlign(paraSegments, elementAlign);
|
|
2011
|
+
const cssTextAlign = chunk4GX347MG_js.resolveCssTextAlign(paraAlign, isRtlParagraph);
|
|
1993
2012
|
const paraMarginLeft = isRtlParagraph ? void 0 : rawMarginLeft;
|
|
1994
2013
|
const paraMarginRight = isRtlParagraph ? rawMarginLeft : void 0;
|
|
1995
2014
|
const paraTextIndent = rawTextIndent;
|
|
1996
|
-
const paraKinsokuStyle =
|
|
2015
|
+
const paraKinsokuStyle = chunk4GX347MG_js.getKinsokuLineBreakStyles(firstSeg?.segment.style);
|
|
1997
2016
|
const hasParaKinsoku = Object.keys(paraKinsokuStyle).length > 0;
|
|
1998
2017
|
const paraProps = effectiveSegments[firstSeg?.globalIndex ?? -1]?.paragraphProperties ?? (paraSegments.length === 0 ? terminator?.paragraphProperties : void 0);
|
|
1999
2018
|
const spacing = resolveParagraphSpacing({
|
|
@@ -2003,7 +2022,7 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2003
2022
|
isLast: paraIndex === paragraphs.length - 1,
|
|
2004
2023
|
spaceFirstLast
|
|
2005
2024
|
});
|
|
2006
|
-
const strutFontSize =
|
|
2025
|
+
const strutFontSize = chunk4GX347MG_js.resolveParagraphStrutFontSize(
|
|
2007
2026
|
paraSegments.length > 0 ? paraSegments.map(({ segment }) => segment) : terminator ? [terminator] : [],
|
|
2008
2027
|
bodyStyle?.fontSize
|
|
2009
2028
|
);
|
|
@@ -2107,13 +2126,13 @@ function hexToRgbUnit(hex) {
|
|
|
2107
2126
|
};
|
|
2108
2127
|
}
|
|
2109
2128
|
function getDuotoneColors(element) {
|
|
2110
|
-
if (!
|
|
2129
|
+
if (!chunk4GX347MG_js.isImageLikeElement(element)) {
|
|
2111
2130
|
return void 0;
|
|
2112
2131
|
}
|
|
2113
2132
|
return element.imageEffects?.duotone;
|
|
2114
2133
|
}
|
|
2115
2134
|
function buildLineShadowCss(element) {
|
|
2116
|
-
if (!
|
|
2135
|
+
if (!chunk4GX347MG_js.hasShapeProperties(element)) {
|
|
2117
2136
|
return void 0;
|
|
2118
2137
|
}
|
|
2119
2138
|
const ss = element.shapeStyle;
|
|
@@ -2124,13 +2143,13 @@ function buildLineShadowCss(element) {
|
|
|
2124
2143
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
2125
2144
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
2126
2145
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
2127
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
2128
|
-
|
|
2146
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunk4GX347MG_js.colorWithOpacity(
|
|
2147
|
+
chunk4GX347MG_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
2129
2148
|
opacity
|
|
2130
2149
|
)}`;
|
|
2131
2150
|
}
|
|
2132
2151
|
function buildLineGlowFilter(element) {
|
|
2133
|
-
if (!
|
|
2152
|
+
if (!chunk4GX347MG_js.hasShapeProperties(element)) {
|
|
2134
2153
|
return void 0;
|
|
2135
2154
|
}
|
|
2136
2155
|
const ss = element.shapeStyle;
|
|
@@ -2139,7 +2158,7 @@ function buildLineGlowFilter(element) {
|
|
|
2139
2158
|
}
|
|
2140
2159
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
2141
2160
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
2142
|
-
const glowCol =
|
|
2161
|
+
const glowCol = chunk4GX347MG_js.colorWithOpacity(chunk4GX347MG_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
2143
2162
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
2144
2163
|
}
|
|
2145
2164
|
function mapDagBlendModeToCss(blend) {
|
|
@@ -2163,7 +2182,7 @@ function getDagDuotoneFilterId(elementId) {
|
|
|
2163
2182
|
return `dag-duotone-${elementId}`;
|
|
2164
2183
|
}
|
|
2165
2184
|
function hasDagDuotoneEffect(element) {
|
|
2166
|
-
if (!
|
|
2185
|
+
if (!chunk4GX347MG_js.hasShapeProperties(element)) {
|
|
2167
2186
|
return false;
|
|
2168
2187
|
}
|
|
2169
2188
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
@@ -2226,7 +2245,7 @@ function getRoundRectRadiusPx(element) {
|
|
|
2226
2245
|
|
|
2227
2246
|
// src/viewer/utils/shape-visual-3d.ts
|
|
2228
2247
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
2229
|
-
return
|
|
2248
|
+
return chunk4GX347MG_js.build3DExtrusionData(
|
|
2230
2249
|
shape3d,
|
|
2231
2250
|
scene3d,
|
|
2232
2251
|
fillColor,
|
|
@@ -2235,7 +2254,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
2235
2254
|
);
|
|
2236
2255
|
}
|
|
2237
2256
|
function apply3dEffects2(base, scene3d, shape3d, fillColorFallback) {
|
|
2238
|
-
|
|
2257
|
+
chunk4GX347MG_js.apply3dEffects(base, scene3d, shape3d, fillColorFallback);
|
|
2239
2258
|
}
|
|
2240
2259
|
|
|
2241
2260
|
// src/viewer/utils/shape-visual-style.ts
|
|
@@ -2243,43 +2262,43 @@ function getGradientTilingCss(style) {
|
|
|
2243
2262
|
if (!style || style.fillMode !== "gradient") {
|
|
2244
2263
|
return void 0;
|
|
2245
2264
|
}
|
|
2246
|
-
const isStructuredLinear = (style.fillGradientType || "linear") === "linear" &&
|
|
2265
|
+
const isStructuredLinear = (style.fillGradientType || "linear") === "linear" && chunk4GX347MG_js.sanitizeGradientStops(style.fillGradientStops).length > 0;
|
|
2247
2266
|
if (isStructuredLinear) {
|
|
2248
|
-
const flip =
|
|
2267
|
+
const flip = chunk4GX347MG_js.getGradientTileFlipCss(style.fillGradientFlip);
|
|
2249
2268
|
if (flip) {
|
|
2250
2269
|
return flip;
|
|
2251
2270
|
}
|
|
2252
2271
|
}
|
|
2253
|
-
return
|
|
2272
|
+
return chunk4GX347MG_js.getGradientTileRectCss(style.fillGradientTileRect);
|
|
2254
2273
|
}
|
|
2255
2274
|
function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2256
|
-
if (!
|
|
2275
|
+
if (!chunk4GX347MG_js.hasShapeProperties(element)) {
|
|
2257
2276
|
return {};
|
|
2258
2277
|
}
|
|
2259
2278
|
const normalizedShapeType = getShapeType(element.shapeType);
|
|
2260
|
-
const clipPath =
|
|
2279
|
+
const clipPath = chunk4GX347MG_js.isIdentityRectClip(element) ? void 0 : chunk4GX347MG_js.getResolvedShapeClipPath(element);
|
|
2261
2280
|
const rendersCustomVectorPath = (element.type === "shape" || element.type === "image" || element.type === "picture") && Boolean(element.pathData) && typeof element.pathWidth === "number" && element.pathWidth > 0 && typeof element.pathHeight === "number" && element.pathHeight > 0;
|
|
2262
|
-
const rendersStrokeOnlyPreset =
|
|
2281
|
+
const rendersStrokeOnlyPreset = chunk4GX347MG_js.isStrokeOnlyPresetElement(element);
|
|
2263
2282
|
const fillOpacity = element.shapeStyle?.fillOpacity;
|
|
2264
2283
|
const strokeOpacity = element.shapeStyle?.strokeOpacity;
|
|
2265
|
-
const strokeDash =
|
|
2266
|
-
const fillGradient =
|
|
2284
|
+
const strokeDash = chunk4GX347MG_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2285
|
+
const fillGradient = chunk4GX347MG_js.buildCssGradientFromShapeStyle(element.shapeStyle, {
|
|
2267
2286
|
rotation: element.rotation,
|
|
2268
2287
|
width: element.width,
|
|
2269
2288
|
height: element.height
|
|
2270
2289
|
}) || element.shapeStyle?.fillGradient;
|
|
2271
|
-
const shadowCss =
|
|
2272
|
-
const innerShadowCss =
|
|
2273
|
-
const resolvedFillColor =
|
|
2274
|
-
const resolvedStrokeColor =
|
|
2290
|
+
const shadowCss = chunk4GX347MG_js.buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
2291
|
+
const innerShadowCss = chunk4GX347MG_js.buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
2292
|
+
const resolvedFillColor = chunk4GX347MG_js.colorWithOpacity(fillColor, fillOpacity);
|
|
2293
|
+
const resolvedStrokeColor = chunk4GX347MG_js.colorWithOpacity(strokeColor, strokeOpacity);
|
|
2275
2294
|
const ss = element.shapeStyle;
|
|
2276
2295
|
const gradientTiling = getGradientTilingCss(ss);
|
|
2277
|
-
const paintsGradientOutline =
|
|
2296
|
+
const paintsGradientOutline = chunk4GX347MG_js.suppressesCssBorder(element);
|
|
2278
2297
|
const hasFillOverlayColor = Boolean(
|
|
2279
2298
|
ss?.dagFillOverlayColor && ss.dagFillOverlayColor !== "transparent"
|
|
2280
2299
|
);
|
|
2281
2300
|
const combinedShadowParts = [];
|
|
2282
|
-
const multiLayerShadow =
|
|
2301
|
+
const multiLayerShadow = chunk4GX347MG_js.buildMultiLayerShadowCss(element.shapeStyle);
|
|
2283
2302
|
if (multiLayerShadow) {
|
|
2284
2303
|
combinedShadowParts.push(multiLayerShadow);
|
|
2285
2304
|
} else if (shadowCss) {
|
|
@@ -2288,7 +2307,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2288
2307
|
if (innerShadowCss) {
|
|
2289
2308
|
combinedShadowParts.push(innerShadowCss);
|
|
2290
2309
|
}
|
|
2291
|
-
const glowBoxShadow =
|
|
2310
|
+
const glowBoxShadow = chunk4GX347MG_js.buildGlowBoxShadow(ss?.glowColor, ss?.glowRadius, ss?.glowOpacity);
|
|
2292
2311
|
if (glowBoxShadow) {
|
|
2293
2312
|
combinedShadowParts.push(glowBoxShadow);
|
|
2294
2313
|
}
|
|
@@ -2296,7 +2315,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2296
2315
|
if (lineShadow) {
|
|
2297
2316
|
combinedShadowParts.push(lineShadow);
|
|
2298
2317
|
}
|
|
2299
|
-
const compoundLineShadow =
|
|
2318
|
+
const compoundLineShadow = chunk4GX347MG_js.getCompoundLineBoxShadow(
|
|
2300
2319
|
element.shapeStyle?.compoundLine,
|
|
2301
2320
|
strokeWidth,
|
|
2302
2321
|
resolvedStrokeColor
|
|
@@ -2309,11 +2328,11 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2309
2328
|
if (ss?.glowColor && ss.glowColor !== "transparent" && ss.glowRadius) {
|
|
2310
2329
|
const glowOpacity = typeof ss.glowOpacity === "number" ? ss.glowOpacity : 0.75;
|
|
2311
2330
|
const glowRad = Math.round(Math.max(0, ss.glowRadius));
|
|
2312
|
-
const glowCol =
|
|
2331
|
+
const glowCol = chunk4GX347MG_js.colorWithOpacity(chunk4GX347MG_js.normalizeHexColor(ss.glowColor, "#ffff00"), glowOpacity);
|
|
2313
2332
|
filterParts.push(`drop-shadow(0 0 ${glowRad}px ${glowCol})`);
|
|
2314
2333
|
}
|
|
2315
2334
|
if (typeof ss?.softEdgeRadius === "number" && ss.softEdgeRadius > 0) {
|
|
2316
|
-
filterParts.push(`url(#${
|
|
2335
|
+
filterParts.push(`url(#${chunk4GX347MG_js.getSoftEdgeFilterId(element.id)})`);
|
|
2317
2336
|
}
|
|
2318
2337
|
if (typeof ss?.blurRadius === "number" && ss.blurRadius > 0) {
|
|
2319
2338
|
filterParts.push(`blur(${Math.round(ss.blurRadius)}px)`);
|
|
@@ -2322,13 +2341,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2322
2341
|
if (lineGlowCss) {
|
|
2323
2342
|
filterParts.push(lineGlowCss);
|
|
2324
2343
|
}
|
|
2325
|
-
const dagFilter =
|
|
2344
|
+
const dagFilter = chunk4GX347MG_js.getEffectDagFilter(ss, element.id);
|
|
2326
2345
|
if (dagFilter) {
|
|
2327
2346
|
filterParts.push(dagFilter);
|
|
2328
2347
|
}
|
|
2329
2348
|
const lineJoinCss = ss?.lineJoin === "round" ? "round" : ss?.lineJoin === "bevel" ? "bevel" : ss?.lineJoin === "miter" ? "miter" : void 0;
|
|
2330
2349
|
const miterLimitCss = ss?.lineJoin === "miter" && typeof ss?.miterLimit === "number" ? Math.max(ss.miterLimit / 1e5, 1) : void 0;
|
|
2331
|
-
const patternFill =
|
|
2350
|
+
const patternFill = chunk4GX347MG_js.buildPatternFillCss(element.shapeStyle);
|
|
2332
2351
|
const imageFillUrl = ss?.fillMode === "image" && ss.fillImageUrl ? ss.fillImageUrl : void 0;
|
|
2333
2352
|
const imageFillMode = ss?.fillImageMode || "stretch";
|
|
2334
2353
|
let reflectCss;
|
|
@@ -2340,7 +2359,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2340
2359
|
const endOpacity = typeof ss.reflectionEndOpacity === "number" ? ss.reflectionEndOpacity : 0;
|
|
2341
2360
|
const fadeLength = typeof ss.reflectionEndPosition === "number" ? Math.round(ss.reflectionEndPosition * Math.max(element.height, 1)) : 100;
|
|
2342
2361
|
const blurRadius = typeof ss.reflectionBlurRadius === "number" ? ss.reflectionBlurRadius : 0;
|
|
2343
|
-
reflectCss =
|
|
2362
|
+
reflectCss = chunk4GX347MG_js.buildReflectionCss(distance, startOpacity, endOpacity, fadeLength, blurRadius);
|
|
2344
2363
|
}
|
|
2345
2364
|
}
|
|
2346
2365
|
const base = {
|
|
@@ -2386,9 +2405,9 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2386
2405
|
// path following the shape's geometry, because a CSS border can only take
|
|
2387
2406
|
// one colour. Keeping the border too would draw the parser's averaged
|
|
2388
2407
|
// solid underneath the gradient.
|
|
2389
|
-
borderWidth: strokeWidth > 0 && !paintsGradientOutline ?
|
|
2408
|
+
borderWidth: strokeWidth > 0 && !paintsGradientOutline ? chunk4GX347MG_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : 0,
|
|
2390
2409
|
borderColor: strokeWidth > 0 && !paintsGradientOutline ? resolvedStrokeColor : void 0,
|
|
2391
|
-
borderStyle: strokeWidth > 0 && !paintsGradientOutline ?
|
|
2410
|
+
borderStyle: strokeWidth > 0 && !paintsGradientOutline ? chunk4GX347MG_js.getCssBorderDashStyle(strokeDash, ss?.compoundLine) : void 0,
|
|
2392
2411
|
strokeLinejoin: lineJoinCss,
|
|
2393
2412
|
strokeMiterlimit: miterLimitCss,
|
|
2394
2413
|
strokeLinecap: ss?.lineCap === "rnd" ? "round" : ss?.lineCap === "sq" ? "square" : ss?.lineCap === "flat" ? "butt" : void 0
|
|
@@ -2448,7 +2467,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2448
2467
|
borderWidth: 0,
|
|
2449
2468
|
borderTopWidth: Math.max(strokeWidth, 2),
|
|
2450
2469
|
borderTopColor: resolvedStrokeColor,
|
|
2451
|
-
borderTopStyle:
|
|
2470
|
+
borderTopStyle: chunk4GX347MG_js.getCssBorderDashStyle(strokeDash)
|
|
2452
2471
|
};
|
|
2453
2472
|
}
|
|
2454
2473
|
if (normalizedShapeType === "cylinder") {
|
|
@@ -2462,13 +2481,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2462
2481
|
function getConnectorAdjustment(element, key, fallback) {
|
|
2463
2482
|
const direct = element.shapeAdjustments?.[key];
|
|
2464
2483
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
2465
|
-
return
|
|
2484
|
+
return chunk4GX347MG_js.clampUnitInterval(direct / 1e5);
|
|
2466
2485
|
}
|
|
2467
2486
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
2468
2487
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
2469
|
-
return
|
|
2488
|
+
return chunk4GX347MG_js.clampUnitInterval(fallbackKey / 1e5);
|
|
2470
2489
|
}
|
|
2471
|
-
return
|
|
2490
|
+
return chunk4GX347MG_js.clampUnitInterval(fallback);
|
|
2472
2491
|
}
|
|
2473
2492
|
function getConnectorPathGeometry(element) {
|
|
2474
2493
|
const width = Math.max(element.width, 0);
|
|
@@ -2601,7 +2620,7 @@ function toHexByte(value) {
|
|
|
2601
2620
|
return clamped.toString(16).padStart(2, "0");
|
|
2602
2621
|
}
|
|
2603
2622
|
function shiftHex(hex, factor, towardsWhite) {
|
|
2604
|
-
const channels =
|
|
2623
|
+
const channels = chunk4GX347MG_js.hexToRgbChannels(hex);
|
|
2605
2624
|
if (!channels) {
|
|
2606
2625
|
return hex;
|
|
2607
2626
|
}
|
|
@@ -2627,7 +2646,7 @@ function buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity) {
|
|
|
2627
2646
|
const fillOff = subpath.fillMode === "none" || !hasFill;
|
|
2628
2647
|
return {
|
|
2629
2648
|
d: subpath.d,
|
|
2630
|
-
fill: fillOff ? "none" :
|
|
2649
|
+
fill: fillOff ? "none" : chunk4GX347MG_js.colorWithOpacity(adjustFillForMode(fillColor, subpath.fillMode), fillOpacity),
|
|
2631
2650
|
stroked: subpath.stroke !== false
|
|
2632
2651
|
};
|
|
2633
2652
|
});
|
|
@@ -2643,11 +2662,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
|
|
|
2643
2662
|
strokePaint,
|
|
2644
2663
|
strokeWidth,
|
|
2645
2664
|
dashArray,
|
|
2646
|
-
lineCap:
|
|
2665
|
+
lineCap: chunk4GX347MG_js.svgLineCap(shapeStyle?.lineCap),
|
|
2647
2666
|
lineJoin,
|
|
2648
2667
|
miterLimit,
|
|
2649
|
-
offsets:
|
|
2650
|
-
widths:
|
|
2668
|
+
offsets: chunk4GX347MG_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
2669
|
+
widths: chunk4GX347MG_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
|
|
2651
2670
|
};
|
|
2652
2671
|
}
|
|
2653
2672
|
function strokeStrands(d, keyBase, ctx) {
|
|
@@ -2695,9 +2714,9 @@ function gradientDefs(gradient) {
|
|
|
2695
2714
|
}
|
|
2696
2715
|
function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredPaths, shapeStyle, hasFill, fillColor, fillOpacity, strokePaint, strokeWidth, dashArray, animatesFill = false, gradient) {
|
|
2697
2716
|
const ctx = strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray);
|
|
2698
|
-
const subpaths = structuredPaths && structuredPaths.length > 0 ?
|
|
2717
|
+
const subpaths = structuredPaths && structuredPaths.length > 0 ? chunk4GX347MG_js.customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
2699
2718
|
const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
|
|
2700
|
-
const gradientPaint = gradient ?
|
|
2719
|
+
const gradientPaint = gradient ? chunk4GX347MG_js.svgGradientFillRef(gradient) : void 0;
|
|
2701
2720
|
const nodes = [];
|
|
2702
2721
|
if (subpaths && needsPerSubpath) {
|
|
2703
2722
|
const paints = buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity);
|
|
@@ -2729,7 +2748,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2729
2748
|
"path",
|
|
2730
2749
|
{
|
|
2731
2750
|
d: pathData,
|
|
2732
|
-
fill: animatesFill ? "inherit" : gradientPaint ??
|
|
2751
|
+
fill: animatesFill ? "inherit" : gradientPaint ?? chunk4GX347MG_js.colorWithOpacity(fillColor, fillOpacity),
|
|
2733
2752
|
stroke: "none",
|
|
2734
2753
|
vectorEffect: "non-scaling-stroke"
|
|
2735
2754
|
},
|
|
@@ -2755,14 +2774,14 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2755
2774
|
);
|
|
2756
2775
|
}
|
|
2757
2776
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2758
|
-
if (!
|
|
2777
|
+
if (!chunk4GX347MG_js.hasShapeProperties(element)) {
|
|
2759
2778
|
return null;
|
|
2760
2779
|
}
|
|
2761
2780
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
2762
|
-
const fillPaint = animatesFill ? "inherit" :
|
|
2763
|
-
const strokePaint = animatesStroke ? "inherit" :
|
|
2764
|
-
const dashType =
|
|
2765
|
-
const dashArray =
|
|
2781
|
+
const fillPaint = animatesFill ? "inherit" : chunk4GX347MG_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
2782
|
+
const strokePaint = animatesStroke ? "inherit" : chunk4GX347MG_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
2783
|
+
const dashType = chunk4GX347MG_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2784
|
+
const dashArray = chunk4GX347MG_js.getSvgStrokeDasharray(
|
|
2766
2785
|
dashType,
|
|
2767
2786
|
Math.max(strokeWidth, 1),
|
|
2768
2787
|
element.shapeStyle?.customDashSegments
|
|
@@ -2843,21 +2862,21 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2843
2862
|
// container's `background-image` is suppressed for custom geometry, so
|
|
2844
2863
|
// without this the shape fell back to the parser's representative solid
|
|
2845
2864
|
// and lost every fade (issue #132).
|
|
2846
|
-
|
|
2865
|
+
chunk4GX347MG_js.buildSvgGradientDef(element.shapeStyle, element.id)
|
|
2847
2866
|
);
|
|
2848
2867
|
}
|
|
2849
|
-
if (
|
|
2868
|
+
if (chunk4GX347MG_js.isCalloutShape(normalizedType)) {
|
|
2850
2869
|
const width = Math.max(element.width, 1);
|
|
2851
2870
|
const height = Math.max(element.height, 1);
|
|
2852
|
-
const geometry =
|
|
2871
|
+
const geometry = chunk4GX347MG_js.getCalloutLeaderLineGeometry(
|
|
2853
2872
|
normalizedType,
|
|
2854
2873
|
width,
|
|
2855
2874
|
height,
|
|
2856
2875
|
element.shapeAdjustments
|
|
2857
2876
|
);
|
|
2858
2877
|
if (geometry && geometry.points.length >= 2) {
|
|
2859
|
-
const leaderPath =
|
|
2860
|
-
const bounds =
|
|
2878
|
+
const leaderPath = chunk4GX347MG_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
2879
|
+
const bounds = chunk4GX347MG_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
2861
2880
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
2862
2881
|
const offsetLeft = bounds.minX;
|
|
2863
2882
|
const offsetTop = bounds.minY;
|
|
@@ -2920,10 +2939,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2920
2939
|
const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
|
|
2921
2940
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
2922
2941
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
2923
|
-
const connectorLineCap =
|
|
2942
|
+
const connectorLineCap = chunk4GX347MG_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
2924
2943
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
2925
|
-
const offsets =
|
|
2926
|
-
const widths =
|
|
2944
|
+
const offsets = chunk4GX347MG_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
2945
|
+
const widths = chunk4GX347MG_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
2927
2946
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2928
2947
|
"svg",
|
|
2929
2948
|
{
|
|
@@ -2990,15 +3009,15 @@ function parseGradientFillCss(gradFill) {
|
|
|
2990
3009
|
}
|
|
2991
3010
|
const parsed = stops.map((gs) => {
|
|
2992
3011
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
2993
|
-
const color =
|
|
2994
|
-
const opacity =
|
|
2995
|
-
return { pos, color:
|
|
3012
|
+
const color = chunk4GX347MG_js.parseDrawingColor(gs) ?? "#888888";
|
|
3013
|
+
const opacity = chunk4GX347MG_js.parseDrawingColorOpacity(gs);
|
|
3014
|
+
return { pos, color: chunk4GX347MG_js.colorWithOpacity(color, opacity) };
|
|
2996
3015
|
}).sort((a, b) => a.pos - b.pos);
|
|
2997
3016
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
2998
3017
|
const lin = gradFill["a:lin"];
|
|
2999
3018
|
if (lin) {
|
|
3000
3019
|
const angRaw = Number.parseInt(String(lin["@_ang"] || "0"), 10);
|
|
3001
|
-
const angleDeg = Math.round(
|
|
3020
|
+
const angleDeg = Math.round(chunk4GX347MG_js.ooxmlGradientAngleToCssDegrees(angRaw / 6e4));
|
|
3002
3021
|
return `linear-gradient(${angleDeg}deg, ${stopStrings})`;
|
|
3003
3022
|
}
|
|
3004
3023
|
const path = gradFill["a:path"];
|
|
@@ -3033,8 +3052,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
3033
3052
|
if (!pattFill) {
|
|
3034
3053
|
return void 0;
|
|
3035
3054
|
}
|
|
3036
|
-
const fgColor =
|
|
3037
|
-
const bgColor =
|
|
3055
|
+
const fgColor = chunk4GX347MG_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
3056
|
+
const bgColor = chunk4GX347MG_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
3038
3057
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
3039
3058
|
switch (preset) {
|
|
3040
3059
|
case "ltHorz":
|
|
@@ -3145,11 +3164,11 @@ function parseCellBorders(cellProperties) {
|
|
|
3145
3164
|
const prstDash = ln["a:prstDash"];
|
|
3146
3165
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
3147
3166
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
3148
|
-
const color =
|
|
3167
|
+
const color = chunk4GX347MG_js.parseDrawingColor(ln["a:solidFill"]);
|
|
3149
3168
|
if (color) {
|
|
3150
|
-
const opacity =
|
|
3169
|
+
const opacity = chunk4GX347MG_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
3151
3170
|
const key = `${edge.prefix}`;
|
|
3152
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
3171
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunk4GX347MG_js.colorWithOpacity(color, opacity)}`;
|
|
3153
3172
|
}
|
|
3154
3173
|
}
|
|
3155
3174
|
return borderStyle;
|
|
@@ -3162,7 +3181,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3162
3181
|
const textShadowParts = [];
|
|
3163
3182
|
const outerShdw = effectLst["a:outerShdw"];
|
|
3164
3183
|
if (outerShdw) {
|
|
3165
|
-
const shdwColor =
|
|
3184
|
+
const shdwColor = chunk4GX347MG_js.parseDrawingColor(outerShdw);
|
|
3166
3185
|
if (shdwColor) {
|
|
3167
3186
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
3168
3187
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -3180,7 +3199,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3180
3199
|
}
|
|
3181
3200
|
const glow = effectLst["a:glow"];
|
|
3182
3201
|
if (glow) {
|
|
3183
|
-
const glowColor =
|
|
3202
|
+
const glowColor = chunk4GX347MG_js.parseDrawingColor(glow);
|
|
3184
3203
|
if (glowColor) {
|
|
3185
3204
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
3186
3205
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -3259,10 +3278,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3259
3278
|
if (runProps?.["@_u"] !== void 0) {
|
|
3260
3279
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
3261
3280
|
}
|
|
3262
|
-
const runColor =
|
|
3281
|
+
const runColor = chunk4GX347MG_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunk4GX347MG_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
3263
3282
|
if (runColor) {
|
|
3264
|
-
const opacity =
|
|
3265
|
-
cellStyle.color =
|
|
3283
|
+
const opacity = chunk4GX347MG_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
3284
|
+
cellStyle.color = chunk4GX347MG_js.colorWithOpacity(runColor, opacity);
|
|
3266
3285
|
}
|
|
3267
3286
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
3268
3287
|
if (fontFamily) {
|
|
@@ -3272,15 +3291,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3272
3291
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
3273
3292
|
}
|
|
3274
3293
|
const cellProperties = cellXml["a:tcPr"];
|
|
3275
|
-
const cellFill =
|
|
3294
|
+
const cellFill = chunk4GX347MG_js.parseDrawingColor(
|
|
3276
3295
|
cellProperties?.["a:solidFill"],
|
|
3277
3296
|
schemeColorOverrides
|
|
3278
3297
|
);
|
|
3279
3298
|
if (cellFill) {
|
|
3280
|
-
const opacity =
|
|
3299
|
+
const opacity = chunk4GX347MG_js.parseDrawingColorOpacity(
|
|
3281
3300
|
cellProperties?.["a:solidFill"]
|
|
3282
3301
|
);
|
|
3283
|
-
cellStyle.backgroundColor =
|
|
3302
|
+
cellStyle.backgroundColor = chunk4GX347MG_js.colorWithOpacity(cellFill, opacity);
|
|
3284
3303
|
} else {
|
|
3285
3304
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
3286
3305
|
if (gradCss) {
|
|
@@ -3295,16 +3314,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3295
3314
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
3296
3315
|
Object.assign(cellStyle, edgeBorders);
|
|
3297
3316
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
3298
|
-
const borderColor =
|
|
3317
|
+
const borderColor = chunk4GX347MG_js.parseDrawingColor(
|
|
3299
3318
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
3300
3319
|
schemeColorOverrides
|
|
3301
|
-
) ||
|
|
3320
|
+
) || chunk4GX347MG_js.parseDrawingColor(
|
|
3302
3321
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
3303
3322
|
schemeColorOverrides
|
|
3304
|
-
) ||
|
|
3323
|
+
) || chunk4GX347MG_js.parseDrawingColor(
|
|
3305
3324
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
3306
3325
|
schemeColorOverrides
|
|
3307
|
-
) ||
|
|
3326
|
+
) || chunk4GX347MG_js.parseDrawingColor(
|
|
3308
3327
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
3309
3328
|
schemeColorOverrides
|
|
3310
3329
|
);
|
|
@@ -3383,10 +3402,10 @@ function resolveTableStyleFillColor(fill, colorScheme) {
|
|
|
3383
3402
|
}
|
|
3384
3403
|
let color = base;
|
|
3385
3404
|
if (fill.tint !== void 0 && fill.tint > 0) {
|
|
3386
|
-
color =
|
|
3405
|
+
color = chunk4GX347MG_js.tintColor2(color, fill.tint / 1e5);
|
|
3387
3406
|
}
|
|
3388
3407
|
if (fill.shade !== void 0 && fill.shade > 0) {
|
|
3389
|
-
color =
|
|
3408
|
+
color = chunk4GX347MG_js.shadeColor2(color, 1 - fill.shade / 1e5);
|
|
3390
3409
|
}
|
|
3391
3410
|
return color;
|
|
3392
3411
|
}
|
|
@@ -3411,7 +3430,7 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3411
3430
|
style.fontFamily = text.fontFace;
|
|
3412
3431
|
applied = true;
|
|
3413
3432
|
} else {
|
|
3414
|
-
const refFont =
|
|
3433
|
+
const refFont = chunk4GX347MG_js.resolveFontRefIdx(text.fontRefIdx, fontScheme);
|
|
3415
3434
|
if (refFont) {
|
|
3416
3435
|
style.fontFamily = refFont;
|
|
3417
3436
|
applied = true;
|
|
@@ -3422,10 +3441,10 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3422
3441
|
if (base) {
|
|
3423
3442
|
let color = base;
|
|
3424
3443
|
if (text.fontTint !== void 0 && text.fontTint > 0) {
|
|
3425
|
-
color =
|
|
3444
|
+
color = chunk4GX347MG_js.tintColor2(color, text.fontTint / 1e5);
|
|
3426
3445
|
}
|
|
3427
3446
|
if (text.fontShade !== void 0 && text.fontShade > 0) {
|
|
3428
|
-
color =
|
|
3447
|
+
color = chunk4GX347MG_js.shadeColor2(color, 1 - text.fontShade / 1e5);
|
|
3429
3448
|
}
|
|
3430
3449
|
style.color = color;
|
|
3431
3450
|
applied = true;
|
|
@@ -3614,7 +3633,7 @@ function parseTableElementData(element, fallbackTextStyle) {
|
|
|
3614
3633
|
};
|
|
3615
3634
|
}
|
|
3616
3635
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
3617
|
-
return
|
|
3636
|
+
return chunk4GX347MG_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
3618
3637
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
3619
3638
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
3620
3639
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -3762,9 +3781,9 @@ function cellStyleToCss(style) {
|
|
|
3762
3781
|
if (style.gradientFillCss) {
|
|
3763
3782
|
css.background = style.gradientFillCss;
|
|
3764
3783
|
} else if (style.fillMode === "pattern" && style.patternFillPreset) {
|
|
3765
|
-
const fg =
|
|
3766
|
-
const bg =
|
|
3767
|
-
const svgPattern =
|
|
3784
|
+
const fg = chunk4GX347MG_js.normalizeHexColor(style.patternFillForeground, "#000000");
|
|
3785
|
+
const bg = chunk4GX347MG_js.normalizeHexColor(style.patternFillBackground, "#ffffff");
|
|
3786
|
+
const svgPattern = chunk4GX347MG_js.getPatternSvg(style.patternFillPreset, fg, bg);
|
|
3768
3787
|
if (svgPattern) {
|
|
3769
3788
|
const encoded = encodeURIComponent(svgPattern);
|
|
3770
3789
|
css.backgroundImage = `url("data:image/svg+xml,${encoded}")`;
|
|
@@ -3840,7 +3859,7 @@ function cellStyleToCss(style) {
|
|
|
3840
3859
|
if (edge.width || edge.color) {
|
|
3841
3860
|
const w = edge.width ?? 1;
|
|
3842
3861
|
const c = edge.color ?? style.borderColor ?? "#000000";
|
|
3843
|
-
const s =
|
|
3862
|
+
const s = chunk4GX347MG_js.ooxmlDashToCssBorderStyle(edge.dash);
|
|
3844
3863
|
css[edge.prefix] = `${w}px ${s} ${c}`;
|
|
3845
3864
|
}
|
|
3846
3865
|
}
|
|
@@ -3871,7 +3890,7 @@ function cellStyleToCss(style) {
|
|
|
3871
3890
|
css.textShadow = textShadowParts.join(", ");
|
|
3872
3891
|
}
|
|
3873
3892
|
if (style.cell3D) {
|
|
3874
|
-
Object.assign(css,
|
|
3893
|
+
Object.assign(css, chunk4GX347MG_js.cell3DBevelCss(style.cell3D));
|
|
3875
3894
|
}
|
|
3876
3895
|
return css;
|
|
3877
3896
|
}
|
|
@@ -3885,7 +3904,7 @@ function TableResizeOverlay({
|
|
|
3885
3904
|
const containerRef = React6.useRef(null);
|
|
3886
3905
|
const [rowBounds, setRowBounds] = React6.useState([]);
|
|
3887
3906
|
const dragRef = React6.useRef(null);
|
|
3888
|
-
const colBoundaries = React6.useMemo(() =>
|
|
3907
|
+
const colBoundaries = React6.useMemo(() => chunk4GX347MG_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
3889
3908
|
const measureRows = React6.useCallback(() => {
|
|
3890
3909
|
const container = containerRef.current;
|
|
3891
3910
|
if (!container) {
|
|
@@ -3932,11 +3951,11 @@ function TableResizeOverlay({
|
|
|
3932
3951
|
const rect = containerRef.current.getBoundingClientRect();
|
|
3933
3952
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
3934
3953
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
3935
|
-
onResizeColumns(
|
|
3954
|
+
onResizeColumns(chunk4GX347MG_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
3936
3955
|
} else if (drag.type === "row" && onResizeRow) {
|
|
3937
3956
|
const deltaY = e.clientY - drag.startPos;
|
|
3938
|
-
const newHeight =
|
|
3939
|
-
drag.initialRowHeight ??
|
|
3957
|
+
const newHeight = chunk4GX347MG_js.computeResizedRowHeight(
|
|
3958
|
+
drag.initialRowHeight ?? chunk4GX347MG_js.DEFAULT_ROW_HEIGHT,
|
|
3940
3959
|
deltaY
|
|
3941
3960
|
);
|
|
3942
3961
|
onResizeRow(drag.index, newHeight);
|
|
@@ -3974,7 +3993,7 @@ function TableResizeOverlay({
|
|
|
3974
3993
|
e.stopPropagation();
|
|
3975
3994
|
const table = containerRef.current?.querySelector("table");
|
|
3976
3995
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
3977
|
-
const actualHeight = tr?.offsetHeight ??
|
|
3996
|
+
const actualHeight = tr?.offsetHeight ?? chunk4GX347MG_js.DEFAULT_ROW_HEIGHT;
|
|
3978
3997
|
document.body.style.cursor = "row-resize";
|
|
3979
3998
|
document.body.style.userSelect = "none";
|
|
3980
3999
|
dragRef.current = {
|
|
@@ -4022,7 +4041,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4022
4041
|
}
|
|
4023
4042
|
const first = selectedCell.selectedCells[0];
|
|
4024
4043
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4025
|
-
return
|
|
4044
|
+
return chunk4GX347MG_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
4026
4045
|
})();
|
|
4027
4046
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4028
4047
|
TableResizeOverlay,
|
|
@@ -4042,7 +4061,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4042
4061
|
"table",
|
|
4043
4062
|
{
|
|
4044
4063
|
className: "w-full h-full border-collapse table-fixed",
|
|
4045
|
-
style: { fontFamily:
|
|
4064
|
+
style: { fontFamily: chunk4GX347MG_js.DEFAULT_FONT_FAMILY },
|
|
4046
4065
|
children: [
|
|
4047
4066
|
tableData.columnWidths.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: tableData.columnWidths.map((w, ci) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4048
4067
|
"col",
|
|
@@ -4060,7 +4079,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4060
4079
|
return null;
|
|
4061
4080
|
}
|
|
4062
4081
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
4063
|
-
const isInMultiSelection =
|
|
4082
|
+
const isInMultiSelection = chunk4GX347MG_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
4064
4083
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
4065
4084
|
const diag = getCellDiagonalBorders2(
|
|
4066
4085
|
cell.style,
|
|
@@ -4090,7 +4109,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4090
4109
|
}
|
|
4091
4110
|
event.stopPropagation();
|
|
4092
4111
|
if (event.shiftKey && selectedCell) {
|
|
4093
|
-
const rect =
|
|
4112
|
+
const rect = chunk4GX347MG_js.computeSelectionRect(
|
|
4094
4113
|
selectedCell.rowIndex,
|
|
4095
4114
|
selectedCell.columnIndex,
|
|
4096
4115
|
rowIndex,
|
|
@@ -4100,7 +4119,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4100
4119
|
options?.onSelectCell?.({
|
|
4101
4120
|
rowIndex: selectedCell.rowIndex,
|
|
4102
4121
|
columnIndex: selectedCell.columnIndex,
|
|
4103
|
-
selectedCells:
|
|
4122
|
+
selectedCells: chunk4GX347MG_js.rectToCells(rect)
|
|
4104
4123
|
});
|
|
4105
4124
|
} else {
|
|
4106
4125
|
options?.onSelectCell?.({
|
|
@@ -4179,7 +4198,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4179
4198
|
}
|
|
4180
4199
|
const first = selectedCell.selectedCells[0];
|
|
4181
4200
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4182
|
-
return
|
|
4201
|
+
return chunk4GX347MG_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
4183
4202
|
})();
|
|
4184
4203
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
4185
4204
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4200,7 +4219,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4200
4219
|
"table",
|
|
4201
4220
|
{
|
|
4202
4221
|
className: "w-full h-full border-collapse table-fixed",
|
|
4203
|
-
style: { fontFamily:
|
|
4222
|
+
style: { fontFamily: chunk4GX347MG_js.DEFAULT_FONT_FAMILY },
|
|
4204
4223
|
children: [
|
|
4205
4224
|
parsedTable.columnPercentages.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: parsedTable.columnPercentages.map((percentage, columnIndex) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4206
4225
|
"col",
|
|
@@ -4261,7 +4280,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4261
4280
|
"border px-1 py-0.5 align-top",
|
|
4262
4281
|
isEditable && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
4263
4282
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
4264
|
-
|
|
4283
|
+
chunk4GX347MG_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
4265
4284
|
),
|
|
4266
4285
|
colSpan,
|
|
4267
4286
|
rowSpan: rSpan,
|
|
@@ -4272,7 +4291,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4272
4291
|
}
|
|
4273
4292
|
event.stopPropagation();
|
|
4274
4293
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
4275
|
-
const rect =
|
|
4294
|
+
const rect = chunk4GX347MG_js.computeSelectionRect(
|
|
4276
4295
|
selectedCell.rowIndex,
|
|
4277
4296
|
selectedCell.columnIndex,
|
|
4278
4297
|
rowIndex,
|
|
@@ -4282,7 +4301,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4282
4301
|
options?.onSelectCell?.({
|
|
4283
4302
|
rowIndex: selectedCell.rowIndex,
|
|
4284
4303
|
columnIndex: selectedCell.columnIndex,
|
|
4285
|
-
selectedCells:
|
|
4304
|
+
selectedCells: chunk4GX347MG_js.rectToCells(rect)
|
|
4286
4305
|
});
|
|
4287
4306
|
} else {
|
|
4288
4307
|
options?.onSelectCell?.({
|
|
@@ -4339,24 +4358,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4339
4358
|
}
|
|
4340
4359
|
var LEGEND_ITEM_WIDTH = 80;
|
|
4341
4360
|
function partAttrs(part) {
|
|
4342
|
-
return part ?
|
|
4361
|
+
return part ? chunk4GX347MG_js.chartPartToAttrs(part) : void 0;
|
|
4343
4362
|
}
|
|
4344
4363
|
function resolveReactPalette(chartData) {
|
|
4345
4364
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
4346
4365
|
return chartData.colorPalette;
|
|
4347
4366
|
}
|
|
4348
|
-
return [...
|
|
4367
|
+
return [...chunk4GX347MG_js.getChartStylePalette(chartData.style?.styleId)];
|
|
4349
4368
|
}
|
|
4350
4369
|
function buildReactChartViewModel(element) {
|
|
4351
4370
|
if (element.type !== "chart" || !element.chartData) {
|
|
4352
|
-
return
|
|
4371
|
+
return chunk4GX347MG_js.buildChartViewModel(element);
|
|
4353
4372
|
}
|
|
4354
4373
|
const palette = resolveReactPalette(element.chartData);
|
|
4355
4374
|
const themedElement = {
|
|
4356
4375
|
...element,
|
|
4357
4376
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
4358
4377
|
};
|
|
4359
|
-
return
|
|
4378
|
+
return chunk4GX347MG_js.buildChartViewModel(themedElement);
|
|
4360
4379
|
}
|
|
4361
4380
|
function renderPrimitive(prim, key) {
|
|
4362
4381
|
switch (prim.kind) {
|
|
@@ -4745,7 +4764,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4745
4764
|
const unmatchedRows = [];
|
|
4746
4765
|
categories.forEach((cat, i) => {
|
|
4747
4766
|
const value = values[i] ?? 0;
|
|
4748
|
-
const code =
|
|
4767
|
+
const code = chunk4GX347MG_js.resolveRegionCode(cat);
|
|
4749
4768
|
if (code) {
|
|
4750
4769
|
regionValueMap.set(code, { value, label: cat });
|
|
4751
4770
|
} else {
|
|
@@ -4783,8 +4802,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4783
4802
|
let fill = "#e2e8f0";
|
|
4784
4803
|
let dataLabel = null;
|
|
4785
4804
|
if (entry) {
|
|
4786
|
-
const t =
|
|
4787
|
-
fill =
|
|
4805
|
+
const t = chunk4GX347MG_js.normalizeValue(entry.value, minVal, maxVal);
|
|
4806
|
+
fill = chunk4GX347MG_js.sequentialColorScale(t);
|
|
4788
4807
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
4789
4808
|
"text",
|
|
4790
4809
|
{
|
|
@@ -4795,7 +4814,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4795
4814
|
fontWeight: 600,
|
|
4796
4815
|
fill: "#1e293b",
|
|
4797
4816
|
style: { pointerEvents: "none" },
|
|
4798
|
-
children:
|
|
4817
|
+
children: chunk4GX347MG_js.formatAxisValue(entry.value)
|
|
4799
4818
|
},
|
|
4800
4819
|
`${element.id}-map-dl-${region.code}`
|
|
4801
4820
|
);
|
|
@@ -4813,7 +4832,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4813
4832
|
opacity: 0.9,
|
|
4814
4833
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
4815
4834
|
region.name,
|
|
4816
|
-
entry ? `: ${
|
|
4835
|
+
entry ? `: ${chunk4GX347MG_js.formatAxisValue(entry.value)}` : ""
|
|
4817
4836
|
] })
|
|
4818
4837
|
}
|
|
4819
4838
|
),
|
|
@@ -4851,7 +4870,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4851
4870
|
fontSize: 7,
|
|
4852
4871
|
fill: "#64748b",
|
|
4853
4872
|
textAnchor: "middle",
|
|
4854
|
-
children:
|
|
4873
|
+
children: chunk4GX347MG_js.formatAxisValue(minVal)
|
|
4855
4874
|
},
|
|
4856
4875
|
`${element.id}-map-legend-min`
|
|
4857
4876
|
),
|
|
@@ -4863,7 +4882,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4863
4882
|
fontSize: 7,
|
|
4864
4883
|
fill: "#64748b",
|
|
4865
4884
|
textAnchor: "middle",
|
|
4866
|
-
children:
|
|
4885
|
+
children: chunk4GX347MG_js.formatAxisValue(maxVal)
|
|
4867
4886
|
},
|
|
4868
4887
|
`${element.id}-map-legend-max`
|
|
4869
4888
|
)
|
|
@@ -4929,7 +4948,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4929
4948
|
y,
|
|
4930
4949
|
fontSize,
|
|
4931
4950
|
fill: "#475569",
|
|
4932
|
-
children:
|
|
4951
|
+
children: chunk4GX347MG_js.formatAxisValue(row.value)
|
|
4933
4952
|
},
|
|
4934
4953
|
`${element.id}-map-ft-val-${i}`
|
|
4935
4954
|
)
|
|
@@ -5000,7 +5019,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
5000
5019
|
|
|
5001
5020
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
5002
5021
|
function sColor(series, idx) {
|
|
5003
|
-
return
|
|
5022
|
+
return chunk4GX347MG_js.seriesColor(series, idx);
|
|
5004
5023
|
}
|
|
5005
5024
|
function valToY(val, range, topY, bottomY) {
|
|
5006
5025
|
const usable = bottomY - topY;
|
|
@@ -5539,7 +5558,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5539
5558
|
width: 10,
|
|
5540
5559
|
height: 10,
|
|
5541
5560
|
rx: 2,
|
|
5542
|
-
fill:
|
|
5561
|
+
fill: chunk4GX347MG_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5543
5562
|
},
|
|
5544
5563
|
`${id}-leg-r-${i}`
|
|
5545
5564
|
)
|
|
@@ -5563,7 +5582,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5563
5582
|
width: 10,
|
|
5564
5583
|
height: 10,
|
|
5565
5584
|
rx: 2,
|
|
5566
|
-
fill:
|
|
5585
|
+
fill: chunk4GX347MG_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5567
5586
|
}
|
|
5568
5587
|
),
|
|
5569
5588
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -5576,9 +5595,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5576
5595
|
}
|
|
5577
5596
|
const lines = [];
|
|
5578
5597
|
if (range.logScale && range.logBase) {
|
|
5579
|
-
const ticks =
|
|
5598
|
+
const ticks = chunk4GX347MG_js.generateLogTicks(range);
|
|
5580
5599
|
ticks.forEach((tickVal, i) => {
|
|
5581
|
-
const y =
|
|
5600
|
+
const y = chunk4GX347MG_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5582
5601
|
lines.push(
|
|
5583
5602
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5584
5603
|
"line",
|
|
@@ -5599,7 +5618,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5599
5618
|
const steps = 4;
|
|
5600
5619
|
for (let i = 0; i <= steps; i++) {
|
|
5601
5620
|
const val = range.min + range.span * i / steps;
|
|
5602
|
-
const y =
|
|
5621
|
+
const y = chunk4GX347MG_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5603
5622
|
lines.push(
|
|
5604
5623
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5605
5624
|
"line",
|
|
@@ -5623,9 +5642,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5623
5642
|
const labels = [];
|
|
5624
5643
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5625
5644
|
if (range.logScale && range.logBase) {
|
|
5626
|
-
const ticks =
|
|
5645
|
+
const ticks = chunk4GX347MG_js.generateLogTicks(range);
|
|
5627
5646
|
ticks.forEach((tickVal, i) => {
|
|
5628
|
-
const y =
|
|
5647
|
+
const y = chunk4GX347MG_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5629
5648
|
labels.push(
|
|
5630
5649
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5631
5650
|
"text",
|
|
@@ -5635,7 +5654,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5635
5654
|
textAnchor: "end",
|
|
5636
5655
|
fontSize: 8,
|
|
5637
5656
|
fill: "#64748b",
|
|
5638
|
-
children: hasDisplayUnits ?
|
|
5657
|
+
children: hasDisplayUnits ? chunk4GX347MG_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunk4GX347MG_js.formatAxisValue(tickVal)
|
|
5639
5658
|
},
|
|
5640
5659
|
`${id}-vaxis-log-${i}`
|
|
5641
5660
|
)
|
|
@@ -5645,7 +5664,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5645
5664
|
const steps = 4;
|
|
5646
5665
|
for (let i = 0; i <= steps; i++) {
|
|
5647
5666
|
const val = range.min + range.span * i / steps;
|
|
5648
|
-
const y =
|
|
5667
|
+
const y = chunk4GX347MG_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5649
5668
|
labels.push(
|
|
5650
5669
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5651
5670
|
"text",
|
|
@@ -5655,7 +5674,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5655
5674
|
textAnchor: "end",
|
|
5656
5675
|
fontSize: 8,
|
|
5657
5676
|
fill: "#64748b",
|
|
5658
|
-
children: hasDisplayUnits ?
|
|
5677
|
+
children: hasDisplayUnits ? chunk4GX347MG_js.formatAxisValueWithUnits(val, axisFormatting) : chunk4GX347MG_js.formatAxisValue(val)
|
|
5659
5678
|
},
|
|
5660
5679
|
`${id}-vaxis-${i}`
|
|
5661
5680
|
)
|
|
@@ -5663,7 +5682,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5663
5682
|
}
|
|
5664
5683
|
}
|
|
5665
5684
|
if (hasDisplayUnits) {
|
|
5666
|
-
const unitLabel =
|
|
5685
|
+
const unitLabel = chunk4GX347MG_js.getDisplayUnitLabel(
|
|
5667
5686
|
axisFormatting.displayUnits,
|
|
5668
5687
|
axisFormatting.displayUnitsLabel
|
|
5669
5688
|
);
|
|
@@ -5738,7 +5757,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
5738
5757
|
if (range.min >= 0) {
|
|
5739
5758
|
return null;
|
|
5740
5759
|
}
|
|
5741
|
-
const y =
|
|
5760
|
+
const y = chunk4GX347MG_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
5742
5761
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5743
5762
|
"line",
|
|
5744
5763
|
{
|
|
@@ -5762,7 +5781,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5762
5781
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5763
5782
|
for (let i = 0; i <= steps; i++) {
|
|
5764
5783
|
const val = range.min + range.span * i / steps;
|
|
5765
|
-
const y =
|
|
5784
|
+
const y = chunk4GX347MG_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5766
5785
|
labels.push(
|
|
5767
5786
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5768
5787
|
"text",
|
|
@@ -5774,7 +5793,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5774
5793
|
fontFamily,
|
|
5775
5794
|
fontWeight,
|
|
5776
5795
|
fill: fontColor,
|
|
5777
|
-
children: hasDisplayUnits ?
|
|
5796
|
+
children: hasDisplayUnits ? chunk4GX347MG_js.formatAxisValueWithUnits(val, axisFormatting) : chunk4GX347MG_js.formatAxisValue(val)
|
|
5778
5797
|
},
|
|
5779
5798
|
`${id}-sec-vaxis-${i}`
|
|
5780
5799
|
)
|
|
@@ -5798,7 +5817,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5798
5817
|
);
|
|
5799
5818
|
}
|
|
5800
5819
|
if (hasDisplayUnits) {
|
|
5801
|
-
const unitLabel =
|
|
5820
|
+
const unitLabel = chunk4GX347MG_js.getDisplayUnitLabel(
|
|
5802
5821
|
axisFormatting.displayUnits,
|
|
5803
5822
|
axisFormatting.displayUnitsLabel
|
|
5804
5823
|
);
|
|
@@ -5829,7 +5848,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
5829
5848
|
const ticks = [];
|
|
5830
5849
|
for (let i = 0; i <= steps; i++) {
|
|
5831
5850
|
const val = range.min + range.span * i / steps;
|
|
5832
|
-
const y =
|
|
5851
|
+
const y = chunk4GX347MG_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5833
5852
|
ticks.push(
|
|
5834
5853
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5835
5854
|
"line",
|
|
@@ -5856,7 +5875,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
5856
5875
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
5857
5876
|
for (let i = 0; i <= steps; i++) {
|
|
5858
5877
|
const val = range.min + range.span * i / steps;
|
|
5859
|
-
const y =
|
|
5878
|
+
const y = chunk4GX347MG_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5860
5879
|
lines.push(
|
|
5861
5880
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5862
5881
|
"line",
|
|
@@ -6018,7 +6037,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6018
6037
|
width: 8,
|
|
6019
6038
|
height: 8,
|
|
6020
6039
|
borderRadius: 2,
|
|
6021
|
-
backgroundColor:
|
|
6040
|
+
backgroundColor: chunk4GX347MG_js.seriesColor(
|
|
6022
6041
|
s,
|
|
6023
6042
|
si,
|
|
6024
6043
|
chartData.style?.styleId,
|
|
@@ -6056,10 +6075,10 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6056
6075
|
}
|
|
6057
6076
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
6058
6077
|
const style = chartData.style;
|
|
6059
|
-
const areaFill =
|
|
6078
|
+
const areaFill = chunk4GX347MG_js.chartAreaFill(chartData);
|
|
6060
6079
|
const legendPos = style?.legendPosition || "b";
|
|
6061
|
-
const range =
|
|
6062
|
-
const layout =
|
|
6080
|
+
const range = chunk4GX347MG_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6081
|
+
const layout = chunk4GX347MG_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6063
6082
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6064
6083
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
6065
6084
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -6080,10 +6099,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6080
6099
|
const close = closeSeries.values[ci] ?? high;
|
|
6081
6100
|
const isUp = close >= open;
|
|
6082
6101
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
6083
|
-
const highY =
|
|
6084
|
-
const lowY =
|
|
6085
|
-
const openY =
|
|
6086
|
-
const closeY =
|
|
6102
|
+
const highY = chunk4GX347MG_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
6103
|
+
const lowY = chunk4GX347MG_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
6104
|
+
const openY = chunk4GX347MG_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
6105
|
+
const closeY = chunk4GX347MG_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
|
|
6087
6106
|
elements.push(
|
|
6088
6107
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6089
6108
|
"line",
|
|
@@ -6126,7 +6145,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6126
6145
|
textAnchor: "middle",
|
|
6127
6146
|
fontSize: 7,
|
|
6128
6147
|
fill: "#334155",
|
|
6129
|
-
children:
|
|
6148
|
+
children: chunk4GX347MG_js.formatAxisValue(close)
|
|
6130
6149
|
},
|
|
6131
6150
|
`${element.id}-stock-dl-${ci}`
|
|
6132
6151
|
)
|
|
@@ -6168,7 +6187,7 @@ function FailedToLoad() {
|
|
|
6168
6187
|
var LazySurfaceChart3DScene = React6__default.default.lazy(
|
|
6169
6188
|
async () => {
|
|
6170
6189
|
try {
|
|
6171
|
-
return await import('./SurfaceChart3DScene-
|
|
6190
|
+
return await import('./SurfaceChart3DScene-AD43LAOO.js');
|
|
6172
6191
|
} catch {
|
|
6173
6192
|
return { default: FailedToLoad };
|
|
6174
6193
|
}
|
|
@@ -6192,7 +6211,7 @@ var SurfaceChart3DErrorBoundary = class extends React6__default.default.Componen
|
|
|
6192
6211
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
6193
6212
|
const rows = chartData.series.length;
|
|
6194
6213
|
const cols = Math.max(categoryLabels.length, 1);
|
|
6195
|
-
const range =
|
|
6214
|
+
const range = chunk4GX347MG_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6196
6215
|
const heightMap = new Float32Array(rows * cols);
|
|
6197
6216
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
6198
6217
|
for (let r = 0; r < rows; r++) {
|
|
@@ -6311,10 +6330,10 @@ function darkenRgb(r, g, b, factor) {
|
|
|
6311
6330
|
}
|
|
6312
6331
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
6313
6332
|
const style = chartData.style;
|
|
6314
|
-
const areaFill =
|
|
6333
|
+
const areaFill = chunk4GX347MG_js.chartAreaFill(chartData);
|
|
6315
6334
|
const legendPos = style?.legendPosition || "b";
|
|
6316
|
-
const layout =
|
|
6317
|
-
const range =
|
|
6335
|
+
const layout = chunk4GX347MG_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6336
|
+
const range = chunk4GX347MG_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6318
6337
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6319
6338
|
const seriesCount = chartData.series.length;
|
|
6320
6339
|
const cols = catCount - 1;
|
|
@@ -6403,10 +6422,10 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6403
6422
|
}
|
|
6404
6423
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
6405
6424
|
const style = chartData.style;
|
|
6406
|
-
const areaFill =
|
|
6425
|
+
const areaFill = chunk4GX347MG_js.chartAreaFill(chartData);
|
|
6407
6426
|
const legendPos = style?.legendPosition || "b";
|
|
6408
|
-
const layout =
|
|
6409
|
-
const range =
|
|
6427
|
+
const layout = chunk4GX347MG_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6428
|
+
const range = chunk4GX347MG_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6410
6429
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6411
6430
|
const seriesCount = chartData.series.length;
|
|
6412
6431
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -6468,9 +6487,9 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6468
6487
|
}
|
|
6469
6488
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
6470
6489
|
const style = chartData.style;
|
|
6471
|
-
const areaFill =
|
|
6490
|
+
const areaFill = chunk4GX347MG_js.chartAreaFill(chartData);
|
|
6472
6491
|
const legendPos = style?.legendPosition || "b";
|
|
6473
|
-
const layout =
|
|
6492
|
+
const layout = chunk4GX347MG_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6474
6493
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
6475
6494
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
6476
6495
|
const rects = [];
|
|
@@ -6493,14 +6512,14 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
6493
6512
|
y: curY,
|
|
6494
6513
|
width: Math.max(w - 1, 1),
|
|
6495
6514
|
height: Math.max(h - 1, 1),
|
|
6496
|
-
fill:
|
|
6515
|
+
fill: chunk4GX347MG_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
6497
6516
|
rx: 2,
|
|
6498
6517
|
opacity: 0.85
|
|
6499
6518
|
},
|
|
6500
6519
|
`${element.id}-tm-${item.index}`
|
|
6501
6520
|
)
|
|
6502
6521
|
);
|
|
6503
|
-
const
|
|
6522
|
+
const label2 = categoryLabels[item.index] ?? `${item.index + 1}`;
|
|
6504
6523
|
if (w > 30 && h > 14) {
|
|
6505
6524
|
rects.push(
|
|
6506
6525
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6512,7 +6531,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
6512
6531
|
fontSize: Math.min(10, h * 0.3),
|
|
6513
6532
|
fill: "#fff",
|
|
6514
6533
|
fontWeight: 600,
|
|
6515
|
-
children:
|
|
6534
|
+
children: label2
|
|
6516
6535
|
},
|
|
6517
6536
|
`${element.id}-tm-lbl-${item.index}`
|
|
6518
6537
|
)
|
|
@@ -6544,11 +6563,11 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
6544
6563
|
}
|
|
6545
6564
|
function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
6546
6565
|
const style = chartData.style;
|
|
6547
|
-
const areaFill =
|
|
6566
|
+
const areaFill = chunk4GX347MG_js.chartAreaFill(chartData);
|
|
6548
6567
|
const legendPos = style?.legendPosition || "b";
|
|
6549
6568
|
const values = chartData.series[0]?.values ?? [];
|
|
6550
|
-
const range =
|
|
6551
|
-
const layout =
|
|
6569
|
+
const range = chunk4GX347MG_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6570
|
+
const layout = chunk4GX347MG_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6552
6571
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
6553
6572
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
6554
6573
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -6559,8 +6578,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6559
6578
|
const isLast = i === values.length - 1;
|
|
6560
6579
|
const startVal = isLast ? 0 : runningTotal;
|
|
6561
6580
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
6562
|
-
const barStartY =
|
|
6563
|
-
const barEndY =
|
|
6581
|
+
const barStartY = chunk4GX347MG_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
6582
|
+
const barEndY = chunk4GX347MG_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
|
|
6564
6583
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
6565
6584
|
const y = Math.min(barStartY, barEndY);
|
|
6566
6585
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -6589,7 +6608,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6589
6608
|
textAnchor: "middle",
|
|
6590
6609
|
fontSize: 7,
|
|
6591
6610
|
fill: "#334155",
|
|
6592
|
-
children:
|
|
6611
|
+
children: chunk4GX347MG_js.formatAxisValue(isLast ? endVal : val)
|
|
6593
6612
|
},
|
|
6594
6613
|
`${element.id}-wf-dl-${i}`
|
|
6595
6614
|
)
|
|
@@ -6636,20 +6655,20 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6636
6655
|
}
|
|
6637
6656
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
6638
6657
|
const style = chartData.style;
|
|
6639
|
-
const areaFill =
|
|
6658
|
+
const areaFill = chunk4GX347MG_js.chartAreaFill(chartData);
|
|
6640
6659
|
const legendPos = style?.legendPosition || "b";
|
|
6641
|
-
const layoutOpts =
|
|
6660
|
+
const layoutOpts = chunk4GX347MG_js.computeLayoutOptions(
|
|
6642
6661
|
chartData.axes,
|
|
6643
6662
|
chartData.dataTable,
|
|
6644
6663
|
chartData.series.length
|
|
6645
6664
|
);
|
|
6646
|
-
const layout =
|
|
6647
|
-
const { primary, secondary } =
|
|
6665
|
+
const layout = chunk4GX347MG_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
6666
|
+
const { primary, secondary } = chunk4GX347MG_js.splitSeriesByAxis(chartData.series, chartData.axes);
|
|
6648
6667
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
6649
6668
|
const secondarySeries = secondary.map((e) => e.series);
|
|
6650
|
-
const range =
|
|
6651
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
6652
|
-
const secondaryAxisFmt =
|
|
6669
|
+
const range = chunk4GX347MG_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
6670
|
+
const secondaryRange = secondarySeries.length > 0 ? chunk4GX347MG_js.computeValueRange(secondarySeries) : void 0;
|
|
6671
|
+
const secondaryAxisFmt = chunk4GX347MG_js.getSecondaryValueAxis(chartData.axes);
|
|
6653
6672
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6654
6673
|
const barSeriesCount = 1;
|
|
6655
6674
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -6665,8 +6684,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6665
6684
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
6666
6685
|
barSeries.values.forEach((val, vi) => {
|
|
6667
6686
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
6668
|
-
const zeroY =
|
|
6669
|
-
const valY =
|
|
6687
|
+
const zeroY = chunk4GX347MG_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
6688
|
+
const valY = chunk4GX347MG_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
|
|
6670
6689
|
const y = Math.min(zeroY, valY);
|
|
6671
6690
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
6672
6691
|
barElements.push(
|
|
@@ -6677,7 +6696,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6677
6696
|
y,
|
|
6678
6697
|
width: barWidth,
|
|
6679
6698
|
height: h,
|
|
6680
|
-
fill:
|
|
6699
|
+
fill: chunk4GX347MG_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
6681
6700
|
rx: 1
|
|
6682
6701
|
},
|
|
6683
6702
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -6693,7 +6712,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6693
6712
|
textAnchor: "middle",
|
|
6694
6713
|
fontSize: 7,
|
|
6695
6714
|
fill: "#334155",
|
|
6696
|
-
children:
|
|
6715
|
+
children: chunk4GX347MG_js.formatAxisValue(val)
|
|
6697
6716
|
},
|
|
6698
6717
|
`${element.id}-combo-bar-dl-${vi}`
|
|
6699
6718
|
)
|
|
@@ -6710,10 +6729,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6710
6729
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
6711
6730
|
const points = series.values.map((val, vi) => {
|
|
6712
6731
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
6713
|
-
const y =
|
|
6732
|
+
const y = chunk4GX347MG_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
6714
6733
|
return { x, y, val };
|
|
6715
6734
|
});
|
|
6716
|
-
const c =
|
|
6735
|
+
const c = chunk4GX347MG_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
6717
6736
|
lineElements.push(
|
|
6718
6737
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6719
6738
|
"polyline",
|
|
@@ -6740,7 +6759,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6740
6759
|
textAnchor: "middle",
|
|
6741
6760
|
fontSize: 7,
|
|
6742
6761
|
fill: "#334155",
|
|
6743
|
-
children:
|
|
6762
|
+
children: chunk4GX347MG_js.formatAxisValue(p.val)
|
|
6744
6763
|
},
|
|
6745
6764
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
6746
6765
|
)
|
|
@@ -6979,14 +6998,14 @@ function layoutToCategory(layout) {
|
|
|
6979
6998
|
};
|
|
6980
6999
|
return map[layout] ?? "list";
|
|
6981
7000
|
}
|
|
6982
|
-
function smartArtNodeGroupProps(nodeId, shadow,
|
|
7001
|
+
function smartArtNodeGroupProps(nodeId, shadow, label2) {
|
|
6983
7002
|
const props = {
|
|
6984
7003
|
"data-smartart-node-id": nodeId,
|
|
6985
7004
|
style: { filter: shadow, pointerEvents: "auto" }
|
|
6986
7005
|
};
|
|
6987
|
-
if (
|
|
7006
|
+
if (label2) {
|
|
6988
7007
|
props.role = "img";
|
|
6989
|
-
props["aria-label"] =
|
|
7008
|
+
props["aria-label"] = label2;
|
|
6990
7009
|
}
|
|
6991
7010
|
return props;
|
|
6992
7011
|
}
|
|
@@ -7886,14 +7905,14 @@ function buildNotesPdf(pages) {
|
|
|
7886
7905
|
notes: page.notes,
|
|
7887
7906
|
slideNumber: page.slideNumber
|
|
7888
7907
|
}));
|
|
7889
|
-
const bytes =
|
|
7908
|
+
const bytes = chunk4GX347MG_js.buildNotesPdfBytes(images, meta);
|
|
7890
7909
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
7891
7910
|
return URL.createObjectURL(blob);
|
|
7892
7911
|
}
|
|
7893
7912
|
|
|
7894
7913
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
7895
7914
|
function buildPdfFromImageData(images) {
|
|
7896
|
-
const bytes =
|
|
7915
|
+
const bytes = chunk4GX347MG_js.buildSlidesPdfBytes(images);
|
|
7897
7916
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
7898
7917
|
return URL.createObjectURL(blob);
|
|
7899
7918
|
}
|
|
@@ -7902,7 +7921,7 @@ function buildPdfFromImageData(images) {
|
|
|
7902
7921
|
var activePreview = null;
|
|
7903
7922
|
function startPreviewAnimation(elementId, preset, options) {
|
|
7904
7923
|
stopPreviewAnimation();
|
|
7905
|
-
const descriptor =
|
|
7924
|
+
const descriptor = chunk4GX347MG_js.buildPreviewAnimation(preset, options);
|
|
7906
7925
|
if (!descriptor) {
|
|
7907
7926
|
return;
|
|
7908
7927
|
}
|
|
@@ -7915,7 +7934,7 @@ function startMotionPathPreview(elementId, path, options) {
|
|
|
7915
7934
|
return;
|
|
7916
7935
|
}
|
|
7917
7936
|
const stage = domEl.offsetParent;
|
|
7918
|
-
const descriptor =
|
|
7937
|
+
const descriptor = chunk4GX347MG_js.buildMotionPathPreview({
|
|
7919
7938
|
path,
|
|
7920
7939
|
slideWidth: stage?.offsetWidth || DEFAULT_PREVIEW_SLIDE_WIDTH,
|
|
7921
7940
|
slideHeight: stage?.offsetHeight || DEFAULT_PREVIEW_SLIDE_HEIGHT,
|