pptx-react-viewer 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/README.md +1 -1
- package/dist/{AiChatPanel-BRGQCYZM.mjs → AiChatPanel-RFBZWMUE.mjs} +2 -2
- package/dist/AiChatPanel-RFBZWMUE.mjs.br +0 -0
- package/dist/AiChatPanel-RFBZWMUE.mjs.gz +0 -0
- package/dist/{AiChatPanel-PW5OT25Z.js → AiChatPanel-VCCVHAAI.js} +10 -10
- package/dist/AiChatPanel-VCCVHAAI.js.br +0 -0
- package/dist/AiChatPanel-VCCVHAAI.js.gz +0 -0
- package/dist/{Model3DScene-TEF362W2.mjs → Model3DScene-2M6HVWTE.mjs} +1 -1
- package/dist/{Model3DScene-TEF362W2.mjs.br → Model3DScene-2M6HVWTE.mjs.br} +0 -0
- package/dist/Model3DScene-2M6HVWTE.mjs.gz +0 -0
- package/dist/{Model3DScene-JCGYRKXM.js → Model3DScene-RQIGSYGQ.js} +2 -2
- package/dist/{Model3DScene-JCGYRKXM.js.br → Model3DScene-RQIGSYGQ.js.br} +0 -0
- package/dist/Model3DScene-RQIGSYGQ.js.gz +0 -0
- package/dist/PowerPointViewer-gmU5rc7K.d.ts.map +1 -1
- package/dist/{SurfaceChart3DScene-2SHCYZVC.js → SurfaceChart3DScene-2FVASQGC.js} +2 -2
- package/dist/SurfaceChart3DScene-2FVASQGC.js.br +0 -0
- package/dist/SurfaceChart3DScene-2FVASQGC.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-UPDCIMJM.mjs → SurfaceChart3DScene-EGMWY4CZ.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-UPDCIMJM.mjs.br → SurfaceChart3DScene-EGMWY4CZ.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-EGMWY4CZ.mjs.gz +0 -0
- package/dist/{chunk-R2N2UYT7.mjs → chunk-27XBWVO5.mjs} +310 -3
- package/dist/chunk-27XBWVO5.mjs.br +0 -0
- package/dist/{chunk-R2N2UYT7.mjs.gz → chunk-27XBWVO5.mjs.gz} +0 -0
- package/dist/{chunk-OKOJVSKJ.js → chunk-46Z6MNRS.js} +315 -2
- package/dist/chunk-46Z6MNRS.js.br +0 -0
- package/dist/{chunk-OKOJVSKJ.js.gz → chunk-46Z6MNRS.js.gz} +0 -0
- package/dist/{chunk-B6NRDUHJ.mjs → chunk-7DQHWPIB.mjs} +2 -2
- package/dist/chunk-7DQHWPIB.mjs.br +0 -0
- package/dist/chunk-7DQHWPIB.mjs.gz +0 -0
- package/dist/{chunk-ZKDE3HJI.js → chunk-LDF77JJD.js} +208 -208
- package/dist/chunk-LDF77JJD.js.br +0 -0
- package/dist/chunk-LDF77JJD.js.gz +0 -0
- package/dist/{chunk-5XLLRPMV.mjs → chunk-NGE7YQTF.mjs} +110 -14
- package/dist/chunk-NGE7YQTF.mjs.br +0 -0
- package/dist/chunk-NGE7YQTF.mjs.gz +0 -0
- package/dist/{chunk-LFXG7SGG.js → chunk-VHO53ZXZ.js} +764 -756
- package/dist/chunk-VHO53ZXZ.js.br +0 -0
- package/dist/chunk-VHO53ZXZ.js.gz +0 -0
- package/dist/{chunk-L63RAVM7.mjs → chunk-Y4OSELBT.mjs} +16 -8
- package/dist/chunk-Y4OSELBT.mjs.br +0 -0
- package/dist/chunk-Y4OSELBT.mjs.gz +0 -0
- package/dist/{chunk-ZB4NZRCI.js → chunk-ZRY7NLKS.js} +354 -257
- package/dist/chunk-ZRY7NLKS.js.br +0 -0
- package/dist/chunk-ZRY7NLKS.js.gz +0 -0
- package/dist/{index-a8wcFjRJ.d.ts → index-nAyIdGqF.d.ts} +2 -2
- package/dist/{index-a8wcFjRJ.d.ts.map → index-nAyIdGqF.d.ts.map} +1 -1
- package/dist/index.js +33 -33
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +100 -0
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +78 -78
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +3 -3
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/viewer/index.js +20 -20
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +4 -4
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +5 -3
- package/dist/AiChatPanel-BRGQCYZM.mjs.br +0 -0
- package/dist/AiChatPanel-BRGQCYZM.mjs.gz +0 -0
- package/dist/AiChatPanel-PW5OT25Z.js.br +0 -0
- package/dist/AiChatPanel-PW5OT25Z.js.gz +0 -0
- package/dist/Model3DScene-JCGYRKXM.js.gz +0 -0
- package/dist/Model3DScene-TEF362W2.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-2SHCYZVC.js.br +0 -0
- package/dist/SurfaceChart3DScene-2SHCYZVC.js.gz +0 -0
- package/dist/SurfaceChart3DScene-UPDCIMJM.mjs.gz +0 -0
- package/dist/chunk-5XLLRPMV.mjs.br +0 -0
- package/dist/chunk-5XLLRPMV.mjs.gz +0 -0
- package/dist/chunk-B6NRDUHJ.mjs.br +0 -0
- package/dist/chunk-B6NRDUHJ.mjs.gz +0 -0
- package/dist/chunk-L63RAVM7.mjs.br +0 -0
- package/dist/chunk-L63RAVM7.mjs.gz +0 -0
- package/dist/chunk-LFXG7SGG.js.br +0 -0
- package/dist/chunk-LFXG7SGG.js.gz +0 -0
- package/dist/chunk-OKOJVSKJ.js.br +0 -0
- package/dist/chunk-R2N2UYT7.mjs.br +0 -0
- package/dist/chunk-ZB4NZRCI.js.br +0 -0
- package/dist/chunk-ZB4NZRCI.js.gz +0 -0
- package/dist/chunk-ZKDE3HJI.js.br +0 -0
- package/dist/chunk-ZKDE3HJI.js.gz +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk46Z6MNRS_js = require('./chunk-46Z6MNRS.js');
|
|
4
4
|
var chunkCUUYYYC5_js = require('./chunk-CUUYYYC5.js');
|
|
5
5
|
var chunkCLNGAVNH_js = require('./chunk-CLNGAVNH.js');
|
|
6
6
|
var clsx = require('clsx');
|
|
@@ -16,7 +16,7 @@ var React6__default = /*#__PURE__*/_interopDefault(React6);
|
|
|
16
16
|
|
|
17
17
|
// src/viewer/utils/animation-effects.ts
|
|
18
18
|
function getAnimationInitialStyle2(preset, nativeAnimation) {
|
|
19
|
-
return
|
|
19
|
+
return chunk46Z6MNRS_js.getAnimationInitialStyle(preset, nativeAnimation);
|
|
20
20
|
}
|
|
21
21
|
function cn(...inputs) {
|
|
22
22
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
@@ -24,7 +24,7 @@ function cn(...inputs) {
|
|
|
24
24
|
|
|
25
25
|
// src/viewer/utils/clone.ts
|
|
26
26
|
function cloneHistorySnapshot2(snapshot) {
|
|
27
|
-
return
|
|
27
|
+
return chunk46Z6MNRS_js.cloneHistorySnapshot(snapshot);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
// src/viewer/constants/scalar.ts
|
|
@@ -134,7 +134,7 @@ var GLYPH_COMPONENTS = {
|
|
|
134
134
|
plus: lu.LuPlus,
|
|
135
135
|
triangle: lu.LuTriangle
|
|
136
136
|
};
|
|
137
|
-
var SHAPE_PRESETS =
|
|
137
|
+
var SHAPE_PRESETS = chunk46Z6MNRS_js.SHAPE_PRESET_DEFS.map(
|
|
138
138
|
(def) => ({
|
|
139
139
|
type: def.type,
|
|
140
140
|
label: def.label,
|
|
@@ -263,12 +263,12 @@ function isConnectorOrLineElement(element) {
|
|
|
263
263
|
function partitionTemplateElements(slides) {
|
|
264
264
|
const templateElementsBySlideId = {};
|
|
265
265
|
const nextSlides = slides.map((slide) => {
|
|
266
|
-
const template = slide.elements.filter((el) =>
|
|
266
|
+
const template = slide.elements.filter((el) => chunk46Z6MNRS_js.isTemplateElement(el));
|
|
267
267
|
if (template.length === 0) {
|
|
268
268
|
return slide;
|
|
269
269
|
}
|
|
270
270
|
templateElementsBySlideId[slide.id] = template;
|
|
271
|
-
return { ...slide, elements: slide.elements.filter((el) => !
|
|
271
|
+
return { ...slide, elements: slide.elements.filter((el) => !chunk46Z6MNRS_js.isTemplateElement(el)) };
|
|
272
272
|
});
|
|
273
273
|
return { slides: nextSlides, templateElementsBySlideId };
|
|
274
274
|
}
|
|
@@ -293,7 +293,7 @@ function getImageMaskStyle(element) {
|
|
|
293
293
|
}
|
|
294
294
|
const normalized = shapeType.toLowerCase();
|
|
295
295
|
if (normalized === "roundrect" || normalized === "round1rect" || normalized === "round2samerect" || normalized === "round2diagrect" || normalized === "sniproundrect" || normalized === "snip1rect" || normalized === "snip2diagrect") {
|
|
296
|
-
const radiusPx =
|
|
296
|
+
const radiusPx = chunk46Z6MNRS_js.getRoundRectRadiusPx(element);
|
|
297
297
|
if (radiusPx <= 0.01) {
|
|
298
298
|
return void 0;
|
|
299
299
|
}
|
|
@@ -305,7 +305,7 @@ function getImageMaskStyle(element) {
|
|
|
305
305
|
if (normalized === "can" || normalized === "cylinder") {
|
|
306
306
|
return { borderRadius: "48% / 12%" };
|
|
307
307
|
}
|
|
308
|
-
const clipPath =
|
|
308
|
+
const clipPath = chunk46Z6MNRS_js.getResolvedShapeClipPath(element);
|
|
309
309
|
if (!clipPath) {
|
|
310
310
|
return void 0;
|
|
311
311
|
}
|
|
@@ -321,10 +321,10 @@ function getImageRenderStyle(element) {
|
|
|
321
321
|
objectFit: "cover"
|
|
322
322
|
};
|
|
323
323
|
}
|
|
324
|
-
const cropLeft =
|
|
325
|
-
const cropTop =
|
|
326
|
-
const cropRight =
|
|
327
|
-
const cropBottom =
|
|
324
|
+
const cropLeft = chunk46Z6MNRS_js.clampCropValue(element.cropLeft);
|
|
325
|
+
const cropTop = chunk46Z6MNRS_js.clampCropValue(element.cropTop);
|
|
326
|
+
const cropRight = chunk46Z6MNRS_js.clampCropValue(element.cropRight);
|
|
327
|
+
const cropBottom = chunk46Z6MNRS_js.clampCropValue(element.cropBottom);
|
|
328
328
|
const hasCrop = cropLeft + cropRight > 1e-4 || cropTop + cropBottom > 1e-4;
|
|
329
329
|
if (!hasCrop) {
|
|
330
330
|
return {
|
|
@@ -336,10 +336,10 @@ function getImageRenderStyle(element) {
|
|
|
336
336
|
}
|
|
337
337
|
const safeHorizontalScale = cropLeft + cropRight >= 0.99 ? 0.99 / (cropLeft + cropRight) : 1;
|
|
338
338
|
const safeVerticalScale = cropTop + cropBottom >= 0.99 ? 0.99 / (cropTop + cropBottom) : 1;
|
|
339
|
-
const normalizedLeft =
|
|
340
|
-
const normalizedRight =
|
|
341
|
-
const normalizedTop =
|
|
342
|
-
const normalizedBottom =
|
|
339
|
+
const normalizedLeft = chunk46Z6MNRS_js.clampCropValue(cropLeft * safeHorizontalScale);
|
|
340
|
+
const normalizedRight = chunk46Z6MNRS_js.clampCropValue(cropRight * safeHorizontalScale);
|
|
341
|
+
const normalizedTop = chunk46Z6MNRS_js.clampCropValue(cropTop * safeVerticalScale);
|
|
342
|
+
const normalizedBottom = chunk46Z6MNRS_js.clampCropValue(cropBottom * safeVerticalScale);
|
|
343
343
|
const remainingWidth = Math.max(0.01, 1 - normalizedLeft - normalizedRight);
|
|
344
344
|
const remainingHeight = Math.max(0.01, 1 - normalizedTop - normalizedBottom);
|
|
345
345
|
const tx = Math.round(-normalizedLeft / remainingWidth * 1e4) / 100;
|
|
@@ -720,7 +720,7 @@ function executeMediaCommand(command) {
|
|
|
720
720
|
if (!el) {
|
|
721
721
|
return false;
|
|
722
722
|
}
|
|
723
|
-
const parsed =
|
|
723
|
+
const parsed = chunk46Z6MNRS_js.parseMediaCommand(command.command);
|
|
724
724
|
if (!parsed) {
|
|
725
725
|
return false;
|
|
726
726
|
}
|
|
@@ -1186,20 +1186,20 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
1186
1186
|
const textDecorationStyle = isDoubleStrike ? "double" : void 0;
|
|
1187
1187
|
const hasItalicRuns = element.textStyle?.italic || Boolean(element.textSegments?.some((segment) => segment.style?.italic));
|
|
1188
1188
|
const isRtl = element.textStyle?.rtl === true;
|
|
1189
|
-
const resolvedTextColor = element.textStyle?.hyperlink ?
|
|
1189
|
+
const resolvedTextColor = element.textStyle?.hyperlink ? chunk46Z6MNRS_js.normalizeHexColor(element.textStyle?.color, HYPERLINK_COLOR) : chunk46Z6MNRS_js.normalizeHexColor(element.textStyle?.color, fallbackColor);
|
|
1190
1190
|
const bodyTop = element.textStyle?.bodyInsetTop ?? DEFAULT_BODY_INSET_TB_PX;
|
|
1191
1191
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
1192
1192
|
const bodyLeft = element.textStyle?.bodyInsetLeft ?? DEFAULT_BODY_INSET_LR_PX;
|
|
1193
1193
|
const bodyRight = element.textStyle?.bodyInsetRight ?? DEFAULT_BODY_INSET_LR_PX;
|
|
1194
|
-
const writingMode =
|
|
1195
|
-
const textOrientation =
|
|
1196
|
-
const verticalDirection =
|
|
1194
|
+
const writingMode = chunk46Z6MNRS_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
1195
|
+
const textOrientation = chunk46Z6MNRS_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
1196
|
+
const verticalDirection = chunk46Z6MNRS_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
1197
1197
|
const resolvedDirection = verticalDirection || (isRtl ? "rtl" : "ltr");
|
|
1198
1198
|
const resolvedUnicodeBidi = isRtl ? "plaintext" : void 0;
|
|
1199
1199
|
const hasSegments = (element.textSegments?.length ?? 0) > 0;
|
|
1200
1200
|
return {
|
|
1201
1201
|
color: resolvedTextColor,
|
|
1202
|
-
backgroundColor: !hasSegments && element.textStyle?.highlightColor ?
|
|
1202
|
+
backgroundColor: !hasSegments && element.textStyle?.highlightColor ? chunk46Z6MNRS_js.normalizeHexColor(element.textStyle.highlightColor, void 0) : void 0,
|
|
1203
1203
|
textAlign: (() => {
|
|
1204
1204
|
const a = element.textStyle?.align;
|
|
1205
1205
|
if (a === "justLow" || a === "dist" || a === "thaiDist") {
|
|
@@ -1215,7 +1215,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
1215
1215
|
textDecorationLine: textDecorationTokens.length > 0 ? textDecorationTokens.join(" ") : "none",
|
|
1216
1216
|
textDecorationStyle,
|
|
1217
1217
|
fontFamily: element.textStyle?.fontFamily || DEFAULT_FONT_FAMILY,
|
|
1218
|
-
lineHeight:
|
|
1218
|
+
lineHeight: chunk46Z6MNRS_js.resolveLineHeight(element.textStyle, hasItalicRuns),
|
|
1219
1219
|
paddingTop: bodyTop + (hasItalicRuns ? 1 : 0),
|
|
1220
1220
|
paddingBottom: bodyBottom + (hasItalicRuns ? 1 : 0),
|
|
1221
1221
|
paddingLeft: bodyLeft + (element.textStyle?.paragraphMarginLeft || 0),
|
|
@@ -1228,7 +1228,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
1228
1228
|
// Auto-fit: use OOXML-provided fontScale/lnSpcReduction when available,
|
|
1229
1229
|
// otherwise fall back to heuristic estimation. The pure font-scale maths
|
|
1230
1230
|
// now lives in pptx-viewer-shared (computeAutoFitTextStyle).
|
|
1231
|
-
...
|
|
1231
|
+
...chunk46Z6MNRS_js.computeAutoFitTextStyle({
|
|
1232
1232
|
textStyle: element.textStyle,
|
|
1233
1233
|
text: element.text ?? "",
|
|
1234
1234
|
width: element.width,
|
|
@@ -1266,9 +1266,9 @@ function getTextLayoutStyle(element) {
|
|
|
1266
1266
|
return {};
|
|
1267
1267
|
}
|
|
1268
1268
|
const verticalAlign = element.textStyle?.vAlign || "top";
|
|
1269
|
-
const writingMode =
|
|
1270
|
-
const textOrientation =
|
|
1271
|
-
const verticalDirection =
|
|
1269
|
+
const writingMode = chunk46Z6MNRS_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
1270
|
+
const textOrientation = chunk46Z6MNRS_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
1271
|
+
const verticalDirection = chunk46Z6MNRS_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
1272
1272
|
const parsedColumnCount = Number(element.textStyle?.columnCount);
|
|
1273
1273
|
const columnCount = Number.isFinite(parsedColumnCount) ? Math.max(1, Math.min(16, Math.round(parsedColumnCount))) : 1;
|
|
1274
1274
|
const hasColumns = columnCount > 1;
|
|
@@ -1285,7 +1285,7 @@ function getTextLayoutStyle(element) {
|
|
|
1285
1285
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
1286
1286
|
const parsedColumnSpacing = Number(element.textStyle?.columnSpacing);
|
|
1287
1287
|
const columnGap = Number.isFinite(parsedColumnSpacing) && parsedColumnSpacing > 0 ? `${parsedColumnSpacing}px` : "0.75em";
|
|
1288
|
-
const kinsokuStyles =
|
|
1288
|
+
const kinsokuStyles = chunk46Z6MNRS_js.getKinsokuLineBreakStyles(element.textStyle);
|
|
1289
1289
|
if (hasColumns) {
|
|
1290
1290
|
return {
|
|
1291
1291
|
display: "block",
|
|
@@ -1332,10 +1332,10 @@ function getTextLayoutStyle(element) {
|
|
|
1332
1332
|
|
|
1333
1333
|
// src/viewer/utils/text-effects.tsx
|
|
1334
1334
|
function buildTextFillCss2(style) {
|
|
1335
|
-
return
|
|
1335
|
+
return chunk46Z6MNRS_js.buildTextFillCss(style);
|
|
1336
1336
|
}
|
|
1337
1337
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
1338
|
-
return
|
|
1338
|
+
return chunk46Z6MNRS_js.buildTextBody3DSceneStyle(textStyle);
|
|
1339
1339
|
}
|
|
1340
1340
|
|
|
1341
1341
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -1520,17 +1520,17 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1520
1520
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
1521
1521
|
return renderedSegments;
|
|
1522
1522
|
}
|
|
1523
|
-
const paraKey = `${elementId}${
|
|
1523
|
+
const paraKey = `${elementId}${chunk46Z6MNRS_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
1524
1524
|
const paraState = subElementAnimStates.get(paraKey);
|
|
1525
1525
|
if (paraState) {
|
|
1526
1526
|
const style = buildAnimStyle(paraState);
|
|
1527
1527
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
1528
1528
|
}
|
|
1529
|
-
const firstWordKey = `${elementId}${
|
|
1529
|
+
const firstWordKey = `${elementId}${chunk46Z6MNRS_js.TEXT_BUILD_ID_SEP}w${paraIndex}-0`;
|
|
1530
1530
|
if (subElementAnimStates.has(firstWordKey)) {
|
|
1531
1531
|
return wrapByWord(elementId, paraIndex, paraSegments, subElementAnimStates);
|
|
1532
1532
|
}
|
|
1533
|
-
const firstCharKey = `${elementId}${
|
|
1533
|
+
const firstCharKey = `${elementId}${chunk46Z6MNRS_js.TEXT_BUILD_ID_SEP}c${paraIndex}-0`;
|
|
1534
1534
|
if (subElementAnimStates.has(firstCharKey)) {
|
|
1535
1535
|
return wrapByChar(elementId, paraIndex, paraSegments, subElementAnimStates);
|
|
1536
1536
|
}
|
|
@@ -1551,7 +1551,7 @@ function wrapByWord(elementId, paraIndex, paraSegments, states) {
|
|
|
1551
1551
|
nodes.push(/* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Fragment, { children: w }, `ws-${i}`));
|
|
1552
1552
|
continue;
|
|
1553
1553
|
}
|
|
1554
|
-
const key = `${elementId}${
|
|
1554
|
+
const key = `${elementId}${chunk46Z6MNRS_js.TEXT_BUILD_ID_SEP}w${paraIndex}-${wordIdx}`;
|
|
1555
1555
|
const state = states.get(key);
|
|
1556
1556
|
const style = buildAnimStyle(state);
|
|
1557
1557
|
nodes.push(
|
|
@@ -1565,7 +1565,7 @@ function wrapByChar(elementId, paraIndex, paraSegments, states) {
|
|
|
1565
1565
|
const fullText = paraSegments.map((e) => e.segment.text).join("");
|
|
1566
1566
|
const nodes = [];
|
|
1567
1567
|
for (let i = 0; i < fullText.length; i++) {
|
|
1568
|
-
const key = `${elementId}${
|
|
1568
|
+
const key = `${elementId}${chunk46Z6MNRS_js.TEXT_BUILD_ID_SEP}c${paraIndex}-${i}`;
|
|
1569
1569
|
const state = states.get(key);
|
|
1570
1570
|
const style = buildAnimStyle(state);
|
|
1571
1571
|
nodes.push(
|
|
@@ -1711,10 +1711,10 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1711
1711
|
if (!needsScriptFonts || !text) {
|
|
1712
1712
|
return text;
|
|
1713
1713
|
}
|
|
1714
|
-
const runs =
|
|
1714
|
+
const runs = chunk46Z6MNRS_js.segmentByScript(text);
|
|
1715
1715
|
if (runs.length <= 1) {
|
|
1716
1716
|
if (runs.length === 1) {
|
|
1717
|
-
const font =
|
|
1717
|
+
const font = chunk46Z6MNRS_js.resolveFontForScript(runs[0].script, scriptFonts);
|
|
1718
1718
|
if (font && font !== baseFontFamily) {
|
|
1719
1719
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: text });
|
|
1720
1720
|
}
|
|
@@ -1722,7 +1722,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1722
1722
|
return text;
|
|
1723
1723
|
}
|
|
1724
1724
|
return runs.map((run, i) => {
|
|
1725
|
-
const font =
|
|
1725
|
+
const font = chunk46Z6MNRS_js.resolveFontForScript(run.script, scriptFonts);
|
|
1726
1726
|
if (!font || font === baseFontFamily) {
|
|
1727
1727
|
return /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Fragment, { children: run.text }, `${keyPrefix}-r${i}`);
|
|
1728
1728
|
}
|
|
@@ -1794,8 +1794,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1794
1794
|
);
|
|
1795
1795
|
}
|
|
1796
1796
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
1797
|
-
const mathml =
|
|
1798
|
-
const safeMathml = mathml ?
|
|
1797
|
+
const mathml = chunk46Z6MNRS_js.convertOmmlToMathMl(equationXml);
|
|
1798
|
+
const safeMathml = mathml ? chunk46Z6MNRS_js.sanitizeMathMl(mathml) : "";
|
|
1799
1799
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1800
1800
|
"span",
|
|
1801
1801
|
{
|
|
@@ -1845,7 +1845,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1845
1845
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: equationContent }, `${elementId}-seg-${segmentIndex}`);
|
|
1846
1846
|
}
|
|
1847
1847
|
function renderPictureBullet(elementId, segmentIndex, bulletInfo, baseFontSize) {
|
|
1848
|
-
const picture =
|
|
1848
|
+
const picture = chunk46Z6MNRS_js.resolvePictureBullet(bulletInfo, baseFontSize) ?? {
|
|
1849
1849
|
sizePx: baseFontSize,
|
|
1850
1850
|
fallbackMarker: "\u2022",
|
|
1851
1851
|
accessibleLabel: "Bullet"
|
|
@@ -1895,7 +1895,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1895
1895
|
);
|
|
1896
1896
|
}
|
|
1897
1897
|
const segmentStyle = segment.style || {};
|
|
1898
|
-
const textValue =
|
|
1898
|
+
const textValue = chunk46Z6MNRS_js.substituteFieldText(segment.text || "", segment.fieldType, fieldContext);
|
|
1899
1899
|
const lines = textValue.split("\n");
|
|
1900
1900
|
const textDecorationTokens = [];
|
|
1901
1901
|
if (segmentStyle.underline || segmentStyle.hyperlink) {
|
|
@@ -1905,8 +1905,8 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1905
1905
|
textDecorationTokens.push("line-through");
|
|
1906
1906
|
}
|
|
1907
1907
|
const isDoubleStrike = segmentStyle.strikethrough && segmentStyle.strikeType === "dblStrike";
|
|
1908
|
-
const resolvedSegmentColor = segmentStyle.hyperlink ?
|
|
1909
|
-
const underlineDecoration =
|
|
1908
|
+
const resolvedSegmentColor = segmentStyle.hyperlink ? chunk46Z6MNRS_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, HYPERLINK_COLOR) : chunk46Z6MNRS_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, fallbackColor);
|
|
1909
|
+
const underlineDecoration = chunk46Z6MNRS_js.resolveUnderlineDecorationStyle(
|
|
1910
1910
|
Boolean(isDoubleStrike),
|
|
1911
1911
|
segmentStyle.underlineStyle
|
|
1912
1912
|
);
|
|
@@ -1929,7 +1929,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1929
1929
|
complexScript: segmentStyle.complexScriptFont || element.textStyle?.complexScriptFont || baseFontFamily,
|
|
1930
1930
|
symbol: segmentStyle.symbolFont || element.textStyle?.symbolFont || baseFontFamily
|
|
1931
1931
|
};
|
|
1932
|
-
const needsScriptFonts =
|
|
1932
|
+
const needsScriptFonts = chunk46Z6MNRS_js.hasDistinctScriptFonts(scriptFonts);
|
|
1933
1933
|
const spanStyle = {
|
|
1934
1934
|
color: resolvedSegmentColor,
|
|
1935
1935
|
fontSize: baseFontSize * baselineFontScale,
|
|
@@ -1947,15 +1947,15 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1947
1947
|
fontVariantCaps: segmentStyle.textCaps === "small" ? "small-caps" : void 0,
|
|
1948
1948
|
letterSpacing,
|
|
1949
1949
|
fontKerning,
|
|
1950
|
-
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ?
|
|
1950
|
+
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ? chunk46Z6MNRS_js.normalizeHexColor(segmentStyle.highlightColor, "transparent") : void 0,
|
|
1951
1951
|
...textFillStyles,
|
|
1952
|
-
textDecorationColor: segmentStyle.underlineColor ?
|
|
1953
|
-
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${
|
|
1952
|
+
textDecorationColor: segmentStyle.underlineColor ? chunk46Z6MNRS_js.normalizeHexColor(segmentStyle.underlineColor, void 0) : void 0,
|
|
1953
|
+
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${chunk46Z6MNRS_js.normalizeHexColor(segmentStyle.textOutlineColor, "#000000")}` : segmentStyle.textOutlineWidth ? `${segmentStyle.textOutlineWidth}px currentColor` : void 0,
|
|
1954
1954
|
paintOrder: segmentStyle.textOutlineWidth ? "stroke fill" : void 0,
|
|
1955
|
-
textShadow:
|
|
1956
|
-
filter:
|
|
1957
|
-
opacity:
|
|
1958
|
-
WebkitBoxReflect:
|
|
1955
|
+
textShadow: chunk46Z6MNRS_js.buildTextShadowCss(segmentStyle),
|
|
1956
|
+
filter: chunk46Z6MNRS_js.buildTextRunFilterChain(segmentStyle),
|
|
1957
|
+
opacity: chunk46Z6MNRS_js.getTextAlphaOpacity(segmentStyle),
|
|
1958
|
+
WebkitBoxReflect: chunk46Z6MNRS_js.buildTextReflectionCss(segmentStyle)
|
|
1959
1959
|
};
|
|
1960
1960
|
const runRtl = segmentStyle.rtl;
|
|
1961
1961
|
if (runRtl !== void 0 && runRtl !== paragraphRtl) {
|
|
@@ -1975,7 +1975,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1975
1975
|
spanStyle.fontSize = baseFontSize * (bulletInfo.sizePercent / 100) * baselineFontScale;
|
|
1976
1976
|
}
|
|
1977
1977
|
if (bulletInfo.color) {
|
|
1978
|
-
spanStyle.color =
|
|
1978
|
+
spanStyle.color = chunk46Z6MNRS_js.normalizeHexColor(bulletInfo.color, resolvedSegmentColor);
|
|
1979
1979
|
}
|
|
1980
1980
|
}
|
|
1981
1981
|
if (bulletInfo?.imageDataUrl || bulletInfo?.imageRelId) {
|
|
@@ -2015,7 +2015,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
2015
2015
|
textAlign: segment.rubyAlignment === "l" ? "left" : segment.rubyAlignment === "r" ? "right" : segment.rubyAlignment === "dist" || segment.rubyAlignment === "distCat" || segment.rubyAlignment === "distLetter" ? "justify" : "center"
|
|
2016
2016
|
};
|
|
2017
2017
|
if (segment.rubyStyle?.color) {
|
|
2018
|
-
rubyStyle.color =
|
|
2018
|
+
rubyStyle.color = chunk46Z6MNRS_js.normalizeHexColor(segment.rubyStyle.color, resolvedSegmentColor);
|
|
2019
2019
|
}
|
|
2020
2020
|
innerContent = /* @__PURE__ */ jsxRuntime.jsxs("ruby", { children: [
|
|
2021
2021
|
baseContent,
|
|
@@ -2149,14 +2149,14 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2149
2149
|
return Boolean(segment.text) && segment.text.trim().length > 0;
|
|
2150
2150
|
});
|
|
2151
2151
|
const hasBullet = bulletInfo && !bulletInfo.none && hasVisibleTextContent;
|
|
2152
|
-
const paraRtl =
|
|
2152
|
+
const paraRtl = chunk46Z6MNRS_js.resolveParagraphRtl(paraSegments, elementRtl);
|
|
2153
2153
|
const isRtlParagraph = paraRtl === true;
|
|
2154
|
-
const paraAlign =
|
|
2155
|
-
const cssTextAlign =
|
|
2154
|
+
const paraAlign = chunk46Z6MNRS_js.resolveParagraphAlign(paraSegments, elementAlign);
|
|
2155
|
+
const cssTextAlign = chunk46Z6MNRS_js.resolveCssTextAlign(paraAlign, isRtlParagraph);
|
|
2156
2156
|
const paraMarginLeft = isRtlParagraph ? void 0 : rawMarginLeft;
|
|
2157
2157
|
const paraMarginRight = isRtlParagraph ? rawMarginLeft : void 0;
|
|
2158
2158
|
const paraTextIndent = rawTextIndent;
|
|
2159
|
-
const paraKinsokuStyle =
|
|
2159
|
+
const paraKinsokuStyle = chunk46Z6MNRS_js.getKinsokuLineBreakStyles(firstSeg?.segment.style);
|
|
2160
2160
|
const hasParaKinsoku = Object.keys(paraKinsokuStyle).length > 0;
|
|
2161
2161
|
const paraProps = effectiveSegments[firstSeg?.globalIndex ?? -1]?.paragraphProperties;
|
|
2162
2162
|
const spacing = resolveParagraphSpacing({
|
|
@@ -2260,8 +2260,8 @@ function buildLineShadowCss(element) {
|
|
|
2260
2260
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
2261
2261
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
2262
2262
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
2263
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
2264
|
-
|
|
2263
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunk46Z6MNRS_js.colorWithOpacity(
|
|
2264
|
+
chunk46Z6MNRS_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
2265
2265
|
opacity
|
|
2266
2266
|
)}`;
|
|
2267
2267
|
}
|
|
@@ -2275,7 +2275,7 @@ function buildLineGlowFilter(element) {
|
|
|
2275
2275
|
}
|
|
2276
2276
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
2277
2277
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
2278
|
-
const glowCol =
|
|
2278
|
+
const glowCol = chunk46Z6MNRS_js.colorWithOpacity(chunk46Z6MNRS_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
2279
2279
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
2280
2280
|
}
|
|
2281
2281
|
function mapDagBlendModeToCss(blend) {
|
|
@@ -2362,7 +2362,7 @@ function getRoundRectRadiusPx2(element) {
|
|
|
2362
2362
|
|
|
2363
2363
|
// src/viewer/utils/shape-visual-3d.ts
|
|
2364
2364
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
2365
|
-
return
|
|
2365
|
+
return chunk46Z6MNRS_js.build3DExtrusionData(
|
|
2366
2366
|
shape3d,
|
|
2367
2367
|
scene3d,
|
|
2368
2368
|
fillColor,
|
|
@@ -2371,7 +2371,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
2371
2371
|
);
|
|
2372
2372
|
}
|
|
2373
2373
|
function apply3dEffects2(base, scene3d, shape3d, fillColorFallback) {
|
|
2374
|
-
|
|
2374
|
+
chunk46Z6MNRS_js.apply3dEffects(base, scene3d, shape3d, fillColorFallback);
|
|
2375
2375
|
}
|
|
2376
2376
|
|
|
2377
2377
|
// src/viewer/utils/vector-subpath-paint.ts
|
|
@@ -2380,7 +2380,7 @@ function toHexByte(value) {
|
|
|
2380
2380
|
return clamped.toString(16).padStart(2, "0");
|
|
2381
2381
|
}
|
|
2382
2382
|
function shiftHex(hex, factor, towardsWhite) {
|
|
2383
|
-
const channels =
|
|
2383
|
+
const channels = chunk46Z6MNRS_js.hexToRgbChannels(hex);
|
|
2384
2384
|
if (!channels) {
|
|
2385
2385
|
return hex;
|
|
2386
2386
|
}
|
|
@@ -2406,7 +2406,7 @@ function buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity) {
|
|
|
2406
2406
|
const fillOff = subpath.fillMode === "none" || !hasFill;
|
|
2407
2407
|
return {
|
|
2408
2408
|
d: subpath.d,
|
|
2409
|
-
fill: fillOff ? "none" :
|
|
2409
|
+
fill: fillOff ? "none" : chunk46Z6MNRS_js.colorWithOpacity(adjustFillForMode(fillColor, subpath.fillMode), fillOpacity),
|
|
2410
2410
|
stroked: subpath.stroke !== false
|
|
2411
2411
|
};
|
|
2412
2412
|
});
|
|
@@ -2441,23 +2441,23 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2441
2441
|
return {};
|
|
2442
2442
|
}
|
|
2443
2443
|
const normalizedShapeType = getShapeType(element.shapeType);
|
|
2444
|
-
const clipPath =
|
|
2444
|
+
const clipPath = chunk46Z6MNRS_js.getResolvedShapeClipPath(element);
|
|
2445
2445
|
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;
|
|
2446
2446
|
const rendersStrokeOnlyPreset = Boolean(getStrokeOnlyPresetPaths(element));
|
|
2447
2447
|
const fillOpacity = element.shapeStyle?.fillOpacity;
|
|
2448
2448
|
const strokeOpacity = element.shapeStyle?.strokeOpacity;
|
|
2449
|
-
const strokeDash =
|
|
2450
|
-
const fillGradient =
|
|
2451
|
-
const shadowCss =
|
|
2452
|
-
const innerShadowCss =
|
|
2453
|
-
const resolvedFillColor =
|
|
2454
|
-
const resolvedStrokeColor =
|
|
2449
|
+
const strokeDash = chunk46Z6MNRS_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2450
|
+
const fillGradient = chunk46Z6MNRS_js.buildCssGradientFromShapeStyle(element.shapeStyle) || element.shapeStyle?.fillGradient;
|
|
2451
|
+
const shadowCss = chunk46Z6MNRS_js.buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
2452
|
+
const innerShadowCss = chunk46Z6MNRS_js.buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
2453
|
+
const resolvedFillColor = chunk46Z6MNRS_js.colorWithOpacity(fillColor, fillOpacity);
|
|
2454
|
+
const resolvedStrokeColor = chunk46Z6MNRS_js.colorWithOpacity(strokeColor, strokeOpacity);
|
|
2455
2455
|
const ss = element.shapeStyle;
|
|
2456
2456
|
const hasFillOverlayColor = Boolean(
|
|
2457
2457
|
ss?.dagFillOverlayColor && ss.dagFillOverlayColor !== "transparent"
|
|
2458
2458
|
);
|
|
2459
2459
|
const combinedShadowParts = [];
|
|
2460
|
-
const multiLayerShadow =
|
|
2460
|
+
const multiLayerShadow = chunk46Z6MNRS_js.buildMultiLayerShadowCss(element.shapeStyle);
|
|
2461
2461
|
if (multiLayerShadow) {
|
|
2462
2462
|
combinedShadowParts.push(multiLayerShadow);
|
|
2463
2463
|
} else if (shadowCss) {
|
|
@@ -2466,7 +2466,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2466
2466
|
if (innerShadowCss) {
|
|
2467
2467
|
combinedShadowParts.push(innerShadowCss);
|
|
2468
2468
|
}
|
|
2469
|
-
const glowBoxShadow =
|
|
2469
|
+
const glowBoxShadow = chunk46Z6MNRS_js.buildGlowBoxShadow(ss?.glowColor, ss?.glowRadius, ss?.glowOpacity);
|
|
2470
2470
|
if (glowBoxShadow) {
|
|
2471
2471
|
combinedShadowParts.push(glowBoxShadow);
|
|
2472
2472
|
}
|
|
@@ -2474,7 +2474,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2474
2474
|
if (lineShadow) {
|
|
2475
2475
|
combinedShadowParts.push(lineShadow);
|
|
2476
2476
|
}
|
|
2477
|
-
const compoundLineShadow =
|
|
2477
|
+
const compoundLineShadow = chunk46Z6MNRS_js.getCompoundLineBoxShadow(
|
|
2478
2478
|
element.shapeStyle?.compoundLine,
|
|
2479
2479
|
strokeWidth,
|
|
2480
2480
|
resolvedStrokeColor
|
|
@@ -2487,11 +2487,11 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2487
2487
|
if (ss?.glowColor && ss.glowColor !== "transparent" && ss.glowRadius) {
|
|
2488
2488
|
const glowOpacity = typeof ss.glowOpacity === "number" ? ss.glowOpacity : 0.75;
|
|
2489
2489
|
const glowRad = Math.round(Math.max(0, ss.glowRadius));
|
|
2490
|
-
const glowCol =
|
|
2490
|
+
const glowCol = chunk46Z6MNRS_js.colorWithOpacity(chunk46Z6MNRS_js.normalizeHexColor(ss.glowColor, "#ffff00"), glowOpacity);
|
|
2491
2491
|
filterParts.push(`drop-shadow(0 0 ${glowRad}px ${glowCol})`);
|
|
2492
2492
|
}
|
|
2493
2493
|
if (typeof ss?.softEdgeRadius === "number" && ss.softEdgeRadius > 0) {
|
|
2494
|
-
filterParts.push(`url(#${
|
|
2494
|
+
filterParts.push(`url(#${chunk46Z6MNRS_js.getSoftEdgeFilterId(element.id)})`);
|
|
2495
2495
|
}
|
|
2496
2496
|
if (typeof ss?.blurRadius === "number" && ss.blurRadius > 0) {
|
|
2497
2497
|
filterParts.push(`blur(${Math.round(ss.blurRadius)}px)`);
|
|
@@ -2500,13 +2500,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2500
2500
|
if (lineGlowCss) {
|
|
2501
2501
|
filterParts.push(lineGlowCss);
|
|
2502
2502
|
}
|
|
2503
|
-
const dagFilter =
|
|
2503
|
+
const dagFilter = chunk46Z6MNRS_js.getEffectDagFilter(ss, element.id);
|
|
2504
2504
|
if (dagFilter) {
|
|
2505
2505
|
filterParts.push(dagFilter);
|
|
2506
2506
|
}
|
|
2507
2507
|
const lineJoinCss = ss?.lineJoin === "round" ? "round" : ss?.lineJoin === "bevel" ? "bevel" : ss?.lineJoin === "miter" ? "miter" : void 0;
|
|
2508
2508
|
const miterLimitCss = ss?.lineJoin === "miter" && typeof ss?.miterLimit === "number" ? Math.max(ss.miterLimit / 1e5, 1) : void 0;
|
|
2509
|
-
const patternFill =
|
|
2509
|
+
const patternFill = chunk46Z6MNRS_js.buildPatternFillCss(element.shapeStyle);
|
|
2510
2510
|
const imageFillUrl = ss?.fillMode === "image" && ss.fillImageUrl ? ss.fillImageUrl : void 0;
|
|
2511
2511
|
const imageFillMode = ss?.fillImageMode || "stretch";
|
|
2512
2512
|
let reflectCss;
|
|
@@ -2518,7 +2518,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2518
2518
|
const endOpacity = typeof ss.reflectionEndOpacity === "number" ? ss.reflectionEndOpacity : 0;
|
|
2519
2519
|
const fadeLength = typeof ss.reflectionEndPosition === "number" ? Math.round(ss.reflectionEndPosition * Math.max(element.height, 1)) : 100;
|
|
2520
2520
|
const blurRadius = typeof ss.reflectionBlurRadius === "number" ? ss.reflectionBlurRadius : 0;
|
|
2521
|
-
reflectCss =
|
|
2521
|
+
reflectCss = chunk46Z6MNRS_js.buildReflectionCss(distance, startOpacity, endOpacity, fadeLength, blurRadius);
|
|
2522
2522
|
}
|
|
2523
2523
|
}
|
|
2524
2524
|
const base = {
|
|
@@ -2536,9 +2536,9 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2536
2536
|
// is present, `ShapeEffectOverlay` paints a separate blended tint layer so
|
|
2537
2537
|
// the colour is actually rendered (and text/children are not tinted).
|
|
2538
2538
|
mixBlendMode: hasFillOverlayColor ? void 0 : mapDagBlendModeToCss(ss?.dagFillOverlayBlend),
|
|
2539
|
-
borderWidth: strokeWidth > 0 ?
|
|
2539
|
+
borderWidth: strokeWidth > 0 ? chunk46Z6MNRS_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : void 0,
|
|
2540
2540
|
borderColor: strokeWidth > 0 ? resolvedStrokeColor : void 0,
|
|
2541
|
-
borderStyle: strokeWidth > 0 ?
|
|
2541
|
+
borderStyle: strokeWidth > 0 ? chunk46Z6MNRS_js.getCssBorderDashStyle(strokeDash, ss?.compoundLine) : void 0,
|
|
2542
2542
|
strokeLinejoin: lineJoinCss,
|
|
2543
2543
|
strokeMiterlimit: miterLimitCss,
|
|
2544
2544
|
strokeLinecap: ss?.lineCap === "rnd" ? "round" : ss?.lineCap === "sq" ? "square" : ss?.lineCap === "flat" ? "butt" : void 0
|
|
@@ -2594,7 +2594,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2594
2594
|
borderWidth: 0,
|
|
2595
2595
|
borderTopWidth: Math.max(strokeWidth, 2),
|
|
2596
2596
|
borderTopColor: resolvedStrokeColor,
|
|
2597
|
-
borderTopStyle:
|
|
2597
|
+
borderTopStyle: chunk46Z6MNRS_js.getCssBorderDashStyle(strokeDash)
|
|
2598
2598
|
};
|
|
2599
2599
|
}
|
|
2600
2600
|
if (normalizedShapeType === "cylinder") {
|
|
@@ -2608,13 +2608,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2608
2608
|
function getConnectorAdjustment(element, key, fallback) {
|
|
2609
2609
|
const direct = element.shapeAdjustments?.[key];
|
|
2610
2610
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
2611
|
-
return
|
|
2611
|
+
return chunk46Z6MNRS_js.clampUnitInterval(direct / 1e5);
|
|
2612
2612
|
}
|
|
2613
2613
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
2614
2614
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
2615
|
-
return
|
|
2615
|
+
return chunk46Z6MNRS_js.clampUnitInterval(fallbackKey / 1e5);
|
|
2616
2616
|
}
|
|
2617
|
-
return
|
|
2617
|
+
return chunk46Z6MNRS_js.clampUnitInterval(fallback);
|
|
2618
2618
|
}
|
|
2619
2619
|
function getConnectorPathGeometry(element) {
|
|
2620
2620
|
const width = Math.max(element.width, 1);
|
|
@@ -2751,11 +2751,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
|
|
|
2751
2751
|
strokePaint,
|
|
2752
2752
|
strokeWidth,
|
|
2753
2753
|
dashArray,
|
|
2754
|
-
lineCap:
|
|
2754
|
+
lineCap: chunk46Z6MNRS_js.svgLineCap(shapeStyle?.lineCap),
|
|
2755
2755
|
lineJoin,
|
|
2756
2756
|
miterLimit,
|
|
2757
|
-
offsets:
|
|
2758
|
-
widths:
|
|
2757
|
+
offsets: chunk46Z6MNRS_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
2758
|
+
widths: chunk46Z6MNRS_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
|
|
2759
2759
|
};
|
|
2760
2760
|
}
|
|
2761
2761
|
function strokeStrands(d, keyBase, ctx) {
|
|
@@ -2809,7 +2809,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2809
2809
|
"path",
|
|
2810
2810
|
{
|
|
2811
2811
|
d: pathData,
|
|
2812
|
-
fill: animatesFill ? "inherit" :
|
|
2812
|
+
fill: animatesFill ? "inherit" : chunk46Z6MNRS_js.colorWithOpacity(fillColor, fillOpacity),
|
|
2813
2813
|
stroke: "none",
|
|
2814
2814
|
vectorEffect: "non-scaling-stroke"
|
|
2815
2815
|
},
|
|
@@ -2855,10 +2855,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2855
2855
|
return null;
|
|
2856
2856
|
}
|
|
2857
2857
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
2858
|
-
const fillPaint = animatesFill ? "inherit" :
|
|
2859
|
-
const strokePaint = animatesStroke ? "inherit" :
|
|
2860
|
-
const dashType =
|
|
2861
|
-
const dashArray =
|
|
2858
|
+
const fillPaint = animatesFill ? "inherit" : chunk46Z6MNRS_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
2859
|
+
const strokePaint = animatesStroke ? "inherit" : chunk46Z6MNRS_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
2860
|
+
const dashType = chunk46Z6MNRS_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2861
|
+
const dashArray = chunk46Z6MNRS_js.getSvgStrokeDasharray(
|
|
2862
2862
|
dashType,
|
|
2863
2863
|
Math.max(strokeWidth, 1),
|
|
2864
2864
|
element.shapeStyle?.customDashSegments
|
|
@@ -3011,10 +3011,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
3011
3011
|
const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
|
|
3012
3012
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
3013
3013
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
3014
|
-
const connectorLineCap =
|
|
3014
|
+
const connectorLineCap = chunk46Z6MNRS_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
3015
3015
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
3016
|
-
const offsets =
|
|
3017
|
-
const widths =
|
|
3016
|
+
const offsets = chunk46Z6MNRS_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
3017
|
+
const widths = chunk46Z6MNRS_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
3018
3018
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3019
3019
|
"svg",
|
|
3020
3020
|
{
|
|
@@ -3093,9 +3093,9 @@ function parseGradientFillCss(gradFill) {
|
|
|
3093
3093
|
}
|
|
3094
3094
|
const parsed = stops.map((gs) => {
|
|
3095
3095
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
3096
|
-
const color =
|
|
3097
|
-
const opacity =
|
|
3098
|
-
return { pos, color:
|
|
3096
|
+
const color = chunk46Z6MNRS_js.parseDrawingColor(gs) ?? "#888888";
|
|
3097
|
+
const opacity = chunk46Z6MNRS_js.parseDrawingColorOpacity(gs);
|
|
3098
|
+
return { pos, color: chunk46Z6MNRS_js.colorWithOpacity(color, opacity) };
|
|
3099
3099
|
}).sort((a, b) => a.pos - b.pos);
|
|
3100
3100
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
3101
3101
|
const lin = gradFill["a:lin"];
|
|
@@ -3136,8 +3136,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
3136
3136
|
if (!pattFill) {
|
|
3137
3137
|
return void 0;
|
|
3138
3138
|
}
|
|
3139
|
-
const fgColor =
|
|
3140
|
-
const bgColor =
|
|
3139
|
+
const fgColor = chunk46Z6MNRS_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
3140
|
+
const bgColor = chunk46Z6MNRS_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
3141
3141
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
3142
3142
|
switch (preset) {
|
|
3143
3143
|
case "ltHorz":
|
|
@@ -3248,11 +3248,11 @@ function parseCellBorders(cellProperties) {
|
|
|
3248
3248
|
const prstDash = ln["a:prstDash"];
|
|
3249
3249
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
3250
3250
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
3251
|
-
const color =
|
|
3251
|
+
const color = chunk46Z6MNRS_js.parseDrawingColor(ln["a:solidFill"]);
|
|
3252
3252
|
if (color) {
|
|
3253
|
-
const opacity =
|
|
3253
|
+
const opacity = chunk46Z6MNRS_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
3254
3254
|
const key = `${edge.prefix}`;
|
|
3255
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
3255
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunk46Z6MNRS_js.colorWithOpacity(color, opacity)}`;
|
|
3256
3256
|
}
|
|
3257
3257
|
}
|
|
3258
3258
|
return borderStyle;
|
|
@@ -3265,7 +3265,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3265
3265
|
const textShadowParts = [];
|
|
3266
3266
|
const outerShdw = effectLst["a:outerShdw"];
|
|
3267
3267
|
if (outerShdw) {
|
|
3268
|
-
const shdwColor =
|
|
3268
|
+
const shdwColor = chunk46Z6MNRS_js.parseDrawingColor(outerShdw);
|
|
3269
3269
|
if (shdwColor) {
|
|
3270
3270
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
3271
3271
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -3283,7 +3283,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3283
3283
|
}
|
|
3284
3284
|
const glow = effectLst["a:glow"];
|
|
3285
3285
|
if (glow) {
|
|
3286
|
-
const glowColor =
|
|
3286
|
+
const glowColor = chunk46Z6MNRS_js.parseDrawingColor(glow);
|
|
3287
3287
|
if (glowColor) {
|
|
3288
3288
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
3289
3289
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -3362,10 +3362,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3362
3362
|
if (runProps?.["@_u"] !== void 0) {
|
|
3363
3363
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
3364
3364
|
}
|
|
3365
|
-
const runColor =
|
|
3365
|
+
const runColor = chunk46Z6MNRS_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunk46Z6MNRS_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
3366
3366
|
if (runColor) {
|
|
3367
|
-
const opacity =
|
|
3368
|
-
cellStyle.color =
|
|
3367
|
+
const opacity = chunk46Z6MNRS_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
3368
|
+
cellStyle.color = chunk46Z6MNRS_js.colorWithOpacity(runColor, opacity);
|
|
3369
3369
|
}
|
|
3370
3370
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
3371
3371
|
if (fontFamily) {
|
|
@@ -3375,15 +3375,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3375
3375
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
3376
3376
|
}
|
|
3377
3377
|
const cellProperties = cellXml["a:tcPr"];
|
|
3378
|
-
const cellFill =
|
|
3378
|
+
const cellFill = chunk46Z6MNRS_js.parseDrawingColor(
|
|
3379
3379
|
cellProperties?.["a:solidFill"],
|
|
3380
3380
|
schemeColorOverrides
|
|
3381
3381
|
);
|
|
3382
3382
|
if (cellFill) {
|
|
3383
|
-
const opacity =
|
|
3383
|
+
const opacity = chunk46Z6MNRS_js.parseDrawingColorOpacity(
|
|
3384
3384
|
cellProperties?.["a:solidFill"]
|
|
3385
3385
|
);
|
|
3386
|
-
cellStyle.backgroundColor =
|
|
3386
|
+
cellStyle.backgroundColor = chunk46Z6MNRS_js.colorWithOpacity(cellFill, opacity);
|
|
3387
3387
|
} else {
|
|
3388
3388
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
3389
3389
|
if (gradCss) {
|
|
@@ -3398,16 +3398,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3398
3398
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
3399
3399
|
Object.assign(cellStyle, edgeBorders);
|
|
3400
3400
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
3401
|
-
const borderColor =
|
|
3401
|
+
const borderColor = chunk46Z6MNRS_js.parseDrawingColor(
|
|
3402
3402
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
3403
3403
|
schemeColorOverrides
|
|
3404
|
-
) ||
|
|
3404
|
+
) || chunk46Z6MNRS_js.parseDrawingColor(
|
|
3405
3405
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
3406
3406
|
schemeColorOverrides
|
|
3407
|
-
) ||
|
|
3407
|
+
) || chunk46Z6MNRS_js.parseDrawingColor(
|
|
3408
3408
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
3409
3409
|
schemeColorOverrides
|
|
3410
|
-
) ||
|
|
3410
|
+
) || chunk46Z6MNRS_js.parseDrawingColor(
|
|
3411
3411
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
3412
3412
|
schemeColorOverrides
|
|
3413
3413
|
);
|
|
@@ -3486,10 +3486,10 @@ function resolveTableStyleFillColor(fill, colorScheme) {
|
|
|
3486
3486
|
}
|
|
3487
3487
|
let color = base;
|
|
3488
3488
|
if (fill.tint !== void 0 && fill.tint > 0) {
|
|
3489
|
-
color =
|
|
3489
|
+
color = chunk46Z6MNRS_js.tintColor2(color, fill.tint / 1e5);
|
|
3490
3490
|
}
|
|
3491
3491
|
if (fill.shade !== void 0 && fill.shade > 0) {
|
|
3492
|
-
color =
|
|
3492
|
+
color = chunk46Z6MNRS_js.shadeColor2(color, 1 - fill.shade / 1e5);
|
|
3493
3493
|
}
|
|
3494
3494
|
return color;
|
|
3495
3495
|
}
|
|
@@ -3514,7 +3514,7 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3514
3514
|
style.fontFamily = text.fontFace;
|
|
3515
3515
|
applied = true;
|
|
3516
3516
|
} else {
|
|
3517
|
-
const refFont =
|
|
3517
|
+
const refFont = chunk46Z6MNRS_js.resolveFontRefIdx(text.fontRefIdx, fontScheme);
|
|
3518
3518
|
if (refFont) {
|
|
3519
3519
|
style.fontFamily = refFont;
|
|
3520
3520
|
applied = true;
|
|
@@ -3525,10 +3525,10 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3525
3525
|
if (base) {
|
|
3526
3526
|
let color = base;
|
|
3527
3527
|
if (text.fontTint !== void 0 && text.fontTint > 0) {
|
|
3528
|
-
color =
|
|
3528
|
+
color = chunk46Z6MNRS_js.tintColor2(color, text.fontTint / 1e5);
|
|
3529
3529
|
}
|
|
3530
3530
|
if (text.fontShade !== void 0 && text.fontShade > 0) {
|
|
3531
|
-
color =
|
|
3531
|
+
color = chunk46Z6MNRS_js.shadeColor2(color, 1 - text.fontShade / 1e5);
|
|
3532
3532
|
}
|
|
3533
3533
|
style.color = color;
|
|
3534
3534
|
applied = true;
|
|
@@ -3717,7 +3717,7 @@ function parseTableElementData(element, fallbackTextStyle) {
|
|
|
3717
3717
|
};
|
|
3718
3718
|
}
|
|
3719
3719
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
3720
|
-
return
|
|
3720
|
+
return chunk46Z6MNRS_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
3721
3721
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
3722
3722
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
3723
3723
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -3865,9 +3865,9 @@ function cellStyleToCss(style) {
|
|
|
3865
3865
|
if (style.gradientFillCss) {
|
|
3866
3866
|
css.background = style.gradientFillCss;
|
|
3867
3867
|
} else if (style.fillMode === "pattern" && style.patternFillPreset) {
|
|
3868
|
-
const fg =
|
|
3869
|
-
const bg =
|
|
3870
|
-
const svgPattern =
|
|
3868
|
+
const fg = chunk46Z6MNRS_js.normalizeHexColor(style.patternFillForeground, "#000000");
|
|
3869
|
+
const bg = chunk46Z6MNRS_js.normalizeHexColor(style.patternFillBackground, "#ffffff");
|
|
3870
|
+
const svgPattern = chunk46Z6MNRS_js.getPatternSvg(style.patternFillPreset, fg, bg);
|
|
3871
3871
|
if (svgPattern) {
|
|
3872
3872
|
const encoded = encodeURIComponent(svgPattern);
|
|
3873
3873
|
css.backgroundImage = `url("data:image/svg+xml,${encoded}")`;
|
|
@@ -3943,7 +3943,7 @@ function cellStyleToCss(style) {
|
|
|
3943
3943
|
if (edge.width || edge.color) {
|
|
3944
3944
|
const w = edge.width ?? 1;
|
|
3945
3945
|
const c = edge.color ?? style.borderColor ?? "#000000";
|
|
3946
|
-
const s =
|
|
3946
|
+
const s = chunk46Z6MNRS_js.ooxmlDashToCssBorderStyle(edge.dash);
|
|
3947
3947
|
css[edge.prefix] = `${w}px ${s} ${c}`;
|
|
3948
3948
|
}
|
|
3949
3949
|
}
|
|
@@ -3974,7 +3974,7 @@ function cellStyleToCss(style) {
|
|
|
3974
3974
|
css.textShadow = textShadowParts.join(", ");
|
|
3975
3975
|
}
|
|
3976
3976
|
if (style.cell3D) {
|
|
3977
|
-
Object.assign(css,
|
|
3977
|
+
Object.assign(css, chunk46Z6MNRS_js.cell3DBevelCss(style.cell3D));
|
|
3978
3978
|
}
|
|
3979
3979
|
return css;
|
|
3980
3980
|
}
|
|
@@ -3988,7 +3988,7 @@ function TableResizeOverlay({
|
|
|
3988
3988
|
const containerRef = React6.useRef(null);
|
|
3989
3989
|
const [rowBounds, setRowBounds] = React6.useState([]);
|
|
3990
3990
|
const dragRef = React6.useRef(null);
|
|
3991
|
-
const colBoundaries = React6.useMemo(() =>
|
|
3991
|
+
const colBoundaries = React6.useMemo(() => chunk46Z6MNRS_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
3992
3992
|
const measureRows = React6.useCallback(() => {
|
|
3993
3993
|
const container = containerRef.current;
|
|
3994
3994
|
if (!container) {
|
|
@@ -4035,11 +4035,11 @@ function TableResizeOverlay({
|
|
|
4035
4035
|
const rect = containerRef.current.getBoundingClientRect();
|
|
4036
4036
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
4037
4037
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
4038
|
-
onResizeColumns(
|
|
4038
|
+
onResizeColumns(chunk46Z6MNRS_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
4039
4039
|
} else if (drag.type === "row" && onResizeRow) {
|
|
4040
4040
|
const deltaY = e.clientY - drag.startPos;
|
|
4041
|
-
const newHeight =
|
|
4042
|
-
drag.initialRowHeight ??
|
|
4041
|
+
const newHeight = chunk46Z6MNRS_js.computeResizedRowHeight(
|
|
4042
|
+
drag.initialRowHeight ?? chunk46Z6MNRS_js.DEFAULT_ROW_HEIGHT,
|
|
4043
4043
|
deltaY
|
|
4044
4044
|
);
|
|
4045
4045
|
onResizeRow(drag.index, newHeight);
|
|
@@ -4077,7 +4077,7 @@ function TableResizeOverlay({
|
|
|
4077
4077
|
e.stopPropagation();
|
|
4078
4078
|
const table = containerRef.current?.querySelector("table");
|
|
4079
4079
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
4080
|
-
const actualHeight = tr?.offsetHeight ??
|
|
4080
|
+
const actualHeight = tr?.offsetHeight ?? chunk46Z6MNRS_js.DEFAULT_ROW_HEIGHT;
|
|
4081
4081
|
document.body.style.cursor = "row-resize";
|
|
4082
4082
|
document.body.style.userSelect = "none";
|
|
4083
4083
|
dragRef.current = {
|
|
@@ -4125,7 +4125,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4125
4125
|
}
|
|
4126
4126
|
const first = selectedCell.selectedCells[0];
|
|
4127
4127
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4128
|
-
return
|
|
4128
|
+
return chunk46Z6MNRS_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
4129
4129
|
})();
|
|
4130
4130
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4131
4131
|
TableResizeOverlay,
|
|
@@ -4158,7 +4158,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4158
4158
|
return null;
|
|
4159
4159
|
}
|
|
4160
4160
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
4161
|
-
const isInMultiSelection =
|
|
4161
|
+
const isInMultiSelection = chunk46Z6MNRS_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
4162
4162
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
4163
4163
|
const diag = getCellDiagonalBorders2(
|
|
4164
4164
|
cell.style,
|
|
@@ -4188,7 +4188,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4188
4188
|
}
|
|
4189
4189
|
event.stopPropagation();
|
|
4190
4190
|
if (event.shiftKey && selectedCell) {
|
|
4191
|
-
const rect =
|
|
4191
|
+
const rect = chunk46Z6MNRS_js.computeSelectionRect(
|
|
4192
4192
|
selectedCell.rowIndex,
|
|
4193
4193
|
selectedCell.columnIndex,
|
|
4194
4194
|
rowIndex,
|
|
@@ -4198,7 +4198,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4198
4198
|
options?.onSelectCell?.({
|
|
4199
4199
|
rowIndex: selectedCell.rowIndex,
|
|
4200
4200
|
columnIndex: selectedCell.columnIndex,
|
|
4201
|
-
selectedCells:
|
|
4201
|
+
selectedCells: chunk46Z6MNRS_js.rectToCells(rect)
|
|
4202
4202
|
});
|
|
4203
4203
|
} else {
|
|
4204
4204
|
options?.onSelectCell?.({
|
|
@@ -4275,7 +4275,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4275
4275
|
}
|
|
4276
4276
|
const first = selectedCell.selectedCells[0];
|
|
4277
4277
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4278
|
-
return
|
|
4278
|
+
return chunk46Z6MNRS_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
4279
4279
|
})();
|
|
4280
4280
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
4281
4281
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4352,7 +4352,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4352
4352
|
"border px-1 py-0.5 align-top",
|
|
4353
4353
|
isEditable && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
4354
4354
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
4355
|
-
|
|
4355
|
+
chunk46Z6MNRS_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
4356
4356
|
),
|
|
4357
4357
|
colSpan,
|
|
4358
4358
|
rowSpan: rSpan,
|
|
@@ -4363,7 +4363,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4363
4363
|
}
|
|
4364
4364
|
event.stopPropagation();
|
|
4365
4365
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
4366
|
-
const rect =
|
|
4366
|
+
const rect = chunk46Z6MNRS_js.computeSelectionRect(
|
|
4367
4367
|
selectedCell.rowIndex,
|
|
4368
4368
|
selectedCell.columnIndex,
|
|
4369
4369
|
rowIndex,
|
|
@@ -4373,7 +4373,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4373
4373
|
options?.onSelectCell?.({
|
|
4374
4374
|
rowIndex: selectedCell.rowIndex,
|
|
4375
4375
|
columnIndex: selectedCell.columnIndex,
|
|
4376
|
-
selectedCells:
|
|
4376
|
+
selectedCells: chunk46Z6MNRS_js.rectToCells(rect)
|
|
4377
4377
|
});
|
|
4378
4378
|
} else {
|
|
4379
4379
|
options?.onSelectCell?.({
|
|
@@ -4428,24 +4428,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4428
4428
|
}
|
|
4429
4429
|
var LEGEND_ITEM_WIDTH = 80;
|
|
4430
4430
|
function partAttrs(part) {
|
|
4431
|
-
return part ?
|
|
4431
|
+
return part ? chunk46Z6MNRS_js.chartPartToAttrs(part) : void 0;
|
|
4432
4432
|
}
|
|
4433
4433
|
function resolveReactPalette(chartData) {
|
|
4434
4434
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
4435
4435
|
return chartData.colorPalette;
|
|
4436
4436
|
}
|
|
4437
|
-
return [...
|
|
4437
|
+
return [...chunk46Z6MNRS_js.getChartStylePalette(chartData.style?.styleId)];
|
|
4438
4438
|
}
|
|
4439
4439
|
function buildReactChartViewModel(element) {
|
|
4440
4440
|
if (element.type !== "chart" || !element.chartData) {
|
|
4441
|
-
return
|
|
4441
|
+
return chunk46Z6MNRS_js.buildChartViewModel(element);
|
|
4442
4442
|
}
|
|
4443
4443
|
const palette = resolveReactPalette(element.chartData);
|
|
4444
4444
|
const themedElement = {
|
|
4445
4445
|
...element,
|
|
4446
4446
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
4447
4447
|
};
|
|
4448
|
-
return
|
|
4448
|
+
return chunk46Z6MNRS_js.buildChartViewModel(themedElement);
|
|
4449
4449
|
}
|
|
4450
4450
|
function renderPrimitive(prim, key) {
|
|
4451
4451
|
switch (prim.kind) {
|
|
@@ -4834,7 +4834,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4834
4834
|
const unmatchedRows = [];
|
|
4835
4835
|
categories.forEach((cat, i) => {
|
|
4836
4836
|
const value = values[i] ?? 0;
|
|
4837
|
-
const code =
|
|
4837
|
+
const code = chunk46Z6MNRS_js.resolveRegionCode(cat);
|
|
4838
4838
|
if (code) {
|
|
4839
4839
|
regionValueMap.set(code, { value, label: cat });
|
|
4840
4840
|
} else {
|
|
@@ -4872,8 +4872,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4872
4872
|
let fill = "#e2e8f0";
|
|
4873
4873
|
let dataLabel = null;
|
|
4874
4874
|
if (entry) {
|
|
4875
|
-
const t =
|
|
4876
|
-
fill =
|
|
4875
|
+
const t = chunk46Z6MNRS_js.normalizeValue(entry.value, minVal, maxVal);
|
|
4876
|
+
fill = chunk46Z6MNRS_js.sequentialColorScale(t);
|
|
4877
4877
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
4878
4878
|
"text",
|
|
4879
4879
|
{
|
|
@@ -4884,7 +4884,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4884
4884
|
fontWeight: 600,
|
|
4885
4885
|
fill: "#1e293b",
|
|
4886
4886
|
style: { pointerEvents: "none" },
|
|
4887
|
-
children:
|
|
4887
|
+
children: chunk46Z6MNRS_js.formatAxisValue(entry.value)
|
|
4888
4888
|
},
|
|
4889
4889
|
`${element.id}-map-dl-${region.code}`
|
|
4890
4890
|
);
|
|
@@ -4902,7 +4902,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4902
4902
|
opacity: 0.9,
|
|
4903
4903
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
4904
4904
|
region.name,
|
|
4905
|
-
entry ? `: ${
|
|
4905
|
+
entry ? `: ${chunk46Z6MNRS_js.formatAxisValue(entry.value)}` : ""
|
|
4906
4906
|
] })
|
|
4907
4907
|
}
|
|
4908
4908
|
),
|
|
@@ -4940,7 +4940,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4940
4940
|
fontSize: 7,
|
|
4941
4941
|
fill: "#64748b",
|
|
4942
4942
|
textAnchor: "middle",
|
|
4943
|
-
children:
|
|
4943
|
+
children: chunk46Z6MNRS_js.formatAxisValue(minVal)
|
|
4944
4944
|
},
|
|
4945
4945
|
`${element.id}-map-legend-min`
|
|
4946
4946
|
),
|
|
@@ -4952,7 +4952,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4952
4952
|
fontSize: 7,
|
|
4953
4953
|
fill: "#64748b",
|
|
4954
4954
|
textAnchor: "middle",
|
|
4955
|
-
children:
|
|
4955
|
+
children: chunk46Z6MNRS_js.formatAxisValue(maxVal)
|
|
4956
4956
|
},
|
|
4957
4957
|
`${element.id}-map-legend-max`
|
|
4958
4958
|
)
|
|
@@ -5018,7 +5018,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
5018
5018
|
y,
|
|
5019
5019
|
fontSize,
|
|
5020
5020
|
fill: "#475569",
|
|
5021
|
-
children:
|
|
5021
|
+
children: chunk46Z6MNRS_js.formatAxisValue(row.value)
|
|
5022
5022
|
},
|
|
5023
5023
|
`${element.id}-map-ft-val-${i}`
|
|
5024
5024
|
)
|
|
@@ -5089,7 +5089,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
5089
5089
|
|
|
5090
5090
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
5091
5091
|
function sColor(series, idx) {
|
|
5092
|
-
return
|
|
5092
|
+
return chunk46Z6MNRS_js.seriesColor(series, idx);
|
|
5093
5093
|
}
|
|
5094
5094
|
function valToY(val, range, topY, bottomY) {
|
|
5095
5095
|
const usable = bottomY - topY;
|
|
@@ -5628,7 +5628,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5628
5628
|
width: 10,
|
|
5629
5629
|
height: 10,
|
|
5630
5630
|
rx: 2,
|
|
5631
|
-
fill:
|
|
5631
|
+
fill: chunk46Z6MNRS_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5632
5632
|
},
|
|
5633
5633
|
`${id}-leg-r-${i}`
|
|
5634
5634
|
)
|
|
@@ -5652,7 +5652,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5652
5652
|
width: 10,
|
|
5653
5653
|
height: 10,
|
|
5654
5654
|
rx: 2,
|
|
5655
|
-
fill:
|
|
5655
|
+
fill: chunk46Z6MNRS_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5656
5656
|
}
|
|
5657
5657
|
),
|
|
5658
5658
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -5665,9 +5665,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5665
5665
|
}
|
|
5666
5666
|
const lines = [];
|
|
5667
5667
|
if (range.logScale && range.logBase) {
|
|
5668
|
-
const ticks =
|
|
5668
|
+
const ticks = chunk46Z6MNRS_js.generateLogTicks(range);
|
|
5669
5669
|
ticks.forEach((tickVal, i) => {
|
|
5670
|
-
const y =
|
|
5670
|
+
const y = chunk46Z6MNRS_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5671
5671
|
lines.push(
|
|
5672
5672
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5673
5673
|
"line",
|
|
@@ -5688,7 +5688,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5688
5688
|
const steps = 4;
|
|
5689
5689
|
for (let i = 0; i <= steps; i++) {
|
|
5690
5690
|
const val = range.min + range.span * i / steps;
|
|
5691
|
-
const y =
|
|
5691
|
+
const y = chunk46Z6MNRS_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5692
5692
|
lines.push(
|
|
5693
5693
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5694
5694
|
"line",
|
|
@@ -5712,9 +5712,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5712
5712
|
const labels = [];
|
|
5713
5713
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5714
5714
|
if (range.logScale && range.logBase) {
|
|
5715
|
-
const ticks =
|
|
5715
|
+
const ticks = chunk46Z6MNRS_js.generateLogTicks(range);
|
|
5716
5716
|
ticks.forEach((tickVal, i) => {
|
|
5717
|
-
const y =
|
|
5717
|
+
const y = chunk46Z6MNRS_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5718
5718
|
labels.push(
|
|
5719
5719
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5720
5720
|
"text",
|
|
@@ -5724,7 +5724,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5724
5724
|
textAnchor: "end",
|
|
5725
5725
|
fontSize: 8,
|
|
5726
5726
|
fill: "#64748b",
|
|
5727
|
-
children: hasDisplayUnits ?
|
|
5727
|
+
children: hasDisplayUnits ? chunk46Z6MNRS_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunk46Z6MNRS_js.formatAxisValue(tickVal)
|
|
5728
5728
|
},
|
|
5729
5729
|
`${id}-vaxis-log-${i}`
|
|
5730
5730
|
)
|
|
@@ -5734,7 +5734,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5734
5734
|
const steps = 4;
|
|
5735
5735
|
for (let i = 0; i <= steps; i++) {
|
|
5736
5736
|
const val = range.min + range.span * i / steps;
|
|
5737
|
-
const y =
|
|
5737
|
+
const y = chunk46Z6MNRS_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5738
5738
|
labels.push(
|
|
5739
5739
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5740
5740
|
"text",
|
|
@@ -5744,7 +5744,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5744
5744
|
textAnchor: "end",
|
|
5745
5745
|
fontSize: 8,
|
|
5746
5746
|
fill: "#64748b",
|
|
5747
|
-
children: hasDisplayUnits ?
|
|
5747
|
+
children: hasDisplayUnits ? chunk46Z6MNRS_js.formatAxisValueWithUnits(val, axisFormatting) : chunk46Z6MNRS_js.formatAxisValue(val)
|
|
5748
5748
|
},
|
|
5749
5749
|
`${id}-vaxis-${i}`
|
|
5750
5750
|
)
|
|
@@ -5752,7 +5752,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5752
5752
|
}
|
|
5753
5753
|
}
|
|
5754
5754
|
if (hasDisplayUnits) {
|
|
5755
|
-
const unitLabel =
|
|
5755
|
+
const unitLabel = chunk46Z6MNRS_js.getDisplayUnitLabel(
|
|
5756
5756
|
axisFormatting.displayUnits,
|
|
5757
5757
|
axisFormatting.displayUnitsLabel
|
|
5758
5758
|
);
|
|
@@ -5827,7 +5827,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
5827
5827
|
if (range.min >= 0) {
|
|
5828
5828
|
return null;
|
|
5829
5829
|
}
|
|
5830
|
-
const y =
|
|
5830
|
+
const y = chunk46Z6MNRS_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
5831
5831
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5832
5832
|
"line",
|
|
5833
5833
|
{
|
|
@@ -5851,7 +5851,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5851
5851
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5852
5852
|
for (let i = 0; i <= steps; i++) {
|
|
5853
5853
|
const val = range.min + range.span * i / steps;
|
|
5854
|
-
const y =
|
|
5854
|
+
const y = chunk46Z6MNRS_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5855
5855
|
labels.push(
|
|
5856
5856
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5857
5857
|
"text",
|
|
@@ -5863,7 +5863,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5863
5863
|
fontFamily,
|
|
5864
5864
|
fontWeight,
|
|
5865
5865
|
fill: fontColor,
|
|
5866
|
-
children: hasDisplayUnits ?
|
|
5866
|
+
children: hasDisplayUnits ? chunk46Z6MNRS_js.formatAxisValueWithUnits(val, axisFormatting) : chunk46Z6MNRS_js.formatAxisValue(val)
|
|
5867
5867
|
},
|
|
5868
5868
|
`${id}-sec-vaxis-${i}`
|
|
5869
5869
|
)
|
|
@@ -5887,7 +5887,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5887
5887
|
);
|
|
5888
5888
|
}
|
|
5889
5889
|
if (hasDisplayUnits) {
|
|
5890
|
-
const unitLabel =
|
|
5890
|
+
const unitLabel = chunk46Z6MNRS_js.getDisplayUnitLabel(
|
|
5891
5891
|
axisFormatting.displayUnits,
|
|
5892
5892
|
axisFormatting.displayUnitsLabel
|
|
5893
5893
|
);
|
|
@@ -5918,7 +5918,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
5918
5918
|
const ticks = [];
|
|
5919
5919
|
for (let i = 0; i <= steps; i++) {
|
|
5920
5920
|
const val = range.min + range.span * i / steps;
|
|
5921
|
-
const y =
|
|
5921
|
+
const y = chunk46Z6MNRS_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5922
5922
|
ticks.push(
|
|
5923
5923
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5924
5924
|
"line",
|
|
@@ -5945,7 +5945,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
5945
5945
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
5946
5946
|
for (let i = 0; i <= steps; i++) {
|
|
5947
5947
|
const val = range.min + range.span * i / steps;
|
|
5948
|
-
const y =
|
|
5948
|
+
const y = chunk46Z6MNRS_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5949
5949
|
lines.push(
|
|
5950
5950
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5951
5951
|
"line",
|
|
@@ -6107,7 +6107,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6107
6107
|
width: 8,
|
|
6108
6108
|
height: 8,
|
|
6109
6109
|
borderRadius: 2,
|
|
6110
|
-
backgroundColor:
|
|
6110
|
+
backgroundColor: chunk46Z6MNRS_js.seriesColor(
|
|
6111
6111
|
s,
|
|
6112
6112
|
si,
|
|
6113
6113
|
chartData.style?.styleId,
|
|
@@ -6146,8 +6146,8 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6146
6146
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
6147
6147
|
const style = chartData.style;
|
|
6148
6148
|
const legendPos = style?.legendPosition || "b";
|
|
6149
|
-
const range =
|
|
6150
|
-
const layout =
|
|
6149
|
+
const range = chunk46Z6MNRS_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6150
|
+
const layout = chunk46Z6MNRS_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6151
6151
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6152
6152
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
6153
6153
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -6168,10 +6168,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6168
6168
|
const close = closeSeries.values[ci] ?? high;
|
|
6169
6169
|
const isUp = close >= open;
|
|
6170
6170
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
6171
|
-
const highY =
|
|
6172
|
-
const lowY =
|
|
6173
|
-
const openY =
|
|
6174
|
-
const closeY =
|
|
6171
|
+
const highY = chunk46Z6MNRS_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
6172
|
+
const lowY = chunk46Z6MNRS_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
6173
|
+
const openY = chunk46Z6MNRS_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
6174
|
+
const closeY = chunk46Z6MNRS_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
|
|
6175
6175
|
elements.push(
|
|
6176
6176
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6177
6177
|
"line",
|
|
@@ -6214,7 +6214,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6214
6214
|
textAnchor: "middle",
|
|
6215
6215
|
fontSize: 7,
|
|
6216
6216
|
fill: "#334155",
|
|
6217
|
-
children:
|
|
6217
|
+
children: chunk46Z6MNRS_js.formatAxisValue(close)
|
|
6218
6218
|
},
|
|
6219
6219
|
`${element.id}-stock-dl-${ci}`
|
|
6220
6220
|
)
|
|
@@ -6256,7 +6256,7 @@ function FailedToLoad() {
|
|
|
6256
6256
|
var LazySurfaceChart3DScene = React6__default.default.lazy(
|
|
6257
6257
|
async () => {
|
|
6258
6258
|
try {
|
|
6259
|
-
return await import('./SurfaceChart3DScene-
|
|
6259
|
+
return await import('./SurfaceChart3DScene-2FVASQGC.js');
|
|
6260
6260
|
} catch {
|
|
6261
6261
|
return { default: FailedToLoad };
|
|
6262
6262
|
}
|
|
@@ -6280,7 +6280,7 @@ var SurfaceChart3DErrorBoundary = class extends React6__default.default.Componen
|
|
|
6280
6280
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
6281
6281
|
const rows = chartData.series.length;
|
|
6282
6282
|
const cols = Math.max(categoryLabels.length, 1);
|
|
6283
|
-
const range =
|
|
6283
|
+
const range = chunk46Z6MNRS_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6284
6284
|
const heightMap = new Float32Array(rows * cols);
|
|
6285
6285
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
6286
6286
|
for (let r = 0; r < rows; r++) {
|
|
@@ -6400,8 +6400,8 @@ function darkenRgb(r, g, b, factor) {
|
|
|
6400
6400
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
6401
6401
|
const style = chartData.style;
|
|
6402
6402
|
const legendPos = style?.legendPosition || "b";
|
|
6403
|
-
const layout =
|
|
6404
|
-
const range =
|
|
6403
|
+
const layout = chunk46Z6MNRS_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6404
|
+
const range = chunk46Z6MNRS_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6405
6405
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6406
6406
|
const seriesCount = chartData.series.length;
|
|
6407
6407
|
const cols = catCount - 1;
|
|
@@ -6491,8 +6491,8 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6491
6491
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
6492
6492
|
const style = chartData.style;
|
|
6493
6493
|
const legendPos = style?.legendPosition || "b";
|
|
6494
|
-
const layout =
|
|
6495
|
-
const range =
|
|
6494
|
+
const layout = chunk46Z6MNRS_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6495
|
+
const range = chunk46Z6MNRS_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6496
6496
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6497
6497
|
const seriesCount = chartData.series.length;
|
|
6498
6498
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -6555,7 +6555,7 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6555
6555
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
6556
6556
|
const style = chartData.style;
|
|
6557
6557
|
const legendPos = style?.legendPosition || "b";
|
|
6558
|
-
const layout =
|
|
6558
|
+
const layout = chunk46Z6MNRS_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6559
6559
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
6560
6560
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
6561
6561
|
const rects = [];
|
|
@@ -6578,7 +6578,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
6578
6578
|
y: curY,
|
|
6579
6579
|
width: Math.max(w - 1, 1),
|
|
6580
6580
|
height: Math.max(h - 1, 1),
|
|
6581
|
-
fill:
|
|
6581
|
+
fill: chunk46Z6MNRS_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
6582
6582
|
rx: 2,
|
|
6583
6583
|
opacity: 0.85
|
|
6584
6584
|
},
|
|
@@ -6631,8 +6631,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6631
6631
|
const style = chartData.style;
|
|
6632
6632
|
const legendPos = style?.legendPosition || "b";
|
|
6633
6633
|
const values = chartData.series[0]?.values ?? [];
|
|
6634
|
-
const range =
|
|
6635
|
-
const layout =
|
|
6634
|
+
const range = chunk46Z6MNRS_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6635
|
+
const layout = chunk46Z6MNRS_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6636
6636
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
6637
6637
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
6638
6638
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -6643,8 +6643,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6643
6643
|
const isLast = i === values.length - 1;
|
|
6644
6644
|
const startVal = isLast ? 0 : runningTotal;
|
|
6645
6645
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
6646
|
-
const barStartY =
|
|
6647
|
-
const barEndY =
|
|
6646
|
+
const barStartY = chunk46Z6MNRS_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
6647
|
+
const barEndY = chunk46Z6MNRS_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
|
|
6648
6648
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
6649
6649
|
const y = Math.min(barStartY, barEndY);
|
|
6650
6650
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -6673,7 +6673,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6673
6673
|
textAnchor: "middle",
|
|
6674
6674
|
fontSize: 7,
|
|
6675
6675
|
fill: "#334155",
|
|
6676
|
-
children:
|
|
6676
|
+
children: chunk46Z6MNRS_js.formatAxisValue(isLast ? endVal : val)
|
|
6677
6677
|
},
|
|
6678
6678
|
`${element.id}-wf-dl-${i}`
|
|
6679
6679
|
)
|
|
@@ -6721,18 +6721,18 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6721
6721
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
6722
6722
|
const style = chartData.style;
|
|
6723
6723
|
const legendPos = style?.legendPosition || "b";
|
|
6724
|
-
const layoutOpts =
|
|
6724
|
+
const layoutOpts = chunk46Z6MNRS_js.computeLayoutOptions(
|
|
6725
6725
|
chartData.axes,
|
|
6726
6726
|
chartData.dataTable,
|
|
6727
6727
|
chartData.series.length
|
|
6728
6728
|
);
|
|
6729
|
-
const layout =
|
|
6730
|
-
const { primary, secondary } =
|
|
6729
|
+
const layout = chunk46Z6MNRS_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
6730
|
+
const { primary, secondary } = chunk46Z6MNRS_js.splitSeriesByAxis(chartData.series, chartData.axes);
|
|
6731
6731
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
6732
6732
|
const secondarySeries = secondary.map((e) => e.series);
|
|
6733
|
-
const range =
|
|
6734
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
6735
|
-
const secondaryAxisFmt =
|
|
6733
|
+
const range = chunk46Z6MNRS_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
6734
|
+
const secondaryRange = secondarySeries.length > 0 ? chunk46Z6MNRS_js.computeValueRange(secondarySeries) : void 0;
|
|
6735
|
+
const secondaryAxisFmt = chunk46Z6MNRS_js.getSecondaryValueAxis(chartData.axes);
|
|
6736
6736
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6737
6737
|
const barSeriesCount = 1;
|
|
6738
6738
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -6748,8 +6748,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6748
6748
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
6749
6749
|
barSeries.values.forEach((val, vi) => {
|
|
6750
6750
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
6751
|
-
const zeroY =
|
|
6752
|
-
const valY =
|
|
6751
|
+
const zeroY = chunk46Z6MNRS_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
6752
|
+
const valY = chunk46Z6MNRS_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
|
|
6753
6753
|
const y = Math.min(zeroY, valY);
|
|
6754
6754
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
6755
6755
|
barElements.push(
|
|
@@ -6760,7 +6760,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6760
6760
|
y,
|
|
6761
6761
|
width: barWidth,
|
|
6762
6762
|
height: h,
|
|
6763
|
-
fill:
|
|
6763
|
+
fill: chunk46Z6MNRS_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
6764
6764
|
rx: 1
|
|
6765
6765
|
},
|
|
6766
6766
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -6776,7 +6776,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6776
6776
|
textAnchor: "middle",
|
|
6777
6777
|
fontSize: 7,
|
|
6778
6778
|
fill: "#334155",
|
|
6779
|
-
children:
|
|
6779
|
+
children: chunk46Z6MNRS_js.formatAxisValue(val)
|
|
6780
6780
|
},
|
|
6781
6781
|
`${element.id}-combo-bar-dl-${vi}`
|
|
6782
6782
|
)
|
|
@@ -6793,10 +6793,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6793
6793
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
6794
6794
|
const points = series.values.map((val, vi) => {
|
|
6795
6795
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
6796
|
-
const y =
|
|
6796
|
+
const y = chunk46Z6MNRS_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
6797
6797
|
return { x, y, val };
|
|
6798
6798
|
});
|
|
6799
|
-
const c =
|
|
6799
|
+
const c = chunk46Z6MNRS_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
6800
6800
|
lineElements.push(
|
|
6801
6801
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6802
6802
|
"polyline",
|
|
@@ -6823,7 +6823,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6823
6823
|
textAnchor: "middle",
|
|
6824
6824
|
fontSize: 7,
|
|
6825
6825
|
fill: "#334155",
|
|
6826
|
-
children:
|
|
6826
|
+
children: chunk46Z6MNRS_js.formatAxisValue(p.val)
|
|
6827
6827
|
},
|
|
6828
6828
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
6829
6829
|
)
|
|
@@ -7969,14 +7969,14 @@ function buildNotesPdf(pages) {
|
|
|
7969
7969
|
notes: page.notes,
|
|
7970
7970
|
slideNumber: page.slideNumber
|
|
7971
7971
|
}));
|
|
7972
|
-
const bytes =
|
|
7972
|
+
const bytes = chunk46Z6MNRS_js.buildNotesPdfBytes(images, meta);
|
|
7973
7973
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
7974
7974
|
return URL.createObjectURL(blob);
|
|
7975
7975
|
}
|
|
7976
7976
|
|
|
7977
7977
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
7978
7978
|
function buildPdfFromImageData(images) {
|
|
7979
|
-
const bytes =
|
|
7979
|
+
const bytes = chunk46Z6MNRS_js.buildSlidesPdfBytes(images);
|
|
7980
7980
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
7981
7981
|
return URL.createObjectURL(blob);
|
|
7982
7982
|
}
|
|
@@ -7985,7 +7985,7 @@ function buildPdfFromImageData(images) {
|
|
|
7985
7985
|
var activePreview = null;
|
|
7986
7986
|
function startPreviewAnimation(elementId, preset, options) {
|
|
7987
7987
|
stopPreviewAnimation();
|
|
7988
|
-
const descriptor =
|
|
7988
|
+
const descriptor = chunk46Z6MNRS_js.buildPreviewAnimation(preset, options);
|
|
7989
7989
|
if (!descriptor) {
|
|
7990
7990
|
return;
|
|
7991
7991
|
}
|