pptx-react-viewer 2.11.0 → 2.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/dist/{AiChatPanel-PJPSDMN4.js → AiChatPanel-E6W3EACA.js} +23 -23
- package/dist/AiChatPanel-E6W3EACA.js.br +0 -0
- package/dist/AiChatPanel-E6W3EACA.js.gz +0 -0
- package/dist/{AiChatPanel-EX2TBRJM.mjs → AiChatPanel-RMQIJDUJ.mjs} +4 -4
- package/dist/AiChatPanel-RMQIJDUJ.mjs.br +0 -0
- package/dist/AiChatPanel-RMQIJDUJ.mjs.gz +0 -0
- package/dist/{Model3DScene-UCBPTEAY.js → Model3DScene-U4B4NZJT.js} +2 -2
- package/dist/Model3DScene-U4B4NZJT.js.br +0 -0
- package/dist/Model3DScene-U4B4NZJT.js.gz +0 -0
- package/dist/{Model3DScene-TTQFV7OS.mjs → Model3DScene-WHSHBMR5.mjs} +1 -1
- package/dist/Model3DScene-WHSHBMR5.mjs.br +0 -0
- package/dist/Model3DScene-WHSHBMR5.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-ADKCYYOQ.js → SurfaceChart3DScene-5S43UBRD.js} +2 -2
- package/dist/SurfaceChart3DScene-5S43UBRD.js.br +0 -0
- package/dist/SurfaceChart3DScene-5S43UBRD.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-5SZCRHZI.mjs → SurfaceChart3DScene-77JP5XH5.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-5SZCRHZI.mjs.br → SurfaceChart3DScene-77JP5XH5.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-77JP5XH5.mjs.gz +0 -0
- package/dist/{chunk-RJEY2KZH.mjs → chunk-DD54KUDG.mjs} +3 -3
- package/dist/chunk-DD54KUDG.mjs.br +0 -0
- package/dist/chunk-DD54KUDG.mjs.gz +0 -0
- package/dist/{chunk-MM5RMRSP.js → chunk-FAP6OPLL.js} +250 -250
- package/dist/chunk-FAP6OPLL.js.br +0 -0
- package/dist/chunk-FAP6OPLL.js.gz +0 -0
- package/dist/{chunk-C2UWTH42.mjs → chunk-FV7HEYCX.mjs} +211 -3
- package/dist/chunk-FV7HEYCX.mjs.br +0 -0
- package/dist/{chunk-C2UWTH42.mjs.gz → chunk-FV7HEYCX.mjs.gz} +0 -0
- package/dist/{chunk-UZVRM6LD.mjs → chunk-HF6L2CTF.mjs} +1 -1
- package/dist/chunk-HF6L2CTF.mjs.br +0 -0
- package/dist/chunk-HF6L2CTF.mjs.gz +0 -0
- package/dist/{chunk-N6IHR6PS.js → chunk-IOVOQ6ZJ.js} +89 -1
- package/dist/chunk-IOVOQ6ZJ.js.br +0 -0
- package/dist/{chunk-N6IHR6PS.js.gz → chunk-IOVOQ6ZJ.js.gz} +0 -0
- package/dist/{chunk-E367QIKR.js → chunk-IXBM3HWH.js} +1109 -1070
- package/dist/chunk-IXBM3HWH.js.br +0 -0
- package/dist/chunk-IXBM3HWH.js.gz +0 -0
- package/dist/{chunk-HMQVOPQH.js → chunk-KDJBWJJH.js} +222 -2
- package/dist/chunk-KDJBWJJH.js.br +0 -0
- package/dist/{chunk-HMQVOPQH.js.gz → chunk-KDJBWJJH.js.gz} +0 -0
- package/dist/{chunk-HK2UERUX.mjs → chunk-NJ4PTG4F.mjs} +30 -28
- package/dist/chunk-NJ4PTG4F.mjs.br +0 -0
- package/dist/chunk-NJ4PTG4F.mjs.gz +0 -0
- package/dist/{chunk-L2CM5EUD.mjs → chunk-PXYZFWDA.mjs} +142 -103
- package/dist/chunk-PXYZFWDA.mjs.br +0 -0
- package/dist/chunk-PXYZFWDA.mjs.gz +0 -0
- package/dist/{chunk-4J7SPY64.js → chunk-QT6BPOZM.js} +352 -350
- package/dist/chunk-QT6BPOZM.js.br +0 -0
- package/dist/chunk-QT6BPOZM.js.gz +0 -0
- package/dist/{chunk-53NXKDMZ.mjs → chunk-RHR7GTDX.mjs} +89 -1
- package/dist/chunk-RHR7GTDX.mjs.br +0 -0
- package/dist/{chunk-53NXKDMZ.mjs.gz → chunk-RHR7GTDX.mjs.gz} +0 -0
- package/dist/{chunk-VNP627O5.js → chunk-X3SFCKAF.js} +3 -3
- package/dist/chunk-X3SFCKAF.js.br +0 -0
- package/dist/chunk-X3SFCKAF.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.d.ts +4 -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.d.ts +12 -1
- package/dist/internals.d.ts.map +1 -1
- 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/{useViewerBuildingBlocks-Rqxm0pRS.d.ts → useViewerBuildingBlocks-YvCYsxa3.d.ts} +5 -1
- package/dist/useViewerBuildingBlocks-YvCYsxa3.d.ts.map +1 -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-EX2TBRJM.mjs.br +0 -0
- package/dist/AiChatPanel-EX2TBRJM.mjs.gz +0 -0
- package/dist/AiChatPanel-PJPSDMN4.js.br +0 -0
- package/dist/AiChatPanel-PJPSDMN4.js.gz +0 -0
- package/dist/Model3DScene-TTQFV7OS.mjs.br +0 -0
- package/dist/Model3DScene-TTQFV7OS.mjs.gz +0 -0
- package/dist/Model3DScene-UCBPTEAY.js.br +0 -0
- package/dist/Model3DScene-UCBPTEAY.js.gz +0 -0
- package/dist/SurfaceChart3DScene-5SZCRHZI.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-ADKCYYOQ.js.br +0 -0
- package/dist/SurfaceChart3DScene-ADKCYYOQ.js.gz +0 -0
- package/dist/chunk-4J7SPY64.js.br +0 -0
- package/dist/chunk-4J7SPY64.js.gz +0 -0
- package/dist/chunk-53NXKDMZ.mjs.br +0 -0
- package/dist/chunk-C2UWTH42.mjs.br +0 -0
- package/dist/chunk-E367QIKR.js.br +0 -0
- package/dist/chunk-E367QIKR.js.gz +0 -0
- package/dist/chunk-HK2UERUX.mjs.br +0 -0
- package/dist/chunk-HK2UERUX.mjs.gz +0 -0
- package/dist/chunk-HMQVOPQH.js.br +0 -0
- package/dist/chunk-L2CM5EUD.mjs.br +0 -0
- package/dist/chunk-L2CM5EUD.mjs.gz +0 -0
- package/dist/chunk-MM5RMRSP.js.br +0 -0
- package/dist/chunk-MM5RMRSP.js.gz +0 -0
- package/dist/chunk-N6IHR6PS.js.br +0 -0
- package/dist/chunk-RJEY2KZH.mjs.br +0 -0
- package/dist/chunk-RJEY2KZH.mjs.gz +0 -0
- package/dist/chunk-UZVRM6LD.mjs.br +0 -0
- package/dist/chunk-UZVRM6LD.mjs.gz +0 -0
- package/dist/chunk-VNP627O5.js.br +0 -0
- package/dist/chunk-VNP627O5.js.gz +0 -0
- package/dist/useViewerBuildingBlocks-Rqxm0pRS.d.ts.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkIOVOQ6ZJ_js = require('./chunk-IOVOQ6ZJ.js');
|
|
4
|
+
var chunkKDJBWJJH_js = require('./chunk-KDJBWJJH.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 chunkKDJBWJJH_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 chunkKDJBWJJH_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 = chunkKDJBWJJH_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 = chunkKDJBWJJH_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 (!chunkKDJBWJJH_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) => chunkKDJBWJJH_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) => !chunkKDJBWJJH_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 (!chunkKDJBWJJH_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 = chunkKDJBWJJH_js.getRoundRectRadiusPx(element);
|
|
311
311
|
if (radiusPx <= 0.01) {
|
|
312
312
|
return void 0;
|
|
313
313
|
}
|
|
@@ -319,7 +319,7 @@ function getImageMaskStyle(element) {
|
|
|
319
319
|
if (normalized === "can" || normalized === "cylinder") {
|
|
320
320
|
return { borderRadius: "48% / 12%" };
|
|
321
321
|
}
|
|
322
|
-
const clipPath =
|
|
322
|
+
const clipPath = chunkKDJBWJJH_js.getResolvedShapeClipPath(element);
|
|
323
323
|
if (!clipPath) {
|
|
324
324
|
return void 0;
|
|
325
325
|
}
|
|
@@ -327,7 +327,7 @@ function getImageMaskStyle(element) {
|
|
|
327
327
|
}
|
|
328
328
|
function getImageRenderStyle(element) {
|
|
329
329
|
const maskStyle = getImageMaskStyle(element) || {};
|
|
330
|
-
if (!
|
|
330
|
+
if (!chunkKDJBWJJH_js.isImageLikeElement(element)) {
|
|
331
331
|
return {
|
|
332
332
|
...maskStyle,
|
|
333
333
|
width: "100%",
|
|
@@ -335,10 +335,10 @@ function getImageRenderStyle(element) {
|
|
|
335
335
|
objectFit: "cover"
|
|
336
336
|
};
|
|
337
337
|
}
|
|
338
|
-
const cropLeft =
|
|
339
|
-
const cropTop =
|
|
340
|
-
const cropRight =
|
|
341
|
-
const cropBottom =
|
|
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
342
|
const hasCrop = cropLeft + cropRight > 1e-4 || cropTop + cropBottom > 1e-4;
|
|
343
343
|
if (!hasCrop) {
|
|
344
344
|
return {
|
|
@@ -350,10 +350,10 @@ function getImageRenderStyle(element) {
|
|
|
350
350
|
}
|
|
351
351
|
const safeHorizontalScale = cropLeft + cropRight >= 0.99 ? 0.99 / (cropLeft + cropRight) : 1;
|
|
352
352
|
const safeVerticalScale = cropTop + cropBottom >= 0.99 ? 0.99 / (cropTop + cropBottom) : 1;
|
|
353
|
-
const normalizedLeft =
|
|
354
|
-
const normalizedRight =
|
|
355
|
-
const normalizedTop =
|
|
356
|
-
const normalizedBottom =
|
|
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
357
|
const remainingWidth = Math.max(0.01, 1 - normalizedLeft - normalizedRight);
|
|
358
358
|
const remainingHeight = Math.max(0.01, 1 - normalizedTop - normalizedBottom);
|
|
359
359
|
const tx = Math.round(-normalizedLeft / remainingWidth * 1e4) / 100;
|
|
@@ -382,7 +382,7 @@ var CROP_SHAPE_CLIP_PATHS = {
|
|
|
382
382
|
star: "polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)"
|
|
383
383
|
};
|
|
384
384
|
function getCropShapeClipPath(element) {
|
|
385
|
-
if (!
|
|
385
|
+
if (!chunkKDJBWJJH_js.isImageLikeElement(element)) {
|
|
386
386
|
return void 0;
|
|
387
387
|
}
|
|
388
388
|
const shape = element.cropShape;
|
|
@@ -392,7 +392,7 @@ function getCropShapeClipPath(element) {
|
|
|
392
392
|
return CROP_SHAPE_CLIP_PATHS[shape];
|
|
393
393
|
}
|
|
394
394
|
function isImageTiled(element) {
|
|
395
|
-
if (!
|
|
395
|
+
if (!chunkKDJBWJJH_js.isImageLikeElement(element)) {
|
|
396
396
|
return false;
|
|
397
397
|
}
|
|
398
398
|
return typeof element.tileScaleX === "number" || typeof element.tileScaleY === "number";
|
|
@@ -450,7 +450,7 @@ function buildMirrorTiledBackground(src, flip, scaleX, scaleY) {
|
|
|
450
450
|
};
|
|
451
451
|
}
|
|
452
452
|
function getImageTilingStyle(element) {
|
|
453
|
-
if (!
|
|
453
|
+
if (!chunkKDJBWJJH_js.isImageLikeElement(element) || !isImageTiled(element)) {
|
|
454
454
|
return void 0;
|
|
455
455
|
}
|
|
456
456
|
const scaleX = typeof element.tileScaleX === "number" ? element.tileScaleX * 100 : 100;
|
|
@@ -730,9 +730,9 @@ function registerMediaElement(elementId, el) {
|
|
|
730
730
|
};
|
|
731
731
|
}
|
|
732
732
|
function executeMediaCommand(command, frameRoot) {
|
|
733
|
-
return
|
|
733
|
+
return chunkKDJBWJJH_js.runMediaCommand(
|
|
734
734
|
command,
|
|
735
|
-
(targetId) => registry.get(targetId) ??
|
|
735
|
+
(targetId) => registry.get(targetId) ?? chunkKDJBWJJH_js.findMediaElementByElementId(targetId, frameRoot?.())
|
|
736
736
|
);
|
|
737
737
|
}
|
|
738
738
|
function PresentationMediaController({
|
|
@@ -966,7 +966,7 @@ function PresentationMediaController({
|
|
|
966
966
|
}
|
|
967
967
|
function renderMediaElement(element, mediaDataUrls, options) {
|
|
968
968
|
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:
|
|
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: chunkIOVOQ6ZJ_js.translationsEn["pptx.media.title"] });
|
|
970
970
|
}
|
|
971
971
|
const mediaType = element.mediaType;
|
|
972
972
|
const mediaPath = element.mediaPath;
|
|
@@ -996,7 +996,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
996
996
|
"img",
|
|
997
997
|
{
|
|
998
998
|
src: posterUrl,
|
|
999
|
-
alt:
|
|
999
|
+
alt: chunkIOVOQ6ZJ_js.translationsEn["pptx.media.posterAlt"],
|
|
1000
1000
|
className: "w-full h-full object-contain opacity-50"
|
|
1001
1001
|
}
|
|
1002
1002
|
),
|
|
@@ -1017,7 +1017,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1017
1017
|
]
|
|
1018
1018
|
}
|
|
1019
1019
|
),
|
|
1020
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children:
|
|
1020
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: chunkIOVOQ6ZJ_js.translationsEn["pptx.media.notFound"] })
|
|
1021
1021
|
] })
|
|
1022
1022
|
] });
|
|
1023
1023
|
}
|
|
@@ -1058,7 +1058,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1058
1058
|
"img",
|
|
1059
1059
|
{
|
|
1060
1060
|
src: posterUrl,
|
|
1061
|
-
alt:
|
|
1061
|
+
alt: chunkIOVOQ6ZJ_js.translationsEn["pptx.media.videoPosterAlt"],
|
|
1062
1062
|
className: "w-full h-full object-contain"
|
|
1063
1063
|
}
|
|
1064
1064
|
),
|
|
@@ -1147,7 +1147,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1147
1147
|
|
|
1148
1148
|
// src/viewer/utils/text-utils.tsx
|
|
1149
1149
|
function getTextStyleForElement(element, fallbackColor) {
|
|
1150
|
-
return
|
|
1150
|
+
return chunkKDJBWJJH_js.buildTextBlockStyle(element, { fallbackColor });
|
|
1151
1151
|
}
|
|
1152
1152
|
|
|
1153
1153
|
// src/viewer/utils/text-layout.tsx
|
|
@@ -1172,13 +1172,13 @@ function computeTabSize(tabStops, defaultTabSize) {
|
|
|
1172
1172
|
return avgGap > 0 ? `${Math.round(avgGap)}px` : fromDefault;
|
|
1173
1173
|
}
|
|
1174
1174
|
function getTextLayoutStyle(element) {
|
|
1175
|
-
if (!
|
|
1175
|
+
if (!chunkKDJBWJJH_js.hasTextProperties(element)) {
|
|
1176
1176
|
return {};
|
|
1177
1177
|
}
|
|
1178
1178
|
const verticalAlign = element.textStyle?.vAlign || "top";
|
|
1179
|
-
const writingMode =
|
|
1180
|
-
const textOrientation =
|
|
1181
|
-
const verticalDirection =
|
|
1179
|
+
const writingMode = chunkKDJBWJJH_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
1180
|
+
const textOrientation = chunkKDJBWJJH_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
1181
|
+
const verticalDirection = chunkKDJBWJJH_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
1182
1182
|
const parsedColumnCount = Number(element.textStyle?.columnCount);
|
|
1183
1183
|
const columnCount = Number.isFinite(parsedColumnCount) ? Math.max(1, Math.min(16, Math.round(parsedColumnCount))) : 1;
|
|
1184
1184
|
const hasColumns = columnCount > 1;
|
|
@@ -1186,7 +1186,7 @@ function getTextLayoutStyle(element) {
|
|
|
1186
1186
|
const tabStops = element.textStyle?.tabStops;
|
|
1187
1187
|
const tabSize = computeTabSize(tabStops, element.textStyle?.defaultTabSize);
|
|
1188
1188
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
1189
|
-
const hasParagraphIndents =
|
|
1189
|
+
const hasParagraphIndents = chunkKDJBWJJH_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
1190
1190
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
1191
1191
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
1192
1192
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
@@ -1195,7 +1195,7 @@ function getTextLayoutStyle(element) {
|
|
|
1195
1195
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
1196
1196
|
const parsedColumnSpacing = Number(element.textStyle?.columnSpacing);
|
|
1197
1197
|
const columnGap = Number.isFinite(parsedColumnSpacing) && parsedColumnSpacing > 0 ? `${parsedColumnSpacing}px` : "0.75em";
|
|
1198
|
-
const kinsokuStyles =
|
|
1198
|
+
const kinsokuStyles = chunkKDJBWJJH_js.getKinsokuLineBreakStyles(element.textStyle);
|
|
1199
1199
|
if (hasColumns) {
|
|
1200
1200
|
return {
|
|
1201
1201
|
display: "block",
|
|
@@ -1242,10 +1242,10 @@ function getTextLayoutStyle(element) {
|
|
|
1242
1242
|
|
|
1243
1243
|
// src/viewer/utils/text-effects.tsx
|
|
1244
1244
|
function buildTextFillCss2(style) {
|
|
1245
|
-
return
|
|
1245
|
+
return chunkKDJBWJJH_js.buildTextFillCss(style);
|
|
1246
1246
|
}
|
|
1247
1247
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
1248
|
-
return
|
|
1248
|
+
return chunkKDJBWJJH_js.buildTextBody3DSceneStyle(textStyle);
|
|
1249
1249
|
}
|
|
1250
1250
|
|
|
1251
1251
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -1430,13 +1430,13 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1430
1430
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
1431
1431
|
return renderedSegments;
|
|
1432
1432
|
}
|
|
1433
|
-
const paraKey = `${elementId}${
|
|
1433
|
+
const paraKey = `${elementId}${chunkKDJBWJJH_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
1434
1434
|
const paraState = subElementAnimStates.get(paraKey);
|
|
1435
1435
|
if (paraState) {
|
|
1436
1436
|
const style = buildAnimStyle(paraState);
|
|
1437
1437
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
1438
1438
|
}
|
|
1439
|
-
const spec =
|
|
1439
|
+
const spec = chunkKDJBWJJH_js.buildTextBuildSpec(
|
|
1440
1440
|
elementId,
|
|
1441
1441
|
paraIndex,
|
|
1442
1442
|
paraSegments.map((entry) => ({ text: entry.segment.text, style: entry })),
|
|
@@ -1454,7 +1454,7 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1454
1454
|
"span",
|
|
1455
1455
|
{
|
|
1456
1456
|
"data-anim-id": span.animId,
|
|
1457
|
-
style:
|
|
1457
|
+
style: chunkKDJBWJJH_js.textBuildSpanStyle(span),
|
|
1458
1458
|
children: content
|
|
1459
1459
|
},
|
|
1460
1460
|
span.animId
|
|
@@ -1598,10 +1598,10 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1598
1598
|
if (!needsScriptFonts || !text) {
|
|
1599
1599
|
return text;
|
|
1600
1600
|
}
|
|
1601
|
-
const runs =
|
|
1601
|
+
const runs = chunkKDJBWJJH_js.segmentByScript(text);
|
|
1602
1602
|
if (runs.length <= 1) {
|
|
1603
1603
|
if (runs.length === 1) {
|
|
1604
|
-
const font =
|
|
1604
|
+
const font = chunkKDJBWJJH_js.resolveFontForScript(runs[0].script, scriptFonts);
|
|
1605
1605
|
if (font && font !== baseFontFamily) {
|
|
1606
1606
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: text });
|
|
1607
1607
|
}
|
|
@@ -1609,7 +1609,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1609
1609
|
return text;
|
|
1610
1610
|
}
|
|
1611
1611
|
return runs.map((run, i) => {
|
|
1612
|
-
const font =
|
|
1612
|
+
const font = chunkKDJBWJJH_js.resolveFontForScript(run.script, scriptFonts);
|
|
1613
1613
|
if (!font || font === baseFontFamily) {
|
|
1614
1614
|
return /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Fragment, { children: run.text }, `${keyPrefix}-r${i}`);
|
|
1615
1615
|
}
|
|
@@ -1681,8 +1681,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1681
1681
|
);
|
|
1682
1682
|
}
|
|
1683
1683
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
1684
|
-
const mathml =
|
|
1685
|
-
const safeMathml = mathml ?
|
|
1684
|
+
const mathml = chunkKDJBWJJH_js.convertOmmlToMathMl(equationXml);
|
|
1685
|
+
const safeMathml = mathml ? chunkKDJBWJJH_js.sanitizeMathMl(mathml) : "";
|
|
1686
1686
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1687
1687
|
"span",
|
|
1688
1688
|
{
|
|
@@ -1692,7 +1692,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1692
1692
|
},
|
|
1693
1693
|
dangerouslySetInnerHTML: { __html: safeMathml }
|
|
1694
1694
|
}
|
|
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:
|
|
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: chunkIOVOQ6ZJ_js.translationsEn["pptx.textSegment.equationFallback"] });
|
|
1696
1696
|
if (equationNumber) {
|
|
1697
1697
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1698
1698
|
"span",
|
|
@@ -1732,7 +1732,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1732
1732
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: equationContent }, `${elementId}-seg-${segmentIndex}`);
|
|
1733
1733
|
}
|
|
1734
1734
|
function renderPictureBullet(elementId, segmentIndex, bulletInfo, baseFontSize) {
|
|
1735
|
-
const picture =
|
|
1735
|
+
const picture = chunkKDJBWJJH_js.resolvePictureBullet(bulletInfo, baseFontSize) ?? {
|
|
1736
1736
|
sizePx: baseFontSize,
|
|
1737
1737
|
fallbackMarker: "\u2022",
|
|
1738
1738
|
accessibleLabel: "Bullet"
|
|
@@ -1783,7 +1783,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1783
1783
|
}
|
|
1784
1784
|
const segmentStyle = segment.style || {};
|
|
1785
1785
|
const rawText = bulletInfo && typeof bulletHangPx === "number" ? (segment.text || "").trimEnd() : segment.text || "";
|
|
1786
|
-
const textValue =
|
|
1786
|
+
const textValue = chunkKDJBWJJH_js.substituteFieldText(rawText, segment.fieldType, fieldContext);
|
|
1787
1787
|
const lines = textValue.split("\n");
|
|
1788
1788
|
const textDecorationTokens = [];
|
|
1789
1789
|
if (segmentStyle.underline || segmentStyle.hyperlink) {
|
|
@@ -1793,8 +1793,8 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1793
1793
|
textDecorationTokens.push("line-through");
|
|
1794
1794
|
}
|
|
1795
1795
|
const isDoubleStrike = segmentStyle.strikethrough && segmentStyle.strikeType === "dblStrike";
|
|
1796
|
-
const resolvedSegmentColor = segmentStyle.hyperlink ?
|
|
1797
|
-
const underlineDecoration =
|
|
1796
|
+
const resolvedSegmentColor = segmentStyle.hyperlink ? chunkKDJBWJJH_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, HYPERLINK_COLOR) : chunkKDJBWJJH_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, fallbackColor);
|
|
1797
|
+
const underlineDecoration = chunkKDJBWJJH_js.resolveUnderlineDecorationStyle(
|
|
1798
1798
|
Boolean(isDoubleStrike),
|
|
1799
1799
|
segmentStyle.underlineStyle
|
|
1800
1800
|
);
|
|
@@ -1804,20 +1804,20 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1804
1804
|
const letterSpacing = typeof segmentStyle.characterSpacing === "number" && segmentStyle.characterSpacing !== 0 ? `${segmentStyle.characterSpacing / 100 * (96 / 72)}px` : void 0;
|
|
1805
1805
|
const textFillStyles = buildTextFillCss2(segmentStyle);
|
|
1806
1806
|
const rawFontSize = segmentStyle.fontSize || element.textStyle?.fontSize || DEFAULT_TEXT_FONT_SIZE;
|
|
1807
|
-
const autoFitScale =
|
|
1807
|
+
const autoFitScale = chunkKDJBWJJH_js.resolveAutoFitFontScale(element.textStyle);
|
|
1808
1808
|
const baseFontSize = rawFontSize * autoFitScale;
|
|
1809
1809
|
const baselineShift = baselineFraction !== 0 ? `${baselineFraction * baseFontSize}px` : void 0;
|
|
1810
1810
|
const baseFontSizePt = baseFontSize * (72 / 96);
|
|
1811
1811
|
const fontKerning = typeof segmentStyle.kerning === "number" ? segmentStyle.kerning === 0 ? "none" : baseFontSizePt >= segmentStyle.kerning / 100 ? "normal" : "none" : void 0;
|
|
1812
1812
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
1813
|
-
const baseFontFamily = rawFontFamily ?
|
|
1813
|
+
const baseFontFamily = rawFontFamily ? chunkKDJBWJJH_js.getSubstituteFontFamily(rawFontFamily) : DEFAULT_FONT_FAMILY;
|
|
1814
1814
|
const scriptFonts = {
|
|
1815
1815
|
latin: baseFontFamily,
|
|
1816
1816
|
eastAsia: segmentStyle.eastAsiaFont || element.textStyle?.eastAsiaFont || baseFontFamily,
|
|
1817
1817
|
complexScript: segmentStyle.complexScriptFont || element.textStyle?.complexScriptFont || baseFontFamily,
|
|
1818
1818
|
symbol: segmentStyle.symbolFont || element.textStyle?.symbolFont || baseFontFamily
|
|
1819
1819
|
};
|
|
1820
|
-
const needsScriptFonts =
|
|
1820
|
+
const needsScriptFonts = chunkKDJBWJJH_js.hasDistinctScriptFonts(scriptFonts);
|
|
1821
1821
|
const spanStyle = {
|
|
1822
1822
|
color: resolvedSegmentColor,
|
|
1823
1823
|
fontSize: baseFontSize * baselineFontScale,
|
|
@@ -1835,15 +1835,15 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1835
1835
|
fontVariantCaps: segmentStyle.textCaps === "small" ? "small-caps" : void 0,
|
|
1836
1836
|
letterSpacing,
|
|
1837
1837
|
fontKerning,
|
|
1838
|
-
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ?
|
|
1838
|
+
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ? chunkKDJBWJJH_js.normalizeHexColor(segmentStyle.highlightColor, "transparent") : void 0,
|
|
1839
1839
|
...textFillStyles,
|
|
1840
|
-
textDecorationColor: segmentStyle.underlineColor ?
|
|
1841
|
-
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${
|
|
1840
|
+
textDecorationColor: segmentStyle.underlineColor ? chunkKDJBWJJH_js.normalizeHexColor(segmentStyle.underlineColor, void 0) : void 0,
|
|
1841
|
+
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${chunkKDJBWJJH_js.normalizeHexColor(segmentStyle.textOutlineColor, "#000000")}` : segmentStyle.textOutlineWidth ? `${segmentStyle.textOutlineWidth}px currentColor` : void 0,
|
|
1842
1842
|
paintOrder: segmentStyle.textOutlineWidth ? "stroke fill" : void 0,
|
|
1843
|
-
textShadow:
|
|
1844
|
-
filter:
|
|
1845
|
-
opacity:
|
|
1846
|
-
WebkitBoxReflect:
|
|
1843
|
+
textShadow: chunkKDJBWJJH_js.buildTextShadowCss(segmentStyle),
|
|
1844
|
+
filter: chunkKDJBWJJH_js.buildTextRunFilterChain(segmentStyle),
|
|
1845
|
+
opacity: chunkKDJBWJJH_js.getTextAlphaOpacity(segmentStyle),
|
|
1846
|
+
WebkitBoxReflect: chunkKDJBWJJH_js.buildTextReflectionCss(segmentStyle)
|
|
1847
1847
|
};
|
|
1848
1848
|
const runRtl = segmentStyle.rtl;
|
|
1849
1849
|
if (runRtl !== void 0 && runRtl !== paragraphRtl) {
|
|
@@ -1863,7 +1863,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1863
1863
|
spanStyle.fontSize = baseFontSize * (bulletInfo.sizePercent / 100) * baselineFontScale;
|
|
1864
1864
|
}
|
|
1865
1865
|
if (bulletInfo.color) {
|
|
1866
|
-
spanStyle.color =
|
|
1866
|
+
spanStyle.color = chunkKDJBWJJH_js.normalizeHexColor(bulletInfo.color, resolvedSegmentColor);
|
|
1867
1867
|
}
|
|
1868
1868
|
if (typeof bulletHangPx === "number" && bulletHangPx > 0) {
|
|
1869
1869
|
spanStyle.display = "inline-block";
|
|
@@ -1908,7 +1908,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1908
1908
|
textAlign: segment.rubyAlignment === "l" ? "left" : segment.rubyAlignment === "r" ? "right" : segment.rubyAlignment === "dist" || segment.rubyAlignment === "distCat" || segment.rubyAlignment === "distLetter" ? "justify" : "center"
|
|
1909
1909
|
};
|
|
1910
1910
|
if (segment.rubyStyle?.color) {
|
|
1911
|
-
rubyStyle.color =
|
|
1911
|
+
rubyStyle.color = chunkKDJBWJJH_js.normalizeHexColor(segment.rubyStyle.color, resolvedSegmentColor);
|
|
1912
1912
|
}
|
|
1913
1913
|
innerContent = /* @__PURE__ */ jsxRuntime.jsxs("ruby", { children: [
|
|
1914
1914
|
baseContent,
|
|
@@ -2003,7 +2003,7 @@ function groupSegmentsIntoParagraphs(segments) {
|
|
|
2003
2003
|
return paragraphs;
|
|
2004
2004
|
}
|
|
2005
2005
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick) {
|
|
2006
|
-
if (!
|
|
2006
|
+
if (!chunkKDJBWJJH_js.hasTextProperties(element)) {
|
|
2007
2007
|
return emptyFallback || null;
|
|
2008
2008
|
}
|
|
2009
2009
|
const effectiveSegments = segmentOverrides ?? element.textSegments;
|
|
@@ -2024,10 +2024,10 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2024
2024
|
return element.text || emptyFallback || "";
|
|
2025
2025
|
}
|
|
2026
2026
|
const paragraphs = groupSegmentsIntoParagraphs(effectiveSegments);
|
|
2027
|
-
const paragraphIndents =
|
|
2028
|
-
const elementRtl =
|
|
2029
|
-
const elementAlign =
|
|
2030
|
-
const bodyStyle =
|
|
2027
|
+
const paragraphIndents = chunkKDJBWJJH_js.hasTextProperties(element) ? element.paragraphIndents : void 0;
|
|
2028
|
+
const elementRtl = chunkKDJBWJJH_js.hasTextProperties(element) ? element.textStyle?.rtl : void 0;
|
|
2029
|
+
const elementAlign = chunkKDJBWJJH_js.hasTextProperties(element) ? element.textStyle?.align : void 0;
|
|
2030
|
+
const bodyStyle = chunkKDJBWJJH_js.hasTextProperties(element) ? element.textStyle : void 0;
|
|
2031
2031
|
const spaceFirstLast = bodyStyle?.spaceFirstLastParagraph !== false;
|
|
2032
2032
|
return paragraphs.map(({ entries: paraSegments, terminator }, paraIndex) => {
|
|
2033
2033
|
const paraIndent = paragraphIndents?.[paraIndex];
|
|
@@ -2042,14 +2042,14 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2042
2042
|
return Boolean(segment.text) && segment.text.trim().length > 0;
|
|
2043
2043
|
});
|
|
2044
2044
|
const hasBullet = bulletInfo && !bulletInfo.none && hasVisibleTextContent;
|
|
2045
|
-
const paraRtl =
|
|
2045
|
+
const paraRtl = chunkKDJBWJJH_js.resolveParagraphRtl(paraSegments, elementRtl);
|
|
2046
2046
|
const isRtlParagraph = paraRtl === true;
|
|
2047
|
-
const paraAlign =
|
|
2048
|
-
const cssTextAlign =
|
|
2047
|
+
const paraAlign = chunkKDJBWJJH_js.resolveParagraphAlign(paraSegments, elementAlign);
|
|
2048
|
+
const cssTextAlign = chunkKDJBWJJH_js.resolveCssTextAlign(paraAlign, isRtlParagraph);
|
|
2049
2049
|
const paraMarginLeft = isRtlParagraph ? void 0 : rawMarginLeft;
|
|
2050
2050
|
const paraMarginRight = isRtlParagraph ? rawMarginLeft : void 0;
|
|
2051
2051
|
const paraTextIndent = rawTextIndent;
|
|
2052
|
-
const paraKinsokuStyle =
|
|
2052
|
+
const paraKinsokuStyle = chunkKDJBWJJH_js.getKinsokuLineBreakStyles(firstSeg?.segment.style);
|
|
2053
2053
|
const hasParaKinsoku = Object.keys(paraKinsokuStyle).length > 0;
|
|
2054
2054
|
const paraProps = effectiveSegments[firstSeg?.globalIndex ?? -1]?.paragraphProperties ?? (paraSegments.length === 0 ? terminator?.paragraphProperties : void 0);
|
|
2055
2055
|
const spacing = resolveParagraphSpacing({
|
|
@@ -2059,7 +2059,7 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2059
2059
|
isLast: paraIndex === paragraphs.length - 1,
|
|
2060
2060
|
spaceFirstLast
|
|
2061
2061
|
});
|
|
2062
|
-
const strutFontSize =
|
|
2062
|
+
const strutFontSize = chunkKDJBWJJH_js.resolveParagraphStrutFontSize(
|
|
2063
2063
|
paraSegments.length > 0 ? paraSegments.map(({ segment }) => segment) : terminator ? [terminator] : [],
|
|
2064
2064
|
bodyStyle?.fontSize
|
|
2065
2065
|
);
|
|
@@ -2163,13 +2163,13 @@ function hexToRgbUnit(hex) {
|
|
|
2163
2163
|
};
|
|
2164
2164
|
}
|
|
2165
2165
|
function getDuotoneColors(element) {
|
|
2166
|
-
if (!
|
|
2166
|
+
if (!chunkKDJBWJJH_js.isImageLikeElement(element)) {
|
|
2167
2167
|
return void 0;
|
|
2168
2168
|
}
|
|
2169
2169
|
return element.imageEffects?.duotone;
|
|
2170
2170
|
}
|
|
2171
2171
|
function buildLineShadowCss(element) {
|
|
2172
|
-
if (!
|
|
2172
|
+
if (!chunkKDJBWJJH_js.hasShapeProperties(element)) {
|
|
2173
2173
|
return void 0;
|
|
2174
2174
|
}
|
|
2175
2175
|
const ss = element.shapeStyle;
|
|
@@ -2180,13 +2180,13 @@ function buildLineShadowCss(element) {
|
|
|
2180
2180
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
2181
2181
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
2182
2182
|
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
|
-
|
|
2183
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkKDJBWJJH_js.colorWithOpacity(
|
|
2184
|
+
chunkKDJBWJJH_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
2185
2185
|
opacity
|
|
2186
2186
|
)}`;
|
|
2187
2187
|
}
|
|
2188
2188
|
function buildLineGlowFilter(element) {
|
|
2189
|
-
if (!
|
|
2189
|
+
if (!chunkKDJBWJJH_js.hasShapeProperties(element)) {
|
|
2190
2190
|
return void 0;
|
|
2191
2191
|
}
|
|
2192
2192
|
const ss = element.shapeStyle;
|
|
@@ -2195,7 +2195,7 @@ function buildLineGlowFilter(element) {
|
|
|
2195
2195
|
}
|
|
2196
2196
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
2197
2197
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
2198
|
-
const glowCol =
|
|
2198
|
+
const glowCol = chunkKDJBWJJH_js.colorWithOpacity(chunkKDJBWJJH_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
2199
2199
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
2200
2200
|
}
|
|
2201
2201
|
function mapDagBlendModeToCss(blend) {
|
|
@@ -2219,7 +2219,7 @@ function getDagDuotoneFilterId(elementId) {
|
|
|
2219
2219
|
return `dag-duotone-${elementId}`;
|
|
2220
2220
|
}
|
|
2221
2221
|
function hasDagDuotoneEffect(element) {
|
|
2222
|
-
if (!
|
|
2222
|
+
if (!chunkKDJBWJJH_js.hasShapeProperties(element)) {
|
|
2223
2223
|
return false;
|
|
2224
2224
|
}
|
|
2225
2225
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
@@ -2282,7 +2282,7 @@ function getRoundRectRadiusPx2(element) {
|
|
|
2282
2282
|
|
|
2283
2283
|
// src/viewer/utils/shape-visual-3d.ts
|
|
2284
2284
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
2285
|
-
return
|
|
2285
|
+
return chunkKDJBWJJH_js.build3DExtrusionData(
|
|
2286
2286
|
shape3d,
|
|
2287
2287
|
scene3d,
|
|
2288
2288
|
fillColor,
|
|
@@ -2291,7 +2291,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
2291
2291
|
);
|
|
2292
2292
|
}
|
|
2293
2293
|
function apply3dEffects2(base, scene3d, shape3d, fillColorFallback) {
|
|
2294
|
-
|
|
2294
|
+
chunkKDJBWJJH_js.apply3dEffects(base, scene3d, shape3d, fillColorFallback);
|
|
2295
2295
|
}
|
|
2296
2296
|
|
|
2297
2297
|
// src/viewer/utils/vector-subpath-paint.ts
|
|
@@ -2300,7 +2300,7 @@ function toHexByte(value) {
|
|
|
2300
2300
|
return clamped.toString(16).padStart(2, "0");
|
|
2301
2301
|
}
|
|
2302
2302
|
function shiftHex(hex, factor, towardsWhite) {
|
|
2303
|
-
const channels =
|
|
2303
|
+
const channels = chunkKDJBWJJH_js.hexToRgbChannels(hex);
|
|
2304
2304
|
if (!channels) {
|
|
2305
2305
|
return hex;
|
|
2306
2306
|
}
|
|
@@ -2326,13 +2326,13 @@ function buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity) {
|
|
|
2326
2326
|
const fillOff = subpath.fillMode === "none" || !hasFill;
|
|
2327
2327
|
return {
|
|
2328
2328
|
d: subpath.d,
|
|
2329
|
-
fill: fillOff ? "none" :
|
|
2329
|
+
fill: fillOff ? "none" : chunkKDJBWJJH_js.colorWithOpacity(adjustFillForMode(fillColor, subpath.fillMode), fillOpacity),
|
|
2330
2330
|
stroked: subpath.stroke !== false
|
|
2331
2331
|
};
|
|
2332
2332
|
});
|
|
2333
2333
|
}
|
|
2334
2334
|
function getStrokeOnlyPresetPaths(element) {
|
|
2335
|
-
if (element.type !== "shape" || !
|
|
2335
|
+
if (element.type !== "shape" || !chunkKDJBWJJH_js.hasShapeProperties(element)) {
|
|
2336
2336
|
return void 0;
|
|
2337
2337
|
}
|
|
2338
2338
|
const shapeType = element.shapeType;
|
|
@@ -2342,7 +2342,7 @@ function getStrokeOnlyPresetPaths(element) {
|
|
|
2342
2342
|
if (element.pathData) {
|
|
2343
2343
|
return void 0;
|
|
2344
2344
|
}
|
|
2345
|
-
const result =
|
|
2345
|
+
const result = chunkKDJBWJJH_js.evaluatePresetShape(
|
|
2346
2346
|
shapeType,
|
|
2347
2347
|
Math.max(element.width, 1),
|
|
2348
2348
|
Math.max(element.height, 1),
|
|
@@ -2360,43 +2360,43 @@ function getGradientTilingCss(style) {
|
|
|
2360
2360
|
if (!style || style.fillMode !== "gradient") {
|
|
2361
2361
|
return void 0;
|
|
2362
2362
|
}
|
|
2363
|
-
const isStructuredLinear = (style.fillGradientType || "linear") === "linear" &&
|
|
2363
|
+
const isStructuredLinear = (style.fillGradientType || "linear") === "linear" && chunkKDJBWJJH_js.sanitizeGradientStops(style.fillGradientStops).length > 0;
|
|
2364
2364
|
if (isStructuredLinear) {
|
|
2365
|
-
const flip =
|
|
2365
|
+
const flip = chunkKDJBWJJH_js.getGradientTileFlipCss(style.fillGradientFlip);
|
|
2366
2366
|
if (flip) {
|
|
2367
2367
|
return flip;
|
|
2368
2368
|
}
|
|
2369
2369
|
}
|
|
2370
|
-
return
|
|
2370
|
+
return chunkKDJBWJJH_js.getGradientTileRectCss(style.fillGradientTileRect);
|
|
2371
2371
|
}
|
|
2372
2372
|
function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2373
|
-
if (!
|
|
2373
|
+
if (!chunkKDJBWJJH_js.hasShapeProperties(element)) {
|
|
2374
2374
|
return {};
|
|
2375
2375
|
}
|
|
2376
2376
|
const normalizedShapeType = getShapeType(element.shapeType);
|
|
2377
|
-
const clipPath =
|
|
2377
|
+
const clipPath = chunkKDJBWJJH_js.getResolvedShapeClipPath(element);
|
|
2378
2378
|
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
2379
|
const rendersStrokeOnlyPreset = Boolean(getStrokeOnlyPresetPaths(element));
|
|
2380
2380
|
const fillOpacity = element.shapeStyle?.fillOpacity;
|
|
2381
2381
|
const strokeOpacity = element.shapeStyle?.strokeOpacity;
|
|
2382
|
-
const strokeDash =
|
|
2383
|
-
const fillGradient =
|
|
2382
|
+
const strokeDash = chunkKDJBWJJH_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2383
|
+
const fillGradient = chunkKDJBWJJH_js.buildCssGradientFromShapeStyle(element.shapeStyle, {
|
|
2384
2384
|
rotation: element.rotation,
|
|
2385
2385
|
width: element.width,
|
|
2386
2386
|
height: element.height
|
|
2387
2387
|
}) || element.shapeStyle?.fillGradient;
|
|
2388
|
-
const shadowCss =
|
|
2389
|
-
const innerShadowCss =
|
|
2390
|
-
const resolvedFillColor =
|
|
2391
|
-
const resolvedStrokeColor =
|
|
2388
|
+
const shadowCss = chunkKDJBWJJH_js.buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
2389
|
+
const innerShadowCss = chunkKDJBWJJH_js.buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
2390
|
+
const resolvedFillColor = chunkKDJBWJJH_js.colorWithOpacity(fillColor, fillOpacity);
|
|
2391
|
+
const resolvedStrokeColor = chunkKDJBWJJH_js.colorWithOpacity(strokeColor, strokeOpacity);
|
|
2392
2392
|
const ss = element.shapeStyle;
|
|
2393
2393
|
const gradientTiling = getGradientTilingCss(ss);
|
|
2394
|
-
const paintsGradientOutline =
|
|
2394
|
+
const paintsGradientOutline = chunkKDJBWJJH_js.suppressesCssBorder(element);
|
|
2395
2395
|
const hasFillOverlayColor = Boolean(
|
|
2396
2396
|
ss?.dagFillOverlayColor && ss.dagFillOverlayColor !== "transparent"
|
|
2397
2397
|
);
|
|
2398
2398
|
const combinedShadowParts = [];
|
|
2399
|
-
const multiLayerShadow =
|
|
2399
|
+
const multiLayerShadow = chunkKDJBWJJH_js.buildMultiLayerShadowCss(element.shapeStyle);
|
|
2400
2400
|
if (multiLayerShadow) {
|
|
2401
2401
|
combinedShadowParts.push(multiLayerShadow);
|
|
2402
2402
|
} else if (shadowCss) {
|
|
@@ -2405,7 +2405,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2405
2405
|
if (innerShadowCss) {
|
|
2406
2406
|
combinedShadowParts.push(innerShadowCss);
|
|
2407
2407
|
}
|
|
2408
|
-
const glowBoxShadow =
|
|
2408
|
+
const glowBoxShadow = chunkKDJBWJJH_js.buildGlowBoxShadow(ss?.glowColor, ss?.glowRadius, ss?.glowOpacity);
|
|
2409
2409
|
if (glowBoxShadow) {
|
|
2410
2410
|
combinedShadowParts.push(glowBoxShadow);
|
|
2411
2411
|
}
|
|
@@ -2413,7 +2413,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2413
2413
|
if (lineShadow) {
|
|
2414
2414
|
combinedShadowParts.push(lineShadow);
|
|
2415
2415
|
}
|
|
2416
|
-
const compoundLineShadow =
|
|
2416
|
+
const compoundLineShadow = chunkKDJBWJJH_js.getCompoundLineBoxShadow(
|
|
2417
2417
|
element.shapeStyle?.compoundLine,
|
|
2418
2418
|
strokeWidth,
|
|
2419
2419
|
resolvedStrokeColor
|
|
@@ -2426,11 +2426,11 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2426
2426
|
if (ss?.glowColor && ss.glowColor !== "transparent" && ss.glowRadius) {
|
|
2427
2427
|
const glowOpacity = typeof ss.glowOpacity === "number" ? ss.glowOpacity : 0.75;
|
|
2428
2428
|
const glowRad = Math.round(Math.max(0, ss.glowRadius));
|
|
2429
|
-
const glowCol =
|
|
2429
|
+
const glowCol = chunkKDJBWJJH_js.colorWithOpacity(chunkKDJBWJJH_js.normalizeHexColor(ss.glowColor, "#ffff00"), glowOpacity);
|
|
2430
2430
|
filterParts.push(`drop-shadow(0 0 ${glowRad}px ${glowCol})`);
|
|
2431
2431
|
}
|
|
2432
2432
|
if (typeof ss?.softEdgeRadius === "number" && ss.softEdgeRadius > 0) {
|
|
2433
|
-
filterParts.push(`url(#${
|
|
2433
|
+
filterParts.push(`url(#${chunkKDJBWJJH_js.getSoftEdgeFilterId(element.id)})`);
|
|
2434
2434
|
}
|
|
2435
2435
|
if (typeof ss?.blurRadius === "number" && ss.blurRadius > 0) {
|
|
2436
2436
|
filterParts.push(`blur(${Math.round(ss.blurRadius)}px)`);
|
|
@@ -2439,13 +2439,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2439
2439
|
if (lineGlowCss) {
|
|
2440
2440
|
filterParts.push(lineGlowCss);
|
|
2441
2441
|
}
|
|
2442
|
-
const dagFilter =
|
|
2442
|
+
const dagFilter = chunkKDJBWJJH_js.getEffectDagFilter(ss, element.id);
|
|
2443
2443
|
if (dagFilter) {
|
|
2444
2444
|
filterParts.push(dagFilter);
|
|
2445
2445
|
}
|
|
2446
2446
|
const lineJoinCss = ss?.lineJoin === "round" ? "round" : ss?.lineJoin === "bevel" ? "bevel" : ss?.lineJoin === "miter" ? "miter" : void 0;
|
|
2447
2447
|
const miterLimitCss = ss?.lineJoin === "miter" && typeof ss?.miterLimit === "number" ? Math.max(ss.miterLimit / 1e5, 1) : void 0;
|
|
2448
|
-
const patternFill =
|
|
2448
|
+
const patternFill = chunkKDJBWJJH_js.buildPatternFillCss(element.shapeStyle);
|
|
2449
2449
|
const imageFillUrl = ss?.fillMode === "image" && ss.fillImageUrl ? ss.fillImageUrl : void 0;
|
|
2450
2450
|
const imageFillMode = ss?.fillImageMode || "stretch";
|
|
2451
2451
|
let reflectCss;
|
|
@@ -2457,7 +2457,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2457
2457
|
const endOpacity = typeof ss.reflectionEndOpacity === "number" ? ss.reflectionEndOpacity : 0;
|
|
2458
2458
|
const fadeLength = typeof ss.reflectionEndPosition === "number" ? Math.round(ss.reflectionEndPosition * Math.max(element.height, 1)) : 100;
|
|
2459
2459
|
const blurRadius = typeof ss.reflectionBlurRadius === "number" ? ss.reflectionBlurRadius : 0;
|
|
2460
|
-
reflectCss =
|
|
2460
|
+
reflectCss = chunkKDJBWJJH_js.buildReflectionCss(distance, startOpacity, endOpacity, fadeLength, blurRadius);
|
|
2461
2461
|
}
|
|
2462
2462
|
}
|
|
2463
2463
|
const base = {
|
|
@@ -2503,9 +2503,9 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2503
2503
|
// path following the shape's geometry, because a CSS border can only take
|
|
2504
2504
|
// one colour. Keeping the border too would draw the parser's averaged
|
|
2505
2505
|
// solid underneath the gradient.
|
|
2506
|
-
borderWidth: strokeWidth > 0 && !paintsGradientOutline ?
|
|
2506
|
+
borderWidth: strokeWidth > 0 && !paintsGradientOutline ? chunkKDJBWJJH_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : 0,
|
|
2507
2507
|
borderColor: strokeWidth > 0 && !paintsGradientOutline ? resolvedStrokeColor : void 0,
|
|
2508
|
-
borderStyle: strokeWidth > 0 && !paintsGradientOutline ?
|
|
2508
|
+
borderStyle: strokeWidth > 0 && !paintsGradientOutline ? chunkKDJBWJJH_js.getCssBorderDashStyle(strokeDash, ss?.compoundLine) : void 0,
|
|
2509
2509
|
strokeLinejoin: lineJoinCss,
|
|
2510
2510
|
strokeMiterlimit: miterLimitCss,
|
|
2511
2511
|
strokeLinecap: ss?.lineCap === "rnd" ? "round" : ss?.lineCap === "sq" ? "square" : ss?.lineCap === "flat" ? "butt" : void 0
|
|
@@ -2561,7 +2561,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2561
2561
|
borderWidth: 0,
|
|
2562
2562
|
borderTopWidth: Math.max(strokeWidth, 2),
|
|
2563
2563
|
borderTopColor: resolvedStrokeColor,
|
|
2564
|
-
borderTopStyle:
|
|
2564
|
+
borderTopStyle: chunkKDJBWJJH_js.getCssBorderDashStyle(strokeDash)
|
|
2565
2565
|
};
|
|
2566
2566
|
}
|
|
2567
2567
|
if (normalizedShapeType === "cylinder") {
|
|
@@ -2575,13 +2575,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2575
2575
|
function getConnectorAdjustment(element, key, fallback) {
|
|
2576
2576
|
const direct = element.shapeAdjustments?.[key];
|
|
2577
2577
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
2578
|
-
return
|
|
2578
|
+
return chunkKDJBWJJH_js.clampUnitInterval(direct / 1e5);
|
|
2579
2579
|
}
|
|
2580
2580
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
2581
2581
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
2582
|
-
return
|
|
2582
|
+
return chunkKDJBWJJH_js.clampUnitInterval(fallbackKey / 1e5);
|
|
2583
2583
|
}
|
|
2584
|
-
return
|
|
2584
|
+
return chunkKDJBWJJH_js.clampUnitInterval(fallback);
|
|
2585
2585
|
}
|
|
2586
2586
|
function getConnectorPathGeometry(element) {
|
|
2587
2587
|
const width = Math.max(element.width, 1);
|
|
@@ -2718,11 +2718,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
|
|
|
2718
2718
|
strokePaint,
|
|
2719
2719
|
strokeWidth,
|
|
2720
2720
|
dashArray,
|
|
2721
|
-
lineCap:
|
|
2721
|
+
lineCap: chunkKDJBWJJH_js.svgLineCap(shapeStyle?.lineCap),
|
|
2722
2722
|
lineJoin,
|
|
2723
2723
|
miterLimit,
|
|
2724
|
-
offsets:
|
|
2725
|
-
widths:
|
|
2724
|
+
offsets: chunkKDJBWJJH_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
2725
|
+
widths: chunkKDJBWJJH_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
|
|
2726
2726
|
};
|
|
2727
2727
|
}
|
|
2728
2728
|
function strokeStrands(d, keyBase, ctx) {
|
|
@@ -2770,9 +2770,9 @@ function gradientDefs(gradient) {
|
|
|
2770
2770
|
}
|
|
2771
2771
|
function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredPaths, shapeStyle, hasFill, fillColor, fillOpacity, strokePaint, strokeWidth, dashArray, animatesFill = false, gradient) {
|
|
2772
2772
|
const ctx = strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray);
|
|
2773
|
-
const subpaths = structuredPaths && structuredPaths.length > 0 ?
|
|
2773
|
+
const subpaths = structuredPaths && structuredPaths.length > 0 ? chunkKDJBWJJH_js.customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
2774
2774
|
const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
|
|
2775
|
-
const gradientPaint = gradient ?
|
|
2775
|
+
const gradientPaint = gradient ? chunkKDJBWJJH_js.svgGradientFillRef(gradient) : void 0;
|
|
2776
2776
|
const nodes = [];
|
|
2777
2777
|
if (subpaths && needsPerSubpath) {
|
|
2778
2778
|
const paints = buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity);
|
|
@@ -2804,7 +2804,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2804
2804
|
"path",
|
|
2805
2805
|
{
|
|
2806
2806
|
d: pathData,
|
|
2807
|
-
fill: animatesFill ? "inherit" : gradientPaint ??
|
|
2807
|
+
fill: animatesFill ? "inherit" : gradientPaint ?? chunkKDJBWJJH_js.colorWithOpacity(fillColor, fillOpacity),
|
|
2808
2808
|
stroke: "none",
|
|
2809
2809
|
vectorEffect: "non-scaling-stroke"
|
|
2810
2810
|
},
|
|
@@ -2849,14 +2849,14 @@ function renderStrokeOnlyPreset(presetPaths, width, height, shapeStyle, strokePa
|
|
|
2849
2849
|
);
|
|
2850
2850
|
}
|
|
2851
2851
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2852
|
-
if (!
|
|
2852
|
+
if (!chunkKDJBWJJH_js.hasShapeProperties(element)) {
|
|
2853
2853
|
return null;
|
|
2854
2854
|
}
|
|
2855
2855
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
2856
|
-
const fillPaint = animatesFill ? "inherit" :
|
|
2857
|
-
const strokePaint = animatesStroke ? "inherit" :
|
|
2858
|
-
const dashType =
|
|
2859
|
-
const dashArray =
|
|
2856
|
+
const fillPaint = animatesFill ? "inherit" : chunkKDJBWJJH_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
2857
|
+
const strokePaint = animatesStroke ? "inherit" : chunkKDJBWJJH_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
2858
|
+
const dashType = chunkKDJBWJJH_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2859
|
+
const dashArray = chunkKDJBWJJH_js.getSvgStrokeDasharray(
|
|
2860
2860
|
dashType,
|
|
2861
2861
|
Math.max(strokeWidth, 1),
|
|
2862
2862
|
element.shapeStyle?.customDashSegments
|
|
@@ -2937,21 +2937,21 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2937
2937
|
// container's `background-image` is suppressed for custom geometry, so
|
|
2938
2938
|
// without this the shape fell back to the parser's representative solid
|
|
2939
2939
|
// and lost every fade (issue #132).
|
|
2940
|
-
|
|
2940
|
+
chunkKDJBWJJH_js.buildSvgGradientDef(element.shapeStyle, element.id)
|
|
2941
2941
|
);
|
|
2942
2942
|
}
|
|
2943
|
-
if (
|
|
2943
|
+
if (chunkKDJBWJJH_js.isCalloutShape(normalizedType)) {
|
|
2944
2944
|
const width = Math.max(element.width, 1);
|
|
2945
2945
|
const height = Math.max(element.height, 1);
|
|
2946
|
-
const geometry =
|
|
2946
|
+
const geometry = chunkKDJBWJJH_js.getCalloutLeaderLineGeometry(
|
|
2947
2947
|
normalizedType,
|
|
2948
2948
|
width,
|
|
2949
2949
|
height,
|
|
2950
2950
|
element.shapeAdjustments
|
|
2951
2951
|
);
|
|
2952
2952
|
if (geometry && geometry.points.length >= 2) {
|
|
2953
|
-
const leaderPath =
|
|
2954
|
-
const bounds =
|
|
2953
|
+
const leaderPath = chunkKDJBWJJH_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
2954
|
+
const bounds = chunkKDJBWJJH_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
2955
2955
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
2956
2956
|
const offsetLeft = bounds.minX;
|
|
2957
2957
|
const offsetTop = bounds.minY;
|
|
@@ -3014,10 +3014,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
3014
3014
|
const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
|
|
3015
3015
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
3016
3016
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
3017
|
-
const connectorLineCap =
|
|
3017
|
+
const connectorLineCap = chunkKDJBWJJH_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
3018
3018
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
3019
|
-
const offsets =
|
|
3020
|
-
const widths =
|
|
3019
|
+
const offsets = chunkKDJBWJJH_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
3020
|
+
const widths = chunkKDJBWJJH_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
3021
3021
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3022
3022
|
"svg",
|
|
3023
3023
|
{
|
|
@@ -3096,15 +3096,15 @@ function parseGradientFillCss(gradFill) {
|
|
|
3096
3096
|
}
|
|
3097
3097
|
const parsed = stops.map((gs) => {
|
|
3098
3098
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
3099
|
-
const color =
|
|
3100
|
-
const opacity =
|
|
3101
|
-
return { pos, color:
|
|
3099
|
+
const color = chunkKDJBWJJH_js.parseDrawingColor(gs) ?? "#888888";
|
|
3100
|
+
const opacity = chunkKDJBWJJH_js.parseDrawingColorOpacity(gs);
|
|
3101
|
+
return { pos, color: chunkKDJBWJJH_js.colorWithOpacity(color, opacity) };
|
|
3102
3102
|
}).sort((a, b) => a.pos - b.pos);
|
|
3103
3103
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
3104
3104
|
const lin = gradFill["a:lin"];
|
|
3105
3105
|
if (lin) {
|
|
3106
3106
|
const angRaw = Number.parseInt(String(lin["@_ang"] || "0"), 10);
|
|
3107
|
-
const angleDeg = Math.round(
|
|
3107
|
+
const angleDeg = Math.round(chunkKDJBWJJH_js.ooxmlGradientAngleToCssDegrees(angRaw / 6e4));
|
|
3108
3108
|
return `linear-gradient(${angleDeg}deg, ${stopStrings})`;
|
|
3109
3109
|
}
|
|
3110
3110
|
const path = gradFill["a:path"];
|
|
@@ -3139,8 +3139,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
3139
3139
|
if (!pattFill) {
|
|
3140
3140
|
return void 0;
|
|
3141
3141
|
}
|
|
3142
|
-
const fgColor =
|
|
3143
|
-
const bgColor =
|
|
3142
|
+
const fgColor = chunkKDJBWJJH_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
3143
|
+
const bgColor = chunkKDJBWJJH_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
3144
3144
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
3145
3145
|
switch (preset) {
|
|
3146
3146
|
case "ltHorz":
|
|
@@ -3251,11 +3251,11 @@ function parseCellBorders(cellProperties) {
|
|
|
3251
3251
|
const prstDash = ln["a:prstDash"];
|
|
3252
3252
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
3253
3253
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
3254
|
-
const color =
|
|
3254
|
+
const color = chunkKDJBWJJH_js.parseDrawingColor(ln["a:solidFill"]);
|
|
3255
3255
|
if (color) {
|
|
3256
|
-
const opacity =
|
|
3256
|
+
const opacity = chunkKDJBWJJH_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
3257
3257
|
const key = `${edge.prefix}`;
|
|
3258
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
3258
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkKDJBWJJH_js.colorWithOpacity(color, opacity)}`;
|
|
3259
3259
|
}
|
|
3260
3260
|
}
|
|
3261
3261
|
return borderStyle;
|
|
@@ -3268,7 +3268,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3268
3268
|
const textShadowParts = [];
|
|
3269
3269
|
const outerShdw = effectLst["a:outerShdw"];
|
|
3270
3270
|
if (outerShdw) {
|
|
3271
|
-
const shdwColor =
|
|
3271
|
+
const shdwColor = chunkKDJBWJJH_js.parseDrawingColor(outerShdw);
|
|
3272
3272
|
if (shdwColor) {
|
|
3273
3273
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
3274
3274
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -3286,7 +3286,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3286
3286
|
}
|
|
3287
3287
|
const glow = effectLst["a:glow"];
|
|
3288
3288
|
if (glow) {
|
|
3289
|
-
const glowColor =
|
|
3289
|
+
const glowColor = chunkKDJBWJJH_js.parseDrawingColor(glow);
|
|
3290
3290
|
if (glowColor) {
|
|
3291
3291
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
3292
3292
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -3365,10 +3365,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3365
3365
|
if (runProps?.["@_u"] !== void 0) {
|
|
3366
3366
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
3367
3367
|
}
|
|
3368
|
-
const runColor =
|
|
3368
|
+
const runColor = chunkKDJBWJJH_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkKDJBWJJH_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
3369
3369
|
if (runColor) {
|
|
3370
|
-
const opacity =
|
|
3371
|
-
cellStyle.color =
|
|
3370
|
+
const opacity = chunkKDJBWJJH_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
3371
|
+
cellStyle.color = chunkKDJBWJJH_js.colorWithOpacity(runColor, opacity);
|
|
3372
3372
|
}
|
|
3373
3373
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
3374
3374
|
if (fontFamily) {
|
|
@@ -3378,15 +3378,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3378
3378
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
3379
3379
|
}
|
|
3380
3380
|
const cellProperties = cellXml["a:tcPr"];
|
|
3381
|
-
const cellFill =
|
|
3381
|
+
const cellFill = chunkKDJBWJJH_js.parseDrawingColor(
|
|
3382
3382
|
cellProperties?.["a:solidFill"],
|
|
3383
3383
|
schemeColorOverrides
|
|
3384
3384
|
);
|
|
3385
3385
|
if (cellFill) {
|
|
3386
|
-
const opacity =
|
|
3386
|
+
const opacity = chunkKDJBWJJH_js.parseDrawingColorOpacity(
|
|
3387
3387
|
cellProperties?.["a:solidFill"]
|
|
3388
3388
|
);
|
|
3389
|
-
cellStyle.backgroundColor =
|
|
3389
|
+
cellStyle.backgroundColor = chunkKDJBWJJH_js.colorWithOpacity(cellFill, opacity);
|
|
3390
3390
|
} else {
|
|
3391
3391
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
3392
3392
|
if (gradCss) {
|
|
@@ -3401,16 +3401,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3401
3401
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
3402
3402
|
Object.assign(cellStyle, edgeBorders);
|
|
3403
3403
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
3404
|
-
const borderColor =
|
|
3404
|
+
const borderColor = chunkKDJBWJJH_js.parseDrawingColor(
|
|
3405
3405
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
3406
3406
|
schemeColorOverrides
|
|
3407
|
-
) ||
|
|
3407
|
+
) || chunkKDJBWJJH_js.parseDrawingColor(
|
|
3408
3408
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
3409
3409
|
schemeColorOverrides
|
|
3410
|
-
) ||
|
|
3410
|
+
) || chunkKDJBWJJH_js.parseDrawingColor(
|
|
3411
3411
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
3412
3412
|
schemeColorOverrides
|
|
3413
|
-
) ||
|
|
3413
|
+
) || chunkKDJBWJJH_js.parseDrawingColor(
|
|
3414
3414
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
3415
3415
|
schemeColorOverrides
|
|
3416
3416
|
);
|
|
@@ -3489,10 +3489,10 @@ function resolveTableStyleFillColor(fill, colorScheme) {
|
|
|
3489
3489
|
}
|
|
3490
3490
|
let color = base;
|
|
3491
3491
|
if (fill.tint !== void 0 && fill.tint > 0) {
|
|
3492
|
-
color =
|
|
3492
|
+
color = chunkKDJBWJJH_js.tintColor2(color, fill.tint / 1e5);
|
|
3493
3493
|
}
|
|
3494
3494
|
if (fill.shade !== void 0 && fill.shade > 0) {
|
|
3495
|
-
color =
|
|
3495
|
+
color = chunkKDJBWJJH_js.shadeColor2(color, 1 - fill.shade / 1e5);
|
|
3496
3496
|
}
|
|
3497
3497
|
return color;
|
|
3498
3498
|
}
|
|
@@ -3517,7 +3517,7 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3517
3517
|
style.fontFamily = text.fontFace;
|
|
3518
3518
|
applied = true;
|
|
3519
3519
|
} else {
|
|
3520
|
-
const refFont =
|
|
3520
|
+
const refFont = chunkKDJBWJJH_js.resolveFontRefIdx(text.fontRefIdx, fontScheme);
|
|
3521
3521
|
if (refFont) {
|
|
3522
3522
|
style.fontFamily = refFont;
|
|
3523
3523
|
applied = true;
|
|
@@ -3528,10 +3528,10 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3528
3528
|
if (base) {
|
|
3529
3529
|
let color = base;
|
|
3530
3530
|
if (text.fontTint !== void 0 && text.fontTint > 0) {
|
|
3531
|
-
color =
|
|
3531
|
+
color = chunkKDJBWJJH_js.tintColor2(color, text.fontTint / 1e5);
|
|
3532
3532
|
}
|
|
3533
3533
|
if (text.fontShade !== void 0 && text.fontShade > 0) {
|
|
3534
|
-
color =
|
|
3534
|
+
color = chunkKDJBWJJH_js.shadeColor2(color, 1 - text.fontShade / 1e5);
|
|
3535
3535
|
}
|
|
3536
3536
|
style.color = color;
|
|
3537
3537
|
applied = true;
|
|
@@ -3720,7 +3720,7 @@ function parseTableElementData(element, fallbackTextStyle) {
|
|
|
3720
3720
|
};
|
|
3721
3721
|
}
|
|
3722
3722
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
3723
|
-
return
|
|
3723
|
+
return chunkKDJBWJJH_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
3724
3724
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
3725
3725
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
3726
3726
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -3868,9 +3868,9 @@ function cellStyleToCss(style) {
|
|
|
3868
3868
|
if (style.gradientFillCss) {
|
|
3869
3869
|
css.background = style.gradientFillCss;
|
|
3870
3870
|
} else if (style.fillMode === "pattern" && style.patternFillPreset) {
|
|
3871
|
-
const fg =
|
|
3872
|
-
const bg =
|
|
3873
|
-
const svgPattern =
|
|
3871
|
+
const fg = chunkKDJBWJJH_js.normalizeHexColor(style.patternFillForeground, "#000000");
|
|
3872
|
+
const bg = chunkKDJBWJJH_js.normalizeHexColor(style.patternFillBackground, "#ffffff");
|
|
3873
|
+
const svgPattern = chunkKDJBWJJH_js.getPatternSvg(style.patternFillPreset, fg, bg);
|
|
3874
3874
|
if (svgPattern) {
|
|
3875
3875
|
const encoded = encodeURIComponent(svgPattern);
|
|
3876
3876
|
css.backgroundImage = `url("data:image/svg+xml,${encoded}")`;
|
|
@@ -3946,7 +3946,7 @@ function cellStyleToCss(style) {
|
|
|
3946
3946
|
if (edge.width || edge.color) {
|
|
3947
3947
|
const w = edge.width ?? 1;
|
|
3948
3948
|
const c = edge.color ?? style.borderColor ?? "#000000";
|
|
3949
|
-
const s =
|
|
3949
|
+
const s = chunkKDJBWJJH_js.ooxmlDashToCssBorderStyle(edge.dash);
|
|
3950
3950
|
css[edge.prefix] = `${w}px ${s} ${c}`;
|
|
3951
3951
|
}
|
|
3952
3952
|
}
|
|
@@ -3977,7 +3977,7 @@ function cellStyleToCss(style) {
|
|
|
3977
3977
|
css.textShadow = textShadowParts.join(", ");
|
|
3978
3978
|
}
|
|
3979
3979
|
if (style.cell3D) {
|
|
3980
|
-
Object.assign(css,
|
|
3980
|
+
Object.assign(css, chunkKDJBWJJH_js.cell3DBevelCss(style.cell3D));
|
|
3981
3981
|
}
|
|
3982
3982
|
return css;
|
|
3983
3983
|
}
|
|
@@ -3991,7 +3991,7 @@ function TableResizeOverlay({
|
|
|
3991
3991
|
const containerRef = React6.useRef(null);
|
|
3992
3992
|
const [rowBounds, setRowBounds] = React6.useState([]);
|
|
3993
3993
|
const dragRef = React6.useRef(null);
|
|
3994
|
-
const colBoundaries = React6.useMemo(() =>
|
|
3994
|
+
const colBoundaries = React6.useMemo(() => chunkKDJBWJJH_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
3995
3995
|
const measureRows = React6.useCallback(() => {
|
|
3996
3996
|
const container = containerRef.current;
|
|
3997
3997
|
if (!container) {
|
|
@@ -4038,11 +4038,11 @@ function TableResizeOverlay({
|
|
|
4038
4038
|
const rect = containerRef.current.getBoundingClientRect();
|
|
4039
4039
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
4040
4040
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
4041
|
-
onResizeColumns(
|
|
4041
|
+
onResizeColumns(chunkKDJBWJJH_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
4042
4042
|
} else if (drag.type === "row" && onResizeRow) {
|
|
4043
4043
|
const deltaY = e.clientY - drag.startPos;
|
|
4044
|
-
const newHeight =
|
|
4045
|
-
drag.initialRowHeight ??
|
|
4044
|
+
const newHeight = chunkKDJBWJJH_js.computeResizedRowHeight(
|
|
4045
|
+
drag.initialRowHeight ?? chunkKDJBWJJH_js.DEFAULT_ROW_HEIGHT,
|
|
4046
4046
|
deltaY
|
|
4047
4047
|
);
|
|
4048
4048
|
onResizeRow(drag.index, newHeight);
|
|
@@ -4080,7 +4080,7 @@ function TableResizeOverlay({
|
|
|
4080
4080
|
e.stopPropagation();
|
|
4081
4081
|
const table = containerRef.current?.querySelector("table");
|
|
4082
4082
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
4083
|
-
const actualHeight = tr?.offsetHeight ??
|
|
4083
|
+
const actualHeight = tr?.offsetHeight ?? chunkKDJBWJJH_js.DEFAULT_ROW_HEIGHT;
|
|
4084
4084
|
document.body.style.cursor = "row-resize";
|
|
4085
4085
|
document.body.style.userSelect = "none";
|
|
4086
4086
|
dragRef.current = {
|
|
@@ -4128,7 +4128,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4128
4128
|
}
|
|
4129
4129
|
const first = selectedCell.selectedCells[0];
|
|
4130
4130
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4131
|
-
return
|
|
4131
|
+
return chunkKDJBWJJH_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
4132
4132
|
})();
|
|
4133
4133
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4134
4134
|
TableResizeOverlay,
|
|
@@ -4161,7 +4161,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4161
4161
|
return null;
|
|
4162
4162
|
}
|
|
4163
4163
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
4164
|
-
const isInMultiSelection =
|
|
4164
|
+
const isInMultiSelection = chunkKDJBWJJH_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
4165
4165
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
4166
4166
|
const diag = getCellDiagonalBorders2(
|
|
4167
4167
|
cell.style,
|
|
@@ -4191,7 +4191,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4191
4191
|
}
|
|
4192
4192
|
event.stopPropagation();
|
|
4193
4193
|
if (event.shiftKey && selectedCell) {
|
|
4194
|
-
const rect =
|
|
4194
|
+
const rect = chunkKDJBWJJH_js.computeSelectionRect(
|
|
4195
4195
|
selectedCell.rowIndex,
|
|
4196
4196
|
selectedCell.columnIndex,
|
|
4197
4197
|
rowIndex,
|
|
@@ -4201,7 +4201,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4201
4201
|
options?.onSelectCell?.({
|
|
4202
4202
|
rowIndex: selectedCell.rowIndex,
|
|
4203
4203
|
columnIndex: selectedCell.columnIndex,
|
|
4204
|
-
selectedCells:
|
|
4204
|
+
selectedCells: chunkKDJBWJJH_js.rectToCells(rect)
|
|
4205
4205
|
});
|
|
4206
4206
|
} else {
|
|
4207
4207
|
options?.onSelectCell?.({
|
|
@@ -4263,7 +4263,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4263
4263
|
if (tableEl2.tableData && tableEl2.tableData.rows.length > 0) {
|
|
4264
4264
|
return renderTableFromTableData(tableEl2, textStyle, options);
|
|
4265
4265
|
}
|
|
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:
|
|
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: chunkIOVOQ6ZJ_js.translationsEn["pptx.table.title"] });
|
|
4267
4267
|
}
|
|
4268
4268
|
const selectedCell = options?.selectedCell || null;
|
|
4269
4269
|
const isEditable = Boolean(options?.editable);
|
|
@@ -4278,7 +4278,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4278
4278
|
}
|
|
4279
4279
|
const first = selectedCell.selectedCells[0];
|
|
4280
4280
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4281
|
-
return
|
|
4281
|
+
return chunkKDJBWJJH_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
4282
4282
|
})();
|
|
4283
4283
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
4284
4284
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4355,7 +4355,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4355
4355
|
"border px-1 py-0.5 align-top",
|
|
4356
4356
|
isEditable && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
4357
4357
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
4358
|
-
|
|
4358
|
+
chunkKDJBWJJH_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
4359
|
),
|
|
4360
4360
|
colSpan,
|
|
4361
4361
|
rowSpan: rSpan,
|
|
@@ -4366,7 +4366,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4366
4366
|
}
|
|
4367
4367
|
event.stopPropagation();
|
|
4368
4368
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
4369
|
-
const rect =
|
|
4369
|
+
const rect = chunkKDJBWJJH_js.computeSelectionRect(
|
|
4370
4370
|
selectedCell.rowIndex,
|
|
4371
4371
|
selectedCell.columnIndex,
|
|
4372
4372
|
rowIndex,
|
|
@@ -4376,7 +4376,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4376
4376
|
options?.onSelectCell?.({
|
|
4377
4377
|
rowIndex: selectedCell.rowIndex,
|
|
4378
4378
|
columnIndex: selectedCell.columnIndex,
|
|
4379
|
-
selectedCells:
|
|
4379
|
+
selectedCells: chunkKDJBWJJH_js.rectToCells(rect)
|
|
4380
4380
|
});
|
|
4381
4381
|
} else {
|
|
4382
4382
|
options?.onSelectCell?.({
|
|
@@ -4431,24 +4431,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4431
4431
|
}
|
|
4432
4432
|
var LEGEND_ITEM_WIDTH = 80;
|
|
4433
4433
|
function partAttrs(part) {
|
|
4434
|
-
return part ?
|
|
4434
|
+
return part ? chunkKDJBWJJH_js.chartPartToAttrs(part) : void 0;
|
|
4435
4435
|
}
|
|
4436
4436
|
function resolveReactPalette(chartData) {
|
|
4437
4437
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
4438
4438
|
return chartData.colorPalette;
|
|
4439
4439
|
}
|
|
4440
|
-
return [...
|
|
4440
|
+
return [...chunkKDJBWJJH_js.getChartStylePalette(chartData.style?.styleId)];
|
|
4441
4441
|
}
|
|
4442
4442
|
function buildReactChartViewModel(element) {
|
|
4443
4443
|
if (element.type !== "chart" || !element.chartData) {
|
|
4444
|
-
return
|
|
4444
|
+
return chunkKDJBWJJH_js.buildChartViewModel(element);
|
|
4445
4445
|
}
|
|
4446
4446
|
const palette = resolveReactPalette(element.chartData);
|
|
4447
4447
|
const themedElement = {
|
|
4448
4448
|
...element,
|
|
4449
4449
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
4450
4450
|
};
|
|
4451
|
-
return
|
|
4451
|
+
return chunkKDJBWJJH_js.buildChartViewModel(themedElement);
|
|
4452
4452
|
}
|
|
4453
4453
|
function renderPrimitive(prim, key) {
|
|
4454
4454
|
switch (prim.kind) {
|
|
@@ -4837,7 +4837,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4837
4837
|
const unmatchedRows = [];
|
|
4838
4838
|
categories.forEach((cat, i) => {
|
|
4839
4839
|
const value = values[i] ?? 0;
|
|
4840
|
-
const code =
|
|
4840
|
+
const code = chunkKDJBWJJH_js.resolveRegionCode(cat);
|
|
4841
4841
|
if (code) {
|
|
4842
4842
|
regionValueMap.set(code, { value, label: cat });
|
|
4843
4843
|
} else {
|
|
@@ -4875,8 +4875,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4875
4875
|
let fill = "#e2e8f0";
|
|
4876
4876
|
let dataLabel = null;
|
|
4877
4877
|
if (entry) {
|
|
4878
|
-
const t =
|
|
4879
|
-
fill =
|
|
4878
|
+
const t = chunkKDJBWJJH_js.normalizeValue(entry.value, minVal, maxVal);
|
|
4879
|
+
fill = chunkKDJBWJJH_js.sequentialColorScale(t);
|
|
4880
4880
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
4881
4881
|
"text",
|
|
4882
4882
|
{
|
|
@@ -4887,7 +4887,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4887
4887
|
fontWeight: 600,
|
|
4888
4888
|
fill: "#1e293b",
|
|
4889
4889
|
style: { pointerEvents: "none" },
|
|
4890
|
-
children:
|
|
4890
|
+
children: chunkKDJBWJJH_js.formatAxisValue(entry.value)
|
|
4891
4891
|
},
|
|
4892
4892
|
`${element.id}-map-dl-${region.code}`
|
|
4893
4893
|
);
|
|
@@ -4905,7 +4905,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4905
4905
|
opacity: 0.9,
|
|
4906
4906
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
4907
4907
|
region.name,
|
|
4908
|
-
entry ? `: ${
|
|
4908
|
+
entry ? `: ${chunkKDJBWJJH_js.formatAxisValue(entry.value)}` : ""
|
|
4909
4909
|
] })
|
|
4910
4910
|
}
|
|
4911
4911
|
),
|
|
@@ -4943,7 +4943,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4943
4943
|
fontSize: 7,
|
|
4944
4944
|
fill: "#64748b",
|
|
4945
4945
|
textAnchor: "middle",
|
|
4946
|
-
children:
|
|
4946
|
+
children: chunkKDJBWJJH_js.formatAxisValue(minVal)
|
|
4947
4947
|
},
|
|
4948
4948
|
`${element.id}-map-legend-min`
|
|
4949
4949
|
),
|
|
@@ -4955,7 +4955,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4955
4955
|
fontSize: 7,
|
|
4956
4956
|
fill: "#64748b",
|
|
4957
4957
|
textAnchor: "middle",
|
|
4958
|
-
children:
|
|
4958
|
+
children: chunkKDJBWJJH_js.formatAxisValue(maxVal)
|
|
4959
4959
|
},
|
|
4960
4960
|
`${element.id}-map-legend-max`
|
|
4961
4961
|
)
|
|
@@ -4974,7 +4974,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4974
4974
|
textAnchor: "middle",
|
|
4975
4975
|
fontSize: 7,
|
|
4976
4976
|
fill: "#94a3b8",
|
|
4977
|
-
children:
|
|
4977
|
+
children: chunkIOVOQ6ZJ_js.translationsEn["pptx.chart.additionalRegionsFallback"]
|
|
4978
4978
|
},
|
|
4979
4979
|
`${element.id}-map-ft-hdr`
|
|
4980
4980
|
)
|
|
@@ -5021,7 +5021,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
5021
5021
|
y,
|
|
5022
5022
|
fontSize,
|
|
5023
5023
|
fill: "#475569",
|
|
5024
|
-
children:
|
|
5024
|
+
children: chunkKDJBWJJH_js.formatAxisValue(row.value)
|
|
5025
5025
|
},
|
|
5026
5026
|
`${element.id}-map-ft-val-${i}`
|
|
5027
5027
|
)
|
|
@@ -5092,7 +5092,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
5092
5092
|
|
|
5093
5093
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
5094
5094
|
function sColor(series, idx) {
|
|
5095
|
-
return
|
|
5095
|
+
return chunkKDJBWJJH_js.seriesColor(series, idx);
|
|
5096
5096
|
}
|
|
5097
5097
|
function valToY(val, range, topY, bottomY) {
|
|
5098
5098
|
const usable = bottomY - topY;
|
|
@@ -5631,7 +5631,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5631
5631
|
width: 10,
|
|
5632
5632
|
height: 10,
|
|
5633
5633
|
rx: 2,
|
|
5634
|
-
fill:
|
|
5634
|
+
fill: chunkKDJBWJJH_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5635
5635
|
},
|
|
5636
5636
|
`${id}-leg-r-${i}`
|
|
5637
5637
|
)
|
|
@@ -5655,7 +5655,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5655
5655
|
width: 10,
|
|
5656
5656
|
height: 10,
|
|
5657
5657
|
rx: 2,
|
|
5658
|
-
fill:
|
|
5658
|
+
fill: chunkKDJBWJJH_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5659
5659
|
}
|
|
5660
5660
|
),
|
|
5661
5661
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -5668,9 +5668,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5668
5668
|
}
|
|
5669
5669
|
const lines = [];
|
|
5670
5670
|
if (range.logScale && range.logBase) {
|
|
5671
|
-
const ticks =
|
|
5671
|
+
const ticks = chunkKDJBWJJH_js.generateLogTicks(range);
|
|
5672
5672
|
ticks.forEach((tickVal, i) => {
|
|
5673
|
-
const y =
|
|
5673
|
+
const y = chunkKDJBWJJH_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5674
5674
|
lines.push(
|
|
5675
5675
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5676
5676
|
"line",
|
|
@@ -5691,7 +5691,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5691
5691
|
const steps = 4;
|
|
5692
5692
|
for (let i = 0; i <= steps; i++) {
|
|
5693
5693
|
const val = range.min + range.span * i / steps;
|
|
5694
|
-
const y =
|
|
5694
|
+
const y = chunkKDJBWJJH_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5695
5695
|
lines.push(
|
|
5696
5696
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5697
5697
|
"line",
|
|
@@ -5715,9 +5715,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5715
5715
|
const labels = [];
|
|
5716
5716
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5717
5717
|
if (range.logScale && range.logBase) {
|
|
5718
|
-
const ticks =
|
|
5718
|
+
const ticks = chunkKDJBWJJH_js.generateLogTicks(range);
|
|
5719
5719
|
ticks.forEach((tickVal, i) => {
|
|
5720
|
-
const y =
|
|
5720
|
+
const y = chunkKDJBWJJH_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5721
5721
|
labels.push(
|
|
5722
5722
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5723
5723
|
"text",
|
|
@@ -5727,7 +5727,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5727
5727
|
textAnchor: "end",
|
|
5728
5728
|
fontSize: 8,
|
|
5729
5729
|
fill: "#64748b",
|
|
5730
|
-
children: hasDisplayUnits ?
|
|
5730
|
+
children: hasDisplayUnits ? chunkKDJBWJJH_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunkKDJBWJJH_js.formatAxisValue(tickVal)
|
|
5731
5731
|
},
|
|
5732
5732
|
`${id}-vaxis-log-${i}`
|
|
5733
5733
|
)
|
|
@@ -5737,7 +5737,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5737
5737
|
const steps = 4;
|
|
5738
5738
|
for (let i = 0; i <= steps; i++) {
|
|
5739
5739
|
const val = range.min + range.span * i / steps;
|
|
5740
|
-
const y =
|
|
5740
|
+
const y = chunkKDJBWJJH_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5741
5741
|
labels.push(
|
|
5742
5742
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5743
5743
|
"text",
|
|
@@ -5747,7 +5747,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5747
5747
|
textAnchor: "end",
|
|
5748
5748
|
fontSize: 8,
|
|
5749
5749
|
fill: "#64748b",
|
|
5750
|
-
children: hasDisplayUnits ?
|
|
5750
|
+
children: hasDisplayUnits ? chunkKDJBWJJH_js.formatAxisValueWithUnits(val, axisFormatting) : chunkKDJBWJJH_js.formatAxisValue(val)
|
|
5751
5751
|
},
|
|
5752
5752
|
`${id}-vaxis-${i}`
|
|
5753
5753
|
)
|
|
@@ -5755,7 +5755,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5755
5755
|
}
|
|
5756
5756
|
}
|
|
5757
5757
|
if (hasDisplayUnits) {
|
|
5758
|
-
const unitLabel =
|
|
5758
|
+
const unitLabel = chunkKDJBWJJH_js.getDisplayUnitLabel(
|
|
5759
5759
|
axisFormatting.displayUnits,
|
|
5760
5760
|
axisFormatting.displayUnitsLabel
|
|
5761
5761
|
);
|
|
@@ -5830,7 +5830,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
5830
5830
|
if (range.min >= 0) {
|
|
5831
5831
|
return null;
|
|
5832
5832
|
}
|
|
5833
|
-
const y =
|
|
5833
|
+
const y = chunkKDJBWJJH_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
5834
5834
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5835
5835
|
"line",
|
|
5836
5836
|
{
|
|
@@ -5854,7 +5854,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5854
5854
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5855
5855
|
for (let i = 0; i <= steps; i++) {
|
|
5856
5856
|
const val = range.min + range.span * i / steps;
|
|
5857
|
-
const y =
|
|
5857
|
+
const y = chunkKDJBWJJH_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5858
5858
|
labels.push(
|
|
5859
5859
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5860
5860
|
"text",
|
|
@@ -5866,7 +5866,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5866
5866
|
fontFamily,
|
|
5867
5867
|
fontWeight,
|
|
5868
5868
|
fill: fontColor,
|
|
5869
|
-
children: hasDisplayUnits ?
|
|
5869
|
+
children: hasDisplayUnits ? chunkKDJBWJJH_js.formatAxisValueWithUnits(val, axisFormatting) : chunkKDJBWJJH_js.formatAxisValue(val)
|
|
5870
5870
|
},
|
|
5871
5871
|
`${id}-sec-vaxis-${i}`
|
|
5872
5872
|
)
|
|
@@ -5890,7 +5890,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5890
5890
|
);
|
|
5891
5891
|
}
|
|
5892
5892
|
if (hasDisplayUnits) {
|
|
5893
|
-
const unitLabel =
|
|
5893
|
+
const unitLabel = chunkKDJBWJJH_js.getDisplayUnitLabel(
|
|
5894
5894
|
axisFormatting.displayUnits,
|
|
5895
5895
|
axisFormatting.displayUnitsLabel
|
|
5896
5896
|
);
|
|
@@ -5921,7 +5921,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
5921
5921
|
const ticks = [];
|
|
5922
5922
|
for (let i = 0; i <= steps; i++) {
|
|
5923
5923
|
const val = range.min + range.span * i / steps;
|
|
5924
|
-
const y =
|
|
5924
|
+
const y = chunkKDJBWJJH_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5925
5925
|
ticks.push(
|
|
5926
5926
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5927
5927
|
"line",
|
|
@@ -5948,7 +5948,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
5948
5948
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
5949
5949
|
for (let i = 0; i <= steps; i++) {
|
|
5950
5950
|
const val = range.min + range.span * i / steps;
|
|
5951
|
-
const y =
|
|
5951
|
+
const y = chunkKDJBWJJH_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5952
5952
|
lines.push(
|
|
5953
5953
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5954
5954
|
"line",
|
|
@@ -6066,7 +6066,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6066
6066
|
showK && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6067
6067
|
"th",
|
|
6068
6068
|
{
|
|
6069
|
-
"aria-label":
|
|
6069
|
+
"aria-label": chunkIOVOQ6ZJ_js.translationsEn["pptx.chart.rowLabelsAria"],
|
|
6070
6070
|
style: {
|
|
6071
6071
|
padding: "1px 4px",
|
|
6072
6072
|
fontWeight: 400,
|
|
@@ -6110,7 +6110,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6110
6110
|
width: 8,
|
|
6111
6111
|
height: 8,
|
|
6112
6112
|
borderRadius: 2,
|
|
6113
|
-
backgroundColor:
|
|
6113
|
+
backgroundColor: chunkKDJBWJJH_js.seriesColor(
|
|
6114
6114
|
s,
|
|
6115
6115
|
si,
|
|
6116
6116
|
chartData.style?.styleId,
|
|
@@ -6149,8 +6149,8 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6149
6149
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
6150
6150
|
const style = chartData.style;
|
|
6151
6151
|
const legendPos = style?.legendPosition || "b";
|
|
6152
|
-
const range =
|
|
6153
|
-
const layout =
|
|
6152
|
+
const range = chunkKDJBWJJH_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6153
|
+
const layout = chunkKDJBWJJH_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6154
6154
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6155
6155
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
6156
6156
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -6171,10 +6171,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6171
6171
|
const close = closeSeries.values[ci] ?? high;
|
|
6172
6172
|
const isUp = close >= open;
|
|
6173
6173
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
6174
|
-
const highY =
|
|
6175
|
-
const lowY =
|
|
6176
|
-
const openY =
|
|
6177
|
-
const closeY =
|
|
6174
|
+
const highY = chunkKDJBWJJH_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
6175
|
+
const lowY = chunkKDJBWJJH_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
6176
|
+
const openY = chunkKDJBWJJH_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
6177
|
+
const closeY = chunkKDJBWJJH_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
|
|
6178
6178
|
elements.push(
|
|
6179
6179
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6180
6180
|
"line",
|
|
@@ -6217,7 +6217,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6217
6217
|
textAnchor: "middle",
|
|
6218
6218
|
fontSize: 7,
|
|
6219
6219
|
fill: "#334155",
|
|
6220
|
-
children:
|
|
6220
|
+
children: chunkKDJBWJJH_js.formatAxisValue(close)
|
|
6221
6221
|
},
|
|
6222
6222
|
`${element.id}-stock-dl-${ci}`
|
|
6223
6223
|
)
|
|
@@ -6259,7 +6259,7 @@ function FailedToLoad() {
|
|
|
6259
6259
|
var LazySurfaceChart3DScene = React6__default.default.lazy(
|
|
6260
6260
|
async () => {
|
|
6261
6261
|
try {
|
|
6262
|
-
return await import('./SurfaceChart3DScene-
|
|
6262
|
+
return await import('./SurfaceChart3DScene-5S43UBRD.js');
|
|
6263
6263
|
} catch {
|
|
6264
6264
|
return { default: FailedToLoad };
|
|
6265
6265
|
}
|
|
@@ -6283,7 +6283,7 @@ var SurfaceChart3DErrorBoundary = class extends React6__default.default.Componen
|
|
|
6283
6283
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
6284
6284
|
const rows = chartData.series.length;
|
|
6285
6285
|
const cols = Math.max(categoryLabels.length, 1);
|
|
6286
|
-
const range =
|
|
6286
|
+
const range = chunkKDJBWJJH_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6287
6287
|
const heightMap = new Float32Array(rows * cols);
|
|
6288
6288
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
6289
6289
|
for (let r = 0; r < rows; r++) {
|
|
@@ -6403,8 +6403,8 @@ function darkenRgb(r, g, b, factor) {
|
|
|
6403
6403
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
6404
6404
|
const style = chartData.style;
|
|
6405
6405
|
const legendPos = style?.legendPosition || "b";
|
|
6406
|
-
const layout =
|
|
6407
|
-
const range =
|
|
6406
|
+
const layout = chunkKDJBWJJH_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6407
|
+
const range = chunkKDJBWJJH_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6408
6408
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6409
6409
|
const seriesCount = chartData.series.length;
|
|
6410
6410
|
const cols = catCount - 1;
|
|
@@ -6494,8 +6494,8 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6494
6494
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
6495
6495
|
const style = chartData.style;
|
|
6496
6496
|
const legendPos = style?.legendPosition || "b";
|
|
6497
|
-
const layout =
|
|
6498
|
-
const range =
|
|
6497
|
+
const layout = chunkKDJBWJJH_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6498
|
+
const range = chunkKDJBWJJH_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6499
6499
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6500
6500
|
const seriesCount = chartData.series.length;
|
|
6501
6501
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -6558,7 +6558,7 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6558
6558
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
6559
6559
|
const style = chartData.style;
|
|
6560
6560
|
const legendPos = style?.legendPosition || "b";
|
|
6561
|
-
const layout =
|
|
6561
|
+
const layout = chunkKDJBWJJH_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6562
6562
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
6563
6563
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
6564
6564
|
const rects = [];
|
|
@@ -6581,7 +6581,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
6581
6581
|
y: curY,
|
|
6582
6582
|
width: Math.max(w - 1, 1),
|
|
6583
6583
|
height: Math.max(h - 1, 1),
|
|
6584
|
-
fill:
|
|
6584
|
+
fill: chunkKDJBWJJH_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
6585
6585
|
rx: 2,
|
|
6586
6586
|
opacity: 0.85
|
|
6587
6587
|
},
|
|
@@ -6634,8 +6634,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6634
6634
|
const style = chartData.style;
|
|
6635
6635
|
const legendPos = style?.legendPosition || "b";
|
|
6636
6636
|
const values = chartData.series[0]?.values ?? [];
|
|
6637
|
-
const range =
|
|
6638
|
-
const layout =
|
|
6637
|
+
const range = chunkKDJBWJJH_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6638
|
+
const layout = chunkKDJBWJJH_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6639
6639
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
6640
6640
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
6641
6641
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -6646,8 +6646,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6646
6646
|
const isLast = i === values.length - 1;
|
|
6647
6647
|
const startVal = isLast ? 0 : runningTotal;
|
|
6648
6648
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
6649
|
-
const barStartY =
|
|
6650
|
-
const barEndY =
|
|
6649
|
+
const barStartY = chunkKDJBWJJH_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
6650
|
+
const barEndY = chunkKDJBWJJH_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
|
|
6651
6651
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
6652
6652
|
const y = Math.min(barStartY, barEndY);
|
|
6653
6653
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -6676,7 +6676,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6676
6676
|
textAnchor: "middle",
|
|
6677
6677
|
fontSize: 7,
|
|
6678
6678
|
fill: "#334155",
|
|
6679
|
-
children:
|
|
6679
|
+
children: chunkKDJBWJJH_js.formatAxisValue(isLast ? endVal : val)
|
|
6680
6680
|
},
|
|
6681
6681
|
`${element.id}-wf-dl-${i}`
|
|
6682
6682
|
)
|
|
@@ -6724,18 +6724,18 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6724
6724
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
6725
6725
|
const style = chartData.style;
|
|
6726
6726
|
const legendPos = style?.legendPosition || "b";
|
|
6727
|
-
const layoutOpts =
|
|
6727
|
+
const layoutOpts = chunkKDJBWJJH_js.computeLayoutOptions(
|
|
6728
6728
|
chartData.axes,
|
|
6729
6729
|
chartData.dataTable,
|
|
6730
6730
|
chartData.series.length
|
|
6731
6731
|
);
|
|
6732
|
-
const layout =
|
|
6733
|
-
const { primary, secondary } =
|
|
6732
|
+
const layout = chunkKDJBWJJH_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
6733
|
+
const { primary, secondary } = chunkKDJBWJJH_js.splitSeriesByAxis(chartData.series, chartData.axes);
|
|
6734
6734
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
6735
6735
|
const secondarySeries = secondary.map((e) => e.series);
|
|
6736
|
-
const range =
|
|
6737
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
6738
|
-
const secondaryAxisFmt =
|
|
6736
|
+
const range = chunkKDJBWJJH_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
6737
|
+
const secondaryRange = secondarySeries.length > 0 ? chunkKDJBWJJH_js.computeValueRange(secondarySeries) : void 0;
|
|
6738
|
+
const secondaryAxisFmt = chunkKDJBWJJH_js.getSecondaryValueAxis(chartData.axes);
|
|
6739
6739
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6740
6740
|
const barSeriesCount = 1;
|
|
6741
6741
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -6751,8 +6751,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6751
6751
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
6752
6752
|
barSeries.values.forEach((val, vi) => {
|
|
6753
6753
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
6754
|
-
const zeroY =
|
|
6755
|
-
const valY =
|
|
6754
|
+
const zeroY = chunkKDJBWJJH_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
6755
|
+
const valY = chunkKDJBWJJH_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
|
|
6756
6756
|
const y = Math.min(zeroY, valY);
|
|
6757
6757
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
6758
6758
|
barElements.push(
|
|
@@ -6763,7 +6763,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6763
6763
|
y,
|
|
6764
6764
|
width: barWidth,
|
|
6765
6765
|
height: h,
|
|
6766
|
-
fill:
|
|
6766
|
+
fill: chunkKDJBWJJH_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
6767
6767
|
rx: 1
|
|
6768
6768
|
},
|
|
6769
6769
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -6779,7 +6779,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6779
6779
|
textAnchor: "middle",
|
|
6780
6780
|
fontSize: 7,
|
|
6781
6781
|
fill: "#334155",
|
|
6782
|
-
children:
|
|
6782
|
+
children: chunkKDJBWJJH_js.formatAxisValue(val)
|
|
6783
6783
|
},
|
|
6784
6784
|
`${element.id}-combo-bar-dl-${vi}`
|
|
6785
6785
|
)
|
|
@@ -6796,10 +6796,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6796
6796
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
6797
6797
|
const points = series.values.map((val, vi) => {
|
|
6798
6798
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
6799
|
-
const y =
|
|
6799
|
+
const y = chunkKDJBWJJH_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
6800
6800
|
return { x, y, val };
|
|
6801
6801
|
});
|
|
6802
|
-
const c =
|
|
6802
|
+
const c = chunkKDJBWJJH_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
6803
6803
|
lineElements.push(
|
|
6804
6804
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6805
6805
|
"polyline",
|
|
@@ -6826,7 +6826,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6826
6826
|
textAnchor: "middle",
|
|
6827
6827
|
fontSize: 7,
|
|
6828
6828
|
fill: "#334155",
|
|
6829
|
-
children:
|
|
6829
|
+
children: chunkKDJBWJJH_js.formatAxisValue(p.val)
|
|
6830
6830
|
},
|
|
6831
6831
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
6832
6832
|
)
|
|
@@ -6864,11 +6864,11 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6864
6864
|
}
|
|
6865
6865
|
function renderChartElement(element) {
|
|
6866
6866
|
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:
|
|
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: chunkIOVOQ6ZJ_js.translationsEn["pptx.chart.heading"] });
|
|
6868
6868
|
}
|
|
6869
6869
|
const chartData = element.chartData;
|
|
6870
6870
|
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:
|
|
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: chunkIOVOQ6ZJ_js.translationsEn["pptx.chart.heading"] });
|
|
6872
6872
|
}
|
|
6873
6873
|
const longestSeriesLength = chartData.series.reduce(
|
|
6874
6874
|
(maxLength, series) => Math.max(maxLength, series.values.length),
|
|
@@ -7972,14 +7972,14 @@ function buildNotesPdf(pages) {
|
|
|
7972
7972
|
notes: page.notes,
|
|
7973
7973
|
slideNumber: page.slideNumber
|
|
7974
7974
|
}));
|
|
7975
|
-
const bytes =
|
|
7975
|
+
const bytes = chunkKDJBWJJH_js.buildNotesPdfBytes(images, meta);
|
|
7976
7976
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
7977
7977
|
return URL.createObjectURL(blob);
|
|
7978
7978
|
}
|
|
7979
7979
|
|
|
7980
7980
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
7981
7981
|
function buildPdfFromImageData(images) {
|
|
7982
|
-
const bytes =
|
|
7982
|
+
const bytes = chunkKDJBWJJH_js.buildSlidesPdfBytes(images);
|
|
7983
7983
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
7984
7984
|
return URL.createObjectURL(blob);
|
|
7985
7985
|
}
|
|
@@ -7988,7 +7988,7 @@ function buildPdfFromImageData(images) {
|
|
|
7988
7988
|
var activePreview = null;
|
|
7989
7989
|
function startPreviewAnimation(elementId, preset, options) {
|
|
7990
7990
|
stopPreviewAnimation();
|
|
7991
|
-
const descriptor =
|
|
7991
|
+
const descriptor = chunkKDJBWJJH_js.buildPreviewAnimation(preset, options);
|
|
7992
7992
|
if (!descriptor) {
|
|
7993
7993
|
return;
|
|
7994
7994
|
}
|
|
@@ -8001,7 +8001,7 @@ function startMotionPathPreview(elementId, path, options) {
|
|
|
8001
8001
|
return;
|
|
8002
8002
|
}
|
|
8003
8003
|
const stage = domEl.offsetParent;
|
|
8004
|
-
const descriptor =
|
|
8004
|
+
const descriptor = chunkKDJBWJJH_js.buildMotionPathPreview({
|
|
8005
8005
|
path,
|
|
8006
8006
|
slideWidth: stage?.offsetWidth || DEFAULT_PREVIEW_SLIDE_WIDTH,
|
|
8007
8007
|
slideHeight: stage?.offsetHeight || DEFAULT_PREVIEW_SLIDE_HEIGHT,
|