pptx-react-viewer 2.11.1 → 2.12.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 +2 -0
- package/dist/{AiChatPanel-RMQIJDUJ.mjs → AiChatPanel-CS4CONUO.mjs} +4 -4
- package/dist/AiChatPanel-CS4CONUO.mjs.br +0 -0
- package/dist/AiChatPanel-CS4CONUO.mjs.gz +0 -0
- package/dist/{AiChatPanel-E6W3EACA.js → AiChatPanel-JIXSOZXN.js} +23 -23
- package/dist/AiChatPanel-JIXSOZXN.js.br +0 -0
- package/dist/AiChatPanel-JIXSOZXN.js.gz +0 -0
- package/dist/{Model3DScene-U4B4NZJT.js → Model3DScene-5KMJ4JL6.js} +2 -2
- package/dist/{Model3DScene-U4B4NZJT.js.br → Model3DScene-5KMJ4JL6.js.br} +0 -0
- package/dist/Model3DScene-5KMJ4JL6.js.gz +0 -0
- package/dist/{Model3DScene-WHSHBMR5.mjs → Model3DScene-RWFPSN6B.mjs} +1 -1
- package/dist/Model3DScene-RWFPSN6B.mjs.br +0 -0
- package/dist/Model3DScene-RWFPSN6B.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-77JP5XH5.mjs → SurfaceChart3DScene-2GZQM3LN.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-77JP5XH5.mjs.br → SurfaceChart3DScene-2GZQM3LN.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-2GZQM3LN.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-5S43UBRD.js → SurfaceChart3DScene-BIOKIETC.js} +2 -2
- package/dist/SurfaceChart3DScene-BIOKIETC.js.br +0 -0
- package/dist/SurfaceChart3DScene-BIOKIETC.js.gz +0 -0
- package/dist/{chunk-FAP6OPLL.js → chunk-2VUHJNWM.js} +243 -284
- package/dist/chunk-2VUHJNWM.js.br +0 -0
- package/dist/chunk-2VUHJNWM.js.gz +0 -0
- package/dist/{chunk-IOVOQ6ZJ.js → chunk-3GNSGGY2.js} +288 -1
- package/dist/chunk-3GNSGGY2.js.br +0 -0
- package/dist/chunk-3GNSGGY2.js.gz +0 -0
- package/dist/{chunk-NJ4PTG4F.mjs → chunk-AOED5MFM.mjs} +18 -39
- package/dist/chunk-AOED5MFM.mjs.br +0 -0
- package/dist/chunk-AOED5MFM.mjs.gz +0 -0
- package/dist/{chunk-PXYZFWDA.mjs → chunk-BJQSHVYH.mjs} +86 -61
- package/dist/chunk-BJQSHVYH.mjs.br +0 -0
- package/dist/chunk-BJQSHVYH.mjs.gz +0 -0
- package/dist/{chunk-DD54KUDG.mjs → chunk-CEUHGUZ4.mjs} +5 -46
- package/dist/chunk-CEUHGUZ4.mjs.br +0 -0
- package/dist/chunk-CEUHGUZ4.mjs.gz +0 -0
- package/dist/{chunk-RHR7GTDX.mjs → chunk-ECDKYPQ2.mjs} +288 -1
- package/dist/chunk-ECDKYPQ2.mjs.br +0 -0
- package/dist/chunk-ECDKYPQ2.mjs.gz +0 -0
- package/dist/{chunk-HF6L2CTF.mjs → chunk-EJRHYYKE.mjs} +1 -1
- package/dist/chunk-EJRHYYKE.mjs.br +0 -0
- package/dist/chunk-EJRHYYKE.mjs.gz +0 -0
- package/dist/{chunk-KDJBWJJH.js → chunk-PJUQQF3I.js} +328 -52
- package/dist/chunk-PJUQQF3I.js.br +0 -0
- package/dist/chunk-PJUQQF3I.js.gz +0 -0
- package/dist/{chunk-QT6BPOZM.js → chunk-PTGTFXPU.js} +345 -366
- package/dist/chunk-PTGTFXPU.js.br +0 -0
- package/dist/chunk-PTGTFXPU.js.gz +0 -0
- package/dist/{chunk-FV7HEYCX.mjs → chunk-QGHC65C4.mjs} +320 -53
- package/dist/chunk-QGHC65C4.mjs.br +0 -0
- package/dist/chunk-QGHC65C4.mjs.gz +0 -0
- package/dist/{chunk-IXBM3HWH.js → chunk-SP7U34QM.js} +1064 -1039
- package/dist/chunk-SP7U34QM.js.br +0 -0
- package/dist/chunk-SP7U34QM.js.gz +0 -0
- package/dist/{chunk-X3SFCKAF.js → chunk-ZIXSSQAZ.js} +3 -3
- package/dist/chunk-ZIXSSQAZ.js.br +0 -0
- package/dist/chunk-ZIXSSQAZ.js.gz +0 -0
- package/dist/i18n.js +4 -4
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.js +36 -36
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.js +79 -79
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +4 -4
- 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.js +22 -22
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +6 -6
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-E6W3EACA.js.br +0 -0
- package/dist/AiChatPanel-E6W3EACA.js.gz +0 -0
- package/dist/AiChatPanel-RMQIJDUJ.mjs.br +0 -0
- package/dist/AiChatPanel-RMQIJDUJ.mjs.gz +0 -0
- package/dist/Model3DScene-U4B4NZJT.js.gz +0 -0
- package/dist/Model3DScene-WHSHBMR5.mjs.br +0 -0
- package/dist/Model3DScene-WHSHBMR5.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-5S43UBRD.js.br +0 -0
- package/dist/SurfaceChart3DScene-5S43UBRD.js.gz +0 -0
- package/dist/SurfaceChart3DScene-77JP5XH5.mjs.gz +0 -0
- package/dist/chunk-DD54KUDG.mjs.br +0 -0
- package/dist/chunk-DD54KUDG.mjs.gz +0 -0
- package/dist/chunk-FAP6OPLL.js.br +0 -0
- package/dist/chunk-FAP6OPLL.js.gz +0 -0
- package/dist/chunk-FV7HEYCX.mjs.br +0 -0
- package/dist/chunk-FV7HEYCX.mjs.gz +0 -0
- package/dist/chunk-HF6L2CTF.mjs.br +0 -0
- package/dist/chunk-HF6L2CTF.mjs.gz +0 -0
- package/dist/chunk-IOVOQ6ZJ.js.br +0 -0
- package/dist/chunk-IOVOQ6ZJ.js.gz +0 -0
- package/dist/chunk-IXBM3HWH.js.br +0 -0
- package/dist/chunk-IXBM3HWH.js.gz +0 -0
- package/dist/chunk-KDJBWJJH.js.br +0 -0
- package/dist/chunk-KDJBWJJH.js.gz +0 -0
- package/dist/chunk-NJ4PTG4F.mjs.br +0 -0
- package/dist/chunk-NJ4PTG4F.mjs.gz +0 -0
- package/dist/chunk-PXYZFWDA.mjs.br +0 -0
- package/dist/chunk-PXYZFWDA.mjs.gz +0 -0
- package/dist/chunk-QT6BPOZM.js.br +0 -0
- package/dist/chunk-QT6BPOZM.js.gz +0 -0
- package/dist/chunk-RHR7GTDX.mjs.br +0 -0
- package/dist/chunk-RHR7GTDX.mjs.gz +0 -0
- package/dist/chunk-X3SFCKAF.js.br +0 -0
- package/dist/chunk-X3SFCKAF.js.gz +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunk3GNSGGY2_js = require('./chunk-3GNSGGY2.js');
|
|
4
|
+
var chunkPJUQQF3I_js = require('./chunk-PJUQQF3I.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 chunkPJUQQF3I_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 chunkPJUQQF3I_js.cloneHistorySnapshot(snapshot);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
// src/viewer/constants/scalar.ts
|
|
@@ -63,7 +63,7 @@ var TOOLBAR_SECTIONS = [
|
|
|
63
63
|
{ id: "view", labelKey: "pptx.ribbon.tab.view" },
|
|
64
64
|
{ id: "help", labelKey: "pptx.ribbon.tab.help" }
|
|
65
65
|
];
|
|
66
|
-
var SHORTCUT_REFERENCE_ITEMS =
|
|
66
|
+
var SHORTCUT_REFERENCE_ITEMS = chunkPJUQQF3I_js.VIEWER_SHORTCUT_REFERENCE;
|
|
67
67
|
|
|
68
68
|
// src/viewer/constants/theme.ts
|
|
69
69
|
var THEME_COLOR_SWATCHES = [
|
|
@@ -107,7 +107,7 @@ var GLYPH_COMPONENTS = {
|
|
|
107
107
|
plus: lu.LuPlus,
|
|
108
108
|
triangle: lu.LuTriangle
|
|
109
109
|
};
|
|
110
|
-
var SHAPE_PRESETS =
|
|
110
|
+
var SHAPE_PRESETS = chunkPJUQQF3I_js.SHAPE_PRESET_DEFS.map(
|
|
111
111
|
(def) => ({
|
|
112
112
|
type: def.type,
|
|
113
113
|
label: def.label,
|
|
@@ -266,7 +266,7 @@ function isConnectorOrLineElement(element) {
|
|
|
266
266
|
if (element.type === "connector") {
|
|
267
267
|
return true;
|
|
268
268
|
}
|
|
269
|
-
if (!
|
|
269
|
+
if (!chunkPJUQQF3I_js.hasShapeProperties(element)) {
|
|
270
270
|
return false;
|
|
271
271
|
}
|
|
272
272
|
const st = getShapeType(element.shapeType);
|
|
@@ -277,12 +277,12 @@ function isConnectorOrLineElement(element) {
|
|
|
277
277
|
function partitionTemplateElements(slides) {
|
|
278
278
|
const templateElementsBySlideId = {};
|
|
279
279
|
const nextSlides = slides.map((slide) => {
|
|
280
|
-
const template = slide.elements.filter((el) =>
|
|
280
|
+
const template = slide.elements.filter((el) => chunkPJUQQF3I_js.isTemplateElement(el));
|
|
281
281
|
if (template.length === 0) {
|
|
282
282
|
return slide;
|
|
283
283
|
}
|
|
284
284
|
templateElementsBySlideId[slide.id] = template;
|
|
285
|
-
return { ...slide, elements: slide.elements.filter((el) => !
|
|
285
|
+
return { ...slide, elements: slide.elements.filter((el) => !chunkPJUQQF3I_js.isTemplateElement(el)) };
|
|
286
286
|
});
|
|
287
287
|
return { slides: nextSlides, templateElementsBySlideId };
|
|
288
288
|
}
|
|
@@ -298,7 +298,7 @@ function buildSaveSlides(slides, templateElementsBySlideId) {
|
|
|
298
298
|
|
|
299
299
|
// src/viewer/utils/image-style.ts
|
|
300
300
|
function getImageMaskStyle(element) {
|
|
301
|
-
if (!
|
|
301
|
+
if (!chunkPJUQQF3I_js.hasShapeProperties(element)) {
|
|
302
302
|
return void 0;
|
|
303
303
|
}
|
|
304
304
|
const shapeType = element.shapeType;
|
|
@@ -307,7 +307,7 @@ function getImageMaskStyle(element) {
|
|
|
307
307
|
}
|
|
308
308
|
const normalized = shapeType.toLowerCase();
|
|
309
309
|
if (normalized === "roundrect" || normalized === "round1rect" || normalized === "round2samerect" || normalized === "round2diagrect" || normalized === "sniproundrect" || normalized === "snip1rect" || normalized === "snip2diagrect") {
|
|
310
|
-
const radiusPx =
|
|
310
|
+
const radiusPx = chunkPJUQQF3I_js.getRoundRectRadiusPx(element);
|
|
311
311
|
if (radiusPx <= 0.01) {
|
|
312
312
|
return void 0;
|
|
313
313
|
}
|
|
@@ -319,57 +319,16 @@ function getImageMaskStyle(element) {
|
|
|
319
319
|
if (normalized === "can" || normalized === "cylinder") {
|
|
320
320
|
return { borderRadius: "48% / 12%" };
|
|
321
321
|
}
|
|
322
|
-
const clipPath =
|
|
322
|
+
const clipPath = chunkPJUQQF3I_js.getResolvedShapeClipPath(element);
|
|
323
323
|
if (!clipPath) {
|
|
324
324
|
return void 0;
|
|
325
325
|
}
|
|
326
326
|
return { clipPath };
|
|
327
327
|
}
|
|
328
328
|
function getImageRenderStyle(element) {
|
|
329
|
-
const maskStyle = getImageMaskStyle(element) || {};
|
|
330
|
-
if (!chunkKDJBWJJH_js.isImageLikeElement(element)) {
|
|
331
|
-
return {
|
|
332
|
-
...maskStyle,
|
|
333
|
-
width: "100%",
|
|
334
|
-
height: "100%",
|
|
335
|
-
objectFit: "cover"
|
|
336
|
-
};
|
|
337
|
-
}
|
|
338
|
-
const cropLeft = chunkKDJBWJJH_js.clampCropValue(element.cropLeft);
|
|
339
|
-
const cropTop = chunkKDJBWJJH_js.clampCropValue(element.cropTop);
|
|
340
|
-
const cropRight = chunkKDJBWJJH_js.clampCropValue(element.cropRight);
|
|
341
|
-
const cropBottom = chunkKDJBWJJH_js.clampCropValue(element.cropBottom);
|
|
342
|
-
const hasCrop = cropLeft + cropRight > 1e-4 || cropTop + cropBottom > 1e-4;
|
|
343
|
-
if (!hasCrop) {
|
|
344
|
-
return {
|
|
345
|
-
...maskStyle,
|
|
346
|
-
width: "100%",
|
|
347
|
-
height: "100%",
|
|
348
|
-
objectFit: "cover"
|
|
349
|
-
};
|
|
350
|
-
}
|
|
351
|
-
const safeHorizontalScale = cropLeft + cropRight >= 0.99 ? 0.99 / (cropLeft + cropRight) : 1;
|
|
352
|
-
const safeVerticalScale = cropTop + cropBottom >= 0.99 ? 0.99 / (cropTop + cropBottom) : 1;
|
|
353
|
-
const normalizedLeft = chunkKDJBWJJH_js.clampCropValue(cropLeft * safeHorizontalScale);
|
|
354
|
-
const normalizedRight = chunkKDJBWJJH_js.clampCropValue(cropRight * safeHorizontalScale);
|
|
355
|
-
const normalizedTop = chunkKDJBWJJH_js.clampCropValue(cropTop * safeVerticalScale);
|
|
356
|
-
const normalizedBottom = chunkKDJBWJJH_js.clampCropValue(cropBottom * safeVerticalScale);
|
|
357
|
-
const remainingWidth = Math.max(0.01, 1 - normalizedLeft - normalizedRight);
|
|
358
|
-
const remainingHeight = Math.max(0.01, 1 - normalizedTop - normalizedBottom);
|
|
359
|
-
const tx = Math.round(-normalizedLeft / remainingWidth * 1e4) / 100;
|
|
360
|
-
const ty = Math.round(-normalizedTop / remainingHeight * 1e4) / 100;
|
|
361
|
-
const sx = Math.round(1 / remainingWidth * 1e6) / 1e6;
|
|
362
|
-
const sy = Math.round(1 / remainingHeight * 1e6) / 1e6;
|
|
363
329
|
return {
|
|
364
|
-
...
|
|
365
|
-
|
|
366
|
-
width: "100%",
|
|
367
|
-
height: "100%",
|
|
368
|
-
maxWidth: "none",
|
|
369
|
-
maxHeight: "none",
|
|
370
|
-
objectFit: "fill",
|
|
371
|
-
transformOrigin: "top left",
|
|
372
|
-
transform: `translate(${tx}%, ${ty}%) scale(${sx}, ${sy})`
|
|
330
|
+
...getImageMaskStyle(element) || {},
|
|
331
|
+
...chunkPJUQQF3I_js.getImageFitStyle(element)
|
|
373
332
|
};
|
|
374
333
|
}
|
|
375
334
|
var CROP_SHAPE_CLIP_PATHS = {
|
|
@@ -382,7 +341,7 @@ var CROP_SHAPE_CLIP_PATHS = {
|
|
|
382
341
|
star: "polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)"
|
|
383
342
|
};
|
|
384
343
|
function getCropShapeClipPath(element) {
|
|
385
|
-
if (!
|
|
344
|
+
if (!chunkPJUQQF3I_js.isImageLikeElement(element)) {
|
|
386
345
|
return void 0;
|
|
387
346
|
}
|
|
388
347
|
const shape = element.cropShape;
|
|
@@ -392,7 +351,7 @@ function getCropShapeClipPath(element) {
|
|
|
392
351
|
return CROP_SHAPE_CLIP_PATHS[shape];
|
|
393
352
|
}
|
|
394
353
|
function isImageTiled(element) {
|
|
395
|
-
if (!
|
|
354
|
+
if (!chunkPJUQQF3I_js.isImageLikeElement(element)) {
|
|
396
355
|
return false;
|
|
397
356
|
}
|
|
398
357
|
return typeof element.tileScaleX === "number" || typeof element.tileScaleY === "number";
|
|
@@ -450,7 +409,7 @@ function buildMirrorTiledBackground(src, flip, scaleX, scaleY) {
|
|
|
450
409
|
};
|
|
451
410
|
}
|
|
452
411
|
function getImageTilingStyle(element) {
|
|
453
|
-
if (!
|
|
412
|
+
if (!chunkPJUQQF3I_js.isImageLikeElement(element) || !isImageTiled(element)) {
|
|
454
413
|
return void 0;
|
|
455
414
|
}
|
|
456
415
|
const scaleX = typeof element.tileScaleX === "number" ? element.tileScaleX * 100 : 100;
|
|
@@ -730,9 +689,9 @@ function registerMediaElement(elementId, el) {
|
|
|
730
689
|
};
|
|
731
690
|
}
|
|
732
691
|
function executeMediaCommand(command, frameRoot) {
|
|
733
|
-
return
|
|
692
|
+
return chunkPJUQQF3I_js.runMediaCommand(
|
|
734
693
|
command,
|
|
735
|
-
(targetId) => registry.get(targetId) ??
|
|
694
|
+
(targetId) => registry.get(targetId) ?? chunkPJUQQF3I_js.findMediaElementByElementId(targetId, frameRoot?.())
|
|
736
695
|
);
|
|
737
696
|
}
|
|
738
697
|
function PresentationMediaController({
|
|
@@ -966,7 +925,7 @@ function PresentationMediaController({
|
|
|
966
925
|
}
|
|
967
926
|
function renderMediaElement(element, mediaDataUrls, options) {
|
|
968
927
|
if (element.type !== "media") {
|
|
969
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
928
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunk3GNSGGY2_js.translationsEn["pptx.media.title"] });
|
|
970
929
|
}
|
|
971
930
|
const mediaType = element.mediaType;
|
|
972
931
|
const mediaPath = element.mediaPath;
|
|
@@ -996,7 +955,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
996
955
|
"img",
|
|
997
956
|
{
|
|
998
957
|
src: posterUrl,
|
|
999
|
-
alt:
|
|
958
|
+
alt: chunk3GNSGGY2_js.translationsEn["pptx.media.posterAlt"],
|
|
1000
959
|
className: "w-full h-full object-contain opacity-50"
|
|
1001
960
|
}
|
|
1002
961
|
),
|
|
@@ -1017,7 +976,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1017
976
|
]
|
|
1018
977
|
}
|
|
1019
978
|
),
|
|
1020
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children:
|
|
979
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: chunk3GNSGGY2_js.translationsEn["pptx.media.notFound"] })
|
|
1021
980
|
] })
|
|
1022
981
|
] });
|
|
1023
982
|
}
|
|
@@ -1058,7 +1017,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1058
1017
|
"img",
|
|
1059
1018
|
{
|
|
1060
1019
|
src: posterUrl,
|
|
1061
|
-
alt:
|
|
1020
|
+
alt: chunk3GNSGGY2_js.translationsEn["pptx.media.videoPosterAlt"],
|
|
1062
1021
|
className: "w-full h-full object-contain"
|
|
1063
1022
|
}
|
|
1064
1023
|
),
|
|
@@ -1147,7 +1106,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1147
1106
|
|
|
1148
1107
|
// src/viewer/utils/text-utils.tsx
|
|
1149
1108
|
function getTextStyleForElement(element, fallbackColor) {
|
|
1150
|
-
return
|
|
1109
|
+
return chunkPJUQQF3I_js.buildTextBlockStyle(element, { fallbackColor });
|
|
1151
1110
|
}
|
|
1152
1111
|
|
|
1153
1112
|
// src/viewer/utils/text-layout.tsx
|
|
@@ -1172,13 +1131,13 @@ function computeTabSize(tabStops, defaultTabSize) {
|
|
|
1172
1131
|
return avgGap > 0 ? `${Math.round(avgGap)}px` : fromDefault;
|
|
1173
1132
|
}
|
|
1174
1133
|
function getTextLayoutStyle(element) {
|
|
1175
|
-
if (!
|
|
1134
|
+
if (!chunkPJUQQF3I_js.hasTextProperties(element)) {
|
|
1176
1135
|
return {};
|
|
1177
1136
|
}
|
|
1178
1137
|
const verticalAlign = element.textStyle?.vAlign || "top";
|
|
1179
|
-
const writingMode =
|
|
1180
|
-
const textOrientation =
|
|
1181
|
-
const verticalDirection =
|
|
1138
|
+
const writingMode = chunkPJUQQF3I_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
1139
|
+
const textOrientation = chunkPJUQQF3I_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
1140
|
+
const verticalDirection = chunkPJUQQF3I_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
1182
1141
|
const parsedColumnCount = Number(element.textStyle?.columnCount);
|
|
1183
1142
|
const columnCount = Number.isFinite(parsedColumnCount) ? Math.max(1, Math.min(16, Math.round(parsedColumnCount))) : 1;
|
|
1184
1143
|
const hasColumns = columnCount > 1;
|
|
@@ -1186,7 +1145,7 @@ function getTextLayoutStyle(element) {
|
|
|
1186
1145
|
const tabStops = element.textStyle?.tabStops;
|
|
1187
1146
|
const tabSize = computeTabSize(tabStops, element.textStyle?.defaultTabSize);
|
|
1188
1147
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
1189
|
-
const hasParagraphIndents =
|
|
1148
|
+
const hasParagraphIndents = chunkPJUQQF3I_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
1190
1149
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
1191
1150
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
1192
1151
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
@@ -1195,7 +1154,7 @@ function getTextLayoutStyle(element) {
|
|
|
1195
1154
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
1196
1155
|
const parsedColumnSpacing = Number(element.textStyle?.columnSpacing);
|
|
1197
1156
|
const columnGap = Number.isFinite(parsedColumnSpacing) && parsedColumnSpacing > 0 ? `${parsedColumnSpacing}px` : "0.75em";
|
|
1198
|
-
const kinsokuStyles =
|
|
1157
|
+
const kinsokuStyles = chunkPJUQQF3I_js.getKinsokuLineBreakStyles(element.textStyle);
|
|
1199
1158
|
if (hasColumns) {
|
|
1200
1159
|
return {
|
|
1201
1160
|
display: "block",
|
|
@@ -1242,10 +1201,10 @@ function getTextLayoutStyle(element) {
|
|
|
1242
1201
|
|
|
1243
1202
|
// src/viewer/utils/text-effects.tsx
|
|
1244
1203
|
function buildTextFillCss2(style) {
|
|
1245
|
-
return
|
|
1204
|
+
return chunkPJUQQF3I_js.buildTextFillCss(style);
|
|
1246
1205
|
}
|
|
1247
1206
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
1248
|
-
return
|
|
1207
|
+
return chunkPJUQQF3I_js.buildTextBody3DSceneStyle(textStyle);
|
|
1249
1208
|
}
|
|
1250
1209
|
|
|
1251
1210
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -1430,13 +1389,13 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1430
1389
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
1431
1390
|
return renderedSegments;
|
|
1432
1391
|
}
|
|
1433
|
-
const paraKey = `${elementId}${
|
|
1392
|
+
const paraKey = `${elementId}${chunkPJUQQF3I_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
1434
1393
|
const paraState = subElementAnimStates.get(paraKey);
|
|
1435
1394
|
if (paraState) {
|
|
1436
1395
|
const style = buildAnimStyle(paraState);
|
|
1437
1396
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
1438
1397
|
}
|
|
1439
|
-
const spec =
|
|
1398
|
+
const spec = chunkPJUQQF3I_js.buildTextBuildSpec(
|
|
1440
1399
|
elementId,
|
|
1441
1400
|
paraIndex,
|
|
1442
1401
|
paraSegments.map((entry) => ({ text: entry.segment.text, style: entry })),
|
|
@@ -1454,7 +1413,7 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1454
1413
|
"span",
|
|
1455
1414
|
{
|
|
1456
1415
|
"data-anim-id": span.animId,
|
|
1457
|
-
style:
|
|
1416
|
+
style: chunkPJUQQF3I_js.textBuildSpanStyle(span),
|
|
1458
1417
|
children: content
|
|
1459
1418
|
},
|
|
1460
1419
|
span.animId
|
|
@@ -1598,10 +1557,10 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1598
1557
|
if (!needsScriptFonts || !text) {
|
|
1599
1558
|
return text;
|
|
1600
1559
|
}
|
|
1601
|
-
const runs =
|
|
1560
|
+
const runs = chunkPJUQQF3I_js.segmentByScript(text);
|
|
1602
1561
|
if (runs.length <= 1) {
|
|
1603
1562
|
if (runs.length === 1) {
|
|
1604
|
-
const font =
|
|
1563
|
+
const font = chunkPJUQQF3I_js.resolveFontForScript(runs[0].script, scriptFonts);
|
|
1605
1564
|
if (font && font !== baseFontFamily) {
|
|
1606
1565
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: text });
|
|
1607
1566
|
}
|
|
@@ -1609,7 +1568,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1609
1568
|
return text;
|
|
1610
1569
|
}
|
|
1611
1570
|
return runs.map((run, i) => {
|
|
1612
|
-
const font =
|
|
1571
|
+
const font = chunkPJUQQF3I_js.resolveFontForScript(run.script, scriptFonts);
|
|
1613
1572
|
if (!font || font === baseFontFamily) {
|
|
1614
1573
|
return /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Fragment, { children: run.text }, `${keyPrefix}-r${i}`);
|
|
1615
1574
|
}
|
|
@@ -1681,8 +1640,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1681
1640
|
);
|
|
1682
1641
|
}
|
|
1683
1642
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
1684
|
-
const mathml =
|
|
1685
|
-
const safeMathml = mathml ?
|
|
1643
|
+
const mathml = chunkPJUQQF3I_js.convertOmmlToMathMl(equationXml);
|
|
1644
|
+
const safeMathml = mathml ? chunkPJUQQF3I_js.sanitizeMathMl(mathml) : "";
|
|
1686
1645
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1687
1646
|
"span",
|
|
1688
1647
|
{
|
|
@@ -1692,7 +1651,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1692
1651
|
},
|
|
1693
1652
|
dangerouslySetInnerHTML: { __html: safeMathml }
|
|
1694
1653
|
}
|
|
1695
|
-
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children:
|
|
1654
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children: chunk3GNSGGY2_js.translationsEn["pptx.textSegment.equationFallback"] });
|
|
1696
1655
|
if (equationNumber) {
|
|
1697
1656
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1698
1657
|
"span",
|
|
@@ -1732,7 +1691,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1732
1691
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: equationContent }, `${elementId}-seg-${segmentIndex}`);
|
|
1733
1692
|
}
|
|
1734
1693
|
function renderPictureBullet(elementId, segmentIndex, bulletInfo, baseFontSize) {
|
|
1735
|
-
const picture =
|
|
1694
|
+
const picture = chunkPJUQQF3I_js.resolvePictureBullet(bulletInfo, baseFontSize) ?? {
|
|
1736
1695
|
sizePx: baseFontSize,
|
|
1737
1696
|
fallbackMarker: "\u2022",
|
|
1738
1697
|
accessibleLabel: "Bullet"
|
|
@@ -1783,7 +1742,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1783
1742
|
}
|
|
1784
1743
|
const segmentStyle = segment.style || {};
|
|
1785
1744
|
const rawText = bulletInfo && typeof bulletHangPx === "number" ? (segment.text || "").trimEnd() : segment.text || "";
|
|
1786
|
-
const textValue =
|
|
1745
|
+
const textValue = chunkPJUQQF3I_js.substituteFieldText(rawText, segment.fieldType, fieldContext);
|
|
1787
1746
|
const lines = textValue.split("\n");
|
|
1788
1747
|
const textDecorationTokens = [];
|
|
1789
1748
|
if (segmentStyle.underline || segmentStyle.hyperlink) {
|
|
@@ -1793,8 +1752,8 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1793
1752
|
textDecorationTokens.push("line-through");
|
|
1794
1753
|
}
|
|
1795
1754
|
const isDoubleStrike = segmentStyle.strikethrough && segmentStyle.strikeType === "dblStrike";
|
|
1796
|
-
const resolvedSegmentColor = segmentStyle.hyperlink ?
|
|
1797
|
-
const underlineDecoration =
|
|
1755
|
+
const resolvedSegmentColor = segmentStyle.hyperlink ? chunkPJUQQF3I_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, HYPERLINK_COLOR) : chunkPJUQQF3I_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, fallbackColor);
|
|
1756
|
+
const underlineDecoration = chunkPJUQQF3I_js.resolveUnderlineDecorationStyle(
|
|
1798
1757
|
Boolean(isDoubleStrike),
|
|
1799
1758
|
segmentStyle.underlineStyle
|
|
1800
1759
|
);
|
|
@@ -1804,20 +1763,20 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1804
1763
|
const letterSpacing = typeof segmentStyle.characterSpacing === "number" && segmentStyle.characterSpacing !== 0 ? `${segmentStyle.characterSpacing / 100 * (96 / 72)}px` : void 0;
|
|
1805
1764
|
const textFillStyles = buildTextFillCss2(segmentStyle);
|
|
1806
1765
|
const rawFontSize = segmentStyle.fontSize || element.textStyle?.fontSize || DEFAULT_TEXT_FONT_SIZE;
|
|
1807
|
-
const autoFitScale =
|
|
1766
|
+
const autoFitScale = chunkPJUQQF3I_js.resolveAutoFitFontScale(element.textStyle);
|
|
1808
1767
|
const baseFontSize = rawFontSize * autoFitScale;
|
|
1809
1768
|
const baselineShift = baselineFraction !== 0 ? `${baselineFraction * baseFontSize}px` : void 0;
|
|
1810
1769
|
const baseFontSizePt = baseFontSize * (72 / 96);
|
|
1811
1770
|
const fontKerning = typeof segmentStyle.kerning === "number" ? segmentStyle.kerning === 0 ? "none" : baseFontSizePt >= segmentStyle.kerning / 100 ? "normal" : "none" : void 0;
|
|
1812
1771
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
1813
|
-
const baseFontFamily = rawFontFamily ?
|
|
1772
|
+
const baseFontFamily = rawFontFamily ? chunkPJUQQF3I_js.getSubstituteFontFamily(rawFontFamily) : DEFAULT_FONT_FAMILY;
|
|
1814
1773
|
const scriptFonts = {
|
|
1815
1774
|
latin: baseFontFamily,
|
|
1816
1775
|
eastAsia: segmentStyle.eastAsiaFont || element.textStyle?.eastAsiaFont || baseFontFamily,
|
|
1817
1776
|
complexScript: segmentStyle.complexScriptFont || element.textStyle?.complexScriptFont || baseFontFamily,
|
|
1818
1777
|
symbol: segmentStyle.symbolFont || element.textStyle?.symbolFont || baseFontFamily
|
|
1819
1778
|
};
|
|
1820
|
-
const needsScriptFonts =
|
|
1779
|
+
const needsScriptFonts = chunkPJUQQF3I_js.hasDistinctScriptFonts(scriptFonts);
|
|
1821
1780
|
const spanStyle = {
|
|
1822
1781
|
color: resolvedSegmentColor,
|
|
1823
1782
|
fontSize: baseFontSize * baselineFontScale,
|
|
@@ -1835,15 +1794,15 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1835
1794
|
fontVariantCaps: segmentStyle.textCaps === "small" ? "small-caps" : void 0,
|
|
1836
1795
|
letterSpacing,
|
|
1837
1796
|
fontKerning,
|
|
1838
|
-
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ?
|
|
1797
|
+
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ? chunkPJUQQF3I_js.normalizeHexColor(segmentStyle.highlightColor, "transparent") : void 0,
|
|
1839
1798
|
...textFillStyles,
|
|
1840
|
-
textDecorationColor: segmentStyle.underlineColor ?
|
|
1841
|
-
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${
|
|
1799
|
+
textDecorationColor: segmentStyle.underlineColor ? chunkPJUQQF3I_js.normalizeHexColor(segmentStyle.underlineColor, void 0) : void 0,
|
|
1800
|
+
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${chunkPJUQQF3I_js.normalizeHexColor(segmentStyle.textOutlineColor, "#000000")}` : segmentStyle.textOutlineWidth ? `${segmentStyle.textOutlineWidth}px currentColor` : void 0,
|
|
1842
1801
|
paintOrder: segmentStyle.textOutlineWidth ? "stroke fill" : void 0,
|
|
1843
|
-
textShadow:
|
|
1844
|
-
filter:
|
|
1845
|
-
opacity:
|
|
1846
|
-
WebkitBoxReflect:
|
|
1802
|
+
textShadow: chunkPJUQQF3I_js.buildTextShadowCss(segmentStyle),
|
|
1803
|
+
filter: chunkPJUQQF3I_js.buildTextRunFilterChain(segmentStyle),
|
|
1804
|
+
opacity: chunkPJUQQF3I_js.getTextAlphaOpacity(segmentStyle),
|
|
1805
|
+
WebkitBoxReflect: chunkPJUQQF3I_js.buildTextReflectionCss(segmentStyle)
|
|
1847
1806
|
};
|
|
1848
1807
|
const runRtl = segmentStyle.rtl;
|
|
1849
1808
|
if (runRtl !== void 0 && runRtl !== paragraphRtl) {
|
|
@@ -1863,7 +1822,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1863
1822
|
spanStyle.fontSize = baseFontSize * (bulletInfo.sizePercent / 100) * baselineFontScale;
|
|
1864
1823
|
}
|
|
1865
1824
|
if (bulletInfo.color) {
|
|
1866
|
-
spanStyle.color =
|
|
1825
|
+
spanStyle.color = chunkPJUQQF3I_js.normalizeHexColor(bulletInfo.color, resolvedSegmentColor);
|
|
1867
1826
|
}
|
|
1868
1827
|
if (typeof bulletHangPx === "number" && bulletHangPx > 0) {
|
|
1869
1828
|
spanStyle.display = "inline-block";
|
|
@@ -1908,7 +1867,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1908
1867
|
textAlign: segment.rubyAlignment === "l" ? "left" : segment.rubyAlignment === "r" ? "right" : segment.rubyAlignment === "dist" || segment.rubyAlignment === "distCat" || segment.rubyAlignment === "distLetter" ? "justify" : "center"
|
|
1909
1868
|
};
|
|
1910
1869
|
if (segment.rubyStyle?.color) {
|
|
1911
|
-
rubyStyle.color =
|
|
1870
|
+
rubyStyle.color = chunkPJUQQF3I_js.normalizeHexColor(segment.rubyStyle.color, resolvedSegmentColor);
|
|
1912
1871
|
}
|
|
1913
1872
|
innerContent = /* @__PURE__ */ jsxRuntime.jsxs("ruby", { children: [
|
|
1914
1873
|
baseContent,
|
|
@@ -2003,7 +1962,7 @@ function groupSegmentsIntoParagraphs(segments) {
|
|
|
2003
1962
|
return paragraphs;
|
|
2004
1963
|
}
|
|
2005
1964
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick) {
|
|
2006
|
-
if (!
|
|
1965
|
+
if (!chunkPJUQQF3I_js.hasTextProperties(element)) {
|
|
2007
1966
|
return emptyFallback || null;
|
|
2008
1967
|
}
|
|
2009
1968
|
const effectiveSegments = segmentOverrides ?? element.textSegments;
|
|
@@ -2024,10 +1983,10 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2024
1983
|
return element.text || emptyFallback || "";
|
|
2025
1984
|
}
|
|
2026
1985
|
const paragraphs = groupSegmentsIntoParagraphs(effectiveSegments);
|
|
2027
|
-
const paragraphIndents =
|
|
2028
|
-
const elementRtl =
|
|
2029
|
-
const elementAlign =
|
|
2030
|
-
const bodyStyle =
|
|
1986
|
+
const paragraphIndents = chunkPJUQQF3I_js.hasTextProperties(element) ? element.paragraphIndents : void 0;
|
|
1987
|
+
const elementRtl = chunkPJUQQF3I_js.hasTextProperties(element) ? element.textStyle?.rtl : void 0;
|
|
1988
|
+
const elementAlign = chunkPJUQQF3I_js.hasTextProperties(element) ? element.textStyle?.align : void 0;
|
|
1989
|
+
const bodyStyle = chunkPJUQQF3I_js.hasTextProperties(element) ? element.textStyle : void 0;
|
|
2031
1990
|
const spaceFirstLast = bodyStyle?.spaceFirstLastParagraph !== false;
|
|
2032
1991
|
return paragraphs.map(({ entries: paraSegments, terminator }, paraIndex) => {
|
|
2033
1992
|
const paraIndent = paragraphIndents?.[paraIndex];
|
|
@@ -2042,14 +2001,14 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2042
2001
|
return Boolean(segment.text) && segment.text.trim().length > 0;
|
|
2043
2002
|
});
|
|
2044
2003
|
const hasBullet = bulletInfo && !bulletInfo.none && hasVisibleTextContent;
|
|
2045
|
-
const paraRtl =
|
|
2004
|
+
const paraRtl = chunkPJUQQF3I_js.resolveParagraphRtl(paraSegments, elementRtl);
|
|
2046
2005
|
const isRtlParagraph = paraRtl === true;
|
|
2047
|
-
const paraAlign =
|
|
2048
|
-
const cssTextAlign =
|
|
2006
|
+
const paraAlign = chunkPJUQQF3I_js.resolveParagraphAlign(paraSegments, elementAlign);
|
|
2007
|
+
const cssTextAlign = chunkPJUQQF3I_js.resolveCssTextAlign(paraAlign, isRtlParagraph);
|
|
2049
2008
|
const paraMarginLeft = isRtlParagraph ? void 0 : rawMarginLeft;
|
|
2050
2009
|
const paraMarginRight = isRtlParagraph ? rawMarginLeft : void 0;
|
|
2051
2010
|
const paraTextIndent = rawTextIndent;
|
|
2052
|
-
const paraKinsokuStyle =
|
|
2011
|
+
const paraKinsokuStyle = chunkPJUQQF3I_js.getKinsokuLineBreakStyles(firstSeg?.segment.style);
|
|
2053
2012
|
const hasParaKinsoku = Object.keys(paraKinsokuStyle).length > 0;
|
|
2054
2013
|
const paraProps = effectiveSegments[firstSeg?.globalIndex ?? -1]?.paragraphProperties ?? (paraSegments.length === 0 ? terminator?.paragraphProperties : void 0);
|
|
2055
2014
|
const spacing = resolveParagraphSpacing({
|
|
@@ -2059,7 +2018,7 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2059
2018
|
isLast: paraIndex === paragraphs.length - 1,
|
|
2060
2019
|
spaceFirstLast
|
|
2061
2020
|
});
|
|
2062
|
-
const strutFontSize =
|
|
2021
|
+
const strutFontSize = chunkPJUQQF3I_js.resolveParagraphStrutFontSize(
|
|
2063
2022
|
paraSegments.length > 0 ? paraSegments.map(({ segment }) => segment) : terminator ? [terminator] : [],
|
|
2064
2023
|
bodyStyle?.fontSize
|
|
2065
2024
|
);
|
|
@@ -2163,13 +2122,13 @@ function hexToRgbUnit(hex) {
|
|
|
2163
2122
|
};
|
|
2164
2123
|
}
|
|
2165
2124
|
function getDuotoneColors(element) {
|
|
2166
|
-
if (!
|
|
2125
|
+
if (!chunkPJUQQF3I_js.isImageLikeElement(element)) {
|
|
2167
2126
|
return void 0;
|
|
2168
2127
|
}
|
|
2169
2128
|
return element.imageEffects?.duotone;
|
|
2170
2129
|
}
|
|
2171
2130
|
function buildLineShadowCss(element) {
|
|
2172
|
-
if (!
|
|
2131
|
+
if (!chunkPJUQQF3I_js.hasShapeProperties(element)) {
|
|
2173
2132
|
return void 0;
|
|
2174
2133
|
}
|
|
2175
2134
|
const ss = element.shapeStyle;
|
|
@@ -2180,13 +2139,13 @@ function buildLineShadowCss(element) {
|
|
|
2180
2139
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
2181
2140
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
2182
2141
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
2183
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
2184
|
-
|
|
2142
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkPJUQQF3I_js.colorWithOpacity(
|
|
2143
|
+
chunkPJUQQF3I_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
2185
2144
|
opacity
|
|
2186
2145
|
)}`;
|
|
2187
2146
|
}
|
|
2188
2147
|
function buildLineGlowFilter(element) {
|
|
2189
|
-
if (!
|
|
2148
|
+
if (!chunkPJUQQF3I_js.hasShapeProperties(element)) {
|
|
2190
2149
|
return void 0;
|
|
2191
2150
|
}
|
|
2192
2151
|
const ss = element.shapeStyle;
|
|
@@ -2195,7 +2154,7 @@ function buildLineGlowFilter(element) {
|
|
|
2195
2154
|
}
|
|
2196
2155
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
2197
2156
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
2198
|
-
const glowCol =
|
|
2157
|
+
const glowCol = chunkPJUQQF3I_js.colorWithOpacity(chunkPJUQQF3I_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
2199
2158
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
2200
2159
|
}
|
|
2201
2160
|
function mapDagBlendModeToCss(blend) {
|
|
@@ -2219,7 +2178,7 @@ function getDagDuotoneFilterId(elementId) {
|
|
|
2219
2178
|
return `dag-duotone-${elementId}`;
|
|
2220
2179
|
}
|
|
2221
2180
|
function hasDagDuotoneEffect(element) {
|
|
2222
|
-
if (!
|
|
2181
|
+
if (!chunkPJUQQF3I_js.hasShapeProperties(element)) {
|
|
2223
2182
|
return false;
|
|
2224
2183
|
}
|
|
2225
2184
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
@@ -2282,7 +2241,7 @@ function getRoundRectRadiusPx2(element) {
|
|
|
2282
2241
|
|
|
2283
2242
|
// src/viewer/utils/shape-visual-3d.ts
|
|
2284
2243
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
2285
|
-
return
|
|
2244
|
+
return chunkPJUQQF3I_js.build3DExtrusionData(
|
|
2286
2245
|
shape3d,
|
|
2287
2246
|
scene3d,
|
|
2288
2247
|
fillColor,
|
|
@@ -2291,7 +2250,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
2291
2250
|
);
|
|
2292
2251
|
}
|
|
2293
2252
|
function apply3dEffects2(base, scene3d, shape3d, fillColorFallback) {
|
|
2294
|
-
|
|
2253
|
+
chunkPJUQQF3I_js.apply3dEffects(base, scene3d, shape3d, fillColorFallback);
|
|
2295
2254
|
}
|
|
2296
2255
|
|
|
2297
2256
|
// src/viewer/utils/vector-subpath-paint.ts
|
|
@@ -2300,7 +2259,7 @@ function toHexByte(value) {
|
|
|
2300
2259
|
return clamped.toString(16).padStart(2, "0");
|
|
2301
2260
|
}
|
|
2302
2261
|
function shiftHex(hex, factor, towardsWhite) {
|
|
2303
|
-
const channels =
|
|
2262
|
+
const channels = chunkPJUQQF3I_js.hexToRgbChannels(hex);
|
|
2304
2263
|
if (!channels) {
|
|
2305
2264
|
return hex;
|
|
2306
2265
|
}
|
|
@@ -2326,13 +2285,13 @@ function buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity) {
|
|
|
2326
2285
|
const fillOff = subpath.fillMode === "none" || !hasFill;
|
|
2327
2286
|
return {
|
|
2328
2287
|
d: subpath.d,
|
|
2329
|
-
fill: fillOff ? "none" :
|
|
2288
|
+
fill: fillOff ? "none" : chunkPJUQQF3I_js.colorWithOpacity(adjustFillForMode(fillColor, subpath.fillMode), fillOpacity),
|
|
2330
2289
|
stroked: subpath.stroke !== false
|
|
2331
2290
|
};
|
|
2332
2291
|
});
|
|
2333
2292
|
}
|
|
2334
2293
|
function getStrokeOnlyPresetPaths(element) {
|
|
2335
|
-
if (element.type !== "shape" || !
|
|
2294
|
+
if (element.type !== "shape" || !chunkPJUQQF3I_js.hasShapeProperties(element)) {
|
|
2336
2295
|
return void 0;
|
|
2337
2296
|
}
|
|
2338
2297
|
const shapeType = element.shapeType;
|
|
@@ -2342,7 +2301,7 @@ function getStrokeOnlyPresetPaths(element) {
|
|
|
2342
2301
|
if (element.pathData) {
|
|
2343
2302
|
return void 0;
|
|
2344
2303
|
}
|
|
2345
|
-
const result =
|
|
2304
|
+
const result = chunkPJUQQF3I_js.evaluatePresetShape(
|
|
2346
2305
|
shapeType,
|
|
2347
2306
|
Math.max(element.width, 1),
|
|
2348
2307
|
Math.max(element.height, 1),
|
|
@@ -2360,43 +2319,43 @@ function getGradientTilingCss(style) {
|
|
|
2360
2319
|
if (!style || style.fillMode !== "gradient") {
|
|
2361
2320
|
return void 0;
|
|
2362
2321
|
}
|
|
2363
|
-
const isStructuredLinear = (style.fillGradientType || "linear") === "linear" &&
|
|
2322
|
+
const isStructuredLinear = (style.fillGradientType || "linear") === "linear" && chunkPJUQQF3I_js.sanitizeGradientStops(style.fillGradientStops).length > 0;
|
|
2364
2323
|
if (isStructuredLinear) {
|
|
2365
|
-
const flip =
|
|
2324
|
+
const flip = chunkPJUQQF3I_js.getGradientTileFlipCss(style.fillGradientFlip);
|
|
2366
2325
|
if (flip) {
|
|
2367
2326
|
return flip;
|
|
2368
2327
|
}
|
|
2369
2328
|
}
|
|
2370
|
-
return
|
|
2329
|
+
return chunkPJUQQF3I_js.getGradientTileRectCss(style.fillGradientTileRect);
|
|
2371
2330
|
}
|
|
2372
2331
|
function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2373
|
-
if (!
|
|
2332
|
+
if (!chunkPJUQQF3I_js.hasShapeProperties(element)) {
|
|
2374
2333
|
return {};
|
|
2375
2334
|
}
|
|
2376
2335
|
const normalizedShapeType = getShapeType(element.shapeType);
|
|
2377
|
-
const clipPath =
|
|
2336
|
+
const clipPath = chunkPJUQQF3I_js.getResolvedShapeClipPath(element);
|
|
2378
2337
|
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;
|
|
2379
2338
|
const rendersStrokeOnlyPreset = Boolean(getStrokeOnlyPresetPaths(element));
|
|
2380
2339
|
const fillOpacity = element.shapeStyle?.fillOpacity;
|
|
2381
2340
|
const strokeOpacity = element.shapeStyle?.strokeOpacity;
|
|
2382
|
-
const strokeDash =
|
|
2383
|
-
const fillGradient =
|
|
2341
|
+
const strokeDash = chunkPJUQQF3I_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2342
|
+
const fillGradient = chunkPJUQQF3I_js.buildCssGradientFromShapeStyle(element.shapeStyle, {
|
|
2384
2343
|
rotation: element.rotation,
|
|
2385
2344
|
width: element.width,
|
|
2386
2345
|
height: element.height
|
|
2387
2346
|
}) || element.shapeStyle?.fillGradient;
|
|
2388
|
-
const shadowCss =
|
|
2389
|
-
const innerShadowCss =
|
|
2390
|
-
const resolvedFillColor =
|
|
2391
|
-
const resolvedStrokeColor =
|
|
2347
|
+
const shadowCss = chunkPJUQQF3I_js.buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
2348
|
+
const innerShadowCss = chunkPJUQQF3I_js.buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
2349
|
+
const resolvedFillColor = chunkPJUQQF3I_js.colorWithOpacity(fillColor, fillOpacity);
|
|
2350
|
+
const resolvedStrokeColor = chunkPJUQQF3I_js.colorWithOpacity(strokeColor, strokeOpacity);
|
|
2392
2351
|
const ss = element.shapeStyle;
|
|
2393
2352
|
const gradientTiling = getGradientTilingCss(ss);
|
|
2394
|
-
const paintsGradientOutline =
|
|
2353
|
+
const paintsGradientOutline = chunkPJUQQF3I_js.suppressesCssBorder(element);
|
|
2395
2354
|
const hasFillOverlayColor = Boolean(
|
|
2396
2355
|
ss?.dagFillOverlayColor && ss.dagFillOverlayColor !== "transparent"
|
|
2397
2356
|
);
|
|
2398
2357
|
const combinedShadowParts = [];
|
|
2399
|
-
const multiLayerShadow =
|
|
2358
|
+
const multiLayerShadow = chunkPJUQQF3I_js.buildMultiLayerShadowCss(element.shapeStyle);
|
|
2400
2359
|
if (multiLayerShadow) {
|
|
2401
2360
|
combinedShadowParts.push(multiLayerShadow);
|
|
2402
2361
|
} else if (shadowCss) {
|
|
@@ -2405,7 +2364,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2405
2364
|
if (innerShadowCss) {
|
|
2406
2365
|
combinedShadowParts.push(innerShadowCss);
|
|
2407
2366
|
}
|
|
2408
|
-
const glowBoxShadow =
|
|
2367
|
+
const glowBoxShadow = chunkPJUQQF3I_js.buildGlowBoxShadow(ss?.glowColor, ss?.glowRadius, ss?.glowOpacity);
|
|
2409
2368
|
if (glowBoxShadow) {
|
|
2410
2369
|
combinedShadowParts.push(glowBoxShadow);
|
|
2411
2370
|
}
|
|
@@ -2413,7 +2372,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2413
2372
|
if (lineShadow) {
|
|
2414
2373
|
combinedShadowParts.push(lineShadow);
|
|
2415
2374
|
}
|
|
2416
|
-
const compoundLineShadow =
|
|
2375
|
+
const compoundLineShadow = chunkPJUQQF3I_js.getCompoundLineBoxShadow(
|
|
2417
2376
|
element.shapeStyle?.compoundLine,
|
|
2418
2377
|
strokeWidth,
|
|
2419
2378
|
resolvedStrokeColor
|
|
@@ -2426,11 +2385,11 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2426
2385
|
if (ss?.glowColor && ss.glowColor !== "transparent" && ss.glowRadius) {
|
|
2427
2386
|
const glowOpacity = typeof ss.glowOpacity === "number" ? ss.glowOpacity : 0.75;
|
|
2428
2387
|
const glowRad = Math.round(Math.max(0, ss.glowRadius));
|
|
2429
|
-
const glowCol =
|
|
2388
|
+
const glowCol = chunkPJUQQF3I_js.colorWithOpacity(chunkPJUQQF3I_js.normalizeHexColor(ss.glowColor, "#ffff00"), glowOpacity);
|
|
2430
2389
|
filterParts.push(`drop-shadow(0 0 ${glowRad}px ${glowCol})`);
|
|
2431
2390
|
}
|
|
2432
2391
|
if (typeof ss?.softEdgeRadius === "number" && ss.softEdgeRadius > 0) {
|
|
2433
|
-
filterParts.push(`url(#${
|
|
2392
|
+
filterParts.push(`url(#${chunkPJUQQF3I_js.getSoftEdgeFilterId(element.id)})`);
|
|
2434
2393
|
}
|
|
2435
2394
|
if (typeof ss?.blurRadius === "number" && ss.blurRadius > 0) {
|
|
2436
2395
|
filterParts.push(`blur(${Math.round(ss.blurRadius)}px)`);
|
|
@@ -2439,13 +2398,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2439
2398
|
if (lineGlowCss) {
|
|
2440
2399
|
filterParts.push(lineGlowCss);
|
|
2441
2400
|
}
|
|
2442
|
-
const dagFilter =
|
|
2401
|
+
const dagFilter = chunkPJUQQF3I_js.getEffectDagFilter(ss, element.id);
|
|
2443
2402
|
if (dagFilter) {
|
|
2444
2403
|
filterParts.push(dagFilter);
|
|
2445
2404
|
}
|
|
2446
2405
|
const lineJoinCss = ss?.lineJoin === "round" ? "round" : ss?.lineJoin === "bevel" ? "bevel" : ss?.lineJoin === "miter" ? "miter" : void 0;
|
|
2447
2406
|
const miterLimitCss = ss?.lineJoin === "miter" && typeof ss?.miterLimit === "number" ? Math.max(ss.miterLimit / 1e5, 1) : void 0;
|
|
2448
|
-
const patternFill =
|
|
2407
|
+
const patternFill = chunkPJUQQF3I_js.buildPatternFillCss(element.shapeStyle);
|
|
2449
2408
|
const imageFillUrl = ss?.fillMode === "image" && ss.fillImageUrl ? ss.fillImageUrl : void 0;
|
|
2450
2409
|
const imageFillMode = ss?.fillImageMode || "stretch";
|
|
2451
2410
|
let reflectCss;
|
|
@@ -2457,7 +2416,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2457
2416
|
const endOpacity = typeof ss.reflectionEndOpacity === "number" ? ss.reflectionEndOpacity : 0;
|
|
2458
2417
|
const fadeLength = typeof ss.reflectionEndPosition === "number" ? Math.round(ss.reflectionEndPosition * Math.max(element.height, 1)) : 100;
|
|
2459
2418
|
const blurRadius = typeof ss.reflectionBlurRadius === "number" ? ss.reflectionBlurRadius : 0;
|
|
2460
|
-
reflectCss =
|
|
2419
|
+
reflectCss = chunkPJUQQF3I_js.buildReflectionCss(distance, startOpacity, endOpacity, fadeLength, blurRadius);
|
|
2461
2420
|
}
|
|
2462
2421
|
}
|
|
2463
2422
|
const base = {
|
|
@@ -2503,9 +2462,9 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2503
2462
|
// path following the shape's geometry, because a CSS border can only take
|
|
2504
2463
|
// one colour. Keeping the border too would draw the parser's averaged
|
|
2505
2464
|
// solid underneath the gradient.
|
|
2506
|
-
borderWidth: strokeWidth > 0 && !paintsGradientOutline ?
|
|
2465
|
+
borderWidth: strokeWidth > 0 && !paintsGradientOutline ? chunkPJUQQF3I_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : 0,
|
|
2507
2466
|
borderColor: strokeWidth > 0 && !paintsGradientOutline ? resolvedStrokeColor : void 0,
|
|
2508
|
-
borderStyle: strokeWidth > 0 && !paintsGradientOutline ?
|
|
2467
|
+
borderStyle: strokeWidth > 0 && !paintsGradientOutline ? chunkPJUQQF3I_js.getCssBorderDashStyle(strokeDash, ss?.compoundLine) : void 0,
|
|
2509
2468
|
strokeLinejoin: lineJoinCss,
|
|
2510
2469
|
strokeMiterlimit: miterLimitCss,
|
|
2511
2470
|
strokeLinecap: ss?.lineCap === "rnd" ? "round" : ss?.lineCap === "sq" ? "square" : ss?.lineCap === "flat" ? "butt" : void 0
|
|
@@ -2561,7 +2520,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2561
2520
|
borderWidth: 0,
|
|
2562
2521
|
borderTopWidth: Math.max(strokeWidth, 2),
|
|
2563
2522
|
borderTopColor: resolvedStrokeColor,
|
|
2564
|
-
borderTopStyle:
|
|
2523
|
+
borderTopStyle: chunkPJUQQF3I_js.getCssBorderDashStyle(strokeDash)
|
|
2565
2524
|
};
|
|
2566
2525
|
}
|
|
2567
2526
|
if (normalizedShapeType === "cylinder") {
|
|
@@ -2575,13 +2534,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2575
2534
|
function getConnectorAdjustment(element, key, fallback) {
|
|
2576
2535
|
const direct = element.shapeAdjustments?.[key];
|
|
2577
2536
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
2578
|
-
return
|
|
2537
|
+
return chunkPJUQQF3I_js.clampUnitInterval(direct / 1e5);
|
|
2579
2538
|
}
|
|
2580
2539
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
2581
2540
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
2582
|
-
return
|
|
2541
|
+
return chunkPJUQQF3I_js.clampUnitInterval(fallbackKey / 1e5);
|
|
2583
2542
|
}
|
|
2584
|
-
return
|
|
2543
|
+
return chunkPJUQQF3I_js.clampUnitInterval(fallback);
|
|
2585
2544
|
}
|
|
2586
2545
|
function getConnectorPathGeometry(element) {
|
|
2587
2546
|
const width = Math.max(element.width, 1);
|
|
@@ -2718,11 +2677,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
|
|
|
2718
2677
|
strokePaint,
|
|
2719
2678
|
strokeWidth,
|
|
2720
2679
|
dashArray,
|
|
2721
|
-
lineCap:
|
|
2680
|
+
lineCap: chunkPJUQQF3I_js.svgLineCap(shapeStyle?.lineCap),
|
|
2722
2681
|
lineJoin,
|
|
2723
2682
|
miterLimit,
|
|
2724
|
-
offsets:
|
|
2725
|
-
widths:
|
|
2683
|
+
offsets: chunkPJUQQF3I_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
2684
|
+
widths: chunkPJUQQF3I_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
|
|
2726
2685
|
};
|
|
2727
2686
|
}
|
|
2728
2687
|
function strokeStrands(d, keyBase, ctx) {
|
|
@@ -2770,9 +2729,9 @@ function gradientDefs(gradient) {
|
|
|
2770
2729
|
}
|
|
2771
2730
|
function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredPaths, shapeStyle, hasFill, fillColor, fillOpacity, strokePaint, strokeWidth, dashArray, animatesFill = false, gradient) {
|
|
2772
2731
|
const ctx = strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray);
|
|
2773
|
-
const subpaths = structuredPaths && structuredPaths.length > 0 ?
|
|
2732
|
+
const subpaths = structuredPaths && structuredPaths.length > 0 ? chunkPJUQQF3I_js.customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
2774
2733
|
const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
|
|
2775
|
-
const gradientPaint = gradient ?
|
|
2734
|
+
const gradientPaint = gradient ? chunkPJUQQF3I_js.svgGradientFillRef(gradient) : void 0;
|
|
2776
2735
|
const nodes = [];
|
|
2777
2736
|
if (subpaths && needsPerSubpath) {
|
|
2778
2737
|
const paints = buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity);
|
|
@@ -2804,7 +2763,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2804
2763
|
"path",
|
|
2805
2764
|
{
|
|
2806
2765
|
d: pathData,
|
|
2807
|
-
fill: animatesFill ? "inherit" : gradientPaint ??
|
|
2766
|
+
fill: animatesFill ? "inherit" : gradientPaint ?? chunkPJUQQF3I_js.colorWithOpacity(fillColor, fillOpacity),
|
|
2808
2767
|
stroke: "none",
|
|
2809
2768
|
vectorEffect: "non-scaling-stroke"
|
|
2810
2769
|
},
|
|
@@ -2849,14 +2808,14 @@ function renderStrokeOnlyPreset(presetPaths, width, height, shapeStyle, strokePa
|
|
|
2849
2808
|
);
|
|
2850
2809
|
}
|
|
2851
2810
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2852
|
-
if (!
|
|
2811
|
+
if (!chunkPJUQQF3I_js.hasShapeProperties(element)) {
|
|
2853
2812
|
return null;
|
|
2854
2813
|
}
|
|
2855
2814
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
2856
|
-
const fillPaint = animatesFill ? "inherit" :
|
|
2857
|
-
const strokePaint = animatesStroke ? "inherit" :
|
|
2858
|
-
const dashType =
|
|
2859
|
-
const dashArray =
|
|
2815
|
+
const fillPaint = animatesFill ? "inherit" : chunkPJUQQF3I_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
2816
|
+
const strokePaint = animatesStroke ? "inherit" : chunkPJUQQF3I_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
2817
|
+
const dashType = chunkPJUQQF3I_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2818
|
+
const dashArray = chunkPJUQQF3I_js.getSvgStrokeDasharray(
|
|
2860
2819
|
dashType,
|
|
2861
2820
|
Math.max(strokeWidth, 1),
|
|
2862
2821
|
element.shapeStyle?.customDashSegments
|
|
@@ -2937,21 +2896,21 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2937
2896
|
// container's `background-image` is suppressed for custom geometry, so
|
|
2938
2897
|
// without this the shape fell back to the parser's representative solid
|
|
2939
2898
|
// and lost every fade (issue #132).
|
|
2940
|
-
|
|
2899
|
+
chunkPJUQQF3I_js.buildSvgGradientDef(element.shapeStyle, element.id)
|
|
2941
2900
|
);
|
|
2942
2901
|
}
|
|
2943
|
-
if (
|
|
2902
|
+
if (chunkPJUQQF3I_js.isCalloutShape(normalizedType)) {
|
|
2944
2903
|
const width = Math.max(element.width, 1);
|
|
2945
2904
|
const height = Math.max(element.height, 1);
|
|
2946
|
-
const geometry =
|
|
2905
|
+
const geometry = chunkPJUQQF3I_js.getCalloutLeaderLineGeometry(
|
|
2947
2906
|
normalizedType,
|
|
2948
2907
|
width,
|
|
2949
2908
|
height,
|
|
2950
2909
|
element.shapeAdjustments
|
|
2951
2910
|
);
|
|
2952
2911
|
if (geometry && geometry.points.length >= 2) {
|
|
2953
|
-
const leaderPath =
|
|
2954
|
-
const bounds =
|
|
2912
|
+
const leaderPath = chunkPJUQQF3I_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
2913
|
+
const bounds = chunkPJUQQF3I_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
2955
2914
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
2956
2915
|
const offsetLeft = bounds.minX;
|
|
2957
2916
|
const offsetTop = bounds.minY;
|
|
@@ -3014,10 +2973,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
3014
2973
|
const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
|
|
3015
2974
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
3016
2975
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
3017
|
-
const connectorLineCap =
|
|
2976
|
+
const connectorLineCap = chunkPJUQQF3I_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
3018
2977
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
3019
|
-
const offsets =
|
|
3020
|
-
const widths =
|
|
2978
|
+
const offsets = chunkPJUQQF3I_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
2979
|
+
const widths = chunkPJUQQF3I_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
3021
2980
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3022
2981
|
"svg",
|
|
3023
2982
|
{
|
|
@@ -3096,15 +3055,15 @@ function parseGradientFillCss(gradFill) {
|
|
|
3096
3055
|
}
|
|
3097
3056
|
const parsed = stops.map((gs) => {
|
|
3098
3057
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
3099
|
-
const color =
|
|
3100
|
-
const opacity =
|
|
3101
|
-
return { pos, color:
|
|
3058
|
+
const color = chunkPJUQQF3I_js.parseDrawingColor(gs) ?? "#888888";
|
|
3059
|
+
const opacity = chunkPJUQQF3I_js.parseDrawingColorOpacity(gs);
|
|
3060
|
+
return { pos, color: chunkPJUQQF3I_js.colorWithOpacity(color, opacity) };
|
|
3102
3061
|
}).sort((a, b) => a.pos - b.pos);
|
|
3103
3062
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
3104
3063
|
const lin = gradFill["a:lin"];
|
|
3105
3064
|
if (lin) {
|
|
3106
3065
|
const angRaw = Number.parseInt(String(lin["@_ang"] || "0"), 10);
|
|
3107
|
-
const angleDeg = Math.round(
|
|
3066
|
+
const angleDeg = Math.round(chunkPJUQQF3I_js.ooxmlGradientAngleToCssDegrees(angRaw / 6e4));
|
|
3108
3067
|
return `linear-gradient(${angleDeg}deg, ${stopStrings})`;
|
|
3109
3068
|
}
|
|
3110
3069
|
const path = gradFill["a:path"];
|
|
@@ -3139,8 +3098,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
3139
3098
|
if (!pattFill) {
|
|
3140
3099
|
return void 0;
|
|
3141
3100
|
}
|
|
3142
|
-
const fgColor =
|
|
3143
|
-
const bgColor =
|
|
3101
|
+
const fgColor = chunkPJUQQF3I_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
3102
|
+
const bgColor = chunkPJUQQF3I_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
3144
3103
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
3145
3104
|
switch (preset) {
|
|
3146
3105
|
case "ltHorz":
|
|
@@ -3251,11 +3210,11 @@ function parseCellBorders(cellProperties) {
|
|
|
3251
3210
|
const prstDash = ln["a:prstDash"];
|
|
3252
3211
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
3253
3212
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
3254
|
-
const color =
|
|
3213
|
+
const color = chunkPJUQQF3I_js.parseDrawingColor(ln["a:solidFill"]);
|
|
3255
3214
|
if (color) {
|
|
3256
|
-
const opacity =
|
|
3215
|
+
const opacity = chunkPJUQQF3I_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
3257
3216
|
const key = `${edge.prefix}`;
|
|
3258
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
3217
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkPJUQQF3I_js.colorWithOpacity(color, opacity)}`;
|
|
3259
3218
|
}
|
|
3260
3219
|
}
|
|
3261
3220
|
return borderStyle;
|
|
@@ -3268,7 +3227,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3268
3227
|
const textShadowParts = [];
|
|
3269
3228
|
const outerShdw = effectLst["a:outerShdw"];
|
|
3270
3229
|
if (outerShdw) {
|
|
3271
|
-
const shdwColor =
|
|
3230
|
+
const shdwColor = chunkPJUQQF3I_js.parseDrawingColor(outerShdw);
|
|
3272
3231
|
if (shdwColor) {
|
|
3273
3232
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
3274
3233
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -3286,7 +3245,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3286
3245
|
}
|
|
3287
3246
|
const glow = effectLst["a:glow"];
|
|
3288
3247
|
if (glow) {
|
|
3289
|
-
const glowColor =
|
|
3248
|
+
const glowColor = chunkPJUQQF3I_js.parseDrawingColor(glow);
|
|
3290
3249
|
if (glowColor) {
|
|
3291
3250
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
3292
3251
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -3365,10 +3324,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3365
3324
|
if (runProps?.["@_u"] !== void 0) {
|
|
3366
3325
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
3367
3326
|
}
|
|
3368
|
-
const runColor =
|
|
3327
|
+
const runColor = chunkPJUQQF3I_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkPJUQQF3I_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
3369
3328
|
if (runColor) {
|
|
3370
|
-
const opacity =
|
|
3371
|
-
cellStyle.color =
|
|
3329
|
+
const opacity = chunkPJUQQF3I_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
3330
|
+
cellStyle.color = chunkPJUQQF3I_js.colorWithOpacity(runColor, opacity);
|
|
3372
3331
|
}
|
|
3373
3332
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
3374
3333
|
if (fontFamily) {
|
|
@@ -3378,15 +3337,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3378
3337
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
3379
3338
|
}
|
|
3380
3339
|
const cellProperties = cellXml["a:tcPr"];
|
|
3381
|
-
const cellFill =
|
|
3340
|
+
const cellFill = chunkPJUQQF3I_js.parseDrawingColor(
|
|
3382
3341
|
cellProperties?.["a:solidFill"],
|
|
3383
3342
|
schemeColorOverrides
|
|
3384
3343
|
);
|
|
3385
3344
|
if (cellFill) {
|
|
3386
|
-
const opacity =
|
|
3345
|
+
const opacity = chunkPJUQQF3I_js.parseDrawingColorOpacity(
|
|
3387
3346
|
cellProperties?.["a:solidFill"]
|
|
3388
3347
|
);
|
|
3389
|
-
cellStyle.backgroundColor =
|
|
3348
|
+
cellStyle.backgroundColor = chunkPJUQQF3I_js.colorWithOpacity(cellFill, opacity);
|
|
3390
3349
|
} else {
|
|
3391
3350
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
3392
3351
|
if (gradCss) {
|
|
@@ -3401,16 +3360,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3401
3360
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
3402
3361
|
Object.assign(cellStyle, edgeBorders);
|
|
3403
3362
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
3404
|
-
const borderColor =
|
|
3363
|
+
const borderColor = chunkPJUQQF3I_js.parseDrawingColor(
|
|
3405
3364
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
3406
3365
|
schemeColorOverrides
|
|
3407
|
-
) ||
|
|
3366
|
+
) || chunkPJUQQF3I_js.parseDrawingColor(
|
|
3408
3367
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
3409
3368
|
schemeColorOverrides
|
|
3410
|
-
) ||
|
|
3369
|
+
) || chunkPJUQQF3I_js.parseDrawingColor(
|
|
3411
3370
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
3412
3371
|
schemeColorOverrides
|
|
3413
|
-
) ||
|
|
3372
|
+
) || chunkPJUQQF3I_js.parseDrawingColor(
|
|
3414
3373
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
3415
3374
|
schemeColorOverrides
|
|
3416
3375
|
);
|
|
@@ -3489,10 +3448,10 @@ function resolveTableStyleFillColor(fill, colorScheme) {
|
|
|
3489
3448
|
}
|
|
3490
3449
|
let color = base;
|
|
3491
3450
|
if (fill.tint !== void 0 && fill.tint > 0) {
|
|
3492
|
-
color =
|
|
3451
|
+
color = chunkPJUQQF3I_js.tintColor2(color, fill.tint / 1e5);
|
|
3493
3452
|
}
|
|
3494
3453
|
if (fill.shade !== void 0 && fill.shade > 0) {
|
|
3495
|
-
color =
|
|
3454
|
+
color = chunkPJUQQF3I_js.shadeColor2(color, 1 - fill.shade / 1e5);
|
|
3496
3455
|
}
|
|
3497
3456
|
return color;
|
|
3498
3457
|
}
|
|
@@ -3517,7 +3476,7 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3517
3476
|
style.fontFamily = text.fontFace;
|
|
3518
3477
|
applied = true;
|
|
3519
3478
|
} else {
|
|
3520
|
-
const refFont =
|
|
3479
|
+
const refFont = chunkPJUQQF3I_js.resolveFontRefIdx(text.fontRefIdx, fontScheme);
|
|
3521
3480
|
if (refFont) {
|
|
3522
3481
|
style.fontFamily = refFont;
|
|
3523
3482
|
applied = true;
|
|
@@ -3528,10 +3487,10 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3528
3487
|
if (base) {
|
|
3529
3488
|
let color = base;
|
|
3530
3489
|
if (text.fontTint !== void 0 && text.fontTint > 0) {
|
|
3531
|
-
color =
|
|
3490
|
+
color = chunkPJUQQF3I_js.tintColor2(color, text.fontTint / 1e5);
|
|
3532
3491
|
}
|
|
3533
3492
|
if (text.fontShade !== void 0 && text.fontShade > 0) {
|
|
3534
|
-
color =
|
|
3493
|
+
color = chunkPJUQQF3I_js.shadeColor2(color, 1 - text.fontShade / 1e5);
|
|
3535
3494
|
}
|
|
3536
3495
|
style.color = color;
|
|
3537
3496
|
applied = true;
|
|
@@ -3720,7 +3679,7 @@ function parseTableElementData(element, fallbackTextStyle) {
|
|
|
3720
3679
|
};
|
|
3721
3680
|
}
|
|
3722
3681
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
3723
|
-
return
|
|
3682
|
+
return chunkPJUQQF3I_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
3724
3683
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
3725
3684
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
3726
3685
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -3868,9 +3827,9 @@ function cellStyleToCss(style) {
|
|
|
3868
3827
|
if (style.gradientFillCss) {
|
|
3869
3828
|
css.background = style.gradientFillCss;
|
|
3870
3829
|
} else if (style.fillMode === "pattern" && style.patternFillPreset) {
|
|
3871
|
-
const fg =
|
|
3872
|
-
const bg =
|
|
3873
|
-
const svgPattern =
|
|
3830
|
+
const fg = chunkPJUQQF3I_js.normalizeHexColor(style.patternFillForeground, "#000000");
|
|
3831
|
+
const bg = chunkPJUQQF3I_js.normalizeHexColor(style.patternFillBackground, "#ffffff");
|
|
3832
|
+
const svgPattern = chunkPJUQQF3I_js.getPatternSvg(style.patternFillPreset, fg, bg);
|
|
3874
3833
|
if (svgPattern) {
|
|
3875
3834
|
const encoded = encodeURIComponent(svgPattern);
|
|
3876
3835
|
css.backgroundImage = `url("data:image/svg+xml,${encoded}")`;
|
|
@@ -3946,7 +3905,7 @@ function cellStyleToCss(style) {
|
|
|
3946
3905
|
if (edge.width || edge.color) {
|
|
3947
3906
|
const w = edge.width ?? 1;
|
|
3948
3907
|
const c = edge.color ?? style.borderColor ?? "#000000";
|
|
3949
|
-
const s =
|
|
3908
|
+
const s = chunkPJUQQF3I_js.ooxmlDashToCssBorderStyle(edge.dash);
|
|
3950
3909
|
css[edge.prefix] = `${w}px ${s} ${c}`;
|
|
3951
3910
|
}
|
|
3952
3911
|
}
|
|
@@ -3977,7 +3936,7 @@ function cellStyleToCss(style) {
|
|
|
3977
3936
|
css.textShadow = textShadowParts.join(", ");
|
|
3978
3937
|
}
|
|
3979
3938
|
if (style.cell3D) {
|
|
3980
|
-
Object.assign(css,
|
|
3939
|
+
Object.assign(css, chunkPJUQQF3I_js.cell3DBevelCss(style.cell3D));
|
|
3981
3940
|
}
|
|
3982
3941
|
return css;
|
|
3983
3942
|
}
|
|
@@ -3991,7 +3950,7 @@ function TableResizeOverlay({
|
|
|
3991
3950
|
const containerRef = React6.useRef(null);
|
|
3992
3951
|
const [rowBounds, setRowBounds] = React6.useState([]);
|
|
3993
3952
|
const dragRef = React6.useRef(null);
|
|
3994
|
-
const colBoundaries = React6.useMemo(() =>
|
|
3953
|
+
const colBoundaries = React6.useMemo(() => chunkPJUQQF3I_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
3995
3954
|
const measureRows = React6.useCallback(() => {
|
|
3996
3955
|
const container = containerRef.current;
|
|
3997
3956
|
if (!container) {
|
|
@@ -4038,11 +3997,11 @@ function TableResizeOverlay({
|
|
|
4038
3997
|
const rect = containerRef.current.getBoundingClientRect();
|
|
4039
3998
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
4040
3999
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
4041
|
-
onResizeColumns(
|
|
4000
|
+
onResizeColumns(chunkPJUQQF3I_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
4042
4001
|
} else if (drag.type === "row" && onResizeRow) {
|
|
4043
4002
|
const deltaY = e.clientY - drag.startPos;
|
|
4044
|
-
const newHeight =
|
|
4045
|
-
drag.initialRowHeight ??
|
|
4003
|
+
const newHeight = chunkPJUQQF3I_js.computeResizedRowHeight(
|
|
4004
|
+
drag.initialRowHeight ?? chunkPJUQQF3I_js.DEFAULT_ROW_HEIGHT,
|
|
4046
4005
|
deltaY
|
|
4047
4006
|
);
|
|
4048
4007
|
onResizeRow(drag.index, newHeight);
|
|
@@ -4080,7 +4039,7 @@ function TableResizeOverlay({
|
|
|
4080
4039
|
e.stopPropagation();
|
|
4081
4040
|
const table = containerRef.current?.querySelector("table");
|
|
4082
4041
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
4083
|
-
const actualHeight = tr?.offsetHeight ??
|
|
4042
|
+
const actualHeight = tr?.offsetHeight ?? chunkPJUQQF3I_js.DEFAULT_ROW_HEIGHT;
|
|
4084
4043
|
document.body.style.cursor = "row-resize";
|
|
4085
4044
|
document.body.style.userSelect = "none";
|
|
4086
4045
|
dragRef.current = {
|
|
@@ -4128,7 +4087,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4128
4087
|
}
|
|
4129
4088
|
const first = selectedCell.selectedCells[0];
|
|
4130
4089
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4131
|
-
return
|
|
4090
|
+
return chunkPJUQQF3I_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
4132
4091
|
})();
|
|
4133
4092
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4134
4093
|
TableResizeOverlay,
|
|
@@ -4161,7 +4120,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4161
4120
|
return null;
|
|
4162
4121
|
}
|
|
4163
4122
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
4164
|
-
const isInMultiSelection =
|
|
4123
|
+
const isInMultiSelection = chunkPJUQQF3I_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
4165
4124
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
4166
4125
|
const diag = getCellDiagonalBorders2(
|
|
4167
4126
|
cell.style,
|
|
@@ -4191,7 +4150,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4191
4150
|
}
|
|
4192
4151
|
event.stopPropagation();
|
|
4193
4152
|
if (event.shiftKey && selectedCell) {
|
|
4194
|
-
const rect =
|
|
4153
|
+
const rect = chunkPJUQQF3I_js.computeSelectionRect(
|
|
4195
4154
|
selectedCell.rowIndex,
|
|
4196
4155
|
selectedCell.columnIndex,
|
|
4197
4156
|
rowIndex,
|
|
@@ -4201,7 +4160,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4201
4160
|
options?.onSelectCell?.({
|
|
4202
4161
|
rowIndex: selectedCell.rowIndex,
|
|
4203
4162
|
columnIndex: selectedCell.columnIndex,
|
|
4204
|
-
selectedCells:
|
|
4163
|
+
selectedCells: chunkPJUQQF3I_js.rectToCells(rect)
|
|
4205
4164
|
});
|
|
4206
4165
|
} else {
|
|
4207
4166
|
options?.onSelectCell?.({
|
|
@@ -4263,7 +4222,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4263
4222
|
if (tableEl2.tableData && tableEl2.tableData.rows.length > 0) {
|
|
4264
4223
|
return renderTableFromTableData(tableEl2, textStyle, options);
|
|
4265
4224
|
}
|
|
4266
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
4225
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunk3GNSGGY2_js.translationsEn["pptx.table.title"] });
|
|
4267
4226
|
}
|
|
4268
4227
|
const selectedCell = options?.selectedCell || null;
|
|
4269
4228
|
const isEditable = Boolean(options?.editable);
|
|
@@ -4278,7 +4237,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4278
4237
|
}
|
|
4279
4238
|
const first = selectedCell.selectedCells[0];
|
|
4280
4239
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4281
|
-
return
|
|
4240
|
+
return chunkPJUQQF3I_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
4282
4241
|
})();
|
|
4283
4242
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
4284
4243
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4355,7 +4314,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4355
4314
|
"border px-1 py-0.5 align-top",
|
|
4356
4315
|
isEditable && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
4357
4316
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
4358
|
-
|
|
4317
|
+
chunkPJUQQF3I_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
4359
4318
|
),
|
|
4360
4319
|
colSpan,
|
|
4361
4320
|
rowSpan: rSpan,
|
|
@@ -4366,7 +4325,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4366
4325
|
}
|
|
4367
4326
|
event.stopPropagation();
|
|
4368
4327
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
4369
|
-
const rect =
|
|
4328
|
+
const rect = chunkPJUQQF3I_js.computeSelectionRect(
|
|
4370
4329
|
selectedCell.rowIndex,
|
|
4371
4330
|
selectedCell.columnIndex,
|
|
4372
4331
|
rowIndex,
|
|
@@ -4376,7 +4335,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4376
4335
|
options?.onSelectCell?.({
|
|
4377
4336
|
rowIndex: selectedCell.rowIndex,
|
|
4378
4337
|
columnIndex: selectedCell.columnIndex,
|
|
4379
|
-
selectedCells:
|
|
4338
|
+
selectedCells: chunkPJUQQF3I_js.rectToCells(rect)
|
|
4380
4339
|
});
|
|
4381
4340
|
} else {
|
|
4382
4341
|
options?.onSelectCell?.({
|
|
@@ -4431,24 +4390,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4431
4390
|
}
|
|
4432
4391
|
var LEGEND_ITEM_WIDTH = 80;
|
|
4433
4392
|
function partAttrs(part) {
|
|
4434
|
-
return part ?
|
|
4393
|
+
return part ? chunkPJUQQF3I_js.chartPartToAttrs(part) : void 0;
|
|
4435
4394
|
}
|
|
4436
4395
|
function resolveReactPalette(chartData) {
|
|
4437
4396
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
4438
4397
|
return chartData.colorPalette;
|
|
4439
4398
|
}
|
|
4440
|
-
return [...
|
|
4399
|
+
return [...chunkPJUQQF3I_js.getChartStylePalette(chartData.style?.styleId)];
|
|
4441
4400
|
}
|
|
4442
4401
|
function buildReactChartViewModel(element) {
|
|
4443
4402
|
if (element.type !== "chart" || !element.chartData) {
|
|
4444
|
-
return
|
|
4403
|
+
return chunkPJUQQF3I_js.buildChartViewModel(element);
|
|
4445
4404
|
}
|
|
4446
4405
|
const palette = resolveReactPalette(element.chartData);
|
|
4447
4406
|
const themedElement = {
|
|
4448
4407
|
...element,
|
|
4449
4408
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
4450
4409
|
};
|
|
4451
|
-
return
|
|
4410
|
+
return chunkPJUQQF3I_js.buildChartViewModel(themedElement);
|
|
4452
4411
|
}
|
|
4453
4412
|
function renderPrimitive(prim, key) {
|
|
4454
4413
|
switch (prim.kind) {
|
|
@@ -4837,7 +4796,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4837
4796
|
const unmatchedRows = [];
|
|
4838
4797
|
categories.forEach((cat, i) => {
|
|
4839
4798
|
const value = values[i] ?? 0;
|
|
4840
|
-
const code =
|
|
4799
|
+
const code = chunkPJUQQF3I_js.resolveRegionCode(cat);
|
|
4841
4800
|
if (code) {
|
|
4842
4801
|
regionValueMap.set(code, { value, label: cat });
|
|
4843
4802
|
} else {
|
|
@@ -4875,8 +4834,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4875
4834
|
let fill = "#e2e8f0";
|
|
4876
4835
|
let dataLabel = null;
|
|
4877
4836
|
if (entry) {
|
|
4878
|
-
const t =
|
|
4879
|
-
fill =
|
|
4837
|
+
const t = chunkPJUQQF3I_js.normalizeValue(entry.value, minVal, maxVal);
|
|
4838
|
+
fill = chunkPJUQQF3I_js.sequentialColorScale(t);
|
|
4880
4839
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
4881
4840
|
"text",
|
|
4882
4841
|
{
|
|
@@ -4887,7 +4846,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4887
4846
|
fontWeight: 600,
|
|
4888
4847
|
fill: "#1e293b",
|
|
4889
4848
|
style: { pointerEvents: "none" },
|
|
4890
|
-
children:
|
|
4849
|
+
children: chunkPJUQQF3I_js.formatAxisValue(entry.value)
|
|
4891
4850
|
},
|
|
4892
4851
|
`${element.id}-map-dl-${region.code}`
|
|
4893
4852
|
);
|
|
@@ -4905,7 +4864,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4905
4864
|
opacity: 0.9,
|
|
4906
4865
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
4907
4866
|
region.name,
|
|
4908
|
-
entry ? `: ${
|
|
4867
|
+
entry ? `: ${chunkPJUQQF3I_js.formatAxisValue(entry.value)}` : ""
|
|
4909
4868
|
] })
|
|
4910
4869
|
}
|
|
4911
4870
|
),
|
|
@@ -4943,7 +4902,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4943
4902
|
fontSize: 7,
|
|
4944
4903
|
fill: "#64748b",
|
|
4945
4904
|
textAnchor: "middle",
|
|
4946
|
-
children:
|
|
4905
|
+
children: chunkPJUQQF3I_js.formatAxisValue(minVal)
|
|
4947
4906
|
},
|
|
4948
4907
|
`${element.id}-map-legend-min`
|
|
4949
4908
|
),
|
|
@@ -4955,7 +4914,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4955
4914
|
fontSize: 7,
|
|
4956
4915
|
fill: "#64748b",
|
|
4957
4916
|
textAnchor: "middle",
|
|
4958
|
-
children:
|
|
4917
|
+
children: chunkPJUQQF3I_js.formatAxisValue(maxVal)
|
|
4959
4918
|
},
|
|
4960
4919
|
`${element.id}-map-legend-max`
|
|
4961
4920
|
)
|
|
@@ -4974,7 +4933,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4974
4933
|
textAnchor: "middle",
|
|
4975
4934
|
fontSize: 7,
|
|
4976
4935
|
fill: "#94a3b8",
|
|
4977
|
-
children:
|
|
4936
|
+
children: chunk3GNSGGY2_js.translationsEn["pptx.chart.additionalRegionsFallback"]
|
|
4978
4937
|
},
|
|
4979
4938
|
`${element.id}-map-ft-hdr`
|
|
4980
4939
|
)
|
|
@@ -5021,7 +4980,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
5021
4980
|
y,
|
|
5022
4981
|
fontSize,
|
|
5023
4982
|
fill: "#475569",
|
|
5024
|
-
children:
|
|
4983
|
+
children: chunkPJUQQF3I_js.formatAxisValue(row.value)
|
|
5025
4984
|
},
|
|
5026
4985
|
`${element.id}-map-ft-val-${i}`
|
|
5027
4986
|
)
|
|
@@ -5092,7 +5051,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
5092
5051
|
|
|
5093
5052
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
5094
5053
|
function sColor(series, idx) {
|
|
5095
|
-
return
|
|
5054
|
+
return chunkPJUQQF3I_js.seriesColor(series, idx);
|
|
5096
5055
|
}
|
|
5097
5056
|
function valToY(val, range, topY, bottomY) {
|
|
5098
5057
|
const usable = bottomY - topY;
|
|
@@ -5631,7 +5590,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5631
5590
|
width: 10,
|
|
5632
5591
|
height: 10,
|
|
5633
5592
|
rx: 2,
|
|
5634
|
-
fill:
|
|
5593
|
+
fill: chunkPJUQQF3I_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5635
5594
|
},
|
|
5636
5595
|
`${id}-leg-r-${i}`
|
|
5637
5596
|
)
|
|
@@ -5655,7 +5614,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5655
5614
|
width: 10,
|
|
5656
5615
|
height: 10,
|
|
5657
5616
|
rx: 2,
|
|
5658
|
-
fill:
|
|
5617
|
+
fill: chunkPJUQQF3I_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5659
5618
|
}
|
|
5660
5619
|
),
|
|
5661
5620
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -5668,9 +5627,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5668
5627
|
}
|
|
5669
5628
|
const lines = [];
|
|
5670
5629
|
if (range.logScale && range.logBase) {
|
|
5671
|
-
const ticks =
|
|
5630
|
+
const ticks = chunkPJUQQF3I_js.generateLogTicks(range);
|
|
5672
5631
|
ticks.forEach((tickVal, i) => {
|
|
5673
|
-
const y =
|
|
5632
|
+
const y = chunkPJUQQF3I_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5674
5633
|
lines.push(
|
|
5675
5634
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5676
5635
|
"line",
|
|
@@ -5691,7 +5650,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5691
5650
|
const steps = 4;
|
|
5692
5651
|
for (let i = 0; i <= steps; i++) {
|
|
5693
5652
|
const val = range.min + range.span * i / steps;
|
|
5694
|
-
const y =
|
|
5653
|
+
const y = chunkPJUQQF3I_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5695
5654
|
lines.push(
|
|
5696
5655
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5697
5656
|
"line",
|
|
@@ -5715,9 +5674,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5715
5674
|
const labels = [];
|
|
5716
5675
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5717
5676
|
if (range.logScale && range.logBase) {
|
|
5718
|
-
const ticks =
|
|
5677
|
+
const ticks = chunkPJUQQF3I_js.generateLogTicks(range);
|
|
5719
5678
|
ticks.forEach((tickVal, i) => {
|
|
5720
|
-
const y =
|
|
5679
|
+
const y = chunkPJUQQF3I_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5721
5680
|
labels.push(
|
|
5722
5681
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5723
5682
|
"text",
|
|
@@ -5727,7 +5686,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5727
5686
|
textAnchor: "end",
|
|
5728
5687
|
fontSize: 8,
|
|
5729
5688
|
fill: "#64748b",
|
|
5730
|
-
children: hasDisplayUnits ?
|
|
5689
|
+
children: hasDisplayUnits ? chunkPJUQQF3I_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunkPJUQQF3I_js.formatAxisValue(tickVal)
|
|
5731
5690
|
},
|
|
5732
5691
|
`${id}-vaxis-log-${i}`
|
|
5733
5692
|
)
|
|
@@ -5737,7 +5696,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5737
5696
|
const steps = 4;
|
|
5738
5697
|
for (let i = 0; i <= steps; i++) {
|
|
5739
5698
|
const val = range.min + range.span * i / steps;
|
|
5740
|
-
const y =
|
|
5699
|
+
const y = chunkPJUQQF3I_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5741
5700
|
labels.push(
|
|
5742
5701
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5743
5702
|
"text",
|
|
@@ -5747,7 +5706,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5747
5706
|
textAnchor: "end",
|
|
5748
5707
|
fontSize: 8,
|
|
5749
5708
|
fill: "#64748b",
|
|
5750
|
-
children: hasDisplayUnits ?
|
|
5709
|
+
children: hasDisplayUnits ? chunkPJUQQF3I_js.formatAxisValueWithUnits(val, axisFormatting) : chunkPJUQQF3I_js.formatAxisValue(val)
|
|
5751
5710
|
},
|
|
5752
5711
|
`${id}-vaxis-${i}`
|
|
5753
5712
|
)
|
|
@@ -5755,7 +5714,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5755
5714
|
}
|
|
5756
5715
|
}
|
|
5757
5716
|
if (hasDisplayUnits) {
|
|
5758
|
-
const unitLabel =
|
|
5717
|
+
const unitLabel = chunkPJUQQF3I_js.getDisplayUnitLabel(
|
|
5759
5718
|
axisFormatting.displayUnits,
|
|
5760
5719
|
axisFormatting.displayUnitsLabel
|
|
5761
5720
|
);
|
|
@@ -5830,7 +5789,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
5830
5789
|
if (range.min >= 0) {
|
|
5831
5790
|
return null;
|
|
5832
5791
|
}
|
|
5833
|
-
const y =
|
|
5792
|
+
const y = chunkPJUQQF3I_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
5834
5793
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5835
5794
|
"line",
|
|
5836
5795
|
{
|
|
@@ -5854,7 +5813,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5854
5813
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5855
5814
|
for (let i = 0; i <= steps; i++) {
|
|
5856
5815
|
const val = range.min + range.span * i / steps;
|
|
5857
|
-
const y =
|
|
5816
|
+
const y = chunkPJUQQF3I_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5858
5817
|
labels.push(
|
|
5859
5818
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5860
5819
|
"text",
|
|
@@ -5866,7 +5825,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5866
5825
|
fontFamily,
|
|
5867
5826
|
fontWeight,
|
|
5868
5827
|
fill: fontColor,
|
|
5869
|
-
children: hasDisplayUnits ?
|
|
5828
|
+
children: hasDisplayUnits ? chunkPJUQQF3I_js.formatAxisValueWithUnits(val, axisFormatting) : chunkPJUQQF3I_js.formatAxisValue(val)
|
|
5870
5829
|
},
|
|
5871
5830
|
`${id}-sec-vaxis-${i}`
|
|
5872
5831
|
)
|
|
@@ -5890,7 +5849,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5890
5849
|
);
|
|
5891
5850
|
}
|
|
5892
5851
|
if (hasDisplayUnits) {
|
|
5893
|
-
const unitLabel =
|
|
5852
|
+
const unitLabel = chunkPJUQQF3I_js.getDisplayUnitLabel(
|
|
5894
5853
|
axisFormatting.displayUnits,
|
|
5895
5854
|
axisFormatting.displayUnitsLabel
|
|
5896
5855
|
);
|
|
@@ -5921,7 +5880,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
5921
5880
|
const ticks = [];
|
|
5922
5881
|
for (let i = 0; i <= steps; i++) {
|
|
5923
5882
|
const val = range.min + range.span * i / steps;
|
|
5924
|
-
const y =
|
|
5883
|
+
const y = chunkPJUQQF3I_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5925
5884
|
ticks.push(
|
|
5926
5885
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5927
5886
|
"line",
|
|
@@ -5948,7 +5907,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
5948
5907
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
5949
5908
|
for (let i = 0; i <= steps; i++) {
|
|
5950
5909
|
const val = range.min + range.span * i / steps;
|
|
5951
|
-
const y =
|
|
5910
|
+
const y = chunkPJUQQF3I_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5952
5911
|
lines.push(
|
|
5953
5912
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5954
5913
|
"line",
|
|
@@ -6066,7 +6025,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6066
6025
|
showK && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6067
6026
|
"th",
|
|
6068
6027
|
{
|
|
6069
|
-
"aria-label":
|
|
6028
|
+
"aria-label": chunk3GNSGGY2_js.translationsEn["pptx.chart.rowLabelsAria"],
|
|
6070
6029
|
style: {
|
|
6071
6030
|
padding: "1px 4px",
|
|
6072
6031
|
fontWeight: 400,
|
|
@@ -6110,7 +6069,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6110
6069
|
width: 8,
|
|
6111
6070
|
height: 8,
|
|
6112
6071
|
borderRadius: 2,
|
|
6113
|
-
backgroundColor:
|
|
6072
|
+
backgroundColor: chunkPJUQQF3I_js.seriesColor(
|
|
6114
6073
|
s,
|
|
6115
6074
|
si,
|
|
6116
6075
|
chartData.style?.styleId,
|
|
@@ -6149,8 +6108,8 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6149
6108
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
6150
6109
|
const style = chartData.style;
|
|
6151
6110
|
const legendPos = style?.legendPosition || "b";
|
|
6152
|
-
const range =
|
|
6153
|
-
const layout =
|
|
6111
|
+
const range = chunkPJUQQF3I_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6112
|
+
const layout = chunkPJUQQF3I_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6154
6113
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6155
6114
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
6156
6115
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -6171,10 +6130,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6171
6130
|
const close = closeSeries.values[ci] ?? high;
|
|
6172
6131
|
const isUp = close >= open;
|
|
6173
6132
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
6174
|
-
const highY =
|
|
6175
|
-
const lowY =
|
|
6176
|
-
const openY =
|
|
6177
|
-
const closeY =
|
|
6133
|
+
const highY = chunkPJUQQF3I_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
6134
|
+
const lowY = chunkPJUQQF3I_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
6135
|
+
const openY = chunkPJUQQF3I_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
6136
|
+
const closeY = chunkPJUQQF3I_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
|
|
6178
6137
|
elements.push(
|
|
6179
6138
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6180
6139
|
"line",
|
|
@@ -6217,7 +6176,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6217
6176
|
textAnchor: "middle",
|
|
6218
6177
|
fontSize: 7,
|
|
6219
6178
|
fill: "#334155",
|
|
6220
|
-
children:
|
|
6179
|
+
children: chunkPJUQQF3I_js.formatAxisValue(close)
|
|
6221
6180
|
},
|
|
6222
6181
|
`${element.id}-stock-dl-${ci}`
|
|
6223
6182
|
)
|
|
@@ -6259,7 +6218,7 @@ function FailedToLoad() {
|
|
|
6259
6218
|
var LazySurfaceChart3DScene = React6__default.default.lazy(
|
|
6260
6219
|
async () => {
|
|
6261
6220
|
try {
|
|
6262
|
-
return await import('./SurfaceChart3DScene-
|
|
6221
|
+
return await import('./SurfaceChart3DScene-BIOKIETC.js');
|
|
6263
6222
|
} catch {
|
|
6264
6223
|
return { default: FailedToLoad };
|
|
6265
6224
|
}
|
|
@@ -6283,7 +6242,7 @@ var SurfaceChart3DErrorBoundary = class extends React6__default.default.Componen
|
|
|
6283
6242
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
6284
6243
|
const rows = chartData.series.length;
|
|
6285
6244
|
const cols = Math.max(categoryLabels.length, 1);
|
|
6286
|
-
const range =
|
|
6245
|
+
const range = chunkPJUQQF3I_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6287
6246
|
const heightMap = new Float32Array(rows * cols);
|
|
6288
6247
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
6289
6248
|
for (let r = 0; r < rows; r++) {
|
|
@@ -6403,8 +6362,8 @@ function darkenRgb(r, g, b, factor) {
|
|
|
6403
6362
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
6404
6363
|
const style = chartData.style;
|
|
6405
6364
|
const legendPos = style?.legendPosition || "b";
|
|
6406
|
-
const layout =
|
|
6407
|
-
const range =
|
|
6365
|
+
const layout = chunkPJUQQF3I_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6366
|
+
const range = chunkPJUQQF3I_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6408
6367
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6409
6368
|
const seriesCount = chartData.series.length;
|
|
6410
6369
|
const cols = catCount - 1;
|
|
@@ -6494,8 +6453,8 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6494
6453
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
6495
6454
|
const style = chartData.style;
|
|
6496
6455
|
const legendPos = style?.legendPosition || "b";
|
|
6497
|
-
const layout =
|
|
6498
|
-
const range =
|
|
6456
|
+
const layout = chunkPJUQQF3I_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6457
|
+
const range = chunkPJUQQF3I_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6499
6458
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6500
6459
|
const seriesCount = chartData.series.length;
|
|
6501
6460
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -6558,7 +6517,7 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6558
6517
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
6559
6518
|
const style = chartData.style;
|
|
6560
6519
|
const legendPos = style?.legendPosition || "b";
|
|
6561
|
-
const layout =
|
|
6520
|
+
const layout = chunkPJUQQF3I_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6562
6521
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
6563
6522
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
6564
6523
|
const rects = [];
|
|
@@ -6581,7 +6540,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
6581
6540
|
y: curY,
|
|
6582
6541
|
width: Math.max(w - 1, 1),
|
|
6583
6542
|
height: Math.max(h - 1, 1),
|
|
6584
|
-
fill:
|
|
6543
|
+
fill: chunkPJUQQF3I_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
6585
6544
|
rx: 2,
|
|
6586
6545
|
opacity: 0.85
|
|
6587
6546
|
},
|
|
@@ -6634,8 +6593,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6634
6593
|
const style = chartData.style;
|
|
6635
6594
|
const legendPos = style?.legendPosition || "b";
|
|
6636
6595
|
const values = chartData.series[0]?.values ?? [];
|
|
6637
|
-
const range =
|
|
6638
|
-
const layout =
|
|
6596
|
+
const range = chunkPJUQQF3I_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6597
|
+
const layout = chunkPJUQQF3I_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6639
6598
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
6640
6599
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
6641
6600
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -6646,8 +6605,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6646
6605
|
const isLast = i === values.length - 1;
|
|
6647
6606
|
const startVal = isLast ? 0 : runningTotal;
|
|
6648
6607
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
6649
|
-
const barStartY =
|
|
6650
|
-
const barEndY =
|
|
6608
|
+
const barStartY = chunkPJUQQF3I_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
6609
|
+
const barEndY = chunkPJUQQF3I_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
|
|
6651
6610
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
6652
6611
|
const y = Math.min(barStartY, barEndY);
|
|
6653
6612
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -6676,7 +6635,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6676
6635
|
textAnchor: "middle",
|
|
6677
6636
|
fontSize: 7,
|
|
6678
6637
|
fill: "#334155",
|
|
6679
|
-
children:
|
|
6638
|
+
children: chunkPJUQQF3I_js.formatAxisValue(isLast ? endVal : val)
|
|
6680
6639
|
},
|
|
6681
6640
|
`${element.id}-wf-dl-${i}`
|
|
6682
6641
|
)
|
|
@@ -6724,18 +6683,18 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6724
6683
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
6725
6684
|
const style = chartData.style;
|
|
6726
6685
|
const legendPos = style?.legendPosition || "b";
|
|
6727
|
-
const layoutOpts =
|
|
6686
|
+
const layoutOpts = chunkPJUQQF3I_js.computeLayoutOptions(
|
|
6728
6687
|
chartData.axes,
|
|
6729
6688
|
chartData.dataTable,
|
|
6730
6689
|
chartData.series.length
|
|
6731
6690
|
);
|
|
6732
|
-
const layout =
|
|
6733
|
-
const { primary, secondary } =
|
|
6691
|
+
const layout = chunkPJUQQF3I_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
6692
|
+
const { primary, secondary } = chunkPJUQQF3I_js.splitSeriesByAxis(chartData.series, chartData.axes);
|
|
6734
6693
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
6735
6694
|
const secondarySeries = secondary.map((e) => e.series);
|
|
6736
|
-
const range =
|
|
6737
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
6738
|
-
const secondaryAxisFmt =
|
|
6695
|
+
const range = chunkPJUQQF3I_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
6696
|
+
const secondaryRange = secondarySeries.length > 0 ? chunkPJUQQF3I_js.computeValueRange(secondarySeries) : void 0;
|
|
6697
|
+
const secondaryAxisFmt = chunkPJUQQF3I_js.getSecondaryValueAxis(chartData.axes);
|
|
6739
6698
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6740
6699
|
const barSeriesCount = 1;
|
|
6741
6700
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -6751,8 +6710,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6751
6710
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
6752
6711
|
barSeries.values.forEach((val, vi) => {
|
|
6753
6712
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
6754
|
-
const zeroY =
|
|
6755
|
-
const valY =
|
|
6713
|
+
const zeroY = chunkPJUQQF3I_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
6714
|
+
const valY = chunkPJUQQF3I_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
|
|
6756
6715
|
const y = Math.min(zeroY, valY);
|
|
6757
6716
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
6758
6717
|
barElements.push(
|
|
@@ -6763,7 +6722,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6763
6722
|
y,
|
|
6764
6723
|
width: barWidth,
|
|
6765
6724
|
height: h,
|
|
6766
|
-
fill:
|
|
6725
|
+
fill: chunkPJUQQF3I_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
6767
6726
|
rx: 1
|
|
6768
6727
|
},
|
|
6769
6728
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -6779,7 +6738,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6779
6738
|
textAnchor: "middle",
|
|
6780
6739
|
fontSize: 7,
|
|
6781
6740
|
fill: "#334155",
|
|
6782
|
-
children:
|
|
6741
|
+
children: chunkPJUQQF3I_js.formatAxisValue(val)
|
|
6783
6742
|
},
|
|
6784
6743
|
`${element.id}-combo-bar-dl-${vi}`
|
|
6785
6744
|
)
|
|
@@ -6796,10 +6755,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6796
6755
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
6797
6756
|
const points = series.values.map((val, vi) => {
|
|
6798
6757
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
6799
|
-
const y =
|
|
6758
|
+
const y = chunkPJUQQF3I_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
6800
6759
|
return { x, y, val };
|
|
6801
6760
|
});
|
|
6802
|
-
const c =
|
|
6761
|
+
const c = chunkPJUQQF3I_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
6803
6762
|
lineElements.push(
|
|
6804
6763
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6805
6764
|
"polyline",
|
|
@@ -6826,7 +6785,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6826
6785
|
textAnchor: "middle",
|
|
6827
6786
|
fontSize: 7,
|
|
6828
6787
|
fill: "#334155",
|
|
6829
|
-
children:
|
|
6788
|
+
children: chunkPJUQQF3I_js.formatAxisValue(p.val)
|
|
6830
6789
|
},
|
|
6831
6790
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
6832
6791
|
)
|
|
@@ -6864,11 +6823,11 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6864
6823
|
}
|
|
6865
6824
|
function renderChartElement(element) {
|
|
6866
6825
|
if (element.type !== "chart") {
|
|
6867
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
6826
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunk3GNSGGY2_js.translationsEn["pptx.chart.heading"] });
|
|
6868
6827
|
}
|
|
6869
6828
|
const chartData = element.chartData;
|
|
6870
6829
|
if (!chartData || chartData.series.length === 0) {
|
|
6871
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
6830
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunk3GNSGGY2_js.translationsEn["pptx.chart.heading"] });
|
|
6872
6831
|
}
|
|
6873
6832
|
const longestSeriesLength = chartData.series.reduce(
|
|
6874
6833
|
(maxLength, series) => Math.max(maxLength, series.values.length),
|
|
@@ -7972,14 +7931,14 @@ function buildNotesPdf(pages) {
|
|
|
7972
7931
|
notes: page.notes,
|
|
7973
7932
|
slideNumber: page.slideNumber
|
|
7974
7933
|
}));
|
|
7975
|
-
const bytes =
|
|
7934
|
+
const bytes = chunkPJUQQF3I_js.buildNotesPdfBytes(images, meta);
|
|
7976
7935
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
7977
7936
|
return URL.createObjectURL(blob);
|
|
7978
7937
|
}
|
|
7979
7938
|
|
|
7980
7939
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
7981
7940
|
function buildPdfFromImageData(images) {
|
|
7982
|
-
const bytes =
|
|
7941
|
+
const bytes = chunkPJUQQF3I_js.buildSlidesPdfBytes(images);
|
|
7983
7942
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
7984
7943
|
return URL.createObjectURL(blob);
|
|
7985
7944
|
}
|
|
@@ -7988,7 +7947,7 @@ function buildPdfFromImageData(images) {
|
|
|
7988
7947
|
var activePreview = null;
|
|
7989
7948
|
function startPreviewAnimation(elementId, preset, options) {
|
|
7990
7949
|
stopPreviewAnimation();
|
|
7991
|
-
const descriptor =
|
|
7950
|
+
const descriptor = chunkPJUQQF3I_js.buildPreviewAnimation(preset, options);
|
|
7992
7951
|
if (!descriptor) {
|
|
7993
7952
|
return;
|
|
7994
7953
|
}
|
|
@@ -8001,7 +7960,7 @@ function startMotionPathPreview(elementId, path, options) {
|
|
|
8001
7960
|
return;
|
|
8002
7961
|
}
|
|
8003
7962
|
const stage = domEl.offsetParent;
|
|
8004
|
-
const descriptor =
|
|
7963
|
+
const descriptor = chunkPJUQQF3I_js.buildMotionPathPreview({
|
|
8005
7964
|
path,
|
|
8006
7965
|
slideWidth: stage?.offsetWidth || DEFAULT_PREVIEW_SLIDE_WIDTH,
|
|
8007
7966
|
slideHeight: stage?.offsetHeight || DEFAULT_PREVIEW_SLIDE_HEIGHT,
|