pptx-react-viewer 2.15.2 → 2.15.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/dist/{AiChatPanel-HSQLY6O7.mjs → AiChatPanel-OXAKUVYH.mjs} +3 -3
- package/dist/AiChatPanel-OXAKUVYH.mjs.br +0 -0
- package/dist/AiChatPanel-OXAKUVYH.mjs.gz +0 -0
- package/dist/{AiChatPanel-WGX7DUQE.js → AiChatPanel-R7BYGQX5.js} +22 -22
- package/dist/AiChatPanel-R7BYGQX5.js.br +0 -0
- package/dist/AiChatPanel-R7BYGQX5.js.gz +0 -0
- package/dist/{Model3DScene-DYWYNVLU.js → Model3DScene-BK7RWDCU.js} +2 -2
- package/dist/Model3DScene-BK7RWDCU.js.br +0 -0
- package/dist/Model3DScene-BK7RWDCU.js.gz +0 -0
- package/dist/{Model3DScene-3DOCQYAE.mjs → Model3DScene-TPUVF4FY.mjs} +1 -1
- package/dist/Model3DScene-TPUVF4FY.mjs.br +0 -0
- package/dist/Model3DScene-TPUVF4FY.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-GIKV3DXC.mjs → SurfaceChart3DScene-FXJ45DC5.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-GIKV3DXC.mjs.br → SurfaceChart3DScene-FXJ45DC5.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-FXJ45DC5.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-7UB5JE2W.js → SurfaceChart3DScene-WOLVZOW3.js} +2 -2
- package/dist/SurfaceChart3DScene-WOLVZOW3.js.br +0 -0
- package/dist/SurfaceChart3DScene-WOLVZOW3.js.gz +0 -0
- package/dist/{chunk-U47SG5XL.js → chunk-3XJODTAV.js} +334 -334
- package/dist/chunk-3XJODTAV.js.br +0 -0
- package/dist/chunk-3XJODTAV.js.gz +0 -0
- package/dist/{chunk-LVGFV42Z.mjs → chunk-6M6WP2TK.mjs} +188 -144
- package/dist/chunk-6M6WP2TK.mjs.br +0 -0
- package/dist/chunk-6M6WP2TK.mjs.gz +0 -0
- package/dist/{chunk-MQXKBH43.js → chunk-FHTEL3Q6.js} +247 -247
- package/dist/chunk-FHTEL3Q6.js.br +0 -0
- package/dist/chunk-FHTEL3Q6.js.gz +0 -0
- package/dist/{chunk-RSNAGJTQ.js → chunk-IEXZ2JSO.js} +1084 -1052
- package/dist/chunk-IEXZ2JSO.js.br +0 -0
- package/dist/chunk-IEXZ2JSO.js.gz +0 -0
- package/dist/{chunk-GLC2RPKN.mjs → chunk-OPX74QGH.mjs} +2 -2
- package/dist/chunk-OPX74QGH.mjs.br +0 -0
- package/dist/chunk-OPX74QGH.mjs.gz +0 -0
- package/dist/{chunk-IXEHYABF.mjs → chunk-RPGAI65Z.mjs} +40 -8
- package/dist/chunk-RPGAI65Z.mjs.br +0 -0
- package/dist/chunk-RPGAI65Z.mjs.gz +0 -0
- package/dist/{chunk-DC4GIE7E.js → chunk-T5IS3MGN.js} +3 -3
- package/dist/chunk-T5IS3MGN.js.br +0 -0
- package/dist/chunk-T5IS3MGN.js.gz +0 -0
- package/dist/{chunk-IXCNYPFK.mjs → chunk-U2UPBBJV.mjs} +1 -1
- package/dist/chunk-U2UPBBJV.mjs.br +0 -0
- package/dist/chunk-U2UPBBJV.mjs.gz +0 -0
- package/dist/{chunk-ZAO36XAK.mjs → chunk-WJNWCKS7.mjs} +5 -5
- package/dist/chunk-WJNWCKS7.mjs.br +0 -0
- package/dist/chunk-WJNWCKS7.mjs.gz +0 -0
- package/dist/{chunk-SBRSPTSA.js → chunk-YBTRSG74.js} +190 -144
- package/dist/chunk-YBTRSG74.js.br +0 -0
- package/dist/chunk-YBTRSG74.js.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-HSQLY6O7.mjs.br +0 -0
- package/dist/AiChatPanel-HSQLY6O7.mjs.gz +0 -0
- package/dist/AiChatPanel-WGX7DUQE.js.br +0 -0
- package/dist/AiChatPanel-WGX7DUQE.js.gz +0 -0
- package/dist/Model3DScene-3DOCQYAE.mjs.br +0 -0
- package/dist/Model3DScene-3DOCQYAE.mjs.gz +0 -0
- package/dist/Model3DScene-DYWYNVLU.js.br +0 -0
- package/dist/Model3DScene-DYWYNVLU.js.gz +0 -0
- package/dist/SurfaceChart3DScene-7UB5JE2W.js.br +0 -0
- package/dist/SurfaceChart3DScene-7UB5JE2W.js.gz +0 -0
- package/dist/SurfaceChart3DScene-GIKV3DXC.mjs.gz +0 -0
- package/dist/chunk-DC4GIE7E.js.br +0 -0
- package/dist/chunk-DC4GIE7E.js.gz +0 -0
- package/dist/chunk-GLC2RPKN.mjs.br +0 -0
- package/dist/chunk-GLC2RPKN.mjs.gz +0 -0
- package/dist/chunk-IXCNYPFK.mjs.br +0 -0
- package/dist/chunk-IXCNYPFK.mjs.gz +0 -0
- package/dist/chunk-IXEHYABF.mjs.br +0 -0
- package/dist/chunk-IXEHYABF.mjs.gz +0 -0
- package/dist/chunk-LVGFV42Z.mjs.br +0 -0
- package/dist/chunk-LVGFV42Z.mjs.gz +0 -0
- package/dist/chunk-MQXKBH43.js.br +0 -0
- package/dist/chunk-MQXKBH43.js.gz +0 -0
- package/dist/chunk-RSNAGJTQ.js.br +0 -0
- package/dist/chunk-RSNAGJTQ.js.gz +0 -0
- package/dist/chunk-SBRSPTSA.js.br +0 -0
- package/dist/chunk-SBRSPTSA.js.gz +0 -0
- package/dist/chunk-U47SG5XL.js.br +0 -0
- package/dist/chunk-U47SG5XL.js.gz +0 -0
- package/dist/chunk-ZAO36XAK.mjs.br +0 -0
- package/dist/chunk-ZAO36XAK.mjs.gz +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunk3ISYPBSX_js = require('./chunk-3ISYPBSX.js');
|
|
4
|
-
var
|
|
4
|
+
var chunkYBTRSG74_js = require('./chunk-YBTRSG74.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 chunkYBTRSG74_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 chunkYBTRSG74_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 = chunkYBTRSG74_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 = chunkYBTRSG74_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 (!chunkYBTRSG74_js.hasShapeProperties(element)) {
|
|
270
270
|
return false;
|
|
271
271
|
}
|
|
272
272
|
const st = getShapeType(element.shapeType);
|
|
@@ -277,12 +277,12 @@ function isConnectorOrLineElement(element) {
|
|
|
277
277
|
function partitionTemplateElements(slides) {
|
|
278
278
|
const templateElementsBySlideId = {};
|
|
279
279
|
const nextSlides = slides.map((slide) => {
|
|
280
|
-
const template = slide.elements.filter((el) =>
|
|
280
|
+
const template = slide.elements.filter((el) => chunkYBTRSG74_js.isTemplateElement(el));
|
|
281
281
|
if (template.length === 0) {
|
|
282
282
|
return slide;
|
|
283
283
|
}
|
|
284
284
|
templateElementsBySlideId[slide.id] = template;
|
|
285
|
-
return { ...slide, elements: slide.elements.filter((el) => !
|
|
285
|
+
return { ...slide, elements: slide.elements.filter((el) => !chunkYBTRSG74_js.isTemplateElement(el)) };
|
|
286
286
|
});
|
|
287
287
|
return { slides: nextSlides, templateElementsBySlideId };
|
|
288
288
|
}
|
|
@@ -298,7 +298,7 @@ function buildSaveSlides(slides, templateElementsBySlideId) {
|
|
|
298
298
|
|
|
299
299
|
// src/viewer/utils/image-style.ts
|
|
300
300
|
function getImageMaskStyle(element) {
|
|
301
|
-
if (!
|
|
301
|
+
if (!chunkYBTRSG74_js.hasShapeProperties(element)) {
|
|
302
302
|
return void 0;
|
|
303
303
|
}
|
|
304
304
|
const shapeType = element.shapeType;
|
|
@@ -307,7 +307,7 @@ function getImageMaskStyle(element) {
|
|
|
307
307
|
}
|
|
308
308
|
const normalized = shapeType.toLowerCase();
|
|
309
309
|
if (normalized === "roundrect" || normalized === "round1rect" || normalized === "round2samerect" || normalized === "round2diagrect" || normalized === "sniproundrect" || normalized === "snip1rect" || normalized === "snip2diagrect") {
|
|
310
|
-
const radiusPx =
|
|
310
|
+
const radiusPx = chunkYBTRSG74_js.getRoundRectRadiusPx2(element);
|
|
311
311
|
if (radiusPx <= 0.01) {
|
|
312
312
|
return void 0;
|
|
313
313
|
}
|
|
@@ -319,7 +319,7 @@ function getImageMaskStyle(element) {
|
|
|
319
319
|
if (normalized === "can" || normalized === "cylinder") {
|
|
320
320
|
return { borderRadius: "48% / 12%" };
|
|
321
321
|
}
|
|
322
|
-
const clipPath =
|
|
322
|
+
const clipPath = chunkYBTRSG74_js.getResolvedShapeClipPath(element);
|
|
323
323
|
if (!clipPath) {
|
|
324
324
|
return void 0;
|
|
325
325
|
}
|
|
@@ -328,7 +328,7 @@ function getImageMaskStyle(element) {
|
|
|
328
328
|
function getImageRenderStyle(element) {
|
|
329
329
|
return {
|
|
330
330
|
...getImageMaskStyle(element) || {},
|
|
331
|
-
...
|
|
331
|
+
...chunkYBTRSG74_js.getImageFitStyle(element)
|
|
332
332
|
};
|
|
333
333
|
}
|
|
334
334
|
var CROP_SHAPE_CLIP_PATHS = {
|
|
@@ -341,7 +341,7 @@ var CROP_SHAPE_CLIP_PATHS = {
|
|
|
341
341
|
star: "polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)"
|
|
342
342
|
};
|
|
343
343
|
function getCropShapeClipPath(element) {
|
|
344
|
-
if (!
|
|
344
|
+
if (!chunkYBTRSG74_js.isImageLikeElement(element)) {
|
|
345
345
|
return void 0;
|
|
346
346
|
}
|
|
347
347
|
const shape = element.cropShape;
|
|
@@ -351,7 +351,7 @@ function getCropShapeClipPath(element) {
|
|
|
351
351
|
return CROP_SHAPE_CLIP_PATHS[shape];
|
|
352
352
|
}
|
|
353
353
|
function isImageTiled(element) {
|
|
354
|
-
if (!
|
|
354
|
+
if (!chunkYBTRSG74_js.isImageLikeElement(element)) {
|
|
355
355
|
return false;
|
|
356
356
|
}
|
|
357
357
|
return typeof element.tileScaleX === "number" || typeof element.tileScaleY === "number";
|
|
@@ -409,7 +409,7 @@ function buildMirrorTiledBackground(src, flip, scaleX, scaleY) {
|
|
|
409
409
|
};
|
|
410
410
|
}
|
|
411
411
|
function getImageTilingStyle(element) {
|
|
412
|
-
if (!
|
|
412
|
+
if (!chunkYBTRSG74_js.isImageLikeElement(element) || !isImageTiled(element)) {
|
|
413
413
|
return void 0;
|
|
414
414
|
}
|
|
415
415
|
const scaleX = typeof element.tileScaleX === "number" ? element.tileScaleX * 100 : 100;
|
|
@@ -659,9 +659,9 @@ function registerMediaElement(elementId, el) {
|
|
|
659
659
|
};
|
|
660
660
|
}
|
|
661
661
|
function executeMediaCommand(command, frameRoot) {
|
|
662
|
-
return
|
|
662
|
+
return chunkYBTRSG74_js.runMediaCommand(
|
|
663
663
|
command,
|
|
664
|
-
(targetId) => registry.get(targetId) ??
|
|
664
|
+
(targetId) => registry.get(targetId) ?? chunkYBTRSG74_js.findMediaElementByElementId(targetId, frameRoot?.())
|
|
665
665
|
);
|
|
666
666
|
}
|
|
667
667
|
function PresentationMediaController({
|
|
@@ -705,7 +705,7 @@ function PresentationMediaController({
|
|
|
705
705
|
loop: shouldLoop,
|
|
706
706
|
volume: playbackVolume,
|
|
707
707
|
playbackRate
|
|
708
|
-
} =
|
|
708
|
+
} = chunkYBTRSG74_js.mediaPlaybackAttributes({
|
|
709
709
|
loop: element.loop,
|
|
710
710
|
volume: element.volume,
|
|
711
711
|
playbackSpeed: element.playbackSpeed
|
|
@@ -841,7 +841,7 @@ function PresentationMediaController({
|
|
|
841
841
|
if (element.playAcrossSlides && element.mediaType === "audio") {
|
|
842
842
|
const dataUrl = element.mediaData ?? resolvedDataUrl;
|
|
843
843
|
if (dataUrl) {
|
|
844
|
-
|
|
844
|
+
chunkYBTRSG74_js.registerPersistentAudio(
|
|
845
845
|
element.id,
|
|
846
846
|
dataUrl,
|
|
847
847
|
element.mediaMimeType,
|
|
@@ -912,7 +912,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
912
912
|
const dataUrl = element.mediaData ?? (mediaPath ? mediaDataUrls.get(mediaPath) : void 0);
|
|
913
913
|
const trimFragment = buildTrimFragment(element);
|
|
914
914
|
const posterUrl = element.posterFrameData ?? void 0;
|
|
915
|
-
const shouldLoop =
|
|
915
|
+
const shouldLoop = chunkYBTRSG74_js.mediaPlaybackAttributes(element).loop;
|
|
916
916
|
const shouldAutoPlay = options?.autoPlay === true || element.autoPlay === true;
|
|
917
917
|
const isFullScreen = options?.fullScreen === true;
|
|
918
918
|
const isPresentationMode = options?.isPresentationMode === true;
|
|
@@ -1078,7 +1078,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1078
1078
|
|
|
1079
1079
|
// src/viewer/utils/text-utils.tsx
|
|
1080
1080
|
function getTextStyleForElement(element, fallbackColor) {
|
|
1081
|
-
return
|
|
1081
|
+
return chunkYBTRSG74_js.buildTextBlockStyle(element, { fallbackColor });
|
|
1082
1082
|
}
|
|
1083
1083
|
|
|
1084
1084
|
// src/viewer/utils/text-layout.tsx
|
|
@@ -1103,13 +1103,13 @@ function computeTabSize(tabStops, defaultTabSize) {
|
|
|
1103
1103
|
return avgGap > 0 ? `${Math.round(avgGap)}px` : fromDefault;
|
|
1104
1104
|
}
|
|
1105
1105
|
function getTextLayoutStyle(element) {
|
|
1106
|
-
if (!
|
|
1106
|
+
if (!chunkYBTRSG74_js.hasTextProperties(element)) {
|
|
1107
1107
|
return {};
|
|
1108
1108
|
}
|
|
1109
1109
|
const verticalAlign = element.textStyle?.vAlign || "top";
|
|
1110
|
-
const writingMode =
|
|
1111
|
-
const textOrientation =
|
|
1112
|
-
const verticalDirection =
|
|
1110
|
+
const writingMode = chunkYBTRSG74_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
1111
|
+
const textOrientation = chunkYBTRSG74_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
1112
|
+
const verticalDirection = chunkYBTRSG74_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
1113
1113
|
const parsedColumnCount = Number(element.textStyle?.columnCount);
|
|
1114
1114
|
const columnCount = Number.isFinite(parsedColumnCount) ? Math.max(1, Math.min(16, Math.round(parsedColumnCount))) : 1;
|
|
1115
1115
|
const hasColumns = columnCount > 1;
|
|
@@ -1117,7 +1117,7 @@ function getTextLayoutStyle(element) {
|
|
|
1117
1117
|
const tabStops = element.textStyle?.tabStops;
|
|
1118
1118
|
const tabSize = computeTabSize(tabStops, element.textStyle?.defaultTabSize);
|
|
1119
1119
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
1120
|
-
const hasParagraphIndents =
|
|
1120
|
+
const hasParagraphIndents = chunkYBTRSG74_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
1121
1121
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
1122
1122
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
1123
1123
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
@@ -1126,7 +1126,7 @@ function getTextLayoutStyle(element) {
|
|
|
1126
1126
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
1127
1127
|
const parsedColumnSpacing = Number(element.textStyle?.columnSpacing);
|
|
1128
1128
|
const columnGap = Number.isFinite(parsedColumnSpacing) && parsedColumnSpacing > 0 ? `${parsedColumnSpacing}px` : "0.75em";
|
|
1129
|
-
const kinsokuStyles =
|
|
1129
|
+
const kinsokuStyles = chunkYBTRSG74_js.getKinsokuLineBreakStyles(element.textStyle);
|
|
1130
1130
|
if (hasColumns) {
|
|
1131
1131
|
return {
|
|
1132
1132
|
display: "block",
|
|
@@ -1173,10 +1173,10 @@ function getTextLayoutStyle(element) {
|
|
|
1173
1173
|
|
|
1174
1174
|
// src/viewer/utils/text-effects.tsx
|
|
1175
1175
|
function buildTextFillCss2(style) {
|
|
1176
|
-
return
|
|
1176
|
+
return chunkYBTRSG74_js.buildTextFillCss(style);
|
|
1177
1177
|
}
|
|
1178
1178
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
1179
|
-
return
|
|
1179
|
+
return chunkYBTRSG74_js.buildTextBody3DSceneStyle(textStyle);
|
|
1180
1180
|
}
|
|
1181
1181
|
|
|
1182
1182
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -1361,13 +1361,13 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1361
1361
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
1362
1362
|
return renderedSegments;
|
|
1363
1363
|
}
|
|
1364
|
-
const paraKey = `${elementId}${
|
|
1364
|
+
const paraKey = `${elementId}${chunkYBTRSG74_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
1365
1365
|
const paraState = subElementAnimStates.get(paraKey);
|
|
1366
1366
|
if (paraState) {
|
|
1367
1367
|
const style = buildAnimStyle(paraState);
|
|
1368
1368
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
1369
1369
|
}
|
|
1370
|
-
const spec =
|
|
1370
|
+
const spec = chunkYBTRSG74_js.buildTextBuildSpec(
|
|
1371
1371
|
elementId,
|
|
1372
1372
|
paraIndex,
|
|
1373
1373
|
paraSegments.map((entry) => ({ text: entry.segment.text, style: entry })),
|
|
@@ -1385,7 +1385,7 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1385
1385
|
"span",
|
|
1386
1386
|
{
|
|
1387
1387
|
"data-anim-id": span.animId,
|
|
1388
|
-
style:
|
|
1388
|
+
style: chunkYBTRSG74_js.textBuildSpanStyle(span),
|
|
1389
1389
|
children: content
|
|
1390
1390
|
},
|
|
1391
1391
|
span.animId
|
|
@@ -1529,10 +1529,10 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1529
1529
|
if (!needsScriptFonts || !text) {
|
|
1530
1530
|
return text;
|
|
1531
1531
|
}
|
|
1532
|
-
const runs =
|
|
1532
|
+
const runs = chunkYBTRSG74_js.segmentByScript(text);
|
|
1533
1533
|
if (runs.length <= 1) {
|
|
1534
1534
|
if (runs.length === 1) {
|
|
1535
|
-
const font =
|
|
1535
|
+
const font = chunkYBTRSG74_js.resolveFontForScript(runs[0].script, scriptFonts);
|
|
1536
1536
|
if (font && font !== baseFontFamily) {
|
|
1537
1537
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: text });
|
|
1538
1538
|
}
|
|
@@ -1540,7 +1540,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1540
1540
|
return text;
|
|
1541
1541
|
}
|
|
1542
1542
|
return runs.map((run, i) => {
|
|
1543
|
-
const font =
|
|
1543
|
+
const font = chunkYBTRSG74_js.resolveFontForScript(run.script, scriptFonts);
|
|
1544
1544
|
if (!font || font === baseFontFamily) {
|
|
1545
1545
|
return /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Fragment, { children: run.text }, `${keyPrefix}-r${i}`);
|
|
1546
1546
|
}
|
|
@@ -1612,8 +1612,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1612
1612
|
);
|
|
1613
1613
|
}
|
|
1614
1614
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
1615
|
-
const mathml =
|
|
1616
|
-
const safeMathml = mathml ?
|
|
1615
|
+
const mathml = chunkYBTRSG74_js.convertOmmlToMathMl(equationXml);
|
|
1616
|
+
const safeMathml = mathml ? chunkYBTRSG74_js.sanitizeMathMl(mathml) : "";
|
|
1617
1617
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1618
1618
|
"span",
|
|
1619
1619
|
{
|
|
@@ -1663,7 +1663,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1663
1663
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: equationContent }, `${elementId}-seg-${segmentIndex}`);
|
|
1664
1664
|
}
|
|
1665
1665
|
function renderPictureBullet(elementId, segmentIndex, bulletInfo, baseFontSize) {
|
|
1666
|
-
const picture =
|
|
1666
|
+
const picture = chunkYBTRSG74_js.resolvePictureBullet(bulletInfo, baseFontSize) ?? {
|
|
1667
1667
|
sizePx: baseFontSize,
|
|
1668
1668
|
fallbackMarker: "\u2022",
|
|
1669
1669
|
accessibleLabel: "Bullet"
|
|
@@ -1714,7 +1714,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1714
1714
|
}
|
|
1715
1715
|
const segmentStyle = segment.style || {};
|
|
1716
1716
|
const rawText = bulletInfo && typeof bulletHangPx === "number" ? (segment.text || "").trimEnd() : segment.text || "";
|
|
1717
|
-
const textValue =
|
|
1717
|
+
const textValue = chunkYBTRSG74_js.substituteFieldText(rawText, segment.fieldType, fieldContext);
|
|
1718
1718
|
const lines = textValue.split("\n");
|
|
1719
1719
|
const textDecorationTokens = [];
|
|
1720
1720
|
if (segmentStyle.underline || segmentStyle.hyperlink) {
|
|
@@ -1724,28 +1724,28 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1724
1724
|
textDecorationTokens.push("line-through");
|
|
1725
1725
|
}
|
|
1726
1726
|
const isDoubleStrike = segmentStyle.strikethrough && segmentStyle.strikeType === "dblStrike";
|
|
1727
|
-
const resolvedSegmentColor = segmentStyle.hyperlink ?
|
|
1728
|
-
const underlineDecoration =
|
|
1727
|
+
const resolvedSegmentColor = segmentStyle.hyperlink ? chunkYBTRSG74_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, HYPERLINK_COLOR) : chunkYBTRSG74_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, fallbackColor);
|
|
1728
|
+
const underlineDecoration = chunkYBTRSG74_js.resolveUnderlineDecorationStyle(
|
|
1729
1729
|
Boolean(isDoubleStrike),
|
|
1730
1730
|
segmentStyle.underlineStyle
|
|
1731
1731
|
);
|
|
1732
1732
|
const rawBaseline = typeof segmentStyle.baseline === "number" ? segmentStyle.baseline : 0;
|
|
1733
1733
|
const baselineFraction = rawBaseline === 0 ? 0 : Math.abs(rawBaseline) >= 1e3 ? rawBaseline / 1e5 : rawBaseline / 100;
|
|
1734
1734
|
const baselineFontScale = baselineFraction !== 0 ? 0.65 : 1;
|
|
1735
|
-
const letterSpacing = typeof segmentStyle.characterSpacing === "number" && segmentStyle.characterSpacing !== 0 ? `calc(${segmentStyle.characterSpacing / 100 * (96 / 72)}px + ${
|
|
1735
|
+
const letterSpacing = typeof segmentStyle.characterSpacing === "number" && segmentStyle.characterSpacing !== 0 ? `calc(${segmentStyle.characterSpacing / 100 * (96 / 72)}px + ${chunkYBTRSG74_js.POWERPOINT_METRIC_TRACKING})` : chunkYBTRSG74_js.POWERPOINT_METRIC_TRACKING;
|
|
1736
1736
|
const textFillStyles = buildTextFillCss2(segmentStyle);
|
|
1737
1737
|
const rawFontSize = segmentStyle.fontSize || element.textStyle?.fontSize || DEFAULT_TEXT_FONT_SIZE;
|
|
1738
|
-
const autoFitScale =
|
|
1738
|
+
const autoFitScale = chunkYBTRSG74_js.resolveAutoFitFontScale(element.textStyle);
|
|
1739
1739
|
const baseFontSize = rawFontSize * autoFitScale;
|
|
1740
1740
|
const baselineShift = baselineFraction !== 0 ? `${baselineFraction * baseFontSize}px` : void 0;
|
|
1741
1741
|
const baseFontSizePt = baseFontSize * (72 / 96);
|
|
1742
1742
|
const fontKerning = typeof segmentStyle.kerning === "number" ? segmentStyle.kerning === 0 ? "none" : baseFontSizePt >= segmentStyle.kerning / 100 ? "normal" : "none" : void 0;
|
|
1743
1743
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
1744
|
-
const baseFontFamily = rawFontFamily ?
|
|
1744
|
+
const baseFontFamily = rawFontFamily ? chunkYBTRSG74_js.getSubstituteFontFamily(
|
|
1745
1745
|
rawFontFamily,
|
|
1746
|
-
|
|
1746
|
+
chunkYBTRSG74_js.parsePanoseString(segmentStyle.latinFontPanose ?? element.textStyle?.latinFontPanose)
|
|
1747
1747
|
) : DEFAULT_FONT_FAMILY2;
|
|
1748
|
-
const scriptFont = (name, panose) => name ?
|
|
1748
|
+
const scriptFont = (name, panose) => name ? chunkYBTRSG74_js.getSubstituteFontFamily(name, chunkYBTRSG74_js.parsePanoseString(panose)) : baseFontFamily;
|
|
1749
1749
|
const scriptFonts = {
|
|
1750
1750
|
latin: baseFontFamily,
|
|
1751
1751
|
eastAsia: scriptFont(
|
|
@@ -1761,7 +1761,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1761
1761
|
segmentStyle.symbolFontPanose ?? element.textStyle?.symbolFontPanose
|
|
1762
1762
|
)
|
|
1763
1763
|
};
|
|
1764
|
-
const needsScriptFonts =
|
|
1764
|
+
const needsScriptFonts = chunkYBTRSG74_js.hasDistinctScriptFonts(scriptFonts);
|
|
1765
1765
|
const spanStyle = {
|
|
1766
1766
|
color: resolvedSegmentColor,
|
|
1767
1767
|
fontSize: baseFontSize * baselineFontScale,
|
|
@@ -1779,15 +1779,15 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1779
1779
|
fontVariantCaps: segmentStyle.textCaps === "small" ? "small-caps" : void 0,
|
|
1780
1780
|
letterSpacing,
|
|
1781
1781
|
fontKerning,
|
|
1782
|
-
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ?
|
|
1782
|
+
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ? chunkYBTRSG74_js.normalizeHexColor(segmentStyle.highlightColor, "transparent") : void 0,
|
|
1783
1783
|
...textFillStyles,
|
|
1784
|
-
textDecorationColor: segmentStyle.underlineColor ?
|
|
1785
|
-
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${
|
|
1784
|
+
textDecorationColor: segmentStyle.underlineColor ? chunkYBTRSG74_js.normalizeHexColor(segmentStyle.underlineColor, void 0) : void 0,
|
|
1785
|
+
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${chunkYBTRSG74_js.normalizeHexColor(segmentStyle.textOutlineColor, "#000000")}` : segmentStyle.textOutlineWidth ? `${segmentStyle.textOutlineWidth}px currentColor` : void 0,
|
|
1786
1786
|
paintOrder: segmentStyle.textOutlineWidth ? "stroke fill" : void 0,
|
|
1787
|
-
textShadow:
|
|
1788
|
-
filter:
|
|
1789
|
-
opacity:
|
|
1790
|
-
WebkitBoxReflect:
|
|
1787
|
+
textShadow: chunkYBTRSG74_js.buildTextShadowCss(segmentStyle),
|
|
1788
|
+
filter: chunkYBTRSG74_js.buildTextRunFilterChain(segmentStyle),
|
|
1789
|
+
opacity: chunkYBTRSG74_js.getTextAlphaOpacity(segmentStyle),
|
|
1790
|
+
WebkitBoxReflect: chunkYBTRSG74_js.buildTextReflectionCss(segmentStyle)
|
|
1791
1791
|
};
|
|
1792
1792
|
const runRtl = segmentStyle.rtl;
|
|
1793
1793
|
if (runRtl !== void 0 && runRtl !== paragraphRtl) {
|
|
@@ -1807,7 +1807,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1807
1807
|
spanStyle.fontSize = baseFontSize * (bulletInfo.sizePercent / 100) * baselineFontScale;
|
|
1808
1808
|
}
|
|
1809
1809
|
if (bulletInfo.color) {
|
|
1810
|
-
spanStyle.color =
|
|
1810
|
+
spanStyle.color = chunkYBTRSG74_js.normalizeHexColor(bulletInfo.color, resolvedSegmentColor);
|
|
1811
1811
|
}
|
|
1812
1812
|
if (typeof bulletHangPx === "number" && bulletHangPx > 0) {
|
|
1813
1813
|
spanStyle.display = "inline-block";
|
|
@@ -1852,7 +1852,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1852
1852
|
textAlign: segment.rubyAlignment === "l" ? "left" : segment.rubyAlignment === "r" ? "right" : segment.rubyAlignment === "dist" || segment.rubyAlignment === "distCat" || segment.rubyAlignment === "distLetter" ? "justify" : "center"
|
|
1853
1853
|
};
|
|
1854
1854
|
if (segment.rubyStyle?.color) {
|
|
1855
|
-
rubyStyle.color =
|
|
1855
|
+
rubyStyle.color = chunkYBTRSG74_js.normalizeHexColor(segment.rubyStyle.color, resolvedSegmentColor);
|
|
1856
1856
|
}
|
|
1857
1857
|
innerContent = /* @__PURE__ */ jsxRuntime.jsxs("ruby", { children: [
|
|
1858
1858
|
baseContent,
|
|
@@ -1925,7 +1925,7 @@ function resolveParagraphSpacing(input) {
|
|
|
1925
1925
|
if (typeof exactPt === "number" && exactPt > 0) {
|
|
1926
1926
|
result.lineHeight = `${exactPt * PT_TO_PX}px`;
|
|
1927
1927
|
} else if (typeof multiplier === "number" && multiplier > 0) {
|
|
1928
|
-
result.lineHeight =
|
|
1928
|
+
result.lineHeight = chunkYBTRSG74_js.proportionalLineHeight(multiplier);
|
|
1929
1929
|
}
|
|
1930
1930
|
return result;
|
|
1931
1931
|
}
|
|
@@ -1947,7 +1947,7 @@ function groupSegmentsIntoParagraphs(segments) {
|
|
|
1947
1947
|
return paragraphs;
|
|
1948
1948
|
}
|
|
1949
1949
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick) {
|
|
1950
|
-
if (!
|
|
1950
|
+
if (!chunkYBTRSG74_js.hasTextProperties(element)) {
|
|
1951
1951
|
return emptyFallback || null;
|
|
1952
1952
|
}
|
|
1953
1953
|
const effectiveSegments = segmentOverrides ?? element.textSegments;
|
|
@@ -1968,10 +1968,10 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
1968
1968
|
return element.text || emptyFallback || "";
|
|
1969
1969
|
}
|
|
1970
1970
|
const paragraphs = groupSegmentsIntoParagraphs(effectiveSegments);
|
|
1971
|
-
const paragraphIndents =
|
|
1972
|
-
const elementRtl =
|
|
1973
|
-
const elementAlign =
|
|
1974
|
-
const bodyStyle =
|
|
1971
|
+
const paragraphIndents = chunkYBTRSG74_js.hasTextProperties(element) ? element.paragraphIndents : void 0;
|
|
1972
|
+
const elementRtl = chunkYBTRSG74_js.hasTextProperties(element) ? element.textStyle?.rtl : void 0;
|
|
1973
|
+
const elementAlign = chunkYBTRSG74_js.hasTextProperties(element) ? element.textStyle?.align : void 0;
|
|
1974
|
+
const bodyStyle = chunkYBTRSG74_js.hasTextProperties(element) ? element.textStyle : void 0;
|
|
1975
1975
|
const spaceFirstLast = bodyStyle?.spaceFirstLastParagraph !== false;
|
|
1976
1976
|
return paragraphs.map(({ entries: paraSegments, terminator }, paraIndex) => {
|
|
1977
1977
|
const paraIndent = paragraphIndents?.[paraIndex];
|
|
@@ -1986,14 +1986,14 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
1986
1986
|
return Boolean(segment.text) && segment.text.trim().length > 0;
|
|
1987
1987
|
});
|
|
1988
1988
|
const hasBullet = bulletInfo && !bulletInfo.none && hasVisibleTextContent;
|
|
1989
|
-
const paraRtl =
|
|
1989
|
+
const paraRtl = chunkYBTRSG74_js.resolveParagraphRtl(paraSegments, elementRtl);
|
|
1990
1990
|
const isRtlParagraph = paraRtl === true;
|
|
1991
|
-
const paraAlign =
|
|
1992
|
-
const cssTextAlign =
|
|
1991
|
+
const paraAlign = chunkYBTRSG74_js.resolveParagraphAlign(paraSegments, elementAlign);
|
|
1992
|
+
const cssTextAlign = chunkYBTRSG74_js.resolveCssTextAlign(paraAlign, isRtlParagraph);
|
|
1993
1993
|
const paraMarginLeft = isRtlParagraph ? void 0 : rawMarginLeft;
|
|
1994
1994
|
const paraMarginRight = isRtlParagraph ? rawMarginLeft : void 0;
|
|
1995
1995
|
const paraTextIndent = rawTextIndent;
|
|
1996
|
-
const paraKinsokuStyle =
|
|
1996
|
+
const paraKinsokuStyle = chunkYBTRSG74_js.getKinsokuLineBreakStyles(firstSeg?.segment.style);
|
|
1997
1997
|
const hasParaKinsoku = Object.keys(paraKinsokuStyle).length > 0;
|
|
1998
1998
|
const paraProps = effectiveSegments[firstSeg?.globalIndex ?? -1]?.paragraphProperties ?? (paraSegments.length === 0 ? terminator?.paragraphProperties : void 0);
|
|
1999
1999
|
const spacing = resolveParagraphSpacing({
|
|
@@ -2003,7 +2003,7 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2003
2003
|
isLast: paraIndex === paragraphs.length - 1,
|
|
2004
2004
|
spaceFirstLast
|
|
2005
2005
|
});
|
|
2006
|
-
const strutFontSize =
|
|
2006
|
+
const strutFontSize = chunkYBTRSG74_js.resolveParagraphStrutFontSize(
|
|
2007
2007
|
paraSegments.length > 0 ? paraSegments.map(({ segment }) => segment) : terminator ? [terminator] : [],
|
|
2008
2008
|
bodyStyle?.fontSize
|
|
2009
2009
|
);
|
|
@@ -2107,13 +2107,13 @@ function hexToRgbUnit(hex) {
|
|
|
2107
2107
|
};
|
|
2108
2108
|
}
|
|
2109
2109
|
function getDuotoneColors(element) {
|
|
2110
|
-
if (!
|
|
2110
|
+
if (!chunkYBTRSG74_js.isImageLikeElement(element)) {
|
|
2111
2111
|
return void 0;
|
|
2112
2112
|
}
|
|
2113
2113
|
return element.imageEffects?.duotone;
|
|
2114
2114
|
}
|
|
2115
2115
|
function buildLineShadowCss(element) {
|
|
2116
|
-
if (!
|
|
2116
|
+
if (!chunkYBTRSG74_js.hasShapeProperties(element)) {
|
|
2117
2117
|
return void 0;
|
|
2118
2118
|
}
|
|
2119
2119
|
const ss = element.shapeStyle;
|
|
@@ -2124,13 +2124,13 @@ function buildLineShadowCss(element) {
|
|
|
2124
2124
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
2125
2125
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
2126
2126
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
2127
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
2128
|
-
|
|
2127
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkYBTRSG74_js.colorWithOpacity(
|
|
2128
|
+
chunkYBTRSG74_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
2129
2129
|
opacity
|
|
2130
2130
|
)}`;
|
|
2131
2131
|
}
|
|
2132
2132
|
function buildLineGlowFilter(element) {
|
|
2133
|
-
if (!
|
|
2133
|
+
if (!chunkYBTRSG74_js.hasShapeProperties(element)) {
|
|
2134
2134
|
return void 0;
|
|
2135
2135
|
}
|
|
2136
2136
|
const ss = element.shapeStyle;
|
|
@@ -2139,7 +2139,7 @@ function buildLineGlowFilter(element) {
|
|
|
2139
2139
|
}
|
|
2140
2140
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
2141
2141
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
2142
|
-
const glowCol =
|
|
2142
|
+
const glowCol = chunkYBTRSG74_js.colorWithOpacity(chunkYBTRSG74_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
2143
2143
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
2144
2144
|
}
|
|
2145
2145
|
function mapDagBlendModeToCss(blend) {
|
|
@@ -2163,7 +2163,7 @@ function getDagDuotoneFilterId(elementId) {
|
|
|
2163
2163
|
return `dag-duotone-${elementId}`;
|
|
2164
2164
|
}
|
|
2165
2165
|
function hasDagDuotoneEffect(element) {
|
|
2166
|
-
if (!
|
|
2166
|
+
if (!chunkYBTRSG74_js.hasShapeProperties(element)) {
|
|
2167
2167
|
return false;
|
|
2168
2168
|
}
|
|
2169
2169
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
@@ -2217,7 +2217,7 @@ function renderDagDuotoneSvgFilter(elementId, color1, color2) {
|
|
|
2217
2217
|
function localClampAdjustment(value) {
|
|
2218
2218
|
return Math.max(SHAPE_ADJUSTMENT_MIN, Math.min(SHAPE_ADJUSTMENT_MAX, Math.round(value)));
|
|
2219
2219
|
}
|
|
2220
|
-
function
|
|
2220
|
+
function getRoundRectRadiusPx(element) {
|
|
2221
2221
|
const adjustment = element.shapeAdjustments?.adj;
|
|
2222
2222
|
const adjValue = typeof adjustment === "number" && Number.isFinite(adjustment) ? localClampAdjustment(adjustment) : DEFAULT_ROUND_RECT_ADJUSTMENT;
|
|
2223
2223
|
const normalizedAdjustment = adjValue / SHAPE_ADJUSTMENT_MAX;
|
|
@@ -2226,7 +2226,7 @@ function getRoundRectRadiusPx2(element) {
|
|
|
2226
2226
|
|
|
2227
2227
|
// src/viewer/utils/shape-visual-3d.ts
|
|
2228
2228
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
2229
|
-
return
|
|
2229
|
+
return chunkYBTRSG74_js.build3DExtrusionData(
|
|
2230
2230
|
shape3d,
|
|
2231
2231
|
scene3d,
|
|
2232
2232
|
fillColor,
|
|
@@ -2235,7 +2235,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
2235
2235
|
);
|
|
2236
2236
|
}
|
|
2237
2237
|
function apply3dEffects2(base, scene3d, shape3d, fillColorFallback) {
|
|
2238
|
-
|
|
2238
|
+
chunkYBTRSG74_js.apply3dEffects(base, scene3d, shape3d, fillColorFallback);
|
|
2239
2239
|
}
|
|
2240
2240
|
|
|
2241
2241
|
// src/viewer/utils/shape-visual-style.ts
|
|
@@ -2243,43 +2243,43 @@ function getGradientTilingCss(style) {
|
|
|
2243
2243
|
if (!style || style.fillMode !== "gradient") {
|
|
2244
2244
|
return void 0;
|
|
2245
2245
|
}
|
|
2246
|
-
const isStructuredLinear = (style.fillGradientType || "linear") === "linear" &&
|
|
2246
|
+
const isStructuredLinear = (style.fillGradientType || "linear") === "linear" && chunkYBTRSG74_js.sanitizeGradientStops(style.fillGradientStops).length > 0;
|
|
2247
2247
|
if (isStructuredLinear) {
|
|
2248
|
-
const flip =
|
|
2248
|
+
const flip = chunkYBTRSG74_js.getGradientTileFlipCss(style.fillGradientFlip);
|
|
2249
2249
|
if (flip) {
|
|
2250
2250
|
return flip;
|
|
2251
2251
|
}
|
|
2252
2252
|
}
|
|
2253
|
-
return
|
|
2253
|
+
return chunkYBTRSG74_js.getGradientTileRectCss(style.fillGradientTileRect);
|
|
2254
2254
|
}
|
|
2255
2255
|
function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2256
|
-
if (!
|
|
2256
|
+
if (!chunkYBTRSG74_js.hasShapeProperties(element)) {
|
|
2257
2257
|
return {};
|
|
2258
2258
|
}
|
|
2259
2259
|
const normalizedShapeType = getShapeType(element.shapeType);
|
|
2260
|
-
const clipPath =
|
|
2260
|
+
const clipPath = chunkYBTRSG74_js.isIdentityRectClip(element) ? void 0 : chunkYBTRSG74_js.getResolvedShapeClipPath(element);
|
|
2261
2261
|
const rendersCustomVectorPath = (element.type === "shape" || element.type === "image" || element.type === "picture") && Boolean(element.pathData) && typeof element.pathWidth === "number" && element.pathWidth > 0 && typeof element.pathHeight === "number" && element.pathHeight > 0;
|
|
2262
|
-
const rendersStrokeOnlyPreset =
|
|
2262
|
+
const rendersStrokeOnlyPreset = chunkYBTRSG74_js.isStrokeOnlyPresetElement(element);
|
|
2263
2263
|
const fillOpacity = element.shapeStyle?.fillOpacity;
|
|
2264
2264
|
const strokeOpacity = element.shapeStyle?.strokeOpacity;
|
|
2265
|
-
const strokeDash =
|
|
2266
|
-
const fillGradient =
|
|
2265
|
+
const strokeDash = chunkYBTRSG74_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2266
|
+
const fillGradient = chunkYBTRSG74_js.buildCssGradientFromShapeStyle(element.shapeStyle, {
|
|
2267
2267
|
rotation: element.rotation,
|
|
2268
2268
|
width: element.width,
|
|
2269
2269
|
height: element.height
|
|
2270
2270
|
}) || element.shapeStyle?.fillGradient;
|
|
2271
|
-
const shadowCss =
|
|
2272
|
-
const innerShadowCss =
|
|
2273
|
-
const resolvedFillColor =
|
|
2274
|
-
const resolvedStrokeColor =
|
|
2271
|
+
const shadowCss = chunkYBTRSG74_js.buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
2272
|
+
const innerShadowCss = chunkYBTRSG74_js.buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
2273
|
+
const resolvedFillColor = chunkYBTRSG74_js.colorWithOpacity(fillColor, fillOpacity);
|
|
2274
|
+
const resolvedStrokeColor = chunkYBTRSG74_js.colorWithOpacity(strokeColor, strokeOpacity);
|
|
2275
2275
|
const ss = element.shapeStyle;
|
|
2276
2276
|
const gradientTiling = getGradientTilingCss(ss);
|
|
2277
|
-
const paintsGradientOutline =
|
|
2277
|
+
const paintsGradientOutline = chunkYBTRSG74_js.suppressesCssBorder(element);
|
|
2278
2278
|
const hasFillOverlayColor = Boolean(
|
|
2279
2279
|
ss?.dagFillOverlayColor && ss.dagFillOverlayColor !== "transparent"
|
|
2280
2280
|
);
|
|
2281
2281
|
const combinedShadowParts = [];
|
|
2282
|
-
const multiLayerShadow =
|
|
2282
|
+
const multiLayerShadow = chunkYBTRSG74_js.buildMultiLayerShadowCss(element.shapeStyle);
|
|
2283
2283
|
if (multiLayerShadow) {
|
|
2284
2284
|
combinedShadowParts.push(multiLayerShadow);
|
|
2285
2285
|
} else if (shadowCss) {
|
|
@@ -2288,7 +2288,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2288
2288
|
if (innerShadowCss) {
|
|
2289
2289
|
combinedShadowParts.push(innerShadowCss);
|
|
2290
2290
|
}
|
|
2291
|
-
const glowBoxShadow =
|
|
2291
|
+
const glowBoxShadow = chunkYBTRSG74_js.buildGlowBoxShadow(ss?.glowColor, ss?.glowRadius, ss?.glowOpacity);
|
|
2292
2292
|
if (glowBoxShadow) {
|
|
2293
2293
|
combinedShadowParts.push(glowBoxShadow);
|
|
2294
2294
|
}
|
|
@@ -2296,7 +2296,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2296
2296
|
if (lineShadow) {
|
|
2297
2297
|
combinedShadowParts.push(lineShadow);
|
|
2298
2298
|
}
|
|
2299
|
-
const compoundLineShadow =
|
|
2299
|
+
const compoundLineShadow = chunkYBTRSG74_js.getCompoundLineBoxShadow(
|
|
2300
2300
|
element.shapeStyle?.compoundLine,
|
|
2301
2301
|
strokeWidth,
|
|
2302
2302
|
resolvedStrokeColor
|
|
@@ -2309,11 +2309,11 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2309
2309
|
if (ss?.glowColor && ss.glowColor !== "transparent" && ss.glowRadius) {
|
|
2310
2310
|
const glowOpacity = typeof ss.glowOpacity === "number" ? ss.glowOpacity : 0.75;
|
|
2311
2311
|
const glowRad = Math.round(Math.max(0, ss.glowRadius));
|
|
2312
|
-
const glowCol =
|
|
2312
|
+
const glowCol = chunkYBTRSG74_js.colorWithOpacity(chunkYBTRSG74_js.normalizeHexColor(ss.glowColor, "#ffff00"), glowOpacity);
|
|
2313
2313
|
filterParts.push(`drop-shadow(0 0 ${glowRad}px ${glowCol})`);
|
|
2314
2314
|
}
|
|
2315
2315
|
if (typeof ss?.softEdgeRadius === "number" && ss.softEdgeRadius > 0) {
|
|
2316
|
-
filterParts.push(`url(#${
|
|
2316
|
+
filterParts.push(`url(#${chunkYBTRSG74_js.getSoftEdgeFilterId(element.id)})`);
|
|
2317
2317
|
}
|
|
2318
2318
|
if (typeof ss?.blurRadius === "number" && ss.blurRadius > 0) {
|
|
2319
2319
|
filterParts.push(`blur(${Math.round(ss.blurRadius)}px)`);
|
|
@@ -2322,13 +2322,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2322
2322
|
if (lineGlowCss) {
|
|
2323
2323
|
filterParts.push(lineGlowCss);
|
|
2324
2324
|
}
|
|
2325
|
-
const dagFilter =
|
|
2325
|
+
const dagFilter = chunkYBTRSG74_js.getEffectDagFilter(ss, element.id);
|
|
2326
2326
|
if (dagFilter) {
|
|
2327
2327
|
filterParts.push(dagFilter);
|
|
2328
2328
|
}
|
|
2329
2329
|
const lineJoinCss = ss?.lineJoin === "round" ? "round" : ss?.lineJoin === "bevel" ? "bevel" : ss?.lineJoin === "miter" ? "miter" : void 0;
|
|
2330
2330
|
const miterLimitCss = ss?.lineJoin === "miter" && typeof ss?.miterLimit === "number" ? Math.max(ss.miterLimit / 1e5, 1) : void 0;
|
|
2331
|
-
const patternFill =
|
|
2331
|
+
const patternFill = chunkYBTRSG74_js.buildPatternFillCss(element.shapeStyle);
|
|
2332
2332
|
const imageFillUrl = ss?.fillMode === "image" && ss.fillImageUrl ? ss.fillImageUrl : void 0;
|
|
2333
2333
|
const imageFillMode = ss?.fillImageMode || "stretch";
|
|
2334
2334
|
let reflectCss;
|
|
@@ -2340,7 +2340,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2340
2340
|
const endOpacity = typeof ss.reflectionEndOpacity === "number" ? ss.reflectionEndOpacity : 0;
|
|
2341
2341
|
const fadeLength = typeof ss.reflectionEndPosition === "number" ? Math.round(ss.reflectionEndPosition * Math.max(element.height, 1)) : 100;
|
|
2342
2342
|
const blurRadius = typeof ss.reflectionBlurRadius === "number" ? ss.reflectionBlurRadius : 0;
|
|
2343
|
-
reflectCss =
|
|
2343
|
+
reflectCss = chunkYBTRSG74_js.buildReflectionCss(distance, startOpacity, endOpacity, fadeLength, blurRadius);
|
|
2344
2344
|
}
|
|
2345
2345
|
}
|
|
2346
2346
|
const base = {
|
|
@@ -2386,9 +2386,9 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2386
2386
|
// path following the shape's geometry, because a CSS border can only take
|
|
2387
2387
|
// one colour. Keeping the border too would draw the parser's averaged
|
|
2388
2388
|
// solid underneath the gradient.
|
|
2389
|
-
borderWidth: strokeWidth > 0 && !paintsGradientOutline ?
|
|
2389
|
+
borderWidth: strokeWidth > 0 && !paintsGradientOutline ? chunkYBTRSG74_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : 0,
|
|
2390
2390
|
borderColor: strokeWidth > 0 && !paintsGradientOutline ? resolvedStrokeColor : void 0,
|
|
2391
|
-
borderStyle: strokeWidth > 0 && !paintsGradientOutline ?
|
|
2391
|
+
borderStyle: strokeWidth > 0 && !paintsGradientOutline ? chunkYBTRSG74_js.getCssBorderDashStyle(strokeDash, ss?.compoundLine) : void 0,
|
|
2392
2392
|
strokeLinejoin: lineJoinCss,
|
|
2393
2393
|
strokeMiterlimit: miterLimitCss,
|
|
2394
2394
|
strokeLinecap: ss?.lineCap === "rnd" ? "round" : ss?.lineCap === "sq" ? "square" : ss?.lineCap === "flat" ? "butt" : void 0
|
|
@@ -2416,7 +2416,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2416
2416
|
};
|
|
2417
2417
|
}
|
|
2418
2418
|
if (normalizedShapeType === "roundRect") {
|
|
2419
|
-
const radiusPx =
|
|
2419
|
+
const radiusPx = getRoundRectRadiusPx(element);
|
|
2420
2420
|
if (radiusPx <= 0.01) {
|
|
2421
2421
|
return base;
|
|
2422
2422
|
}
|
|
@@ -2448,7 +2448,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2448
2448
|
borderWidth: 0,
|
|
2449
2449
|
borderTopWidth: Math.max(strokeWidth, 2),
|
|
2450
2450
|
borderTopColor: resolvedStrokeColor,
|
|
2451
|
-
borderTopStyle:
|
|
2451
|
+
borderTopStyle: chunkYBTRSG74_js.getCssBorderDashStyle(strokeDash)
|
|
2452
2452
|
};
|
|
2453
2453
|
}
|
|
2454
2454
|
if (normalizedShapeType === "cylinder") {
|
|
@@ -2462,13 +2462,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2462
2462
|
function getConnectorAdjustment(element, key, fallback) {
|
|
2463
2463
|
const direct = element.shapeAdjustments?.[key];
|
|
2464
2464
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
2465
|
-
return
|
|
2465
|
+
return chunkYBTRSG74_js.clampUnitInterval(direct / 1e5);
|
|
2466
2466
|
}
|
|
2467
2467
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
2468
2468
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
2469
|
-
return
|
|
2469
|
+
return chunkYBTRSG74_js.clampUnitInterval(fallbackKey / 1e5);
|
|
2470
2470
|
}
|
|
2471
|
-
return
|
|
2471
|
+
return chunkYBTRSG74_js.clampUnitInterval(fallback);
|
|
2472
2472
|
}
|
|
2473
2473
|
function getConnectorPathGeometry(element) {
|
|
2474
2474
|
const width = Math.max(element.width, 0);
|
|
@@ -2601,7 +2601,7 @@ function toHexByte(value) {
|
|
|
2601
2601
|
return clamped.toString(16).padStart(2, "0");
|
|
2602
2602
|
}
|
|
2603
2603
|
function shiftHex(hex, factor, towardsWhite) {
|
|
2604
|
-
const channels =
|
|
2604
|
+
const channels = chunkYBTRSG74_js.hexToRgbChannels(hex);
|
|
2605
2605
|
if (!channels) {
|
|
2606
2606
|
return hex;
|
|
2607
2607
|
}
|
|
@@ -2627,7 +2627,7 @@ function buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity) {
|
|
|
2627
2627
|
const fillOff = subpath.fillMode === "none" || !hasFill;
|
|
2628
2628
|
return {
|
|
2629
2629
|
d: subpath.d,
|
|
2630
|
-
fill: fillOff ? "none" :
|
|
2630
|
+
fill: fillOff ? "none" : chunkYBTRSG74_js.colorWithOpacity(adjustFillForMode(fillColor, subpath.fillMode), fillOpacity),
|
|
2631
2631
|
stroked: subpath.stroke !== false
|
|
2632
2632
|
};
|
|
2633
2633
|
});
|
|
@@ -2643,11 +2643,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
|
|
|
2643
2643
|
strokePaint,
|
|
2644
2644
|
strokeWidth,
|
|
2645
2645
|
dashArray,
|
|
2646
|
-
lineCap:
|
|
2646
|
+
lineCap: chunkYBTRSG74_js.svgLineCap(shapeStyle?.lineCap),
|
|
2647
2647
|
lineJoin,
|
|
2648
2648
|
miterLimit,
|
|
2649
|
-
offsets:
|
|
2650
|
-
widths:
|
|
2649
|
+
offsets: chunkYBTRSG74_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
2650
|
+
widths: chunkYBTRSG74_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
|
|
2651
2651
|
};
|
|
2652
2652
|
}
|
|
2653
2653
|
function strokeStrands(d, keyBase, ctx) {
|
|
@@ -2695,9 +2695,9 @@ function gradientDefs(gradient) {
|
|
|
2695
2695
|
}
|
|
2696
2696
|
function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredPaths, shapeStyle, hasFill, fillColor, fillOpacity, strokePaint, strokeWidth, dashArray, animatesFill = false, gradient) {
|
|
2697
2697
|
const ctx = strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray);
|
|
2698
|
-
const subpaths = structuredPaths && structuredPaths.length > 0 ?
|
|
2698
|
+
const subpaths = structuredPaths && structuredPaths.length > 0 ? chunkYBTRSG74_js.customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
2699
2699
|
const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
|
|
2700
|
-
const gradientPaint = gradient ?
|
|
2700
|
+
const gradientPaint = gradient ? chunkYBTRSG74_js.svgGradientFillRef(gradient) : void 0;
|
|
2701
2701
|
const nodes = [];
|
|
2702
2702
|
if (subpaths && needsPerSubpath) {
|
|
2703
2703
|
const paints = buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity);
|
|
@@ -2729,7 +2729,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2729
2729
|
"path",
|
|
2730
2730
|
{
|
|
2731
2731
|
d: pathData,
|
|
2732
|
-
fill: animatesFill ? "inherit" : gradientPaint ??
|
|
2732
|
+
fill: animatesFill ? "inherit" : gradientPaint ?? chunkYBTRSG74_js.colorWithOpacity(fillColor, fillOpacity),
|
|
2733
2733
|
stroke: "none",
|
|
2734
2734
|
vectorEffect: "non-scaling-stroke"
|
|
2735
2735
|
},
|
|
@@ -2755,14 +2755,14 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2755
2755
|
);
|
|
2756
2756
|
}
|
|
2757
2757
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2758
|
-
if (!
|
|
2758
|
+
if (!chunkYBTRSG74_js.hasShapeProperties(element)) {
|
|
2759
2759
|
return null;
|
|
2760
2760
|
}
|
|
2761
2761
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
2762
|
-
const fillPaint = animatesFill ? "inherit" :
|
|
2763
|
-
const strokePaint = animatesStroke ? "inherit" :
|
|
2764
|
-
const dashType =
|
|
2765
|
-
const dashArray =
|
|
2762
|
+
const fillPaint = animatesFill ? "inherit" : chunkYBTRSG74_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
2763
|
+
const strokePaint = animatesStroke ? "inherit" : chunkYBTRSG74_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
2764
|
+
const dashType = chunkYBTRSG74_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2765
|
+
const dashArray = chunkYBTRSG74_js.getSvgStrokeDasharray(
|
|
2766
2766
|
dashType,
|
|
2767
2767
|
Math.max(strokeWidth, 1),
|
|
2768
2768
|
element.shapeStyle?.customDashSegments
|
|
@@ -2843,21 +2843,21 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2843
2843
|
// container's `background-image` is suppressed for custom geometry, so
|
|
2844
2844
|
// without this the shape fell back to the parser's representative solid
|
|
2845
2845
|
// and lost every fade (issue #132).
|
|
2846
|
-
|
|
2846
|
+
chunkYBTRSG74_js.buildSvgGradientDef(element.shapeStyle, element.id)
|
|
2847
2847
|
);
|
|
2848
2848
|
}
|
|
2849
|
-
if (
|
|
2849
|
+
if (chunkYBTRSG74_js.isCalloutShape(normalizedType)) {
|
|
2850
2850
|
const width = Math.max(element.width, 1);
|
|
2851
2851
|
const height = Math.max(element.height, 1);
|
|
2852
|
-
const geometry =
|
|
2852
|
+
const geometry = chunkYBTRSG74_js.getCalloutLeaderLineGeometry(
|
|
2853
2853
|
normalizedType,
|
|
2854
2854
|
width,
|
|
2855
2855
|
height,
|
|
2856
2856
|
element.shapeAdjustments
|
|
2857
2857
|
);
|
|
2858
2858
|
if (geometry && geometry.points.length >= 2) {
|
|
2859
|
-
const leaderPath =
|
|
2860
|
-
const bounds =
|
|
2859
|
+
const leaderPath = chunkYBTRSG74_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
2860
|
+
const bounds = chunkYBTRSG74_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
2861
2861
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
2862
2862
|
const offsetLeft = bounds.minX;
|
|
2863
2863
|
const offsetTop = bounds.minY;
|
|
@@ -2920,10 +2920,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2920
2920
|
const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
|
|
2921
2921
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
2922
2922
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
2923
|
-
const connectorLineCap =
|
|
2923
|
+
const connectorLineCap = chunkYBTRSG74_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
2924
2924
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
2925
|
-
const offsets =
|
|
2926
|
-
const widths =
|
|
2925
|
+
const offsets = chunkYBTRSG74_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
2926
|
+
const widths = chunkYBTRSG74_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
2927
2927
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2928
2928
|
"svg",
|
|
2929
2929
|
{
|
|
@@ -2990,15 +2990,15 @@ function parseGradientFillCss(gradFill) {
|
|
|
2990
2990
|
}
|
|
2991
2991
|
const parsed = stops.map((gs) => {
|
|
2992
2992
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
2993
|
-
const color =
|
|
2994
|
-
const opacity =
|
|
2995
|
-
return { pos, color:
|
|
2993
|
+
const color = chunkYBTRSG74_js.parseDrawingColor(gs) ?? "#888888";
|
|
2994
|
+
const opacity = chunkYBTRSG74_js.parseDrawingColorOpacity(gs);
|
|
2995
|
+
return { pos, color: chunkYBTRSG74_js.colorWithOpacity(color, opacity) };
|
|
2996
2996
|
}).sort((a, b) => a.pos - b.pos);
|
|
2997
2997
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
2998
2998
|
const lin = gradFill["a:lin"];
|
|
2999
2999
|
if (lin) {
|
|
3000
3000
|
const angRaw = Number.parseInt(String(lin["@_ang"] || "0"), 10);
|
|
3001
|
-
const angleDeg = Math.round(
|
|
3001
|
+
const angleDeg = Math.round(chunkYBTRSG74_js.ooxmlGradientAngleToCssDegrees(angRaw / 6e4));
|
|
3002
3002
|
return `linear-gradient(${angleDeg}deg, ${stopStrings})`;
|
|
3003
3003
|
}
|
|
3004
3004
|
const path = gradFill["a:path"];
|
|
@@ -3033,8 +3033,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
3033
3033
|
if (!pattFill) {
|
|
3034
3034
|
return void 0;
|
|
3035
3035
|
}
|
|
3036
|
-
const fgColor =
|
|
3037
|
-
const bgColor =
|
|
3036
|
+
const fgColor = chunkYBTRSG74_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
3037
|
+
const bgColor = chunkYBTRSG74_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
3038
3038
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
3039
3039
|
switch (preset) {
|
|
3040
3040
|
case "ltHorz":
|
|
@@ -3145,11 +3145,11 @@ function parseCellBorders(cellProperties) {
|
|
|
3145
3145
|
const prstDash = ln["a:prstDash"];
|
|
3146
3146
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
3147
3147
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
3148
|
-
const color =
|
|
3148
|
+
const color = chunkYBTRSG74_js.parseDrawingColor(ln["a:solidFill"]);
|
|
3149
3149
|
if (color) {
|
|
3150
|
-
const opacity =
|
|
3150
|
+
const opacity = chunkYBTRSG74_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
3151
3151
|
const key = `${edge.prefix}`;
|
|
3152
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
3152
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkYBTRSG74_js.colorWithOpacity(color, opacity)}`;
|
|
3153
3153
|
}
|
|
3154
3154
|
}
|
|
3155
3155
|
return borderStyle;
|
|
@@ -3162,7 +3162,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3162
3162
|
const textShadowParts = [];
|
|
3163
3163
|
const outerShdw = effectLst["a:outerShdw"];
|
|
3164
3164
|
if (outerShdw) {
|
|
3165
|
-
const shdwColor =
|
|
3165
|
+
const shdwColor = chunkYBTRSG74_js.parseDrawingColor(outerShdw);
|
|
3166
3166
|
if (shdwColor) {
|
|
3167
3167
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
3168
3168
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -3180,7 +3180,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3180
3180
|
}
|
|
3181
3181
|
const glow = effectLst["a:glow"];
|
|
3182
3182
|
if (glow) {
|
|
3183
|
-
const glowColor =
|
|
3183
|
+
const glowColor = chunkYBTRSG74_js.parseDrawingColor(glow);
|
|
3184
3184
|
if (glowColor) {
|
|
3185
3185
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
3186
3186
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -3259,10 +3259,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3259
3259
|
if (runProps?.["@_u"] !== void 0) {
|
|
3260
3260
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
3261
3261
|
}
|
|
3262
|
-
const runColor =
|
|
3262
|
+
const runColor = chunkYBTRSG74_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkYBTRSG74_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
3263
3263
|
if (runColor) {
|
|
3264
|
-
const opacity =
|
|
3265
|
-
cellStyle.color =
|
|
3264
|
+
const opacity = chunkYBTRSG74_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
3265
|
+
cellStyle.color = chunkYBTRSG74_js.colorWithOpacity(runColor, opacity);
|
|
3266
3266
|
}
|
|
3267
3267
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
3268
3268
|
if (fontFamily) {
|
|
@@ -3272,15 +3272,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3272
3272
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
3273
3273
|
}
|
|
3274
3274
|
const cellProperties = cellXml["a:tcPr"];
|
|
3275
|
-
const cellFill =
|
|
3275
|
+
const cellFill = chunkYBTRSG74_js.parseDrawingColor(
|
|
3276
3276
|
cellProperties?.["a:solidFill"],
|
|
3277
3277
|
schemeColorOverrides
|
|
3278
3278
|
);
|
|
3279
3279
|
if (cellFill) {
|
|
3280
|
-
const opacity =
|
|
3280
|
+
const opacity = chunkYBTRSG74_js.parseDrawingColorOpacity(
|
|
3281
3281
|
cellProperties?.["a:solidFill"]
|
|
3282
3282
|
);
|
|
3283
|
-
cellStyle.backgroundColor =
|
|
3283
|
+
cellStyle.backgroundColor = chunkYBTRSG74_js.colorWithOpacity(cellFill, opacity);
|
|
3284
3284
|
} else {
|
|
3285
3285
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
3286
3286
|
if (gradCss) {
|
|
@@ -3295,16 +3295,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3295
3295
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
3296
3296
|
Object.assign(cellStyle, edgeBorders);
|
|
3297
3297
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
3298
|
-
const borderColor =
|
|
3298
|
+
const borderColor = chunkYBTRSG74_js.parseDrawingColor(
|
|
3299
3299
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
3300
3300
|
schemeColorOverrides
|
|
3301
|
-
) ||
|
|
3301
|
+
) || chunkYBTRSG74_js.parseDrawingColor(
|
|
3302
3302
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
3303
3303
|
schemeColorOverrides
|
|
3304
|
-
) ||
|
|
3304
|
+
) || chunkYBTRSG74_js.parseDrawingColor(
|
|
3305
3305
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
3306
3306
|
schemeColorOverrides
|
|
3307
|
-
) ||
|
|
3307
|
+
) || chunkYBTRSG74_js.parseDrawingColor(
|
|
3308
3308
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
3309
3309
|
schemeColorOverrides
|
|
3310
3310
|
);
|
|
@@ -3383,10 +3383,10 @@ function resolveTableStyleFillColor(fill, colorScheme) {
|
|
|
3383
3383
|
}
|
|
3384
3384
|
let color = base;
|
|
3385
3385
|
if (fill.tint !== void 0 && fill.tint > 0) {
|
|
3386
|
-
color =
|
|
3386
|
+
color = chunkYBTRSG74_js.tintColor2(color, fill.tint / 1e5);
|
|
3387
3387
|
}
|
|
3388
3388
|
if (fill.shade !== void 0 && fill.shade > 0) {
|
|
3389
|
-
color =
|
|
3389
|
+
color = chunkYBTRSG74_js.shadeColor2(color, 1 - fill.shade / 1e5);
|
|
3390
3390
|
}
|
|
3391
3391
|
return color;
|
|
3392
3392
|
}
|
|
@@ -3411,7 +3411,7 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3411
3411
|
style.fontFamily = text.fontFace;
|
|
3412
3412
|
applied = true;
|
|
3413
3413
|
} else {
|
|
3414
|
-
const refFont =
|
|
3414
|
+
const refFont = chunkYBTRSG74_js.resolveFontRefIdx(text.fontRefIdx, fontScheme);
|
|
3415
3415
|
if (refFont) {
|
|
3416
3416
|
style.fontFamily = refFont;
|
|
3417
3417
|
applied = true;
|
|
@@ -3422,10 +3422,10 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3422
3422
|
if (base) {
|
|
3423
3423
|
let color = base;
|
|
3424
3424
|
if (text.fontTint !== void 0 && text.fontTint > 0) {
|
|
3425
|
-
color =
|
|
3425
|
+
color = chunkYBTRSG74_js.tintColor2(color, text.fontTint / 1e5);
|
|
3426
3426
|
}
|
|
3427
3427
|
if (text.fontShade !== void 0 && text.fontShade > 0) {
|
|
3428
|
-
color =
|
|
3428
|
+
color = chunkYBTRSG74_js.shadeColor2(color, 1 - text.fontShade / 1e5);
|
|
3429
3429
|
}
|
|
3430
3430
|
style.color = color;
|
|
3431
3431
|
applied = true;
|
|
@@ -3614,7 +3614,7 @@ function parseTableElementData(element, fallbackTextStyle) {
|
|
|
3614
3614
|
};
|
|
3615
3615
|
}
|
|
3616
3616
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
3617
|
-
return
|
|
3617
|
+
return chunkYBTRSG74_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
3618
3618
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
3619
3619
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
3620
3620
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -3762,9 +3762,9 @@ function cellStyleToCss(style) {
|
|
|
3762
3762
|
if (style.gradientFillCss) {
|
|
3763
3763
|
css.background = style.gradientFillCss;
|
|
3764
3764
|
} else if (style.fillMode === "pattern" && style.patternFillPreset) {
|
|
3765
|
-
const fg =
|
|
3766
|
-
const bg =
|
|
3767
|
-
const svgPattern =
|
|
3765
|
+
const fg = chunkYBTRSG74_js.normalizeHexColor(style.patternFillForeground, "#000000");
|
|
3766
|
+
const bg = chunkYBTRSG74_js.normalizeHexColor(style.patternFillBackground, "#ffffff");
|
|
3767
|
+
const svgPattern = chunkYBTRSG74_js.getPatternSvg(style.patternFillPreset, fg, bg);
|
|
3768
3768
|
if (svgPattern) {
|
|
3769
3769
|
const encoded = encodeURIComponent(svgPattern);
|
|
3770
3770
|
css.backgroundImage = `url("data:image/svg+xml,${encoded}")`;
|
|
@@ -3840,7 +3840,7 @@ function cellStyleToCss(style) {
|
|
|
3840
3840
|
if (edge.width || edge.color) {
|
|
3841
3841
|
const w = edge.width ?? 1;
|
|
3842
3842
|
const c = edge.color ?? style.borderColor ?? "#000000";
|
|
3843
|
-
const s =
|
|
3843
|
+
const s = chunkYBTRSG74_js.ooxmlDashToCssBorderStyle(edge.dash);
|
|
3844
3844
|
css[edge.prefix] = `${w}px ${s} ${c}`;
|
|
3845
3845
|
}
|
|
3846
3846
|
}
|
|
@@ -3871,7 +3871,7 @@ function cellStyleToCss(style) {
|
|
|
3871
3871
|
css.textShadow = textShadowParts.join(", ");
|
|
3872
3872
|
}
|
|
3873
3873
|
if (style.cell3D) {
|
|
3874
|
-
Object.assign(css,
|
|
3874
|
+
Object.assign(css, chunkYBTRSG74_js.cell3DBevelCss(style.cell3D));
|
|
3875
3875
|
}
|
|
3876
3876
|
return css;
|
|
3877
3877
|
}
|
|
@@ -3885,7 +3885,7 @@ function TableResizeOverlay({
|
|
|
3885
3885
|
const containerRef = React6.useRef(null);
|
|
3886
3886
|
const [rowBounds, setRowBounds] = React6.useState([]);
|
|
3887
3887
|
const dragRef = React6.useRef(null);
|
|
3888
|
-
const colBoundaries = React6.useMemo(() =>
|
|
3888
|
+
const colBoundaries = React6.useMemo(() => chunkYBTRSG74_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
3889
3889
|
const measureRows = React6.useCallback(() => {
|
|
3890
3890
|
const container = containerRef.current;
|
|
3891
3891
|
if (!container) {
|
|
@@ -3932,11 +3932,11 @@ function TableResizeOverlay({
|
|
|
3932
3932
|
const rect = containerRef.current.getBoundingClientRect();
|
|
3933
3933
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
3934
3934
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
3935
|
-
onResizeColumns(
|
|
3935
|
+
onResizeColumns(chunkYBTRSG74_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
3936
3936
|
} else if (drag.type === "row" && onResizeRow) {
|
|
3937
3937
|
const deltaY = e.clientY - drag.startPos;
|
|
3938
|
-
const newHeight =
|
|
3939
|
-
drag.initialRowHeight ??
|
|
3938
|
+
const newHeight = chunkYBTRSG74_js.computeResizedRowHeight(
|
|
3939
|
+
drag.initialRowHeight ?? chunkYBTRSG74_js.DEFAULT_ROW_HEIGHT,
|
|
3940
3940
|
deltaY
|
|
3941
3941
|
);
|
|
3942
3942
|
onResizeRow(drag.index, newHeight);
|
|
@@ -3974,7 +3974,7 @@ function TableResizeOverlay({
|
|
|
3974
3974
|
e.stopPropagation();
|
|
3975
3975
|
const table = containerRef.current?.querySelector("table");
|
|
3976
3976
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
3977
|
-
const actualHeight = tr?.offsetHeight ??
|
|
3977
|
+
const actualHeight = tr?.offsetHeight ?? chunkYBTRSG74_js.DEFAULT_ROW_HEIGHT;
|
|
3978
3978
|
document.body.style.cursor = "row-resize";
|
|
3979
3979
|
document.body.style.userSelect = "none";
|
|
3980
3980
|
dragRef.current = {
|
|
@@ -4022,7 +4022,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4022
4022
|
}
|
|
4023
4023
|
const first = selectedCell.selectedCells[0];
|
|
4024
4024
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4025
|
-
return
|
|
4025
|
+
return chunkYBTRSG74_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
4026
4026
|
})();
|
|
4027
4027
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4028
4028
|
TableResizeOverlay,
|
|
@@ -4042,7 +4042,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4042
4042
|
"table",
|
|
4043
4043
|
{
|
|
4044
4044
|
className: "w-full h-full border-collapse table-fixed",
|
|
4045
|
-
style: { fontFamily:
|
|
4045
|
+
style: { fontFamily: chunkYBTRSG74_js.DEFAULT_FONT_FAMILY },
|
|
4046
4046
|
children: [
|
|
4047
4047
|
tableData.columnWidths.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: tableData.columnWidths.map((w, ci) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4048
4048
|
"col",
|
|
@@ -4060,7 +4060,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4060
4060
|
return null;
|
|
4061
4061
|
}
|
|
4062
4062
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
4063
|
-
const isInMultiSelection =
|
|
4063
|
+
const isInMultiSelection = chunkYBTRSG74_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
4064
4064
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
4065
4065
|
const diag = getCellDiagonalBorders2(
|
|
4066
4066
|
cell.style,
|
|
@@ -4090,7 +4090,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4090
4090
|
}
|
|
4091
4091
|
event.stopPropagation();
|
|
4092
4092
|
if (event.shiftKey && selectedCell) {
|
|
4093
|
-
const rect =
|
|
4093
|
+
const rect = chunkYBTRSG74_js.computeSelectionRect(
|
|
4094
4094
|
selectedCell.rowIndex,
|
|
4095
4095
|
selectedCell.columnIndex,
|
|
4096
4096
|
rowIndex,
|
|
@@ -4100,7 +4100,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4100
4100
|
options?.onSelectCell?.({
|
|
4101
4101
|
rowIndex: selectedCell.rowIndex,
|
|
4102
4102
|
columnIndex: selectedCell.columnIndex,
|
|
4103
|
-
selectedCells:
|
|
4103
|
+
selectedCells: chunkYBTRSG74_js.rectToCells(rect)
|
|
4104
4104
|
});
|
|
4105
4105
|
} else {
|
|
4106
4106
|
options?.onSelectCell?.({
|
|
@@ -4179,7 +4179,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4179
4179
|
}
|
|
4180
4180
|
const first = selectedCell.selectedCells[0];
|
|
4181
4181
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4182
|
-
return
|
|
4182
|
+
return chunkYBTRSG74_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
4183
4183
|
})();
|
|
4184
4184
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
4185
4185
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4200,7 +4200,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4200
4200
|
"table",
|
|
4201
4201
|
{
|
|
4202
4202
|
className: "w-full h-full border-collapse table-fixed",
|
|
4203
|
-
style: { fontFamily:
|
|
4203
|
+
style: { fontFamily: chunkYBTRSG74_js.DEFAULT_FONT_FAMILY },
|
|
4204
4204
|
children: [
|
|
4205
4205
|
parsedTable.columnPercentages.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: parsedTable.columnPercentages.map((percentage, columnIndex) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4206
4206
|
"col",
|
|
@@ -4261,7 +4261,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4261
4261
|
"border px-1 py-0.5 align-top",
|
|
4262
4262
|
isEditable && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
4263
4263
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
4264
|
-
|
|
4264
|
+
chunkYBTRSG74_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
4265
4265
|
),
|
|
4266
4266
|
colSpan,
|
|
4267
4267
|
rowSpan: rSpan,
|
|
@@ -4272,7 +4272,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4272
4272
|
}
|
|
4273
4273
|
event.stopPropagation();
|
|
4274
4274
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
4275
|
-
const rect =
|
|
4275
|
+
const rect = chunkYBTRSG74_js.computeSelectionRect(
|
|
4276
4276
|
selectedCell.rowIndex,
|
|
4277
4277
|
selectedCell.columnIndex,
|
|
4278
4278
|
rowIndex,
|
|
@@ -4282,7 +4282,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4282
4282
|
options?.onSelectCell?.({
|
|
4283
4283
|
rowIndex: selectedCell.rowIndex,
|
|
4284
4284
|
columnIndex: selectedCell.columnIndex,
|
|
4285
|
-
selectedCells:
|
|
4285
|
+
selectedCells: chunkYBTRSG74_js.rectToCells(rect)
|
|
4286
4286
|
});
|
|
4287
4287
|
} else {
|
|
4288
4288
|
options?.onSelectCell?.({
|
|
@@ -4339,24 +4339,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4339
4339
|
}
|
|
4340
4340
|
var LEGEND_ITEM_WIDTH = 80;
|
|
4341
4341
|
function partAttrs(part) {
|
|
4342
|
-
return part ?
|
|
4342
|
+
return part ? chunkYBTRSG74_js.chartPartToAttrs(part) : void 0;
|
|
4343
4343
|
}
|
|
4344
4344
|
function resolveReactPalette(chartData) {
|
|
4345
4345
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
4346
4346
|
return chartData.colorPalette;
|
|
4347
4347
|
}
|
|
4348
|
-
return [...
|
|
4348
|
+
return [...chunkYBTRSG74_js.getChartStylePalette(chartData.style?.styleId)];
|
|
4349
4349
|
}
|
|
4350
4350
|
function buildReactChartViewModel(element) {
|
|
4351
4351
|
if (element.type !== "chart" || !element.chartData) {
|
|
4352
|
-
return
|
|
4352
|
+
return chunkYBTRSG74_js.buildChartViewModel(element);
|
|
4353
4353
|
}
|
|
4354
4354
|
const palette = resolveReactPalette(element.chartData);
|
|
4355
4355
|
const themedElement = {
|
|
4356
4356
|
...element,
|
|
4357
4357
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
4358
4358
|
};
|
|
4359
|
-
return
|
|
4359
|
+
return chunkYBTRSG74_js.buildChartViewModel(themedElement);
|
|
4360
4360
|
}
|
|
4361
4361
|
function renderPrimitive(prim, key) {
|
|
4362
4362
|
switch (prim.kind) {
|
|
@@ -4745,7 +4745,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4745
4745
|
const unmatchedRows = [];
|
|
4746
4746
|
categories.forEach((cat, i) => {
|
|
4747
4747
|
const value = values[i] ?? 0;
|
|
4748
|
-
const code =
|
|
4748
|
+
const code = chunkYBTRSG74_js.resolveRegionCode(cat);
|
|
4749
4749
|
if (code) {
|
|
4750
4750
|
regionValueMap.set(code, { value, label: cat });
|
|
4751
4751
|
} else {
|
|
@@ -4783,8 +4783,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4783
4783
|
let fill = "#e2e8f0";
|
|
4784
4784
|
let dataLabel = null;
|
|
4785
4785
|
if (entry) {
|
|
4786
|
-
const t =
|
|
4787
|
-
fill =
|
|
4786
|
+
const t = chunkYBTRSG74_js.normalizeValue(entry.value, minVal, maxVal);
|
|
4787
|
+
fill = chunkYBTRSG74_js.sequentialColorScale(t);
|
|
4788
4788
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
4789
4789
|
"text",
|
|
4790
4790
|
{
|
|
@@ -4795,7 +4795,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4795
4795
|
fontWeight: 600,
|
|
4796
4796
|
fill: "#1e293b",
|
|
4797
4797
|
style: { pointerEvents: "none" },
|
|
4798
|
-
children:
|
|
4798
|
+
children: chunkYBTRSG74_js.formatAxisValue(entry.value)
|
|
4799
4799
|
},
|
|
4800
4800
|
`${element.id}-map-dl-${region.code}`
|
|
4801
4801
|
);
|
|
@@ -4813,7 +4813,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4813
4813
|
opacity: 0.9,
|
|
4814
4814
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
4815
4815
|
region.name,
|
|
4816
|
-
entry ? `: ${
|
|
4816
|
+
entry ? `: ${chunkYBTRSG74_js.formatAxisValue(entry.value)}` : ""
|
|
4817
4817
|
] })
|
|
4818
4818
|
}
|
|
4819
4819
|
),
|
|
@@ -4851,7 +4851,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4851
4851
|
fontSize: 7,
|
|
4852
4852
|
fill: "#64748b",
|
|
4853
4853
|
textAnchor: "middle",
|
|
4854
|
-
children:
|
|
4854
|
+
children: chunkYBTRSG74_js.formatAxisValue(minVal)
|
|
4855
4855
|
},
|
|
4856
4856
|
`${element.id}-map-legend-min`
|
|
4857
4857
|
),
|
|
@@ -4863,7 +4863,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4863
4863
|
fontSize: 7,
|
|
4864
4864
|
fill: "#64748b",
|
|
4865
4865
|
textAnchor: "middle",
|
|
4866
|
-
children:
|
|
4866
|
+
children: chunkYBTRSG74_js.formatAxisValue(maxVal)
|
|
4867
4867
|
},
|
|
4868
4868
|
`${element.id}-map-legend-max`
|
|
4869
4869
|
)
|
|
@@ -4929,7 +4929,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4929
4929
|
y,
|
|
4930
4930
|
fontSize,
|
|
4931
4931
|
fill: "#475569",
|
|
4932
|
-
children:
|
|
4932
|
+
children: chunkYBTRSG74_js.formatAxisValue(row.value)
|
|
4933
4933
|
},
|
|
4934
4934
|
`${element.id}-map-ft-val-${i}`
|
|
4935
4935
|
)
|
|
@@ -5000,7 +5000,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
5000
5000
|
|
|
5001
5001
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
5002
5002
|
function sColor(series, idx) {
|
|
5003
|
-
return
|
|
5003
|
+
return chunkYBTRSG74_js.seriesColor(series, idx);
|
|
5004
5004
|
}
|
|
5005
5005
|
function valToY(val, range, topY, bottomY) {
|
|
5006
5006
|
const usable = bottomY - topY;
|
|
@@ -5539,7 +5539,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5539
5539
|
width: 10,
|
|
5540
5540
|
height: 10,
|
|
5541
5541
|
rx: 2,
|
|
5542
|
-
fill:
|
|
5542
|
+
fill: chunkYBTRSG74_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5543
5543
|
},
|
|
5544
5544
|
`${id}-leg-r-${i}`
|
|
5545
5545
|
)
|
|
@@ -5563,7 +5563,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5563
5563
|
width: 10,
|
|
5564
5564
|
height: 10,
|
|
5565
5565
|
rx: 2,
|
|
5566
|
-
fill:
|
|
5566
|
+
fill: chunkYBTRSG74_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5567
5567
|
}
|
|
5568
5568
|
),
|
|
5569
5569
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -5576,9 +5576,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5576
5576
|
}
|
|
5577
5577
|
const lines = [];
|
|
5578
5578
|
if (range.logScale && range.logBase) {
|
|
5579
|
-
const ticks =
|
|
5579
|
+
const ticks = chunkYBTRSG74_js.generateLogTicks(range);
|
|
5580
5580
|
ticks.forEach((tickVal, i) => {
|
|
5581
|
-
const y =
|
|
5581
|
+
const y = chunkYBTRSG74_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5582
5582
|
lines.push(
|
|
5583
5583
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5584
5584
|
"line",
|
|
@@ -5599,7 +5599,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5599
5599
|
const steps = 4;
|
|
5600
5600
|
for (let i = 0; i <= steps; i++) {
|
|
5601
5601
|
const val = range.min + range.span * i / steps;
|
|
5602
|
-
const y =
|
|
5602
|
+
const y = chunkYBTRSG74_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5603
5603
|
lines.push(
|
|
5604
5604
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5605
5605
|
"line",
|
|
@@ -5623,9 +5623,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5623
5623
|
const labels = [];
|
|
5624
5624
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5625
5625
|
if (range.logScale && range.logBase) {
|
|
5626
|
-
const ticks =
|
|
5626
|
+
const ticks = chunkYBTRSG74_js.generateLogTicks(range);
|
|
5627
5627
|
ticks.forEach((tickVal, i) => {
|
|
5628
|
-
const y =
|
|
5628
|
+
const y = chunkYBTRSG74_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5629
5629
|
labels.push(
|
|
5630
5630
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5631
5631
|
"text",
|
|
@@ -5635,7 +5635,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5635
5635
|
textAnchor: "end",
|
|
5636
5636
|
fontSize: 8,
|
|
5637
5637
|
fill: "#64748b",
|
|
5638
|
-
children: hasDisplayUnits ?
|
|
5638
|
+
children: hasDisplayUnits ? chunkYBTRSG74_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunkYBTRSG74_js.formatAxisValue(tickVal)
|
|
5639
5639
|
},
|
|
5640
5640
|
`${id}-vaxis-log-${i}`
|
|
5641
5641
|
)
|
|
@@ -5645,7 +5645,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5645
5645
|
const steps = 4;
|
|
5646
5646
|
for (let i = 0; i <= steps; i++) {
|
|
5647
5647
|
const val = range.min + range.span * i / steps;
|
|
5648
|
-
const y =
|
|
5648
|
+
const y = chunkYBTRSG74_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5649
5649
|
labels.push(
|
|
5650
5650
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5651
5651
|
"text",
|
|
@@ -5655,7 +5655,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5655
5655
|
textAnchor: "end",
|
|
5656
5656
|
fontSize: 8,
|
|
5657
5657
|
fill: "#64748b",
|
|
5658
|
-
children: hasDisplayUnits ?
|
|
5658
|
+
children: hasDisplayUnits ? chunkYBTRSG74_js.formatAxisValueWithUnits(val, axisFormatting) : chunkYBTRSG74_js.formatAxisValue(val)
|
|
5659
5659
|
},
|
|
5660
5660
|
`${id}-vaxis-${i}`
|
|
5661
5661
|
)
|
|
@@ -5663,7 +5663,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5663
5663
|
}
|
|
5664
5664
|
}
|
|
5665
5665
|
if (hasDisplayUnits) {
|
|
5666
|
-
const unitLabel =
|
|
5666
|
+
const unitLabel = chunkYBTRSG74_js.getDisplayUnitLabel(
|
|
5667
5667
|
axisFormatting.displayUnits,
|
|
5668
5668
|
axisFormatting.displayUnitsLabel
|
|
5669
5669
|
);
|
|
@@ -5738,7 +5738,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
5738
5738
|
if (range.min >= 0) {
|
|
5739
5739
|
return null;
|
|
5740
5740
|
}
|
|
5741
|
-
const y =
|
|
5741
|
+
const y = chunkYBTRSG74_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
5742
5742
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5743
5743
|
"line",
|
|
5744
5744
|
{
|
|
@@ -5762,7 +5762,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5762
5762
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5763
5763
|
for (let i = 0; i <= steps; i++) {
|
|
5764
5764
|
const val = range.min + range.span * i / steps;
|
|
5765
|
-
const y =
|
|
5765
|
+
const y = chunkYBTRSG74_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5766
5766
|
labels.push(
|
|
5767
5767
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5768
5768
|
"text",
|
|
@@ -5774,7 +5774,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5774
5774
|
fontFamily,
|
|
5775
5775
|
fontWeight,
|
|
5776
5776
|
fill: fontColor,
|
|
5777
|
-
children: hasDisplayUnits ?
|
|
5777
|
+
children: hasDisplayUnits ? chunkYBTRSG74_js.formatAxisValueWithUnits(val, axisFormatting) : chunkYBTRSG74_js.formatAxisValue(val)
|
|
5778
5778
|
},
|
|
5779
5779
|
`${id}-sec-vaxis-${i}`
|
|
5780
5780
|
)
|
|
@@ -5798,7 +5798,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5798
5798
|
);
|
|
5799
5799
|
}
|
|
5800
5800
|
if (hasDisplayUnits) {
|
|
5801
|
-
const unitLabel =
|
|
5801
|
+
const unitLabel = chunkYBTRSG74_js.getDisplayUnitLabel(
|
|
5802
5802
|
axisFormatting.displayUnits,
|
|
5803
5803
|
axisFormatting.displayUnitsLabel
|
|
5804
5804
|
);
|
|
@@ -5829,7 +5829,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
5829
5829
|
const ticks = [];
|
|
5830
5830
|
for (let i = 0; i <= steps; i++) {
|
|
5831
5831
|
const val = range.min + range.span * i / steps;
|
|
5832
|
-
const y =
|
|
5832
|
+
const y = chunkYBTRSG74_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5833
5833
|
ticks.push(
|
|
5834
5834
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5835
5835
|
"line",
|
|
@@ -5856,7 +5856,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
5856
5856
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
5857
5857
|
for (let i = 0; i <= steps; i++) {
|
|
5858
5858
|
const val = range.min + range.span * i / steps;
|
|
5859
|
-
const y =
|
|
5859
|
+
const y = chunkYBTRSG74_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5860
5860
|
lines.push(
|
|
5861
5861
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5862
5862
|
"line",
|
|
@@ -6018,7 +6018,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6018
6018
|
width: 8,
|
|
6019
6019
|
height: 8,
|
|
6020
6020
|
borderRadius: 2,
|
|
6021
|
-
backgroundColor:
|
|
6021
|
+
backgroundColor: chunkYBTRSG74_js.seriesColor(
|
|
6022
6022
|
s,
|
|
6023
6023
|
si,
|
|
6024
6024
|
chartData.style?.styleId,
|
|
@@ -6056,10 +6056,10 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6056
6056
|
}
|
|
6057
6057
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
6058
6058
|
const style = chartData.style;
|
|
6059
|
-
const areaFill =
|
|
6059
|
+
const areaFill = chunkYBTRSG74_js.chartAreaFill(chartData);
|
|
6060
6060
|
const legendPos = style?.legendPosition || "b";
|
|
6061
|
-
const range =
|
|
6062
|
-
const layout =
|
|
6061
|
+
const range = chunkYBTRSG74_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6062
|
+
const layout = chunkYBTRSG74_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6063
6063
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6064
6064
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
6065
6065
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -6080,10 +6080,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6080
6080
|
const close = closeSeries.values[ci] ?? high;
|
|
6081
6081
|
const isUp = close >= open;
|
|
6082
6082
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
6083
|
-
const highY =
|
|
6084
|
-
const lowY =
|
|
6085
|
-
const openY =
|
|
6086
|
-
const closeY =
|
|
6083
|
+
const highY = chunkYBTRSG74_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
6084
|
+
const lowY = chunkYBTRSG74_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
6085
|
+
const openY = chunkYBTRSG74_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
6086
|
+
const closeY = chunkYBTRSG74_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
|
|
6087
6087
|
elements.push(
|
|
6088
6088
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6089
6089
|
"line",
|
|
@@ -6126,7 +6126,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6126
6126
|
textAnchor: "middle",
|
|
6127
6127
|
fontSize: 7,
|
|
6128
6128
|
fill: "#334155",
|
|
6129
|
-
children:
|
|
6129
|
+
children: chunkYBTRSG74_js.formatAxisValue(close)
|
|
6130
6130
|
},
|
|
6131
6131
|
`${element.id}-stock-dl-${ci}`
|
|
6132
6132
|
)
|
|
@@ -6168,7 +6168,7 @@ function FailedToLoad() {
|
|
|
6168
6168
|
var LazySurfaceChart3DScene = React6__default.default.lazy(
|
|
6169
6169
|
async () => {
|
|
6170
6170
|
try {
|
|
6171
|
-
return await import('./SurfaceChart3DScene-
|
|
6171
|
+
return await import('./SurfaceChart3DScene-WOLVZOW3.js');
|
|
6172
6172
|
} catch {
|
|
6173
6173
|
return { default: FailedToLoad };
|
|
6174
6174
|
}
|
|
@@ -6192,7 +6192,7 @@ var SurfaceChart3DErrorBoundary = class extends React6__default.default.Componen
|
|
|
6192
6192
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
6193
6193
|
const rows = chartData.series.length;
|
|
6194
6194
|
const cols = Math.max(categoryLabels.length, 1);
|
|
6195
|
-
const range =
|
|
6195
|
+
const range = chunkYBTRSG74_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6196
6196
|
const heightMap = new Float32Array(rows * cols);
|
|
6197
6197
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
6198
6198
|
for (let r = 0; r < rows; r++) {
|
|
@@ -6311,10 +6311,10 @@ function darkenRgb(r, g, b, factor) {
|
|
|
6311
6311
|
}
|
|
6312
6312
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
6313
6313
|
const style = chartData.style;
|
|
6314
|
-
const areaFill =
|
|
6314
|
+
const areaFill = chunkYBTRSG74_js.chartAreaFill(chartData);
|
|
6315
6315
|
const legendPos = style?.legendPosition || "b";
|
|
6316
|
-
const layout =
|
|
6317
|
-
const range =
|
|
6316
|
+
const layout = chunkYBTRSG74_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6317
|
+
const range = chunkYBTRSG74_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6318
6318
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6319
6319
|
const seriesCount = chartData.series.length;
|
|
6320
6320
|
const cols = catCount - 1;
|
|
@@ -6403,10 +6403,10 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6403
6403
|
}
|
|
6404
6404
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
6405
6405
|
const style = chartData.style;
|
|
6406
|
-
const areaFill =
|
|
6406
|
+
const areaFill = chunkYBTRSG74_js.chartAreaFill(chartData);
|
|
6407
6407
|
const legendPos = style?.legendPosition || "b";
|
|
6408
|
-
const layout =
|
|
6409
|
-
const range =
|
|
6408
|
+
const layout = chunkYBTRSG74_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6409
|
+
const range = chunkYBTRSG74_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6410
6410
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6411
6411
|
const seriesCount = chartData.series.length;
|
|
6412
6412
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -6468,9 +6468,9 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6468
6468
|
}
|
|
6469
6469
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
6470
6470
|
const style = chartData.style;
|
|
6471
|
-
const areaFill =
|
|
6471
|
+
const areaFill = chunkYBTRSG74_js.chartAreaFill(chartData);
|
|
6472
6472
|
const legendPos = style?.legendPosition || "b";
|
|
6473
|
-
const layout =
|
|
6473
|
+
const layout = chunkYBTRSG74_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6474
6474
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
6475
6475
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
6476
6476
|
const rects = [];
|
|
@@ -6493,7 +6493,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
6493
6493
|
y: curY,
|
|
6494
6494
|
width: Math.max(w - 1, 1),
|
|
6495
6495
|
height: Math.max(h - 1, 1),
|
|
6496
|
-
fill:
|
|
6496
|
+
fill: chunkYBTRSG74_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
6497
6497
|
rx: 2,
|
|
6498
6498
|
opacity: 0.85
|
|
6499
6499
|
},
|
|
@@ -6544,11 +6544,11 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
6544
6544
|
}
|
|
6545
6545
|
function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
6546
6546
|
const style = chartData.style;
|
|
6547
|
-
const areaFill =
|
|
6547
|
+
const areaFill = chunkYBTRSG74_js.chartAreaFill(chartData);
|
|
6548
6548
|
const legendPos = style?.legendPosition || "b";
|
|
6549
6549
|
const values = chartData.series[0]?.values ?? [];
|
|
6550
|
-
const range =
|
|
6551
|
-
const layout =
|
|
6550
|
+
const range = chunkYBTRSG74_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6551
|
+
const layout = chunkYBTRSG74_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6552
6552
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
6553
6553
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
6554
6554
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -6559,8 +6559,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6559
6559
|
const isLast = i === values.length - 1;
|
|
6560
6560
|
const startVal = isLast ? 0 : runningTotal;
|
|
6561
6561
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
6562
|
-
const barStartY =
|
|
6563
|
-
const barEndY =
|
|
6562
|
+
const barStartY = chunkYBTRSG74_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
6563
|
+
const barEndY = chunkYBTRSG74_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
|
|
6564
6564
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
6565
6565
|
const y = Math.min(barStartY, barEndY);
|
|
6566
6566
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -6589,7 +6589,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6589
6589
|
textAnchor: "middle",
|
|
6590
6590
|
fontSize: 7,
|
|
6591
6591
|
fill: "#334155",
|
|
6592
|
-
children:
|
|
6592
|
+
children: chunkYBTRSG74_js.formatAxisValue(isLast ? endVal : val)
|
|
6593
6593
|
},
|
|
6594
6594
|
`${element.id}-wf-dl-${i}`
|
|
6595
6595
|
)
|
|
@@ -6636,20 +6636,20 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6636
6636
|
}
|
|
6637
6637
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
6638
6638
|
const style = chartData.style;
|
|
6639
|
-
const areaFill =
|
|
6639
|
+
const areaFill = chunkYBTRSG74_js.chartAreaFill(chartData);
|
|
6640
6640
|
const legendPos = style?.legendPosition || "b";
|
|
6641
|
-
const layoutOpts =
|
|
6641
|
+
const layoutOpts = chunkYBTRSG74_js.computeLayoutOptions(
|
|
6642
6642
|
chartData.axes,
|
|
6643
6643
|
chartData.dataTable,
|
|
6644
6644
|
chartData.series.length
|
|
6645
6645
|
);
|
|
6646
|
-
const layout =
|
|
6647
|
-
const { primary, secondary } =
|
|
6646
|
+
const layout = chunkYBTRSG74_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
6647
|
+
const { primary, secondary } = chunkYBTRSG74_js.splitSeriesByAxis(chartData.series, chartData.axes);
|
|
6648
6648
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
6649
6649
|
const secondarySeries = secondary.map((e) => e.series);
|
|
6650
|
-
const range =
|
|
6651
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
6652
|
-
const secondaryAxisFmt =
|
|
6650
|
+
const range = chunkYBTRSG74_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
6651
|
+
const secondaryRange = secondarySeries.length > 0 ? chunkYBTRSG74_js.computeValueRange(secondarySeries) : void 0;
|
|
6652
|
+
const secondaryAxisFmt = chunkYBTRSG74_js.getSecondaryValueAxis(chartData.axes);
|
|
6653
6653
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6654
6654
|
const barSeriesCount = 1;
|
|
6655
6655
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -6665,8 +6665,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6665
6665
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
6666
6666
|
barSeries.values.forEach((val, vi) => {
|
|
6667
6667
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
6668
|
-
const zeroY =
|
|
6669
|
-
const valY =
|
|
6668
|
+
const zeroY = chunkYBTRSG74_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
6669
|
+
const valY = chunkYBTRSG74_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
|
|
6670
6670
|
const y = Math.min(zeroY, valY);
|
|
6671
6671
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
6672
6672
|
barElements.push(
|
|
@@ -6677,7 +6677,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6677
6677
|
y,
|
|
6678
6678
|
width: barWidth,
|
|
6679
6679
|
height: h,
|
|
6680
|
-
fill:
|
|
6680
|
+
fill: chunkYBTRSG74_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
6681
6681
|
rx: 1
|
|
6682
6682
|
},
|
|
6683
6683
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -6693,7 +6693,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6693
6693
|
textAnchor: "middle",
|
|
6694
6694
|
fontSize: 7,
|
|
6695
6695
|
fill: "#334155",
|
|
6696
|
-
children:
|
|
6696
|
+
children: chunkYBTRSG74_js.formatAxisValue(val)
|
|
6697
6697
|
},
|
|
6698
6698
|
`${element.id}-combo-bar-dl-${vi}`
|
|
6699
6699
|
)
|
|
@@ -6710,10 +6710,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6710
6710
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
6711
6711
|
const points = series.values.map((val, vi) => {
|
|
6712
6712
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
6713
|
-
const y =
|
|
6713
|
+
const y = chunkYBTRSG74_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
6714
6714
|
return { x, y, val };
|
|
6715
6715
|
});
|
|
6716
|
-
const c =
|
|
6716
|
+
const c = chunkYBTRSG74_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
6717
6717
|
lineElements.push(
|
|
6718
6718
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6719
6719
|
"polyline",
|
|
@@ -6740,7 +6740,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6740
6740
|
textAnchor: "middle",
|
|
6741
6741
|
fontSize: 7,
|
|
6742
6742
|
fill: "#334155",
|
|
6743
|
-
children:
|
|
6743
|
+
children: chunkYBTRSG74_js.formatAxisValue(p.val)
|
|
6744
6744
|
},
|
|
6745
6745
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
6746
6746
|
)
|
|
@@ -7886,14 +7886,14 @@ function buildNotesPdf(pages) {
|
|
|
7886
7886
|
notes: page.notes,
|
|
7887
7887
|
slideNumber: page.slideNumber
|
|
7888
7888
|
}));
|
|
7889
|
-
const bytes =
|
|
7889
|
+
const bytes = chunkYBTRSG74_js.buildNotesPdfBytes(images, meta);
|
|
7890
7890
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
7891
7891
|
return URL.createObjectURL(blob);
|
|
7892
7892
|
}
|
|
7893
7893
|
|
|
7894
7894
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
7895
7895
|
function buildPdfFromImageData(images) {
|
|
7896
|
-
const bytes =
|
|
7896
|
+
const bytes = chunkYBTRSG74_js.buildSlidesPdfBytes(images);
|
|
7897
7897
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
7898
7898
|
return URL.createObjectURL(blob);
|
|
7899
7899
|
}
|
|
@@ -7902,7 +7902,7 @@ function buildPdfFromImageData(images) {
|
|
|
7902
7902
|
var activePreview = null;
|
|
7903
7903
|
function startPreviewAnimation(elementId, preset, options) {
|
|
7904
7904
|
stopPreviewAnimation();
|
|
7905
|
-
const descriptor =
|
|
7905
|
+
const descriptor = chunkYBTRSG74_js.buildPreviewAnimation(preset, options);
|
|
7906
7906
|
if (!descriptor) {
|
|
7907
7907
|
return;
|
|
7908
7908
|
}
|
|
@@ -7915,7 +7915,7 @@ function startMotionPathPreview(elementId, path, options) {
|
|
|
7915
7915
|
return;
|
|
7916
7916
|
}
|
|
7917
7917
|
const stage = domEl.offsetParent;
|
|
7918
|
-
const descriptor =
|
|
7918
|
+
const descriptor = chunkYBTRSG74_js.buildMotionPathPreview({
|
|
7919
7919
|
path,
|
|
7920
7920
|
slideWidth: stage?.offsetWidth || DEFAULT_PREVIEW_SLIDE_WIDTH,
|
|
7921
7921
|
slideHeight: stage?.offsetHeight || DEFAULT_PREVIEW_SLIDE_HEIGHT,
|