pptx-react-viewer 2.5.3 → 2.6.1
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 +9 -0
- package/dist/{AiChatPanel-DPMHPOWF.js → AiChatPanel-LBK6YRKH.js} +22 -22
- package/dist/AiChatPanel-LBK6YRKH.js.br +0 -0
- package/dist/AiChatPanel-LBK6YRKH.js.gz +0 -0
- package/dist/{AiChatPanel-OFOOWR4U.mjs → AiChatPanel-RVZOGGFK.mjs} +3 -3
- package/dist/AiChatPanel-RVZOGGFK.mjs.br +0 -0
- package/dist/AiChatPanel-RVZOGGFK.mjs.gz +0 -0
- package/dist/{Model3DScene-PD2MDBIE.js → Model3DScene-L46RNRU5.js} +2 -2
- package/dist/Model3DScene-L46RNRU5.js.br +0 -0
- package/dist/Model3DScene-L46RNRU5.js.gz +0 -0
- package/dist/{Model3DScene-P4OKVQBF.mjs → Model3DScene-WBUZ74G3.mjs} +1 -1
- package/dist/Model3DScene-WBUZ74G3.mjs.br +0 -0
- package/dist/Model3DScene-WBUZ74G3.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-TL4ZIOI4.mjs → SurfaceChart3DScene-CB32AJS4.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-TL4ZIOI4.mjs.br → SurfaceChart3DScene-CB32AJS4.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-CB32AJS4.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-FECS3THE.js → SurfaceChart3DScene-RWMGMREC.js} +2 -2
- package/dist/SurfaceChart3DScene-RWMGMREC.js.br +0 -0
- package/dist/SurfaceChart3DScene-RWMGMREC.js.gz +0 -0
- package/dist/{chunk-UUS7QT22.js → chunk-2VE3LVKZ.js} +346 -315
- package/dist/chunk-2VE3LVKZ.js.br +0 -0
- package/dist/chunk-2VE3LVKZ.js.gz +0 -0
- package/dist/{chunk-FFLUALX5.js → chunk-4O7PPQ2V.js} +260 -240
- package/dist/chunk-4O7PPQ2V.js.br +0 -0
- package/dist/chunk-4O7PPQ2V.js.gz +0 -0
- package/dist/{chunk-ZZA62IND.mjs → chunk-54FSVX3O.mjs} +35 -4
- package/dist/chunk-54FSVX3O.mjs.br +0 -0
- package/dist/chunk-54FSVX3O.mjs.gz +0 -0
- package/dist/{chunk-H2FZ2NJ7.js → chunk-AX4Q5JWN.js} +3 -3
- package/dist/chunk-AX4Q5JWN.js.br +0 -0
- package/dist/chunk-AX4Q5JWN.js.gz +0 -0
- package/dist/{chunk-F3JUUSC4.mjs → chunk-BL3WW2BS.mjs} +95 -15
- package/dist/chunk-BL3WW2BS.mjs.br +0 -0
- package/dist/chunk-BL3WW2BS.mjs.gz +0 -0
- package/dist/{chunk-6KOM27PS.mjs → chunk-EI456HZK.mjs} +964 -64
- package/dist/chunk-EI456HZK.mjs.br +0 -0
- package/dist/chunk-EI456HZK.mjs.gz +0 -0
- package/dist/{chunk-SAXG53MO.mjs → chunk-GC6HQMVG.mjs} +1 -1
- package/dist/chunk-GC6HQMVG.mjs.br +0 -0
- package/dist/chunk-GC6HQMVG.mjs.gz +0 -0
- package/dist/{chunk-USHZUHHG.js → chunk-IEFH47TF.js} +929 -849
- package/dist/chunk-IEFH47TF.js.br +0 -0
- package/dist/chunk-IEFH47TF.js.gz +0 -0
- package/dist/{chunk-23Q3I2LM.js → chunk-T7AMP24E.js} +966 -63
- package/dist/chunk-T7AMP24E.js.br +0 -0
- package/dist/chunk-T7AMP24E.js.gz +0 -0
- package/dist/{chunk-QDIF3ZXF.mjs → chunk-ZUNDIOGD.mjs} +28 -8
- package/dist/chunk-ZUNDIOGD.mjs.br +0 -0
- package/dist/chunk-ZUNDIOGD.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 +44 -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 chunkT7AMP24E_js = require('./chunk-T7AMP24E.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 chunkT7AMP24E_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 chunkT7AMP24E_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 = chunkT7AMP24E_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 (!chunkT7AMP24E_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) => chunkT7AMP24E_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) => !chunkT7AMP24E_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 (!chunkT7AMP24E_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 = chunkT7AMP24E_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 = chunkT7AMP24E_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 (!chunkT7AMP24E_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 = chunkT7AMP24E_js.clampCropValue(element.cropLeft);
|
|
324
|
+
const cropTop = chunkT7AMP24E_js.clampCropValue(element.cropTop);
|
|
325
|
+
const cropRight = chunkT7AMP24E_js.clampCropValue(element.cropRight);
|
|
326
|
+
const cropBottom = chunkT7AMP24E_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 = chunkT7AMP24E_js.clampCropValue(cropLeft * safeHorizontalScale);
|
|
339
|
+
const normalizedRight = chunkT7AMP24E_js.clampCropValue(cropRight * safeHorizontalScale);
|
|
340
|
+
const normalizedTop = chunkT7AMP24E_js.clampCropValue(cropTop * safeVerticalScale);
|
|
341
|
+
const normalizedBottom = chunkT7AMP24E_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 (!chunkT7AMP24E_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 (!chunkT7AMP24E_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 (!chunkT7AMP24E_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 = chunkT7AMP24E_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 (!chunkT7AMP24E_js.hasTextProperties(element)) {
|
|
1175
1175
|
return { color: fallbackColor };
|
|
1176
1176
|
}
|
|
1177
1177
|
const textDecorationTokens = [];
|
|
@@ -1185,20 +1185,24 @@ 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 ? chunkT7AMP24E_js.normalizeHexColor(element.textStyle?.color, HYPERLINK_COLOR) : chunkT7AMP24E_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
|
|
1194
|
-
const
|
|
1195
|
-
const
|
|
1193
|
+
const hasParagraphIndents = (element.paragraphIndents?.length ?? 0) > 0;
|
|
1194
|
+
const bodyIndent = hasParagraphIndents ? 0 : element.textStyle?.paragraphIndent || 0;
|
|
1195
|
+
const bodyMarginLeft = hasParagraphIndents ? 0 : element.textStyle?.paragraphMarginLeft || 0;
|
|
1196
|
+
const bodyMarginRight = hasParagraphIndents ? 0 : element.textStyle?.paragraphMarginRight || 0;
|
|
1197
|
+
const writingMode = chunkT7AMP24E_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
1198
|
+
const textOrientation = chunkT7AMP24E_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
1199
|
+
const verticalDirection = chunkT7AMP24E_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
1196
1200
|
const resolvedDirection = verticalDirection || (isRtl ? "rtl" : "ltr");
|
|
1197
1201
|
const resolvedUnicodeBidi = isRtl ? "plaintext" : void 0;
|
|
1198
1202
|
const hasSegments = (element.textSegments?.length ?? 0) > 0;
|
|
1199
1203
|
return {
|
|
1200
1204
|
color: resolvedTextColor,
|
|
1201
|
-
backgroundColor: !hasSegments && element.textStyle?.highlightColor ?
|
|
1205
|
+
backgroundColor: !hasSegments && element.textStyle?.highlightColor ? chunkT7AMP24E_js.normalizeHexColor(element.textStyle.highlightColor, void 0) : void 0,
|
|
1202
1206
|
textAlign: (() => {
|
|
1203
1207
|
const a = element.textStyle?.align;
|
|
1204
1208
|
if (a === "justLow" || a === "dist" || a === "thaiDist") {
|
|
@@ -1214,12 +1218,12 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
1214
1218
|
textDecorationLine: textDecorationTokens.length > 0 ? textDecorationTokens.join(" ") : "none",
|
|
1215
1219
|
textDecorationStyle,
|
|
1216
1220
|
fontFamily: element.textStyle?.fontFamily || DEFAULT_FONT_FAMILY,
|
|
1217
|
-
lineHeight:
|
|
1221
|
+
lineHeight: chunkT7AMP24E_js.resolveLineHeight(element.textStyle, hasItalicRuns),
|
|
1218
1222
|
paddingTop: bodyTop + (hasItalicRuns ? 1 : 0),
|
|
1219
1223
|
paddingBottom: bodyBottom + (hasItalicRuns ? 1 : 0),
|
|
1220
|
-
paddingLeft: bodyLeft +
|
|
1221
|
-
paddingRight: bodyRight +
|
|
1222
|
-
textIndent:
|
|
1224
|
+
paddingLeft: bodyLeft + bodyMarginLeft,
|
|
1225
|
+
paddingRight: bodyRight + bodyMarginRight,
|
|
1226
|
+
textIndent: bodyIndent,
|
|
1223
1227
|
overflow: "visible",
|
|
1224
1228
|
writingMode,
|
|
1225
1229
|
textOrientation,
|
|
@@ -1227,7 +1231,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
1227
1231
|
// Auto-fit: use OOXML-provided fontScale/lnSpcReduction when available,
|
|
1228
1232
|
// otherwise fall back to heuristic estimation. The pure font-scale maths
|
|
1229
1233
|
// now lives in pptx-viewer-shared (computeAutoFitTextStyle).
|
|
1230
|
-
...
|
|
1234
|
+
...chunkT7AMP24E_js.computeAutoFitTextStyle({
|
|
1231
1235
|
textStyle: element.textStyle,
|
|
1232
1236
|
text: element.text ?? "",
|
|
1233
1237
|
width: element.width,
|
|
@@ -1261,13 +1265,13 @@ function computeTabSize(tabStops, defaultTabSize) {
|
|
|
1261
1265
|
return avgGap > 0 ? `${Math.round(avgGap)}px` : fromDefault;
|
|
1262
1266
|
}
|
|
1263
1267
|
function getTextLayoutStyle(element) {
|
|
1264
|
-
if (!
|
|
1268
|
+
if (!chunkT7AMP24E_js.hasTextProperties(element)) {
|
|
1265
1269
|
return {};
|
|
1266
1270
|
}
|
|
1267
1271
|
const verticalAlign = element.textStyle?.vAlign || "top";
|
|
1268
|
-
const writingMode =
|
|
1269
|
-
const textOrientation =
|
|
1270
|
-
const verticalDirection =
|
|
1272
|
+
const writingMode = chunkT7AMP24E_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
1273
|
+
const textOrientation = chunkT7AMP24E_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
1274
|
+
const verticalDirection = chunkT7AMP24E_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
1271
1275
|
const parsedColumnCount = Number(element.textStyle?.columnCount);
|
|
1272
1276
|
const columnCount = Number.isFinite(parsedColumnCount) ? Math.max(1, Math.min(16, Math.round(parsedColumnCount))) : 1;
|
|
1273
1277
|
const hasColumns = columnCount > 1;
|
|
@@ -1275,7 +1279,7 @@ function getTextLayoutStyle(element) {
|
|
|
1275
1279
|
const tabStops = element.textStyle?.tabStops;
|
|
1276
1280
|
const tabSize = computeTabSize(tabStops, element.textStyle?.defaultTabSize);
|
|
1277
1281
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
1278
|
-
const hasParagraphIndents =
|
|
1282
|
+
const hasParagraphIndents = chunkT7AMP24E_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
1279
1283
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
1280
1284
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
1281
1285
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
@@ -1284,7 +1288,7 @@ function getTextLayoutStyle(element) {
|
|
|
1284
1288
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
1285
1289
|
const parsedColumnSpacing = Number(element.textStyle?.columnSpacing);
|
|
1286
1290
|
const columnGap = Number.isFinite(parsedColumnSpacing) && parsedColumnSpacing > 0 ? `${parsedColumnSpacing}px` : "0.75em";
|
|
1287
|
-
const kinsokuStyles =
|
|
1291
|
+
const kinsokuStyles = chunkT7AMP24E_js.getKinsokuLineBreakStyles(element.textStyle);
|
|
1288
1292
|
if (hasColumns) {
|
|
1289
1293
|
return {
|
|
1290
1294
|
display: "block",
|
|
@@ -1331,10 +1335,10 @@ function getTextLayoutStyle(element) {
|
|
|
1331
1335
|
|
|
1332
1336
|
// src/viewer/utils/text-effects.tsx
|
|
1333
1337
|
function buildTextFillCss2(style) {
|
|
1334
|
-
return
|
|
1338
|
+
return chunkT7AMP24E_js.buildTextFillCss(style);
|
|
1335
1339
|
}
|
|
1336
1340
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
1337
|
-
return
|
|
1341
|
+
return chunkT7AMP24E_js.buildTextBody3DSceneStyle(textStyle);
|
|
1338
1342
|
}
|
|
1339
1343
|
|
|
1340
1344
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -1519,13 +1523,13 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1519
1523
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
1520
1524
|
return renderedSegments;
|
|
1521
1525
|
}
|
|
1522
|
-
const paraKey = `${elementId}${
|
|
1526
|
+
const paraKey = `${elementId}${chunkT7AMP24E_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
1523
1527
|
const paraState = subElementAnimStates.get(paraKey);
|
|
1524
1528
|
if (paraState) {
|
|
1525
1529
|
const style = buildAnimStyle(paraState);
|
|
1526
1530
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
1527
1531
|
}
|
|
1528
|
-
const spec =
|
|
1532
|
+
const spec = chunkT7AMP24E_js.buildTextBuildSpec(
|
|
1529
1533
|
elementId,
|
|
1530
1534
|
paraIndex,
|
|
1531
1535
|
paraSegments.map((entry) => ({ text: entry.segment.text, style: entry })),
|
|
@@ -1543,7 +1547,7 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1543
1547
|
"span",
|
|
1544
1548
|
{
|
|
1545
1549
|
"data-anim-id": span.animId,
|
|
1546
|
-
style:
|
|
1550
|
+
style: chunkT7AMP24E_js.textBuildSpanStyle(span),
|
|
1547
1551
|
children: content
|
|
1548
1552
|
},
|
|
1549
1553
|
span.animId
|
|
@@ -1687,10 +1691,10 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1687
1691
|
if (!needsScriptFonts || !text) {
|
|
1688
1692
|
return text;
|
|
1689
1693
|
}
|
|
1690
|
-
const runs =
|
|
1694
|
+
const runs = chunkT7AMP24E_js.segmentByScript(text);
|
|
1691
1695
|
if (runs.length <= 1) {
|
|
1692
1696
|
if (runs.length === 1) {
|
|
1693
|
-
const font =
|
|
1697
|
+
const font = chunkT7AMP24E_js.resolveFontForScript(runs[0].script, scriptFonts);
|
|
1694
1698
|
if (font && font !== baseFontFamily) {
|
|
1695
1699
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: text });
|
|
1696
1700
|
}
|
|
@@ -1698,7 +1702,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1698
1702
|
return text;
|
|
1699
1703
|
}
|
|
1700
1704
|
return runs.map((run, i) => {
|
|
1701
|
-
const font =
|
|
1705
|
+
const font = chunkT7AMP24E_js.resolveFontForScript(run.script, scriptFonts);
|
|
1702
1706
|
if (!font || font === baseFontFamily) {
|
|
1703
1707
|
return /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Fragment, { children: run.text }, `${keyPrefix}-r${i}`);
|
|
1704
1708
|
}
|
|
@@ -1770,8 +1774,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1770
1774
|
);
|
|
1771
1775
|
}
|
|
1772
1776
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
1773
|
-
const mathml =
|
|
1774
|
-
const safeMathml = mathml ?
|
|
1777
|
+
const mathml = chunkT7AMP24E_js.convertOmmlToMathMl(equationXml);
|
|
1778
|
+
const safeMathml = mathml ? chunkT7AMP24E_js.sanitizeMathMl(mathml) : "";
|
|
1775
1779
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1776
1780
|
"span",
|
|
1777
1781
|
{
|
|
@@ -1821,7 +1825,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1821
1825
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: equationContent }, `${elementId}-seg-${segmentIndex}`);
|
|
1822
1826
|
}
|
|
1823
1827
|
function renderPictureBullet(elementId, segmentIndex, bulletInfo, baseFontSize) {
|
|
1824
|
-
const picture =
|
|
1828
|
+
const picture = chunkT7AMP24E_js.resolvePictureBullet(bulletInfo, baseFontSize) ?? {
|
|
1825
1829
|
sizePx: baseFontSize,
|
|
1826
1830
|
fallbackMarker: "\u2022",
|
|
1827
1831
|
accessibleLabel: "Bullet"
|
|
@@ -1871,7 +1875,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1871
1875
|
);
|
|
1872
1876
|
}
|
|
1873
1877
|
const segmentStyle = segment.style || {};
|
|
1874
|
-
const textValue =
|
|
1878
|
+
const textValue = chunkT7AMP24E_js.substituteFieldText(segment.text || "", segment.fieldType, fieldContext);
|
|
1875
1879
|
const lines = textValue.split("\n");
|
|
1876
1880
|
const textDecorationTokens = [];
|
|
1877
1881
|
if (segmentStyle.underline || segmentStyle.hyperlink) {
|
|
@@ -1881,8 +1885,8 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1881
1885
|
textDecorationTokens.push("line-through");
|
|
1882
1886
|
}
|
|
1883
1887
|
const isDoubleStrike = segmentStyle.strikethrough && segmentStyle.strikeType === "dblStrike";
|
|
1884
|
-
const resolvedSegmentColor = segmentStyle.hyperlink ?
|
|
1885
|
-
const underlineDecoration =
|
|
1888
|
+
const resolvedSegmentColor = segmentStyle.hyperlink ? chunkT7AMP24E_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, HYPERLINK_COLOR) : chunkT7AMP24E_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, fallbackColor);
|
|
1889
|
+
const underlineDecoration = chunkT7AMP24E_js.resolveUnderlineDecorationStyle(
|
|
1886
1890
|
Boolean(isDoubleStrike),
|
|
1887
1891
|
segmentStyle.underlineStyle
|
|
1888
1892
|
);
|
|
@@ -1898,14 +1902,14 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1898
1902
|
const baseFontSizePt = baseFontSize * (72 / 96);
|
|
1899
1903
|
const fontKerning = typeof segmentStyle.kerning === "number" ? segmentStyle.kerning === 0 ? "none" : baseFontSizePt >= segmentStyle.kerning / 100 ? "normal" : "none" : void 0;
|
|
1900
1904
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
1901
|
-
const baseFontFamily = rawFontFamily ?
|
|
1905
|
+
const baseFontFamily = rawFontFamily ? chunkT7AMP24E_js.getSubstituteFontFamily(rawFontFamily) : DEFAULT_FONT_FAMILY;
|
|
1902
1906
|
const scriptFonts = {
|
|
1903
1907
|
latin: baseFontFamily,
|
|
1904
1908
|
eastAsia: segmentStyle.eastAsiaFont || element.textStyle?.eastAsiaFont || baseFontFamily,
|
|
1905
1909
|
complexScript: segmentStyle.complexScriptFont || element.textStyle?.complexScriptFont || baseFontFamily,
|
|
1906
1910
|
symbol: segmentStyle.symbolFont || element.textStyle?.symbolFont || baseFontFamily
|
|
1907
1911
|
};
|
|
1908
|
-
const needsScriptFonts =
|
|
1912
|
+
const needsScriptFonts = chunkT7AMP24E_js.hasDistinctScriptFonts(scriptFonts);
|
|
1909
1913
|
const spanStyle = {
|
|
1910
1914
|
color: resolvedSegmentColor,
|
|
1911
1915
|
fontSize: baseFontSize * baselineFontScale,
|
|
@@ -1923,15 +1927,15 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1923
1927
|
fontVariantCaps: segmentStyle.textCaps === "small" ? "small-caps" : void 0,
|
|
1924
1928
|
letterSpacing,
|
|
1925
1929
|
fontKerning,
|
|
1926
|
-
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ?
|
|
1930
|
+
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ? chunkT7AMP24E_js.normalizeHexColor(segmentStyle.highlightColor, "transparent") : void 0,
|
|
1927
1931
|
...textFillStyles,
|
|
1928
|
-
textDecorationColor: segmentStyle.underlineColor ?
|
|
1929
|
-
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${
|
|
1932
|
+
textDecorationColor: segmentStyle.underlineColor ? chunkT7AMP24E_js.normalizeHexColor(segmentStyle.underlineColor, void 0) : void 0,
|
|
1933
|
+
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${chunkT7AMP24E_js.normalizeHexColor(segmentStyle.textOutlineColor, "#000000")}` : segmentStyle.textOutlineWidth ? `${segmentStyle.textOutlineWidth}px currentColor` : void 0,
|
|
1930
1934
|
paintOrder: segmentStyle.textOutlineWidth ? "stroke fill" : void 0,
|
|
1931
|
-
textShadow:
|
|
1932
|
-
filter:
|
|
1933
|
-
opacity:
|
|
1934
|
-
WebkitBoxReflect:
|
|
1935
|
+
textShadow: chunkT7AMP24E_js.buildTextShadowCss(segmentStyle),
|
|
1936
|
+
filter: chunkT7AMP24E_js.buildTextRunFilterChain(segmentStyle),
|
|
1937
|
+
opacity: chunkT7AMP24E_js.getTextAlphaOpacity(segmentStyle),
|
|
1938
|
+
WebkitBoxReflect: chunkT7AMP24E_js.buildTextReflectionCss(segmentStyle)
|
|
1935
1939
|
};
|
|
1936
1940
|
const runRtl = segmentStyle.rtl;
|
|
1937
1941
|
if (runRtl !== void 0 && runRtl !== paragraphRtl) {
|
|
@@ -1951,7 +1955,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1951
1955
|
spanStyle.fontSize = baseFontSize * (bulletInfo.sizePercent / 100) * baselineFontScale;
|
|
1952
1956
|
}
|
|
1953
1957
|
if (bulletInfo.color) {
|
|
1954
|
-
spanStyle.color =
|
|
1958
|
+
spanStyle.color = chunkT7AMP24E_js.normalizeHexColor(bulletInfo.color, resolvedSegmentColor);
|
|
1955
1959
|
}
|
|
1956
1960
|
}
|
|
1957
1961
|
if (bulletInfo?.imageDataUrl || bulletInfo?.imageRelId) {
|
|
@@ -1991,7 +1995,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1991
1995
|
textAlign: segment.rubyAlignment === "l" ? "left" : segment.rubyAlignment === "r" ? "right" : segment.rubyAlignment === "dist" || segment.rubyAlignment === "distCat" || segment.rubyAlignment === "distLetter" ? "justify" : "center"
|
|
1992
1996
|
};
|
|
1993
1997
|
if (segment.rubyStyle?.color) {
|
|
1994
|
-
rubyStyle.color =
|
|
1998
|
+
rubyStyle.color = chunkT7AMP24E_js.normalizeHexColor(segment.rubyStyle.color, resolvedSegmentColor);
|
|
1995
1999
|
}
|
|
1996
2000
|
innerContent = /* @__PURE__ */ jsxRuntime.jsxs("ruby", { children: [
|
|
1997
2001
|
baseContent,
|
|
@@ -2086,7 +2090,7 @@ function groupSegmentsIntoParagraphs(segments) {
|
|
|
2086
2090
|
return paragraphs;
|
|
2087
2091
|
}
|
|
2088
2092
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick) {
|
|
2089
|
-
if (!
|
|
2093
|
+
if (!chunkT7AMP24E_js.hasTextProperties(element)) {
|
|
2090
2094
|
return emptyFallback || null;
|
|
2091
2095
|
}
|
|
2092
2096
|
const effectiveSegments = segmentOverrides ?? element.textSegments;
|
|
@@ -2107,10 +2111,10 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2107
2111
|
return element.text || emptyFallback || "";
|
|
2108
2112
|
}
|
|
2109
2113
|
const paragraphs = groupSegmentsIntoParagraphs(effectiveSegments);
|
|
2110
|
-
const paragraphIndents =
|
|
2111
|
-
const elementRtl =
|
|
2112
|
-
const elementAlign =
|
|
2113
|
-
const bodyStyle =
|
|
2114
|
+
const paragraphIndents = chunkT7AMP24E_js.hasTextProperties(element) ? element.paragraphIndents : void 0;
|
|
2115
|
+
const elementRtl = chunkT7AMP24E_js.hasTextProperties(element) ? element.textStyle?.rtl : void 0;
|
|
2116
|
+
const elementAlign = chunkT7AMP24E_js.hasTextProperties(element) ? element.textStyle?.align : void 0;
|
|
2117
|
+
const bodyStyle = chunkT7AMP24E_js.hasTextProperties(element) ? element.textStyle : void 0;
|
|
2114
2118
|
const spaceFirstLast = bodyStyle?.spaceFirstLastParagraph !== false;
|
|
2115
2119
|
return paragraphs.map((paraSegments, paraIndex) => {
|
|
2116
2120
|
const paraIndent = paragraphIndents?.[paraIndex];
|
|
@@ -2125,14 +2129,14 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2125
2129
|
return Boolean(segment.text) && segment.text.trim().length > 0;
|
|
2126
2130
|
});
|
|
2127
2131
|
const hasBullet = bulletInfo && !bulletInfo.none && hasVisibleTextContent;
|
|
2128
|
-
const paraRtl =
|
|
2132
|
+
const paraRtl = chunkT7AMP24E_js.resolveParagraphRtl(paraSegments, elementRtl);
|
|
2129
2133
|
const isRtlParagraph = paraRtl === true;
|
|
2130
|
-
const paraAlign =
|
|
2131
|
-
const cssTextAlign =
|
|
2134
|
+
const paraAlign = chunkT7AMP24E_js.resolveParagraphAlign(paraSegments, elementAlign);
|
|
2135
|
+
const cssTextAlign = chunkT7AMP24E_js.resolveCssTextAlign(paraAlign, isRtlParagraph);
|
|
2132
2136
|
const paraMarginLeft = isRtlParagraph ? void 0 : rawMarginLeft;
|
|
2133
2137
|
const paraMarginRight = isRtlParagraph ? rawMarginLeft : void 0;
|
|
2134
2138
|
const paraTextIndent = rawTextIndent;
|
|
2135
|
-
const paraKinsokuStyle =
|
|
2139
|
+
const paraKinsokuStyle = chunkT7AMP24E_js.getKinsokuLineBreakStyles(firstSeg?.segment.style);
|
|
2136
2140
|
const hasParaKinsoku = Object.keys(paraKinsokuStyle).length > 0;
|
|
2137
2141
|
const paraProps = effectiveSegments[firstSeg?.globalIndex ?? -1]?.paragraphProperties;
|
|
2138
2142
|
const spacing = resolveParagraphSpacing({
|
|
@@ -2142,10 +2146,17 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2142
2146
|
isLast: paraIndex === paragraphs.length - 1,
|
|
2143
2147
|
spaceFirstLast
|
|
2144
2148
|
});
|
|
2149
|
+
const strutFontSize = chunkT7AMP24E_js.resolveParagraphStrutFontSize(
|
|
2150
|
+
paraSegments.map(({ segment }) => segment),
|
|
2151
|
+
bodyStyle?.fontSize
|
|
2152
|
+
);
|
|
2145
2153
|
const hasParaSpacing = spacing.marginTop !== void 0 || spacing.marginBottom !== void 0 || spacing.lineHeight !== void 0;
|
|
2146
2154
|
const paraStyle = {
|
|
2147
2155
|
...paraKinsokuStyle
|
|
2148
2156
|
};
|
|
2157
|
+
if (strutFontSize !== void 0) {
|
|
2158
|
+
paraStyle.fontSize = strutFontSize;
|
|
2159
|
+
}
|
|
2149
2160
|
if (spacing.marginTop !== void 0) {
|
|
2150
2161
|
paraStyle.marginTop = spacing.marginTop;
|
|
2151
2162
|
}
|
|
@@ -2171,7 +2182,7 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2171
2182
|
if (cssTextAlign !== void 0) {
|
|
2172
2183
|
paraStyle.textAlign = cssTextAlign;
|
|
2173
2184
|
}
|
|
2174
|
-
const needsWrapper = paraMarginLeft !== void 0 || paraMarginRight !== void 0 || paraTextIndent !== void 0 || hasBullet || paraRtl !== void 0 || cssTextAlign !== void 0 || hasParaKinsoku || hasParaSpacing;
|
|
2185
|
+
const needsWrapper = paraMarginLeft !== void 0 || paraMarginRight !== void 0 || paraTextIndent !== void 0 || hasBullet || paraRtl !== void 0 || cssTextAlign !== void 0 || hasParaKinsoku || hasParaSpacing || strutFontSize !== void 0;
|
|
2175
2186
|
const renderedSegments = paraSegments.filter(({ segment }) => {
|
|
2176
2187
|
if (!hasBullet && segment.bulletInfo) {
|
|
2177
2188
|
return false;
|
|
@@ -2213,13 +2224,14 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2213
2224
|
requireCtrlClick
|
|
2214
2225
|
)
|
|
2215
2226
|
);
|
|
2227
|
+
const isBlankParagraph = renderedSegments.length === 0;
|
|
2216
2228
|
if (!needsWrapper) {
|
|
2217
2229
|
return /* @__PURE__ */ jsxRuntime.jsxs(React6__default.default.Fragment, { children: [
|
|
2218
2230
|
wrappedContent,
|
|
2219
2231
|
paraIndex < paragraphs.length - 1 ? /* @__PURE__ */ jsxRuntime.jsx("br", {}) : null
|
|
2220
2232
|
] }, `${element.id}-para-${paraIndex}`);
|
|
2221
2233
|
}
|
|
2222
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: paraStyle, children: wrappedContent }, `${element.id}-para-${paraIndex}`);
|
|
2234
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: paraStyle, children: isBlankParagraph ? /* @__PURE__ */ jsxRuntime.jsx("br", {}) : wrappedContent }, `${element.id}-para-${paraIndex}`);
|
|
2223
2235
|
});
|
|
2224
2236
|
}
|
|
2225
2237
|
function hexToRgbUnit(hex) {
|
|
@@ -2234,13 +2246,13 @@ function hexToRgbUnit(hex) {
|
|
|
2234
2246
|
};
|
|
2235
2247
|
}
|
|
2236
2248
|
function getDuotoneColors(element) {
|
|
2237
|
-
if (!
|
|
2249
|
+
if (!chunkT7AMP24E_js.isImageLikeElement(element)) {
|
|
2238
2250
|
return void 0;
|
|
2239
2251
|
}
|
|
2240
2252
|
return element.imageEffects?.duotone;
|
|
2241
2253
|
}
|
|
2242
2254
|
function buildLineShadowCss(element) {
|
|
2243
|
-
if (!
|
|
2255
|
+
if (!chunkT7AMP24E_js.hasShapeProperties(element)) {
|
|
2244
2256
|
return void 0;
|
|
2245
2257
|
}
|
|
2246
2258
|
const ss = element.shapeStyle;
|
|
@@ -2251,13 +2263,13 @@ function buildLineShadowCss(element) {
|
|
|
2251
2263
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
2252
2264
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
2253
2265
|
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
|
-
|
|
2266
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkT7AMP24E_js.colorWithOpacity(
|
|
2267
|
+
chunkT7AMP24E_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
2256
2268
|
opacity
|
|
2257
2269
|
)}`;
|
|
2258
2270
|
}
|
|
2259
2271
|
function buildLineGlowFilter(element) {
|
|
2260
|
-
if (!
|
|
2272
|
+
if (!chunkT7AMP24E_js.hasShapeProperties(element)) {
|
|
2261
2273
|
return void 0;
|
|
2262
2274
|
}
|
|
2263
2275
|
const ss = element.shapeStyle;
|
|
@@ -2266,7 +2278,7 @@ function buildLineGlowFilter(element) {
|
|
|
2266
2278
|
}
|
|
2267
2279
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
2268
2280
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
2269
|
-
const glowCol =
|
|
2281
|
+
const glowCol = chunkT7AMP24E_js.colorWithOpacity(chunkT7AMP24E_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
2270
2282
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
2271
2283
|
}
|
|
2272
2284
|
function mapDagBlendModeToCss(blend) {
|
|
@@ -2290,7 +2302,7 @@ function getDagDuotoneFilterId(elementId) {
|
|
|
2290
2302
|
return `dag-duotone-${elementId}`;
|
|
2291
2303
|
}
|
|
2292
2304
|
function hasDagDuotoneEffect(element) {
|
|
2293
|
-
if (!
|
|
2305
|
+
if (!chunkT7AMP24E_js.hasShapeProperties(element)) {
|
|
2294
2306
|
return false;
|
|
2295
2307
|
}
|
|
2296
2308
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
@@ -2353,7 +2365,7 @@ function getRoundRectRadiusPx2(element) {
|
|
|
2353
2365
|
|
|
2354
2366
|
// src/viewer/utils/shape-visual-3d.ts
|
|
2355
2367
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
2356
|
-
return
|
|
2368
|
+
return chunkT7AMP24E_js.build3DExtrusionData(
|
|
2357
2369
|
shape3d,
|
|
2358
2370
|
scene3d,
|
|
2359
2371
|
fillColor,
|
|
@@ -2362,7 +2374,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
2362
2374
|
);
|
|
2363
2375
|
}
|
|
2364
2376
|
function apply3dEffects2(base, scene3d, shape3d, fillColorFallback) {
|
|
2365
|
-
|
|
2377
|
+
chunkT7AMP24E_js.apply3dEffects(base, scene3d, shape3d, fillColorFallback);
|
|
2366
2378
|
}
|
|
2367
2379
|
|
|
2368
2380
|
// src/viewer/utils/vector-subpath-paint.ts
|
|
@@ -2371,7 +2383,7 @@ function toHexByte(value) {
|
|
|
2371
2383
|
return clamped.toString(16).padStart(2, "0");
|
|
2372
2384
|
}
|
|
2373
2385
|
function shiftHex(hex, factor, towardsWhite) {
|
|
2374
|
-
const channels =
|
|
2386
|
+
const channels = chunkT7AMP24E_js.hexToRgbChannels(hex);
|
|
2375
2387
|
if (!channels) {
|
|
2376
2388
|
return hex;
|
|
2377
2389
|
}
|
|
@@ -2397,13 +2409,13 @@ function buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity) {
|
|
|
2397
2409
|
const fillOff = subpath.fillMode === "none" || !hasFill;
|
|
2398
2410
|
return {
|
|
2399
2411
|
d: subpath.d,
|
|
2400
|
-
fill: fillOff ? "none" :
|
|
2412
|
+
fill: fillOff ? "none" : chunkT7AMP24E_js.colorWithOpacity(adjustFillForMode(fillColor, subpath.fillMode), fillOpacity),
|
|
2401
2413
|
stroked: subpath.stroke !== false
|
|
2402
2414
|
};
|
|
2403
2415
|
});
|
|
2404
2416
|
}
|
|
2405
2417
|
function getStrokeOnlyPresetPaths(element) {
|
|
2406
|
-
if (element.type !== "shape" || !
|
|
2418
|
+
if (element.type !== "shape" || !chunkT7AMP24E_js.hasShapeProperties(element)) {
|
|
2407
2419
|
return void 0;
|
|
2408
2420
|
}
|
|
2409
2421
|
const shapeType = element.shapeType;
|
|
@@ -2413,7 +2425,7 @@ function getStrokeOnlyPresetPaths(element) {
|
|
|
2413
2425
|
if (element.pathData) {
|
|
2414
2426
|
return void 0;
|
|
2415
2427
|
}
|
|
2416
|
-
const result =
|
|
2428
|
+
const result = chunkT7AMP24E_js.evaluatePresetShape(
|
|
2417
2429
|
shapeType,
|
|
2418
2430
|
Math.max(element.width, 1),
|
|
2419
2431
|
Math.max(element.height, 1),
|
|
@@ -2428,27 +2440,27 @@ function getStrokeOnlyPresetPaths(element) {
|
|
|
2428
2440
|
|
|
2429
2441
|
// src/viewer/utils/shape-visual-style.ts
|
|
2430
2442
|
function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2431
|
-
if (!
|
|
2443
|
+
if (!chunkT7AMP24E_js.hasShapeProperties(element)) {
|
|
2432
2444
|
return {};
|
|
2433
2445
|
}
|
|
2434
2446
|
const normalizedShapeType = getShapeType(element.shapeType);
|
|
2435
|
-
const clipPath =
|
|
2447
|
+
const clipPath = chunkT7AMP24E_js.getResolvedShapeClipPath(element);
|
|
2436
2448
|
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
2449
|
const rendersStrokeOnlyPreset = Boolean(getStrokeOnlyPresetPaths(element));
|
|
2438
2450
|
const fillOpacity = element.shapeStyle?.fillOpacity;
|
|
2439
2451
|
const strokeOpacity = element.shapeStyle?.strokeOpacity;
|
|
2440
|
-
const strokeDash =
|
|
2441
|
-
const fillGradient =
|
|
2442
|
-
const shadowCss =
|
|
2443
|
-
const innerShadowCss =
|
|
2444
|
-
const resolvedFillColor =
|
|
2445
|
-
const resolvedStrokeColor =
|
|
2452
|
+
const strokeDash = chunkT7AMP24E_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2453
|
+
const fillGradient = chunkT7AMP24E_js.buildCssGradientFromShapeStyle(element.shapeStyle) || element.shapeStyle?.fillGradient;
|
|
2454
|
+
const shadowCss = chunkT7AMP24E_js.buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
2455
|
+
const innerShadowCss = chunkT7AMP24E_js.buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
2456
|
+
const resolvedFillColor = chunkT7AMP24E_js.colorWithOpacity(fillColor, fillOpacity);
|
|
2457
|
+
const resolvedStrokeColor = chunkT7AMP24E_js.colorWithOpacity(strokeColor, strokeOpacity);
|
|
2446
2458
|
const ss = element.shapeStyle;
|
|
2447
2459
|
const hasFillOverlayColor = Boolean(
|
|
2448
2460
|
ss?.dagFillOverlayColor && ss.dagFillOverlayColor !== "transparent"
|
|
2449
2461
|
);
|
|
2450
2462
|
const combinedShadowParts = [];
|
|
2451
|
-
const multiLayerShadow =
|
|
2463
|
+
const multiLayerShadow = chunkT7AMP24E_js.buildMultiLayerShadowCss(element.shapeStyle);
|
|
2452
2464
|
if (multiLayerShadow) {
|
|
2453
2465
|
combinedShadowParts.push(multiLayerShadow);
|
|
2454
2466
|
} else if (shadowCss) {
|
|
@@ -2457,7 +2469,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2457
2469
|
if (innerShadowCss) {
|
|
2458
2470
|
combinedShadowParts.push(innerShadowCss);
|
|
2459
2471
|
}
|
|
2460
|
-
const glowBoxShadow =
|
|
2472
|
+
const glowBoxShadow = chunkT7AMP24E_js.buildGlowBoxShadow(ss?.glowColor, ss?.glowRadius, ss?.glowOpacity);
|
|
2461
2473
|
if (glowBoxShadow) {
|
|
2462
2474
|
combinedShadowParts.push(glowBoxShadow);
|
|
2463
2475
|
}
|
|
@@ -2465,7 +2477,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2465
2477
|
if (lineShadow) {
|
|
2466
2478
|
combinedShadowParts.push(lineShadow);
|
|
2467
2479
|
}
|
|
2468
|
-
const compoundLineShadow =
|
|
2480
|
+
const compoundLineShadow = chunkT7AMP24E_js.getCompoundLineBoxShadow(
|
|
2469
2481
|
element.shapeStyle?.compoundLine,
|
|
2470
2482
|
strokeWidth,
|
|
2471
2483
|
resolvedStrokeColor
|
|
@@ -2478,11 +2490,11 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2478
2490
|
if (ss?.glowColor && ss.glowColor !== "transparent" && ss.glowRadius) {
|
|
2479
2491
|
const glowOpacity = typeof ss.glowOpacity === "number" ? ss.glowOpacity : 0.75;
|
|
2480
2492
|
const glowRad = Math.round(Math.max(0, ss.glowRadius));
|
|
2481
|
-
const glowCol =
|
|
2493
|
+
const glowCol = chunkT7AMP24E_js.colorWithOpacity(chunkT7AMP24E_js.normalizeHexColor(ss.glowColor, "#ffff00"), glowOpacity);
|
|
2482
2494
|
filterParts.push(`drop-shadow(0 0 ${glowRad}px ${glowCol})`);
|
|
2483
2495
|
}
|
|
2484
2496
|
if (typeof ss?.softEdgeRadius === "number" && ss.softEdgeRadius > 0) {
|
|
2485
|
-
filterParts.push(`url(#${
|
|
2497
|
+
filterParts.push(`url(#${chunkT7AMP24E_js.getSoftEdgeFilterId(element.id)})`);
|
|
2486
2498
|
}
|
|
2487
2499
|
if (typeof ss?.blurRadius === "number" && ss.blurRadius > 0) {
|
|
2488
2500
|
filterParts.push(`blur(${Math.round(ss.blurRadius)}px)`);
|
|
@@ -2491,13 +2503,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2491
2503
|
if (lineGlowCss) {
|
|
2492
2504
|
filterParts.push(lineGlowCss);
|
|
2493
2505
|
}
|
|
2494
|
-
const dagFilter =
|
|
2506
|
+
const dagFilter = chunkT7AMP24E_js.getEffectDagFilter(ss, element.id);
|
|
2495
2507
|
if (dagFilter) {
|
|
2496
2508
|
filterParts.push(dagFilter);
|
|
2497
2509
|
}
|
|
2498
2510
|
const lineJoinCss = ss?.lineJoin === "round" ? "round" : ss?.lineJoin === "bevel" ? "bevel" : ss?.lineJoin === "miter" ? "miter" : void 0;
|
|
2499
2511
|
const miterLimitCss = ss?.lineJoin === "miter" && typeof ss?.miterLimit === "number" ? Math.max(ss.miterLimit / 1e5, 1) : void 0;
|
|
2500
|
-
const patternFill =
|
|
2512
|
+
const patternFill = chunkT7AMP24E_js.buildPatternFillCss(element.shapeStyle);
|
|
2501
2513
|
const imageFillUrl = ss?.fillMode === "image" && ss.fillImageUrl ? ss.fillImageUrl : void 0;
|
|
2502
2514
|
const imageFillMode = ss?.fillImageMode || "stretch";
|
|
2503
2515
|
let reflectCss;
|
|
@@ -2509,7 +2521,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2509
2521
|
const endOpacity = typeof ss.reflectionEndOpacity === "number" ? ss.reflectionEndOpacity : 0;
|
|
2510
2522
|
const fadeLength = typeof ss.reflectionEndPosition === "number" ? Math.round(ss.reflectionEndPosition * Math.max(element.height, 1)) : 100;
|
|
2511
2523
|
const blurRadius = typeof ss.reflectionBlurRadius === "number" ? ss.reflectionBlurRadius : 0;
|
|
2512
|
-
reflectCss =
|
|
2524
|
+
reflectCss = chunkT7AMP24E_js.buildReflectionCss(distance, startOpacity, endOpacity, fadeLength, blurRadius);
|
|
2513
2525
|
}
|
|
2514
2526
|
}
|
|
2515
2527
|
const base = {
|
|
@@ -2543,9 +2555,17 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2543
2555
|
// is present, `ShapeEffectOverlay` paints a separate blended tint layer so
|
|
2544
2556
|
// the colour is actually rendered (and text/children are not tinted).
|
|
2545
2557
|
mixBlendMode: hasFillOverlayColor ? void 0 : mapDagBlendModeToCss(ss?.dagFillOverlayBlend),
|
|
2546
|
-
|
|
2558
|
+
// An unstroked element must occupy EXACTLY its authored box. The
|
|
2559
|
+
// container class carries a 1px (transparent) border for the
|
|
2560
|
+
// selection/hover affordance and `box-sizing: border-box`, which
|
|
2561
|
+
// silently shrank every unstroked element's content by 2px and shifted
|
|
2562
|
+
// it 1px down-right. On a 40x40 icon that is a visible 5% shrink, and
|
|
2563
|
+
// two adjacent 40px buttons rendered with a 2px gap PowerPoint does not
|
|
2564
|
+
// draw. The affordance is an `outline` instead (see `ElementRenderer`),
|
|
2565
|
+
// which paints in the same place without taking part in layout.
|
|
2566
|
+
borderWidth: strokeWidth > 0 ? chunkT7AMP24E_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : 0,
|
|
2547
2567
|
borderColor: strokeWidth > 0 ? resolvedStrokeColor : void 0,
|
|
2548
|
-
borderStyle: strokeWidth > 0 ?
|
|
2568
|
+
borderStyle: strokeWidth > 0 ? chunkT7AMP24E_js.getCssBorderDashStyle(strokeDash, ss?.compoundLine) : void 0,
|
|
2549
2569
|
strokeLinejoin: lineJoinCss,
|
|
2550
2570
|
strokeMiterlimit: miterLimitCss,
|
|
2551
2571
|
strokeLinecap: ss?.lineCap === "rnd" ? "round" : ss?.lineCap === "sq" ? "square" : ss?.lineCap === "flat" ? "butt" : void 0
|
|
@@ -2601,7 +2621,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2601
2621
|
borderWidth: 0,
|
|
2602
2622
|
borderTopWidth: Math.max(strokeWidth, 2),
|
|
2603
2623
|
borderTopColor: resolvedStrokeColor,
|
|
2604
|
-
borderTopStyle:
|
|
2624
|
+
borderTopStyle: chunkT7AMP24E_js.getCssBorderDashStyle(strokeDash)
|
|
2605
2625
|
};
|
|
2606
2626
|
}
|
|
2607
2627
|
if (normalizedShapeType === "cylinder") {
|
|
@@ -2615,13 +2635,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2615
2635
|
function getConnectorAdjustment(element, key, fallback) {
|
|
2616
2636
|
const direct = element.shapeAdjustments?.[key];
|
|
2617
2637
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
2618
|
-
return
|
|
2638
|
+
return chunkT7AMP24E_js.clampUnitInterval(direct / 1e5);
|
|
2619
2639
|
}
|
|
2620
2640
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
2621
2641
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
2622
|
-
return
|
|
2642
|
+
return chunkT7AMP24E_js.clampUnitInterval(fallbackKey / 1e5);
|
|
2623
2643
|
}
|
|
2624
|
-
return
|
|
2644
|
+
return chunkT7AMP24E_js.clampUnitInterval(fallback);
|
|
2625
2645
|
}
|
|
2626
2646
|
function getConnectorPathGeometry(element) {
|
|
2627
2647
|
const width = Math.max(element.width, 1);
|
|
@@ -2758,11 +2778,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
|
|
|
2758
2778
|
strokePaint,
|
|
2759
2779
|
strokeWidth,
|
|
2760
2780
|
dashArray,
|
|
2761
|
-
lineCap:
|
|
2781
|
+
lineCap: chunkT7AMP24E_js.svgLineCap(shapeStyle?.lineCap),
|
|
2762
2782
|
lineJoin,
|
|
2763
2783
|
miterLimit,
|
|
2764
|
-
offsets:
|
|
2765
|
-
widths:
|
|
2784
|
+
offsets: chunkT7AMP24E_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
2785
|
+
widths: chunkT7AMP24E_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
|
|
2766
2786
|
};
|
|
2767
2787
|
}
|
|
2768
2788
|
function strokeStrands(d, keyBase, ctx) {
|
|
@@ -2785,7 +2805,7 @@ function strokeStrands(d, keyBase, ctx) {
|
|
|
2785
2805
|
}
|
|
2786
2806
|
function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredPaths, shapeStyle, hasFill, fillColor, fillOpacity, strokePaint, strokeWidth, dashArray, animatesFill = false) {
|
|
2787
2807
|
const ctx = strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray);
|
|
2788
|
-
const subpaths = structuredPaths && structuredPaths.length > 0 ?
|
|
2808
|
+
const subpaths = structuredPaths && structuredPaths.length > 0 ? chunkT7AMP24E_js.customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
2789
2809
|
const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
|
|
2790
2810
|
const nodes = [];
|
|
2791
2811
|
if (subpaths && needsPerSubpath) {
|
|
@@ -2816,7 +2836,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2816
2836
|
"path",
|
|
2817
2837
|
{
|
|
2818
2838
|
d: pathData,
|
|
2819
|
-
fill: animatesFill ? "inherit" :
|
|
2839
|
+
fill: animatesFill ? "inherit" : chunkT7AMP24E_js.colorWithOpacity(fillColor, fillOpacity),
|
|
2820
2840
|
stroke: "none",
|
|
2821
2841
|
vectorEffect: "non-scaling-stroke"
|
|
2822
2842
|
},
|
|
@@ -2858,14 +2878,14 @@ function renderStrokeOnlyPreset(presetPaths, width, height, shapeStyle, strokePa
|
|
|
2858
2878
|
);
|
|
2859
2879
|
}
|
|
2860
2880
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2861
|
-
if (!
|
|
2881
|
+
if (!chunkT7AMP24E_js.hasShapeProperties(element)) {
|
|
2862
2882
|
return null;
|
|
2863
2883
|
}
|
|
2864
2884
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
2865
|
-
const fillPaint = animatesFill ? "inherit" :
|
|
2866
|
-
const strokePaint = animatesStroke ? "inherit" :
|
|
2867
|
-
const dashType =
|
|
2868
|
-
const dashArray =
|
|
2885
|
+
const fillPaint = animatesFill ? "inherit" : chunkT7AMP24E_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
2886
|
+
const strokePaint = animatesStroke ? "inherit" : chunkT7AMP24E_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
2887
|
+
const dashType = chunkT7AMP24E_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2888
|
+
const dashArray = chunkT7AMP24E_js.getSvgStrokeDasharray(
|
|
2869
2889
|
dashType,
|
|
2870
2890
|
Math.max(strokeWidth, 1),
|
|
2871
2891
|
element.shapeStyle?.customDashSegments
|
|
@@ -2944,18 +2964,18 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2944
2964
|
Boolean(animatesFill)
|
|
2945
2965
|
);
|
|
2946
2966
|
}
|
|
2947
|
-
if (
|
|
2967
|
+
if (chunkT7AMP24E_js.isCalloutShape(normalizedType)) {
|
|
2948
2968
|
const width = Math.max(element.width, 1);
|
|
2949
2969
|
const height = Math.max(element.height, 1);
|
|
2950
|
-
const geometry =
|
|
2970
|
+
const geometry = chunkT7AMP24E_js.getCalloutLeaderLineGeometry(
|
|
2951
2971
|
normalizedType,
|
|
2952
2972
|
width,
|
|
2953
2973
|
height,
|
|
2954
2974
|
element.shapeAdjustments
|
|
2955
2975
|
);
|
|
2956
2976
|
if (geometry && geometry.points.length >= 2) {
|
|
2957
|
-
const leaderPath =
|
|
2958
|
-
const bounds =
|
|
2977
|
+
const leaderPath = chunkT7AMP24E_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
2978
|
+
const bounds = chunkT7AMP24E_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
2959
2979
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
2960
2980
|
const offsetLeft = bounds.minX;
|
|
2961
2981
|
const offsetTop = bounds.minY;
|
|
@@ -3018,10 +3038,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
3018
3038
|
const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
|
|
3019
3039
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
3020
3040
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
3021
|
-
const connectorLineCap =
|
|
3041
|
+
const connectorLineCap = chunkT7AMP24E_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
3022
3042
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
3023
|
-
const offsets =
|
|
3024
|
-
const widths =
|
|
3043
|
+
const offsets = chunkT7AMP24E_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
3044
|
+
const widths = chunkT7AMP24E_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
3025
3045
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3026
3046
|
"svg",
|
|
3027
3047
|
{
|
|
@@ -3100,15 +3120,15 @@ function parseGradientFillCss(gradFill) {
|
|
|
3100
3120
|
}
|
|
3101
3121
|
const parsed = stops.map((gs) => {
|
|
3102
3122
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
3103
|
-
const color =
|
|
3104
|
-
const opacity =
|
|
3105
|
-
return { pos, color:
|
|
3123
|
+
const color = chunkT7AMP24E_js.parseDrawingColor(gs) ?? "#888888";
|
|
3124
|
+
const opacity = chunkT7AMP24E_js.parseDrawingColorOpacity(gs);
|
|
3125
|
+
return { pos, color: chunkT7AMP24E_js.colorWithOpacity(color, opacity) };
|
|
3106
3126
|
}).sort((a, b) => a.pos - b.pos);
|
|
3107
3127
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
3108
3128
|
const lin = gradFill["a:lin"];
|
|
3109
3129
|
if (lin) {
|
|
3110
3130
|
const angRaw = Number.parseInt(String(lin["@_ang"] || "0"), 10);
|
|
3111
|
-
const angleDeg = Math.round(
|
|
3131
|
+
const angleDeg = Math.round(chunkT7AMP24E_js.ooxmlGradientAngleToCssDegrees(angRaw / 6e4));
|
|
3112
3132
|
return `linear-gradient(${angleDeg}deg, ${stopStrings})`;
|
|
3113
3133
|
}
|
|
3114
3134
|
const path = gradFill["a:path"];
|
|
@@ -3143,8 +3163,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
3143
3163
|
if (!pattFill) {
|
|
3144
3164
|
return void 0;
|
|
3145
3165
|
}
|
|
3146
|
-
const fgColor =
|
|
3147
|
-
const bgColor =
|
|
3166
|
+
const fgColor = chunkT7AMP24E_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
3167
|
+
const bgColor = chunkT7AMP24E_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
3148
3168
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
3149
3169
|
switch (preset) {
|
|
3150
3170
|
case "ltHorz":
|
|
@@ -3255,11 +3275,11 @@ function parseCellBorders(cellProperties) {
|
|
|
3255
3275
|
const prstDash = ln["a:prstDash"];
|
|
3256
3276
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
3257
3277
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
3258
|
-
const color =
|
|
3278
|
+
const color = chunkT7AMP24E_js.parseDrawingColor(ln["a:solidFill"]);
|
|
3259
3279
|
if (color) {
|
|
3260
|
-
const opacity =
|
|
3280
|
+
const opacity = chunkT7AMP24E_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
3261
3281
|
const key = `${edge.prefix}`;
|
|
3262
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
3282
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkT7AMP24E_js.colorWithOpacity(color, opacity)}`;
|
|
3263
3283
|
}
|
|
3264
3284
|
}
|
|
3265
3285
|
return borderStyle;
|
|
@@ -3272,7 +3292,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3272
3292
|
const textShadowParts = [];
|
|
3273
3293
|
const outerShdw = effectLst["a:outerShdw"];
|
|
3274
3294
|
if (outerShdw) {
|
|
3275
|
-
const shdwColor =
|
|
3295
|
+
const shdwColor = chunkT7AMP24E_js.parseDrawingColor(outerShdw);
|
|
3276
3296
|
if (shdwColor) {
|
|
3277
3297
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
3278
3298
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -3290,7 +3310,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3290
3310
|
}
|
|
3291
3311
|
const glow = effectLst["a:glow"];
|
|
3292
3312
|
if (glow) {
|
|
3293
|
-
const glowColor =
|
|
3313
|
+
const glowColor = chunkT7AMP24E_js.parseDrawingColor(glow);
|
|
3294
3314
|
if (glowColor) {
|
|
3295
3315
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
3296
3316
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -3369,10 +3389,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3369
3389
|
if (runProps?.["@_u"] !== void 0) {
|
|
3370
3390
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
3371
3391
|
}
|
|
3372
|
-
const runColor =
|
|
3392
|
+
const runColor = chunkT7AMP24E_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkT7AMP24E_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
3373
3393
|
if (runColor) {
|
|
3374
|
-
const opacity =
|
|
3375
|
-
cellStyle.color =
|
|
3394
|
+
const opacity = chunkT7AMP24E_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
3395
|
+
cellStyle.color = chunkT7AMP24E_js.colorWithOpacity(runColor, opacity);
|
|
3376
3396
|
}
|
|
3377
3397
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
3378
3398
|
if (fontFamily) {
|
|
@@ -3382,15 +3402,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3382
3402
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
3383
3403
|
}
|
|
3384
3404
|
const cellProperties = cellXml["a:tcPr"];
|
|
3385
|
-
const cellFill =
|
|
3405
|
+
const cellFill = chunkT7AMP24E_js.parseDrawingColor(
|
|
3386
3406
|
cellProperties?.["a:solidFill"],
|
|
3387
3407
|
schemeColorOverrides
|
|
3388
3408
|
);
|
|
3389
3409
|
if (cellFill) {
|
|
3390
|
-
const opacity =
|
|
3410
|
+
const opacity = chunkT7AMP24E_js.parseDrawingColorOpacity(
|
|
3391
3411
|
cellProperties?.["a:solidFill"]
|
|
3392
3412
|
);
|
|
3393
|
-
cellStyle.backgroundColor =
|
|
3413
|
+
cellStyle.backgroundColor = chunkT7AMP24E_js.colorWithOpacity(cellFill, opacity);
|
|
3394
3414
|
} else {
|
|
3395
3415
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
3396
3416
|
if (gradCss) {
|
|
@@ -3405,16 +3425,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3405
3425
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
3406
3426
|
Object.assign(cellStyle, edgeBorders);
|
|
3407
3427
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
3408
|
-
const borderColor =
|
|
3428
|
+
const borderColor = chunkT7AMP24E_js.parseDrawingColor(
|
|
3409
3429
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
3410
3430
|
schemeColorOverrides
|
|
3411
|
-
) ||
|
|
3431
|
+
) || chunkT7AMP24E_js.parseDrawingColor(
|
|
3412
3432
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
3413
3433
|
schemeColorOverrides
|
|
3414
|
-
) ||
|
|
3434
|
+
) || chunkT7AMP24E_js.parseDrawingColor(
|
|
3415
3435
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
3416
3436
|
schemeColorOverrides
|
|
3417
|
-
) ||
|
|
3437
|
+
) || chunkT7AMP24E_js.parseDrawingColor(
|
|
3418
3438
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
3419
3439
|
schemeColorOverrides
|
|
3420
3440
|
);
|
|
@@ -3493,10 +3513,10 @@ function resolveTableStyleFillColor(fill, colorScheme) {
|
|
|
3493
3513
|
}
|
|
3494
3514
|
let color = base;
|
|
3495
3515
|
if (fill.tint !== void 0 && fill.tint > 0) {
|
|
3496
|
-
color =
|
|
3516
|
+
color = chunkT7AMP24E_js.tintColor2(color, fill.tint / 1e5);
|
|
3497
3517
|
}
|
|
3498
3518
|
if (fill.shade !== void 0 && fill.shade > 0) {
|
|
3499
|
-
color =
|
|
3519
|
+
color = chunkT7AMP24E_js.shadeColor2(color, 1 - fill.shade / 1e5);
|
|
3500
3520
|
}
|
|
3501
3521
|
return color;
|
|
3502
3522
|
}
|
|
@@ -3521,7 +3541,7 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3521
3541
|
style.fontFamily = text.fontFace;
|
|
3522
3542
|
applied = true;
|
|
3523
3543
|
} else {
|
|
3524
|
-
const refFont =
|
|
3544
|
+
const refFont = chunkT7AMP24E_js.resolveFontRefIdx(text.fontRefIdx, fontScheme);
|
|
3525
3545
|
if (refFont) {
|
|
3526
3546
|
style.fontFamily = refFont;
|
|
3527
3547
|
applied = true;
|
|
@@ -3532,10 +3552,10 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3532
3552
|
if (base) {
|
|
3533
3553
|
let color = base;
|
|
3534
3554
|
if (text.fontTint !== void 0 && text.fontTint > 0) {
|
|
3535
|
-
color =
|
|
3555
|
+
color = chunkT7AMP24E_js.tintColor2(color, text.fontTint / 1e5);
|
|
3536
3556
|
}
|
|
3537
3557
|
if (text.fontShade !== void 0 && text.fontShade > 0) {
|
|
3538
|
-
color =
|
|
3558
|
+
color = chunkT7AMP24E_js.shadeColor2(color, 1 - text.fontShade / 1e5);
|
|
3539
3559
|
}
|
|
3540
3560
|
style.color = color;
|
|
3541
3561
|
applied = true;
|
|
@@ -3724,7 +3744,7 @@ function parseTableElementData(element, fallbackTextStyle) {
|
|
|
3724
3744
|
};
|
|
3725
3745
|
}
|
|
3726
3746
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
3727
|
-
return
|
|
3747
|
+
return chunkT7AMP24E_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
3728
3748
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
3729
3749
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
3730
3750
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -3872,9 +3892,9 @@ function cellStyleToCss(style) {
|
|
|
3872
3892
|
if (style.gradientFillCss) {
|
|
3873
3893
|
css.background = style.gradientFillCss;
|
|
3874
3894
|
} else if (style.fillMode === "pattern" && style.patternFillPreset) {
|
|
3875
|
-
const fg =
|
|
3876
|
-
const bg =
|
|
3877
|
-
const svgPattern =
|
|
3895
|
+
const fg = chunkT7AMP24E_js.normalizeHexColor(style.patternFillForeground, "#000000");
|
|
3896
|
+
const bg = chunkT7AMP24E_js.normalizeHexColor(style.patternFillBackground, "#ffffff");
|
|
3897
|
+
const svgPattern = chunkT7AMP24E_js.getPatternSvg(style.patternFillPreset, fg, bg);
|
|
3878
3898
|
if (svgPattern) {
|
|
3879
3899
|
const encoded = encodeURIComponent(svgPattern);
|
|
3880
3900
|
css.backgroundImage = `url("data:image/svg+xml,${encoded}")`;
|
|
@@ -3950,7 +3970,7 @@ function cellStyleToCss(style) {
|
|
|
3950
3970
|
if (edge.width || edge.color) {
|
|
3951
3971
|
const w = edge.width ?? 1;
|
|
3952
3972
|
const c = edge.color ?? style.borderColor ?? "#000000";
|
|
3953
|
-
const s =
|
|
3973
|
+
const s = chunkT7AMP24E_js.ooxmlDashToCssBorderStyle(edge.dash);
|
|
3954
3974
|
css[edge.prefix] = `${w}px ${s} ${c}`;
|
|
3955
3975
|
}
|
|
3956
3976
|
}
|
|
@@ -3981,7 +4001,7 @@ function cellStyleToCss(style) {
|
|
|
3981
4001
|
css.textShadow = textShadowParts.join(", ");
|
|
3982
4002
|
}
|
|
3983
4003
|
if (style.cell3D) {
|
|
3984
|
-
Object.assign(css,
|
|
4004
|
+
Object.assign(css, chunkT7AMP24E_js.cell3DBevelCss(style.cell3D));
|
|
3985
4005
|
}
|
|
3986
4006
|
return css;
|
|
3987
4007
|
}
|
|
@@ -3995,7 +4015,7 @@ function TableResizeOverlay({
|
|
|
3995
4015
|
const containerRef = React6.useRef(null);
|
|
3996
4016
|
const [rowBounds, setRowBounds] = React6.useState([]);
|
|
3997
4017
|
const dragRef = React6.useRef(null);
|
|
3998
|
-
const colBoundaries = React6.useMemo(() =>
|
|
4018
|
+
const colBoundaries = React6.useMemo(() => chunkT7AMP24E_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
3999
4019
|
const measureRows = React6.useCallback(() => {
|
|
4000
4020
|
const container = containerRef.current;
|
|
4001
4021
|
if (!container) {
|
|
@@ -4042,11 +4062,11 @@ function TableResizeOverlay({
|
|
|
4042
4062
|
const rect = containerRef.current.getBoundingClientRect();
|
|
4043
4063
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
4044
4064
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
4045
|
-
onResizeColumns(
|
|
4065
|
+
onResizeColumns(chunkT7AMP24E_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
4046
4066
|
} else if (drag.type === "row" && onResizeRow) {
|
|
4047
4067
|
const deltaY = e.clientY - drag.startPos;
|
|
4048
|
-
const newHeight =
|
|
4049
|
-
drag.initialRowHeight ??
|
|
4068
|
+
const newHeight = chunkT7AMP24E_js.computeResizedRowHeight(
|
|
4069
|
+
drag.initialRowHeight ?? chunkT7AMP24E_js.DEFAULT_ROW_HEIGHT,
|
|
4050
4070
|
deltaY
|
|
4051
4071
|
);
|
|
4052
4072
|
onResizeRow(drag.index, newHeight);
|
|
@@ -4084,7 +4104,7 @@ function TableResizeOverlay({
|
|
|
4084
4104
|
e.stopPropagation();
|
|
4085
4105
|
const table = containerRef.current?.querySelector("table");
|
|
4086
4106
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
4087
|
-
const actualHeight = tr?.offsetHeight ??
|
|
4107
|
+
const actualHeight = tr?.offsetHeight ?? chunkT7AMP24E_js.DEFAULT_ROW_HEIGHT;
|
|
4088
4108
|
document.body.style.cursor = "row-resize";
|
|
4089
4109
|
document.body.style.userSelect = "none";
|
|
4090
4110
|
dragRef.current = {
|
|
@@ -4132,7 +4152,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4132
4152
|
}
|
|
4133
4153
|
const first = selectedCell.selectedCells[0];
|
|
4134
4154
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4135
|
-
return
|
|
4155
|
+
return chunkT7AMP24E_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
4136
4156
|
})();
|
|
4137
4157
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4138
4158
|
TableResizeOverlay,
|
|
@@ -4165,7 +4185,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4165
4185
|
return null;
|
|
4166
4186
|
}
|
|
4167
4187
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
4168
|
-
const isInMultiSelection =
|
|
4188
|
+
const isInMultiSelection = chunkT7AMP24E_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
4169
4189
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
4170
4190
|
const diag = getCellDiagonalBorders2(
|
|
4171
4191
|
cell.style,
|
|
@@ -4195,7 +4215,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4195
4215
|
}
|
|
4196
4216
|
event.stopPropagation();
|
|
4197
4217
|
if (event.shiftKey && selectedCell) {
|
|
4198
|
-
const rect =
|
|
4218
|
+
const rect = chunkT7AMP24E_js.computeSelectionRect(
|
|
4199
4219
|
selectedCell.rowIndex,
|
|
4200
4220
|
selectedCell.columnIndex,
|
|
4201
4221
|
rowIndex,
|
|
@@ -4205,7 +4225,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4205
4225
|
options?.onSelectCell?.({
|
|
4206
4226
|
rowIndex: selectedCell.rowIndex,
|
|
4207
4227
|
columnIndex: selectedCell.columnIndex,
|
|
4208
|
-
selectedCells:
|
|
4228
|
+
selectedCells: chunkT7AMP24E_js.rectToCells(rect)
|
|
4209
4229
|
});
|
|
4210
4230
|
} else {
|
|
4211
4231
|
options?.onSelectCell?.({
|
|
@@ -4282,7 +4302,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4282
4302
|
}
|
|
4283
4303
|
const first = selectedCell.selectedCells[0];
|
|
4284
4304
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4285
|
-
return
|
|
4305
|
+
return chunkT7AMP24E_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
4286
4306
|
})();
|
|
4287
4307
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
4288
4308
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4359,7 +4379,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4359
4379
|
"border px-1 py-0.5 align-top",
|
|
4360
4380
|
isEditable && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
4361
4381
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
4362
|
-
|
|
4382
|
+
chunkT7AMP24E_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
4383
|
),
|
|
4364
4384
|
colSpan,
|
|
4365
4385
|
rowSpan: rSpan,
|
|
@@ -4370,7 +4390,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4370
4390
|
}
|
|
4371
4391
|
event.stopPropagation();
|
|
4372
4392
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
4373
|
-
const rect =
|
|
4393
|
+
const rect = chunkT7AMP24E_js.computeSelectionRect(
|
|
4374
4394
|
selectedCell.rowIndex,
|
|
4375
4395
|
selectedCell.columnIndex,
|
|
4376
4396
|
rowIndex,
|
|
@@ -4380,7 +4400,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4380
4400
|
options?.onSelectCell?.({
|
|
4381
4401
|
rowIndex: selectedCell.rowIndex,
|
|
4382
4402
|
columnIndex: selectedCell.columnIndex,
|
|
4383
|
-
selectedCells:
|
|
4403
|
+
selectedCells: chunkT7AMP24E_js.rectToCells(rect)
|
|
4384
4404
|
});
|
|
4385
4405
|
} else {
|
|
4386
4406
|
options?.onSelectCell?.({
|
|
@@ -4435,24 +4455,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4435
4455
|
}
|
|
4436
4456
|
var LEGEND_ITEM_WIDTH = 80;
|
|
4437
4457
|
function partAttrs(part) {
|
|
4438
|
-
return part ?
|
|
4458
|
+
return part ? chunkT7AMP24E_js.chartPartToAttrs(part) : void 0;
|
|
4439
4459
|
}
|
|
4440
4460
|
function resolveReactPalette(chartData) {
|
|
4441
4461
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
4442
4462
|
return chartData.colorPalette;
|
|
4443
4463
|
}
|
|
4444
|
-
return [...
|
|
4464
|
+
return [...chunkT7AMP24E_js.getChartStylePalette(chartData.style?.styleId)];
|
|
4445
4465
|
}
|
|
4446
4466
|
function buildReactChartViewModel(element) {
|
|
4447
4467
|
if (element.type !== "chart" || !element.chartData) {
|
|
4448
|
-
return
|
|
4468
|
+
return chunkT7AMP24E_js.buildChartViewModel(element);
|
|
4449
4469
|
}
|
|
4450
4470
|
const palette = resolveReactPalette(element.chartData);
|
|
4451
4471
|
const themedElement = {
|
|
4452
4472
|
...element,
|
|
4453
4473
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
4454
4474
|
};
|
|
4455
|
-
return
|
|
4475
|
+
return chunkT7AMP24E_js.buildChartViewModel(themedElement);
|
|
4456
4476
|
}
|
|
4457
4477
|
function renderPrimitive(prim, key) {
|
|
4458
4478
|
switch (prim.kind) {
|
|
@@ -4841,7 +4861,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4841
4861
|
const unmatchedRows = [];
|
|
4842
4862
|
categories.forEach((cat, i) => {
|
|
4843
4863
|
const value = values[i] ?? 0;
|
|
4844
|
-
const code =
|
|
4864
|
+
const code = chunkT7AMP24E_js.resolveRegionCode(cat);
|
|
4845
4865
|
if (code) {
|
|
4846
4866
|
regionValueMap.set(code, { value, label: cat });
|
|
4847
4867
|
} else {
|
|
@@ -4879,8 +4899,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4879
4899
|
let fill = "#e2e8f0";
|
|
4880
4900
|
let dataLabel = null;
|
|
4881
4901
|
if (entry) {
|
|
4882
|
-
const t =
|
|
4883
|
-
fill =
|
|
4902
|
+
const t = chunkT7AMP24E_js.normalizeValue(entry.value, minVal, maxVal);
|
|
4903
|
+
fill = chunkT7AMP24E_js.sequentialColorScale(t);
|
|
4884
4904
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
4885
4905
|
"text",
|
|
4886
4906
|
{
|
|
@@ -4891,7 +4911,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4891
4911
|
fontWeight: 600,
|
|
4892
4912
|
fill: "#1e293b",
|
|
4893
4913
|
style: { pointerEvents: "none" },
|
|
4894
|
-
children:
|
|
4914
|
+
children: chunkT7AMP24E_js.formatAxisValue(entry.value)
|
|
4895
4915
|
},
|
|
4896
4916
|
`${element.id}-map-dl-${region.code}`
|
|
4897
4917
|
);
|
|
@@ -4909,7 +4929,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4909
4929
|
opacity: 0.9,
|
|
4910
4930
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
4911
4931
|
region.name,
|
|
4912
|
-
entry ? `: ${
|
|
4932
|
+
entry ? `: ${chunkT7AMP24E_js.formatAxisValue(entry.value)}` : ""
|
|
4913
4933
|
] })
|
|
4914
4934
|
}
|
|
4915
4935
|
),
|
|
@@ -4947,7 +4967,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4947
4967
|
fontSize: 7,
|
|
4948
4968
|
fill: "#64748b",
|
|
4949
4969
|
textAnchor: "middle",
|
|
4950
|
-
children:
|
|
4970
|
+
children: chunkT7AMP24E_js.formatAxisValue(minVal)
|
|
4951
4971
|
},
|
|
4952
4972
|
`${element.id}-map-legend-min`
|
|
4953
4973
|
),
|
|
@@ -4959,7 +4979,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4959
4979
|
fontSize: 7,
|
|
4960
4980
|
fill: "#64748b",
|
|
4961
4981
|
textAnchor: "middle",
|
|
4962
|
-
children:
|
|
4982
|
+
children: chunkT7AMP24E_js.formatAxisValue(maxVal)
|
|
4963
4983
|
},
|
|
4964
4984
|
`${element.id}-map-legend-max`
|
|
4965
4985
|
)
|
|
@@ -5025,7 +5045,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
5025
5045
|
y,
|
|
5026
5046
|
fontSize,
|
|
5027
5047
|
fill: "#475569",
|
|
5028
|
-
children:
|
|
5048
|
+
children: chunkT7AMP24E_js.formatAxisValue(row.value)
|
|
5029
5049
|
},
|
|
5030
5050
|
`${element.id}-map-ft-val-${i}`
|
|
5031
5051
|
)
|
|
@@ -5096,7 +5116,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
5096
5116
|
|
|
5097
5117
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
5098
5118
|
function sColor(series, idx) {
|
|
5099
|
-
return
|
|
5119
|
+
return chunkT7AMP24E_js.seriesColor(series, idx);
|
|
5100
5120
|
}
|
|
5101
5121
|
function valToY(val, range, topY, bottomY) {
|
|
5102
5122
|
const usable = bottomY - topY;
|
|
@@ -5635,7 +5655,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5635
5655
|
width: 10,
|
|
5636
5656
|
height: 10,
|
|
5637
5657
|
rx: 2,
|
|
5638
|
-
fill:
|
|
5658
|
+
fill: chunkT7AMP24E_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5639
5659
|
},
|
|
5640
5660
|
`${id}-leg-r-${i}`
|
|
5641
5661
|
)
|
|
@@ -5659,7 +5679,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5659
5679
|
width: 10,
|
|
5660
5680
|
height: 10,
|
|
5661
5681
|
rx: 2,
|
|
5662
|
-
fill:
|
|
5682
|
+
fill: chunkT7AMP24E_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5663
5683
|
}
|
|
5664
5684
|
),
|
|
5665
5685
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -5672,9 +5692,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5672
5692
|
}
|
|
5673
5693
|
const lines = [];
|
|
5674
5694
|
if (range.logScale && range.logBase) {
|
|
5675
|
-
const ticks =
|
|
5695
|
+
const ticks = chunkT7AMP24E_js.generateLogTicks(range);
|
|
5676
5696
|
ticks.forEach((tickVal, i) => {
|
|
5677
|
-
const y =
|
|
5697
|
+
const y = chunkT7AMP24E_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5678
5698
|
lines.push(
|
|
5679
5699
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5680
5700
|
"line",
|
|
@@ -5695,7 +5715,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5695
5715
|
const steps = 4;
|
|
5696
5716
|
for (let i = 0; i <= steps; i++) {
|
|
5697
5717
|
const val = range.min + range.span * i / steps;
|
|
5698
|
-
const y =
|
|
5718
|
+
const y = chunkT7AMP24E_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5699
5719
|
lines.push(
|
|
5700
5720
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5701
5721
|
"line",
|
|
@@ -5719,9 +5739,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5719
5739
|
const labels = [];
|
|
5720
5740
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5721
5741
|
if (range.logScale && range.logBase) {
|
|
5722
|
-
const ticks =
|
|
5742
|
+
const ticks = chunkT7AMP24E_js.generateLogTicks(range);
|
|
5723
5743
|
ticks.forEach((tickVal, i) => {
|
|
5724
|
-
const y =
|
|
5744
|
+
const y = chunkT7AMP24E_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5725
5745
|
labels.push(
|
|
5726
5746
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5727
5747
|
"text",
|
|
@@ -5731,7 +5751,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5731
5751
|
textAnchor: "end",
|
|
5732
5752
|
fontSize: 8,
|
|
5733
5753
|
fill: "#64748b",
|
|
5734
|
-
children: hasDisplayUnits ?
|
|
5754
|
+
children: hasDisplayUnits ? chunkT7AMP24E_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunkT7AMP24E_js.formatAxisValue(tickVal)
|
|
5735
5755
|
},
|
|
5736
5756
|
`${id}-vaxis-log-${i}`
|
|
5737
5757
|
)
|
|
@@ -5741,7 +5761,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5741
5761
|
const steps = 4;
|
|
5742
5762
|
for (let i = 0; i <= steps; i++) {
|
|
5743
5763
|
const val = range.min + range.span * i / steps;
|
|
5744
|
-
const y =
|
|
5764
|
+
const y = chunkT7AMP24E_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5745
5765
|
labels.push(
|
|
5746
5766
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5747
5767
|
"text",
|
|
@@ -5751,7 +5771,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5751
5771
|
textAnchor: "end",
|
|
5752
5772
|
fontSize: 8,
|
|
5753
5773
|
fill: "#64748b",
|
|
5754
|
-
children: hasDisplayUnits ?
|
|
5774
|
+
children: hasDisplayUnits ? chunkT7AMP24E_js.formatAxisValueWithUnits(val, axisFormatting) : chunkT7AMP24E_js.formatAxisValue(val)
|
|
5755
5775
|
},
|
|
5756
5776
|
`${id}-vaxis-${i}`
|
|
5757
5777
|
)
|
|
@@ -5759,7 +5779,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5759
5779
|
}
|
|
5760
5780
|
}
|
|
5761
5781
|
if (hasDisplayUnits) {
|
|
5762
|
-
const unitLabel =
|
|
5782
|
+
const unitLabel = chunkT7AMP24E_js.getDisplayUnitLabel(
|
|
5763
5783
|
axisFormatting.displayUnits,
|
|
5764
5784
|
axisFormatting.displayUnitsLabel
|
|
5765
5785
|
);
|
|
@@ -5834,7 +5854,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
5834
5854
|
if (range.min >= 0) {
|
|
5835
5855
|
return null;
|
|
5836
5856
|
}
|
|
5837
|
-
const y =
|
|
5857
|
+
const y = chunkT7AMP24E_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
5838
5858
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5839
5859
|
"line",
|
|
5840
5860
|
{
|
|
@@ -5858,7 +5878,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5858
5878
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5859
5879
|
for (let i = 0; i <= steps; i++) {
|
|
5860
5880
|
const val = range.min + range.span * i / steps;
|
|
5861
|
-
const y =
|
|
5881
|
+
const y = chunkT7AMP24E_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5862
5882
|
labels.push(
|
|
5863
5883
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5864
5884
|
"text",
|
|
@@ -5870,7 +5890,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5870
5890
|
fontFamily,
|
|
5871
5891
|
fontWeight,
|
|
5872
5892
|
fill: fontColor,
|
|
5873
|
-
children: hasDisplayUnits ?
|
|
5893
|
+
children: hasDisplayUnits ? chunkT7AMP24E_js.formatAxisValueWithUnits(val, axisFormatting) : chunkT7AMP24E_js.formatAxisValue(val)
|
|
5874
5894
|
},
|
|
5875
5895
|
`${id}-sec-vaxis-${i}`
|
|
5876
5896
|
)
|
|
@@ -5894,7 +5914,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5894
5914
|
);
|
|
5895
5915
|
}
|
|
5896
5916
|
if (hasDisplayUnits) {
|
|
5897
|
-
const unitLabel =
|
|
5917
|
+
const unitLabel = chunkT7AMP24E_js.getDisplayUnitLabel(
|
|
5898
5918
|
axisFormatting.displayUnits,
|
|
5899
5919
|
axisFormatting.displayUnitsLabel
|
|
5900
5920
|
);
|
|
@@ -5925,7 +5945,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
5925
5945
|
const ticks = [];
|
|
5926
5946
|
for (let i = 0; i <= steps; i++) {
|
|
5927
5947
|
const val = range.min + range.span * i / steps;
|
|
5928
|
-
const y =
|
|
5948
|
+
const y = chunkT7AMP24E_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5929
5949
|
ticks.push(
|
|
5930
5950
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5931
5951
|
"line",
|
|
@@ -5952,7 +5972,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
5952
5972
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
5953
5973
|
for (let i = 0; i <= steps; i++) {
|
|
5954
5974
|
const val = range.min + range.span * i / steps;
|
|
5955
|
-
const y =
|
|
5975
|
+
const y = chunkT7AMP24E_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5956
5976
|
lines.push(
|
|
5957
5977
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5958
5978
|
"line",
|
|
@@ -6114,7 +6134,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6114
6134
|
width: 8,
|
|
6115
6135
|
height: 8,
|
|
6116
6136
|
borderRadius: 2,
|
|
6117
|
-
backgroundColor:
|
|
6137
|
+
backgroundColor: chunkT7AMP24E_js.seriesColor(
|
|
6118
6138
|
s,
|
|
6119
6139
|
si,
|
|
6120
6140
|
chartData.style?.styleId,
|
|
@@ -6153,8 +6173,8 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6153
6173
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
6154
6174
|
const style = chartData.style;
|
|
6155
6175
|
const legendPos = style?.legendPosition || "b";
|
|
6156
|
-
const range =
|
|
6157
|
-
const layout =
|
|
6176
|
+
const range = chunkT7AMP24E_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6177
|
+
const layout = chunkT7AMP24E_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6158
6178
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6159
6179
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
6160
6180
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -6175,10 +6195,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6175
6195
|
const close = closeSeries.values[ci] ?? high;
|
|
6176
6196
|
const isUp = close >= open;
|
|
6177
6197
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
6178
|
-
const highY =
|
|
6179
|
-
const lowY =
|
|
6180
|
-
const openY =
|
|
6181
|
-
const closeY =
|
|
6198
|
+
const highY = chunkT7AMP24E_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
6199
|
+
const lowY = chunkT7AMP24E_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
6200
|
+
const openY = chunkT7AMP24E_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
6201
|
+
const closeY = chunkT7AMP24E_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
|
|
6182
6202
|
elements.push(
|
|
6183
6203
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6184
6204
|
"line",
|
|
@@ -6221,7 +6241,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6221
6241
|
textAnchor: "middle",
|
|
6222
6242
|
fontSize: 7,
|
|
6223
6243
|
fill: "#334155",
|
|
6224
|
-
children:
|
|
6244
|
+
children: chunkT7AMP24E_js.formatAxisValue(close)
|
|
6225
6245
|
},
|
|
6226
6246
|
`${element.id}-stock-dl-${ci}`
|
|
6227
6247
|
)
|
|
@@ -6263,7 +6283,7 @@ function FailedToLoad() {
|
|
|
6263
6283
|
var LazySurfaceChart3DScene = React6__default.default.lazy(
|
|
6264
6284
|
async () => {
|
|
6265
6285
|
try {
|
|
6266
|
-
return await import('./SurfaceChart3DScene-
|
|
6286
|
+
return await import('./SurfaceChart3DScene-RWMGMREC.js');
|
|
6267
6287
|
} catch {
|
|
6268
6288
|
return { default: FailedToLoad };
|
|
6269
6289
|
}
|
|
@@ -6287,7 +6307,7 @@ var SurfaceChart3DErrorBoundary = class extends React6__default.default.Componen
|
|
|
6287
6307
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
6288
6308
|
const rows = chartData.series.length;
|
|
6289
6309
|
const cols = Math.max(categoryLabels.length, 1);
|
|
6290
|
-
const range =
|
|
6310
|
+
const range = chunkT7AMP24E_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6291
6311
|
const heightMap = new Float32Array(rows * cols);
|
|
6292
6312
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
6293
6313
|
for (let r = 0; r < rows; r++) {
|
|
@@ -6407,8 +6427,8 @@ function darkenRgb(r, g, b, factor) {
|
|
|
6407
6427
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
6408
6428
|
const style = chartData.style;
|
|
6409
6429
|
const legendPos = style?.legendPosition || "b";
|
|
6410
|
-
const layout =
|
|
6411
|
-
const range =
|
|
6430
|
+
const layout = chunkT7AMP24E_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6431
|
+
const range = chunkT7AMP24E_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6412
6432
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6413
6433
|
const seriesCount = chartData.series.length;
|
|
6414
6434
|
const cols = catCount - 1;
|
|
@@ -6498,8 +6518,8 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6498
6518
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
6499
6519
|
const style = chartData.style;
|
|
6500
6520
|
const legendPos = style?.legendPosition || "b";
|
|
6501
|
-
const layout =
|
|
6502
|
-
const range =
|
|
6521
|
+
const layout = chunkT7AMP24E_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6522
|
+
const range = chunkT7AMP24E_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6503
6523
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6504
6524
|
const seriesCount = chartData.series.length;
|
|
6505
6525
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -6562,7 +6582,7 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6562
6582
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
6563
6583
|
const style = chartData.style;
|
|
6564
6584
|
const legendPos = style?.legendPosition || "b";
|
|
6565
|
-
const layout =
|
|
6585
|
+
const layout = chunkT7AMP24E_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6566
6586
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
6567
6587
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
6568
6588
|
const rects = [];
|
|
@@ -6585,7 +6605,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
6585
6605
|
y: curY,
|
|
6586
6606
|
width: Math.max(w - 1, 1),
|
|
6587
6607
|
height: Math.max(h - 1, 1),
|
|
6588
|
-
fill:
|
|
6608
|
+
fill: chunkT7AMP24E_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
6589
6609
|
rx: 2,
|
|
6590
6610
|
opacity: 0.85
|
|
6591
6611
|
},
|
|
@@ -6638,8 +6658,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6638
6658
|
const style = chartData.style;
|
|
6639
6659
|
const legendPos = style?.legendPosition || "b";
|
|
6640
6660
|
const values = chartData.series[0]?.values ?? [];
|
|
6641
|
-
const range =
|
|
6642
|
-
const layout =
|
|
6661
|
+
const range = chunkT7AMP24E_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6662
|
+
const layout = chunkT7AMP24E_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6643
6663
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
6644
6664
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
6645
6665
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -6650,8 +6670,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6650
6670
|
const isLast = i === values.length - 1;
|
|
6651
6671
|
const startVal = isLast ? 0 : runningTotal;
|
|
6652
6672
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
6653
|
-
const barStartY =
|
|
6654
|
-
const barEndY =
|
|
6673
|
+
const barStartY = chunkT7AMP24E_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
6674
|
+
const barEndY = chunkT7AMP24E_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
|
|
6655
6675
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
6656
6676
|
const y = Math.min(barStartY, barEndY);
|
|
6657
6677
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -6680,7 +6700,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6680
6700
|
textAnchor: "middle",
|
|
6681
6701
|
fontSize: 7,
|
|
6682
6702
|
fill: "#334155",
|
|
6683
|
-
children:
|
|
6703
|
+
children: chunkT7AMP24E_js.formatAxisValue(isLast ? endVal : val)
|
|
6684
6704
|
},
|
|
6685
6705
|
`${element.id}-wf-dl-${i}`
|
|
6686
6706
|
)
|
|
@@ -6728,18 +6748,18 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6728
6748
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
6729
6749
|
const style = chartData.style;
|
|
6730
6750
|
const legendPos = style?.legendPosition || "b";
|
|
6731
|
-
const layoutOpts =
|
|
6751
|
+
const layoutOpts = chunkT7AMP24E_js.computeLayoutOptions(
|
|
6732
6752
|
chartData.axes,
|
|
6733
6753
|
chartData.dataTable,
|
|
6734
6754
|
chartData.series.length
|
|
6735
6755
|
);
|
|
6736
|
-
const layout =
|
|
6737
|
-
const { primary, secondary } =
|
|
6756
|
+
const layout = chunkT7AMP24E_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
6757
|
+
const { primary, secondary } = chunkT7AMP24E_js.splitSeriesByAxis(chartData.series, chartData.axes);
|
|
6738
6758
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
6739
6759
|
const secondarySeries = secondary.map((e) => e.series);
|
|
6740
|
-
const range =
|
|
6741
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
6742
|
-
const secondaryAxisFmt =
|
|
6760
|
+
const range = chunkT7AMP24E_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
6761
|
+
const secondaryRange = secondarySeries.length > 0 ? chunkT7AMP24E_js.computeValueRange(secondarySeries) : void 0;
|
|
6762
|
+
const secondaryAxisFmt = chunkT7AMP24E_js.getSecondaryValueAxis(chartData.axes);
|
|
6743
6763
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6744
6764
|
const barSeriesCount = 1;
|
|
6745
6765
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -6755,8 +6775,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6755
6775
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
6756
6776
|
barSeries.values.forEach((val, vi) => {
|
|
6757
6777
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
6758
|
-
const zeroY =
|
|
6759
|
-
const valY =
|
|
6778
|
+
const zeroY = chunkT7AMP24E_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
6779
|
+
const valY = chunkT7AMP24E_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
|
|
6760
6780
|
const y = Math.min(zeroY, valY);
|
|
6761
6781
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
6762
6782
|
barElements.push(
|
|
@@ -6767,7 +6787,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6767
6787
|
y,
|
|
6768
6788
|
width: barWidth,
|
|
6769
6789
|
height: h,
|
|
6770
|
-
fill:
|
|
6790
|
+
fill: chunkT7AMP24E_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
6771
6791
|
rx: 1
|
|
6772
6792
|
},
|
|
6773
6793
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -6783,7 +6803,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6783
6803
|
textAnchor: "middle",
|
|
6784
6804
|
fontSize: 7,
|
|
6785
6805
|
fill: "#334155",
|
|
6786
|
-
children:
|
|
6806
|
+
children: chunkT7AMP24E_js.formatAxisValue(val)
|
|
6787
6807
|
},
|
|
6788
6808
|
`${element.id}-combo-bar-dl-${vi}`
|
|
6789
6809
|
)
|
|
@@ -6800,10 +6820,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6800
6820
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
6801
6821
|
const points = series.values.map((val, vi) => {
|
|
6802
6822
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
6803
|
-
const y =
|
|
6823
|
+
const y = chunkT7AMP24E_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
6804
6824
|
return { x, y, val };
|
|
6805
6825
|
});
|
|
6806
|
-
const c =
|
|
6826
|
+
const c = chunkT7AMP24E_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
6807
6827
|
lineElements.push(
|
|
6808
6828
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6809
6829
|
"polyline",
|
|
@@ -6830,7 +6850,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6830
6850
|
textAnchor: "middle",
|
|
6831
6851
|
fontSize: 7,
|
|
6832
6852
|
fill: "#334155",
|
|
6833
|
-
children:
|
|
6853
|
+
children: chunkT7AMP24E_js.formatAxisValue(p.val)
|
|
6834
6854
|
},
|
|
6835
6855
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
6836
6856
|
)
|
|
@@ -7976,14 +7996,14 @@ function buildNotesPdf(pages) {
|
|
|
7976
7996
|
notes: page.notes,
|
|
7977
7997
|
slideNumber: page.slideNumber
|
|
7978
7998
|
}));
|
|
7979
|
-
const bytes =
|
|
7999
|
+
const bytes = chunkT7AMP24E_js.buildNotesPdfBytes(images, meta);
|
|
7980
8000
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
7981
8001
|
return URL.createObjectURL(blob);
|
|
7982
8002
|
}
|
|
7983
8003
|
|
|
7984
8004
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
7985
8005
|
function buildPdfFromImageData(images) {
|
|
7986
|
-
const bytes =
|
|
8006
|
+
const bytes = chunkT7AMP24E_js.buildSlidesPdfBytes(images);
|
|
7987
8007
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
7988
8008
|
return URL.createObjectURL(blob);
|
|
7989
8009
|
}
|
|
@@ -7992,7 +8012,7 @@ function buildPdfFromImageData(images) {
|
|
|
7992
8012
|
var activePreview = null;
|
|
7993
8013
|
function startPreviewAnimation(elementId, preset, options) {
|
|
7994
8014
|
stopPreviewAnimation();
|
|
7995
|
-
const descriptor =
|
|
8015
|
+
const descriptor = chunkT7AMP24E_js.buildPreviewAnimation(preset, options);
|
|
7996
8016
|
if (!descriptor) {
|
|
7997
8017
|
return;
|
|
7998
8018
|
}
|