pptx-react-viewer 2.5.3 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/{AiChatPanel-DPMHPOWF.js → AiChatPanel-53W2JG6G.js} +22 -22
- package/dist/AiChatPanel-53W2JG6G.js.br +0 -0
- package/dist/AiChatPanel-53W2JG6G.js.gz +0 -0
- package/dist/{AiChatPanel-OFOOWR4U.mjs → AiChatPanel-L5IOO72H.mjs} +3 -3
- package/dist/AiChatPanel-L5IOO72H.mjs.br +0 -0
- package/dist/AiChatPanel-L5IOO72H.mjs.gz +0 -0
- package/dist/{Model3DScene-PD2MDBIE.js → Model3DScene-E7JGXNJN.js} +2 -2
- package/dist/Model3DScene-E7JGXNJN.js.br +0 -0
- package/dist/Model3DScene-E7JGXNJN.js.gz +0 -0
- package/dist/{Model3DScene-P4OKVQBF.mjs → Model3DScene-EW7OWRJK.mjs} +1 -1
- package/dist/Model3DScene-EW7OWRJK.mjs.br +0 -0
- package/dist/Model3DScene-EW7OWRJK.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-FECS3THE.js → SurfaceChart3DScene-3QB6NVKD.js} +2 -2
- package/dist/SurfaceChart3DScene-3QB6NVKD.js.br +0 -0
- package/dist/SurfaceChart3DScene-3QB6NVKD.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-TL4ZIOI4.mjs → SurfaceChart3DScene-64HI3U7Y.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-TL4ZIOI4.mjs.br → SurfaceChart3DScene-64HI3U7Y.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-64HI3U7Y.mjs.gz +0 -0
- package/dist/{chunk-6KOM27PS.mjs → chunk-34ZW32XK.mjs} +902 -52
- package/dist/chunk-34ZW32XK.mjs.br +0 -0
- package/dist/chunk-34ZW32XK.mjs.gz +0 -0
- package/dist/{chunk-QDIF3ZXF.mjs → chunk-DWQJW3UM.mjs} +19 -4
- package/dist/chunk-DWQJW3UM.mjs.br +0 -0
- package/dist/chunk-DWQJW3UM.mjs.gz +0 -0
- package/dist/{chunk-UUS7QT22.js → chunk-EJ24IFPL.js} +346 -315
- package/dist/chunk-EJ24IFPL.js.br +0 -0
- package/dist/chunk-EJ24IFPL.js.gz +0 -0
- package/dist/{chunk-FFLUALX5.js → chunk-NXSAYLYI.js} +251 -236
- package/dist/chunk-NXSAYLYI.js.br +0 -0
- package/dist/chunk-NXSAYLYI.js.gz +0 -0
- package/dist/{chunk-SAXG53MO.mjs → chunk-PENV7S7Z.mjs} +1 -1
- package/dist/chunk-PENV7S7Z.mjs.br +0 -0
- package/dist/chunk-PENV7S7Z.mjs.gz +0 -0
- package/dist/{chunk-F3JUUSC4.mjs → chunk-UO55N46T.mjs} +91 -13
- package/dist/chunk-UO55N46T.mjs.br +0 -0
- package/dist/chunk-UO55N46T.mjs.gz +0 -0
- package/dist/{chunk-23Q3I2LM.js → chunk-UVA55CRK.js} +904 -51
- package/dist/chunk-UVA55CRK.js.br +0 -0
- package/dist/chunk-UVA55CRK.js.gz +0 -0
- package/dist/{chunk-USHZUHHG.js → chunk-V5XVTKFS.js} +925 -847
- package/dist/chunk-V5XVTKFS.js.br +0 -0
- package/dist/chunk-V5XVTKFS.js.gz +0 -0
- package/dist/{chunk-H2FZ2NJ7.js → chunk-VBWWICDF.js} +3 -3
- package/dist/chunk-VBWWICDF.js.br +0 -0
- package/dist/chunk-VBWWICDF.js.gz +0 -0
- package/dist/{chunk-ZZA62IND.mjs → chunk-WCO3NEH5.mjs} +35 -4
- package/dist/chunk-WCO3NEH5.mjs.br +0 -0
- package/dist/chunk-WCO3NEH5.mjs.gz +0 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +34 -34
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +42 -0
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +78 -78
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +3 -3
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/viewer/index.d.ts +15 -0
- package/dist/viewer/index.js +21 -21
- 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-DPMHPOWF.js.br +0 -0
- package/dist/AiChatPanel-DPMHPOWF.js.gz +0 -0
- package/dist/AiChatPanel-OFOOWR4U.mjs.br +0 -0
- package/dist/AiChatPanel-OFOOWR4U.mjs.gz +0 -0
- package/dist/Model3DScene-P4OKVQBF.mjs.br +0 -0
- package/dist/Model3DScene-P4OKVQBF.mjs.gz +0 -0
- package/dist/Model3DScene-PD2MDBIE.js.br +0 -0
- package/dist/Model3DScene-PD2MDBIE.js.gz +0 -0
- package/dist/SurfaceChart3DScene-FECS3THE.js.br +0 -0
- package/dist/SurfaceChart3DScene-FECS3THE.js.gz +0 -0
- package/dist/SurfaceChart3DScene-TL4ZIOI4.mjs.gz +0 -0
- package/dist/chunk-23Q3I2LM.js.br +0 -0
- package/dist/chunk-23Q3I2LM.js.gz +0 -0
- package/dist/chunk-6KOM27PS.mjs.br +0 -0
- package/dist/chunk-6KOM27PS.mjs.gz +0 -0
- package/dist/chunk-F3JUUSC4.mjs.br +0 -0
- package/dist/chunk-F3JUUSC4.mjs.gz +0 -0
- package/dist/chunk-FFLUALX5.js.br +0 -0
- package/dist/chunk-FFLUALX5.js.gz +0 -0
- package/dist/chunk-H2FZ2NJ7.js.br +0 -0
- package/dist/chunk-H2FZ2NJ7.js.gz +0 -0
- package/dist/chunk-QDIF3ZXF.mjs.br +0 -0
- package/dist/chunk-QDIF3ZXF.mjs.gz +0 -0
- package/dist/chunk-SAXG53MO.mjs.br +0 -0
- package/dist/chunk-SAXG53MO.mjs.gz +0 -0
- package/dist/chunk-USHZUHHG.js.br +0 -0
- package/dist/chunk-USHZUHHG.js.gz +0 -0
- package/dist/chunk-UUS7QT22.js.br +0 -0
- package/dist/chunk-UUS7QT22.js.gz +0 -0
- package/dist/chunk-ZZA62IND.mjs.br +0 -0
- package/dist/chunk-ZZA62IND.mjs.gz +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunk25VSL2BB_js = require('./chunk-25VSL2BB.js');
|
|
4
|
-
var
|
|
4
|
+
var chunkUVA55CRK_js = require('./chunk-UVA55CRK.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 chunkUVA55CRK_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 chunkUVA55CRK_js.cloneHistorySnapshot(snapshot);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
// src/viewer/constants/scalar.ts
|
|
@@ -133,7 +133,7 @@ var GLYPH_COMPONENTS = {
|
|
|
133
133
|
plus: lu.LuPlus,
|
|
134
134
|
triangle: lu.LuTriangle
|
|
135
135
|
};
|
|
136
|
-
var SHAPE_PRESETS =
|
|
136
|
+
var SHAPE_PRESETS = chunkUVA55CRK_js.SHAPE_PRESET_DEFS.map(
|
|
137
137
|
(def) => ({
|
|
138
138
|
type: def.type,
|
|
139
139
|
label: def.label,
|
|
@@ -251,7 +251,7 @@ function isConnectorOrLineElement(element) {
|
|
|
251
251
|
if (element.type === "connector") {
|
|
252
252
|
return true;
|
|
253
253
|
}
|
|
254
|
-
if (!
|
|
254
|
+
if (!chunkUVA55CRK_js.hasShapeProperties(element)) {
|
|
255
255
|
return false;
|
|
256
256
|
}
|
|
257
257
|
const st = getShapeType(element.shapeType);
|
|
@@ -262,12 +262,12 @@ function isConnectorOrLineElement(element) {
|
|
|
262
262
|
function partitionTemplateElements(slides) {
|
|
263
263
|
const templateElementsBySlideId = {};
|
|
264
264
|
const nextSlides = slides.map((slide) => {
|
|
265
|
-
const template = slide.elements.filter((el) =>
|
|
265
|
+
const template = slide.elements.filter((el) => chunkUVA55CRK_js.isTemplateElement(el));
|
|
266
266
|
if (template.length === 0) {
|
|
267
267
|
return slide;
|
|
268
268
|
}
|
|
269
269
|
templateElementsBySlideId[slide.id] = template;
|
|
270
|
-
return { ...slide, elements: slide.elements.filter((el) => !
|
|
270
|
+
return { ...slide, elements: slide.elements.filter((el) => !chunkUVA55CRK_js.isTemplateElement(el)) };
|
|
271
271
|
});
|
|
272
272
|
return { slides: nextSlides, templateElementsBySlideId };
|
|
273
273
|
}
|
|
@@ -283,7 +283,7 @@ function buildSaveSlides(slides, templateElementsBySlideId) {
|
|
|
283
283
|
|
|
284
284
|
// src/viewer/utils/image-style.ts
|
|
285
285
|
function getImageMaskStyle(element) {
|
|
286
|
-
if (!
|
|
286
|
+
if (!chunkUVA55CRK_js.hasShapeProperties(element)) {
|
|
287
287
|
return void 0;
|
|
288
288
|
}
|
|
289
289
|
const shapeType = element.shapeType;
|
|
@@ -292,7 +292,7 @@ function getImageMaskStyle(element) {
|
|
|
292
292
|
}
|
|
293
293
|
const normalized = shapeType.toLowerCase();
|
|
294
294
|
if (normalized === "roundrect" || normalized === "round1rect" || normalized === "round2samerect" || normalized === "round2diagrect" || normalized === "sniproundrect" || normalized === "snip1rect" || normalized === "snip2diagrect") {
|
|
295
|
-
const radiusPx =
|
|
295
|
+
const radiusPx = chunkUVA55CRK_js.getRoundRectRadiusPx(element);
|
|
296
296
|
if (radiusPx <= 0.01) {
|
|
297
297
|
return void 0;
|
|
298
298
|
}
|
|
@@ -304,7 +304,7 @@ function getImageMaskStyle(element) {
|
|
|
304
304
|
if (normalized === "can" || normalized === "cylinder") {
|
|
305
305
|
return { borderRadius: "48% / 12%" };
|
|
306
306
|
}
|
|
307
|
-
const clipPath =
|
|
307
|
+
const clipPath = chunkUVA55CRK_js.getResolvedShapeClipPath(element);
|
|
308
308
|
if (!clipPath) {
|
|
309
309
|
return void 0;
|
|
310
310
|
}
|
|
@@ -312,7 +312,7 @@ function getImageMaskStyle(element) {
|
|
|
312
312
|
}
|
|
313
313
|
function getImageRenderStyle(element) {
|
|
314
314
|
const maskStyle = getImageMaskStyle(element) || {};
|
|
315
|
-
if (!
|
|
315
|
+
if (!chunkUVA55CRK_js.isImageLikeElement(element)) {
|
|
316
316
|
return {
|
|
317
317
|
...maskStyle,
|
|
318
318
|
width: "100%",
|
|
@@ -320,10 +320,10 @@ function getImageRenderStyle(element) {
|
|
|
320
320
|
objectFit: "cover"
|
|
321
321
|
};
|
|
322
322
|
}
|
|
323
|
-
const cropLeft =
|
|
324
|
-
const cropTop =
|
|
325
|
-
const cropRight =
|
|
326
|
-
const cropBottom =
|
|
323
|
+
const cropLeft = chunkUVA55CRK_js.clampCropValue(element.cropLeft);
|
|
324
|
+
const cropTop = chunkUVA55CRK_js.clampCropValue(element.cropTop);
|
|
325
|
+
const cropRight = chunkUVA55CRK_js.clampCropValue(element.cropRight);
|
|
326
|
+
const cropBottom = chunkUVA55CRK_js.clampCropValue(element.cropBottom);
|
|
327
327
|
const hasCrop = cropLeft + cropRight > 1e-4 || cropTop + cropBottom > 1e-4;
|
|
328
328
|
if (!hasCrop) {
|
|
329
329
|
return {
|
|
@@ -335,10 +335,10 @@ function getImageRenderStyle(element) {
|
|
|
335
335
|
}
|
|
336
336
|
const safeHorizontalScale = cropLeft + cropRight >= 0.99 ? 0.99 / (cropLeft + cropRight) : 1;
|
|
337
337
|
const safeVerticalScale = cropTop + cropBottom >= 0.99 ? 0.99 / (cropTop + cropBottom) : 1;
|
|
338
|
-
const normalizedLeft =
|
|
339
|
-
const normalizedRight =
|
|
340
|
-
const normalizedTop =
|
|
341
|
-
const normalizedBottom =
|
|
338
|
+
const normalizedLeft = chunkUVA55CRK_js.clampCropValue(cropLeft * safeHorizontalScale);
|
|
339
|
+
const normalizedRight = chunkUVA55CRK_js.clampCropValue(cropRight * safeHorizontalScale);
|
|
340
|
+
const normalizedTop = chunkUVA55CRK_js.clampCropValue(cropTop * safeVerticalScale);
|
|
341
|
+
const normalizedBottom = chunkUVA55CRK_js.clampCropValue(cropBottom * safeVerticalScale);
|
|
342
342
|
const remainingWidth = Math.max(0.01, 1 - normalizedLeft - normalizedRight);
|
|
343
343
|
const remainingHeight = Math.max(0.01, 1 - normalizedTop - normalizedBottom);
|
|
344
344
|
const tx = Math.round(-normalizedLeft / remainingWidth * 1e4) / 100;
|
|
@@ -367,7 +367,7 @@ var CROP_SHAPE_CLIP_PATHS = {
|
|
|
367
367
|
star: "polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)"
|
|
368
368
|
};
|
|
369
369
|
function getCropShapeClipPath(element) {
|
|
370
|
-
if (!
|
|
370
|
+
if (!chunkUVA55CRK_js.isImageLikeElement(element)) {
|
|
371
371
|
return void 0;
|
|
372
372
|
}
|
|
373
373
|
const shape = element.cropShape;
|
|
@@ -377,7 +377,7 @@ function getCropShapeClipPath(element) {
|
|
|
377
377
|
return CROP_SHAPE_CLIP_PATHS[shape];
|
|
378
378
|
}
|
|
379
379
|
function isImageTiled(element) {
|
|
380
|
-
if (!
|
|
380
|
+
if (!chunkUVA55CRK_js.isImageLikeElement(element)) {
|
|
381
381
|
return false;
|
|
382
382
|
}
|
|
383
383
|
return typeof element.tileScaleX === "number" || typeof element.tileScaleY === "number";
|
|
@@ -435,7 +435,7 @@ function buildMirrorTiledBackground(src, flip, scaleX, scaleY) {
|
|
|
435
435
|
};
|
|
436
436
|
}
|
|
437
437
|
function getImageTilingStyle(element) {
|
|
438
|
-
if (!
|
|
438
|
+
if (!chunkUVA55CRK_js.isImageLikeElement(element) || !isImageTiled(element)) {
|
|
439
439
|
return void 0;
|
|
440
440
|
}
|
|
441
441
|
const scaleX = typeof element.tileScaleX === "number" ? element.tileScaleX * 100 : 100;
|
|
@@ -719,7 +719,7 @@ function executeMediaCommand(command) {
|
|
|
719
719
|
if (!el) {
|
|
720
720
|
return false;
|
|
721
721
|
}
|
|
722
|
-
const parsed =
|
|
722
|
+
const parsed = chunkUVA55CRK_js.parseMediaCommand(command.command);
|
|
723
723
|
if (!parsed) {
|
|
724
724
|
return false;
|
|
725
725
|
}
|
|
@@ -1171,7 +1171,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1171
1171
|
|
|
1172
1172
|
// src/viewer/utils/text-utils.tsx
|
|
1173
1173
|
function getTextStyleForElement(element, fallbackColor) {
|
|
1174
|
-
if (!
|
|
1174
|
+
if (!chunkUVA55CRK_js.hasTextProperties(element)) {
|
|
1175
1175
|
return { color: fallbackColor };
|
|
1176
1176
|
}
|
|
1177
1177
|
const textDecorationTokens = [];
|
|
@@ -1185,20 +1185,20 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
1185
1185
|
const textDecorationStyle = isDoubleStrike ? "double" : void 0;
|
|
1186
1186
|
const hasItalicRuns = element.textStyle?.italic || Boolean(element.textSegments?.some((segment) => segment.style?.italic));
|
|
1187
1187
|
const isRtl = element.textStyle?.rtl === true;
|
|
1188
|
-
const resolvedTextColor = element.textStyle?.hyperlink ?
|
|
1188
|
+
const resolvedTextColor = element.textStyle?.hyperlink ? chunkUVA55CRK_js.normalizeHexColor(element.textStyle?.color, HYPERLINK_COLOR) : chunkUVA55CRK_js.normalizeHexColor(element.textStyle?.color, fallbackColor);
|
|
1189
1189
|
const bodyTop = element.textStyle?.bodyInsetTop ?? DEFAULT_BODY_INSET_TB_PX;
|
|
1190
1190
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
1191
1191
|
const bodyLeft = element.textStyle?.bodyInsetLeft ?? DEFAULT_BODY_INSET_LR_PX;
|
|
1192
1192
|
const bodyRight = element.textStyle?.bodyInsetRight ?? DEFAULT_BODY_INSET_LR_PX;
|
|
1193
|
-
const writingMode =
|
|
1194
|
-
const textOrientation =
|
|
1195
|
-
const verticalDirection =
|
|
1193
|
+
const writingMode = chunkUVA55CRK_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
1194
|
+
const textOrientation = chunkUVA55CRK_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
1195
|
+
const verticalDirection = chunkUVA55CRK_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
1196
1196
|
const resolvedDirection = verticalDirection || (isRtl ? "rtl" : "ltr");
|
|
1197
1197
|
const resolvedUnicodeBidi = isRtl ? "plaintext" : void 0;
|
|
1198
1198
|
const hasSegments = (element.textSegments?.length ?? 0) > 0;
|
|
1199
1199
|
return {
|
|
1200
1200
|
color: resolvedTextColor,
|
|
1201
|
-
backgroundColor: !hasSegments && element.textStyle?.highlightColor ?
|
|
1201
|
+
backgroundColor: !hasSegments && element.textStyle?.highlightColor ? chunkUVA55CRK_js.normalizeHexColor(element.textStyle.highlightColor, void 0) : void 0,
|
|
1202
1202
|
textAlign: (() => {
|
|
1203
1203
|
const a = element.textStyle?.align;
|
|
1204
1204
|
if (a === "justLow" || a === "dist" || a === "thaiDist") {
|
|
@@ -1214,7 +1214,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
1214
1214
|
textDecorationLine: textDecorationTokens.length > 0 ? textDecorationTokens.join(" ") : "none",
|
|
1215
1215
|
textDecorationStyle,
|
|
1216
1216
|
fontFamily: element.textStyle?.fontFamily || DEFAULT_FONT_FAMILY,
|
|
1217
|
-
lineHeight:
|
|
1217
|
+
lineHeight: chunkUVA55CRK_js.resolveLineHeight(element.textStyle, hasItalicRuns),
|
|
1218
1218
|
paddingTop: bodyTop + (hasItalicRuns ? 1 : 0),
|
|
1219
1219
|
paddingBottom: bodyBottom + (hasItalicRuns ? 1 : 0),
|
|
1220
1220
|
paddingLeft: bodyLeft + (element.textStyle?.paragraphMarginLeft || 0),
|
|
@@ -1227,7 +1227,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
1227
1227
|
// Auto-fit: use OOXML-provided fontScale/lnSpcReduction when available,
|
|
1228
1228
|
// otherwise fall back to heuristic estimation. The pure font-scale maths
|
|
1229
1229
|
// now lives in pptx-viewer-shared (computeAutoFitTextStyle).
|
|
1230
|
-
...
|
|
1230
|
+
...chunkUVA55CRK_js.computeAutoFitTextStyle({
|
|
1231
1231
|
textStyle: element.textStyle,
|
|
1232
1232
|
text: element.text ?? "",
|
|
1233
1233
|
width: element.width,
|
|
@@ -1261,13 +1261,13 @@ function computeTabSize(tabStops, defaultTabSize) {
|
|
|
1261
1261
|
return avgGap > 0 ? `${Math.round(avgGap)}px` : fromDefault;
|
|
1262
1262
|
}
|
|
1263
1263
|
function getTextLayoutStyle(element) {
|
|
1264
|
-
if (!
|
|
1264
|
+
if (!chunkUVA55CRK_js.hasTextProperties(element)) {
|
|
1265
1265
|
return {};
|
|
1266
1266
|
}
|
|
1267
1267
|
const verticalAlign = element.textStyle?.vAlign || "top";
|
|
1268
|
-
const writingMode =
|
|
1269
|
-
const textOrientation =
|
|
1270
|
-
const verticalDirection =
|
|
1268
|
+
const writingMode = chunkUVA55CRK_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
1269
|
+
const textOrientation = chunkUVA55CRK_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
1270
|
+
const verticalDirection = chunkUVA55CRK_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
1271
1271
|
const parsedColumnCount = Number(element.textStyle?.columnCount);
|
|
1272
1272
|
const columnCount = Number.isFinite(parsedColumnCount) ? Math.max(1, Math.min(16, Math.round(parsedColumnCount))) : 1;
|
|
1273
1273
|
const hasColumns = columnCount > 1;
|
|
@@ -1275,7 +1275,7 @@ function getTextLayoutStyle(element) {
|
|
|
1275
1275
|
const tabStops = element.textStyle?.tabStops;
|
|
1276
1276
|
const tabSize = computeTabSize(tabStops, element.textStyle?.defaultTabSize);
|
|
1277
1277
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
1278
|
-
const hasParagraphIndents =
|
|
1278
|
+
const hasParagraphIndents = chunkUVA55CRK_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
1279
1279
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
1280
1280
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
1281
1281
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
@@ -1284,7 +1284,7 @@ function getTextLayoutStyle(element) {
|
|
|
1284
1284
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
1285
1285
|
const parsedColumnSpacing = Number(element.textStyle?.columnSpacing);
|
|
1286
1286
|
const columnGap = Number.isFinite(parsedColumnSpacing) && parsedColumnSpacing > 0 ? `${parsedColumnSpacing}px` : "0.75em";
|
|
1287
|
-
const kinsokuStyles =
|
|
1287
|
+
const kinsokuStyles = chunkUVA55CRK_js.getKinsokuLineBreakStyles(element.textStyle);
|
|
1288
1288
|
if (hasColumns) {
|
|
1289
1289
|
return {
|
|
1290
1290
|
display: "block",
|
|
@@ -1331,10 +1331,10 @@ function getTextLayoutStyle(element) {
|
|
|
1331
1331
|
|
|
1332
1332
|
// src/viewer/utils/text-effects.tsx
|
|
1333
1333
|
function buildTextFillCss2(style) {
|
|
1334
|
-
return
|
|
1334
|
+
return chunkUVA55CRK_js.buildTextFillCss(style);
|
|
1335
1335
|
}
|
|
1336
1336
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
1337
|
-
return
|
|
1337
|
+
return chunkUVA55CRK_js.buildTextBody3DSceneStyle(textStyle);
|
|
1338
1338
|
}
|
|
1339
1339
|
|
|
1340
1340
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -1519,13 +1519,13 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1519
1519
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
1520
1520
|
return renderedSegments;
|
|
1521
1521
|
}
|
|
1522
|
-
const paraKey = `${elementId}${
|
|
1522
|
+
const paraKey = `${elementId}${chunkUVA55CRK_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
1523
1523
|
const paraState = subElementAnimStates.get(paraKey);
|
|
1524
1524
|
if (paraState) {
|
|
1525
1525
|
const style = buildAnimStyle(paraState);
|
|
1526
1526
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
1527
1527
|
}
|
|
1528
|
-
const spec =
|
|
1528
|
+
const spec = chunkUVA55CRK_js.buildTextBuildSpec(
|
|
1529
1529
|
elementId,
|
|
1530
1530
|
paraIndex,
|
|
1531
1531
|
paraSegments.map((entry) => ({ text: entry.segment.text, style: entry })),
|
|
@@ -1543,7 +1543,7 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1543
1543
|
"span",
|
|
1544
1544
|
{
|
|
1545
1545
|
"data-anim-id": span.animId,
|
|
1546
|
-
style:
|
|
1546
|
+
style: chunkUVA55CRK_js.textBuildSpanStyle(span),
|
|
1547
1547
|
children: content
|
|
1548
1548
|
},
|
|
1549
1549
|
span.animId
|
|
@@ -1687,10 +1687,10 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1687
1687
|
if (!needsScriptFonts || !text) {
|
|
1688
1688
|
return text;
|
|
1689
1689
|
}
|
|
1690
|
-
const runs =
|
|
1690
|
+
const runs = chunkUVA55CRK_js.segmentByScript(text);
|
|
1691
1691
|
if (runs.length <= 1) {
|
|
1692
1692
|
if (runs.length === 1) {
|
|
1693
|
-
const font =
|
|
1693
|
+
const font = chunkUVA55CRK_js.resolveFontForScript(runs[0].script, scriptFonts);
|
|
1694
1694
|
if (font && font !== baseFontFamily) {
|
|
1695
1695
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: text });
|
|
1696
1696
|
}
|
|
@@ -1698,7 +1698,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1698
1698
|
return text;
|
|
1699
1699
|
}
|
|
1700
1700
|
return runs.map((run, i) => {
|
|
1701
|
-
const font =
|
|
1701
|
+
const font = chunkUVA55CRK_js.resolveFontForScript(run.script, scriptFonts);
|
|
1702
1702
|
if (!font || font === baseFontFamily) {
|
|
1703
1703
|
return /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Fragment, { children: run.text }, `${keyPrefix}-r${i}`);
|
|
1704
1704
|
}
|
|
@@ -1770,8 +1770,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1770
1770
|
);
|
|
1771
1771
|
}
|
|
1772
1772
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
1773
|
-
const mathml =
|
|
1774
|
-
const safeMathml = mathml ?
|
|
1773
|
+
const mathml = chunkUVA55CRK_js.convertOmmlToMathMl(equationXml);
|
|
1774
|
+
const safeMathml = mathml ? chunkUVA55CRK_js.sanitizeMathMl(mathml) : "";
|
|
1775
1775
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1776
1776
|
"span",
|
|
1777
1777
|
{
|
|
@@ -1821,7 +1821,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1821
1821
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: equationContent }, `${elementId}-seg-${segmentIndex}`);
|
|
1822
1822
|
}
|
|
1823
1823
|
function renderPictureBullet(elementId, segmentIndex, bulletInfo, baseFontSize) {
|
|
1824
|
-
const picture =
|
|
1824
|
+
const picture = chunkUVA55CRK_js.resolvePictureBullet(bulletInfo, baseFontSize) ?? {
|
|
1825
1825
|
sizePx: baseFontSize,
|
|
1826
1826
|
fallbackMarker: "\u2022",
|
|
1827
1827
|
accessibleLabel: "Bullet"
|
|
@@ -1871,7 +1871,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1871
1871
|
);
|
|
1872
1872
|
}
|
|
1873
1873
|
const segmentStyle = segment.style || {};
|
|
1874
|
-
const textValue =
|
|
1874
|
+
const textValue = chunkUVA55CRK_js.substituteFieldText(segment.text || "", segment.fieldType, fieldContext);
|
|
1875
1875
|
const lines = textValue.split("\n");
|
|
1876
1876
|
const textDecorationTokens = [];
|
|
1877
1877
|
if (segmentStyle.underline || segmentStyle.hyperlink) {
|
|
@@ -1881,8 +1881,8 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1881
1881
|
textDecorationTokens.push("line-through");
|
|
1882
1882
|
}
|
|
1883
1883
|
const isDoubleStrike = segmentStyle.strikethrough && segmentStyle.strikeType === "dblStrike";
|
|
1884
|
-
const resolvedSegmentColor = segmentStyle.hyperlink ?
|
|
1885
|
-
const underlineDecoration =
|
|
1884
|
+
const resolvedSegmentColor = segmentStyle.hyperlink ? chunkUVA55CRK_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, HYPERLINK_COLOR) : chunkUVA55CRK_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, fallbackColor);
|
|
1885
|
+
const underlineDecoration = chunkUVA55CRK_js.resolveUnderlineDecorationStyle(
|
|
1886
1886
|
Boolean(isDoubleStrike),
|
|
1887
1887
|
segmentStyle.underlineStyle
|
|
1888
1888
|
);
|
|
@@ -1898,14 +1898,14 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1898
1898
|
const baseFontSizePt = baseFontSize * (72 / 96);
|
|
1899
1899
|
const fontKerning = typeof segmentStyle.kerning === "number" ? segmentStyle.kerning === 0 ? "none" : baseFontSizePt >= segmentStyle.kerning / 100 ? "normal" : "none" : void 0;
|
|
1900
1900
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
1901
|
-
const baseFontFamily = rawFontFamily ?
|
|
1901
|
+
const baseFontFamily = rawFontFamily ? chunkUVA55CRK_js.getSubstituteFontFamily(rawFontFamily) : DEFAULT_FONT_FAMILY;
|
|
1902
1902
|
const scriptFonts = {
|
|
1903
1903
|
latin: baseFontFamily,
|
|
1904
1904
|
eastAsia: segmentStyle.eastAsiaFont || element.textStyle?.eastAsiaFont || baseFontFamily,
|
|
1905
1905
|
complexScript: segmentStyle.complexScriptFont || element.textStyle?.complexScriptFont || baseFontFamily,
|
|
1906
1906
|
symbol: segmentStyle.symbolFont || element.textStyle?.symbolFont || baseFontFamily
|
|
1907
1907
|
};
|
|
1908
|
-
const needsScriptFonts =
|
|
1908
|
+
const needsScriptFonts = chunkUVA55CRK_js.hasDistinctScriptFonts(scriptFonts);
|
|
1909
1909
|
const spanStyle = {
|
|
1910
1910
|
color: resolvedSegmentColor,
|
|
1911
1911
|
fontSize: baseFontSize * baselineFontScale,
|
|
@@ -1923,15 +1923,15 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1923
1923
|
fontVariantCaps: segmentStyle.textCaps === "small" ? "small-caps" : void 0,
|
|
1924
1924
|
letterSpacing,
|
|
1925
1925
|
fontKerning,
|
|
1926
|
-
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ?
|
|
1926
|
+
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ? chunkUVA55CRK_js.normalizeHexColor(segmentStyle.highlightColor, "transparent") : void 0,
|
|
1927
1927
|
...textFillStyles,
|
|
1928
|
-
textDecorationColor: segmentStyle.underlineColor ?
|
|
1929
|
-
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${
|
|
1928
|
+
textDecorationColor: segmentStyle.underlineColor ? chunkUVA55CRK_js.normalizeHexColor(segmentStyle.underlineColor, void 0) : void 0,
|
|
1929
|
+
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${chunkUVA55CRK_js.normalizeHexColor(segmentStyle.textOutlineColor, "#000000")}` : segmentStyle.textOutlineWidth ? `${segmentStyle.textOutlineWidth}px currentColor` : void 0,
|
|
1930
1930
|
paintOrder: segmentStyle.textOutlineWidth ? "stroke fill" : void 0,
|
|
1931
|
-
textShadow:
|
|
1932
|
-
filter:
|
|
1933
|
-
opacity:
|
|
1934
|
-
WebkitBoxReflect:
|
|
1931
|
+
textShadow: chunkUVA55CRK_js.buildTextShadowCss(segmentStyle),
|
|
1932
|
+
filter: chunkUVA55CRK_js.buildTextRunFilterChain(segmentStyle),
|
|
1933
|
+
opacity: chunkUVA55CRK_js.getTextAlphaOpacity(segmentStyle),
|
|
1934
|
+
WebkitBoxReflect: chunkUVA55CRK_js.buildTextReflectionCss(segmentStyle)
|
|
1935
1935
|
};
|
|
1936
1936
|
const runRtl = segmentStyle.rtl;
|
|
1937
1937
|
if (runRtl !== void 0 && runRtl !== paragraphRtl) {
|
|
@@ -1951,7 +1951,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1951
1951
|
spanStyle.fontSize = baseFontSize * (bulletInfo.sizePercent / 100) * baselineFontScale;
|
|
1952
1952
|
}
|
|
1953
1953
|
if (bulletInfo.color) {
|
|
1954
|
-
spanStyle.color =
|
|
1954
|
+
spanStyle.color = chunkUVA55CRK_js.normalizeHexColor(bulletInfo.color, resolvedSegmentColor);
|
|
1955
1955
|
}
|
|
1956
1956
|
}
|
|
1957
1957
|
if (bulletInfo?.imageDataUrl || bulletInfo?.imageRelId) {
|
|
@@ -1991,7 +1991,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1991
1991
|
textAlign: segment.rubyAlignment === "l" ? "left" : segment.rubyAlignment === "r" ? "right" : segment.rubyAlignment === "dist" || segment.rubyAlignment === "distCat" || segment.rubyAlignment === "distLetter" ? "justify" : "center"
|
|
1992
1992
|
};
|
|
1993
1993
|
if (segment.rubyStyle?.color) {
|
|
1994
|
-
rubyStyle.color =
|
|
1994
|
+
rubyStyle.color = chunkUVA55CRK_js.normalizeHexColor(segment.rubyStyle.color, resolvedSegmentColor);
|
|
1995
1995
|
}
|
|
1996
1996
|
innerContent = /* @__PURE__ */ jsxRuntime.jsxs("ruby", { children: [
|
|
1997
1997
|
baseContent,
|
|
@@ -2086,7 +2086,7 @@ function groupSegmentsIntoParagraphs(segments) {
|
|
|
2086
2086
|
return paragraphs;
|
|
2087
2087
|
}
|
|
2088
2088
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick) {
|
|
2089
|
-
if (!
|
|
2089
|
+
if (!chunkUVA55CRK_js.hasTextProperties(element)) {
|
|
2090
2090
|
return emptyFallback || null;
|
|
2091
2091
|
}
|
|
2092
2092
|
const effectiveSegments = segmentOverrides ?? element.textSegments;
|
|
@@ -2107,10 +2107,10 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2107
2107
|
return element.text || emptyFallback || "";
|
|
2108
2108
|
}
|
|
2109
2109
|
const paragraphs = groupSegmentsIntoParagraphs(effectiveSegments);
|
|
2110
|
-
const paragraphIndents =
|
|
2111
|
-
const elementRtl =
|
|
2112
|
-
const elementAlign =
|
|
2113
|
-
const bodyStyle =
|
|
2110
|
+
const paragraphIndents = chunkUVA55CRK_js.hasTextProperties(element) ? element.paragraphIndents : void 0;
|
|
2111
|
+
const elementRtl = chunkUVA55CRK_js.hasTextProperties(element) ? element.textStyle?.rtl : void 0;
|
|
2112
|
+
const elementAlign = chunkUVA55CRK_js.hasTextProperties(element) ? element.textStyle?.align : void 0;
|
|
2113
|
+
const bodyStyle = chunkUVA55CRK_js.hasTextProperties(element) ? element.textStyle : void 0;
|
|
2114
2114
|
const spaceFirstLast = bodyStyle?.spaceFirstLastParagraph !== false;
|
|
2115
2115
|
return paragraphs.map((paraSegments, paraIndex) => {
|
|
2116
2116
|
const paraIndent = paragraphIndents?.[paraIndex];
|
|
@@ -2125,14 +2125,14 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2125
2125
|
return Boolean(segment.text) && segment.text.trim().length > 0;
|
|
2126
2126
|
});
|
|
2127
2127
|
const hasBullet = bulletInfo && !bulletInfo.none && hasVisibleTextContent;
|
|
2128
|
-
const paraRtl =
|
|
2128
|
+
const paraRtl = chunkUVA55CRK_js.resolveParagraphRtl(paraSegments, elementRtl);
|
|
2129
2129
|
const isRtlParagraph = paraRtl === true;
|
|
2130
|
-
const paraAlign =
|
|
2131
|
-
const cssTextAlign =
|
|
2130
|
+
const paraAlign = chunkUVA55CRK_js.resolveParagraphAlign(paraSegments, elementAlign);
|
|
2131
|
+
const cssTextAlign = chunkUVA55CRK_js.resolveCssTextAlign(paraAlign, isRtlParagraph);
|
|
2132
2132
|
const paraMarginLeft = isRtlParagraph ? void 0 : rawMarginLeft;
|
|
2133
2133
|
const paraMarginRight = isRtlParagraph ? rawMarginLeft : void 0;
|
|
2134
2134
|
const paraTextIndent = rawTextIndent;
|
|
2135
|
-
const paraKinsokuStyle =
|
|
2135
|
+
const paraKinsokuStyle = chunkUVA55CRK_js.getKinsokuLineBreakStyles(firstSeg?.segment.style);
|
|
2136
2136
|
const hasParaKinsoku = Object.keys(paraKinsokuStyle).length > 0;
|
|
2137
2137
|
const paraProps = effectiveSegments[firstSeg?.globalIndex ?? -1]?.paragraphProperties;
|
|
2138
2138
|
const spacing = resolveParagraphSpacing({
|
|
@@ -2142,10 +2142,17 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2142
2142
|
isLast: paraIndex === paragraphs.length - 1,
|
|
2143
2143
|
spaceFirstLast
|
|
2144
2144
|
});
|
|
2145
|
+
const strutFontSize = chunkUVA55CRK_js.resolveParagraphStrutFontSize(
|
|
2146
|
+
paraSegments.map(({ segment }) => segment),
|
|
2147
|
+
bodyStyle?.fontSize
|
|
2148
|
+
);
|
|
2145
2149
|
const hasParaSpacing = spacing.marginTop !== void 0 || spacing.marginBottom !== void 0 || spacing.lineHeight !== void 0;
|
|
2146
2150
|
const paraStyle = {
|
|
2147
2151
|
...paraKinsokuStyle
|
|
2148
2152
|
};
|
|
2153
|
+
if (strutFontSize !== void 0) {
|
|
2154
|
+
paraStyle.fontSize = strutFontSize;
|
|
2155
|
+
}
|
|
2149
2156
|
if (spacing.marginTop !== void 0) {
|
|
2150
2157
|
paraStyle.marginTop = spacing.marginTop;
|
|
2151
2158
|
}
|
|
@@ -2171,7 +2178,7 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2171
2178
|
if (cssTextAlign !== void 0) {
|
|
2172
2179
|
paraStyle.textAlign = cssTextAlign;
|
|
2173
2180
|
}
|
|
2174
|
-
const needsWrapper = paraMarginLeft !== void 0 || paraMarginRight !== void 0 || paraTextIndent !== void 0 || hasBullet || paraRtl !== void 0 || cssTextAlign !== void 0 || hasParaKinsoku || hasParaSpacing;
|
|
2181
|
+
const needsWrapper = paraMarginLeft !== void 0 || paraMarginRight !== void 0 || paraTextIndent !== void 0 || hasBullet || paraRtl !== void 0 || cssTextAlign !== void 0 || hasParaKinsoku || hasParaSpacing || strutFontSize !== void 0;
|
|
2175
2182
|
const renderedSegments = paraSegments.filter(({ segment }) => {
|
|
2176
2183
|
if (!hasBullet && segment.bulletInfo) {
|
|
2177
2184
|
return false;
|
|
@@ -2234,13 +2241,13 @@ function hexToRgbUnit(hex) {
|
|
|
2234
2241
|
};
|
|
2235
2242
|
}
|
|
2236
2243
|
function getDuotoneColors(element) {
|
|
2237
|
-
if (!
|
|
2244
|
+
if (!chunkUVA55CRK_js.isImageLikeElement(element)) {
|
|
2238
2245
|
return void 0;
|
|
2239
2246
|
}
|
|
2240
2247
|
return element.imageEffects?.duotone;
|
|
2241
2248
|
}
|
|
2242
2249
|
function buildLineShadowCss(element) {
|
|
2243
|
-
if (!
|
|
2250
|
+
if (!chunkUVA55CRK_js.hasShapeProperties(element)) {
|
|
2244
2251
|
return void 0;
|
|
2245
2252
|
}
|
|
2246
2253
|
const ss = element.shapeStyle;
|
|
@@ -2251,13 +2258,13 @@ function buildLineShadowCss(element) {
|
|
|
2251
2258
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
2252
2259
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
2253
2260
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
2254
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
2255
|
-
|
|
2261
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkUVA55CRK_js.colorWithOpacity(
|
|
2262
|
+
chunkUVA55CRK_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
2256
2263
|
opacity
|
|
2257
2264
|
)}`;
|
|
2258
2265
|
}
|
|
2259
2266
|
function buildLineGlowFilter(element) {
|
|
2260
|
-
if (!
|
|
2267
|
+
if (!chunkUVA55CRK_js.hasShapeProperties(element)) {
|
|
2261
2268
|
return void 0;
|
|
2262
2269
|
}
|
|
2263
2270
|
const ss = element.shapeStyle;
|
|
@@ -2266,7 +2273,7 @@ function buildLineGlowFilter(element) {
|
|
|
2266
2273
|
}
|
|
2267
2274
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
2268
2275
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
2269
|
-
const glowCol =
|
|
2276
|
+
const glowCol = chunkUVA55CRK_js.colorWithOpacity(chunkUVA55CRK_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
2270
2277
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
2271
2278
|
}
|
|
2272
2279
|
function mapDagBlendModeToCss(blend) {
|
|
@@ -2290,7 +2297,7 @@ function getDagDuotoneFilterId(elementId) {
|
|
|
2290
2297
|
return `dag-duotone-${elementId}`;
|
|
2291
2298
|
}
|
|
2292
2299
|
function hasDagDuotoneEffect(element) {
|
|
2293
|
-
if (!
|
|
2300
|
+
if (!chunkUVA55CRK_js.hasShapeProperties(element)) {
|
|
2294
2301
|
return false;
|
|
2295
2302
|
}
|
|
2296
2303
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
@@ -2353,7 +2360,7 @@ function getRoundRectRadiusPx2(element) {
|
|
|
2353
2360
|
|
|
2354
2361
|
// src/viewer/utils/shape-visual-3d.ts
|
|
2355
2362
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
2356
|
-
return
|
|
2363
|
+
return chunkUVA55CRK_js.build3DExtrusionData(
|
|
2357
2364
|
shape3d,
|
|
2358
2365
|
scene3d,
|
|
2359
2366
|
fillColor,
|
|
@@ -2362,7 +2369,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
2362
2369
|
);
|
|
2363
2370
|
}
|
|
2364
2371
|
function apply3dEffects2(base, scene3d, shape3d, fillColorFallback) {
|
|
2365
|
-
|
|
2372
|
+
chunkUVA55CRK_js.apply3dEffects(base, scene3d, shape3d, fillColorFallback);
|
|
2366
2373
|
}
|
|
2367
2374
|
|
|
2368
2375
|
// src/viewer/utils/vector-subpath-paint.ts
|
|
@@ -2371,7 +2378,7 @@ function toHexByte(value) {
|
|
|
2371
2378
|
return clamped.toString(16).padStart(2, "0");
|
|
2372
2379
|
}
|
|
2373
2380
|
function shiftHex(hex, factor, towardsWhite) {
|
|
2374
|
-
const channels =
|
|
2381
|
+
const channels = chunkUVA55CRK_js.hexToRgbChannels(hex);
|
|
2375
2382
|
if (!channels) {
|
|
2376
2383
|
return hex;
|
|
2377
2384
|
}
|
|
@@ -2397,13 +2404,13 @@ function buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity) {
|
|
|
2397
2404
|
const fillOff = subpath.fillMode === "none" || !hasFill;
|
|
2398
2405
|
return {
|
|
2399
2406
|
d: subpath.d,
|
|
2400
|
-
fill: fillOff ? "none" :
|
|
2407
|
+
fill: fillOff ? "none" : chunkUVA55CRK_js.colorWithOpacity(adjustFillForMode(fillColor, subpath.fillMode), fillOpacity),
|
|
2401
2408
|
stroked: subpath.stroke !== false
|
|
2402
2409
|
};
|
|
2403
2410
|
});
|
|
2404
2411
|
}
|
|
2405
2412
|
function getStrokeOnlyPresetPaths(element) {
|
|
2406
|
-
if (element.type !== "shape" || !
|
|
2413
|
+
if (element.type !== "shape" || !chunkUVA55CRK_js.hasShapeProperties(element)) {
|
|
2407
2414
|
return void 0;
|
|
2408
2415
|
}
|
|
2409
2416
|
const shapeType = element.shapeType;
|
|
@@ -2413,7 +2420,7 @@ function getStrokeOnlyPresetPaths(element) {
|
|
|
2413
2420
|
if (element.pathData) {
|
|
2414
2421
|
return void 0;
|
|
2415
2422
|
}
|
|
2416
|
-
const result =
|
|
2423
|
+
const result = chunkUVA55CRK_js.evaluatePresetShape(
|
|
2417
2424
|
shapeType,
|
|
2418
2425
|
Math.max(element.width, 1),
|
|
2419
2426
|
Math.max(element.height, 1),
|
|
@@ -2428,27 +2435,27 @@ function getStrokeOnlyPresetPaths(element) {
|
|
|
2428
2435
|
|
|
2429
2436
|
// src/viewer/utils/shape-visual-style.ts
|
|
2430
2437
|
function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2431
|
-
if (!
|
|
2438
|
+
if (!chunkUVA55CRK_js.hasShapeProperties(element)) {
|
|
2432
2439
|
return {};
|
|
2433
2440
|
}
|
|
2434
2441
|
const normalizedShapeType = getShapeType(element.shapeType);
|
|
2435
|
-
const clipPath =
|
|
2442
|
+
const clipPath = chunkUVA55CRK_js.getResolvedShapeClipPath(element);
|
|
2436
2443
|
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;
|
|
2437
2444
|
const rendersStrokeOnlyPreset = Boolean(getStrokeOnlyPresetPaths(element));
|
|
2438
2445
|
const fillOpacity = element.shapeStyle?.fillOpacity;
|
|
2439
2446
|
const strokeOpacity = element.shapeStyle?.strokeOpacity;
|
|
2440
|
-
const strokeDash =
|
|
2441
|
-
const fillGradient =
|
|
2442
|
-
const shadowCss =
|
|
2443
|
-
const innerShadowCss =
|
|
2444
|
-
const resolvedFillColor =
|
|
2445
|
-
const resolvedStrokeColor =
|
|
2447
|
+
const strokeDash = chunkUVA55CRK_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2448
|
+
const fillGradient = chunkUVA55CRK_js.buildCssGradientFromShapeStyle(element.shapeStyle) || element.shapeStyle?.fillGradient;
|
|
2449
|
+
const shadowCss = chunkUVA55CRK_js.buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
2450
|
+
const innerShadowCss = chunkUVA55CRK_js.buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
2451
|
+
const resolvedFillColor = chunkUVA55CRK_js.colorWithOpacity(fillColor, fillOpacity);
|
|
2452
|
+
const resolvedStrokeColor = chunkUVA55CRK_js.colorWithOpacity(strokeColor, strokeOpacity);
|
|
2446
2453
|
const ss = element.shapeStyle;
|
|
2447
2454
|
const hasFillOverlayColor = Boolean(
|
|
2448
2455
|
ss?.dagFillOverlayColor && ss.dagFillOverlayColor !== "transparent"
|
|
2449
2456
|
);
|
|
2450
2457
|
const combinedShadowParts = [];
|
|
2451
|
-
const multiLayerShadow =
|
|
2458
|
+
const multiLayerShadow = chunkUVA55CRK_js.buildMultiLayerShadowCss(element.shapeStyle);
|
|
2452
2459
|
if (multiLayerShadow) {
|
|
2453
2460
|
combinedShadowParts.push(multiLayerShadow);
|
|
2454
2461
|
} else if (shadowCss) {
|
|
@@ -2457,7 +2464,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2457
2464
|
if (innerShadowCss) {
|
|
2458
2465
|
combinedShadowParts.push(innerShadowCss);
|
|
2459
2466
|
}
|
|
2460
|
-
const glowBoxShadow =
|
|
2467
|
+
const glowBoxShadow = chunkUVA55CRK_js.buildGlowBoxShadow(ss?.glowColor, ss?.glowRadius, ss?.glowOpacity);
|
|
2461
2468
|
if (glowBoxShadow) {
|
|
2462
2469
|
combinedShadowParts.push(glowBoxShadow);
|
|
2463
2470
|
}
|
|
@@ -2465,7 +2472,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2465
2472
|
if (lineShadow) {
|
|
2466
2473
|
combinedShadowParts.push(lineShadow);
|
|
2467
2474
|
}
|
|
2468
|
-
const compoundLineShadow =
|
|
2475
|
+
const compoundLineShadow = chunkUVA55CRK_js.getCompoundLineBoxShadow(
|
|
2469
2476
|
element.shapeStyle?.compoundLine,
|
|
2470
2477
|
strokeWidth,
|
|
2471
2478
|
resolvedStrokeColor
|
|
@@ -2478,11 +2485,11 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2478
2485
|
if (ss?.glowColor && ss.glowColor !== "transparent" && ss.glowRadius) {
|
|
2479
2486
|
const glowOpacity = typeof ss.glowOpacity === "number" ? ss.glowOpacity : 0.75;
|
|
2480
2487
|
const glowRad = Math.round(Math.max(0, ss.glowRadius));
|
|
2481
|
-
const glowCol =
|
|
2488
|
+
const glowCol = chunkUVA55CRK_js.colorWithOpacity(chunkUVA55CRK_js.normalizeHexColor(ss.glowColor, "#ffff00"), glowOpacity);
|
|
2482
2489
|
filterParts.push(`drop-shadow(0 0 ${glowRad}px ${glowCol})`);
|
|
2483
2490
|
}
|
|
2484
2491
|
if (typeof ss?.softEdgeRadius === "number" && ss.softEdgeRadius > 0) {
|
|
2485
|
-
filterParts.push(`url(#${
|
|
2492
|
+
filterParts.push(`url(#${chunkUVA55CRK_js.getSoftEdgeFilterId(element.id)})`);
|
|
2486
2493
|
}
|
|
2487
2494
|
if (typeof ss?.blurRadius === "number" && ss.blurRadius > 0) {
|
|
2488
2495
|
filterParts.push(`blur(${Math.round(ss.blurRadius)}px)`);
|
|
@@ -2491,13 +2498,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2491
2498
|
if (lineGlowCss) {
|
|
2492
2499
|
filterParts.push(lineGlowCss);
|
|
2493
2500
|
}
|
|
2494
|
-
const dagFilter =
|
|
2501
|
+
const dagFilter = chunkUVA55CRK_js.getEffectDagFilter(ss, element.id);
|
|
2495
2502
|
if (dagFilter) {
|
|
2496
2503
|
filterParts.push(dagFilter);
|
|
2497
2504
|
}
|
|
2498
2505
|
const lineJoinCss = ss?.lineJoin === "round" ? "round" : ss?.lineJoin === "bevel" ? "bevel" : ss?.lineJoin === "miter" ? "miter" : void 0;
|
|
2499
2506
|
const miterLimitCss = ss?.lineJoin === "miter" && typeof ss?.miterLimit === "number" ? Math.max(ss.miterLimit / 1e5, 1) : void 0;
|
|
2500
|
-
const patternFill =
|
|
2507
|
+
const patternFill = chunkUVA55CRK_js.buildPatternFillCss(element.shapeStyle);
|
|
2501
2508
|
const imageFillUrl = ss?.fillMode === "image" && ss.fillImageUrl ? ss.fillImageUrl : void 0;
|
|
2502
2509
|
const imageFillMode = ss?.fillImageMode || "stretch";
|
|
2503
2510
|
let reflectCss;
|
|
@@ -2509,7 +2516,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2509
2516
|
const endOpacity = typeof ss.reflectionEndOpacity === "number" ? ss.reflectionEndOpacity : 0;
|
|
2510
2517
|
const fadeLength = typeof ss.reflectionEndPosition === "number" ? Math.round(ss.reflectionEndPosition * Math.max(element.height, 1)) : 100;
|
|
2511
2518
|
const blurRadius = typeof ss.reflectionBlurRadius === "number" ? ss.reflectionBlurRadius : 0;
|
|
2512
|
-
reflectCss =
|
|
2519
|
+
reflectCss = chunkUVA55CRK_js.buildReflectionCss(distance, startOpacity, endOpacity, fadeLength, blurRadius);
|
|
2513
2520
|
}
|
|
2514
2521
|
}
|
|
2515
2522
|
const base = {
|
|
@@ -2543,9 +2550,17 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2543
2550
|
// is present, `ShapeEffectOverlay` paints a separate blended tint layer so
|
|
2544
2551
|
// the colour is actually rendered (and text/children are not tinted).
|
|
2545
2552
|
mixBlendMode: hasFillOverlayColor ? void 0 : mapDagBlendModeToCss(ss?.dagFillOverlayBlend),
|
|
2546
|
-
|
|
2553
|
+
// An unstroked element must occupy EXACTLY its authored box. The
|
|
2554
|
+
// container class carries a 1px (transparent) border for the
|
|
2555
|
+
// selection/hover affordance and `box-sizing: border-box`, which
|
|
2556
|
+
// silently shrank every unstroked element's content by 2px and shifted
|
|
2557
|
+
// it 1px down-right. On a 40x40 icon that is a visible 5% shrink, and
|
|
2558
|
+
// two adjacent 40px buttons rendered with a 2px gap PowerPoint does not
|
|
2559
|
+
// draw. The affordance is an `outline` instead (see `ElementRenderer`),
|
|
2560
|
+
// which paints in the same place without taking part in layout.
|
|
2561
|
+
borderWidth: strokeWidth > 0 ? chunkUVA55CRK_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : 0,
|
|
2547
2562
|
borderColor: strokeWidth > 0 ? resolvedStrokeColor : void 0,
|
|
2548
|
-
borderStyle: strokeWidth > 0 ?
|
|
2563
|
+
borderStyle: strokeWidth > 0 ? chunkUVA55CRK_js.getCssBorderDashStyle(strokeDash, ss?.compoundLine) : void 0,
|
|
2549
2564
|
strokeLinejoin: lineJoinCss,
|
|
2550
2565
|
strokeMiterlimit: miterLimitCss,
|
|
2551
2566
|
strokeLinecap: ss?.lineCap === "rnd" ? "round" : ss?.lineCap === "sq" ? "square" : ss?.lineCap === "flat" ? "butt" : void 0
|
|
@@ -2601,7 +2616,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2601
2616
|
borderWidth: 0,
|
|
2602
2617
|
borderTopWidth: Math.max(strokeWidth, 2),
|
|
2603
2618
|
borderTopColor: resolvedStrokeColor,
|
|
2604
|
-
borderTopStyle:
|
|
2619
|
+
borderTopStyle: chunkUVA55CRK_js.getCssBorderDashStyle(strokeDash)
|
|
2605
2620
|
};
|
|
2606
2621
|
}
|
|
2607
2622
|
if (normalizedShapeType === "cylinder") {
|
|
@@ -2615,13 +2630,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2615
2630
|
function getConnectorAdjustment(element, key, fallback) {
|
|
2616
2631
|
const direct = element.shapeAdjustments?.[key];
|
|
2617
2632
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
2618
|
-
return
|
|
2633
|
+
return chunkUVA55CRK_js.clampUnitInterval(direct / 1e5);
|
|
2619
2634
|
}
|
|
2620
2635
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
2621
2636
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
2622
|
-
return
|
|
2637
|
+
return chunkUVA55CRK_js.clampUnitInterval(fallbackKey / 1e5);
|
|
2623
2638
|
}
|
|
2624
|
-
return
|
|
2639
|
+
return chunkUVA55CRK_js.clampUnitInterval(fallback);
|
|
2625
2640
|
}
|
|
2626
2641
|
function getConnectorPathGeometry(element) {
|
|
2627
2642
|
const width = Math.max(element.width, 1);
|
|
@@ -2758,11 +2773,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
|
|
|
2758
2773
|
strokePaint,
|
|
2759
2774
|
strokeWidth,
|
|
2760
2775
|
dashArray,
|
|
2761
|
-
lineCap:
|
|
2776
|
+
lineCap: chunkUVA55CRK_js.svgLineCap(shapeStyle?.lineCap),
|
|
2762
2777
|
lineJoin,
|
|
2763
2778
|
miterLimit,
|
|
2764
|
-
offsets:
|
|
2765
|
-
widths:
|
|
2779
|
+
offsets: chunkUVA55CRK_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
2780
|
+
widths: chunkUVA55CRK_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
|
|
2766
2781
|
};
|
|
2767
2782
|
}
|
|
2768
2783
|
function strokeStrands(d, keyBase, ctx) {
|
|
@@ -2785,7 +2800,7 @@ function strokeStrands(d, keyBase, ctx) {
|
|
|
2785
2800
|
}
|
|
2786
2801
|
function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredPaths, shapeStyle, hasFill, fillColor, fillOpacity, strokePaint, strokeWidth, dashArray, animatesFill = false) {
|
|
2787
2802
|
const ctx = strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray);
|
|
2788
|
-
const subpaths = structuredPaths && structuredPaths.length > 0 ?
|
|
2803
|
+
const subpaths = structuredPaths && structuredPaths.length > 0 ? chunkUVA55CRK_js.customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
2789
2804
|
const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
|
|
2790
2805
|
const nodes = [];
|
|
2791
2806
|
if (subpaths && needsPerSubpath) {
|
|
@@ -2816,7 +2831,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2816
2831
|
"path",
|
|
2817
2832
|
{
|
|
2818
2833
|
d: pathData,
|
|
2819
|
-
fill: animatesFill ? "inherit" :
|
|
2834
|
+
fill: animatesFill ? "inherit" : chunkUVA55CRK_js.colorWithOpacity(fillColor, fillOpacity),
|
|
2820
2835
|
stroke: "none",
|
|
2821
2836
|
vectorEffect: "non-scaling-stroke"
|
|
2822
2837
|
},
|
|
@@ -2858,14 +2873,14 @@ function renderStrokeOnlyPreset(presetPaths, width, height, shapeStyle, strokePa
|
|
|
2858
2873
|
);
|
|
2859
2874
|
}
|
|
2860
2875
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2861
|
-
if (!
|
|
2876
|
+
if (!chunkUVA55CRK_js.hasShapeProperties(element)) {
|
|
2862
2877
|
return null;
|
|
2863
2878
|
}
|
|
2864
2879
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
2865
|
-
const fillPaint = animatesFill ? "inherit" :
|
|
2866
|
-
const strokePaint = animatesStroke ? "inherit" :
|
|
2867
|
-
const dashType =
|
|
2868
|
-
const dashArray =
|
|
2880
|
+
const fillPaint = animatesFill ? "inherit" : chunkUVA55CRK_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
2881
|
+
const strokePaint = animatesStroke ? "inherit" : chunkUVA55CRK_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
2882
|
+
const dashType = chunkUVA55CRK_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2883
|
+
const dashArray = chunkUVA55CRK_js.getSvgStrokeDasharray(
|
|
2869
2884
|
dashType,
|
|
2870
2885
|
Math.max(strokeWidth, 1),
|
|
2871
2886
|
element.shapeStyle?.customDashSegments
|
|
@@ -2944,18 +2959,18 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2944
2959
|
Boolean(animatesFill)
|
|
2945
2960
|
);
|
|
2946
2961
|
}
|
|
2947
|
-
if (
|
|
2962
|
+
if (chunkUVA55CRK_js.isCalloutShape(normalizedType)) {
|
|
2948
2963
|
const width = Math.max(element.width, 1);
|
|
2949
2964
|
const height = Math.max(element.height, 1);
|
|
2950
|
-
const geometry =
|
|
2965
|
+
const geometry = chunkUVA55CRK_js.getCalloutLeaderLineGeometry(
|
|
2951
2966
|
normalizedType,
|
|
2952
2967
|
width,
|
|
2953
2968
|
height,
|
|
2954
2969
|
element.shapeAdjustments
|
|
2955
2970
|
);
|
|
2956
2971
|
if (geometry && geometry.points.length >= 2) {
|
|
2957
|
-
const leaderPath =
|
|
2958
|
-
const bounds =
|
|
2972
|
+
const leaderPath = chunkUVA55CRK_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
2973
|
+
const bounds = chunkUVA55CRK_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
2959
2974
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
2960
2975
|
const offsetLeft = bounds.minX;
|
|
2961
2976
|
const offsetTop = bounds.minY;
|
|
@@ -3018,10 +3033,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
3018
3033
|
const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
|
|
3019
3034
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
3020
3035
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
3021
|
-
const connectorLineCap =
|
|
3036
|
+
const connectorLineCap = chunkUVA55CRK_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
3022
3037
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
3023
|
-
const offsets =
|
|
3024
|
-
const widths =
|
|
3038
|
+
const offsets = chunkUVA55CRK_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
3039
|
+
const widths = chunkUVA55CRK_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
3025
3040
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3026
3041
|
"svg",
|
|
3027
3042
|
{
|
|
@@ -3100,15 +3115,15 @@ function parseGradientFillCss(gradFill) {
|
|
|
3100
3115
|
}
|
|
3101
3116
|
const parsed = stops.map((gs) => {
|
|
3102
3117
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
3103
|
-
const color =
|
|
3104
|
-
const opacity =
|
|
3105
|
-
return { pos, color:
|
|
3118
|
+
const color = chunkUVA55CRK_js.parseDrawingColor(gs) ?? "#888888";
|
|
3119
|
+
const opacity = chunkUVA55CRK_js.parseDrawingColorOpacity(gs);
|
|
3120
|
+
return { pos, color: chunkUVA55CRK_js.colorWithOpacity(color, opacity) };
|
|
3106
3121
|
}).sort((a, b) => a.pos - b.pos);
|
|
3107
3122
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
3108
3123
|
const lin = gradFill["a:lin"];
|
|
3109
3124
|
if (lin) {
|
|
3110
3125
|
const angRaw = Number.parseInt(String(lin["@_ang"] || "0"), 10);
|
|
3111
|
-
const angleDeg = Math.round(
|
|
3126
|
+
const angleDeg = Math.round(chunkUVA55CRK_js.ooxmlGradientAngleToCssDegrees(angRaw / 6e4));
|
|
3112
3127
|
return `linear-gradient(${angleDeg}deg, ${stopStrings})`;
|
|
3113
3128
|
}
|
|
3114
3129
|
const path = gradFill["a:path"];
|
|
@@ -3143,8 +3158,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
3143
3158
|
if (!pattFill) {
|
|
3144
3159
|
return void 0;
|
|
3145
3160
|
}
|
|
3146
|
-
const fgColor =
|
|
3147
|
-
const bgColor =
|
|
3161
|
+
const fgColor = chunkUVA55CRK_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
3162
|
+
const bgColor = chunkUVA55CRK_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
3148
3163
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
3149
3164
|
switch (preset) {
|
|
3150
3165
|
case "ltHorz":
|
|
@@ -3255,11 +3270,11 @@ function parseCellBorders(cellProperties) {
|
|
|
3255
3270
|
const prstDash = ln["a:prstDash"];
|
|
3256
3271
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
3257
3272
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
3258
|
-
const color =
|
|
3273
|
+
const color = chunkUVA55CRK_js.parseDrawingColor(ln["a:solidFill"]);
|
|
3259
3274
|
if (color) {
|
|
3260
|
-
const opacity =
|
|
3275
|
+
const opacity = chunkUVA55CRK_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
3261
3276
|
const key = `${edge.prefix}`;
|
|
3262
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
3277
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkUVA55CRK_js.colorWithOpacity(color, opacity)}`;
|
|
3263
3278
|
}
|
|
3264
3279
|
}
|
|
3265
3280
|
return borderStyle;
|
|
@@ -3272,7 +3287,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3272
3287
|
const textShadowParts = [];
|
|
3273
3288
|
const outerShdw = effectLst["a:outerShdw"];
|
|
3274
3289
|
if (outerShdw) {
|
|
3275
|
-
const shdwColor =
|
|
3290
|
+
const shdwColor = chunkUVA55CRK_js.parseDrawingColor(outerShdw);
|
|
3276
3291
|
if (shdwColor) {
|
|
3277
3292
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
3278
3293
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -3290,7 +3305,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3290
3305
|
}
|
|
3291
3306
|
const glow = effectLst["a:glow"];
|
|
3292
3307
|
if (glow) {
|
|
3293
|
-
const glowColor =
|
|
3308
|
+
const glowColor = chunkUVA55CRK_js.parseDrawingColor(glow);
|
|
3294
3309
|
if (glowColor) {
|
|
3295
3310
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
3296
3311
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -3369,10 +3384,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3369
3384
|
if (runProps?.["@_u"] !== void 0) {
|
|
3370
3385
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
3371
3386
|
}
|
|
3372
|
-
const runColor =
|
|
3387
|
+
const runColor = chunkUVA55CRK_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkUVA55CRK_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
3373
3388
|
if (runColor) {
|
|
3374
|
-
const opacity =
|
|
3375
|
-
cellStyle.color =
|
|
3389
|
+
const opacity = chunkUVA55CRK_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
3390
|
+
cellStyle.color = chunkUVA55CRK_js.colorWithOpacity(runColor, opacity);
|
|
3376
3391
|
}
|
|
3377
3392
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
3378
3393
|
if (fontFamily) {
|
|
@@ -3382,15 +3397,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3382
3397
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
3383
3398
|
}
|
|
3384
3399
|
const cellProperties = cellXml["a:tcPr"];
|
|
3385
|
-
const cellFill =
|
|
3400
|
+
const cellFill = chunkUVA55CRK_js.parseDrawingColor(
|
|
3386
3401
|
cellProperties?.["a:solidFill"],
|
|
3387
3402
|
schemeColorOverrides
|
|
3388
3403
|
);
|
|
3389
3404
|
if (cellFill) {
|
|
3390
|
-
const opacity =
|
|
3405
|
+
const opacity = chunkUVA55CRK_js.parseDrawingColorOpacity(
|
|
3391
3406
|
cellProperties?.["a:solidFill"]
|
|
3392
3407
|
);
|
|
3393
|
-
cellStyle.backgroundColor =
|
|
3408
|
+
cellStyle.backgroundColor = chunkUVA55CRK_js.colorWithOpacity(cellFill, opacity);
|
|
3394
3409
|
} else {
|
|
3395
3410
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
3396
3411
|
if (gradCss) {
|
|
@@ -3405,16 +3420,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3405
3420
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
3406
3421
|
Object.assign(cellStyle, edgeBorders);
|
|
3407
3422
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
3408
|
-
const borderColor =
|
|
3423
|
+
const borderColor = chunkUVA55CRK_js.parseDrawingColor(
|
|
3409
3424
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
3410
3425
|
schemeColorOverrides
|
|
3411
|
-
) ||
|
|
3426
|
+
) || chunkUVA55CRK_js.parseDrawingColor(
|
|
3412
3427
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
3413
3428
|
schemeColorOverrides
|
|
3414
|
-
) ||
|
|
3429
|
+
) || chunkUVA55CRK_js.parseDrawingColor(
|
|
3415
3430
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
3416
3431
|
schemeColorOverrides
|
|
3417
|
-
) ||
|
|
3432
|
+
) || chunkUVA55CRK_js.parseDrawingColor(
|
|
3418
3433
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
3419
3434
|
schemeColorOverrides
|
|
3420
3435
|
);
|
|
@@ -3493,10 +3508,10 @@ function resolveTableStyleFillColor(fill, colorScheme) {
|
|
|
3493
3508
|
}
|
|
3494
3509
|
let color = base;
|
|
3495
3510
|
if (fill.tint !== void 0 && fill.tint > 0) {
|
|
3496
|
-
color =
|
|
3511
|
+
color = chunkUVA55CRK_js.tintColor2(color, fill.tint / 1e5);
|
|
3497
3512
|
}
|
|
3498
3513
|
if (fill.shade !== void 0 && fill.shade > 0) {
|
|
3499
|
-
color =
|
|
3514
|
+
color = chunkUVA55CRK_js.shadeColor2(color, 1 - fill.shade / 1e5);
|
|
3500
3515
|
}
|
|
3501
3516
|
return color;
|
|
3502
3517
|
}
|
|
@@ -3521,7 +3536,7 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3521
3536
|
style.fontFamily = text.fontFace;
|
|
3522
3537
|
applied = true;
|
|
3523
3538
|
} else {
|
|
3524
|
-
const refFont =
|
|
3539
|
+
const refFont = chunkUVA55CRK_js.resolveFontRefIdx(text.fontRefIdx, fontScheme);
|
|
3525
3540
|
if (refFont) {
|
|
3526
3541
|
style.fontFamily = refFont;
|
|
3527
3542
|
applied = true;
|
|
@@ -3532,10 +3547,10 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3532
3547
|
if (base) {
|
|
3533
3548
|
let color = base;
|
|
3534
3549
|
if (text.fontTint !== void 0 && text.fontTint > 0) {
|
|
3535
|
-
color =
|
|
3550
|
+
color = chunkUVA55CRK_js.tintColor2(color, text.fontTint / 1e5);
|
|
3536
3551
|
}
|
|
3537
3552
|
if (text.fontShade !== void 0 && text.fontShade > 0) {
|
|
3538
|
-
color =
|
|
3553
|
+
color = chunkUVA55CRK_js.shadeColor2(color, 1 - text.fontShade / 1e5);
|
|
3539
3554
|
}
|
|
3540
3555
|
style.color = color;
|
|
3541
3556
|
applied = true;
|
|
@@ -3724,7 +3739,7 @@ function parseTableElementData(element, fallbackTextStyle) {
|
|
|
3724
3739
|
};
|
|
3725
3740
|
}
|
|
3726
3741
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
3727
|
-
return
|
|
3742
|
+
return chunkUVA55CRK_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
3728
3743
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
3729
3744
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
3730
3745
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -3872,9 +3887,9 @@ function cellStyleToCss(style) {
|
|
|
3872
3887
|
if (style.gradientFillCss) {
|
|
3873
3888
|
css.background = style.gradientFillCss;
|
|
3874
3889
|
} else if (style.fillMode === "pattern" && style.patternFillPreset) {
|
|
3875
|
-
const fg =
|
|
3876
|
-
const bg =
|
|
3877
|
-
const svgPattern =
|
|
3890
|
+
const fg = chunkUVA55CRK_js.normalizeHexColor(style.patternFillForeground, "#000000");
|
|
3891
|
+
const bg = chunkUVA55CRK_js.normalizeHexColor(style.patternFillBackground, "#ffffff");
|
|
3892
|
+
const svgPattern = chunkUVA55CRK_js.getPatternSvg(style.patternFillPreset, fg, bg);
|
|
3878
3893
|
if (svgPattern) {
|
|
3879
3894
|
const encoded = encodeURIComponent(svgPattern);
|
|
3880
3895
|
css.backgroundImage = `url("data:image/svg+xml,${encoded}")`;
|
|
@@ -3950,7 +3965,7 @@ function cellStyleToCss(style) {
|
|
|
3950
3965
|
if (edge.width || edge.color) {
|
|
3951
3966
|
const w = edge.width ?? 1;
|
|
3952
3967
|
const c = edge.color ?? style.borderColor ?? "#000000";
|
|
3953
|
-
const s =
|
|
3968
|
+
const s = chunkUVA55CRK_js.ooxmlDashToCssBorderStyle(edge.dash);
|
|
3954
3969
|
css[edge.prefix] = `${w}px ${s} ${c}`;
|
|
3955
3970
|
}
|
|
3956
3971
|
}
|
|
@@ -3981,7 +3996,7 @@ function cellStyleToCss(style) {
|
|
|
3981
3996
|
css.textShadow = textShadowParts.join(", ");
|
|
3982
3997
|
}
|
|
3983
3998
|
if (style.cell3D) {
|
|
3984
|
-
Object.assign(css,
|
|
3999
|
+
Object.assign(css, chunkUVA55CRK_js.cell3DBevelCss(style.cell3D));
|
|
3985
4000
|
}
|
|
3986
4001
|
return css;
|
|
3987
4002
|
}
|
|
@@ -3995,7 +4010,7 @@ function TableResizeOverlay({
|
|
|
3995
4010
|
const containerRef = React6.useRef(null);
|
|
3996
4011
|
const [rowBounds, setRowBounds] = React6.useState([]);
|
|
3997
4012
|
const dragRef = React6.useRef(null);
|
|
3998
|
-
const colBoundaries = React6.useMemo(() =>
|
|
4013
|
+
const colBoundaries = React6.useMemo(() => chunkUVA55CRK_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
3999
4014
|
const measureRows = React6.useCallback(() => {
|
|
4000
4015
|
const container = containerRef.current;
|
|
4001
4016
|
if (!container) {
|
|
@@ -4042,11 +4057,11 @@ function TableResizeOverlay({
|
|
|
4042
4057
|
const rect = containerRef.current.getBoundingClientRect();
|
|
4043
4058
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
4044
4059
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
4045
|
-
onResizeColumns(
|
|
4060
|
+
onResizeColumns(chunkUVA55CRK_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
4046
4061
|
} else if (drag.type === "row" && onResizeRow) {
|
|
4047
4062
|
const deltaY = e.clientY - drag.startPos;
|
|
4048
|
-
const newHeight =
|
|
4049
|
-
drag.initialRowHeight ??
|
|
4063
|
+
const newHeight = chunkUVA55CRK_js.computeResizedRowHeight(
|
|
4064
|
+
drag.initialRowHeight ?? chunkUVA55CRK_js.DEFAULT_ROW_HEIGHT,
|
|
4050
4065
|
deltaY
|
|
4051
4066
|
);
|
|
4052
4067
|
onResizeRow(drag.index, newHeight);
|
|
@@ -4084,7 +4099,7 @@ function TableResizeOverlay({
|
|
|
4084
4099
|
e.stopPropagation();
|
|
4085
4100
|
const table = containerRef.current?.querySelector("table");
|
|
4086
4101
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
4087
|
-
const actualHeight = tr?.offsetHeight ??
|
|
4102
|
+
const actualHeight = tr?.offsetHeight ?? chunkUVA55CRK_js.DEFAULT_ROW_HEIGHT;
|
|
4088
4103
|
document.body.style.cursor = "row-resize";
|
|
4089
4104
|
document.body.style.userSelect = "none";
|
|
4090
4105
|
dragRef.current = {
|
|
@@ -4132,7 +4147,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4132
4147
|
}
|
|
4133
4148
|
const first = selectedCell.selectedCells[0];
|
|
4134
4149
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4135
|
-
return
|
|
4150
|
+
return chunkUVA55CRK_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
4136
4151
|
})();
|
|
4137
4152
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4138
4153
|
TableResizeOverlay,
|
|
@@ -4165,7 +4180,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4165
4180
|
return null;
|
|
4166
4181
|
}
|
|
4167
4182
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
4168
|
-
const isInMultiSelection =
|
|
4183
|
+
const isInMultiSelection = chunkUVA55CRK_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
4169
4184
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
4170
4185
|
const diag = getCellDiagonalBorders2(
|
|
4171
4186
|
cell.style,
|
|
@@ -4195,7 +4210,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4195
4210
|
}
|
|
4196
4211
|
event.stopPropagation();
|
|
4197
4212
|
if (event.shiftKey && selectedCell) {
|
|
4198
|
-
const rect =
|
|
4213
|
+
const rect = chunkUVA55CRK_js.computeSelectionRect(
|
|
4199
4214
|
selectedCell.rowIndex,
|
|
4200
4215
|
selectedCell.columnIndex,
|
|
4201
4216
|
rowIndex,
|
|
@@ -4205,7 +4220,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4205
4220
|
options?.onSelectCell?.({
|
|
4206
4221
|
rowIndex: selectedCell.rowIndex,
|
|
4207
4222
|
columnIndex: selectedCell.columnIndex,
|
|
4208
|
-
selectedCells:
|
|
4223
|
+
selectedCells: chunkUVA55CRK_js.rectToCells(rect)
|
|
4209
4224
|
});
|
|
4210
4225
|
} else {
|
|
4211
4226
|
options?.onSelectCell?.({
|
|
@@ -4282,7 +4297,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4282
4297
|
}
|
|
4283
4298
|
const first = selectedCell.selectedCells[0];
|
|
4284
4299
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4285
|
-
return
|
|
4300
|
+
return chunkUVA55CRK_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
4286
4301
|
})();
|
|
4287
4302
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
4288
4303
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4359,7 +4374,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4359
4374
|
"border px-1 py-0.5 align-top",
|
|
4360
4375
|
isEditable && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
4361
4376
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
4362
|
-
|
|
4377
|
+
chunkUVA55CRK_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
4363
4378
|
),
|
|
4364
4379
|
colSpan,
|
|
4365
4380
|
rowSpan: rSpan,
|
|
@@ -4370,7 +4385,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4370
4385
|
}
|
|
4371
4386
|
event.stopPropagation();
|
|
4372
4387
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
4373
|
-
const rect =
|
|
4388
|
+
const rect = chunkUVA55CRK_js.computeSelectionRect(
|
|
4374
4389
|
selectedCell.rowIndex,
|
|
4375
4390
|
selectedCell.columnIndex,
|
|
4376
4391
|
rowIndex,
|
|
@@ -4380,7 +4395,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4380
4395
|
options?.onSelectCell?.({
|
|
4381
4396
|
rowIndex: selectedCell.rowIndex,
|
|
4382
4397
|
columnIndex: selectedCell.columnIndex,
|
|
4383
|
-
selectedCells:
|
|
4398
|
+
selectedCells: chunkUVA55CRK_js.rectToCells(rect)
|
|
4384
4399
|
});
|
|
4385
4400
|
} else {
|
|
4386
4401
|
options?.onSelectCell?.({
|
|
@@ -4435,24 +4450,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4435
4450
|
}
|
|
4436
4451
|
var LEGEND_ITEM_WIDTH = 80;
|
|
4437
4452
|
function partAttrs(part) {
|
|
4438
|
-
return part ?
|
|
4453
|
+
return part ? chunkUVA55CRK_js.chartPartToAttrs(part) : void 0;
|
|
4439
4454
|
}
|
|
4440
4455
|
function resolveReactPalette(chartData) {
|
|
4441
4456
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
4442
4457
|
return chartData.colorPalette;
|
|
4443
4458
|
}
|
|
4444
|
-
return [...
|
|
4459
|
+
return [...chunkUVA55CRK_js.getChartStylePalette(chartData.style?.styleId)];
|
|
4445
4460
|
}
|
|
4446
4461
|
function buildReactChartViewModel(element) {
|
|
4447
4462
|
if (element.type !== "chart" || !element.chartData) {
|
|
4448
|
-
return
|
|
4463
|
+
return chunkUVA55CRK_js.buildChartViewModel(element);
|
|
4449
4464
|
}
|
|
4450
4465
|
const palette = resolveReactPalette(element.chartData);
|
|
4451
4466
|
const themedElement = {
|
|
4452
4467
|
...element,
|
|
4453
4468
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
4454
4469
|
};
|
|
4455
|
-
return
|
|
4470
|
+
return chunkUVA55CRK_js.buildChartViewModel(themedElement);
|
|
4456
4471
|
}
|
|
4457
4472
|
function renderPrimitive(prim, key) {
|
|
4458
4473
|
switch (prim.kind) {
|
|
@@ -4841,7 +4856,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4841
4856
|
const unmatchedRows = [];
|
|
4842
4857
|
categories.forEach((cat, i) => {
|
|
4843
4858
|
const value = values[i] ?? 0;
|
|
4844
|
-
const code =
|
|
4859
|
+
const code = chunkUVA55CRK_js.resolveRegionCode(cat);
|
|
4845
4860
|
if (code) {
|
|
4846
4861
|
regionValueMap.set(code, { value, label: cat });
|
|
4847
4862
|
} else {
|
|
@@ -4879,8 +4894,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4879
4894
|
let fill = "#e2e8f0";
|
|
4880
4895
|
let dataLabel = null;
|
|
4881
4896
|
if (entry) {
|
|
4882
|
-
const t =
|
|
4883
|
-
fill =
|
|
4897
|
+
const t = chunkUVA55CRK_js.normalizeValue(entry.value, minVal, maxVal);
|
|
4898
|
+
fill = chunkUVA55CRK_js.sequentialColorScale(t);
|
|
4884
4899
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
4885
4900
|
"text",
|
|
4886
4901
|
{
|
|
@@ -4891,7 +4906,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4891
4906
|
fontWeight: 600,
|
|
4892
4907
|
fill: "#1e293b",
|
|
4893
4908
|
style: { pointerEvents: "none" },
|
|
4894
|
-
children:
|
|
4909
|
+
children: chunkUVA55CRK_js.formatAxisValue(entry.value)
|
|
4895
4910
|
},
|
|
4896
4911
|
`${element.id}-map-dl-${region.code}`
|
|
4897
4912
|
);
|
|
@@ -4909,7 +4924,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4909
4924
|
opacity: 0.9,
|
|
4910
4925
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
4911
4926
|
region.name,
|
|
4912
|
-
entry ? `: ${
|
|
4927
|
+
entry ? `: ${chunkUVA55CRK_js.formatAxisValue(entry.value)}` : ""
|
|
4913
4928
|
] })
|
|
4914
4929
|
}
|
|
4915
4930
|
),
|
|
@@ -4947,7 +4962,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4947
4962
|
fontSize: 7,
|
|
4948
4963
|
fill: "#64748b",
|
|
4949
4964
|
textAnchor: "middle",
|
|
4950
|
-
children:
|
|
4965
|
+
children: chunkUVA55CRK_js.formatAxisValue(minVal)
|
|
4951
4966
|
},
|
|
4952
4967
|
`${element.id}-map-legend-min`
|
|
4953
4968
|
),
|
|
@@ -4959,7 +4974,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4959
4974
|
fontSize: 7,
|
|
4960
4975
|
fill: "#64748b",
|
|
4961
4976
|
textAnchor: "middle",
|
|
4962
|
-
children:
|
|
4977
|
+
children: chunkUVA55CRK_js.formatAxisValue(maxVal)
|
|
4963
4978
|
},
|
|
4964
4979
|
`${element.id}-map-legend-max`
|
|
4965
4980
|
)
|
|
@@ -5025,7 +5040,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
5025
5040
|
y,
|
|
5026
5041
|
fontSize,
|
|
5027
5042
|
fill: "#475569",
|
|
5028
|
-
children:
|
|
5043
|
+
children: chunkUVA55CRK_js.formatAxisValue(row.value)
|
|
5029
5044
|
},
|
|
5030
5045
|
`${element.id}-map-ft-val-${i}`
|
|
5031
5046
|
)
|
|
@@ -5096,7 +5111,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
5096
5111
|
|
|
5097
5112
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
5098
5113
|
function sColor(series, idx) {
|
|
5099
|
-
return
|
|
5114
|
+
return chunkUVA55CRK_js.seriesColor(series, idx);
|
|
5100
5115
|
}
|
|
5101
5116
|
function valToY(val, range, topY, bottomY) {
|
|
5102
5117
|
const usable = bottomY - topY;
|
|
@@ -5635,7 +5650,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5635
5650
|
width: 10,
|
|
5636
5651
|
height: 10,
|
|
5637
5652
|
rx: 2,
|
|
5638
|
-
fill:
|
|
5653
|
+
fill: chunkUVA55CRK_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5639
5654
|
},
|
|
5640
5655
|
`${id}-leg-r-${i}`
|
|
5641
5656
|
)
|
|
@@ -5659,7 +5674,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5659
5674
|
width: 10,
|
|
5660
5675
|
height: 10,
|
|
5661
5676
|
rx: 2,
|
|
5662
|
-
fill:
|
|
5677
|
+
fill: chunkUVA55CRK_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5663
5678
|
}
|
|
5664
5679
|
),
|
|
5665
5680
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -5672,9 +5687,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5672
5687
|
}
|
|
5673
5688
|
const lines = [];
|
|
5674
5689
|
if (range.logScale && range.logBase) {
|
|
5675
|
-
const ticks =
|
|
5690
|
+
const ticks = chunkUVA55CRK_js.generateLogTicks(range);
|
|
5676
5691
|
ticks.forEach((tickVal, i) => {
|
|
5677
|
-
const y =
|
|
5692
|
+
const y = chunkUVA55CRK_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5678
5693
|
lines.push(
|
|
5679
5694
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5680
5695
|
"line",
|
|
@@ -5695,7 +5710,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5695
5710
|
const steps = 4;
|
|
5696
5711
|
for (let i = 0; i <= steps; i++) {
|
|
5697
5712
|
const val = range.min + range.span * i / steps;
|
|
5698
|
-
const y =
|
|
5713
|
+
const y = chunkUVA55CRK_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5699
5714
|
lines.push(
|
|
5700
5715
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5701
5716
|
"line",
|
|
@@ -5719,9 +5734,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5719
5734
|
const labels = [];
|
|
5720
5735
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5721
5736
|
if (range.logScale && range.logBase) {
|
|
5722
|
-
const ticks =
|
|
5737
|
+
const ticks = chunkUVA55CRK_js.generateLogTicks(range);
|
|
5723
5738
|
ticks.forEach((tickVal, i) => {
|
|
5724
|
-
const y =
|
|
5739
|
+
const y = chunkUVA55CRK_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5725
5740
|
labels.push(
|
|
5726
5741
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5727
5742
|
"text",
|
|
@@ -5731,7 +5746,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5731
5746
|
textAnchor: "end",
|
|
5732
5747
|
fontSize: 8,
|
|
5733
5748
|
fill: "#64748b",
|
|
5734
|
-
children: hasDisplayUnits ?
|
|
5749
|
+
children: hasDisplayUnits ? chunkUVA55CRK_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunkUVA55CRK_js.formatAxisValue(tickVal)
|
|
5735
5750
|
},
|
|
5736
5751
|
`${id}-vaxis-log-${i}`
|
|
5737
5752
|
)
|
|
@@ -5741,7 +5756,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5741
5756
|
const steps = 4;
|
|
5742
5757
|
for (let i = 0; i <= steps; i++) {
|
|
5743
5758
|
const val = range.min + range.span * i / steps;
|
|
5744
|
-
const y =
|
|
5759
|
+
const y = chunkUVA55CRK_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5745
5760
|
labels.push(
|
|
5746
5761
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5747
5762
|
"text",
|
|
@@ -5751,7 +5766,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5751
5766
|
textAnchor: "end",
|
|
5752
5767
|
fontSize: 8,
|
|
5753
5768
|
fill: "#64748b",
|
|
5754
|
-
children: hasDisplayUnits ?
|
|
5769
|
+
children: hasDisplayUnits ? chunkUVA55CRK_js.formatAxisValueWithUnits(val, axisFormatting) : chunkUVA55CRK_js.formatAxisValue(val)
|
|
5755
5770
|
},
|
|
5756
5771
|
`${id}-vaxis-${i}`
|
|
5757
5772
|
)
|
|
@@ -5759,7 +5774,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5759
5774
|
}
|
|
5760
5775
|
}
|
|
5761
5776
|
if (hasDisplayUnits) {
|
|
5762
|
-
const unitLabel =
|
|
5777
|
+
const unitLabel = chunkUVA55CRK_js.getDisplayUnitLabel(
|
|
5763
5778
|
axisFormatting.displayUnits,
|
|
5764
5779
|
axisFormatting.displayUnitsLabel
|
|
5765
5780
|
);
|
|
@@ -5834,7 +5849,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
5834
5849
|
if (range.min >= 0) {
|
|
5835
5850
|
return null;
|
|
5836
5851
|
}
|
|
5837
|
-
const y =
|
|
5852
|
+
const y = chunkUVA55CRK_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
5838
5853
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5839
5854
|
"line",
|
|
5840
5855
|
{
|
|
@@ -5858,7 +5873,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5858
5873
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5859
5874
|
for (let i = 0; i <= steps; i++) {
|
|
5860
5875
|
const val = range.min + range.span * i / steps;
|
|
5861
|
-
const y =
|
|
5876
|
+
const y = chunkUVA55CRK_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5862
5877
|
labels.push(
|
|
5863
5878
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5864
5879
|
"text",
|
|
@@ -5870,7 +5885,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5870
5885
|
fontFamily,
|
|
5871
5886
|
fontWeight,
|
|
5872
5887
|
fill: fontColor,
|
|
5873
|
-
children: hasDisplayUnits ?
|
|
5888
|
+
children: hasDisplayUnits ? chunkUVA55CRK_js.formatAxisValueWithUnits(val, axisFormatting) : chunkUVA55CRK_js.formatAxisValue(val)
|
|
5874
5889
|
},
|
|
5875
5890
|
`${id}-sec-vaxis-${i}`
|
|
5876
5891
|
)
|
|
@@ -5894,7 +5909,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5894
5909
|
);
|
|
5895
5910
|
}
|
|
5896
5911
|
if (hasDisplayUnits) {
|
|
5897
|
-
const unitLabel =
|
|
5912
|
+
const unitLabel = chunkUVA55CRK_js.getDisplayUnitLabel(
|
|
5898
5913
|
axisFormatting.displayUnits,
|
|
5899
5914
|
axisFormatting.displayUnitsLabel
|
|
5900
5915
|
);
|
|
@@ -5925,7 +5940,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
5925
5940
|
const ticks = [];
|
|
5926
5941
|
for (let i = 0; i <= steps; i++) {
|
|
5927
5942
|
const val = range.min + range.span * i / steps;
|
|
5928
|
-
const y =
|
|
5943
|
+
const y = chunkUVA55CRK_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5929
5944
|
ticks.push(
|
|
5930
5945
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5931
5946
|
"line",
|
|
@@ -5952,7 +5967,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
5952
5967
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
5953
5968
|
for (let i = 0; i <= steps; i++) {
|
|
5954
5969
|
const val = range.min + range.span * i / steps;
|
|
5955
|
-
const y =
|
|
5970
|
+
const y = chunkUVA55CRK_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5956
5971
|
lines.push(
|
|
5957
5972
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5958
5973
|
"line",
|
|
@@ -6114,7 +6129,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6114
6129
|
width: 8,
|
|
6115
6130
|
height: 8,
|
|
6116
6131
|
borderRadius: 2,
|
|
6117
|
-
backgroundColor:
|
|
6132
|
+
backgroundColor: chunkUVA55CRK_js.seriesColor(
|
|
6118
6133
|
s,
|
|
6119
6134
|
si,
|
|
6120
6135
|
chartData.style?.styleId,
|
|
@@ -6153,8 +6168,8 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6153
6168
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
6154
6169
|
const style = chartData.style;
|
|
6155
6170
|
const legendPos = style?.legendPosition || "b";
|
|
6156
|
-
const range =
|
|
6157
|
-
const layout =
|
|
6171
|
+
const range = chunkUVA55CRK_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6172
|
+
const layout = chunkUVA55CRK_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6158
6173
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6159
6174
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
6160
6175
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -6175,10 +6190,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6175
6190
|
const close = closeSeries.values[ci] ?? high;
|
|
6176
6191
|
const isUp = close >= open;
|
|
6177
6192
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
6178
|
-
const highY =
|
|
6179
|
-
const lowY =
|
|
6180
|
-
const openY =
|
|
6181
|
-
const closeY =
|
|
6193
|
+
const highY = chunkUVA55CRK_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
6194
|
+
const lowY = chunkUVA55CRK_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
6195
|
+
const openY = chunkUVA55CRK_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
6196
|
+
const closeY = chunkUVA55CRK_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
|
|
6182
6197
|
elements.push(
|
|
6183
6198
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6184
6199
|
"line",
|
|
@@ -6221,7 +6236,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6221
6236
|
textAnchor: "middle",
|
|
6222
6237
|
fontSize: 7,
|
|
6223
6238
|
fill: "#334155",
|
|
6224
|
-
children:
|
|
6239
|
+
children: chunkUVA55CRK_js.formatAxisValue(close)
|
|
6225
6240
|
},
|
|
6226
6241
|
`${element.id}-stock-dl-${ci}`
|
|
6227
6242
|
)
|
|
@@ -6263,7 +6278,7 @@ function FailedToLoad() {
|
|
|
6263
6278
|
var LazySurfaceChart3DScene = React6__default.default.lazy(
|
|
6264
6279
|
async () => {
|
|
6265
6280
|
try {
|
|
6266
|
-
return await import('./SurfaceChart3DScene-
|
|
6281
|
+
return await import('./SurfaceChart3DScene-3QB6NVKD.js');
|
|
6267
6282
|
} catch {
|
|
6268
6283
|
return { default: FailedToLoad };
|
|
6269
6284
|
}
|
|
@@ -6287,7 +6302,7 @@ var SurfaceChart3DErrorBoundary = class extends React6__default.default.Componen
|
|
|
6287
6302
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
6288
6303
|
const rows = chartData.series.length;
|
|
6289
6304
|
const cols = Math.max(categoryLabels.length, 1);
|
|
6290
|
-
const range =
|
|
6305
|
+
const range = chunkUVA55CRK_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6291
6306
|
const heightMap = new Float32Array(rows * cols);
|
|
6292
6307
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
6293
6308
|
for (let r = 0; r < rows; r++) {
|
|
@@ -6407,8 +6422,8 @@ function darkenRgb(r, g, b, factor) {
|
|
|
6407
6422
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
6408
6423
|
const style = chartData.style;
|
|
6409
6424
|
const legendPos = style?.legendPosition || "b";
|
|
6410
|
-
const layout =
|
|
6411
|
-
const range =
|
|
6425
|
+
const layout = chunkUVA55CRK_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6426
|
+
const range = chunkUVA55CRK_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6412
6427
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6413
6428
|
const seriesCount = chartData.series.length;
|
|
6414
6429
|
const cols = catCount - 1;
|
|
@@ -6498,8 +6513,8 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6498
6513
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
6499
6514
|
const style = chartData.style;
|
|
6500
6515
|
const legendPos = style?.legendPosition || "b";
|
|
6501
|
-
const layout =
|
|
6502
|
-
const range =
|
|
6516
|
+
const layout = chunkUVA55CRK_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6517
|
+
const range = chunkUVA55CRK_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6503
6518
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6504
6519
|
const seriesCount = chartData.series.length;
|
|
6505
6520
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -6562,7 +6577,7 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6562
6577
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
6563
6578
|
const style = chartData.style;
|
|
6564
6579
|
const legendPos = style?.legendPosition || "b";
|
|
6565
|
-
const layout =
|
|
6580
|
+
const layout = chunkUVA55CRK_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6566
6581
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
6567
6582
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
6568
6583
|
const rects = [];
|
|
@@ -6585,7 +6600,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
6585
6600
|
y: curY,
|
|
6586
6601
|
width: Math.max(w - 1, 1),
|
|
6587
6602
|
height: Math.max(h - 1, 1),
|
|
6588
|
-
fill:
|
|
6603
|
+
fill: chunkUVA55CRK_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
6589
6604
|
rx: 2,
|
|
6590
6605
|
opacity: 0.85
|
|
6591
6606
|
},
|
|
@@ -6638,8 +6653,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6638
6653
|
const style = chartData.style;
|
|
6639
6654
|
const legendPos = style?.legendPosition || "b";
|
|
6640
6655
|
const values = chartData.series[0]?.values ?? [];
|
|
6641
|
-
const range =
|
|
6642
|
-
const layout =
|
|
6656
|
+
const range = chunkUVA55CRK_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6657
|
+
const layout = chunkUVA55CRK_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6643
6658
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
6644
6659
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
6645
6660
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -6650,8 +6665,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6650
6665
|
const isLast = i === values.length - 1;
|
|
6651
6666
|
const startVal = isLast ? 0 : runningTotal;
|
|
6652
6667
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
6653
|
-
const barStartY =
|
|
6654
|
-
const barEndY =
|
|
6668
|
+
const barStartY = chunkUVA55CRK_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
6669
|
+
const barEndY = chunkUVA55CRK_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
|
|
6655
6670
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
6656
6671
|
const y = Math.min(barStartY, barEndY);
|
|
6657
6672
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -6680,7 +6695,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6680
6695
|
textAnchor: "middle",
|
|
6681
6696
|
fontSize: 7,
|
|
6682
6697
|
fill: "#334155",
|
|
6683
|
-
children:
|
|
6698
|
+
children: chunkUVA55CRK_js.formatAxisValue(isLast ? endVal : val)
|
|
6684
6699
|
},
|
|
6685
6700
|
`${element.id}-wf-dl-${i}`
|
|
6686
6701
|
)
|
|
@@ -6728,18 +6743,18 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6728
6743
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
6729
6744
|
const style = chartData.style;
|
|
6730
6745
|
const legendPos = style?.legendPosition || "b";
|
|
6731
|
-
const layoutOpts =
|
|
6746
|
+
const layoutOpts = chunkUVA55CRK_js.computeLayoutOptions(
|
|
6732
6747
|
chartData.axes,
|
|
6733
6748
|
chartData.dataTable,
|
|
6734
6749
|
chartData.series.length
|
|
6735
6750
|
);
|
|
6736
|
-
const layout =
|
|
6737
|
-
const { primary, secondary } =
|
|
6751
|
+
const layout = chunkUVA55CRK_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
6752
|
+
const { primary, secondary } = chunkUVA55CRK_js.splitSeriesByAxis(chartData.series, chartData.axes);
|
|
6738
6753
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
6739
6754
|
const secondarySeries = secondary.map((e) => e.series);
|
|
6740
|
-
const range =
|
|
6741
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
6742
|
-
const secondaryAxisFmt =
|
|
6755
|
+
const range = chunkUVA55CRK_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
6756
|
+
const secondaryRange = secondarySeries.length > 0 ? chunkUVA55CRK_js.computeValueRange(secondarySeries) : void 0;
|
|
6757
|
+
const secondaryAxisFmt = chunkUVA55CRK_js.getSecondaryValueAxis(chartData.axes);
|
|
6743
6758
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6744
6759
|
const barSeriesCount = 1;
|
|
6745
6760
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -6755,8 +6770,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6755
6770
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
6756
6771
|
barSeries.values.forEach((val, vi) => {
|
|
6757
6772
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
6758
|
-
const zeroY =
|
|
6759
|
-
const valY =
|
|
6773
|
+
const zeroY = chunkUVA55CRK_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
6774
|
+
const valY = chunkUVA55CRK_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
|
|
6760
6775
|
const y = Math.min(zeroY, valY);
|
|
6761
6776
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
6762
6777
|
barElements.push(
|
|
@@ -6767,7 +6782,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6767
6782
|
y,
|
|
6768
6783
|
width: barWidth,
|
|
6769
6784
|
height: h,
|
|
6770
|
-
fill:
|
|
6785
|
+
fill: chunkUVA55CRK_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
6771
6786
|
rx: 1
|
|
6772
6787
|
},
|
|
6773
6788
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -6783,7 +6798,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6783
6798
|
textAnchor: "middle",
|
|
6784
6799
|
fontSize: 7,
|
|
6785
6800
|
fill: "#334155",
|
|
6786
|
-
children:
|
|
6801
|
+
children: chunkUVA55CRK_js.formatAxisValue(val)
|
|
6787
6802
|
},
|
|
6788
6803
|
`${element.id}-combo-bar-dl-${vi}`
|
|
6789
6804
|
)
|
|
@@ -6800,10 +6815,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6800
6815
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
6801
6816
|
const points = series.values.map((val, vi) => {
|
|
6802
6817
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
6803
|
-
const y =
|
|
6818
|
+
const y = chunkUVA55CRK_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
6804
6819
|
return { x, y, val };
|
|
6805
6820
|
});
|
|
6806
|
-
const c =
|
|
6821
|
+
const c = chunkUVA55CRK_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
6807
6822
|
lineElements.push(
|
|
6808
6823
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6809
6824
|
"polyline",
|
|
@@ -6830,7 +6845,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6830
6845
|
textAnchor: "middle",
|
|
6831
6846
|
fontSize: 7,
|
|
6832
6847
|
fill: "#334155",
|
|
6833
|
-
children:
|
|
6848
|
+
children: chunkUVA55CRK_js.formatAxisValue(p.val)
|
|
6834
6849
|
},
|
|
6835
6850
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
6836
6851
|
)
|
|
@@ -7976,14 +7991,14 @@ function buildNotesPdf(pages) {
|
|
|
7976
7991
|
notes: page.notes,
|
|
7977
7992
|
slideNumber: page.slideNumber
|
|
7978
7993
|
}));
|
|
7979
|
-
const bytes =
|
|
7994
|
+
const bytes = chunkUVA55CRK_js.buildNotesPdfBytes(images, meta);
|
|
7980
7995
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
7981
7996
|
return URL.createObjectURL(blob);
|
|
7982
7997
|
}
|
|
7983
7998
|
|
|
7984
7999
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
7985
8000
|
function buildPdfFromImageData(images) {
|
|
7986
|
-
const bytes =
|
|
8001
|
+
const bytes = chunkUVA55CRK_js.buildSlidesPdfBytes(images);
|
|
7987
8002
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
7988
8003
|
return URL.createObjectURL(blob);
|
|
7989
8004
|
}
|
|
@@ -7992,7 +8007,7 @@ function buildPdfFromImageData(images) {
|
|
|
7992
8007
|
var activePreview = null;
|
|
7993
8008
|
function startPreviewAnimation(elementId, preset, options) {
|
|
7994
8009
|
stopPreviewAnimation();
|
|
7995
|
-
const descriptor =
|
|
8010
|
+
const descriptor = chunkUVA55CRK_js.buildPreviewAnimation(preset, options);
|
|
7996
8011
|
if (!descriptor) {
|
|
7997
8012
|
return;
|
|
7998
8013
|
}
|