pptx-react-viewer 2.9.0 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/{AiChatPanel-6W6ZBAGU.mjs → AiChatPanel-EX2TBRJM.mjs} +4 -4
- package/dist/AiChatPanel-EX2TBRJM.mjs.br +0 -0
- package/dist/AiChatPanel-EX2TBRJM.mjs.gz +0 -0
- package/dist/{AiChatPanel-MALC32TM.js → AiChatPanel-PJPSDMN4.js} +23 -23
- package/dist/AiChatPanel-PJPSDMN4.js.br +0 -0
- package/dist/AiChatPanel-PJPSDMN4.js.gz +0 -0
- package/dist/{Model3DScene-57HZ4NVD.mjs → Model3DScene-TTQFV7OS.mjs} +1 -1
- package/dist/Model3DScene-TTQFV7OS.mjs.br +0 -0
- package/dist/Model3DScene-TTQFV7OS.mjs.gz +0 -0
- package/dist/{Model3DScene-76R2YXSO.js → Model3DScene-UCBPTEAY.js} +2 -2
- package/dist/Model3DScene-UCBPTEAY.js.br +0 -0
- package/dist/Model3DScene-UCBPTEAY.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-JGOQNHSU.mjs → SurfaceChart3DScene-5SZCRHZI.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-JGOQNHSU.mjs.br → SurfaceChart3DScene-5SZCRHZI.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-5SZCRHZI.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-2QZZTBV4.js → SurfaceChart3DScene-ADKCYYOQ.js} +2 -2
- package/dist/SurfaceChart3DScene-ADKCYYOQ.js.br +0 -0
- package/dist/SurfaceChart3DScene-ADKCYYOQ.js.gz +0 -0
- package/dist/{chunk-D6SHCB4V.js → chunk-4J7SPY64.js} +338 -324
- package/dist/chunk-4J7SPY64.js.br +0 -0
- package/dist/chunk-4J7SPY64.js.gz +0 -0
- package/dist/{chunk-CD434OFE.mjs → chunk-53NXKDMZ.mjs} +48 -0
- package/dist/chunk-53NXKDMZ.mjs.br +0 -0
- package/dist/chunk-53NXKDMZ.mjs.gz +0 -0
- package/dist/{chunk-L47Y62L6.mjs → chunk-C2UWTH42.mjs} +1168 -118
- package/dist/chunk-C2UWTH42.mjs.br +0 -0
- package/dist/chunk-C2UWTH42.mjs.gz +0 -0
- package/dist/{chunk-6UXRNLHD.js → chunk-E367QIKR.js} +2526 -1738
- package/dist/chunk-E367QIKR.js.br +0 -0
- package/dist/chunk-E367QIKR.js.gz +0 -0
- package/dist/{chunk-4FO4JMTN.mjs → chunk-HK2UERUX.mjs} +17 -3
- package/dist/chunk-HK2UERUX.mjs.br +0 -0
- package/dist/chunk-HK2UERUX.mjs.gz +0 -0
- package/dist/{chunk-IKISUZKE.js → chunk-HMQVOPQH.js} +1210 -118
- package/dist/chunk-HMQVOPQH.js.br +0 -0
- package/dist/chunk-HMQVOPQH.js.gz +0 -0
- package/dist/{chunk-NQLVK23T.mjs → chunk-L2CM5EUD.mjs} +885 -97
- package/dist/chunk-L2CM5EUD.mjs.br +0 -0
- package/dist/chunk-L2CM5EUD.mjs.gz +0 -0
- package/dist/{chunk-34BUZNKO.js → chunk-MM5RMRSP.js} +278 -291
- package/dist/chunk-MM5RMRSP.js.br +0 -0
- package/dist/chunk-MM5RMRSP.js.gz +0 -0
- package/dist/{chunk-2JDWFMIK.js → chunk-N6IHR6PS.js} +48 -0
- package/dist/chunk-N6IHR6PS.js.br +0 -0
- package/dist/chunk-N6IHR6PS.js.gz +0 -0
- package/dist/{chunk-JPTO6P5K.mjs → chunk-RJEY2KZH.mjs} +34 -48
- package/dist/chunk-RJEY2KZH.mjs.br +0 -0
- package/dist/chunk-RJEY2KZH.mjs.gz +0 -0
- package/dist/{chunk-6OLS3EJW.mjs → chunk-UZVRM6LD.mjs} +1 -1
- package/dist/chunk-UZVRM6LD.mjs.br +0 -0
- package/dist/chunk-UZVRM6LD.mjs.gz +0 -0
- package/dist/{chunk-YEM2VOAP.js → chunk-VNP627O5.js} +3 -3
- package/dist/chunk-VNP627O5.js.br +0 -0
- package/dist/chunk-VNP627O5.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 +26 -3
- package/dist/index.d.ts.map +1 -1
- 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 +30 -2
- 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/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/{useViewerBuildingBlocks-C59NY1qZ.d.ts → useViewerBuildingBlocks-Rqxm0pRS.d.ts} +19 -5
- package/dist/useViewerBuildingBlocks-Rqxm0pRS.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-6W6ZBAGU.mjs.br +0 -0
- package/dist/AiChatPanel-6W6ZBAGU.mjs.gz +0 -0
- package/dist/AiChatPanel-MALC32TM.js.br +0 -0
- package/dist/AiChatPanel-MALC32TM.js.gz +0 -0
- package/dist/Model3DScene-57HZ4NVD.mjs.br +0 -0
- package/dist/Model3DScene-57HZ4NVD.mjs.gz +0 -0
- package/dist/Model3DScene-76R2YXSO.js.br +0 -0
- package/dist/Model3DScene-76R2YXSO.js.gz +0 -0
- package/dist/SurfaceChart3DScene-2QZZTBV4.js.br +0 -0
- package/dist/SurfaceChart3DScene-2QZZTBV4.js.gz +0 -0
- package/dist/SurfaceChart3DScene-JGOQNHSU.mjs.gz +0 -0
- package/dist/chunk-2JDWFMIK.js.br +0 -0
- package/dist/chunk-2JDWFMIK.js.gz +0 -0
- package/dist/chunk-34BUZNKO.js.br +0 -0
- package/dist/chunk-34BUZNKO.js.gz +0 -0
- package/dist/chunk-4FO4JMTN.mjs.br +0 -0
- package/dist/chunk-4FO4JMTN.mjs.gz +0 -0
- package/dist/chunk-6OLS3EJW.mjs.br +0 -0
- package/dist/chunk-6OLS3EJW.mjs.gz +0 -0
- package/dist/chunk-6UXRNLHD.js.br +0 -0
- package/dist/chunk-6UXRNLHD.js.gz +0 -0
- package/dist/chunk-CD434OFE.mjs.br +0 -0
- package/dist/chunk-CD434OFE.mjs.gz +0 -0
- package/dist/chunk-D6SHCB4V.js.br +0 -0
- package/dist/chunk-D6SHCB4V.js.gz +0 -0
- package/dist/chunk-IKISUZKE.js.br +0 -0
- package/dist/chunk-IKISUZKE.js.gz +0 -0
- package/dist/chunk-JPTO6P5K.mjs.br +0 -0
- package/dist/chunk-JPTO6P5K.mjs.gz +0 -0
- package/dist/chunk-L47Y62L6.mjs.br +0 -0
- package/dist/chunk-L47Y62L6.mjs.gz +0 -0
- package/dist/chunk-NQLVK23T.mjs.br +0 -0
- package/dist/chunk-NQLVK23T.mjs.gz +0 -0
- package/dist/chunk-YEM2VOAP.js.br +0 -0
- package/dist/chunk-YEM2VOAP.js.gz +0 -0
- package/dist/useViewerBuildingBlocks-C59NY1qZ.d.ts.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkN6IHR6PS_js = require('./chunk-N6IHR6PS.js');
|
|
4
|
+
var chunkHMQVOPQH_js = require('./chunk-HMQVOPQH.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 chunkHMQVOPQH_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 chunkHMQVOPQH_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 = chunkHMQVOPQH_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 = chunkHMQVOPQH_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 (!chunkHMQVOPQH_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) => chunkHMQVOPQH_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) => !chunkHMQVOPQH_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 (!chunkHMQVOPQH_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 = chunkHMQVOPQH_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 = chunkHMQVOPQH_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 (!chunkHMQVOPQH_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 = chunkHMQVOPQH_js.clampCropValue(element.cropLeft);
|
|
339
|
+
const cropTop = chunkHMQVOPQH_js.clampCropValue(element.cropTop);
|
|
340
|
+
const cropRight = chunkHMQVOPQH_js.clampCropValue(element.cropRight);
|
|
341
|
+
const cropBottom = chunkHMQVOPQH_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 = chunkHMQVOPQH_js.clampCropValue(cropLeft * safeHorizontalScale);
|
|
354
|
+
const normalizedRight = chunkHMQVOPQH_js.clampCropValue(cropRight * safeHorizontalScale);
|
|
355
|
+
const normalizedTop = chunkHMQVOPQH_js.clampCropValue(cropTop * safeVerticalScale);
|
|
356
|
+
const normalizedBottom = chunkHMQVOPQH_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 (!chunkHMQVOPQH_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 (!chunkHMQVOPQH_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 (!chunkHMQVOPQH_js.isImageLikeElement(element) || !isImageTiled(element)) {
|
|
454
454
|
return void 0;
|
|
455
455
|
}
|
|
456
456
|
const scaleX = typeof element.tileScaleX === "number" ? element.tileScaleX * 100 : 100;
|
|
@@ -729,50 +729,11 @@ function registerMediaElement(elementId, el) {
|
|
|
729
729
|
}
|
|
730
730
|
};
|
|
731
731
|
}
|
|
732
|
-
function executeMediaCommand(command) {
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
const parsed = chunkIKISUZKE_js.parseMediaCommand(command.command);
|
|
738
|
-
if (!parsed) {
|
|
739
|
-
return false;
|
|
740
|
-
}
|
|
741
|
-
const safePlay = () => {
|
|
742
|
-
void el.play().catch(() => {
|
|
743
|
-
});
|
|
744
|
-
};
|
|
745
|
-
const safeSeek = (seconds) => {
|
|
746
|
-
try {
|
|
747
|
-
el.currentTime = seconds;
|
|
748
|
-
} catch {
|
|
749
|
-
}
|
|
750
|
-
};
|
|
751
|
-
switch (parsed.verb) {
|
|
752
|
-
case "playFrom":
|
|
753
|
-
safeSeek(parsed.seekSeconds ?? 0);
|
|
754
|
-
safePlay();
|
|
755
|
-
return true;
|
|
756
|
-
case "play":
|
|
757
|
-
safePlay();
|
|
758
|
-
return true;
|
|
759
|
-
case "pause":
|
|
760
|
-
el.pause();
|
|
761
|
-
return true;
|
|
762
|
-
case "stop":
|
|
763
|
-
el.pause();
|
|
764
|
-
safeSeek(0);
|
|
765
|
-
return true;
|
|
766
|
-
case "togglePlay":
|
|
767
|
-
if (el.paused) {
|
|
768
|
-
safePlay();
|
|
769
|
-
} else {
|
|
770
|
-
el.pause();
|
|
771
|
-
}
|
|
772
|
-
return true;
|
|
773
|
-
default:
|
|
774
|
-
return false;
|
|
775
|
-
}
|
|
732
|
+
function executeMediaCommand(command, frameRoot) {
|
|
733
|
+
return chunkHMQVOPQH_js.runMediaCommand(
|
|
734
|
+
command,
|
|
735
|
+
(targetId) => registry.get(targetId) ?? chunkHMQVOPQH_js.findMediaElementByElementId(targetId, frameRoot?.())
|
|
736
|
+
);
|
|
776
737
|
}
|
|
777
738
|
function PresentationMediaController({
|
|
778
739
|
element,
|
|
@@ -1005,7 +966,7 @@ function PresentationMediaController({
|
|
|
1005
966
|
}
|
|
1006
967
|
function renderMediaElement(element, mediaDataUrls, options) {
|
|
1007
968
|
if (element.type !== "media") {
|
|
1008
|
-
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: chunkN6IHR6PS_js.translationsEn["pptx.media.title"] });
|
|
1009
970
|
}
|
|
1010
971
|
const mediaType = element.mediaType;
|
|
1011
972
|
const mediaPath = element.mediaPath;
|
|
@@ -1035,7 +996,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1035
996
|
"img",
|
|
1036
997
|
{
|
|
1037
998
|
src: posterUrl,
|
|
1038
|
-
alt:
|
|
999
|
+
alt: chunkN6IHR6PS_js.translationsEn["pptx.media.posterAlt"],
|
|
1039
1000
|
className: "w-full h-full object-contain opacity-50"
|
|
1040
1001
|
}
|
|
1041
1002
|
),
|
|
@@ -1056,7 +1017,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1056
1017
|
]
|
|
1057
1018
|
}
|
|
1058
1019
|
),
|
|
1059
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children:
|
|
1020
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: chunkN6IHR6PS_js.translationsEn["pptx.media.notFound"] })
|
|
1060
1021
|
] })
|
|
1061
1022
|
] });
|
|
1062
1023
|
}
|
|
@@ -1097,7 +1058,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1097
1058
|
"img",
|
|
1098
1059
|
{
|
|
1099
1060
|
src: posterUrl,
|
|
1100
|
-
alt:
|
|
1061
|
+
alt: chunkN6IHR6PS_js.translationsEn["pptx.media.videoPosterAlt"],
|
|
1101
1062
|
className: "w-full h-full object-contain"
|
|
1102
1063
|
}
|
|
1103
1064
|
),
|
|
@@ -1186,7 +1147,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1186
1147
|
|
|
1187
1148
|
// src/viewer/utils/text-utils.tsx
|
|
1188
1149
|
function getTextStyleForElement(element, fallbackColor) {
|
|
1189
|
-
return
|
|
1150
|
+
return chunkHMQVOPQH_js.buildTextBlockStyle(element, { fallbackColor });
|
|
1190
1151
|
}
|
|
1191
1152
|
|
|
1192
1153
|
// src/viewer/utils/text-layout.tsx
|
|
@@ -1211,13 +1172,13 @@ function computeTabSize(tabStops, defaultTabSize) {
|
|
|
1211
1172
|
return avgGap > 0 ? `${Math.round(avgGap)}px` : fromDefault;
|
|
1212
1173
|
}
|
|
1213
1174
|
function getTextLayoutStyle(element) {
|
|
1214
|
-
if (!
|
|
1175
|
+
if (!chunkHMQVOPQH_js.hasTextProperties(element)) {
|
|
1215
1176
|
return {};
|
|
1216
1177
|
}
|
|
1217
1178
|
const verticalAlign = element.textStyle?.vAlign || "top";
|
|
1218
|
-
const writingMode =
|
|
1219
|
-
const textOrientation =
|
|
1220
|
-
const verticalDirection =
|
|
1179
|
+
const writingMode = chunkHMQVOPQH_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
1180
|
+
const textOrientation = chunkHMQVOPQH_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
1181
|
+
const verticalDirection = chunkHMQVOPQH_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
1221
1182
|
const parsedColumnCount = Number(element.textStyle?.columnCount);
|
|
1222
1183
|
const columnCount = Number.isFinite(parsedColumnCount) ? Math.max(1, Math.min(16, Math.round(parsedColumnCount))) : 1;
|
|
1223
1184
|
const hasColumns = columnCount > 1;
|
|
@@ -1225,7 +1186,7 @@ function getTextLayoutStyle(element) {
|
|
|
1225
1186
|
const tabStops = element.textStyle?.tabStops;
|
|
1226
1187
|
const tabSize = computeTabSize(tabStops, element.textStyle?.defaultTabSize);
|
|
1227
1188
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
1228
|
-
const hasParagraphIndents =
|
|
1189
|
+
const hasParagraphIndents = chunkHMQVOPQH_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
1229
1190
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
1230
1191
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
1231
1192
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
@@ -1234,7 +1195,7 @@ function getTextLayoutStyle(element) {
|
|
|
1234
1195
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
1235
1196
|
const parsedColumnSpacing = Number(element.textStyle?.columnSpacing);
|
|
1236
1197
|
const columnGap = Number.isFinite(parsedColumnSpacing) && parsedColumnSpacing > 0 ? `${parsedColumnSpacing}px` : "0.75em";
|
|
1237
|
-
const kinsokuStyles =
|
|
1198
|
+
const kinsokuStyles = chunkHMQVOPQH_js.getKinsokuLineBreakStyles(element.textStyle);
|
|
1238
1199
|
if (hasColumns) {
|
|
1239
1200
|
return {
|
|
1240
1201
|
display: "block",
|
|
@@ -1281,10 +1242,10 @@ function getTextLayoutStyle(element) {
|
|
|
1281
1242
|
|
|
1282
1243
|
// src/viewer/utils/text-effects.tsx
|
|
1283
1244
|
function buildTextFillCss2(style) {
|
|
1284
|
-
return
|
|
1245
|
+
return chunkHMQVOPQH_js.buildTextFillCss(style);
|
|
1285
1246
|
}
|
|
1286
1247
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
1287
|
-
return
|
|
1248
|
+
return chunkHMQVOPQH_js.buildTextBody3DSceneStyle(textStyle);
|
|
1288
1249
|
}
|
|
1289
1250
|
|
|
1290
1251
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -1469,13 +1430,13 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1469
1430
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
1470
1431
|
return renderedSegments;
|
|
1471
1432
|
}
|
|
1472
|
-
const paraKey = `${elementId}${
|
|
1433
|
+
const paraKey = `${elementId}${chunkHMQVOPQH_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
1473
1434
|
const paraState = subElementAnimStates.get(paraKey);
|
|
1474
1435
|
if (paraState) {
|
|
1475
1436
|
const style = buildAnimStyle(paraState);
|
|
1476
1437
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
1477
1438
|
}
|
|
1478
|
-
const spec =
|
|
1439
|
+
const spec = chunkHMQVOPQH_js.buildTextBuildSpec(
|
|
1479
1440
|
elementId,
|
|
1480
1441
|
paraIndex,
|
|
1481
1442
|
paraSegments.map((entry) => ({ text: entry.segment.text, style: entry })),
|
|
@@ -1493,7 +1454,7 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1493
1454
|
"span",
|
|
1494
1455
|
{
|
|
1495
1456
|
"data-anim-id": span.animId,
|
|
1496
|
-
style:
|
|
1457
|
+
style: chunkHMQVOPQH_js.textBuildSpanStyle(span),
|
|
1497
1458
|
children: content
|
|
1498
1459
|
},
|
|
1499
1460
|
span.animId
|
|
@@ -1637,10 +1598,10 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1637
1598
|
if (!needsScriptFonts || !text) {
|
|
1638
1599
|
return text;
|
|
1639
1600
|
}
|
|
1640
|
-
const runs =
|
|
1601
|
+
const runs = chunkHMQVOPQH_js.segmentByScript(text);
|
|
1641
1602
|
if (runs.length <= 1) {
|
|
1642
1603
|
if (runs.length === 1) {
|
|
1643
|
-
const font =
|
|
1604
|
+
const font = chunkHMQVOPQH_js.resolveFontForScript(runs[0].script, scriptFonts);
|
|
1644
1605
|
if (font && font !== baseFontFamily) {
|
|
1645
1606
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: text });
|
|
1646
1607
|
}
|
|
@@ -1648,7 +1609,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1648
1609
|
return text;
|
|
1649
1610
|
}
|
|
1650
1611
|
return runs.map((run, i) => {
|
|
1651
|
-
const font =
|
|
1612
|
+
const font = chunkHMQVOPQH_js.resolveFontForScript(run.script, scriptFonts);
|
|
1652
1613
|
if (!font || font === baseFontFamily) {
|
|
1653
1614
|
return /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Fragment, { children: run.text }, `${keyPrefix}-r${i}`);
|
|
1654
1615
|
}
|
|
@@ -1720,8 +1681,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1720
1681
|
);
|
|
1721
1682
|
}
|
|
1722
1683
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
1723
|
-
const mathml =
|
|
1724
|
-
const safeMathml = mathml ?
|
|
1684
|
+
const mathml = chunkHMQVOPQH_js.convertOmmlToMathMl(equationXml);
|
|
1685
|
+
const safeMathml = mathml ? chunkHMQVOPQH_js.sanitizeMathMl(mathml) : "";
|
|
1725
1686
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1726
1687
|
"span",
|
|
1727
1688
|
{
|
|
@@ -1731,7 +1692,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1731
1692
|
},
|
|
1732
1693
|
dangerouslySetInnerHTML: { __html: safeMathml }
|
|
1733
1694
|
}
|
|
1734
|
-
) : /* @__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: chunkN6IHR6PS_js.translationsEn["pptx.textSegment.equationFallback"] });
|
|
1735
1696
|
if (equationNumber) {
|
|
1736
1697
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1737
1698
|
"span",
|
|
@@ -1771,7 +1732,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1771
1732
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: equationContent }, `${elementId}-seg-${segmentIndex}`);
|
|
1772
1733
|
}
|
|
1773
1734
|
function renderPictureBullet(elementId, segmentIndex, bulletInfo, baseFontSize) {
|
|
1774
|
-
const picture =
|
|
1735
|
+
const picture = chunkHMQVOPQH_js.resolvePictureBullet(bulletInfo, baseFontSize) ?? {
|
|
1775
1736
|
sizePx: baseFontSize,
|
|
1776
1737
|
fallbackMarker: "\u2022",
|
|
1777
1738
|
accessibleLabel: "Bullet"
|
|
@@ -1822,7 +1783,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1822
1783
|
}
|
|
1823
1784
|
const segmentStyle = segment.style || {};
|
|
1824
1785
|
const rawText = bulletInfo && typeof bulletHangPx === "number" ? (segment.text || "").trimEnd() : segment.text || "";
|
|
1825
|
-
const textValue =
|
|
1786
|
+
const textValue = chunkHMQVOPQH_js.substituteFieldText(rawText, segment.fieldType, fieldContext);
|
|
1826
1787
|
const lines = textValue.split("\n");
|
|
1827
1788
|
const textDecorationTokens = [];
|
|
1828
1789
|
if (segmentStyle.underline || segmentStyle.hyperlink) {
|
|
@@ -1832,8 +1793,8 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1832
1793
|
textDecorationTokens.push("line-through");
|
|
1833
1794
|
}
|
|
1834
1795
|
const isDoubleStrike = segmentStyle.strikethrough && segmentStyle.strikeType === "dblStrike";
|
|
1835
|
-
const resolvedSegmentColor = segmentStyle.hyperlink ?
|
|
1836
|
-
const underlineDecoration =
|
|
1796
|
+
const resolvedSegmentColor = segmentStyle.hyperlink ? chunkHMQVOPQH_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, HYPERLINK_COLOR) : chunkHMQVOPQH_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, fallbackColor);
|
|
1797
|
+
const underlineDecoration = chunkHMQVOPQH_js.resolveUnderlineDecorationStyle(
|
|
1837
1798
|
Boolean(isDoubleStrike),
|
|
1838
1799
|
segmentStyle.underlineStyle
|
|
1839
1800
|
);
|
|
@@ -1843,20 +1804,20 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1843
1804
|
const letterSpacing = typeof segmentStyle.characterSpacing === "number" && segmentStyle.characterSpacing !== 0 ? `${segmentStyle.characterSpacing / 100 * (96 / 72)}px` : void 0;
|
|
1844
1805
|
const textFillStyles = buildTextFillCss2(segmentStyle);
|
|
1845
1806
|
const rawFontSize = segmentStyle.fontSize || element.textStyle?.fontSize || DEFAULT_TEXT_FONT_SIZE;
|
|
1846
|
-
const autoFitScale =
|
|
1807
|
+
const autoFitScale = chunkHMQVOPQH_js.resolveAutoFitFontScale(element.textStyle);
|
|
1847
1808
|
const baseFontSize = rawFontSize * autoFitScale;
|
|
1848
1809
|
const baselineShift = baselineFraction !== 0 ? `${baselineFraction * baseFontSize}px` : void 0;
|
|
1849
1810
|
const baseFontSizePt = baseFontSize * (72 / 96);
|
|
1850
1811
|
const fontKerning = typeof segmentStyle.kerning === "number" ? segmentStyle.kerning === 0 ? "none" : baseFontSizePt >= segmentStyle.kerning / 100 ? "normal" : "none" : void 0;
|
|
1851
1812
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
1852
|
-
const baseFontFamily = rawFontFamily ?
|
|
1813
|
+
const baseFontFamily = rawFontFamily ? chunkHMQVOPQH_js.getSubstituteFontFamily(rawFontFamily) : DEFAULT_FONT_FAMILY;
|
|
1853
1814
|
const scriptFonts = {
|
|
1854
1815
|
latin: baseFontFamily,
|
|
1855
1816
|
eastAsia: segmentStyle.eastAsiaFont || element.textStyle?.eastAsiaFont || baseFontFamily,
|
|
1856
1817
|
complexScript: segmentStyle.complexScriptFont || element.textStyle?.complexScriptFont || baseFontFamily,
|
|
1857
1818
|
symbol: segmentStyle.symbolFont || element.textStyle?.symbolFont || baseFontFamily
|
|
1858
1819
|
};
|
|
1859
|
-
const needsScriptFonts =
|
|
1820
|
+
const needsScriptFonts = chunkHMQVOPQH_js.hasDistinctScriptFonts(scriptFonts);
|
|
1860
1821
|
const spanStyle = {
|
|
1861
1822
|
color: resolvedSegmentColor,
|
|
1862
1823
|
fontSize: baseFontSize * baselineFontScale,
|
|
@@ -1874,15 +1835,15 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1874
1835
|
fontVariantCaps: segmentStyle.textCaps === "small" ? "small-caps" : void 0,
|
|
1875
1836
|
letterSpacing,
|
|
1876
1837
|
fontKerning,
|
|
1877
|
-
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ?
|
|
1838
|
+
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ? chunkHMQVOPQH_js.normalizeHexColor(segmentStyle.highlightColor, "transparent") : void 0,
|
|
1878
1839
|
...textFillStyles,
|
|
1879
|
-
textDecorationColor: segmentStyle.underlineColor ?
|
|
1880
|
-
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${
|
|
1840
|
+
textDecorationColor: segmentStyle.underlineColor ? chunkHMQVOPQH_js.normalizeHexColor(segmentStyle.underlineColor, void 0) : void 0,
|
|
1841
|
+
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${chunkHMQVOPQH_js.normalizeHexColor(segmentStyle.textOutlineColor, "#000000")}` : segmentStyle.textOutlineWidth ? `${segmentStyle.textOutlineWidth}px currentColor` : void 0,
|
|
1881
1842
|
paintOrder: segmentStyle.textOutlineWidth ? "stroke fill" : void 0,
|
|
1882
|
-
textShadow:
|
|
1883
|
-
filter:
|
|
1884
|
-
opacity:
|
|
1885
|
-
WebkitBoxReflect:
|
|
1843
|
+
textShadow: chunkHMQVOPQH_js.buildTextShadowCss(segmentStyle),
|
|
1844
|
+
filter: chunkHMQVOPQH_js.buildTextRunFilterChain(segmentStyle),
|
|
1845
|
+
opacity: chunkHMQVOPQH_js.getTextAlphaOpacity(segmentStyle),
|
|
1846
|
+
WebkitBoxReflect: chunkHMQVOPQH_js.buildTextReflectionCss(segmentStyle)
|
|
1886
1847
|
};
|
|
1887
1848
|
const runRtl = segmentStyle.rtl;
|
|
1888
1849
|
if (runRtl !== void 0 && runRtl !== paragraphRtl) {
|
|
@@ -1902,7 +1863,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1902
1863
|
spanStyle.fontSize = baseFontSize * (bulletInfo.sizePercent / 100) * baselineFontScale;
|
|
1903
1864
|
}
|
|
1904
1865
|
if (bulletInfo.color) {
|
|
1905
|
-
spanStyle.color =
|
|
1866
|
+
spanStyle.color = chunkHMQVOPQH_js.normalizeHexColor(bulletInfo.color, resolvedSegmentColor);
|
|
1906
1867
|
}
|
|
1907
1868
|
if (typeof bulletHangPx === "number" && bulletHangPx > 0) {
|
|
1908
1869
|
spanStyle.display = "inline-block";
|
|
@@ -1947,7 +1908,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1947
1908
|
textAlign: segment.rubyAlignment === "l" ? "left" : segment.rubyAlignment === "r" ? "right" : segment.rubyAlignment === "dist" || segment.rubyAlignment === "distCat" || segment.rubyAlignment === "distLetter" ? "justify" : "center"
|
|
1948
1909
|
};
|
|
1949
1910
|
if (segment.rubyStyle?.color) {
|
|
1950
|
-
rubyStyle.color =
|
|
1911
|
+
rubyStyle.color = chunkHMQVOPQH_js.normalizeHexColor(segment.rubyStyle.color, resolvedSegmentColor);
|
|
1951
1912
|
}
|
|
1952
1913
|
innerContent = /* @__PURE__ */ jsxRuntime.jsxs("ruby", { children: [
|
|
1953
1914
|
baseContent,
|
|
@@ -2042,7 +2003,7 @@ function groupSegmentsIntoParagraphs(segments) {
|
|
|
2042
2003
|
return paragraphs;
|
|
2043
2004
|
}
|
|
2044
2005
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick) {
|
|
2045
|
-
if (!
|
|
2006
|
+
if (!chunkHMQVOPQH_js.hasTextProperties(element)) {
|
|
2046
2007
|
return emptyFallback || null;
|
|
2047
2008
|
}
|
|
2048
2009
|
const effectiveSegments = segmentOverrides ?? element.textSegments;
|
|
@@ -2063,10 +2024,10 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2063
2024
|
return element.text || emptyFallback || "";
|
|
2064
2025
|
}
|
|
2065
2026
|
const paragraphs = groupSegmentsIntoParagraphs(effectiveSegments);
|
|
2066
|
-
const paragraphIndents =
|
|
2067
|
-
const elementRtl =
|
|
2068
|
-
const elementAlign =
|
|
2069
|
-
const bodyStyle =
|
|
2027
|
+
const paragraphIndents = chunkHMQVOPQH_js.hasTextProperties(element) ? element.paragraphIndents : void 0;
|
|
2028
|
+
const elementRtl = chunkHMQVOPQH_js.hasTextProperties(element) ? element.textStyle?.rtl : void 0;
|
|
2029
|
+
const elementAlign = chunkHMQVOPQH_js.hasTextProperties(element) ? element.textStyle?.align : void 0;
|
|
2030
|
+
const bodyStyle = chunkHMQVOPQH_js.hasTextProperties(element) ? element.textStyle : void 0;
|
|
2070
2031
|
const spaceFirstLast = bodyStyle?.spaceFirstLastParagraph !== false;
|
|
2071
2032
|
return paragraphs.map(({ entries: paraSegments, terminator }, paraIndex) => {
|
|
2072
2033
|
const paraIndent = paragraphIndents?.[paraIndex];
|
|
@@ -2081,14 +2042,14 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2081
2042
|
return Boolean(segment.text) && segment.text.trim().length > 0;
|
|
2082
2043
|
});
|
|
2083
2044
|
const hasBullet = bulletInfo && !bulletInfo.none && hasVisibleTextContent;
|
|
2084
|
-
const paraRtl =
|
|
2045
|
+
const paraRtl = chunkHMQVOPQH_js.resolveParagraphRtl(paraSegments, elementRtl);
|
|
2085
2046
|
const isRtlParagraph = paraRtl === true;
|
|
2086
|
-
const paraAlign =
|
|
2087
|
-
const cssTextAlign =
|
|
2047
|
+
const paraAlign = chunkHMQVOPQH_js.resolveParagraphAlign(paraSegments, elementAlign);
|
|
2048
|
+
const cssTextAlign = chunkHMQVOPQH_js.resolveCssTextAlign(paraAlign, isRtlParagraph);
|
|
2088
2049
|
const paraMarginLeft = isRtlParagraph ? void 0 : rawMarginLeft;
|
|
2089
2050
|
const paraMarginRight = isRtlParagraph ? rawMarginLeft : void 0;
|
|
2090
2051
|
const paraTextIndent = rawTextIndent;
|
|
2091
|
-
const paraKinsokuStyle =
|
|
2052
|
+
const paraKinsokuStyle = chunkHMQVOPQH_js.getKinsokuLineBreakStyles(firstSeg?.segment.style);
|
|
2092
2053
|
const hasParaKinsoku = Object.keys(paraKinsokuStyle).length > 0;
|
|
2093
2054
|
const paraProps = effectiveSegments[firstSeg?.globalIndex ?? -1]?.paragraphProperties ?? (paraSegments.length === 0 ? terminator?.paragraphProperties : void 0);
|
|
2094
2055
|
const spacing = resolveParagraphSpacing({
|
|
@@ -2098,7 +2059,7 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2098
2059
|
isLast: paraIndex === paragraphs.length - 1,
|
|
2099
2060
|
spaceFirstLast
|
|
2100
2061
|
});
|
|
2101
|
-
const strutFontSize =
|
|
2062
|
+
const strutFontSize = chunkHMQVOPQH_js.resolveParagraphStrutFontSize(
|
|
2102
2063
|
paraSegments.length > 0 ? paraSegments.map(({ segment }) => segment) : terminator ? [terminator] : [],
|
|
2103
2064
|
bodyStyle?.fontSize
|
|
2104
2065
|
);
|
|
@@ -2202,13 +2163,13 @@ function hexToRgbUnit(hex) {
|
|
|
2202
2163
|
};
|
|
2203
2164
|
}
|
|
2204
2165
|
function getDuotoneColors(element) {
|
|
2205
|
-
if (!
|
|
2166
|
+
if (!chunkHMQVOPQH_js.isImageLikeElement(element)) {
|
|
2206
2167
|
return void 0;
|
|
2207
2168
|
}
|
|
2208
2169
|
return element.imageEffects?.duotone;
|
|
2209
2170
|
}
|
|
2210
2171
|
function buildLineShadowCss(element) {
|
|
2211
|
-
if (!
|
|
2172
|
+
if (!chunkHMQVOPQH_js.hasShapeProperties(element)) {
|
|
2212
2173
|
return void 0;
|
|
2213
2174
|
}
|
|
2214
2175
|
const ss = element.shapeStyle;
|
|
@@ -2219,13 +2180,13 @@ function buildLineShadowCss(element) {
|
|
|
2219
2180
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
2220
2181
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
2221
2182
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
2222
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
2223
|
-
|
|
2183
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkHMQVOPQH_js.colorWithOpacity(
|
|
2184
|
+
chunkHMQVOPQH_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
2224
2185
|
opacity
|
|
2225
2186
|
)}`;
|
|
2226
2187
|
}
|
|
2227
2188
|
function buildLineGlowFilter(element) {
|
|
2228
|
-
if (!
|
|
2189
|
+
if (!chunkHMQVOPQH_js.hasShapeProperties(element)) {
|
|
2229
2190
|
return void 0;
|
|
2230
2191
|
}
|
|
2231
2192
|
const ss = element.shapeStyle;
|
|
@@ -2234,7 +2195,7 @@ function buildLineGlowFilter(element) {
|
|
|
2234
2195
|
}
|
|
2235
2196
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
2236
2197
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
2237
|
-
const glowCol =
|
|
2198
|
+
const glowCol = chunkHMQVOPQH_js.colorWithOpacity(chunkHMQVOPQH_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
2238
2199
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
2239
2200
|
}
|
|
2240
2201
|
function mapDagBlendModeToCss(blend) {
|
|
@@ -2258,7 +2219,7 @@ function getDagDuotoneFilterId(elementId) {
|
|
|
2258
2219
|
return `dag-duotone-${elementId}`;
|
|
2259
2220
|
}
|
|
2260
2221
|
function hasDagDuotoneEffect(element) {
|
|
2261
|
-
if (!
|
|
2222
|
+
if (!chunkHMQVOPQH_js.hasShapeProperties(element)) {
|
|
2262
2223
|
return false;
|
|
2263
2224
|
}
|
|
2264
2225
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
@@ -2321,7 +2282,7 @@ function getRoundRectRadiusPx2(element) {
|
|
|
2321
2282
|
|
|
2322
2283
|
// src/viewer/utils/shape-visual-3d.ts
|
|
2323
2284
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
2324
|
-
return
|
|
2285
|
+
return chunkHMQVOPQH_js.build3DExtrusionData(
|
|
2325
2286
|
shape3d,
|
|
2326
2287
|
scene3d,
|
|
2327
2288
|
fillColor,
|
|
@@ -2330,7 +2291,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
2330
2291
|
);
|
|
2331
2292
|
}
|
|
2332
2293
|
function apply3dEffects2(base, scene3d, shape3d, fillColorFallback) {
|
|
2333
|
-
|
|
2294
|
+
chunkHMQVOPQH_js.apply3dEffects(base, scene3d, shape3d, fillColorFallback);
|
|
2334
2295
|
}
|
|
2335
2296
|
|
|
2336
2297
|
// src/viewer/utils/vector-subpath-paint.ts
|
|
@@ -2339,7 +2300,7 @@ function toHexByte(value) {
|
|
|
2339
2300
|
return clamped.toString(16).padStart(2, "0");
|
|
2340
2301
|
}
|
|
2341
2302
|
function shiftHex(hex, factor, towardsWhite) {
|
|
2342
|
-
const channels =
|
|
2303
|
+
const channels = chunkHMQVOPQH_js.hexToRgbChannels(hex);
|
|
2343
2304
|
if (!channels) {
|
|
2344
2305
|
return hex;
|
|
2345
2306
|
}
|
|
@@ -2365,13 +2326,13 @@ function buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity) {
|
|
|
2365
2326
|
const fillOff = subpath.fillMode === "none" || !hasFill;
|
|
2366
2327
|
return {
|
|
2367
2328
|
d: subpath.d,
|
|
2368
|
-
fill: fillOff ? "none" :
|
|
2329
|
+
fill: fillOff ? "none" : chunkHMQVOPQH_js.colorWithOpacity(adjustFillForMode(fillColor, subpath.fillMode), fillOpacity),
|
|
2369
2330
|
stroked: subpath.stroke !== false
|
|
2370
2331
|
};
|
|
2371
2332
|
});
|
|
2372
2333
|
}
|
|
2373
2334
|
function getStrokeOnlyPresetPaths(element) {
|
|
2374
|
-
if (element.type !== "shape" || !
|
|
2335
|
+
if (element.type !== "shape" || !chunkHMQVOPQH_js.hasShapeProperties(element)) {
|
|
2375
2336
|
return void 0;
|
|
2376
2337
|
}
|
|
2377
2338
|
const shapeType = element.shapeType;
|
|
@@ -2381,7 +2342,7 @@ function getStrokeOnlyPresetPaths(element) {
|
|
|
2381
2342
|
if (element.pathData) {
|
|
2382
2343
|
return void 0;
|
|
2383
2344
|
}
|
|
2384
|
-
const result =
|
|
2345
|
+
const result = chunkHMQVOPQH_js.evaluatePresetShape(
|
|
2385
2346
|
shapeType,
|
|
2386
2347
|
Math.max(element.width, 1),
|
|
2387
2348
|
Math.max(element.height, 1),
|
|
@@ -2399,43 +2360,43 @@ function getGradientTilingCss(style) {
|
|
|
2399
2360
|
if (!style || style.fillMode !== "gradient") {
|
|
2400
2361
|
return void 0;
|
|
2401
2362
|
}
|
|
2402
|
-
const isStructuredLinear = (style.fillGradientType || "linear") === "linear" &&
|
|
2363
|
+
const isStructuredLinear = (style.fillGradientType || "linear") === "linear" && chunkHMQVOPQH_js.sanitizeGradientStops(style.fillGradientStops).length > 0;
|
|
2403
2364
|
if (isStructuredLinear) {
|
|
2404
|
-
const flip =
|
|
2365
|
+
const flip = chunkHMQVOPQH_js.getGradientTileFlipCss(style.fillGradientFlip);
|
|
2405
2366
|
if (flip) {
|
|
2406
2367
|
return flip;
|
|
2407
2368
|
}
|
|
2408
2369
|
}
|
|
2409
|
-
return
|
|
2370
|
+
return chunkHMQVOPQH_js.getGradientTileRectCss(style.fillGradientTileRect);
|
|
2410
2371
|
}
|
|
2411
2372
|
function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2412
|
-
if (!
|
|
2373
|
+
if (!chunkHMQVOPQH_js.hasShapeProperties(element)) {
|
|
2413
2374
|
return {};
|
|
2414
2375
|
}
|
|
2415
2376
|
const normalizedShapeType = getShapeType(element.shapeType);
|
|
2416
|
-
const clipPath =
|
|
2377
|
+
const clipPath = chunkHMQVOPQH_js.getResolvedShapeClipPath(element);
|
|
2417
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;
|
|
2418
2379
|
const rendersStrokeOnlyPreset = Boolean(getStrokeOnlyPresetPaths(element));
|
|
2419
2380
|
const fillOpacity = element.shapeStyle?.fillOpacity;
|
|
2420
2381
|
const strokeOpacity = element.shapeStyle?.strokeOpacity;
|
|
2421
|
-
const strokeDash =
|
|
2422
|
-
const fillGradient =
|
|
2382
|
+
const strokeDash = chunkHMQVOPQH_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2383
|
+
const fillGradient = chunkHMQVOPQH_js.buildCssGradientFromShapeStyle(element.shapeStyle, {
|
|
2423
2384
|
rotation: element.rotation,
|
|
2424
2385
|
width: element.width,
|
|
2425
2386
|
height: element.height
|
|
2426
2387
|
}) || element.shapeStyle?.fillGradient;
|
|
2427
|
-
const shadowCss =
|
|
2428
|
-
const innerShadowCss =
|
|
2429
|
-
const resolvedFillColor =
|
|
2430
|
-
const resolvedStrokeColor =
|
|
2388
|
+
const shadowCss = chunkHMQVOPQH_js.buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
2389
|
+
const innerShadowCss = chunkHMQVOPQH_js.buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
2390
|
+
const resolvedFillColor = chunkHMQVOPQH_js.colorWithOpacity(fillColor, fillOpacity);
|
|
2391
|
+
const resolvedStrokeColor = chunkHMQVOPQH_js.colorWithOpacity(strokeColor, strokeOpacity);
|
|
2431
2392
|
const ss = element.shapeStyle;
|
|
2432
2393
|
const gradientTiling = getGradientTilingCss(ss);
|
|
2433
|
-
const paintsGradientOutline =
|
|
2394
|
+
const paintsGradientOutline = chunkHMQVOPQH_js.suppressesCssBorder(element);
|
|
2434
2395
|
const hasFillOverlayColor = Boolean(
|
|
2435
2396
|
ss?.dagFillOverlayColor && ss.dagFillOverlayColor !== "transparent"
|
|
2436
2397
|
);
|
|
2437
2398
|
const combinedShadowParts = [];
|
|
2438
|
-
const multiLayerShadow =
|
|
2399
|
+
const multiLayerShadow = chunkHMQVOPQH_js.buildMultiLayerShadowCss(element.shapeStyle);
|
|
2439
2400
|
if (multiLayerShadow) {
|
|
2440
2401
|
combinedShadowParts.push(multiLayerShadow);
|
|
2441
2402
|
} else if (shadowCss) {
|
|
@@ -2444,7 +2405,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2444
2405
|
if (innerShadowCss) {
|
|
2445
2406
|
combinedShadowParts.push(innerShadowCss);
|
|
2446
2407
|
}
|
|
2447
|
-
const glowBoxShadow =
|
|
2408
|
+
const glowBoxShadow = chunkHMQVOPQH_js.buildGlowBoxShadow(ss?.glowColor, ss?.glowRadius, ss?.glowOpacity);
|
|
2448
2409
|
if (glowBoxShadow) {
|
|
2449
2410
|
combinedShadowParts.push(glowBoxShadow);
|
|
2450
2411
|
}
|
|
@@ -2452,7 +2413,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2452
2413
|
if (lineShadow) {
|
|
2453
2414
|
combinedShadowParts.push(lineShadow);
|
|
2454
2415
|
}
|
|
2455
|
-
const compoundLineShadow =
|
|
2416
|
+
const compoundLineShadow = chunkHMQVOPQH_js.getCompoundLineBoxShadow(
|
|
2456
2417
|
element.shapeStyle?.compoundLine,
|
|
2457
2418
|
strokeWidth,
|
|
2458
2419
|
resolvedStrokeColor
|
|
@@ -2465,11 +2426,11 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2465
2426
|
if (ss?.glowColor && ss.glowColor !== "transparent" && ss.glowRadius) {
|
|
2466
2427
|
const glowOpacity = typeof ss.glowOpacity === "number" ? ss.glowOpacity : 0.75;
|
|
2467
2428
|
const glowRad = Math.round(Math.max(0, ss.glowRadius));
|
|
2468
|
-
const glowCol =
|
|
2429
|
+
const glowCol = chunkHMQVOPQH_js.colorWithOpacity(chunkHMQVOPQH_js.normalizeHexColor(ss.glowColor, "#ffff00"), glowOpacity);
|
|
2469
2430
|
filterParts.push(`drop-shadow(0 0 ${glowRad}px ${glowCol})`);
|
|
2470
2431
|
}
|
|
2471
2432
|
if (typeof ss?.softEdgeRadius === "number" && ss.softEdgeRadius > 0) {
|
|
2472
|
-
filterParts.push(`url(#${
|
|
2433
|
+
filterParts.push(`url(#${chunkHMQVOPQH_js.getSoftEdgeFilterId(element.id)})`);
|
|
2473
2434
|
}
|
|
2474
2435
|
if (typeof ss?.blurRadius === "number" && ss.blurRadius > 0) {
|
|
2475
2436
|
filterParts.push(`blur(${Math.round(ss.blurRadius)}px)`);
|
|
@@ -2478,13 +2439,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2478
2439
|
if (lineGlowCss) {
|
|
2479
2440
|
filterParts.push(lineGlowCss);
|
|
2480
2441
|
}
|
|
2481
|
-
const dagFilter =
|
|
2442
|
+
const dagFilter = chunkHMQVOPQH_js.getEffectDagFilter(ss, element.id);
|
|
2482
2443
|
if (dagFilter) {
|
|
2483
2444
|
filterParts.push(dagFilter);
|
|
2484
2445
|
}
|
|
2485
2446
|
const lineJoinCss = ss?.lineJoin === "round" ? "round" : ss?.lineJoin === "bevel" ? "bevel" : ss?.lineJoin === "miter" ? "miter" : void 0;
|
|
2486
2447
|
const miterLimitCss = ss?.lineJoin === "miter" && typeof ss?.miterLimit === "number" ? Math.max(ss.miterLimit / 1e5, 1) : void 0;
|
|
2487
|
-
const patternFill =
|
|
2448
|
+
const patternFill = chunkHMQVOPQH_js.buildPatternFillCss(element.shapeStyle);
|
|
2488
2449
|
const imageFillUrl = ss?.fillMode === "image" && ss.fillImageUrl ? ss.fillImageUrl : void 0;
|
|
2489
2450
|
const imageFillMode = ss?.fillImageMode || "stretch";
|
|
2490
2451
|
let reflectCss;
|
|
@@ -2496,7 +2457,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2496
2457
|
const endOpacity = typeof ss.reflectionEndOpacity === "number" ? ss.reflectionEndOpacity : 0;
|
|
2497
2458
|
const fadeLength = typeof ss.reflectionEndPosition === "number" ? Math.round(ss.reflectionEndPosition * Math.max(element.height, 1)) : 100;
|
|
2498
2459
|
const blurRadius = typeof ss.reflectionBlurRadius === "number" ? ss.reflectionBlurRadius : 0;
|
|
2499
|
-
reflectCss =
|
|
2460
|
+
reflectCss = chunkHMQVOPQH_js.buildReflectionCss(distance, startOpacity, endOpacity, fadeLength, blurRadius);
|
|
2500
2461
|
}
|
|
2501
2462
|
}
|
|
2502
2463
|
const base = {
|
|
@@ -2542,9 +2503,9 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2542
2503
|
// path following the shape's geometry, because a CSS border can only take
|
|
2543
2504
|
// one colour. Keeping the border too would draw the parser's averaged
|
|
2544
2505
|
// solid underneath the gradient.
|
|
2545
|
-
borderWidth: strokeWidth > 0 && !paintsGradientOutline ?
|
|
2506
|
+
borderWidth: strokeWidth > 0 && !paintsGradientOutline ? chunkHMQVOPQH_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : 0,
|
|
2546
2507
|
borderColor: strokeWidth > 0 && !paintsGradientOutline ? resolvedStrokeColor : void 0,
|
|
2547
|
-
borderStyle: strokeWidth > 0 && !paintsGradientOutline ?
|
|
2508
|
+
borderStyle: strokeWidth > 0 && !paintsGradientOutline ? chunkHMQVOPQH_js.getCssBorderDashStyle(strokeDash, ss?.compoundLine) : void 0,
|
|
2548
2509
|
strokeLinejoin: lineJoinCss,
|
|
2549
2510
|
strokeMiterlimit: miterLimitCss,
|
|
2550
2511
|
strokeLinecap: ss?.lineCap === "rnd" ? "round" : ss?.lineCap === "sq" ? "square" : ss?.lineCap === "flat" ? "butt" : void 0
|
|
@@ -2600,7 +2561,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2600
2561
|
borderWidth: 0,
|
|
2601
2562
|
borderTopWidth: Math.max(strokeWidth, 2),
|
|
2602
2563
|
borderTopColor: resolvedStrokeColor,
|
|
2603
|
-
borderTopStyle:
|
|
2564
|
+
borderTopStyle: chunkHMQVOPQH_js.getCssBorderDashStyle(strokeDash)
|
|
2604
2565
|
};
|
|
2605
2566
|
}
|
|
2606
2567
|
if (normalizedShapeType === "cylinder") {
|
|
@@ -2614,13 +2575,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2614
2575
|
function getConnectorAdjustment(element, key, fallback) {
|
|
2615
2576
|
const direct = element.shapeAdjustments?.[key];
|
|
2616
2577
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
2617
|
-
return
|
|
2578
|
+
return chunkHMQVOPQH_js.clampUnitInterval(direct / 1e5);
|
|
2618
2579
|
}
|
|
2619
2580
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
2620
2581
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
2621
|
-
return
|
|
2582
|
+
return chunkHMQVOPQH_js.clampUnitInterval(fallbackKey / 1e5);
|
|
2622
2583
|
}
|
|
2623
|
-
return
|
|
2584
|
+
return chunkHMQVOPQH_js.clampUnitInterval(fallback);
|
|
2624
2585
|
}
|
|
2625
2586
|
function getConnectorPathGeometry(element) {
|
|
2626
2587
|
const width = Math.max(element.width, 1);
|
|
@@ -2757,11 +2718,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
|
|
|
2757
2718
|
strokePaint,
|
|
2758
2719
|
strokeWidth,
|
|
2759
2720
|
dashArray,
|
|
2760
|
-
lineCap:
|
|
2721
|
+
lineCap: chunkHMQVOPQH_js.svgLineCap(shapeStyle?.lineCap),
|
|
2761
2722
|
lineJoin,
|
|
2762
2723
|
miterLimit,
|
|
2763
|
-
offsets:
|
|
2764
|
-
widths:
|
|
2724
|
+
offsets: chunkHMQVOPQH_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
2725
|
+
widths: chunkHMQVOPQH_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
|
|
2765
2726
|
};
|
|
2766
2727
|
}
|
|
2767
2728
|
function strokeStrands(d, keyBase, ctx) {
|
|
@@ -2809,9 +2770,9 @@ function gradientDefs(gradient) {
|
|
|
2809
2770
|
}
|
|
2810
2771
|
function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredPaths, shapeStyle, hasFill, fillColor, fillOpacity, strokePaint, strokeWidth, dashArray, animatesFill = false, gradient) {
|
|
2811
2772
|
const ctx = strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray);
|
|
2812
|
-
const subpaths = structuredPaths && structuredPaths.length > 0 ?
|
|
2773
|
+
const subpaths = structuredPaths && structuredPaths.length > 0 ? chunkHMQVOPQH_js.customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
2813
2774
|
const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
|
|
2814
|
-
const gradientPaint = gradient ?
|
|
2775
|
+
const gradientPaint = gradient ? chunkHMQVOPQH_js.svgGradientFillRef(gradient) : void 0;
|
|
2815
2776
|
const nodes = [];
|
|
2816
2777
|
if (subpaths && needsPerSubpath) {
|
|
2817
2778
|
const paints = buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity);
|
|
@@ -2843,7 +2804,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2843
2804
|
"path",
|
|
2844
2805
|
{
|
|
2845
2806
|
d: pathData,
|
|
2846
|
-
fill: animatesFill ? "inherit" : gradientPaint ??
|
|
2807
|
+
fill: animatesFill ? "inherit" : gradientPaint ?? chunkHMQVOPQH_js.colorWithOpacity(fillColor, fillOpacity),
|
|
2847
2808
|
stroke: "none",
|
|
2848
2809
|
vectorEffect: "non-scaling-stroke"
|
|
2849
2810
|
},
|
|
@@ -2888,14 +2849,14 @@ function renderStrokeOnlyPreset(presetPaths, width, height, shapeStyle, strokePa
|
|
|
2888
2849
|
);
|
|
2889
2850
|
}
|
|
2890
2851
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2891
|
-
if (!
|
|
2852
|
+
if (!chunkHMQVOPQH_js.hasShapeProperties(element)) {
|
|
2892
2853
|
return null;
|
|
2893
2854
|
}
|
|
2894
2855
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
2895
|
-
const fillPaint = animatesFill ? "inherit" :
|
|
2896
|
-
const strokePaint = animatesStroke ? "inherit" :
|
|
2897
|
-
const dashType =
|
|
2898
|
-
const dashArray =
|
|
2856
|
+
const fillPaint = animatesFill ? "inherit" : chunkHMQVOPQH_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
2857
|
+
const strokePaint = animatesStroke ? "inherit" : chunkHMQVOPQH_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
2858
|
+
const dashType = chunkHMQVOPQH_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2859
|
+
const dashArray = chunkHMQVOPQH_js.getSvgStrokeDasharray(
|
|
2899
2860
|
dashType,
|
|
2900
2861
|
Math.max(strokeWidth, 1),
|
|
2901
2862
|
element.shapeStyle?.customDashSegments
|
|
@@ -2976,21 +2937,21 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2976
2937
|
// container's `background-image` is suppressed for custom geometry, so
|
|
2977
2938
|
// without this the shape fell back to the parser's representative solid
|
|
2978
2939
|
// and lost every fade (issue #132).
|
|
2979
|
-
|
|
2940
|
+
chunkHMQVOPQH_js.buildSvgGradientDef(element.shapeStyle, element.id)
|
|
2980
2941
|
);
|
|
2981
2942
|
}
|
|
2982
|
-
if (
|
|
2943
|
+
if (chunkHMQVOPQH_js.isCalloutShape(normalizedType)) {
|
|
2983
2944
|
const width = Math.max(element.width, 1);
|
|
2984
2945
|
const height = Math.max(element.height, 1);
|
|
2985
|
-
const geometry =
|
|
2946
|
+
const geometry = chunkHMQVOPQH_js.getCalloutLeaderLineGeometry(
|
|
2986
2947
|
normalizedType,
|
|
2987
2948
|
width,
|
|
2988
2949
|
height,
|
|
2989
2950
|
element.shapeAdjustments
|
|
2990
2951
|
);
|
|
2991
2952
|
if (geometry && geometry.points.length >= 2) {
|
|
2992
|
-
const leaderPath =
|
|
2993
|
-
const bounds =
|
|
2953
|
+
const leaderPath = chunkHMQVOPQH_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
2954
|
+
const bounds = chunkHMQVOPQH_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
2994
2955
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
2995
2956
|
const offsetLeft = bounds.minX;
|
|
2996
2957
|
const offsetTop = bounds.minY;
|
|
@@ -3053,10 +3014,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
3053
3014
|
const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
|
|
3054
3015
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
3055
3016
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
3056
|
-
const connectorLineCap =
|
|
3017
|
+
const connectorLineCap = chunkHMQVOPQH_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
3057
3018
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
3058
|
-
const offsets =
|
|
3059
|
-
const widths =
|
|
3019
|
+
const offsets = chunkHMQVOPQH_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
3020
|
+
const widths = chunkHMQVOPQH_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
3060
3021
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3061
3022
|
"svg",
|
|
3062
3023
|
{
|
|
@@ -3135,15 +3096,15 @@ function parseGradientFillCss(gradFill) {
|
|
|
3135
3096
|
}
|
|
3136
3097
|
const parsed = stops.map((gs) => {
|
|
3137
3098
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
3138
|
-
const color =
|
|
3139
|
-
const opacity =
|
|
3140
|
-
return { pos, color:
|
|
3099
|
+
const color = chunkHMQVOPQH_js.parseDrawingColor(gs) ?? "#888888";
|
|
3100
|
+
const opacity = chunkHMQVOPQH_js.parseDrawingColorOpacity(gs);
|
|
3101
|
+
return { pos, color: chunkHMQVOPQH_js.colorWithOpacity(color, opacity) };
|
|
3141
3102
|
}).sort((a, b) => a.pos - b.pos);
|
|
3142
3103
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
3143
3104
|
const lin = gradFill["a:lin"];
|
|
3144
3105
|
if (lin) {
|
|
3145
3106
|
const angRaw = Number.parseInt(String(lin["@_ang"] || "0"), 10);
|
|
3146
|
-
const angleDeg = Math.round(
|
|
3107
|
+
const angleDeg = Math.round(chunkHMQVOPQH_js.ooxmlGradientAngleToCssDegrees(angRaw / 6e4));
|
|
3147
3108
|
return `linear-gradient(${angleDeg}deg, ${stopStrings})`;
|
|
3148
3109
|
}
|
|
3149
3110
|
const path = gradFill["a:path"];
|
|
@@ -3178,8 +3139,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
3178
3139
|
if (!pattFill) {
|
|
3179
3140
|
return void 0;
|
|
3180
3141
|
}
|
|
3181
|
-
const fgColor =
|
|
3182
|
-
const bgColor =
|
|
3142
|
+
const fgColor = chunkHMQVOPQH_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
3143
|
+
const bgColor = chunkHMQVOPQH_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
3183
3144
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
3184
3145
|
switch (preset) {
|
|
3185
3146
|
case "ltHorz":
|
|
@@ -3290,11 +3251,11 @@ function parseCellBorders(cellProperties) {
|
|
|
3290
3251
|
const prstDash = ln["a:prstDash"];
|
|
3291
3252
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
3292
3253
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
3293
|
-
const color =
|
|
3254
|
+
const color = chunkHMQVOPQH_js.parseDrawingColor(ln["a:solidFill"]);
|
|
3294
3255
|
if (color) {
|
|
3295
|
-
const opacity =
|
|
3256
|
+
const opacity = chunkHMQVOPQH_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
3296
3257
|
const key = `${edge.prefix}`;
|
|
3297
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
3258
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkHMQVOPQH_js.colorWithOpacity(color, opacity)}`;
|
|
3298
3259
|
}
|
|
3299
3260
|
}
|
|
3300
3261
|
return borderStyle;
|
|
@@ -3307,7 +3268,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3307
3268
|
const textShadowParts = [];
|
|
3308
3269
|
const outerShdw = effectLst["a:outerShdw"];
|
|
3309
3270
|
if (outerShdw) {
|
|
3310
|
-
const shdwColor =
|
|
3271
|
+
const shdwColor = chunkHMQVOPQH_js.parseDrawingColor(outerShdw);
|
|
3311
3272
|
if (shdwColor) {
|
|
3312
3273
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
3313
3274
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -3325,7 +3286,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3325
3286
|
}
|
|
3326
3287
|
const glow = effectLst["a:glow"];
|
|
3327
3288
|
if (glow) {
|
|
3328
|
-
const glowColor =
|
|
3289
|
+
const glowColor = chunkHMQVOPQH_js.parseDrawingColor(glow);
|
|
3329
3290
|
if (glowColor) {
|
|
3330
3291
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
3331
3292
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -3404,10 +3365,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3404
3365
|
if (runProps?.["@_u"] !== void 0) {
|
|
3405
3366
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
3406
3367
|
}
|
|
3407
|
-
const runColor =
|
|
3368
|
+
const runColor = chunkHMQVOPQH_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkHMQVOPQH_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
3408
3369
|
if (runColor) {
|
|
3409
|
-
const opacity =
|
|
3410
|
-
cellStyle.color =
|
|
3370
|
+
const opacity = chunkHMQVOPQH_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
3371
|
+
cellStyle.color = chunkHMQVOPQH_js.colorWithOpacity(runColor, opacity);
|
|
3411
3372
|
}
|
|
3412
3373
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
3413
3374
|
if (fontFamily) {
|
|
@@ -3417,15 +3378,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3417
3378
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
3418
3379
|
}
|
|
3419
3380
|
const cellProperties = cellXml["a:tcPr"];
|
|
3420
|
-
const cellFill =
|
|
3381
|
+
const cellFill = chunkHMQVOPQH_js.parseDrawingColor(
|
|
3421
3382
|
cellProperties?.["a:solidFill"],
|
|
3422
3383
|
schemeColorOverrides
|
|
3423
3384
|
);
|
|
3424
3385
|
if (cellFill) {
|
|
3425
|
-
const opacity =
|
|
3386
|
+
const opacity = chunkHMQVOPQH_js.parseDrawingColorOpacity(
|
|
3426
3387
|
cellProperties?.["a:solidFill"]
|
|
3427
3388
|
);
|
|
3428
|
-
cellStyle.backgroundColor =
|
|
3389
|
+
cellStyle.backgroundColor = chunkHMQVOPQH_js.colorWithOpacity(cellFill, opacity);
|
|
3429
3390
|
} else {
|
|
3430
3391
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
3431
3392
|
if (gradCss) {
|
|
@@ -3440,16 +3401,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3440
3401
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
3441
3402
|
Object.assign(cellStyle, edgeBorders);
|
|
3442
3403
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
3443
|
-
const borderColor =
|
|
3404
|
+
const borderColor = chunkHMQVOPQH_js.parseDrawingColor(
|
|
3444
3405
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
3445
3406
|
schemeColorOverrides
|
|
3446
|
-
) ||
|
|
3407
|
+
) || chunkHMQVOPQH_js.parseDrawingColor(
|
|
3447
3408
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
3448
3409
|
schemeColorOverrides
|
|
3449
|
-
) ||
|
|
3410
|
+
) || chunkHMQVOPQH_js.parseDrawingColor(
|
|
3450
3411
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
3451
3412
|
schemeColorOverrides
|
|
3452
|
-
) ||
|
|
3413
|
+
) || chunkHMQVOPQH_js.parseDrawingColor(
|
|
3453
3414
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
3454
3415
|
schemeColorOverrides
|
|
3455
3416
|
);
|
|
@@ -3528,10 +3489,10 @@ function resolveTableStyleFillColor(fill, colorScheme) {
|
|
|
3528
3489
|
}
|
|
3529
3490
|
let color = base;
|
|
3530
3491
|
if (fill.tint !== void 0 && fill.tint > 0) {
|
|
3531
|
-
color =
|
|
3492
|
+
color = chunkHMQVOPQH_js.tintColor2(color, fill.tint / 1e5);
|
|
3532
3493
|
}
|
|
3533
3494
|
if (fill.shade !== void 0 && fill.shade > 0) {
|
|
3534
|
-
color =
|
|
3495
|
+
color = chunkHMQVOPQH_js.shadeColor2(color, 1 - fill.shade / 1e5);
|
|
3535
3496
|
}
|
|
3536
3497
|
return color;
|
|
3537
3498
|
}
|
|
@@ -3556,7 +3517,7 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3556
3517
|
style.fontFamily = text.fontFace;
|
|
3557
3518
|
applied = true;
|
|
3558
3519
|
} else {
|
|
3559
|
-
const refFont =
|
|
3520
|
+
const refFont = chunkHMQVOPQH_js.resolveFontRefIdx(text.fontRefIdx, fontScheme);
|
|
3560
3521
|
if (refFont) {
|
|
3561
3522
|
style.fontFamily = refFont;
|
|
3562
3523
|
applied = true;
|
|
@@ -3567,10 +3528,10 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3567
3528
|
if (base) {
|
|
3568
3529
|
let color = base;
|
|
3569
3530
|
if (text.fontTint !== void 0 && text.fontTint > 0) {
|
|
3570
|
-
color =
|
|
3531
|
+
color = chunkHMQVOPQH_js.tintColor2(color, text.fontTint / 1e5);
|
|
3571
3532
|
}
|
|
3572
3533
|
if (text.fontShade !== void 0 && text.fontShade > 0) {
|
|
3573
|
-
color =
|
|
3534
|
+
color = chunkHMQVOPQH_js.shadeColor2(color, 1 - text.fontShade / 1e5);
|
|
3574
3535
|
}
|
|
3575
3536
|
style.color = color;
|
|
3576
3537
|
applied = true;
|
|
@@ -3759,7 +3720,7 @@ function parseTableElementData(element, fallbackTextStyle) {
|
|
|
3759
3720
|
};
|
|
3760
3721
|
}
|
|
3761
3722
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
3762
|
-
return
|
|
3723
|
+
return chunkHMQVOPQH_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
3763
3724
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
3764
3725
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
3765
3726
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -3907,9 +3868,9 @@ function cellStyleToCss(style) {
|
|
|
3907
3868
|
if (style.gradientFillCss) {
|
|
3908
3869
|
css.background = style.gradientFillCss;
|
|
3909
3870
|
} else if (style.fillMode === "pattern" && style.patternFillPreset) {
|
|
3910
|
-
const fg =
|
|
3911
|
-
const bg =
|
|
3912
|
-
const svgPattern =
|
|
3871
|
+
const fg = chunkHMQVOPQH_js.normalizeHexColor(style.patternFillForeground, "#000000");
|
|
3872
|
+
const bg = chunkHMQVOPQH_js.normalizeHexColor(style.patternFillBackground, "#ffffff");
|
|
3873
|
+
const svgPattern = chunkHMQVOPQH_js.getPatternSvg(style.patternFillPreset, fg, bg);
|
|
3913
3874
|
if (svgPattern) {
|
|
3914
3875
|
const encoded = encodeURIComponent(svgPattern);
|
|
3915
3876
|
css.backgroundImage = `url("data:image/svg+xml,${encoded}")`;
|
|
@@ -3985,7 +3946,7 @@ function cellStyleToCss(style) {
|
|
|
3985
3946
|
if (edge.width || edge.color) {
|
|
3986
3947
|
const w = edge.width ?? 1;
|
|
3987
3948
|
const c = edge.color ?? style.borderColor ?? "#000000";
|
|
3988
|
-
const s =
|
|
3949
|
+
const s = chunkHMQVOPQH_js.ooxmlDashToCssBorderStyle(edge.dash);
|
|
3989
3950
|
css[edge.prefix] = `${w}px ${s} ${c}`;
|
|
3990
3951
|
}
|
|
3991
3952
|
}
|
|
@@ -4016,7 +3977,7 @@ function cellStyleToCss(style) {
|
|
|
4016
3977
|
css.textShadow = textShadowParts.join(", ");
|
|
4017
3978
|
}
|
|
4018
3979
|
if (style.cell3D) {
|
|
4019
|
-
Object.assign(css,
|
|
3980
|
+
Object.assign(css, chunkHMQVOPQH_js.cell3DBevelCss(style.cell3D));
|
|
4020
3981
|
}
|
|
4021
3982
|
return css;
|
|
4022
3983
|
}
|
|
@@ -4030,7 +3991,7 @@ function TableResizeOverlay({
|
|
|
4030
3991
|
const containerRef = React6.useRef(null);
|
|
4031
3992
|
const [rowBounds, setRowBounds] = React6.useState([]);
|
|
4032
3993
|
const dragRef = React6.useRef(null);
|
|
4033
|
-
const colBoundaries = React6.useMemo(() =>
|
|
3994
|
+
const colBoundaries = React6.useMemo(() => chunkHMQVOPQH_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
4034
3995
|
const measureRows = React6.useCallback(() => {
|
|
4035
3996
|
const container = containerRef.current;
|
|
4036
3997
|
if (!container) {
|
|
@@ -4077,11 +4038,11 @@ function TableResizeOverlay({
|
|
|
4077
4038
|
const rect = containerRef.current.getBoundingClientRect();
|
|
4078
4039
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
4079
4040
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
4080
|
-
onResizeColumns(
|
|
4041
|
+
onResizeColumns(chunkHMQVOPQH_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
4081
4042
|
} else if (drag.type === "row" && onResizeRow) {
|
|
4082
4043
|
const deltaY = e.clientY - drag.startPos;
|
|
4083
|
-
const newHeight =
|
|
4084
|
-
drag.initialRowHeight ??
|
|
4044
|
+
const newHeight = chunkHMQVOPQH_js.computeResizedRowHeight(
|
|
4045
|
+
drag.initialRowHeight ?? chunkHMQVOPQH_js.DEFAULT_ROW_HEIGHT,
|
|
4085
4046
|
deltaY
|
|
4086
4047
|
);
|
|
4087
4048
|
onResizeRow(drag.index, newHeight);
|
|
@@ -4119,7 +4080,7 @@ function TableResizeOverlay({
|
|
|
4119
4080
|
e.stopPropagation();
|
|
4120
4081
|
const table = containerRef.current?.querySelector("table");
|
|
4121
4082
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
4122
|
-
const actualHeight = tr?.offsetHeight ??
|
|
4083
|
+
const actualHeight = tr?.offsetHeight ?? chunkHMQVOPQH_js.DEFAULT_ROW_HEIGHT;
|
|
4123
4084
|
document.body.style.cursor = "row-resize";
|
|
4124
4085
|
document.body.style.userSelect = "none";
|
|
4125
4086
|
dragRef.current = {
|
|
@@ -4167,7 +4128,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4167
4128
|
}
|
|
4168
4129
|
const first = selectedCell.selectedCells[0];
|
|
4169
4130
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4170
|
-
return
|
|
4131
|
+
return chunkHMQVOPQH_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
4171
4132
|
})();
|
|
4172
4133
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4173
4134
|
TableResizeOverlay,
|
|
@@ -4200,7 +4161,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4200
4161
|
return null;
|
|
4201
4162
|
}
|
|
4202
4163
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
4203
|
-
const isInMultiSelection =
|
|
4164
|
+
const isInMultiSelection = chunkHMQVOPQH_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
4204
4165
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
4205
4166
|
const diag = getCellDiagonalBorders2(
|
|
4206
4167
|
cell.style,
|
|
@@ -4230,7 +4191,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4230
4191
|
}
|
|
4231
4192
|
event.stopPropagation();
|
|
4232
4193
|
if (event.shiftKey && selectedCell) {
|
|
4233
|
-
const rect =
|
|
4194
|
+
const rect = chunkHMQVOPQH_js.computeSelectionRect(
|
|
4234
4195
|
selectedCell.rowIndex,
|
|
4235
4196
|
selectedCell.columnIndex,
|
|
4236
4197
|
rowIndex,
|
|
@@ -4240,7 +4201,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4240
4201
|
options?.onSelectCell?.({
|
|
4241
4202
|
rowIndex: selectedCell.rowIndex,
|
|
4242
4203
|
columnIndex: selectedCell.columnIndex,
|
|
4243
|
-
selectedCells:
|
|
4204
|
+
selectedCells: chunkHMQVOPQH_js.rectToCells(rect)
|
|
4244
4205
|
});
|
|
4245
4206
|
} else {
|
|
4246
4207
|
options?.onSelectCell?.({
|
|
@@ -4302,7 +4263,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4302
4263
|
if (tableEl2.tableData && tableEl2.tableData.rows.length > 0) {
|
|
4303
4264
|
return renderTableFromTableData(tableEl2, textStyle, options);
|
|
4304
4265
|
}
|
|
4305
|
-
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: chunkN6IHR6PS_js.translationsEn["pptx.table.title"] });
|
|
4306
4267
|
}
|
|
4307
4268
|
const selectedCell = options?.selectedCell || null;
|
|
4308
4269
|
const isEditable = Boolean(options?.editable);
|
|
@@ -4317,7 +4278,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4317
4278
|
}
|
|
4318
4279
|
const first = selectedCell.selectedCells[0];
|
|
4319
4280
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4320
|
-
return
|
|
4281
|
+
return chunkHMQVOPQH_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
4321
4282
|
})();
|
|
4322
4283
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
4323
4284
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4394,7 +4355,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4394
4355
|
"border px-1 py-0.5 align-top",
|
|
4395
4356
|
isEditable && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
4396
4357
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
4397
|
-
|
|
4358
|
+
chunkHMQVOPQH_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
4398
4359
|
),
|
|
4399
4360
|
colSpan,
|
|
4400
4361
|
rowSpan: rSpan,
|
|
@@ -4405,7 +4366,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4405
4366
|
}
|
|
4406
4367
|
event.stopPropagation();
|
|
4407
4368
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
4408
|
-
const rect =
|
|
4369
|
+
const rect = chunkHMQVOPQH_js.computeSelectionRect(
|
|
4409
4370
|
selectedCell.rowIndex,
|
|
4410
4371
|
selectedCell.columnIndex,
|
|
4411
4372
|
rowIndex,
|
|
@@ -4415,7 +4376,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4415
4376
|
options?.onSelectCell?.({
|
|
4416
4377
|
rowIndex: selectedCell.rowIndex,
|
|
4417
4378
|
columnIndex: selectedCell.columnIndex,
|
|
4418
|
-
selectedCells:
|
|
4379
|
+
selectedCells: chunkHMQVOPQH_js.rectToCells(rect)
|
|
4419
4380
|
});
|
|
4420
4381
|
} else {
|
|
4421
4382
|
options?.onSelectCell?.({
|
|
@@ -4470,24 +4431,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4470
4431
|
}
|
|
4471
4432
|
var LEGEND_ITEM_WIDTH = 80;
|
|
4472
4433
|
function partAttrs(part) {
|
|
4473
|
-
return part ?
|
|
4434
|
+
return part ? chunkHMQVOPQH_js.chartPartToAttrs(part) : void 0;
|
|
4474
4435
|
}
|
|
4475
4436
|
function resolveReactPalette(chartData) {
|
|
4476
4437
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
4477
4438
|
return chartData.colorPalette;
|
|
4478
4439
|
}
|
|
4479
|
-
return [...
|
|
4440
|
+
return [...chunkHMQVOPQH_js.getChartStylePalette(chartData.style?.styleId)];
|
|
4480
4441
|
}
|
|
4481
4442
|
function buildReactChartViewModel(element) {
|
|
4482
4443
|
if (element.type !== "chart" || !element.chartData) {
|
|
4483
|
-
return
|
|
4444
|
+
return chunkHMQVOPQH_js.buildChartViewModel(element);
|
|
4484
4445
|
}
|
|
4485
4446
|
const palette = resolveReactPalette(element.chartData);
|
|
4486
4447
|
const themedElement = {
|
|
4487
4448
|
...element,
|
|
4488
4449
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
4489
4450
|
};
|
|
4490
|
-
return
|
|
4451
|
+
return chunkHMQVOPQH_js.buildChartViewModel(themedElement);
|
|
4491
4452
|
}
|
|
4492
4453
|
function renderPrimitive(prim, key) {
|
|
4493
4454
|
switch (prim.kind) {
|
|
@@ -4876,7 +4837,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4876
4837
|
const unmatchedRows = [];
|
|
4877
4838
|
categories.forEach((cat, i) => {
|
|
4878
4839
|
const value = values[i] ?? 0;
|
|
4879
|
-
const code =
|
|
4840
|
+
const code = chunkHMQVOPQH_js.resolveRegionCode(cat);
|
|
4880
4841
|
if (code) {
|
|
4881
4842
|
regionValueMap.set(code, { value, label: cat });
|
|
4882
4843
|
} else {
|
|
@@ -4914,8 +4875,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4914
4875
|
let fill = "#e2e8f0";
|
|
4915
4876
|
let dataLabel = null;
|
|
4916
4877
|
if (entry) {
|
|
4917
|
-
const t =
|
|
4918
|
-
fill =
|
|
4878
|
+
const t = chunkHMQVOPQH_js.normalizeValue(entry.value, minVal, maxVal);
|
|
4879
|
+
fill = chunkHMQVOPQH_js.sequentialColorScale(t);
|
|
4919
4880
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
4920
4881
|
"text",
|
|
4921
4882
|
{
|
|
@@ -4926,7 +4887,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4926
4887
|
fontWeight: 600,
|
|
4927
4888
|
fill: "#1e293b",
|
|
4928
4889
|
style: { pointerEvents: "none" },
|
|
4929
|
-
children:
|
|
4890
|
+
children: chunkHMQVOPQH_js.formatAxisValue(entry.value)
|
|
4930
4891
|
},
|
|
4931
4892
|
`${element.id}-map-dl-${region.code}`
|
|
4932
4893
|
);
|
|
@@ -4944,7 +4905,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4944
4905
|
opacity: 0.9,
|
|
4945
4906
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
4946
4907
|
region.name,
|
|
4947
|
-
entry ? `: ${
|
|
4908
|
+
entry ? `: ${chunkHMQVOPQH_js.formatAxisValue(entry.value)}` : ""
|
|
4948
4909
|
] })
|
|
4949
4910
|
}
|
|
4950
4911
|
),
|
|
@@ -4982,7 +4943,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4982
4943
|
fontSize: 7,
|
|
4983
4944
|
fill: "#64748b",
|
|
4984
4945
|
textAnchor: "middle",
|
|
4985
|
-
children:
|
|
4946
|
+
children: chunkHMQVOPQH_js.formatAxisValue(minVal)
|
|
4986
4947
|
},
|
|
4987
4948
|
`${element.id}-map-legend-min`
|
|
4988
4949
|
),
|
|
@@ -4994,7 +4955,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4994
4955
|
fontSize: 7,
|
|
4995
4956
|
fill: "#64748b",
|
|
4996
4957
|
textAnchor: "middle",
|
|
4997
|
-
children:
|
|
4958
|
+
children: chunkHMQVOPQH_js.formatAxisValue(maxVal)
|
|
4998
4959
|
},
|
|
4999
4960
|
`${element.id}-map-legend-max`
|
|
5000
4961
|
)
|
|
@@ -5013,7 +4974,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
5013
4974
|
textAnchor: "middle",
|
|
5014
4975
|
fontSize: 7,
|
|
5015
4976
|
fill: "#94a3b8",
|
|
5016
|
-
children:
|
|
4977
|
+
children: chunkN6IHR6PS_js.translationsEn["pptx.chart.additionalRegionsFallback"]
|
|
5017
4978
|
},
|
|
5018
4979
|
`${element.id}-map-ft-hdr`
|
|
5019
4980
|
)
|
|
@@ -5060,7 +5021,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
5060
5021
|
y,
|
|
5061
5022
|
fontSize,
|
|
5062
5023
|
fill: "#475569",
|
|
5063
|
-
children:
|
|
5024
|
+
children: chunkHMQVOPQH_js.formatAxisValue(row.value)
|
|
5064
5025
|
},
|
|
5065
5026
|
`${element.id}-map-ft-val-${i}`
|
|
5066
5027
|
)
|
|
@@ -5131,7 +5092,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
5131
5092
|
|
|
5132
5093
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
5133
5094
|
function sColor(series, idx) {
|
|
5134
|
-
return
|
|
5095
|
+
return chunkHMQVOPQH_js.seriesColor(series, idx);
|
|
5135
5096
|
}
|
|
5136
5097
|
function valToY(val, range, topY, bottomY) {
|
|
5137
5098
|
const usable = bottomY - topY;
|
|
@@ -5670,7 +5631,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5670
5631
|
width: 10,
|
|
5671
5632
|
height: 10,
|
|
5672
5633
|
rx: 2,
|
|
5673
|
-
fill:
|
|
5634
|
+
fill: chunkHMQVOPQH_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5674
5635
|
},
|
|
5675
5636
|
`${id}-leg-r-${i}`
|
|
5676
5637
|
)
|
|
@@ -5694,7 +5655,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5694
5655
|
width: 10,
|
|
5695
5656
|
height: 10,
|
|
5696
5657
|
rx: 2,
|
|
5697
|
-
fill:
|
|
5658
|
+
fill: chunkHMQVOPQH_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5698
5659
|
}
|
|
5699
5660
|
),
|
|
5700
5661
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -5707,9 +5668,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5707
5668
|
}
|
|
5708
5669
|
const lines = [];
|
|
5709
5670
|
if (range.logScale && range.logBase) {
|
|
5710
|
-
const ticks =
|
|
5671
|
+
const ticks = chunkHMQVOPQH_js.generateLogTicks(range);
|
|
5711
5672
|
ticks.forEach((tickVal, i) => {
|
|
5712
|
-
const y =
|
|
5673
|
+
const y = chunkHMQVOPQH_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5713
5674
|
lines.push(
|
|
5714
5675
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5715
5676
|
"line",
|
|
@@ -5730,7 +5691,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5730
5691
|
const steps = 4;
|
|
5731
5692
|
for (let i = 0; i <= steps; i++) {
|
|
5732
5693
|
const val = range.min + range.span * i / steps;
|
|
5733
|
-
const y =
|
|
5694
|
+
const y = chunkHMQVOPQH_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5734
5695
|
lines.push(
|
|
5735
5696
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5736
5697
|
"line",
|
|
@@ -5754,9 +5715,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5754
5715
|
const labels = [];
|
|
5755
5716
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5756
5717
|
if (range.logScale && range.logBase) {
|
|
5757
|
-
const ticks =
|
|
5718
|
+
const ticks = chunkHMQVOPQH_js.generateLogTicks(range);
|
|
5758
5719
|
ticks.forEach((tickVal, i) => {
|
|
5759
|
-
const y =
|
|
5720
|
+
const y = chunkHMQVOPQH_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5760
5721
|
labels.push(
|
|
5761
5722
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5762
5723
|
"text",
|
|
@@ -5766,7 +5727,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5766
5727
|
textAnchor: "end",
|
|
5767
5728
|
fontSize: 8,
|
|
5768
5729
|
fill: "#64748b",
|
|
5769
|
-
children: hasDisplayUnits ?
|
|
5730
|
+
children: hasDisplayUnits ? chunkHMQVOPQH_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunkHMQVOPQH_js.formatAxisValue(tickVal)
|
|
5770
5731
|
},
|
|
5771
5732
|
`${id}-vaxis-log-${i}`
|
|
5772
5733
|
)
|
|
@@ -5776,7 +5737,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5776
5737
|
const steps = 4;
|
|
5777
5738
|
for (let i = 0; i <= steps; i++) {
|
|
5778
5739
|
const val = range.min + range.span * i / steps;
|
|
5779
|
-
const y =
|
|
5740
|
+
const y = chunkHMQVOPQH_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5780
5741
|
labels.push(
|
|
5781
5742
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5782
5743
|
"text",
|
|
@@ -5786,7 +5747,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5786
5747
|
textAnchor: "end",
|
|
5787
5748
|
fontSize: 8,
|
|
5788
5749
|
fill: "#64748b",
|
|
5789
|
-
children: hasDisplayUnits ?
|
|
5750
|
+
children: hasDisplayUnits ? chunkHMQVOPQH_js.formatAxisValueWithUnits(val, axisFormatting) : chunkHMQVOPQH_js.formatAxisValue(val)
|
|
5790
5751
|
},
|
|
5791
5752
|
`${id}-vaxis-${i}`
|
|
5792
5753
|
)
|
|
@@ -5794,7 +5755,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5794
5755
|
}
|
|
5795
5756
|
}
|
|
5796
5757
|
if (hasDisplayUnits) {
|
|
5797
|
-
const unitLabel =
|
|
5758
|
+
const unitLabel = chunkHMQVOPQH_js.getDisplayUnitLabel(
|
|
5798
5759
|
axisFormatting.displayUnits,
|
|
5799
5760
|
axisFormatting.displayUnitsLabel
|
|
5800
5761
|
);
|
|
@@ -5869,7 +5830,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
5869
5830
|
if (range.min >= 0) {
|
|
5870
5831
|
return null;
|
|
5871
5832
|
}
|
|
5872
|
-
const y =
|
|
5833
|
+
const y = chunkHMQVOPQH_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
5873
5834
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5874
5835
|
"line",
|
|
5875
5836
|
{
|
|
@@ -5893,7 +5854,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5893
5854
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5894
5855
|
for (let i = 0; i <= steps; i++) {
|
|
5895
5856
|
const val = range.min + range.span * i / steps;
|
|
5896
|
-
const y =
|
|
5857
|
+
const y = chunkHMQVOPQH_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5897
5858
|
labels.push(
|
|
5898
5859
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5899
5860
|
"text",
|
|
@@ -5905,7 +5866,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5905
5866
|
fontFamily,
|
|
5906
5867
|
fontWeight,
|
|
5907
5868
|
fill: fontColor,
|
|
5908
|
-
children: hasDisplayUnits ?
|
|
5869
|
+
children: hasDisplayUnits ? chunkHMQVOPQH_js.formatAxisValueWithUnits(val, axisFormatting) : chunkHMQVOPQH_js.formatAxisValue(val)
|
|
5909
5870
|
},
|
|
5910
5871
|
`${id}-sec-vaxis-${i}`
|
|
5911
5872
|
)
|
|
@@ -5929,7 +5890,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5929
5890
|
);
|
|
5930
5891
|
}
|
|
5931
5892
|
if (hasDisplayUnits) {
|
|
5932
|
-
const unitLabel =
|
|
5893
|
+
const unitLabel = chunkHMQVOPQH_js.getDisplayUnitLabel(
|
|
5933
5894
|
axisFormatting.displayUnits,
|
|
5934
5895
|
axisFormatting.displayUnitsLabel
|
|
5935
5896
|
);
|
|
@@ -5960,7 +5921,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
5960
5921
|
const ticks = [];
|
|
5961
5922
|
for (let i = 0; i <= steps; i++) {
|
|
5962
5923
|
const val = range.min + range.span * i / steps;
|
|
5963
|
-
const y =
|
|
5924
|
+
const y = chunkHMQVOPQH_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5964
5925
|
ticks.push(
|
|
5965
5926
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5966
5927
|
"line",
|
|
@@ -5987,7 +5948,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
5987
5948
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
5988
5949
|
for (let i = 0; i <= steps; i++) {
|
|
5989
5950
|
const val = range.min + range.span * i / steps;
|
|
5990
|
-
const y =
|
|
5951
|
+
const y = chunkHMQVOPQH_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5991
5952
|
lines.push(
|
|
5992
5953
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5993
5954
|
"line",
|
|
@@ -6105,7 +6066,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6105
6066
|
showK && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6106
6067
|
"th",
|
|
6107
6068
|
{
|
|
6108
|
-
"aria-label":
|
|
6069
|
+
"aria-label": chunkN6IHR6PS_js.translationsEn["pptx.chart.rowLabelsAria"],
|
|
6109
6070
|
style: {
|
|
6110
6071
|
padding: "1px 4px",
|
|
6111
6072
|
fontWeight: 400,
|
|
@@ -6149,7 +6110,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6149
6110
|
width: 8,
|
|
6150
6111
|
height: 8,
|
|
6151
6112
|
borderRadius: 2,
|
|
6152
|
-
backgroundColor:
|
|
6113
|
+
backgroundColor: chunkHMQVOPQH_js.seriesColor(
|
|
6153
6114
|
s,
|
|
6154
6115
|
si,
|
|
6155
6116
|
chartData.style?.styleId,
|
|
@@ -6188,8 +6149,8 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6188
6149
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
6189
6150
|
const style = chartData.style;
|
|
6190
6151
|
const legendPos = style?.legendPosition || "b";
|
|
6191
|
-
const range =
|
|
6192
|
-
const layout =
|
|
6152
|
+
const range = chunkHMQVOPQH_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6153
|
+
const layout = chunkHMQVOPQH_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6193
6154
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6194
6155
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
6195
6156
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -6210,10 +6171,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6210
6171
|
const close = closeSeries.values[ci] ?? high;
|
|
6211
6172
|
const isUp = close >= open;
|
|
6212
6173
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
6213
|
-
const highY =
|
|
6214
|
-
const lowY =
|
|
6215
|
-
const openY =
|
|
6216
|
-
const closeY =
|
|
6174
|
+
const highY = chunkHMQVOPQH_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
6175
|
+
const lowY = chunkHMQVOPQH_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
6176
|
+
const openY = chunkHMQVOPQH_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
6177
|
+
const closeY = chunkHMQVOPQH_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
|
|
6217
6178
|
elements.push(
|
|
6218
6179
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6219
6180
|
"line",
|
|
@@ -6256,7 +6217,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6256
6217
|
textAnchor: "middle",
|
|
6257
6218
|
fontSize: 7,
|
|
6258
6219
|
fill: "#334155",
|
|
6259
|
-
children:
|
|
6220
|
+
children: chunkHMQVOPQH_js.formatAxisValue(close)
|
|
6260
6221
|
},
|
|
6261
6222
|
`${element.id}-stock-dl-${ci}`
|
|
6262
6223
|
)
|
|
@@ -6298,7 +6259,7 @@ function FailedToLoad() {
|
|
|
6298
6259
|
var LazySurfaceChart3DScene = React6__default.default.lazy(
|
|
6299
6260
|
async () => {
|
|
6300
6261
|
try {
|
|
6301
|
-
return await import('./SurfaceChart3DScene-
|
|
6262
|
+
return await import('./SurfaceChart3DScene-ADKCYYOQ.js');
|
|
6302
6263
|
} catch {
|
|
6303
6264
|
return { default: FailedToLoad };
|
|
6304
6265
|
}
|
|
@@ -6322,7 +6283,7 @@ var SurfaceChart3DErrorBoundary = class extends React6__default.default.Componen
|
|
|
6322
6283
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
6323
6284
|
const rows = chartData.series.length;
|
|
6324
6285
|
const cols = Math.max(categoryLabels.length, 1);
|
|
6325
|
-
const range =
|
|
6286
|
+
const range = chunkHMQVOPQH_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6326
6287
|
const heightMap = new Float32Array(rows * cols);
|
|
6327
6288
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
6328
6289
|
for (let r = 0; r < rows; r++) {
|
|
@@ -6442,8 +6403,8 @@ function darkenRgb(r, g, b, factor) {
|
|
|
6442
6403
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
6443
6404
|
const style = chartData.style;
|
|
6444
6405
|
const legendPos = style?.legendPosition || "b";
|
|
6445
|
-
const layout =
|
|
6446
|
-
const range =
|
|
6406
|
+
const layout = chunkHMQVOPQH_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6407
|
+
const range = chunkHMQVOPQH_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6447
6408
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6448
6409
|
const seriesCount = chartData.series.length;
|
|
6449
6410
|
const cols = catCount - 1;
|
|
@@ -6533,8 +6494,8 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6533
6494
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
6534
6495
|
const style = chartData.style;
|
|
6535
6496
|
const legendPos = style?.legendPosition || "b";
|
|
6536
|
-
const layout =
|
|
6537
|
-
const range =
|
|
6497
|
+
const layout = chunkHMQVOPQH_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6498
|
+
const range = chunkHMQVOPQH_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6538
6499
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6539
6500
|
const seriesCount = chartData.series.length;
|
|
6540
6501
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -6597,7 +6558,7 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6597
6558
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
6598
6559
|
const style = chartData.style;
|
|
6599
6560
|
const legendPos = style?.legendPosition || "b";
|
|
6600
|
-
const layout =
|
|
6561
|
+
const layout = chunkHMQVOPQH_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6601
6562
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
6602
6563
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
6603
6564
|
const rects = [];
|
|
@@ -6620,7 +6581,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
6620
6581
|
y: curY,
|
|
6621
6582
|
width: Math.max(w - 1, 1),
|
|
6622
6583
|
height: Math.max(h - 1, 1),
|
|
6623
|
-
fill:
|
|
6584
|
+
fill: chunkHMQVOPQH_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
6624
6585
|
rx: 2,
|
|
6625
6586
|
opacity: 0.85
|
|
6626
6587
|
},
|
|
@@ -6673,8 +6634,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6673
6634
|
const style = chartData.style;
|
|
6674
6635
|
const legendPos = style?.legendPosition || "b";
|
|
6675
6636
|
const values = chartData.series[0]?.values ?? [];
|
|
6676
|
-
const range =
|
|
6677
|
-
const layout =
|
|
6637
|
+
const range = chunkHMQVOPQH_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6638
|
+
const layout = chunkHMQVOPQH_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6678
6639
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
6679
6640
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
6680
6641
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -6685,8 +6646,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6685
6646
|
const isLast = i === values.length - 1;
|
|
6686
6647
|
const startVal = isLast ? 0 : runningTotal;
|
|
6687
6648
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
6688
|
-
const barStartY =
|
|
6689
|
-
const barEndY =
|
|
6649
|
+
const barStartY = chunkHMQVOPQH_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
6650
|
+
const barEndY = chunkHMQVOPQH_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
|
|
6690
6651
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
6691
6652
|
const y = Math.min(barStartY, barEndY);
|
|
6692
6653
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -6715,7 +6676,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6715
6676
|
textAnchor: "middle",
|
|
6716
6677
|
fontSize: 7,
|
|
6717
6678
|
fill: "#334155",
|
|
6718
|
-
children:
|
|
6679
|
+
children: chunkHMQVOPQH_js.formatAxisValue(isLast ? endVal : val)
|
|
6719
6680
|
},
|
|
6720
6681
|
`${element.id}-wf-dl-${i}`
|
|
6721
6682
|
)
|
|
@@ -6763,18 +6724,18 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6763
6724
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
6764
6725
|
const style = chartData.style;
|
|
6765
6726
|
const legendPos = style?.legendPosition || "b";
|
|
6766
|
-
const layoutOpts =
|
|
6727
|
+
const layoutOpts = chunkHMQVOPQH_js.computeLayoutOptions(
|
|
6767
6728
|
chartData.axes,
|
|
6768
6729
|
chartData.dataTable,
|
|
6769
6730
|
chartData.series.length
|
|
6770
6731
|
);
|
|
6771
|
-
const layout =
|
|
6772
|
-
const { primary, secondary } =
|
|
6732
|
+
const layout = chunkHMQVOPQH_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
6733
|
+
const { primary, secondary } = chunkHMQVOPQH_js.splitSeriesByAxis(chartData.series, chartData.axes);
|
|
6773
6734
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
6774
6735
|
const secondarySeries = secondary.map((e) => e.series);
|
|
6775
|
-
const range =
|
|
6776
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
6777
|
-
const secondaryAxisFmt =
|
|
6736
|
+
const range = chunkHMQVOPQH_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
6737
|
+
const secondaryRange = secondarySeries.length > 0 ? chunkHMQVOPQH_js.computeValueRange(secondarySeries) : void 0;
|
|
6738
|
+
const secondaryAxisFmt = chunkHMQVOPQH_js.getSecondaryValueAxis(chartData.axes);
|
|
6778
6739
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6779
6740
|
const barSeriesCount = 1;
|
|
6780
6741
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -6790,8 +6751,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6790
6751
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
6791
6752
|
barSeries.values.forEach((val, vi) => {
|
|
6792
6753
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
6793
|
-
const zeroY =
|
|
6794
|
-
const valY =
|
|
6754
|
+
const zeroY = chunkHMQVOPQH_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
6755
|
+
const valY = chunkHMQVOPQH_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
|
|
6795
6756
|
const y = Math.min(zeroY, valY);
|
|
6796
6757
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
6797
6758
|
barElements.push(
|
|
@@ -6802,7 +6763,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6802
6763
|
y,
|
|
6803
6764
|
width: barWidth,
|
|
6804
6765
|
height: h,
|
|
6805
|
-
fill:
|
|
6766
|
+
fill: chunkHMQVOPQH_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
6806
6767
|
rx: 1
|
|
6807
6768
|
},
|
|
6808
6769
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -6818,7 +6779,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6818
6779
|
textAnchor: "middle",
|
|
6819
6780
|
fontSize: 7,
|
|
6820
6781
|
fill: "#334155",
|
|
6821
|
-
children:
|
|
6782
|
+
children: chunkHMQVOPQH_js.formatAxisValue(val)
|
|
6822
6783
|
},
|
|
6823
6784
|
`${element.id}-combo-bar-dl-${vi}`
|
|
6824
6785
|
)
|
|
@@ -6835,10 +6796,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6835
6796
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
6836
6797
|
const points = series.values.map((val, vi) => {
|
|
6837
6798
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
6838
|
-
const y =
|
|
6799
|
+
const y = chunkHMQVOPQH_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
6839
6800
|
return { x, y, val };
|
|
6840
6801
|
});
|
|
6841
|
-
const c =
|
|
6802
|
+
const c = chunkHMQVOPQH_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
6842
6803
|
lineElements.push(
|
|
6843
6804
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6844
6805
|
"polyline",
|
|
@@ -6865,7 +6826,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6865
6826
|
textAnchor: "middle",
|
|
6866
6827
|
fontSize: 7,
|
|
6867
6828
|
fill: "#334155",
|
|
6868
|
-
children:
|
|
6829
|
+
children: chunkHMQVOPQH_js.formatAxisValue(p.val)
|
|
6869
6830
|
},
|
|
6870
6831
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
6871
6832
|
)
|
|
@@ -6903,11 +6864,11 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6903
6864
|
}
|
|
6904
6865
|
function renderChartElement(element) {
|
|
6905
6866
|
if (element.type !== "chart") {
|
|
6906
|
-
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: chunkN6IHR6PS_js.translationsEn["pptx.chart.heading"] });
|
|
6907
6868
|
}
|
|
6908
6869
|
const chartData = element.chartData;
|
|
6909
6870
|
if (!chartData || chartData.series.length === 0) {
|
|
6910
|
-
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: chunkN6IHR6PS_js.translationsEn["pptx.chart.heading"] });
|
|
6911
6872
|
}
|
|
6912
6873
|
const longestSeriesLength = chartData.series.reduce(
|
|
6913
6874
|
(maxLength, series) => Math.max(maxLength, series.values.length),
|
|
@@ -8011,14 +7972,14 @@ function buildNotesPdf(pages) {
|
|
|
8011
7972
|
notes: page.notes,
|
|
8012
7973
|
slideNumber: page.slideNumber
|
|
8013
7974
|
}));
|
|
8014
|
-
const bytes =
|
|
7975
|
+
const bytes = chunkHMQVOPQH_js.buildNotesPdfBytes(images, meta);
|
|
8015
7976
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
8016
7977
|
return URL.createObjectURL(blob);
|
|
8017
7978
|
}
|
|
8018
7979
|
|
|
8019
7980
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
8020
7981
|
function buildPdfFromImageData(images) {
|
|
8021
|
-
const bytes =
|
|
7982
|
+
const bytes = chunkHMQVOPQH_js.buildSlidesPdfBytes(images);
|
|
8022
7983
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
8023
7984
|
return URL.createObjectURL(blob);
|
|
8024
7985
|
}
|
|
@@ -8027,10 +7988,35 @@ function buildPdfFromImageData(images) {
|
|
|
8027
7988
|
var activePreview = null;
|
|
8028
7989
|
function startPreviewAnimation(elementId, preset, options) {
|
|
8029
7990
|
stopPreviewAnimation();
|
|
8030
|
-
const descriptor =
|
|
7991
|
+
const descriptor = chunkHMQVOPQH_js.buildPreviewAnimation(preset, options);
|
|
7992
|
+
if (!descriptor) {
|
|
7993
|
+
return;
|
|
7994
|
+
}
|
|
7995
|
+
playDescriptor(elementId, descriptor);
|
|
7996
|
+
}
|
|
7997
|
+
function startMotionPathPreview(elementId, path, options) {
|
|
7998
|
+
stopPreviewAnimation();
|
|
7999
|
+
const domEl = document.querySelector(`[data-element-id="${elementId}"]`);
|
|
8000
|
+
if (!domEl) {
|
|
8001
|
+
return;
|
|
8002
|
+
}
|
|
8003
|
+
const stage = domEl.offsetParent;
|
|
8004
|
+
const descriptor = chunkHMQVOPQH_js.buildMotionPathPreview({
|
|
8005
|
+
path,
|
|
8006
|
+
slideWidth: stage?.offsetWidth || DEFAULT_PREVIEW_SLIDE_WIDTH,
|
|
8007
|
+
slideHeight: stage?.offsetHeight || DEFAULT_PREVIEW_SLIDE_HEIGHT,
|
|
8008
|
+
durationMs: options?.durationMs,
|
|
8009
|
+
delayMs: options?.delayMs,
|
|
8010
|
+
timingCurve: options?.timingCurve
|
|
8011
|
+
});
|
|
8031
8012
|
if (!descriptor) {
|
|
8032
8013
|
return;
|
|
8033
8014
|
}
|
|
8015
|
+
playDescriptor(elementId, descriptor);
|
|
8016
|
+
}
|
|
8017
|
+
var DEFAULT_PREVIEW_SLIDE_WIDTH = 1280;
|
|
8018
|
+
var DEFAULT_PREVIEW_SLIDE_HEIGHT = 720;
|
|
8019
|
+
function playDescriptor(elementId, descriptor) {
|
|
8034
8020
|
const domEl = document.querySelector(`[data-element-id="${elementId}"]`);
|
|
8035
8021
|
if (!domEl) {
|
|
8036
8022
|
return;
|
|
@@ -8153,6 +8139,7 @@ exports.resolveSmartArtDataPalette = resolveSmartArtDataPalette;
|
|
|
8153
8139
|
exports.resolveStyle = resolveStyle;
|
|
8154
8140
|
exports.shouldRenderFallbackLabel = shouldRenderFallbackLabel;
|
|
8155
8141
|
exports.smartArtNodeGroupProps = smartArtNodeGroupProps;
|
|
8142
|
+
exports.startMotionPathPreview = startMotionPathPreview;
|
|
8156
8143
|
exports.startPreviewAnimation = startPreviewAnimation;
|
|
8157
8144
|
exports.stopAllPersistentAudio = stopAllPersistentAudio;
|
|
8158
8145
|
exports.stopPreviewAnimation = stopPreviewAnimation;
|