pptx-react-viewer 2.16.7 → 2.16.9
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-XSXMU2Q5.js → AiChatPanel-EPMBL6EA.js} +23 -23
- package/dist/AiChatPanel-EPMBL6EA.js.br +0 -0
- package/dist/AiChatPanel-EPMBL6EA.js.gz +0 -0
- package/dist/{AiChatPanel-2YYL6AKX.mjs → AiChatPanel-XHKYPYPH.mjs} +3 -3
- package/dist/AiChatPanel-XHKYPYPH.mjs.br +0 -0
- package/dist/AiChatPanel-XHKYPYPH.mjs.gz +0 -0
- package/dist/{Model3DScene-36UJZLCO.js → Model3DScene-DUJOZA2B.js} +2 -2
- package/dist/{Model3DScene-36UJZLCO.js.br → Model3DScene-DUJOZA2B.js.br} +0 -0
- package/dist/Model3DScene-DUJOZA2B.js.gz +0 -0
- package/dist/{Model3DScene-NVFP3JBJ.mjs → Model3DScene-YMIAGRPG.mjs} +1 -1
- package/dist/Model3DScene-YMIAGRPG.mjs.br +0 -0
- package/dist/Model3DScene-YMIAGRPG.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-BMFEDBLF.mjs → SurfaceChart3DScene-Q47OEJXS.mjs} +1 -1
- package/dist/SurfaceChart3DScene-Q47OEJXS.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-Q47OEJXS.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-W6I255VU.js → SurfaceChart3DScene-TNCHWQAK.js} +2 -2
- package/dist/SurfaceChart3DScene-TNCHWQAK.js.br +0 -0
- package/dist/SurfaceChart3DScene-TNCHWQAK.js.gz +0 -0
- package/dist/{chunk-J56KVWI5.mjs → chunk-3KIKPDAJ.mjs} +7 -7
- package/dist/chunk-3KIKPDAJ.mjs.br +0 -0
- package/dist/{chunk-J56KVWI5.mjs.gz → chunk-3KIKPDAJ.mjs.gz} +0 -0
- package/dist/{chunk-QNKJUUKD.mjs → chunk-EL2YF26P.mjs} +1 -1
- package/dist/chunk-EL2YF26P.mjs.br +0 -0
- package/dist/chunk-EL2YF26P.mjs.gz +0 -0
- package/dist/{chunk-S7HPAJRX.js → chunk-FSVE6WUY.js} +340 -340
- package/dist/chunk-FSVE6WUY.js.br +0 -0
- package/dist/chunk-FSVE6WUY.js.gz +0 -0
- package/dist/{chunk-KVNZGR3L.mjs → chunk-J7EFC3GS.mjs} +2 -2
- package/dist/chunk-J7EFC3GS.mjs.br +0 -0
- package/dist/{chunk-KVNZGR3L.mjs.gz → chunk-J7EFC3GS.mjs.gz} +0 -0
- package/dist/{chunk-JSJZWA43.js → chunk-PI5SFTDC.js} +3 -3
- package/dist/chunk-PI5SFTDC.js.br +0 -0
- package/dist/chunk-PI5SFTDC.js.gz +0 -0
- package/dist/{chunk-J5V7UCD2.mjs → chunk-VHME5BE6.mjs} +2 -2
- package/dist/chunk-VHME5BE6.mjs.br +0 -0
- package/dist/chunk-VHME5BE6.mjs.gz +0 -0
- package/dist/{chunk-77TMRPDU.js → chunk-VL7ZT3ID.js} +977 -977
- package/dist/chunk-VL7ZT3ID.js.br +0 -0
- package/dist/chunk-VL7ZT3ID.js.gz +0 -0
- package/dist/{chunk-NFJLF7TX.js → chunk-WK22Z7PK.js} +247 -247
- package/dist/chunk-WK22Z7PK.js.br +0 -0
- package/dist/chunk-WK22Z7PK.js.gz +0 -0
- package/dist/{chunk-USAJMMF2.js → chunk-Y2KIB3QH.js} +22 -9
- package/dist/chunk-Y2KIB3QH.js.br +0 -0
- package/dist/{chunk-USAJMMF2.js.gz → chunk-Y2KIB3QH.js.gz} +0 -0
- package/dist/{chunk-D5TAZ5NL.mjs → chunk-YWKUIUQX.mjs} +22 -9
- package/dist/chunk-YWKUIUQX.mjs.br +0 -0
- package/dist/{chunk-D5TAZ5NL.mjs.gz → chunk-YWKUIUQX.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.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-2YYL6AKX.mjs.br +0 -0
- package/dist/AiChatPanel-2YYL6AKX.mjs.gz +0 -0
- package/dist/AiChatPanel-XSXMU2Q5.js.br +0 -0
- package/dist/AiChatPanel-XSXMU2Q5.js.gz +0 -0
- package/dist/Model3DScene-36UJZLCO.js.gz +0 -0
- package/dist/Model3DScene-NVFP3JBJ.mjs.br +0 -0
- package/dist/Model3DScene-NVFP3JBJ.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-BMFEDBLF.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-BMFEDBLF.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-W6I255VU.js.br +0 -0
- package/dist/SurfaceChart3DScene-W6I255VU.js.gz +0 -0
- package/dist/chunk-77TMRPDU.js.br +0 -0
- package/dist/chunk-77TMRPDU.js.gz +0 -0
- package/dist/chunk-D5TAZ5NL.mjs.br +0 -0
- package/dist/chunk-J56KVWI5.mjs.br +0 -0
- package/dist/chunk-J5V7UCD2.mjs.br +0 -0
- package/dist/chunk-J5V7UCD2.mjs.gz +0 -0
- package/dist/chunk-JSJZWA43.js.br +0 -0
- package/dist/chunk-JSJZWA43.js.gz +0 -0
- package/dist/chunk-KVNZGR3L.mjs.br +0 -0
- package/dist/chunk-NFJLF7TX.js.br +0 -0
- package/dist/chunk-NFJLF7TX.js.gz +0 -0
- package/dist/chunk-QNKJUUKD.mjs.br +0 -0
- package/dist/chunk-QNKJUUKD.mjs.gz +0 -0
- package/dist/chunk-S7HPAJRX.js.br +0 -0
- package/dist/chunk-S7HPAJRX.js.gz +0 -0
- package/dist/chunk-USAJMMF2.js.br +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkDVZF4ARG_js = require('./chunk-DVZF4ARG.js');
|
|
4
|
-
var
|
|
4
|
+
var chunkY2KIB3QH_js = require('./chunk-Y2KIB3QH.js');
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var tailwindMerge = require('tailwind-merge');
|
|
7
7
|
var React6 = require('react');
|
|
@@ -15,7 +15,7 @@ var React6__default = /*#__PURE__*/_interopDefault(React6);
|
|
|
15
15
|
|
|
16
16
|
// src/viewer/utils/animation-effects.ts
|
|
17
17
|
function getAnimationInitialStyle2(preset, nativeAnimation) {
|
|
18
|
-
return
|
|
18
|
+
return chunkY2KIB3QH_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 chunkY2KIB3QH_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 = chunkY2KIB3QH_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 = chunkY2KIB3QH_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 (!chunkY2KIB3QH_js.hasShapeProperties(element)) {
|
|
270
270
|
return false;
|
|
271
271
|
}
|
|
272
272
|
const st = getShapeType(element.shapeType);
|
|
@@ -275,7 +275,7 @@ function isConnectorOrLineElement(element) {
|
|
|
275
275
|
|
|
276
276
|
// src/viewer/utils/image-style.ts
|
|
277
277
|
function getImageMaskStyle(element) {
|
|
278
|
-
if (!
|
|
278
|
+
if (!chunkY2KIB3QH_js.hasShapeProperties(element)) {
|
|
279
279
|
return void 0;
|
|
280
280
|
}
|
|
281
281
|
const shapeType = element.shapeType;
|
|
@@ -284,7 +284,7 @@ function getImageMaskStyle(element) {
|
|
|
284
284
|
}
|
|
285
285
|
const normalized = shapeType.toLowerCase();
|
|
286
286
|
if (normalized === "roundrect" || normalized === "round1rect" || normalized === "round2samerect" || normalized === "round2diagrect" || normalized === "sniproundrect" || normalized === "snip1rect" || normalized === "snip2diagrect") {
|
|
287
|
-
const radiusPx =
|
|
287
|
+
const radiusPx = chunkY2KIB3QH_js.getRoundRectRadiusPx2(element);
|
|
288
288
|
if (radiusPx <= 0.01) {
|
|
289
289
|
return void 0;
|
|
290
290
|
}
|
|
@@ -296,7 +296,7 @@ function getImageMaskStyle(element) {
|
|
|
296
296
|
if (normalized === "can" || normalized === "cylinder") {
|
|
297
297
|
return { borderRadius: "48% / 12%" };
|
|
298
298
|
}
|
|
299
|
-
const clipPath =
|
|
299
|
+
const clipPath = chunkY2KIB3QH_js.getResolvedShapeClipPath(element);
|
|
300
300
|
if (!clipPath) {
|
|
301
301
|
return void 0;
|
|
302
302
|
}
|
|
@@ -305,7 +305,7 @@ function getImageMaskStyle(element) {
|
|
|
305
305
|
function getImageRenderStyle(element) {
|
|
306
306
|
return {
|
|
307
307
|
...getImageMaskStyle(element) || {},
|
|
308
|
-
...
|
|
308
|
+
...chunkY2KIB3QH_js.getImageFitStyle(element)
|
|
309
309
|
};
|
|
310
310
|
}
|
|
311
311
|
var CROP_SHAPE_CLIP_PATHS = {
|
|
@@ -318,7 +318,7 @@ var CROP_SHAPE_CLIP_PATHS = {
|
|
|
318
318
|
star: "polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)"
|
|
319
319
|
};
|
|
320
320
|
function getCropShapeClipPath(element) {
|
|
321
|
-
if (!
|
|
321
|
+
if (!chunkY2KIB3QH_js.isImageLikeElement(element)) {
|
|
322
322
|
return void 0;
|
|
323
323
|
}
|
|
324
324
|
const shape = element.cropShape;
|
|
@@ -328,7 +328,7 @@ function getCropShapeClipPath(element) {
|
|
|
328
328
|
return CROP_SHAPE_CLIP_PATHS[shape];
|
|
329
329
|
}
|
|
330
330
|
function isImageTiled(element) {
|
|
331
|
-
if (!
|
|
331
|
+
if (!chunkY2KIB3QH_js.isImageLikeElement(element)) {
|
|
332
332
|
return false;
|
|
333
333
|
}
|
|
334
334
|
return typeof element.tileScaleX === "number" || typeof element.tileScaleY === "number";
|
|
@@ -386,7 +386,7 @@ function buildMirrorTiledBackground(src, flip, scaleX, scaleY) {
|
|
|
386
386
|
};
|
|
387
387
|
}
|
|
388
388
|
function getImageTilingStyle(element) {
|
|
389
|
-
if (!
|
|
389
|
+
if (!chunkY2KIB3QH_js.isImageLikeElement(element) || !isImageTiled(element)) {
|
|
390
390
|
return void 0;
|
|
391
391
|
}
|
|
392
392
|
const scaleX = typeof element.tileScaleX === "number" ? element.tileScaleX * 100 : 100;
|
|
@@ -606,9 +606,9 @@ function registerMediaElement(elementId, el) {
|
|
|
606
606
|
};
|
|
607
607
|
}
|
|
608
608
|
function executeMediaCommand(command, frameRoot) {
|
|
609
|
-
return
|
|
609
|
+
return chunkY2KIB3QH_js.runMediaCommand(
|
|
610
610
|
command,
|
|
611
|
-
(targetId) => registry.get(targetId) ??
|
|
611
|
+
(targetId) => registry.get(targetId) ?? chunkY2KIB3QH_js.findMediaElementByElementId(targetId, frameRoot?.())
|
|
612
612
|
);
|
|
613
613
|
}
|
|
614
614
|
function PresentationMediaController({
|
|
@@ -652,7 +652,7 @@ function PresentationMediaController({
|
|
|
652
652
|
loop: shouldLoop,
|
|
653
653
|
volume: playbackVolume,
|
|
654
654
|
playbackRate
|
|
655
|
-
} =
|
|
655
|
+
} = chunkY2KIB3QH_js.mediaPlaybackAttributes({
|
|
656
656
|
loop: element.loop,
|
|
657
657
|
volume: element.volume,
|
|
658
658
|
playbackSpeed: element.playbackSpeed
|
|
@@ -788,7 +788,7 @@ function PresentationMediaController({
|
|
|
788
788
|
if (element.playAcrossSlides && element.mediaType === "audio") {
|
|
789
789
|
const dataUrl = element.mediaData ?? resolvedDataUrl;
|
|
790
790
|
if (dataUrl) {
|
|
791
|
-
|
|
791
|
+
chunkY2KIB3QH_js.registerPersistentAudio(
|
|
792
792
|
element.id,
|
|
793
793
|
dataUrl,
|
|
794
794
|
element.mediaMimeType,
|
|
@@ -886,17 +886,17 @@ function Badge({
|
|
|
886
886
|
"div",
|
|
887
887
|
{
|
|
888
888
|
className: `absolute inset-0 flex flex-col items-center justify-center ${isMissing ? "gap-1" : ""}`,
|
|
889
|
-
...{ [
|
|
889
|
+
...{ [chunkY2KIB3QH_js.MEDIA_CHROME_ATTRIBUTE]: visual.badge },
|
|
890
890
|
children: [
|
|
891
891
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
892
892
|
FallbackIcon,
|
|
893
893
|
{
|
|
894
|
-
paths:
|
|
894
|
+
paths: chunkY2KIB3QH_js.mediaFallbackIcon(visual, element.mediaType),
|
|
895
895
|
size: isMissing ? 32 : 48,
|
|
896
896
|
className: isMissing ? "text-white/60" : "text-white/80 drop-shadow-md"
|
|
897
897
|
}
|
|
898
898
|
),
|
|
899
|
-
isMissing && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: label(
|
|
899
|
+
isMissing && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: label(chunkY2KIB3QH_js.mediaFallbackLabelKey(visual, element.mediaType)) })
|
|
900
900
|
]
|
|
901
901
|
}
|
|
902
902
|
);
|
|
@@ -913,17 +913,17 @@ function Placeholder({
|
|
|
913
913
|
"div",
|
|
914
914
|
{
|
|
915
915
|
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"}`,
|
|
916
|
-
...{ [
|
|
916
|
+
...{ [chunkY2KIB3QH_js.MEDIA_CHROME_ATTRIBUTE]: visual.placeholder },
|
|
917
917
|
children: [
|
|
918
918
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
919
919
|
FallbackIcon,
|
|
920
920
|
{
|
|
921
|
-
paths:
|
|
921
|
+
paths: chunkY2KIB3QH_js.mediaFallbackIcon(visual, element.mediaType),
|
|
922
922
|
size: isMissing ? 36 : element.mediaType === "audio" ? 24 : 32,
|
|
923
923
|
className: isMissing ? "text-white/50" : "text-white/70"
|
|
924
924
|
}
|
|
925
925
|
),
|
|
926
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `text-[10px] ${isMissing ? "text-white/50" : "text-white/70"}`, children: label(
|
|
926
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `text-[10px] ${isMissing ? "text-white/50" : "text-white/70"}`, children: label(chunkY2KIB3QH_js.mediaFallbackLabelKey(visual, element.mediaType)) })
|
|
927
927
|
]
|
|
928
928
|
}
|
|
929
929
|
);
|
|
@@ -933,7 +933,7 @@ function renderMediaFallback({
|
|
|
933
933
|
posterUrl,
|
|
934
934
|
surface
|
|
935
935
|
}) {
|
|
936
|
-
const visual =
|
|
936
|
+
const visual = chunkY2KIB3QH_js.mediaFallbackVisual(surface, {
|
|
937
937
|
hasPoster: Boolean(posterUrl),
|
|
938
938
|
missing: element.mediaMissing === true
|
|
939
939
|
});
|
|
@@ -962,7 +962,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
962
962
|
const dataUrl = element.mediaData ?? (mediaPath ? mediaDataUrls.get(mediaPath) : void 0);
|
|
963
963
|
const trimFragment = buildTrimFragment(element);
|
|
964
964
|
const posterUrl = element.posterFrameData ?? void 0;
|
|
965
|
-
const shouldLoop =
|
|
965
|
+
const shouldLoop = chunkY2KIB3QH_js.mediaPlaybackAttributes(element).loop;
|
|
966
966
|
const shouldAutoPlay = options?.autoPlay === true || element.autoPlay === true;
|
|
967
967
|
const isFullScreen = options?.fullScreen === true;
|
|
968
968
|
const isPresentationMode = options?.isPresentationMode === true;
|
|
@@ -1045,7 +1045,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1045
1045
|
|
|
1046
1046
|
// src/viewer/utils/text-utils.tsx
|
|
1047
1047
|
function getTextStyleForElement(element, fallbackColor) {
|
|
1048
|
-
return
|
|
1048
|
+
return chunkY2KIB3QH_js.buildTextBlockStyle(element, { fallbackColor });
|
|
1049
1049
|
}
|
|
1050
1050
|
|
|
1051
1051
|
// src/viewer/utils/text-layout.tsx
|
|
@@ -1070,13 +1070,13 @@ function computeTabSize(tabStops, defaultTabSize) {
|
|
|
1070
1070
|
return avgGap > 0 ? `${Math.round(avgGap)}px` : fromDefault;
|
|
1071
1071
|
}
|
|
1072
1072
|
function getTextLayoutStyle(element) {
|
|
1073
|
-
if (!
|
|
1073
|
+
if (!chunkY2KIB3QH_js.hasTextProperties(element)) {
|
|
1074
1074
|
return {};
|
|
1075
1075
|
}
|
|
1076
1076
|
const verticalAlign = element.textStyle?.vAlign || "top";
|
|
1077
|
-
const writingMode =
|
|
1078
|
-
const textOrientation =
|
|
1079
|
-
const verticalDirection =
|
|
1077
|
+
const writingMode = chunkY2KIB3QH_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
1078
|
+
const textOrientation = chunkY2KIB3QH_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
1079
|
+
const verticalDirection = chunkY2KIB3QH_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
1080
1080
|
const parsedColumnCount = Number(element.textStyle?.columnCount);
|
|
1081
1081
|
const columnCount = Number.isFinite(parsedColumnCount) ? Math.max(1, Math.min(16, Math.round(parsedColumnCount))) : 1;
|
|
1082
1082
|
const hasColumns = columnCount > 1;
|
|
@@ -1084,7 +1084,7 @@ function getTextLayoutStyle(element) {
|
|
|
1084
1084
|
const tabStops = element.textStyle?.tabStops;
|
|
1085
1085
|
const tabSize = computeTabSize(tabStops, element.textStyle?.defaultTabSize);
|
|
1086
1086
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
1087
|
-
const hasParagraphIndents =
|
|
1087
|
+
const hasParagraphIndents = chunkY2KIB3QH_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
1088
1088
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
1089
1089
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
1090
1090
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
@@ -1093,7 +1093,7 @@ function getTextLayoutStyle(element) {
|
|
|
1093
1093
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
1094
1094
|
const parsedColumnSpacing = Number(element.textStyle?.columnSpacing);
|
|
1095
1095
|
const columnGap = Number.isFinite(parsedColumnSpacing) && parsedColumnSpacing > 0 ? `${parsedColumnSpacing}px` : "0.75em";
|
|
1096
|
-
const kinsokuStyles =
|
|
1096
|
+
const kinsokuStyles = chunkY2KIB3QH_js.getKinsokuLineBreakStyles(element.textStyle);
|
|
1097
1097
|
if (hasColumns) {
|
|
1098
1098
|
return {
|
|
1099
1099
|
display: "block",
|
|
@@ -1140,10 +1140,10 @@ function getTextLayoutStyle(element) {
|
|
|
1140
1140
|
|
|
1141
1141
|
// src/viewer/utils/text-effects.tsx
|
|
1142
1142
|
function buildTextFillCss2(style) {
|
|
1143
|
-
return
|
|
1143
|
+
return chunkY2KIB3QH_js.buildTextFillCss(style);
|
|
1144
1144
|
}
|
|
1145
1145
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
1146
|
-
return
|
|
1146
|
+
return chunkY2KIB3QH_js.buildTextBody3DSceneStyle(textStyle);
|
|
1147
1147
|
}
|
|
1148
1148
|
|
|
1149
1149
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -1328,13 +1328,13 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1328
1328
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
1329
1329
|
return renderedSegments;
|
|
1330
1330
|
}
|
|
1331
|
-
const paraKey = `${elementId}${
|
|
1331
|
+
const paraKey = `${elementId}${chunkY2KIB3QH_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
1332
1332
|
const paraState = subElementAnimStates.get(paraKey);
|
|
1333
1333
|
if (paraState) {
|
|
1334
1334
|
const style = buildAnimStyle(paraState);
|
|
1335
1335
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
1336
1336
|
}
|
|
1337
|
-
const spec =
|
|
1337
|
+
const spec = chunkY2KIB3QH_js.buildTextBuildSpec(
|
|
1338
1338
|
elementId,
|
|
1339
1339
|
paraIndex,
|
|
1340
1340
|
paraSegments.map((entry) => ({ text: entry.segment.text, style: entry })),
|
|
@@ -1352,7 +1352,7 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1352
1352
|
"span",
|
|
1353
1353
|
{
|
|
1354
1354
|
"data-anim-id": span.animId,
|
|
1355
|
-
style:
|
|
1355
|
+
style: chunkY2KIB3QH_js.textBuildSpanStyle(span),
|
|
1356
1356
|
children: content
|
|
1357
1357
|
},
|
|
1358
1358
|
span.animId
|
|
@@ -1496,10 +1496,10 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1496
1496
|
if (!needsScriptFonts || !text) {
|
|
1497
1497
|
return text;
|
|
1498
1498
|
}
|
|
1499
|
-
const runs =
|
|
1499
|
+
const runs = chunkY2KIB3QH_js.segmentByScript(text);
|
|
1500
1500
|
if (runs.length <= 1) {
|
|
1501
1501
|
if (runs.length === 1) {
|
|
1502
|
-
const font =
|
|
1502
|
+
const font = chunkY2KIB3QH_js.resolveFontForScript(runs[0].script, scriptFonts);
|
|
1503
1503
|
if (font && font !== baseFontFamily) {
|
|
1504
1504
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: text });
|
|
1505
1505
|
}
|
|
@@ -1507,7 +1507,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1507
1507
|
return text;
|
|
1508
1508
|
}
|
|
1509
1509
|
return runs.map((run, i) => {
|
|
1510
|
-
const font =
|
|
1510
|
+
const font = chunkY2KIB3QH_js.resolveFontForScript(run.script, scriptFonts);
|
|
1511
1511
|
if (!font || font === baseFontFamily) {
|
|
1512
1512
|
return /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Fragment, { children: run.text }, `${keyPrefix}-r${i}`);
|
|
1513
1513
|
}
|
|
@@ -1518,14 +1518,14 @@ function renderMetricPieces(text, metric, keyPrefix, inner) {
|
|
|
1518
1518
|
if (!metric || !text) {
|
|
1519
1519
|
return inner(text, keyPrefix);
|
|
1520
1520
|
}
|
|
1521
|
-
const pieces =
|
|
1521
|
+
const pieces = chunkY2KIB3QH_js.splitRunForMetrics(text, metric.font);
|
|
1522
1522
|
if (pieces.length <= 1) {
|
|
1523
1523
|
return inner(text, keyPrefix);
|
|
1524
1524
|
}
|
|
1525
1525
|
return pieces.map((piece, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1526
1526
|
"span",
|
|
1527
1527
|
{
|
|
1528
|
-
style: { letterSpacing:
|
|
1528
|
+
style: { letterSpacing: chunkY2KIB3QH_js.pieceLetterSpacing(metric.authoredPx, piece.tracking) },
|
|
1529
1529
|
children: inner(piece.text, `${keyPrefix}-w${i}`)
|
|
1530
1530
|
},
|
|
1531
1531
|
`${keyPrefix}-w${i}`
|
|
@@ -1596,8 +1596,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1596
1596
|
});
|
|
1597
1597
|
}
|
|
1598
1598
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
1599
|
-
const mathml =
|
|
1600
|
-
const safeMathml = mathml ?
|
|
1599
|
+
const mathml = chunkY2KIB3QH_js.convertOmmlToMathMl(equationXml);
|
|
1600
|
+
const safeMathml = mathml ? chunkY2KIB3QH_js.sanitizeMathMl(mathml) : "";
|
|
1601
1601
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1602
1602
|
"span",
|
|
1603
1603
|
{
|
|
@@ -1647,7 +1647,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1647
1647
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: equationContent }, `${elementId}-seg-${segmentIndex}`);
|
|
1648
1648
|
}
|
|
1649
1649
|
function renderPictureBullet(elementId, segmentIndex, bulletInfo, baseFontSize) {
|
|
1650
|
-
const picture =
|
|
1650
|
+
const picture = chunkY2KIB3QH_js.resolvePictureBullet(bulletInfo, baseFontSize) ?? {
|
|
1651
1651
|
sizePx: baseFontSize,
|
|
1652
1652
|
fallbackMarker: "\u2022",
|
|
1653
1653
|
accessibleLabel: "Bullet"
|
|
@@ -1698,7 +1698,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1698
1698
|
}
|
|
1699
1699
|
const segmentStyle = segment.style || {};
|
|
1700
1700
|
const rawText = bulletInfo && typeof bulletHangPx === "number" ? (segment.text || "").trimEnd() : segment.text || "";
|
|
1701
|
-
const textValue =
|
|
1701
|
+
const textValue = chunkY2KIB3QH_js.substituteFieldText(rawText, segment.fieldType, fieldContext);
|
|
1702
1702
|
const lines = textValue.split("\n");
|
|
1703
1703
|
const textDecorationTokens = [];
|
|
1704
1704
|
if (segmentStyle.underline || segmentStyle.hyperlink) {
|
|
@@ -1708,8 +1708,8 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1708
1708
|
textDecorationTokens.push("line-through");
|
|
1709
1709
|
}
|
|
1710
1710
|
const isDoubleStrike = segmentStyle.strikethrough && segmentStyle.strikeType === "dblStrike";
|
|
1711
|
-
const resolvedSegmentColor = segmentStyle.hyperlink ?
|
|
1712
|
-
const underlineDecoration =
|
|
1711
|
+
const resolvedSegmentColor = segmentStyle.hyperlink ? chunkY2KIB3QH_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, HYPERLINK_COLOR) : chunkY2KIB3QH_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, fallbackColor);
|
|
1712
|
+
const underlineDecoration = chunkY2KIB3QH_js.resolveUnderlineDecorationStyle(
|
|
1713
1713
|
Boolean(isDoubleStrike),
|
|
1714
1714
|
segmentStyle.underlineStyle
|
|
1715
1715
|
);
|
|
@@ -1719,17 +1719,17 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1719
1719
|
const authoredLetterSpacing = typeof segmentStyle.characterSpacing === "number" && segmentStyle.characterSpacing !== 0 ? segmentStyle.characterSpacing / 100 * (96 / 72) : 0;
|
|
1720
1720
|
const textFillStyles = buildTextFillCss2(segmentStyle);
|
|
1721
1721
|
const rawFontSize = segmentStyle.fontSize || element.textStyle?.fontSize || DEFAULT_TEXT_FONT_SIZE;
|
|
1722
|
-
const autoFitScale =
|
|
1722
|
+
const autoFitScale = chunkY2KIB3QH_js.resolveAutoFitFontScale(element.textStyle);
|
|
1723
1723
|
const baseFontSize = rawFontSize * autoFitScale;
|
|
1724
1724
|
const baselineShift = baselineFraction !== 0 ? `${baselineFraction * baseFontSize}px` : void 0;
|
|
1725
1725
|
const baseFontSizePt = baseFontSize * (72 / 96);
|
|
1726
1726
|
const fontKerning = typeof segmentStyle.kerning === "number" ? segmentStyle.kerning === 0 ? "none" : baseFontSizePt >= segmentStyle.kerning / 100 ? "normal" : "none" : void 0;
|
|
1727
1727
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
1728
|
-
const baseFontFamily = rawFontFamily ?
|
|
1728
|
+
const baseFontFamily = rawFontFamily ? chunkY2KIB3QH_js.getSubstituteFontFamily(
|
|
1729
1729
|
rawFontFamily,
|
|
1730
|
-
|
|
1730
|
+
chunkY2KIB3QH_js.parsePanoseString(segmentStyle.latinFontPanose ?? element.textStyle?.latinFontPanose)
|
|
1731
1731
|
) : DEFAULT_FONT_FAMILY2;
|
|
1732
|
-
const scriptFont = (name, panose) => name ?
|
|
1732
|
+
const scriptFont = (name, panose) => name ? chunkY2KIB3QH_js.getSubstituteFontFamily(name, chunkY2KIB3QH_js.parsePanoseString(panose)) : baseFontFamily;
|
|
1733
1733
|
const scriptFonts = {
|
|
1734
1734
|
latin: baseFontFamily,
|
|
1735
1735
|
eastAsia: scriptFont(
|
|
@@ -1745,7 +1745,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1745
1745
|
segmentStyle.symbolFontPanose ?? element.textStyle?.symbolFontPanose
|
|
1746
1746
|
)
|
|
1747
1747
|
};
|
|
1748
|
-
const needsScriptFonts =
|
|
1748
|
+
const needsScriptFonts = chunkY2KIB3QH_js.hasDistinctScriptFonts(scriptFonts);
|
|
1749
1749
|
const metricFont = {
|
|
1750
1750
|
fontFamily: baseFontFamily,
|
|
1751
1751
|
fontSizePx: baseFontSize * baselineFontScale,
|
|
@@ -1753,9 +1753,9 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1753
1753
|
italic: Boolean(segmentStyle.italic)
|
|
1754
1754
|
};
|
|
1755
1755
|
const metricContext = { font: metricFont, authoredPx: authoredLetterSpacing };
|
|
1756
|
-
const letterSpacing =
|
|
1756
|
+
const letterSpacing = chunkY2KIB3QH_js.pieceLetterSpacing(
|
|
1757
1757
|
authoredLetterSpacing,
|
|
1758
|
-
|
|
1758
|
+
chunkY2KIB3QH_js.resolveMetricTrackingPx(textValue, metricFont)
|
|
1759
1759
|
);
|
|
1760
1760
|
const spanStyle = {
|
|
1761
1761
|
color: resolvedSegmentColor,
|
|
@@ -1774,15 +1774,15 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1774
1774
|
fontVariantCaps: segmentStyle.textCaps === "small" ? "small-caps" : void 0,
|
|
1775
1775
|
letterSpacing,
|
|
1776
1776
|
fontKerning,
|
|
1777
|
-
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ?
|
|
1777
|
+
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ? chunkY2KIB3QH_js.normalizeHexColor(segmentStyle.highlightColor, "transparent") : void 0,
|
|
1778
1778
|
...textFillStyles,
|
|
1779
|
-
textDecorationColor: segmentStyle.underlineColor ?
|
|
1780
|
-
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${
|
|
1779
|
+
textDecorationColor: segmentStyle.underlineColor ? chunkY2KIB3QH_js.normalizeHexColor(segmentStyle.underlineColor, void 0) : void 0,
|
|
1780
|
+
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${chunkY2KIB3QH_js.normalizeHexColor(segmentStyle.textOutlineColor, "#000000")}` : segmentStyle.textOutlineWidth ? `${segmentStyle.textOutlineWidth}px currentColor` : void 0,
|
|
1781
1781
|
paintOrder: segmentStyle.textOutlineWidth ? "stroke fill" : void 0,
|
|
1782
|
-
textShadow:
|
|
1783
|
-
filter:
|
|
1784
|
-
opacity:
|
|
1785
|
-
WebkitBoxReflect:
|
|
1782
|
+
textShadow: chunkY2KIB3QH_js.buildTextShadowCss(segmentStyle),
|
|
1783
|
+
filter: chunkY2KIB3QH_js.buildTextRunFilterChain(segmentStyle),
|
|
1784
|
+
opacity: chunkY2KIB3QH_js.getTextAlphaOpacity(segmentStyle),
|
|
1785
|
+
WebkitBoxReflect: chunkY2KIB3QH_js.buildTextReflectionCss(segmentStyle)
|
|
1786
1786
|
};
|
|
1787
1787
|
const runRtl = segmentStyle.rtl;
|
|
1788
1788
|
if (runRtl !== void 0 && runRtl !== paragraphRtl) {
|
|
@@ -1802,7 +1802,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1802
1802
|
spanStyle.fontSize = baseFontSize * (bulletInfo.sizePercent / 100) * baselineFontScale;
|
|
1803
1803
|
}
|
|
1804
1804
|
if (bulletInfo.color) {
|
|
1805
|
-
spanStyle.color =
|
|
1805
|
+
spanStyle.color = chunkY2KIB3QH_js.normalizeHexColor(bulletInfo.color, resolvedSegmentColor);
|
|
1806
1806
|
}
|
|
1807
1807
|
if (typeof bulletHangPx === "number" && bulletHangPx > 0) {
|
|
1808
1808
|
spanStyle.display = "inline-block";
|
|
@@ -1848,7 +1848,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1848
1848
|
textAlign: segment.rubyAlignment === "l" ? "left" : segment.rubyAlignment === "r" ? "right" : segment.rubyAlignment === "dist" || segment.rubyAlignment === "distCat" || segment.rubyAlignment === "distLetter" ? "justify" : "center"
|
|
1849
1849
|
};
|
|
1850
1850
|
if (segment.rubyStyle?.color) {
|
|
1851
|
-
rubyStyle.color =
|
|
1851
|
+
rubyStyle.color = chunkY2KIB3QH_js.normalizeHexColor(segment.rubyStyle.color, resolvedSegmentColor);
|
|
1852
1852
|
}
|
|
1853
1853
|
innerContent = /* @__PURE__ */ jsxRuntime.jsxs("ruby", { children: [
|
|
1854
1854
|
baseContent,
|
|
@@ -1918,7 +1918,7 @@ function groupSegmentsIntoParagraphs(segments) {
|
|
|
1918
1918
|
return paragraphs;
|
|
1919
1919
|
}
|
|
1920
1920
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick) {
|
|
1921
|
-
if (!
|
|
1921
|
+
if (!chunkY2KIB3QH_js.hasTextProperties(element)) {
|
|
1922
1922
|
return emptyFallback || null;
|
|
1923
1923
|
}
|
|
1924
1924
|
const effectiveSegments = segmentOverrides ?? element.textSegments;
|
|
@@ -1939,10 +1939,10 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
1939
1939
|
return element.text || emptyFallback || "";
|
|
1940
1940
|
}
|
|
1941
1941
|
const paragraphs = groupSegmentsIntoParagraphs(effectiveSegments);
|
|
1942
|
-
const paragraphIndents =
|
|
1943
|
-
const elementRtl =
|
|
1944
|
-
const elementAlign =
|
|
1945
|
-
const bodyStyle =
|
|
1942
|
+
const paragraphIndents = chunkY2KIB3QH_js.hasTextProperties(element) ? element.paragraphIndents : void 0;
|
|
1943
|
+
const elementRtl = chunkY2KIB3QH_js.hasTextProperties(element) ? element.textStyle?.rtl : void 0;
|
|
1944
|
+
const elementAlign = chunkY2KIB3QH_js.hasTextProperties(element) ? element.textStyle?.align : void 0;
|
|
1945
|
+
const bodyStyle = chunkY2KIB3QH_js.hasTextProperties(element) ? element.textStyle : void 0;
|
|
1946
1946
|
const spaceFirstLast = bodyStyle?.spaceFirstLastParagraph !== false;
|
|
1947
1947
|
return paragraphs.map(({ entries: paraSegments, terminator }, paraIndex) => {
|
|
1948
1948
|
const paraIndent = paragraphIndents?.[paraIndex];
|
|
@@ -1957,24 +1957,24 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
1957
1957
|
return Boolean(segment.text) && segment.text.trim().length > 0;
|
|
1958
1958
|
});
|
|
1959
1959
|
const hasBullet = bulletInfo && !bulletInfo.none && hasVisibleTextContent;
|
|
1960
|
-
const paraRtl =
|
|
1960
|
+
const paraRtl = chunkY2KIB3QH_js.resolveParagraphRtl(paraSegments, elementRtl);
|
|
1961
1961
|
const isRtlParagraph = paraRtl === true;
|
|
1962
|
-
const paraAlign =
|
|
1963
|
-
const cssTextAlign =
|
|
1962
|
+
const paraAlign = chunkY2KIB3QH_js.resolveParagraphAlign(paraSegments, elementAlign);
|
|
1963
|
+
const cssTextAlign = chunkY2KIB3QH_js.resolveCssTextAlign(paraAlign, isRtlParagraph);
|
|
1964
1964
|
const paraMarginLeft = isRtlParagraph ? void 0 : rawMarginLeft;
|
|
1965
1965
|
const paraMarginRight = isRtlParagraph ? rawMarginLeft : void 0;
|
|
1966
1966
|
const paraTextIndent = rawTextIndent;
|
|
1967
|
-
const paraKinsokuStyle =
|
|
1967
|
+
const paraKinsokuStyle = chunkY2KIB3QH_js.getKinsokuLineBreakStyles(firstSeg?.segment.style);
|
|
1968
1968
|
const hasParaKinsoku = Object.keys(paraKinsokuStyle).length > 0;
|
|
1969
1969
|
const paraProps = effectiveSegments[firstSeg?.globalIndex ?? -1]?.paragraphProperties ?? (paraSegments.length === 0 ? terminator?.paragraphProperties : void 0);
|
|
1970
|
-
const spacing =
|
|
1970
|
+
const spacing = chunkY2KIB3QH_js.resolveParagraphSpacing({
|
|
1971
1971
|
paraProps,
|
|
1972
1972
|
bodyStyle,
|
|
1973
1973
|
isFirst: paraIndex === 0,
|
|
1974
1974
|
isLast: paraIndex === paragraphs.length - 1,
|
|
1975
1975
|
spaceFirstLast
|
|
1976
1976
|
});
|
|
1977
|
-
const strutFontSize =
|
|
1977
|
+
const strutFontSize = chunkY2KIB3QH_js.resolveParagraphStrutFontSize(
|
|
1978
1978
|
paraSegments.length > 0 ? paraSegments.map(({ segment }) => segment) : terminator ? [terminator] : [],
|
|
1979
1979
|
bodyStyle?.fontSize
|
|
1980
1980
|
);
|
|
@@ -2078,13 +2078,13 @@ function hexToRgbUnit(hex) {
|
|
|
2078
2078
|
};
|
|
2079
2079
|
}
|
|
2080
2080
|
function getDuotoneColors(element) {
|
|
2081
|
-
if (!
|
|
2081
|
+
if (!chunkY2KIB3QH_js.isImageLikeElement(element)) {
|
|
2082
2082
|
return void 0;
|
|
2083
2083
|
}
|
|
2084
2084
|
return element.imageEffects?.duotone;
|
|
2085
2085
|
}
|
|
2086
2086
|
function buildLineShadowCss(element) {
|
|
2087
|
-
if (!
|
|
2087
|
+
if (!chunkY2KIB3QH_js.hasShapeProperties(element)) {
|
|
2088
2088
|
return void 0;
|
|
2089
2089
|
}
|
|
2090
2090
|
const ss = element.shapeStyle;
|
|
@@ -2095,13 +2095,13 @@ function buildLineShadowCss(element) {
|
|
|
2095
2095
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
2096
2096
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
2097
2097
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
2098
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
2099
|
-
|
|
2098
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkY2KIB3QH_js.colorWithOpacity(
|
|
2099
|
+
chunkY2KIB3QH_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
2100
2100
|
opacity
|
|
2101
2101
|
)}`;
|
|
2102
2102
|
}
|
|
2103
2103
|
function buildLineGlowFilter(element) {
|
|
2104
|
-
if (!
|
|
2104
|
+
if (!chunkY2KIB3QH_js.hasShapeProperties(element)) {
|
|
2105
2105
|
return void 0;
|
|
2106
2106
|
}
|
|
2107
2107
|
const ss = element.shapeStyle;
|
|
@@ -2110,7 +2110,7 @@ function buildLineGlowFilter(element) {
|
|
|
2110
2110
|
}
|
|
2111
2111
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
2112
2112
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
2113
|
-
const glowCol =
|
|
2113
|
+
const glowCol = chunkY2KIB3QH_js.colorWithOpacity(chunkY2KIB3QH_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
2114
2114
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
2115
2115
|
}
|
|
2116
2116
|
function mapDagBlendModeToCss(blend) {
|
|
@@ -2134,7 +2134,7 @@ function getDagDuotoneFilterId(elementId) {
|
|
|
2134
2134
|
return `dag-duotone-${elementId}`;
|
|
2135
2135
|
}
|
|
2136
2136
|
function hasDagDuotoneEffect(element) {
|
|
2137
|
-
if (!
|
|
2137
|
+
if (!chunkY2KIB3QH_js.hasShapeProperties(element)) {
|
|
2138
2138
|
return false;
|
|
2139
2139
|
}
|
|
2140
2140
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
@@ -2197,7 +2197,7 @@ function getRoundRectRadiusPx(element) {
|
|
|
2197
2197
|
|
|
2198
2198
|
// src/viewer/utils/shape-visual-3d.ts
|
|
2199
2199
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
2200
|
-
return
|
|
2200
|
+
return chunkY2KIB3QH_js.build3DExtrusionData(
|
|
2201
2201
|
shape3d,
|
|
2202
2202
|
scene3d,
|
|
2203
2203
|
fillColor,
|
|
@@ -2206,7 +2206,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
2206
2206
|
);
|
|
2207
2207
|
}
|
|
2208
2208
|
function apply3dEffects2(base, scene3d, shape3d, fillColorFallback) {
|
|
2209
|
-
|
|
2209
|
+
chunkY2KIB3QH_js.apply3dEffects(base, scene3d, shape3d, fillColorFallback);
|
|
2210
2210
|
}
|
|
2211
2211
|
|
|
2212
2212
|
// src/viewer/utils/shape-visual-style.ts
|
|
@@ -2214,43 +2214,43 @@ function getGradientTilingCss(style) {
|
|
|
2214
2214
|
if (!style || style.fillMode !== "gradient") {
|
|
2215
2215
|
return void 0;
|
|
2216
2216
|
}
|
|
2217
|
-
const isStructuredLinear = (style.fillGradientType || "linear") === "linear" &&
|
|
2217
|
+
const isStructuredLinear = (style.fillGradientType || "linear") === "linear" && chunkY2KIB3QH_js.sanitizeGradientStops(style.fillGradientStops).length > 0;
|
|
2218
2218
|
if (isStructuredLinear) {
|
|
2219
|
-
const flip =
|
|
2219
|
+
const flip = chunkY2KIB3QH_js.getGradientTileFlipCss(style.fillGradientFlip);
|
|
2220
2220
|
if (flip) {
|
|
2221
2221
|
return flip;
|
|
2222
2222
|
}
|
|
2223
2223
|
}
|
|
2224
|
-
return
|
|
2224
|
+
return chunkY2KIB3QH_js.getGradientTileRectCss(style.fillGradientTileRect);
|
|
2225
2225
|
}
|
|
2226
2226
|
function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2227
|
-
if (!
|
|
2227
|
+
if (!chunkY2KIB3QH_js.hasShapeProperties(element)) {
|
|
2228
2228
|
return {};
|
|
2229
2229
|
}
|
|
2230
2230
|
const normalizedShapeType = getShapeType(element.shapeType);
|
|
2231
|
-
const clipPath =
|
|
2231
|
+
const clipPath = chunkY2KIB3QH_js.isIdentityRectClip(element) ? void 0 : chunkY2KIB3QH_js.getResolvedShapeClipPath(element);
|
|
2232
2232
|
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;
|
|
2233
|
-
const rendersStrokeOnlyPreset =
|
|
2233
|
+
const rendersStrokeOnlyPreset = chunkY2KIB3QH_js.isStrokeOnlyPresetElement(element);
|
|
2234
2234
|
const fillOpacity = element.shapeStyle?.fillOpacity;
|
|
2235
2235
|
const strokeOpacity = element.shapeStyle?.strokeOpacity;
|
|
2236
|
-
const strokeDash =
|
|
2237
|
-
const fillGradient =
|
|
2236
|
+
const strokeDash = chunkY2KIB3QH_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2237
|
+
const fillGradient = chunkY2KIB3QH_js.buildCssGradientFromShapeStyle(element.shapeStyle, {
|
|
2238
2238
|
rotation: element.rotation,
|
|
2239
2239
|
width: element.width,
|
|
2240
2240
|
height: element.height
|
|
2241
2241
|
}) || element.shapeStyle?.fillGradient;
|
|
2242
|
-
const shadowCss =
|
|
2243
|
-
const innerShadowCss =
|
|
2244
|
-
const resolvedFillColor =
|
|
2245
|
-
const resolvedStrokeColor =
|
|
2242
|
+
const shadowCss = chunkY2KIB3QH_js.buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
2243
|
+
const innerShadowCss = chunkY2KIB3QH_js.buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
2244
|
+
const resolvedFillColor = chunkY2KIB3QH_js.colorWithOpacity(fillColor, fillOpacity);
|
|
2245
|
+
const resolvedStrokeColor = chunkY2KIB3QH_js.colorWithOpacity(strokeColor, strokeOpacity);
|
|
2246
2246
|
const ss = element.shapeStyle;
|
|
2247
2247
|
const gradientTiling = getGradientTilingCss(ss);
|
|
2248
|
-
const paintsGradientOutline =
|
|
2248
|
+
const paintsGradientOutline = chunkY2KIB3QH_js.suppressesCssBorder(element);
|
|
2249
2249
|
const hasFillOverlayColor = Boolean(
|
|
2250
2250
|
ss?.dagFillOverlayColor && ss.dagFillOverlayColor !== "transparent"
|
|
2251
2251
|
);
|
|
2252
2252
|
const combinedShadowParts = [];
|
|
2253
|
-
const multiLayerShadow =
|
|
2253
|
+
const multiLayerShadow = chunkY2KIB3QH_js.buildMultiLayerShadowCss(element.shapeStyle);
|
|
2254
2254
|
if (multiLayerShadow) {
|
|
2255
2255
|
combinedShadowParts.push(multiLayerShadow);
|
|
2256
2256
|
} else if (shadowCss) {
|
|
@@ -2259,7 +2259,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2259
2259
|
if (innerShadowCss) {
|
|
2260
2260
|
combinedShadowParts.push(innerShadowCss);
|
|
2261
2261
|
}
|
|
2262
|
-
const glowBoxShadow =
|
|
2262
|
+
const glowBoxShadow = chunkY2KIB3QH_js.buildGlowBoxShadow(ss?.glowColor, ss?.glowRadius, ss?.glowOpacity);
|
|
2263
2263
|
if (glowBoxShadow) {
|
|
2264
2264
|
combinedShadowParts.push(glowBoxShadow);
|
|
2265
2265
|
}
|
|
@@ -2267,7 +2267,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2267
2267
|
if (lineShadow) {
|
|
2268
2268
|
combinedShadowParts.push(lineShadow);
|
|
2269
2269
|
}
|
|
2270
|
-
const compoundLineShadow =
|
|
2270
|
+
const compoundLineShadow = chunkY2KIB3QH_js.getCompoundLineBoxShadow(
|
|
2271
2271
|
element.shapeStyle?.compoundLine,
|
|
2272
2272
|
strokeWidth,
|
|
2273
2273
|
resolvedStrokeColor
|
|
@@ -2280,11 +2280,11 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2280
2280
|
if (ss?.glowColor && ss.glowColor !== "transparent" && ss.glowRadius) {
|
|
2281
2281
|
const glowOpacity = typeof ss.glowOpacity === "number" ? ss.glowOpacity : 0.75;
|
|
2282
2282
|
const glowRad = Math.round(Math.max(0, ss.glowRadius));
|
|
2283
|
-
const glowCol =
|
|
2283
|
+
const glowCol = chunkY2KIB3QH_js.colorWithOpacity(chunkY2KIB3QH_js.normalizeHexColor(ss.glowColor, "#ffff00"), glowOpacity);
|
|
2284
2284
|
filterParts.push(`drop-shadow(0 0 ${glowRad}px ${glowCol})`);
|
|
2285
2285
|
}
|
|
2286
2286
|
if (typeof ss?.softEdgeRadius === "number" && ss.softEdgeRadius > 0) {
|
|
2287
|
-
filterParts.push(`url(#${
|
|
2287
|
+
filterParts.push(`url(#${chunkY2KIB3QH_js.getSoftEdgeFilterId(element.id)})`);
|
|
2288
2288
|
}
|
|
2289
2289
|
if (typeof ss?.blurRadius === "number" && ss.blurRadius > 0) {
|
|
2290
2290
|
filterParts.push(`blur(${Math.round(ss.blurRadius)}px)`);
|
|
@@ -2293,13 +2293,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2293
2293
|
if (lineGlowCss) {
|
|
2294
2294
|
filterParts.push(lineGlowCss);
|
|
2295
2295
|
}
|
|
2296
|
-
const dagFilter =
|
|
2296
|
+
const dagFilter = chunkY2KIB3QH_js.getEffectDagFilter(ss, element.id);
|
|
2297
2297
|
if (dagFilter) {
|
|
2298
2298
|
filterParts.push(dagFilter);
|
|
2299
2299
|
}
|
|
2300
2300
|
const lineJoinCss = ss?.lineJoin === "round" ? "round" : ss?.lineJoin === "bevel" ? "bevel" : ss?.lineJoin === "miter" ? "miter" : void 0;
|
|
2301
2301
|
const miterLimitCss = ss?.lineJoin === "miter" && typeof ss?.miterLimit === "number" ? Math.max(ss.miterLimit / 1e5, 1) : void 0;
|
|
2302
|
-
const patternFill =
|
|
2302
|
+
const patternFill = chunkY2KIB3QH_js.buildPatternFillCss(element.shapeStyle);
|
|
2303
2303
|
const imageFillUrl = ss?.fillMode === "image" && ss.fillImageUrl ? ss.fillImageUrl : void 0;
|
|
2304
2304
|
const imageFillMode = ss?.fillImageMode || "stretch";
|
|
2305
2305
|
let reflectCss;
|
|
@@ -2311,7 +2311,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2311
2311
|
const endOpacity = typeof ss.reflectionEndOpacity === "number" ? ss.reflectionEndOpacity : 0;
|
|
2312
2312
|
const fadeLength = typeof ss.reflectionEndPosition === "number" ? Math.round(ss.reflectionEndPosition * Math.max(element.height, 1)) : 100;
|
|
2313
2313
|
const blurRadius = typeof ss.reflectionBlurRadius === "number" ? ss.reflectionBlurRadius : 0;
|
|
2314
|
-
reflectCss =
|
|
2314
|
+
reflectCss = chunkY2KIB3QH_js.buildReflectionCss(distance, startOpacity, endOpacity, fadeLength, blurRadius);
|
|
2315
2315
|
}
|
|
2316
2316
|
}
|
|
2317
2317
|
const base = {
|
|
@@ -2357,9 +2357,9 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2357
2357
|
// path following the shape's geometry, because a CSS border can only take
|
|
2358
2358
|
// one colour. Keeping the border too would draw the parser's averaged
|
|
2359
2359
|
// solid underneath the gradient.
|
|
2360
|
-
borderWidth: strokeWidth > 0 && !paintsGradientOutline ?
|
|
2360
|
+
borderWidth: strokeWidth > 0 && !paintsGradientOutline ? chunkY2KIB3QH_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : 0,
|
|
2361
2361
|
borderColor: strokeWidth > 0 && !paintsGradientOutline ? resolvedStrokeColor : void 0,
|
|
2362
|
-
borderStyle: strokeWidth > 0 && !paintsGradientOutline ?
|
|
2362
|
+
borderStyle: strokeWidth > 0 && !paintsGradientOutline ? chunkY2KIB3QH_js.getCssBorderDashStyle(strokeDash, ss?.compoundLine) : void 0,
|
|
2363
2363
|
strokeLinejoin: lineJoinCss,
|
|
2364
2364
|
strokeMiterlimit: miterLimitCss,
|
|
2365
2365
|
strokeLinecap: ss?.lineCap === "rnd" ? "round" : ss?.lineCap === "sq" ? "square" : ss?.lineCap === "flat" ? "butt" : void 0
|
|
@@ -2419,7 +2419,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2419
2419
|
borderWidth: 0,
|
|
2420
2420
|
borderTopWidth: Math.max(strokeWidth, 2),
|
|
2421
2421
|
borderTopColor: resolvedStrokeColor,
|
|
2422
|
-
borderTopStyle:
|
|
2422
|
+
borderTopStyle: chunkY2KIB3QH_js.getCssBorderDashStyle(strokeDash)
|
|
2423
2423
|
};
|
|
2424
2424
|
}
|
|
2425
2425
|
if (normalizedShapeType === "cylinder") {
|
|
@@ -2433,13 +2433,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2433
2433
|
function getConnectorAdjustment(element, key, fallback) {
|
|
2434
2434
|
const direct = element.shapeAdjustments?.[key];
|
|
2435
2435
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
2436
|
-
return
|
|
2436
|
+
return chunkY2KIB3QH_js.clampUnitInterval(direct / 1e5);
|
|
2437
2437
|
}
|
|
2438
2438
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
2439
2439
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
2440
|
-
return
|
|
2440
|
+
return chunkY2KIB3QH_js.clampUnitInterval(fallbackKey / 1e5);
|
|
2441
2441
|
}
|
|
2442
|
-
return
|
|
2442
|
+
return chunkY2KIB3QH_js.clampUnitInterval(fallback);
|
|
2443
2443
|
}
|
|
2444
2444
|
function getConnectorPathGeometry(element) {
|
|
2445
2445
|
const width = Math.max(element.width, 0);
|
|
@@ -2572,7 +2572,7 @@ function toHexByte(value) {
|
|
|
2572
2572
|
return clamped.toString(16).padStart(2, "0");
|
|
2573
2573
|
}
|
|
2574
2574
|
function shiftHex(hex, factor, towardsWhite) {
|
|
2575
|
-
const channels =
|
|
2575
|
+
const channels = chunkY2KIB3QH_js.hexToRgbChannels(hex);
|
|
2576
2576
|
if (!channels) {
|
|
2577
2577
|
return hex;
|
|
2578
2578
|
}
|
|
@@ -2598,7 +2598,7 @@ function buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity) {
|
|
|
2598
2598
|
const fillOff = subpath.fillMode === "none" || !hasFill;
|
|
2599
2599
|
return {
|
|
2600
2600
|
d: subpath.d,
|
|
2601
|
-
fill: fillOff ? "none" :
|
|
2601
|
+
fill: fillOff ? "none" : chunkY2KIB3QH_js.colorWithOpacity(adjustFillForMode(fillColor, subpath.fillMode), fillOpacity),
|
|
2602
2602
|
stroked: subpath.stroke !== false
|
|
2603
2603
|
};
|
|
2604
2604
|
});
|
|
@@ -2614,11 +2614,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
|
|
|
2614
2614
|
strokePaint,
|
|
2615
2615
|
strokeWidth,
|
|
2616
2616
|
dashArray,
|
|
2617
|
-
lineCap:
|
|
2617
|
+
lineCap: chunkY2KIB3QH_js.svgLineCap(shapeStyle?.lineCap),
|
|
2618
2618
|
lineJoin,
|
|
2619
2619
|
miterLimit,
|
|
2620
|
-
offsets:
|
|
2621
|
-
widths:
|
|
2620
|
+
offsets: chunkY2KIB3QH_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
2621
|
+
widths: chunkY2KIB3QH_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
|
|
2622
2622
|
};
|
|
2623
2623
|
}
|
|
2624
2624
|
function strokeStrands(d, keyBase, ctx) {
|
|
@@ -2666,9 +2666,9 @@ function gradientDefs(gradient) {
|
|
|
2666
2666
|
}
|
|
2667
2667
|
function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredPaths, shapeStyle, hasFill, fillColor, fillOpacity, strokePaint, strokeWidth, dashArray, animatesFill = false, gradient) {
|
|
2668
2668
|
const ctx = strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray);
|
|
2669
|
-
const subpaths = structuredPaths && structuredPaths.length > 0 ?
|
|
2669
|
+
const subpaths = structuredPaths && structuredPaths.length > 0 ? chunkY2KIB3QH_js.customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
2670
2670
|
const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
|
|
2671
|
-
const gradientPaint = gradient ?
|
|
2671
|
+
const gradientPaint = gradient ? chunkY2KIB3QH_js.svgGradientFillRef(gradient) : void 0;
|
|
2672
2672
|
const nodes = [];
|
|
2673
2673
|
if (subpaths && needsPerSubpath) {
|
|
2674
2674
|
const paints = buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity);
|
|
@@ -2700,7 +2700,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2700
2700
|
"path",
|
|
2701
2701
|
{
|
|
2702
2702
|
d: pathData,
|
|
2703
|
-
fill: animatesFill ? "inherit" : gradientPaint ??
|
|
2703
|
+
fill: animatesFill ? "inherit" : gradientPaint ?? chunkY2KIB3QH_js.colorWithOpacity(fillColor, fillOpacity),
|
|
2704
2704
|
stroke: "none",
|
|
2705
2705
|
vectorEffect: "non-scaling-stroke"
|
|
2706
2706
|
},
|
|
@@ -2726,14 +2726,14 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2726
2726
|
);
|
|
2727
2727
|
}
|
|
2728
2728
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2729
|
-
if (!
|
|
2729
|
+
if (!chunkY2KIB3QH_js.hasShapeProperties(element)) {
|
|
2730
2730
|
return null;
|
|
2731
2731
|
}
|
|
2732
2732
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
2733
|
-
const fillPaint = animatesFill ? "inherit" :
|
|
2734
|
-
const strokePaint = animatesStroke ? "inherit" :
|
|
2735
|
-
const dashType =
|
|
2736
|
-
const dashArray =
|
|
2733
|
+
const fillPaint = animatesFill ? "inherit" : chunkY2KIB3QH_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
2734
|
+
const strokePaint = animatesStroke ? "inherit" : chunkY2KIB3QH_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
2735
|
+
const dashType = chunkY2KIB3QH_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2736
|
+
const dashArray = chunkY2KIB3QH_js.getSvgStrokeDasharray(
|
|
2737
2737
|
dashType,
|
|
2738
2738
|
Math.max(strokeWidth, 1),
|
|
2739
2739
|
element.shapeStyle?.customDashSegments
|
|
@@ -2814,21 +2814,21 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2814
2814
|
// container's `background-image` is suppressed for custom geometry, so
|
|
2815
2815
|
// without this the shape fell back to the parser's representative solid
|
|
2816
2816
|
// and lost every fade (issue #132).
|
|
2817
|
-
|
|
2817
|
+
chunkY2KIB3QH_js.buildSvgGradientDef(element.shapeStyle, element.id)
|
|
2818
2818
|
);
|
|
2819
2819
|
}
|
|
2820
|
-
if (
|
|
2820
|
+
if (chunkY2KIB3QH_js.isCalloutShape(normalizedType)) {
|
|
2821
2821
|
const width = Math.max(element.width, 1);
|
|
2822
2822
|
const height = Math.max(element.height, 1);
|
|
2823
|
-
const geometry =
|
|
2823
|
+
const geometry = chunkY2KIB3QH_js.getCalloutLeaderLineGeometry(
|
|
2824
2824
|
normalizedType,
|
|
2825
2825
|
width,
|
|
2826
2826
|
height,
|
|
2827
2827
|
element.shapeAdjustments
|
|
2828
2828
|
);
|
|
2829
2829
|
if (geometry && geometry.points.length >= 2) {
|
|
2830
|
-
const leaderPath =
|
|
2831
|
-
const bounds =
|
|
2830
|
+
const leaderPath = chunkY2KIB3QH_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
2831
|
+
const bounds = chunkY2KIB3QH_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
2832
2832
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
2833
2833
|
const offsetLeft = bounds.minX;
|
|
2834
2834
|
const offsetTop = bounds.minY;
|
|
@@ -2891,10 +2891,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2891
2891
|
const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
|
|
2892
2892
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
2893
2893
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
2894
|
-
const connectorLineCap =
|
|
2894
|
+
const connectorLineCap = chunkY2KIB3QH_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
2895
2895
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
2896
|
-
const offsets =
|
|
2897
|
-
const widths =
|
|
2896
|
+
const offsets = chunkY2KIB3QH_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
2897
|
+
const widths = chunkY2KIB3QH_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
2898
2898
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2899
2899
|
"svg",
|
|
2900
2900
|
{
|
|
@@ -2961,15 +2961,15 @@ function parseGradientFillCss(gradFill) {
|
|
|
2961
2961
|
}
|
|
2962
2962
|
const parsed = stops.map((gs) => {
|
|
2963
2963
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
2964
|
-
const color =
|
|
2965
|
-
const opacity =
|
|
2966
|
-
return { pos, color:
|
|
2964
|
+
const color = chunkY2KIB3QH_js.parseDrawingColor(gs) ?? "#888888";
|
|
2965
|
+
const opacity = chunkY2KIB3QH_js.parseDrawingColorOpacity(gs);
|
|
2966
|
+
return { pos, color: chunkY2KIB3QH_js.colorWithOpacity(color, opacity) };
|
|
2967
2967
|
}).sort((a, b) => a.pos - b.pos);
|
|
2968
2968
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
2969
2969
|
const lin = gradFill["a:lin"];
|
|
2970
2970
|
if (lin) {
|
|
2971
2971
|
const angRaw = Number.parseInt(String(lin["@_ang"] || "0"), 10);
|
|
2972
|
-
const angleDeg = Math.round(
|
|
2972
|
+
const angleDeg = Math.round(chunkY2KIB3QH_js.ooxmlGradientAngleToCssDegrees(angRaw / 6e4));
|
|
2973
2973
|
return `linear-gradient(${angleDeg}deg, ${stopStrings})`;
|
|
2974
2974
|
}
|
|
2975
2975
|
const path = gradFill["a:path"];
|
|
@@ -3004,8 +3004,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
3004
3004
|
if (!pattFill) {
|
|
3005
3005
|
return void 0;
|
|
3006
3006
|
}
|
|
3007
|
-
const fgColor =
|
|
3008
|
-
const bgColor =
|
|
3007
|
+
const fgColor = chunkY2KIB3QH_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
3008
|
+
const bgColor = chunkY2KIB3QH_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
3009
3009
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
3010
3010
|
switch (preset) {
|
|
3011
3011
|
case "ltHorz":
|
|
@@ -3116,11 +3116,11 @@ function parseCellBorders(cellProperties) {
|
|
|
3116
3116
|
const prstDash = ln["a:prstDash"];
|
|
3117
3117
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
3118
3118
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
3119
|
-
const color =
|
|
3119
|
+
const color = chunkY2KIB3QH_js.parseDrawingColor(ln["a:solidFill"]);
|
|
3120
3120
|
if (color) {
|
|
3121
|
-
const opacity =
|
|
3121
|
+
const opacity = chunkY2KIB3QH_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
3122
3122
|
const key = `${edge.prefix}`;
|
|
3123
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
3123
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkY2KIB3QH_js.colorWithOpacity(color, opacity)}`;
|
|
3124
3124
|
}
|
|
3125
3125
|
}
|
|
3126
3126
|
return borderStyle;
|
|
@@ -3133,7 +3133,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3133
3133
|
const textShadowParts = [];
|
|
3134
3134
|
const outerShdw = effectLst["a:outerShdw"];
|
|
3135
3135
|
if (outerShdw) {
|
|
3136
|
-
const shdwColor =
|
|
3136
|
+
const shdwColor = chunkY2KIB3QH_js.parseDrawingColor(outerShdw);
|
|
3137
3137
|
if (shdwColor) {
|
|
3138
3138
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
3139
3139
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -3151,7 +3151,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3151
3151
|
}
|
|
3152
3152
|
const glow = effectLst["a:glow"];
|
|
3153
3153
|
if (glow) {
|
|
3154
|
-
const glowColor =
|
|
3154
|
+
const glowColor = chunkY2KIB3QH_js.parseDrawingColor(glow);
|
|
3155
3155
|
if (glowColor) {
|
|
3156
3156
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
3157
3157
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -3230,10 +3230,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3230
3230
|
if (runProps?.["@_u"] !== void 0) {
|
|
3231
3231
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
3232
3232
|
}
|
|
3233
|
-
const runColor =
|
|
3233
|
+
const runColor = chunkY2KIB3QH_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkY2KIB3QH_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
3234
3234
|
if (runColor) {
|
|
3235
|
-
const opacity =
|
|
3236
|
-
cellStyle.color =
|
|
3235
|
+
const opacity = chunkY2KIB3QH_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
3236
|
+
cellStyle.color = chunkY2KIB3QH_js.colorWithOpacity(runColor, opacity);
|
|
3237
3237
|
}
|
|
3238
3238
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
3239
3239
|
if (fontFamily) {
|
|
@@ -3243,15 +3243,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3243
3243
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
3244
3244
|
}
|
|
3245
3245
|
const cellProperties = cellXml["a:tcPr"];
|
|
3246
|
-
const cellFill =
|
|
3246
|
+
const cellFill = chunkY2KIB3QH_js.parseDrawingColor(
|
|
3247
3247
|
cellProperties?.["a:solidFill"],
|
|
3248
3248
|
schemeColorOverrides
|
|
3249
3249
|
);
|
|
3250
3250
|
if (cellFill) {
|
|
3251
|
-
const opacity =
|
|
3251
|
+
const opacity = chunkY2KIB3QH_js.parseDrawingColorOpacity(
|
|
3252
3252
|
cellProperties?.["a:solidFill"]
|
|
3253
3253
|
);
|
|
3254
|
-
cellStyle.backgroundColor =
|
|
3254
|
+
cellStyle.backgroundColor = chunkY2KIB3QH_js.colorWithOpacity(cellFill, opacity);
|
|
3255
3255
|
} else {
|
|
3256
3256
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
3257
3257
|
if (gradCss) {
|
|
@@ -3266,16 +3266,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3266
3266
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
3267
3267
|
Object.assign(cellStyle, edgeBorders);
|
|
3268
3268
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
3269
|
-
const borderColor =
|
|
3269
|
+
const borderColor = chunkY2KIB3QH_js.parseDrawingColor(
|
|
3270
3270
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
3271
3271
|
schemeColorOverrides
|
|
3272
|
-
) ||
|
|
3272
|
+
) || chunkY2KIB3QH_js.parseDrawingColor(
|
|
3273
3273
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
3274
3274
|
schemeColorOverrides
|
|
3275
|
-
) ||
|
|
3275
|
+
) || chunkY2KIB3QH_js.parseDrawingColor(
|
|
3276
3276
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
3277
3277
|
schemeColorOverrides
|
|
3278
|
-
) ||
|
|
3278
|
+
) || chunkY2KIB3QH_js.parseDrawingColor(
|
|
3279
3279
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
3280
3280
|
schemeColorOverrides
|
|
3281
3281
|
);
|
|
@@ -3347,7 +3347,7 @@ function getTableCellBandStyle2(element, rowIndex, cellIndex, rowCount, columnCo
|
|
|
3347
3347
|
if (element.type !== "table") {
|
|
3348
3348
|
return void 0;
|
|
3349
3349
|
}
|
|
3350
|
-
return
|
|
3350
|
+
return chunkY2KIB3QH_js.getTableCellBandStyle(element.tableData, rowIndex, cellIndex, rowCount, columnCount, {
|
|
3351
3351
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
3352
3352
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
3353
3353
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -3409,7 +3409,7 @@ function parseTableElementData(element, fallbackTextStyle) {
|
|
|
3409
3409
|
};
|
|
3410
3410
|
}
|
|
3411
3411
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
3412
|
-
return
|
|
3412
|
+
return chunkY2KIB3QH_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
3413
3413
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
3414
3414
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
3415
3415
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -3542,7 +3542,7 @@ function TableResizeOverlay({
|
|
|
3542
3542
|
const containerRef = React6.useRef(null);
|
|
3543
3543
|
const [rowBounds, setRowBounds] = React6.useState([]);
|
|
3544
3544
|
const dragRef = React6.useRef(null);
|
|
3545
|
-
const colBoundaries = React6.useMemo(() =>
|
|
3545
|
+
const colBoundaries = React6.useMemo(() => chunkY2KIB3QH_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
3546
3546
|
const measureRows = React6.useCallback(() => {
|
|
3547
3547
|
const container = containerRef.current;
|
|
3548
3548
|
if (!container) {
|
|
@@ -3589,11 +3589,11 @@ function TableResizeOverlay({
|
|
|
3589
3589
|
const rect = containerRef.current.getBoundingClientRect();
|
|
3590
3590
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
3591
3591
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
3592
|
-
onResizeColumns(
|
|
3592
|
+
onResizeColumns(chunkY2KIB3QH_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
3593
3593
|
} else if (drag.type === "row" && onResizeRow) {
|
|
3594
3594
|
const deltaY = e.clientY - drag.startPos;
|
|
3595
|
-
const newHeight =
|
|
3596
|
-
drag.initialRowHeight ??
|
|
3595
|
+
const newHeight = chunkY2KIB3QH_js.computeResizedRowHeight(
|
|
3596
|
+
drag.initialRowHeight ?? chunkY2KIB3QH_js.DEFAULT_ROW_HEIGHT,
|
|
3597
3597
|
deltaY
|
|
3598
3598
|
);
|
|
3599
3599
|
onResizeRow(drag.index, newHeight);
|
|
@@ -3631,7 +3631,7 @@ function TableResizeOverlay({
|
|
|
3631
3631
|
e.stopPropagation();
|
|
3632
3632
|
const table = containerRef.current?.querySelector("table");
|
|
3633
3633
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
3634
|
-
const actualHeight = tr?.offsetHeight ??
|
|
3634
|
+
const actualHeight = tr?.offsetHeight ?? chunkY2KIB3QH_js.DEFAULT_ROW_HEIGHT;
|
|
3635
3635
|
document.body.style.cursor = "row-resize";
|
|
3636
3636
|
document.body.style.userSelect = "none";
|
|
3637
3637
|
dragRef.current = {
|
|
@@ -3679,7 +3679,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3679
3679
|
}
|
|
3680
3680
|
const first = selectedCell.selectedCells[0];
|
|
3681
3681
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
3682
|
-
return
|
|
3682
|
+
return chunkY2KIB3QH_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
3683
3683
|
})();
|
|
3684
3684
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3685
3685
|
TableResizeOverlay,
|
|
@@ -3699,7 +3699,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3699
3699
|
"table",
|
|
3700
3700
|
{
|
|
3701
3701
|
className: "w-full h-full border-collapse table-fixed",
|
|
3702
|
-
style: { fontFamily:
|
|
3702
|
+
style: { fontFamily: chunkY2KIB3QH_js.DEFAULT_FONT_FAMILY },
|
|
3703
3703
|
children: [
|
|
3704
3704
|
tableData.columnWidths.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: tableData.columnWidths.map((w, ci) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3705
3705
|
"col",
|
|
@@ -3717,7 +3717,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3717
3717
|
return null;
|
|
3718
3718
|
}
|
|
3719
3719
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
3720
|
-
const isInMultiSelection =
|
|
3720
|
+
const isInMultiSelection = chunkY2KIB3QH_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
3721
3721
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
3722
3722
|
const diag = getCellDiagonalBorders2(
|
|
3723
3723
|
cell.style,
|
|
@@ -3738,7 +3738,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3738
3738
|
rowSpan: cell.rowSpan && cell.rowSpan > 1 ? cell.rowSpan : void 0,
|
|
3739
3739
|
style: {
|
|
3740
3740
|
...textStyle,
|
|
3741
|
-
...
|
|
3741
|
+
...chunkY2KIB3QH_js.cellStyleToCss(cell.style),
|
|
3742
3742
|
...diag ? { position: "relative" } : void 0
|
|
3743
3743
|
},
|
|
3744
3744
|
onClick: (event) => {
|
|
@@ -3747,7 +3747,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3747
3747
|
}
|
|
3748
3748
|
event.stopPropagation();
|
|
3749
3749
|
if (event.shiftKey && selectedCell) {
|
|
3750
|
-
const rect =
|
|
3750
|
+
const rect = chunkY2KIB3QH_js.computeSelectionRect(
|
|
3751
3751
|
selectedCell.rowIndex,
|
|
3752
3752
|
selectedCell.columnIndex,
|
|
3753
3753
|
rowIndex,
|
|
@@ -3757,7 +3757,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3757
3757
|
options?.onSelectCell?.({
|
|
3758
3758
|
rowIndex: selectedCell.rowIndex,
|
|
3759
3759
|
columnIndex: selectedCell.columnIndex,
|
|
3760
|
-
selectedCells:
|
|
3760
|
+
selectedCells: chunkY2KIB3QH_js.rectToCells(rect)
|
|
3761
3761
|
});
|
|
3762
3762
|
} else {
|
|
3763
3763
|
options?.onSelectCell?.({
|
|
@@ -3785,7 +3785,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3785
3785
|
initialText: cell.text ?? "",
|
|
3786
3786
|
style: {
|
|
3787
3787
|
...textStyle,
|
|
3788
|
-
...
|
|
3788
|
+
...chunkY2KIB3QH_js.cellStyleToCss(cell.style)
|
|
3789
3789
|
},
|
|
3790
3790
|
onCommit: (text) => {
|
|
3791
3791
|
options?.onCommitCellEdit?.(rowIndex, cellIndex, text);
|
|
@@ -3836,7 +3836,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3836
3836
|
}
|
|
3837
3837
|
const first = selectedCell.selectedCells[0];
|
|
3838
3838
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
3839
|
-
return
|
|
3839
|
+
return chunkY2KIB3QH_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
3840
3840
|
})();
|
|
3841
3841
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
3842
3842
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3857,7 +3857,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3857
3857
|
"table",
|
|
3858
3858
|
{
|
|
3859
3859
|
className: "w-full h-full border-collapse table-fixed",
|
|
3860
|
-
style: { fontFamily:
|
|
3860
|
+
style: { fontFamily: chunkY2KIB3QH_js.DEFAULT_FONT_FAMILY },
|
|
3861
3861
|
children: [
|
|
3862
3862
|
parsedTable.columnPercentages.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: parsedTable.columnPercentages.map((percentage, columnIndex) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3863
3863
|
"col",
|
|
@@ -3908,7 +3908,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3908
3908
|
const mergedStyle = {
|
|
3909
3909
|
...bandStyle,
|
|
3910
3910
|
...xmlCellStyle,
|
|
3911
|
-
...tdCellOverride ?
|
|
3911
|
+
...tdCellOverride ? chunkY2KIB3QH_js.cellStyleToCss(tdCellOverride) : void 0,
|
|
3912
3912
|
...diag ? { position: "relative" } : void 0
|
|
3913
3913
|
};
|
|
3914
3914
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3918,7 +3918,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3918
3918
|
"border px-1 py-0.5 align-top",
|
|
3919
3919
|
isEditable && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
3920
3920
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
3921
|
-
|
|
3921
|
+
chunkY2KIB3QH_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
3922
3922
|
),
|
|
3923
3923
|
colSpan,
|
|
3924
3924
|
rowSpan: rSpan,
|
|
@@ -3929,7 +3929,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3929
3929
|
}
|
|
3930
3930
|
event.stopPropagation();
|
|
3931
3931
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
3932
|
-
const rect =
|
|
3932
|
+
const rect = chunkY2KIB3QH_js.computeSelectionRect(
|
|
3933
3933
|
selectedCell.rowIndex,
|
|
3934
3934
|
selectedCell.columnIndex,
|
|
3935
3935
|
rowIndex,
|
|
@@ -3939,7 +3939,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3939
3939
|
options?.onSelectCell?.({
|
|
3940
3940
|
rowIndex: selectedCell.rowIndex,
|
|
3941
3941
|
columnIndex: selectedCell.columnIndex,
|
|
3942
|
-
selectedCells:
|
|
3942
|
+
selectedCells: chunkY2KIB3QH_js.rectToCells(rect)
|
|
3943
3943
|
});
|
|
3944
3944
|
} else {
|
|
3945
3945
|
options?.onSelectCell?.({
|
|
@@ -3996,24 +3996,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3996
3996
|
}
|
|
3997
3997
|
var LEGEND_ITEM_WIDTH = 80;
|
|
3998
3998
|
function partAttrs(part) {
|
|
3999
|
-
return part ?
|
|
3999
|
+
return part ? chunkY2KIB3QH_js.chartPartToAttrs(part) : void 0;
|
|
4000
4000
|
}
|
|
4001
4001
|
function resolveReactPalette(chartData) {
|
|
4002
4002
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
4003
4003
|
return chartData.colorPalette;
|
|
4004
4004
|
}
|
|
4005
|
-
return [...
|
|
4005
|
+
return [...chunkY2KIB3QH_js.getChartStylePalette(chartData.style?.styleId)];
|
|
4006
4006
|
}
|
|
4007
4007
|
function buildReactChartViewModel(element) {
|
|
4008
4008
|
if (element.type !== "chart" || !element.chartData) {
|
|
4009
|
-
return
|
|
4009
|
+
return chunkY2KIB3QH_js.buildChartViewModel(element);
|
|
4010
4010
|
}
|
|
4011
4011
|
const palette = resolveReactPalette(element.chartData);
|
|
4012
4012
|
const themedElement = {
|
|
4013
4013
|
...element,
|
|
4014
4014
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
4015
4015
|
};
|
|
4016
|
-
return
|
|
4016
|
+
return chunkY2KIB3QH_js.buildChartViewModel(themedElement);
|
|
4017
4017
|
}
|
|
4018
4018
|
function renderPrimitive(prim, key) {
|
|
4019
4019
|
switch (prim.kind) {
|
|
@@ -4402,7 +4402,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4402
4402
|
const unmatchedRows = [];
|
|
4403
4403
|
categories.forEach((cat, i) => {
|
|
4404
4404
|
const value = values[i] ?? 0;
|
|
4405
|
-
const code =
|
|
4405
|
+
const code = chunkY2KIB3QH_js.resolveRegionCode(cat);
|
|
4406
4406
|
if (code) {
|
|
4407
4407
|
regionValueMap.set(code, { value, label: cat });
|
|
4408
4408
|
} else {
|
|
@@ -4440,8 +4440,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4440
4440
|
let fill = "#e2e8f0";
|
|
4441
4441
|
let dataLabel = null;
|
|
4442
4442
|
if (entry) {
|
|
4443
|
-
const t =
|
|
4444
|
-
fill =
|
|
4443
|
+
const t = chunkY2KIB3QH_js.normalizeValue(entry.value, minVal, maxVal);
|
|
4444
|
+
fill = chunkY2KIB3QH_js.sequentialColorScale(t);
|
|
4445
4445
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
4446
4446
|
"text",
|
|
4447
4447
|
{
|
|
@@ -4452,7 +4452,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4452
4452
|
fontWeight: 600,
|
|
4453
4453
|
fill: "#1e293b",
|
|
4454
4454
|
style: { pointerEvents: "none" },
|
|
4455
|
-
children:
|
|
4455
|
+
children: chunkY2KIB3QH_js.formatAxisValue(entry.value)
|
|
4456
4456
|
},
|
|
4457
4457
|
`${element.id}-map-dl-${region.code}`
|
|
4458
4458
|
);
|
|
@@ -4470,7 +4470,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4470
4470
|
opacity: 0.9,
|
|
4471
4471
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
4472
4472
|
region.name,
|
|
4473
|
-
entry ? `: ${
|
|
4473
|
+
entry ? `: ${chunkY2KIB3QH_js.formatAxisValue(entry.value)}` : ""
|
|
4474
4474
|
] })
|
|
4475
4475
|
}
|
|
4476
4476
|
),
|
|
@@ -4508,7 +4508,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4508
4508
|
fontSize: 7,
|
|
4509
4509
|
fill: "#64748b",
|
|
4510
4510
|
textAnchor: "middle",
|
|
4511
|
-
children:
|
|
4511
|
+
children: chunkY2KIB3QH_js.formatAxisValue(minVal)
|
|
4512
4512
|
},
|
|
4513
4513
|
`${element.id}-map-legend-min`
|
|
4514
4514
|
),
|
|
@@ -4520,7 +4520,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4520
4520
|
fontSize: 7,
|
|
4521
4521
|
fill: "#64748b",
|
|
4522
4522
|
textAnchor: "middle",
|
|
4523
|
-
children:
|
|
4523
|
+
children: chunkY2KIB3QH_js.formatAxisValue(maxVal)
|
|
4524
4524
|
},
|
|
4525
4525
|
`${element.id}-map-legend-max`
|
|
4526
4526
|
)
|
|
@@ -4586,7 +4586,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4586
4586
|
y,
|
|
4587
4587
|
fontSize,
|
|
4588
4588
|
fill: "#475569",
|
|
4589
|
-
children:
|
|
4589
|
+
children: chunkY2KIB3QH_js.formatAxisValue(row.value)
|
|
4590
4590
|
},
|
|
4591
4591
|
`${element.id}-map-ft-val-${i}`
|
|
4592
4592
|
)
|
|
@@ -4657,7 +4657,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
4657
4657
|
|
|
4658
4658
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
4659
4659
|
function sColor(series, idx) {
|
|
4660
|
-
return
|
|
4660
|
+
return chunkY2KIB3QH_js.seriesColor(series, idx);
|
|
4661
4661
|
}
|
|
4662
4662
|
function valToY(val, range, topY, bottomY) {
|
|
4663
4663
|
const usable = bottomY - topY;
|
|
@@ -5196,7 +5196,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5196
5196
|
width: 10,
|
|
5197
5197
|
height: 10,
|
|
5198
5198
|
rx: 2,
|
|
5199
|
-
fill:
|
|
5199
|
+
fill: chunkY2KIB3QH_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5200
5200
|
},
|
|
5201
5201
|
`${id}-leg-r-${i}`
|
|
5202
5202
|
)
|
|
@@ -5220,7 +5220,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5220
5220
|
width: 10,
|
|
5221
5221
|
height: 10,
|
|
5222
5222
|
rx: 2,
|
|
5223
|
-
fill:
|
|
5223
|
+
fill: chunkY2KIB3QH_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5224
5224
|
}
|
|
5225
5225
|
),
|
|
5226
5226
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -5233,9 +5233,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5233
5233
|
}
|
|
5234
5234
|
const lines = [];
|
|
5235
5235
|
if (range.logScale && range.logBase) {
|
|
5236
|
-
const ticks =
|
|
5236
|
+
const ticks = chunkY2KIB3QH_js.generateLogTicks(range);
|
|
5237
5237
|
ticks.forEach((tickVal, i) => {
|
|
5238
|
-
const y =
|
|
5238
|
+
const y = chunkY2KIB3QH_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5239
5239
|
lines.push(
|
|
5240
5240
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5241
5241
|
"line",
|
|
@@ -5256,7 +5256,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5256
5256
|
const steps = 4;
|
|
5257
5257
|
for (let i = 0; i <= steps; i++) {
|
|
5258
5258
|
const val = range.min + range.span * i / steps;
|
|
5259
|
-
const y =
|
|
5259
|
+
const y = chunkY2KIB3QH_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5260
5260
|
lines.push(
|
|
5261
5261
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5262
5262
|
"line",
|
|
@@ -5280,9 +5280,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5280
5280
|
const labels = [];
|
|
5281
5281
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5282
5282
|
if (range.logScale && range.logBase) {
|
|
5283
|
-
const ticks =
|
|
5283
|
+
const ticks = chunkY2KIB3QH_js.generateLogTicks(range);
|
|
5284
5284
|
ticks.forEach((tickVal, i) => {
|
|
5285
|
-
const y =
|
|
5285
|
+
const y = chunkY2KIB3QH_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5286
5286
|
labels.push(
|
|
5287
5287
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5288
5288
|
"text",
|
|
@@ -5292,7 +5292,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5292
5292
|
textAnchor: "end",
|
|
5293
5293
|
fontSize: 8,
|
|
5294
5294
|
fill: "#64748b",
|
|
5295
|
-
children: hasDisplayUnits ?
|
|
5295
|
+
children: hasDisplayUnits ? chunkY2KIB3QH_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunkY2KIB3QH_js.formatAxisValue(tickVal)
|
|
5296
5296
|
},
|
|
5297
5297
|
`${id}-vaxis-log-${i}`
|
|
5298
5298
|
)
|
|
@@ -5302,7 +5302,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5302
5302
|
const steps = 4;
|
|
5303
5303
|
for (let i = 0; i <= steps; i++) {
|
|
5304
5304
|
const val = range.min + range.span * i / steps;
|
|
5305
|
-
const y =
|
|
5305
|
+
const y = chunkY2KIB3QH_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5306
5306
|
labels.push(
|
|
5307
5307
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5308
5308
|
"text",
|
|
@@ -5312,7 +5312,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5312
5312
|
textAnchor: "end",
|
|
5313
5313
|
fontSize: 8,
|
|
5314
5314
|
fill: "#64748b",
|
|
5315
|
-
children: hasDisplayUnits ?
|
|
5315
|
+
children: hasDisplayUnits ? chunkY2KIB3QH_js.formatAxisValueWithUnits(val, axisFormatting) : chunkY2KIB3QH_js.formatAxisValue(val)
|
|
5316
5316
|
},
|
|
5317
5317
|
`${id}-vaxis-${i}`
|
|
5318
5318
|
)
|
|
@@ -5320,7 +5320,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5320
5320
|
}
|
|
5321
5321
|
}
|
|
5322
5322
|
if (hasDisplayUnits) {
|
|
5323
|
-
const unitLabel =
|
|
5323
|
+
const unitLabel = chunkY2KIB3QH_js.getDisplayUnitLabel(
|
|
5324
5324
|
axisFormatting.displayUnits,
|
|
5325
5325
|
axisFormatting.displayUnitsLabel
|
|
5326
5326
|
);
|
|
@@ -5395,7 +5395,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
5395
5395
|
if (range.min >= 0) {
|
|
5396
5396
|
return null;
|
|
5397
5397
|
}
|
|
5398
|
-
const y =
|
|
5398
|
+
const y = chunkY2KIB3QH_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
5399
5399
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5400
5400
|
"line",
|
|
5401
5401
|
{
|
|
@@ -5419,7 +5419,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5419
5419
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5420
5420
|
for (let i = 0; i <= steps; i++) {
|
|
5421
5421
|
const val = range.min + range.span * i / steps;
|
|
5422
|
-
const y =
|
|
5422
|
+
const y = chunkY2KIB3QH_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5423
5423
|
labels.push(
|
|
5424
5424
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5425
5425
|
"text",
|
|
@@ -5431,7 +5431,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5431
5431
|
fontFamily,
|
|
5432
5432
|
fontWeight,
|
|
5433
5433
|
fill: fontColor,
|
|
5434
|
-
children: hasDisplayUnits ?
|
|
5434
|
+
children: hasDisplayUnits ? chunkY2KIB3QH_js.formatAxisValueWithUnits(val, axisFormatting) : chunkY2KIB3QH_js.formatAxisValue(val)
|
|
5435
5435
|
},
|
|
5436
5436
|
`${id}-sec-vaxis-${i}`
|
|
5437
5437
|
)
|
|
@@ -5455,7 +5455,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5455
5455
|
);
|
|
5456
5456
|
}
|
|
5457
5457
|
if (hasDisplayUnits) {
|
|
5458
|
-
const unitLabel =
|
|
5458
|
+
const unitLabel = chunkY2KIB3QH_js.getDisplayUnitLabel(
|
|
5459
5459
|
axisFormatting.displayUnits,
|
|
5460
5460
|
axisFormatting.displayUnitsLabel
|
|
5461
5461
|
);
|
|
@@ -5486,7 +5486,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
5486
5486
|
const ticks = [];
|
|
5487
5487
|
for (let i = 0; i <= steps; i++) {
|
|
5488
5488
|
const val = range.min + range.span * i / steps;
|
|
5489
|
-
const y =
|
|
5489
|
+
const y = chunkY2KIB3QH_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5490
5490
|
ticks.push(
|
|
5491
5491
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5492
5492
|
"line",
|
|
@@ -5513,7 +5513,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
5513
5513
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
5514
5514
|
for (let i = 0; i <= steps; i++) {
|
|
5515
5515
|
const val = range.min + range.span * i / steps;
|
|
5516
|
-
const y =
|
|
5516
|
+
const y = chunkY2KIB3QH_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5517
5517
|
lines.push(
|
|
5518
5518
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5519
5519
|
"line",
|
|
@@ -5675,7 +5675,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
5675
5675
|
width: 8,
|
|
5676
5676
|
height: 8,
|
|
5677
5677
|
borderRadius: 2,
|
|
5678
|
-
backgroundColor:
|
|
5678
|
+
backgroundColor: chunkY2KIB3QH_js.seriesColor(
|
|
5679
5679
|
s,
|
|
5680
5680
|
si,
|
|
5681
5681
|
chartData.style?.styleId,
|
|
@@ -5713,10 +5713,10 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
5713
5713
|
}
|
|
5714
5714
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
5715
5715
|
const style = chartData.style;
|
|
5716
|
-
const areaFill =
|
|
5716
|
+
const areaFill = chunkY2KIB3QH_js.chartAreaFill(chartData);
|
|
5717
5717
|
const legendPos = style?.legendPosition || "b";
|
|
5718
|
-
const range =
|
|
5719
|
-
const layout =
|
|
5718
|
+
const range = chunkY2KIB3QH_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
5719
|
+
const layout = chunkY2KIB3QH_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
5720
5720
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
5721
5721
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
5722
5722
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -5737,10 +5737,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
5737
5737
|
const close = closeSeries.values[ci] ?? high;
|
|
5738
5738
|
const isUp = close >= open;
|
|
5739
5739
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
5740
|
-
const highY =
|
|
5741
|
-
const lowY =
|
|
5742
|
-
const openY =
|
|
5743
|
-
const closeY =
|
|
5740
|
+
const highY = chunkY2KIB3QH_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
5741
|
+
const lowY = chunkY2KIB3QH_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
5742
|
+
const openY = chunkY2KIB3QH_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
5743
|
+
const closeY = chunkY2KIB3QH_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
|
|
5744
5744
|
elements.push(
|
|
5745
5745
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5746
5746
|
"line",
|
|
@@ -5783,7 +5783,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
5783
5783
|
textAnchor: "middle",
|
|
5784
5784
|
fontSize: 7,
|
|
5785
5785
|
fill: "#334155",
|
|
5786
|
-
children:
|
|
5786
|
+
children: chunkY2KIB3QH_js.formatAxisValue(close)
|
|
5787
5787
|
},
|
|
5788
5788
|
`${element.id}-stock-dl-${ci}`
|
|
5789
5789
|
)
|
|
@@ -5825,7 +5825,7 @@ function FailedToLoad() {
|
|
|
5825
5825
|
var LazySurfaceChart3DScene = React6__default.default.lazy(
|
|
5826
5826
|
async () => {
|
|
5827
5827
|
try {
|
|
5828
|
-
return await import('./SurfaceChart3DScene-
|
|
5828
|
+
return await import('./SurfaceChart3DScene-TNCHWQAK.js');
|
|
5829
5829
|
} catch {
|
|
5830
5830
|
return { default: FailedToLoad };
|
|
5831
5831
|
}
|
|
@@ -5849,7 +5849,7 @@ var SurfaceChart3DErrorBoundary = class extends React6__default.default.Componen
|
|
|
5849
5849
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
5850
5850
|
const rows = chartData.series.length;
|
|
5851
5851
|
const cols = Math.max(categoryLabels.length, 1);
|
|
5852
|
-
const range =
|
|
5852
|
+
const range = chunkY2KIB3QH_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
5853
5853
|
const heightMap = new Float32Array(rows * cols);
|
|
5854
5854
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
5855
5855
|
for (let r = 0; r < rows; r++) {
|
|
@@ -5968,10 +5968,10 @@ function darkenRgb(r, g, b, factor) {
|
|
|
5968
5968
|
}
|
|
5969
5969
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
5970
5970
|
const style = chartData.style;
|
|
5971
|
-
const areaFill =
|
|
5971
|
+
const areaFill = chunkY2KIB3QH_js.chartAreaFill(chartData);
|
|
5972
5972
|
const legendPos = style?.legendPosition || "b";
|
|
5973
|
-
const layout =
|
|
5974
|
-
const range =
|
|
5973
|
+
const layout = chunkY2KIB3QH_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
5974
|
+
const range = chunkY2KIB3QH_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
5975
5975
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
5976
5976
|
const seriesCount = chartData.series.length;
|
|
5977
5977
|
const cols = catCount - 1;
|
|
@@ -6060,10 +6060,10 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6060
6060
|
}
|
|
6061
6061
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
6062
6062
|
const style = chartData.style;
|
|
6063
|
-
const areaFill =
|
|
6063
|
+
const areaFill = chunkY2KIB3QH_js.chartAreaFill(chartData);
|
|
6064
6064
|
const legendPos = style?.legendPosition || "b";
|
|
6065
|
-
const layout =
|
|
6066
|
-
const range =
|
|
6065
|
+
const layout = chunkY2KIB3QH_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6066
|
+
const range = chunkY2KIB3QH_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6067
6067
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6068
6068
|
const seriesCount = chartData.series.length;
|
|
6069
6069
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -6125,9 +6125,9 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6125
6125
|
}
|
|
6126
6126
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
6127
6127
|
const style = chartData.style;
|
|
6128
|
-
const areaFill =
|
|
6128
|
+
const areaFill = chunkY2KIB3QH_js.chartAreaFill(chartData);
|
|
6129
6129
|
const legendPos = style?.legendPosition || "b";
|
|
6130
|
-
const layout =
|
|
6130
|
+
const layout = chunkY2KIB3QH_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6131
6131
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
6132
6132
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
6133
6133
|
const rects = [];
|
|
@@ -6150,7 +6150,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
6150
6150
|
y: curY,
|
|
6151
6151
|
width: Math.max(w - 1, 1),
|
|
6152
6152
|
height: Math.max(h - 1, 1),
|
|
6153
|
-
fill:
|
|
6153
|
+
fill: chunkY2KIB3QH_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
6154
6154
|
rx: 2,
|
|
6155
6155
|
opacity: 0.85
|
|
6156
6156
|
},
|
|
@@ -6201,11 +6201,11 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
6201
6201
|
}
|
|
6202
6202
|
function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
6203
6203
|
const style = chartData.style;
|
|
6204
|
-
const areaFill =
|
|
6204
|
+
const areaFill = chunkY2KIB3QH_js.chartAreaFill(chartData);
|
|
6205
6205
|
const legendPos = style?.legendPosition || "b";
|
|
6206
6206
|
const values = chartData.series[0]?.values ?? [];
|
|
6207
|
-
const range =
|
|
6208
|
-
const layout =
|
|
6207
|
+
const range = chunkY2KIB3QH_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6208
|
+
const layout = chunkY2KIB3QH_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6209
6209
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
6210
6210
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
6211
6211
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -6216,8 +6216,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6216
6216
|
const isLast = i === values.length - 1;
|
|
6217
6217
|
const startVal = isLast ? 0 : runningTotal;
|
|
6218
6218
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
6219
|
-
const barStartY =
|
|
6220
|
-
const barEndY =
|
|
6219
|
+
const barStartY = chunkY2KIB3QH_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
6220
|
+
const barEndY = chunkY2KIB3QH_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
|
|
6221
6221
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
6222
6222
|
const y = Math.min(barStartY, barEndY);
|
|
6223
6223
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -6246,7 +6246,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6246
6246
|
textAnchor: "middle",
|
|
6247
6247
|
fontSize: 7,
|
|
6248
6248
|
fill: "#334155",
|
|
6249
|
-
children:
|
|
6249
|
+
children: chunkY2KIB3QH_js.formatAxisValue(isLast ? endVal : val)
|
|
6250
6250
|
},
|
|
6251
6251
|
`${element.id}-wf-dl-${i}`
|
|
6252
6252
|
)
|
|
@@ -6293,20 +6293,20 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6293
6293
|
}
|
|
6294
6294
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
6295
6295
|
const style = chartData.style;
|
|
6296
|
-
const areaFill =
|
|
6296
|
+
const areaFill = chunkY2KIB3QH_js.chartAreaFill(chartData);
|
|
6297
6297
|
const legendPos = style?.legendPosition || "b";
|
|
6298
|
-
const layoutOpts =
|
|
6298
|
+
const layoutOpts = chunkY2KIB3QH_js.computeLayoutOptions(
|
|
6299
6299
|
chartData.axes,
|
|
6300
6300
|
chartData.dataTable,
|
|
6301
6301
|
chartData.series.length
|
|
6302
6302
|
);
|
|
6303
|
-
const layout =
|
|
6304
|
-
const { primary, secondary } =
|
|
6303
|
+
const layout = chunkY2KIB3QH_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
6304
|
+
const { primary, secondary } = chunkY2KIB3QH_js.splitSeriesByAxis(chartData.series, chartData.axes);
|
|
6305
6305
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
6306
6306
|
const secondarySeries = secondary.map((e) => e.series);
|
|
6307
|
-
const range =
|
|
6308
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
6309
|
-
const secondaryAxisFmt =
|
|
6307
|
+
const range = chunkY2KIB3QH_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
6308
|
+
const secondaryRange = secondarySeries.length > 0 ? chunkY2KIB3QH_js.computeValueRange(secondarySeries) : void 0;
|
|
6309
|
+
const secondaryAxisFmt = chunkY2KIB3QH_js.getSecondaryValueAxis(chartData.axes);
|
|
6310
6310
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6311
6311
|
const barSeriesCount = 1;
|
|
6312
6312
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -6322,8 +6322,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6322
6322
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
6323
6323
|
barSeries.values.forEach((val, vi) => {
|
|
6324
6324
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
6325
|
-
const zeroY =
|
|
6326
|
-
const valY =
|
|
6325
|
+
const zeroY = chunkY2KIB3QH_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
6326
|
+
const valY = chunkY2KIB3QH_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
|
|
6327
6327
|
const y = Math.min(zeroY, valY);
|
|
6328
6328
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
6329
6329
|
barElements.push(
|
|
@@ -6334,7 +6334,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6334
6334
|
y,
|
|
6335
6335
|
width: barWidth,
|
|
6336
6336
|
height: h,
|
|
6337
|
-
fill:
|
|
6337
|
+
fill: chunkY2KIB3QH_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
6338
6338
|
rx: 1
|
|
6339
6339
|
},
|
|
6340
6340
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -6350,7 +6350,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6350
6350
|
textAnchor: "middle",
|
|
6351
6351
|
fontSize: 7,
|
|
6352
6352
|
fill: "#334155",
|
|
6353
|
-
children:
|
|
6353
|
+
children: chunkY2KIB3QH_js.formatAxisValue(val)
|
|
6354
6354
|
},
|
|
6355
6355
|
`${element.id}-combo-bar-dl-${vi}`
|
|
6356
6356
|
)
|
|
@@ -6367,10 +6367,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6367
6367
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
6368
6368
|
const points = series.values.map((val, vi) => {
|
|
6369
6369
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
6370
|
-
const y =
|
|
6370
|
+
const y = chunkY2KIB3QH_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
6371
6371
|
return { x, y, val };
|
|
6372
6372
|
});
|
|
6373
|
-
const c =
|
|
6373
|
+
const c = chunkY2KIB3QH_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
6374
6374
|
lineElements.push(
|
|
6375
6375
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6376
6376
|
"polyline",
|
|
@@ -6397,7 +6397,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6397
6397
|
textAnchor: "middle",
|
|
6398
6398
|
fontSize: 7,
|
|
6399
6399
|
fill: "#334155",
|
|
6400
|
-
children:
|
|
6400
|
+
children: chunkY2KIB3QH_js.formatAxisValue(p.val)
|
|
6401
6401
|
},
|
|
6402
6402
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
6403
6403
|
)
|
|
@@ -6517,14 +6517,14 @@ function buildNotesPdf(pages) {
|
|
|
6517
6517
|
notes: page.notes,
|
|
6518
6518
|
slideNumber: page.slideNumber
|
|
6519
6519
|
}));
|
|
6520
|
-
const bytes =
|
|
6520
|
+
const bytes = chunkY2KIB3QH_js.buildNotesPdfBytes(images, meta);
|
|
6521
6521
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
6522
6522
|
return URL.createObjectURL(blob);
|
|
6523
6523
|
}
|
|
6524
6524
|
|
|
6525
6525
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
6526
6526
|
function buildPdfFromImageData(images) {
|
|
6527
|
-
const bytes =
|
|
6527
|
+
const bytes = chunkY2KIB3QH_js.buildSlidesPdfBytes(images);
|
|
6528
6528
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
6529
6529
|
return URL.createObjectURL(blob);
|
|
6530
6530
|
}
|
|
@@ -6533,7 +6533,7 @@ function buildPdfFromImageData(images) {
|
|
|
6533
6533
|
var activePreview = null;
|
|
6534
6534
|
function startPreviewAnimation(elementId, preset, options) {
|
|
6535
6535
|
stopPreviewAnimation();
|
|
6536
|
-
const descriptor =
|
|
6536
|
+
const descriptor = chunkY2KIB3QH_js.buildPreviewAnimation(preset, options);
|
|
6537
6537
|
if (!descriptor) {
|
|
6538
6538
|
return;
|
|
6539
6539
|
}
|
|
@@ -6546,7 +6546,7 @@ function startMotionPathPreview(elementId, path, options) {
|
|
|
6546
6546
|
return;
|
|
6547
6547
|
}
|
|
6548
6548
|
const stage = domEl.offsetParent;
|
|
6549
|
-
const descriptor =
|
|
6549
|
+
const descriptor = chunkY2KIB3QH_js.buildMotionPathPreview({
|
|
6550
6550
|
path,
|
|
6551
6551
|
slideWidth: stage?.offsetWidth || DEFAULT_PREVIEW_SLIDE_WIDTH,
|
|
6552
6552
|
slideHeight: stage?.offsetHeight || DEFAULT_PREVIEW_SLIDE_HEIGHT,
|