pptx-react-viewer 2.13.0 → 2.13.2
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 +8 -0
- package/dist/{AiChatPanel-DEI3EQFM.js → AiChatPanel-F4E3A2DE.js} +35 -27
- package/dist/AiChatPanel-F4E3A2DE.js.br +0 -0
- package/dist/AiChatPanel-F4E3A2DE.js.gz +0 -0
- package/dist/{AiChatPanel-4YS6DEIT.mjs → AiChatPanel-VEULATXX.mjs} +15 -7
- package/dist/AiChatPanel-VEULATXX.mjs.br +0 -0
- package/dist/AiChatPanel-VEULATXX.mjs.gz +0 -0
- package/dist/{Model3DScene-JSNQCKCJ.mjs → Model3DScene-KIPEODEJ.mjs} +1 -1
- package/dist/Model3DScene-KIPEODEJ.mjs.br +0 -0
- package/dist/Model3DScene-KIPEODEJ.mjs.gz +0 -0
- package/dist/{Model3DScene-X4W7GZVY.js → Model3DScene-TD2LIHYP.js} +2 -2
- package/dist/Model3DScene-TD2LIHYP.js.br +0 -0
- package/dist/Model3DScene-TD2LIHYP.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-3MSU74YH.mjs → SurfaceChart3DScene-GRBWZ52S.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-3MSU74YH.mjs.br → SurfaceChart3DScene-GRBWZ52S.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-GRBWZ52S.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-IZLUWT27.js → SurfaceChart3DScene-OTKXQH5O.js} +2 -2
- package/dist/SurfaceChart3DScene-OTKXQH5O.js.br +0 -0
- package/dist/SurfaceChart3DScene-OTKXQH5O.js.gz +0 -0
- package/dist/{chunk-YA7VFYTW.mjs → chunk-3HWE6QZG.mjs} +16 -7
- package/dist/chunk-3HWE6QZG.mjs.br +0 -0
- package/dist/chunk-3HWE6QZG.mjs.gz +0 -0
- package/dist/{chunk-RWIQHVZQ.js → chunk-BNSCH4WT.js} +340 -326
- package/dist/chunk-BNSCH4WT.js.br +0 -0
- package/dist/chunk-BNSCH4WT.js.gz +0 -0
- package/dist/{chunk-IDW5UPXW.js → chunk-DOS7NY7C.js} +259 -295
- package/dist/chunk-DOS7NY7C.js.br +0 -0
- package/dist/chunk-DOS7NY7C.js.gz +0 -0
- package/dist/{chunk-SHZ3GWOD.js → chunk-EUQ2IER3.js} +1046 -1037
- package/dist/chunk-EUQ2IER3.js.br +0 -0
- package/dist/chunk-EUQ2IER3.js.gz +0 -0
- package/dist/{chunk-EFSQW6S5.js → chunk-FDR5W67L.js} +713 -349
- package/dist/chunk-FDR5W67L.js.br +0 -0
- package/dist/chunk-FDR5W67L.js.gz +0 -0
- package/dist/{chunk-4TD7EINA.mjs → chunk-GKOKCOXR.mjs} +709 -350
- package/dist/chunk-GKOKCOXR.mjs.br +0 -0
- package/dist/chunk-GKOKCOXR.mjs.gz +0 -0
- package/dist/{chunk-HRLF4REI.mjs → chunk-GZ6TXBEO.mjs} +21 -56
- package/dist/chunk-GZ6TXBEO.mjs.br +0 -0
- package/dist/chunk-GZ6TXBEO.mjs.gz +0 -0
- package/dist/{chunk-WEU5EMKK.mjs → chunk-L5YGPCQW.mjs} +1 -1
- package/dist/chunk-L5YGPCQW.mjs.br +0 -0
- package/dist/chunk-L5YGPCQW.mjs.gz +0 -0
- package/dist/{chunk-G2LZT5SV.js → chunk-VY3KLDJF.js} +3 -3
- package/dist/chunk-VY3KLDJF.js.br +0 -0
- package/dist/chunk-VY3KLDJF.js.gz +0 -0
- package/dist/{chunk-6KRNQ2KF.mjs → chunk-ZFRPPY2N.mjs} +16 -2
- package/dist/chunk-ZFRPPY2N.mjs.br +0 -0
- package/dist/chunk-ZFRPPY2N.mjs.gz +0 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +34 -34
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +14 -0
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +78 -78
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +3 -3
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/viewer/index.d.ts +14 -0
- package/dist/viewer/index.js +21 -21
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +5 -5
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-4YS6DEIT.mjs.br +0 -0
- package/dist/AiChatPanel-4YS6DEIT.mjs.gz +0 -0
- package/dist/AiChatPanel-DEI3EQFM.js.br +0 -0
- package/dist/AiChatPanel-DEI3EQFM.js.gz +0 -0
- package/dist/Model3DScene-JSNQCKCJ.mjs.br +0 -0
- package/dist/Model3DScene-JSNQCKCJ.mjs.gz +0 -0
- package/dist/Model3DScene-X4W7GZVY.js.br +0 -0
- package/dist/Model3DScene-X4W7GZVY.js.gz +0 -0
- package/dist/SurfaceChart3DScene-3MSU74YH.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-IZLUWT27.js.br +0 -0
- package/dist/SurfaceChart3DScene-IZLUWT27.js.gz +0 -0
- package/dist/chunk-4TD7EINA.mjs.br +0 -0
- package/dist/chunk-4TD7EINA.mjs.gz +0 -0
- package/dist/chunk-6KRNQ2KF.mjs.br +0 -0
- package/dist/chunk-6KRNQ2KF.mjs.gz +0 -0
- package/dist/chunk-EFSQW6S5.js.br +0 -0
- package/dist/chunk-EFSQW6S5.js.gz +0 -0
- package/dist/chunk-G2LZT5SV.js.br +0 -0
- package/dist/chunk-G2LZT5SV.js.gz +0 -0
- package/dist/chunk-HRLF4REI.mjs.br +0 -0
- package/dist/chunk-HRLF4REI.mjs.gz +0 -0
- package/dist/chunk-IDW5UPXW.js.br +0 -0
- package/dist/chunk-IDW5UPXW.js.gz +0 -0
- package/dist/chunk-RWIQHVZQ.js.br +0 -0
- package/dist/chunk-RWIQHVZQ.js.gz +0 -0
- package/dist/chunk-SHZ3GWOD.js.br +0 -0
- package/dist/chunk-SHZ3GWOD.js.gz +0 -0
- package/dist/chunk-WEU5EMKK.mjs.br +0 -0
- package/dist/chunk-WEU5EMKK.mjs.gz +0 -0
- package/dist/chunk-YA7VFYTW.mjs.br +0 -0
- package/dist/chunk-YA7VFYTW.mjs.gz +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkBXAK3JFM_js = require('./chunk-BXAK3JFM.js');
|
|
4
|
-
var
|
|
4
|
+
var chunkFDR5W67L_js = require('./chunk-FDR5W67L.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 chunkFDR5W67L_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 chunkFDR5W67L_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 = chunkFDR5W67L_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 = chunkFDR5W67L_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 (!chunkFDR5W67L_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) => chunkFDR5W67L_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) => !chunkFDR5W67L_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 (!chunkFDR5W67L_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 = chunkFDR5W67L_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 = chunkFDR5W67L_js.getResolvedShapeClipPath(element);
|
|
323
323
|
if (!clipPath) {
|
|
324
324
|
return void 0;
|
|
325
325
|
}
|
|
@@ -328,7 +328,7 @@ function getImageMaskStyle(element) {
|
|
|
328
328
|
function getImageRenderStyle(element) {
|
|
329
329
|
return {
|
|
330
330
|
...getImageMaskStyle(element) || {},
|
|
331
|
-
...
|
|
331
|
+
...chunkFDR5W67L_js.getImageFitStyle(element)
|
|
332
332
|
};
|
|
333
333
|
}
|
|
334
334
|
var CROP_SHAPE_CLIP_PATHS = {
|
|
@@ -341,7 +341,7 @@ var CROP_SHAPE_CLIP_PATHS = {
|
|
|
341
341
|
star: "polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)"
|
|
342
342
|
};
|
|
343
343
|
function getCropShapeClipPath(element) {
|
|
344
|
-
if (!
|
|
344
|
+
if (!chunkFDR5W67L_js.isImageLikeElement(element)) {
|
|
345
345
|
return void 0;
|
|
346
346
|
}
|
|
347
347
|
const shape = element.cropShape;
|
|
@@ -351,7 +351,7 @@ function getCropShapeClipPath(element) {
|
|
|
351
351
|
return CROP_SHAPE_CLIP_PATHS[shape];
|
|
352
352
|
}
|
|
353
353
|
function isImageTiled(element) {
|
|
354
|
-
if (!
|
|
354
|
+
if (!chunkFDR5W67L_js.isImageLikeElement(element)) {
|
|
355
355
|
return false;
|
|
356
356
|
}
|
|
357
357
|
return typeof element.tileScaleX === "number" || typeof element.tileScaleY === "number";
|
|
@@ -409,7 +409,7 @@ function buildMirrorTiledBackground(src, flip, scaleX, scaleY) {
|
|
|
409
409
|
};
|
|
410
410
|
}
|
|
411
411
|
function getImageTilingStyle(element) {
|
|
412
|
-
if (!
|
|
412
|
+
if (!chunkFDR5W67L_js.isImageLikeElement(element) || !isImageTiled(element)) {
|
|
413
413
|
return void 0;
|
|
414
414
|
}
|
|
415
415
|
const scaleX = typeof element.tileScaleX === "number" ? element.tileScaleX * 100 : 100;
|
|
@@ -469,37 +469,6 @@ function ensureArrayValue(value) {
|
|
|
469
469
|
}
|
|
470
470
|
|
|
471
471
|
// src/viewer/utils/media-persistent-audio.tsx
|
|
472
|
-
var persistentAudioMap = /* @__PURE__ */ new Map();
|
|
473
|
-
function registerPersistentAudio(elementId, dataUrl, mimetype, loop, volume, trimStartSec) {
|
|
474
|
-
if (persistentAudioMap.has(elementId)) {
|
|
475
|
-
return;
|
|
476
|
-
}
|
|
477
|
-
const audio = document.createElement("audio");
|
|
478
|
-
audio.src = dataUrl;
|
|
479
|
-
if (mimetype) {
|
|
480
|
-
const source = document.createElement("source");
|
|
481
|
-
source.src = dataUrl;
|
|
482
|
-
source.type = mimetype;
|
|
483
|
-
audio.appendChild(source);
|
|
484
|
-
}
|
|
485
|
-
audio.loop = loop;
|
|
486
|
-
audio.volume = Math.max(0, Math.min(1, volume));
|
|
487
|
-
if (trimStartSec > 0) {
|
|
488
|
-
audio.currentTime = trimStartSec;
|
|
489
|
-
}
|
|
490
|
-
audio.style.display = "none";
|
|
491
|
-
document.body.appendChild(audio);
|
|
492
|
-
persistentAudioMap.set(elementId, { elementId, audio, loop });
|
|
493
|
-
void audio.play().catch(() => {
|
|
494
|
-
});
|
|
495
|
-
}
|
|
496
|
-
function stopAllPersistentAudio() {
|
|
497
|
-
for (const entry of persistentAudioMap.values()) {
|
|
498
|
-
entry.audio.pause();
|
|
499
|
-
entry.audio.remove();
|
|
500
|
-
}
|
|
501
|
-
persistentAudioMap.clear();
|
|
502
|
-
}
|
|
503
472
|
function buildTrimFragment(element) {
|
|
504
473
|
const start = element.trimStartMs;
|
|
505
474
|
const end = element.trimEndMs;
|
|
@@ -690,15 +659,16 @@ function registerMediaElement(elementId, el) {
|
|
|
690
659
|
};
|
|
691
660
|
}
|
|
692
661
|
function executeMediaCommand(command, frameRoot) {
|
|
693
|
-
return
|
|
662
|
+
return chunkFDR5W67L_js.runMediaCommand(
|
|
694
663
|
command,
|
|
695
|
-
(targetId) => registry.get(targetId) ??
|
|
664
|
+
(targetId) => registry.get(targetId) ?? chunkFDR5W67L_js.findMediaElementByElementId(targetId, frameRoot?.())
|
|
696
665
|
);
|
|
697
666
|
}
|
|
698
667
|
function PresentationMediaController({
|
|
699
668
|
element,
|
|
700
669
|
isPresentationMode,
|
|
701
670
|
shouldAutoPlay,
|
|
671
|
+
resolvedDataUrl,
|
|
702
672
|
isFullScreen,
|
|
703
673
|
onPlayStateChange,
|
|
704
674
|
children
|
|
@@ -731,7 +701,11 @@ function PresentationMediaController({
|
|
|
731
701
|
}
|
|
732
702
|
return registerMediaElement(element.id, el);
|
|
733
703
|
}, [element.id]);
|
|
734
|
-
const {
|
|
704
|
+
const {
|
|
705
|
+
loop: shouldLoop,
|
|
706
|
+
volume: playbackVolume,
|
|
707
|
+
playbackRate
|
|
708
|
+
} = chunkFDR5W67L_js.mediaPlaybackAttributes({
|
|
735
709
|
loop: element.loop,
|
|
736
710
|
volume: element.volume,
|
|
737
711
|
playbackSpeed: element.playbackSpeed
|
|
@@ -865,18 +839,18 @@ function PresentationMediaController({
|
|
|
865
839
|
return;
|
|
866
840
|
}
|
|
867
841
|
if (element.playAcrossSlides && element.mediaType === "audio") {
|
|
868
|
-
const dataUrl = element.mediaData ??
|
|
842
|
+
const dataUrl = element.mediaData ?? resolvedDataUrl;
|
|
869
843
|
if (dataUrl) {
|
|
870
|
-
registerPersistentAudio(
|
|
844
|
+
chunkFDR5W67L_js.registerPersistentAudio(
|
|
871
845
|
element.id,
|
|
872
846
|
dataUrl,
|
|
873
847
|
element.mediaMimeType,
|
|
874
|
-
|
|
875
|
-
|
|
848
|
+
shouldLoop,
|
|
849
|
+
playbackVolume,
|
|
876
850
|
trimStartSec
|
|
877
851
|
);
|
|
852
|
+
return;
|
|
878
853
|
}
|
|
879
|
-
return;
|
|
880
854
|
}
|
|
881
855
|
const el = mediaRef.current;
|
|
882
856
|
if (!el) {
|
|
@@ -896,12 +870,12 @@ function PresentationMediaController({
|
|
|
896
870
|
element.playAcrossSlides,
|
|
897
871
|
element.mediaType,
|
|
898
872
|
element.mediaData,
|
|
899
|
-
element.mediaPath,
|
|
900
873
|
element.mediaMimeType,
|
|
901
|
-
element.loop,
|
|
902
874
|
element.id,
|
|
903
|
-
|
|
904
|
-
|
|
875
|
+
resolvedDataUrl,
|
|
876
|
+
shouldLoop,
|
|
877
|
+
playbackVolume,
|
|
878
|
+
trimStartSec
|
|
905
879
|
]);
|
|
906
880
|
const wrapperStyle = hideWhenNotPlaying ? {
|
|
907
881
|
opacity: isMediaPlaying ? 1 : 0,
|
|
@@ -938,22 +912,11 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
938
912
|
const dataUrl = element.mediaData ?? (mediaPath ? mediaDataUrls.get(mediaPath) : void 0);
|
|
939
913
|
const trimFragment = buildTrimFragment(element);
|
|
940
914
|
const posterUrl = element.posterFrameData ?? void 0;
|
|
941
|
-
const shouldLoop =
|
|
915
|
+
const shouldLoop = chunkFDR5W67L_js.mediaPlaybackAttributes(element).loop;
|
|
942
916
|
const shouldAutoPlay = options?.autoPlay === true || element.autoPlay === true;
|
|
943
917
|
const isFullScreen = options?.fullScreen === true;
|
|
944
918
|
const isPresentationMode = options?.isPresentationMode === true;
|
|
945
919
|
const showTransport = options?.showTransport ?? !isPresentationMode;
|
|
946
|
-
if (isPresentationMode && shouldAutoPlay && element.playAcrossSlides && element.mediaType === "audio" && dataUrl && !element.mediaData) {
|
|
947
|
-
const trimStartSec = element.trimStartMs !== void 0 ? element.trimStartMs / 1e3 : 0;
|
|
948
|
-
registerPersistentAudio(
|
|
949
|
-
element.id,
|
|
950
|
-
dataUrl,
|
|
951
|
-
mediaMimeType,
|
|
952
|
-
shouldLoop,
|
|
953
|
-
element.volume ?? 1,
|
|
954
|
-
trimStartSec
|
|
955
|
-
);
|
|
956
|
-
}
|
|
957
920
|
if (element.mediaMissing) {
|
|
958
921
|
if (posterUrl) {
|
|
959
922
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full h-full relative pointer-events-none", children: [
|
|
@@ -996,6 +959,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
996
959
|
element,
|
|
997
960
|
isPresentationMode,
|
|
998
961
|
shouldAutoPlay,
|
|
962
|
+
resolvedDataUrl: dataUrl,
|
|
999
963
|
isFullScreen,
|
|
1000
964
|
onPlayStateChange: options?.onPlayStateChange,
|
|
1001
965
|
children: ({ mediaRef, onPlay }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1068,6 +1032,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1068
1032
|
element,
|
|
1069
1033
|
isPresentationMode,
|
|
1070
1034
|
shouldAutoPlay,
|
|
1035
|
+
resolvedDataUrl: dataUrl,
|
|
1071
1036
|
isFullScreen: false,
|
|
1072
1037
|
onPlayStateChange: options?.onPlayStateChange,
|
|
1073
1038
|
children: ({ mediaRef, onPlay }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1113,7 +1078,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1113
1078
|
|
|
1114
1079
|
// src/viewer/utils/text-utils.tsx
|
|
1115
1080
|
function getTextStyleForElement(element, fallbackColor) {
|
|
1116
|
-
return
|
|
1081
|
+
return chunkFDR5W67L_js.buildTextBlockStyle(element, { fallbackColor });
|
|
1117
1082
|
}
|
|
1118
1083
|
|
|
1119
1084
|
// src/viewer/utils/text-layout.tsx
|
|
@@ -1138,13 +1103,13 @@ function computeTabSize(tabStops, defaultTabSize) {
|
|
|
1138
1103
|
return avgGap > 0 ? `${Math.round(avgGap)}px` : fromDefault;
|
|
1139
1104
|
}
|
|
1140
1105
|
function getTextLayoutStyle(element) {
|
|
1141
|
-
if (!
|
|
1106
|
+
if (!chunkFDR5W67L_js.hasTextProperties(element)) {
|
|
1142
1107
|
return {};
|
|
1143
1108
|
}
|
|
1144
1109
|
const verticalAlign = element.textStyle?.vAlign || "top";
|
|
1145
|
-
const writingMode =
|
|
1146
|
-
const textOrientation =
|
|
1147
|
-
const verticalDirection =
|
|
1110
|
+
const writingMode = chunkFDR5W67L_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
1111
|
+
const textOrientation = chunkFDR5W67L_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
1112
|
+
const verticalDirection = chunkFDR5W67L_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
1148
1113
|
const parsedColumnCount = Number(element.textStyle?.columnCount);
|
|
1149
1114
|
const columnCount = Number.isFinite(parsedColumnCount) ? Math.max(1, Math.min(16, Math.round(parsedColumnCount))) : 1;
|
|
1150
1115
|
const hasColumns = columnCount > 1;
|
|
@@ -1152,7 +1117,7 @@ function getTextLayoutStyle(element) {
|
|
|
1152
1117
|
const tabStops = element.textStyle?.tabStops;
|
|
1153
1118
|
const tabSize = computeTabSize(tabStops, element.textStyle?.defaultTabSize);
|
|
1154
1119
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
1155
|
-
const hasParagraphIndents =
|
|
1120
|
+
const hasParagraphIndents = chunkFDR5W67L_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
1156
1121
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
1157
1122
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
1158
1123
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
@@ -1161,7 +1126,7 @@ function getTextLayoutStyle(element) {
|
|
|
1161
1126
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
1162
1127
|
const parsedColumnSpacing = Number(element.textStyle?.columnSpacing);
|
|
1163
1128
|
const columnGap = Number.isFinite(parsedColumnSpacing) && parsedColumnSpacing > 0 ? `${parsedColumnSpacing}px` : "0.75em";
|
|
1164
|
-
const kinsokuStyles =
|
|
1129
|
+
const kinsokuStyles = chunkFDR5W67L_js.getKinsokuLineBreakStyles(element.textStyle);
|
|
1165
1130
|
if (hasColumns) {
|
|
1166
1131
|
return {
|
|
1167
1132
|
display: "block",
|
|
@@ -1208,10 +1173,10 @@ function getTextLayoutStyle(element) {
|
|
|
1208
1173
|
|
|
1209
1174
|
// src/viewer/utils/text-effects.tsx
|
|
1210
1175
|
function buildTextFillCss2(style) {
|
|
1211
|
-
return
|
|
1176
|
+
return chunkFDR5W67L_js.buildTextFillCss(style);
|
|
1212
1177
|
}
|
|
1213
1178
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
1214
|
-
return
|
|
1179
|
+
return chunkFDR5W67L_js.buildTextBody3DSceneStyle(textStyle);
|
|
1215
1180
|
}
|
|
1216
1181
|
|
|
1217
1182
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -1396,13 +1361,13 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1396
1361
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
1397
1362
|
return renderedSegments;
|
|
1398
1363
|
}
|
|
1399
|
-
const paraKey = `${elementId}${
|
|
1364
|
+
const paraKey = `${elementId}${chunkFDR5W67L_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
1400
1365
|
const paraState = subElementAnimStates.get(paraKey);
|
|
1401
1366
|
if (paraState) {
|
|
1402
1367
|
const style = buildAnimStyle(paraState);
|
|
1403
1368
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
1404
1369
|
}
|
|
1405
|
-
const spec =
|
|
1370
|
+
const spec = chunkFDR5W67L_js.buildTextBuildSpec(
|
|
1406
1371
|
elementId,
|
|
1407
1372
|
paraIndex,
|
|
1408
1373
|
paraSegments.map((entry) => ({ text: entry.segment.text, style: entry })),
|
|
@@ -1420,7 +1385,7 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1420
1385
|
"span",
|
|
1421
1386
|
{
|
|
1422
1387
|
"data-anim-id": span.animId,
|
|
1423
|
-
style:
|
|
1388
|
+
style: chunkFDR5W67L_js.textBuildSpanStyle(span),
|
|
1424
1389
|
children: content
|
|
1425
1390
|
},
|
|
1426
1391
|
span.animId
|
|
@@ -1564,10 +1529,10 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1564
1529
|
if (!needsScriptFonts || !text) {
|
|
1565
1530
|
return text;
|
|
1566
1531
|
}
|
|
1567
|
-
const runs =
|
|
1532
|
+
const runs = chunkFDR5W67L_js.segmentByScript(text);
|
|
1568
1533
|
if (runs.length <= 1) {
|
|
1569
1534
|
if (runs.length === 1) {
|
|
1570
|
-
const font =
|
|
1535
|
+
const font = chunkFDR5W67L_js.resolveFontForScript(runs[0].script, scriptFonts);
|
|
1571
1536
|
if (font && font !== baseFontFamily) {
|
|
1572
1537
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: text });
|
|
1573
1538
|
}
|
|
@@ -1575,7 +1540,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1575
1540
|
return text;
|
|
1576
1541
|
}
|
|
1577
1542
|
return runs.map((run, i) => {
|
|
1578
|
-
const font =
|
|
1543
|
+
const font = chunkFDR5W67L_js.resolveFontForScript(run.script, scriptFonts);
|
|
1579
1544
|
if (!font || font === baseFontFamily) {
|
|
1580
1545
|
return /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Fragment, { children: run.text }, `${keyPrefix}-r${i}`);
|
|
1581
1546
|
}
|
|
@@ -1647,8 +1612,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1647
1612
|
);
|
|
1648
1613
|
}
|
|
1649
1614
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
1650
|
-
const mathml =
|
|
1651
|
-
const safeMathml = mathml ?
|
|
1615
|
+
const mathml = chunkFDR5W67L_js.convertOmmlToMathMl(equationXml);
|
|
1616
|
+
const safeMathml = mathml ? chunkFDR5W67L_js.sanitizeMathMl(mathml) : "";
|
|
1652
1617
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1653
1618
|
"span",
|
|
1654
1619
|
{
|
|
@@ -1698,7 +1663,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1698
1663
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: equationContent }, `${elementId}-seg-${segmentIndex}`);
|
|
1699
1664
|
}
|
|
1700
1665
|
function renderPictureBullet(elementId, segmentIndex, bulletInfo, baseFontSize) {
|
|
1701
|
-
const picture =
|
|
1666
|
+
const picture = chunkFDR5W67L_js.resolvePictureBullet(bulletInfo, baseFontSize) ?? {
|
|
1702
1667
|
sizePx: baseFontSize,
|
|
1703
1668
|
fallbackMarker: "\u2022",
|
|
1704
1669
|
accessibleLabel: "Bullet"
|
|
@@ -1749,7 +1714,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1749
1714
|
}
|
|
1750
1715
|
const segmentStyle = segment.style || {};
|
|
1751
1716
|
const rawText = bulletInfo && typeof bulletHangPx === "number" ? (segment.text || "").trimEnd() : segment.text || "";
|
|
1752
|
-
const textValue =
|
|
1717
|
+
const textValue = chunkFDR5W67L_js.substituteFieldText(rawText, segment.fieldType, fieldContext);
|
|
1753
1718
|
const lines = textValue.split("\n");
|
|
1754
1719
|
const textDecorationTokens = [];
|
|
1755
1720
|
if (segmentStyle.underline || segmentStyle.hyperlink) {
|
|
@@ -1759,28 +1724,28 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1759
1724
|
textDecorationTokens.push("line-through");
|
|
1760
1725
|
}
|
|
1761
1726
|
const isDoubleStrike = segmentStyle.strikethrough && segmentStyle.strikeType === "dblStrike";
|
|
1762
|
-
const resolvedSegmentColor = segmentStyle.hyperlink ?
|
|
1763
|
-
const underlineDecoration =
|
|
1727
|
+
const resolvedSegmentColor = segmentStyle.hyperlink ? chunkFDR5W67L_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, HYPERLINK_COLOR) : chunkFDR5W67L_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, fallbackColor);
|
|
1728
|
+
const underlineDecoration = chunkFDR5W67L_js.resolveUnderlineDecorationStyle(
|
|
1764
1729
|
Boolean(isDoubleStrike),
|
|
1765
1730
|
segmentStyle.underlineStyle
|
|
1766
1731
|
);
|
|
1767
1732
|
const rawBaseline = typeof segmentStyle.baseline === "number" ? segmentStyle.baseline : 0;
|
|
1768
1733
|
const baselineFraction = rawBaseline === 0 ? 0 : Math.abs(rawBaseline) >= 1e3 ? rawBaseline / 1e5 : rawBaseline / 100;
|
|
1769
1734
|
const baselineFontScale = baselineFraction !== 0 ? 0.65 : 1;
|
|
1770
|
-
const letterSpacing = typeof segmentStyle.characterSpacing === "number" && segmentStyle.characterSpacing !== 0 ?
|
|
1735
|
+
const letterSpacing = typeof segmentStyle.characterSpacing === "number" && segmentStyle.characterSpacing !== 0 ? `calc(${segmentStyle.characterSpacing / 100 * (96 / 72)}px + ${chunkFDR5W67L_js.POWERPOINT_METRIC_TRACKING})` : chunkFDR5W67L_js.POWERPOINT_METRIC_TRACKING;
|
|
1771
1736
|
const textFillStyles = buildTextFillCss2(segmentStyle);
|
|
1772
1737
|
const rawFontSize = segmentStyle.fontSize || element.textStyle?.fontSize || DEFAULT_TEXT_FONT_SIZE;
|
|
1773
|
-
const autoFitScale =
|
|
1738
|
+
const autoFitScale = chunkFDR5W67L_js.resolveAutoFitFontScale(element.textStyle);
|
|
1774
1739
|
const baseFontSize = rawFontSize * autoFitScale;
|
|
1775
1740
|
const baselineShift = baselineFraction !== 0 ? `${baselineFraction * baseFontSize}px` : void 0;
|
|
1776
1741
|
const baseFontSizePt = baseFontSize * (72 / 96);
|
|
1777
1742
|
const fontKerning = typeof segmentStyle.kerning === "number" ? segmentStyle.kerning === 0 ? "none" : baseFontSizePt >= segmentStyle.kerning / 100 ? "normal" : "none" : void 0;
|
|
1778
1743
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
1779
|
-
const baseFontFamily = rawFontFamily ?
|
|
1744
|
+
const baseFontFamily = rawFontFamily ? chunkFDR5W67L_js.getSubstituteFontFamily(
|
|
1780
1745
|
rawFontFamily,
|
|
1781
|
-
|
|
1746
|
+
chunkFDR5W67L_js.parsePanoseString(segmentStyle.latinFontPanose ?? element.textStyle?.latinFontPanose)
|
|
1782
1747
|
) : DEFAULT_FONT_FAMILY;
|
|
1783
|
-
const scriptFont = (name, panose) => name ?
|
|
1748
|
+
const scriptFont = (name, panose) => name ? chunkFDR5W67L_js.getSubstituteFontFamily(name, chunkFDR5W67L_js.parsePanoseString(panose)) : baseFontFamily;
|
|
1784
1749
|
const scriptFonts = {
|
|
1785
1750
|
latin: baseFontFamily,
|
|
1786
1751
|
eastAsia: scriptFont(
|
|
@@ -1796,7 +1761,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1796
1761
|
segmentStyle.symbolFontPanose ?? element.textStyle?.symbolFontPanose
|
|
1797
1762
|
)
|
|
1798
1763
|
};
|
|
1799
|
-
const needsScriptFonts =
|
|
1764
|
+
const needsScriptFonts = chunkFDR5W67L_js.hasDistinctScriptFonts(scriptFonts);
|
|
1800
1765
|
const spanStyle = {
|
|
1801
1766
|
color: resolvedSegmentColor,
|
|
1802
1767
|
fontSize: baseFontSize * baselineFontScale,
|
|
@@ -1814,15 +1779,15 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1814
1779
|
fontVariantCaps: segmentStyle.textCaps === "small" ? "small-caps" : void 0,
|
|
1815
1780
|
letterSpacing,
|
|
1816
1781
|
fontKerning,
|
|
1817
|
-
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ?
|
|
1782
|
+
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ? chunkFDR5W67L_js.normalizeHexColor(segmentStyle.highlightColor, "transparent") : void 0,
|
|
1818
1783
|
...textFillStyles,
|
|
1819
|
-
textDecorationColor: segmentStyle.underlineColor ?
|
|
1820
|
-
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${
|
|
1784
|
+
textDecorationColor: segmentStyle.underlineColor ? chunkFDR5W67L_js.normalizeHexColor(segmentStyle.underlineColor, void 0) : void 0,
|
|
1785
|
+
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${chunkFDR5W67L_js.normalizeHexColor(segmentStyle.textOutlineColor, "#000000")}` : segmentStyle.textOutlineWidth ? `${segmentStyle.textOutlineWidth}px currentColor` : void 0,
|
|
1821
1786
|
paintOrder: segmentStyle.textOutlineWidth ? "stroke fill" : void 0,
|
|
1822
|
-
textShadow:
|
|
1823
|
-
filter:
|
|
1824
|
-
opacity:
|
|
1825
|
-
WebkitBoxReflect:
|
|
1787
|
+
textShadow: chunkFDR5W67L_js.buildTextShadowCss(segmentStyle),
|
|
1788
|
+
filter: chunkFDR5W67L_js.buildTextRunFilterChain(segmentStyle),
|
|
1789
|
+
opacity: chunkFDR5W67L_js.getTextAlphaOpacity(segmentStyle),
|
|
1790
|
+
WebkitBoxReflect: chunkFDR5W67L_js.buildTextReflectionCss(segmentStyle)
|
|
1826
1791
|
};
|
|
1827
1792
|
const runRtl = segmentStyle.rtl;
|
|
1828
1793
|
if (runRtl !== void 0 && runRtl !== paragraphRtl) {
|
|
@@ -1842,7 +1807,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1842
1807
|
spanStyle.fontSize = baseFontSize * (bulletInfo.sizePercent / 100) * baselineFontScale;
|
|
1843
1808
|
}
|
|
1844
1809
|
if (bulletInfo.color) {
|
|
1845
|
-
spanStyle.color =
|
|
1810
|
+
spanStyle.color = chunkFDR5W67L_js.normalizeHexColor(bulletInfo.color, resolvedSegmentColor);
|
|
1846
1811
|
}
|
|
1847
1812
|
if (typeof bulletHangPx === "number" && bulletHangPx > 0) {
|
|
1848
1813
|
spanStyle.display = "inline-block";
|
|
@@ -1887,7 +1852,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1887
1852
|
textAlign: segment.rubyAlignment === "l" ? "left" : segment.rubyAlignment === "r" ? "right" : segment.rubyAlignment === "dist" || segment.rubyAlignment === "distCat" || segment.rubyAlignment === "distLetter" ? "justify" : "center"
|
|
1888
1853
|
};
|
|
1889
1854
|
if (segment.rubyStyle?.color) {
|
|
1890
|
-
rubyStyle.color =
|
|
1855
|
+
rubyStyle.color = chunkFDR5W67L_js.normalizeHexColor(segment.rubyStyle.color, resolvedSegmentColor);
|
|
1891
1856
|
}
|
|
1892
1857
|
innerContent = /* @__PURE__ */ jsxRuntime.jsxs("ruby", { children: [
|
|
1893
1858
|
baseContent,
|
|
@@ -1960,7 +1925,7 @@ function resolveParagraphSpacing(input) {
|
|
|
1960
1925
|
if (typeof exactPt === "number" && exactPt > 0) {
|
|
1961
1926
|
result.lineHeight = `${exactPt * PT_TO_PX}px`;
|
|
1962
1927
|
} else if (typeof multiplier === "number" && multiplier > 0) {
|
|
1963
|
-
result.lineHeight = multiplier;
|
|
1928
|
+
result.lineHeight = chunkFDR5W67L_js.proportionalLineHeight(multiplier);
|
|
1964
1929
|
}
|
|
1965
1930
|
return result;
|
|
1966
1931
|
}
|
|
@@ -1982,7 +1947,7 @@ function groupSegmentsIntoParagraphs(segments) {
|
|
|
1982
1947
|
return paragraphs;
|
|
1983
1948
|
}
|
|
1984
1949
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick) {
|
|
1985
|
-
if (!
|
|
1950
|
+
if (!chunkFDR5W67L_js.hasTextProperties(element)) {
|
|
1986
1951
|
return emptyFallback || null;
|
|
1987
1952
|
}
|
|
1988
1953
|
const effectiveSegments = segmentOverrides ?? element.textSegments;
|
|
@@ -2003,10 +1968,10 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2003
1968
|
return element.text || emptyFallback || "";
|
|
2004
1969
|
}
|
|
2005
1970
|
const paragraphs = groupSegmentsIntoParagraphs(effectiveSegments);
|
|
2006
|
-
const paragraphIndents =
|
|
2007
|
-
const elementRtl =
|
|
2008
|
-
const elementAlign =
|
|
2009
|
-
const bodyStyle =
|
|
1971
|
+
const paragraphIndents = chunkFDR5W67L_js.hasTextProperties(element) ? element.paragraphIndents : void 0;
|
|
1972
|
+
const elementRtl = chunkFDR5W67L_js.hasTextProperties(element) ? element.textStyle?.rtl : void 0;
|
|
1973
|
+
const elementAlign = chunkFDR5W67L_js.hasTextProperties(element) ? element.textStyle?.align : void 0;
|
|
1974
|
+
const bodyStyle = chunkFDR5W67L_js.hasTextProperties(element) ? element.textStyle : void 0;
|
|
2010
1975
|
const spaceFirstLast = bodyStyle?.spaceFirstLastParagraph !== false;
|
|
2011
1976
|
return paragraphs.map(({ entries: paraSegments, terminator }, paraIndex) => {
|
|
2012
1977
|
const paraIndent = paragraphIndents?.[paraIndex];
|
|
@@ -2021,14 +1986,14 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2021
1986
|
return Boolean(segment.text) && segment.text.trim().length > 0;
|
|
2022
1987
|
});
|
|
2023
1988
|
const hasBullet = bulletInfo && !bulletInfo.none && hasVisibleTextContent;
|
|
2024
|
-
const paraRtl =
|
|
1989
|
+
const paraRtl = chunkFDR5W67L_js.resolveParagraphRtl(paraSegments, elementRtl);
|
|
2025
1990
|
const isRtlParagraph = paraRtl === true;
|
|
2026
|
-
const paraAlign =
|
|
2027
|
-
const cssTextAlign =
|
|
1991
|
+
const paraAlign = chunkFDR5W67L_js.resolveParagraphAlign(paraSegments, elementAlign);
|
|
1992
|
+
const cssTextAlign = chunkFDR5W67L_js.resolveCssTextAlign(paraAlign, isRtlParagraph);
|
|
2028
1993
|
const paraMarginLeft = isRtlParagraph ? void 0 : rawMarginLeft;
|
|
2029
1994
|
const paraMarginRight = isRtlParagraph ? rawMarginLeft : void 0;
|
|
2030
1995
|
const paraTextIndent = rawTextIndent;
|
|
2031
|
-
const paraKinsokuStyle =
|
|
1996
|
+
const paraKinsokuStyle = chunkFDR5W67L_js.getKinsokuLineBreakStyles(firstSeg?.segment.style);
|
|
2032
1997
|
const hasParaKinsoku = Object.keys(paraKinsokuStyle).length > 0;
|
|
2033
1998
|
const paraProps = effectiveSegments[firstSeg?.globalIndex ?? -1]?.paragraphProperties ?? (paraSegments.length === 0 ? terminator?.paragraphProperties : void 0);
|
|
2034
1999
|
const spacing = resolveParagraphSpacing({
|
|
@@ -2038,7 +2003,7 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2038
2003
|
isLast: paraIndex === paragraphs.length - 1,
|
|
2039
2004
|
spaceFirstLast
|
|
2040
2005
|
});
|
|
2041
|
-
const strutFontSize =
|
|
2006
|
+
const strutFontSize = chunkFDR5W67L_js.resolveParagraphStrutFontSize(
|
|
2042
2007
|
paraSegments.length > 0 ? paraSegments.map(({ segment }) => segment) : terminator ? [terminator] : [],
|
|
2043
2008
|
bodyStyle?.fontSize
|
|
2044
2009
|
);
|
|
@@ -2142,13 +2107,13 @@ function hexToRgbUnit(hex) {
|
|
|
2142
2107
|
};
|
|
2143
2108
|
}
|
|
2144
2109
|
function getDuotoneColors(element) {
|
|
2145
|
-
if (!
|
|
2110
|
+
if (!chunkFDR5W67L_js.isImageLikeElement(element)) {
|
|
2146
2111
|
return void 0;
|
|
2147
2112
|
}
|
|
2148
2113
|
return element.imageEffects?.duotone;
|
|
2149
2114
|
}
|
|
2150
2115
|
function buildLineShadowCss(element) {
|
|
2151
|
-
if (!
|
|
2116
|
+
if (!chunkFDR5W67L_js.hasShapeProperties(element)) {
|
|
2152
2117
|
return void 0;
|
|
2153
2118
|
}
|
|
2154
2119
|
const ss = element.shapeStyle;
|
|
@@ -2159,13 +2124,13 @@ function buildLineShadowCss(element) {
|
|
|
2159
2124
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
2160
2125
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
2161
2126
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
2162
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
2163
|
-
|
|
2127
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkFDR5W67L_js.colorWithOpacity(
|
|
2128
|
+
chunkFDR5W67L_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
2164
2129
|
opacity
|
|
2165
2130
|
)}`;
|
|
2166
2131
|
}
|
|
2167
2132
|
function buildLineGlowFilter(element) {
|
|
2168
|
-
if (!
|
|
2133
|
+
if (!chunkFDR5W67L_js.hasShapeProperties(element)) {
|
|
2169
2134
|
return void 0;
|
|
2170
2135
|
}
|
|
2171
2136
|
const ss = element.shapeStyle;
|
|
@@ -2174,7 +2139,7 @@ function buildLineGlowFilter(element) {
|
|
|
2174
2139
|
}
|
|
2175
2140
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
2176
2141
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
2177
|
-
const glowCol =
|
|
2142
|
+
const glowCol = chunkFDR5W67L_js.colorWithOpacity(chunkFDR5W67L_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
2178
2143
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
2179
2144
|
}
|
|
2180
2145
|
function mapDagBlendModeToCss(blend) {
|
|
@@ -2198,7 +2163,7 @@ function getDagDuotoneFilterId(elementId) {
|
|
|
2198
2163
|
return `dag-duotone-${elementId}`;
|
|
2199
2164
|
}
|
|
2200
2165
|
function hasDagDuotoneEffect(element) {
|
|
2201
|
-
if (!
|
|
2166
|
+
if (!chunkFDR5W67L_js.hasShapeProperties(element)) {
|
|
2202
2167
|
return false;
|
|
2203
2168
|
}
|
|
2204
2169
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
@@ -2261,7 +2226,7 @@ function getRoundRectRadiusPx2(element) {
|
|
|
2261
2226
|
|
|
2262
2227
|
// src/viewer/utils/shape-visual-3d.ts
|
|
2263
2228
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
2264
|
-
return
|
|
2229
|
+
return chunkFDR5W67L_js.build3DExtrusionData(
|
|
2265
2230
|
shape3d,
|
|
2266
2231
|
scene3d,
|
|
2267
2232
|
fillColor,
|
|
@@ -2270,7 +2235,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
2270
2235
|
);
|
|
2271
2236
|
}
|
|
2272
2237
|
function apply3dEffects2(base, scene3d, shape3d, fillColorFallback) {
|
|
2273
|
-
|
|
2238
|
+
chunkFDR5W67L_js.apply3dEffects(base, scene3d, shape3d, fillColorFallback);
|
|
2274
2239
|
}
|
|
2275
2240
|
|
|
2276
2241
|
// src/viewer/utils/vector-subpath-paint.ts
|
|
@@ -2279,7 +2244,7 @@ function toHexByte(value) {
|
|
|
2279
2244
|
return clamped.toString(16).padStart(2, "0");
|
|
2280
2245
|
}
|
|
2281
2246
|
function shiftHex(hex, factor, towardsWhite) {
|
|
2282
|
-
const channels =
|
|
2247
|
+
const channels = chunkFDR5W67L_js.hexToRgbChannels(hex);
|
|
2283
2248
|
if (!channels) {
|
|
2284
2249
|
return hex;
|
|
2285
2250
|
}
|
|
@@ -2305,13 +2270,13 @@ function buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity) {
|
|
|
2305
2270
|
const fillOff = subpath.fillMode === "none" || !hasFill;
|
|
2306
2271
|
return {
|
|
2307
2272
|
d: subpath.d,
|
|
2308
|
-
fill: fillOff ? "none" :
|
|
2273
|
+
fill: fillOff ? "none" : chunkFDR5W67L_js.colorWithOpacity(adjustFillForMode(fillColor, subpath.fillMode), fillOpacity),
|
|
2309
2274
|
stroked: subpath.stroke !== false
|
|
2310
2275
|
};
|
|
2311
2276
|
});
|
|
2312
2277
|
}
|
|
2313
2278
|
function getStrokeOnlyPresetPaths(element) {
|
|
2314
|
-
if (element.type !== "shape" || !
|
|
2279
|
+
if (element.type !== "shape" || !chunkFDR5W67L_js.hasShapeProperties(element)) {
|
|
2315
2280
|
return void 0;
|
|
2316
2281
|
}
|
|
2317
2282
|
const shapeType = element.shapeType;
|
|
@@ -2321,7 +2286,7 @@ function getStrokeOnlyPresetPaths(element) {
|
|
|
2321
2286
|
if (element.pathData) {
|
|
2322
2287
|
return void 0;
|
|
2323
2288
|
}
|
|
2324
|
-
const result =
|
|
2289
|
+
const result = chunkFDR5W67L_js.evaluatePresetShape(
|
|
2325
2290
|
shapeType,
|
|
2326
2291
|
Math.max(element.width, 1),
|
|
2327
2292
|
Math.max(element.height, 1),
|
|
@@ -2339,43 +2304,43 @@ function getGradientTilingCss(style) {
|
|
|
2339
2304
|
if (!style || style.fillMode !== "gradient") {
|
|
2340
2305
|
return void 0;
|
|
2341
2306
|
}
|
|
2342
|
-
const isStructuredLinear = (style.fillGradientType || "linear") === "linear" &&
|
|
2307
|
+
const isStructuredLinear = (style.fillGradientType || "linear") === "linear" && chunkFDR5W67L_js.sanitizeGradientStops(style.fillGradientStops).length > 0;
|
|
2343
2308
|
if (isStructuredLinear) {
|
|
2344
|
-
const flip =
|
|
2309
|
+
const flip = chunkFDR5W67L_js.getGradientTileFlipCss(style.fillGradientFlip);
|
|
2345
2310
|
if (flip) {
|
|
2346
2311
|
return flip;
|
|
2347
2312
|
}
|
|
2348
2313
|
}
|
|
2349
|
-
return
|
|
2314
|
+
return chunkFDR5W67L_js.getGradientTileRectCss(style.fillGradientTileRect);
|
|
2350
2315
|
}
|
|
2351
2316
|
function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2352
|
-
if (!
|
|
2317
|
+
if (!chunkFDR5W67L_js.hasShapeProperties(element)) {
|
|
2353
2318
|
return {};
|
|
2354
2319
|
}
|
|
2355
2320
|
const normalizedShapeType = getShapeType(element.shapeType);
|
|
2356
|
-
const clipPath =
|
|
2321
|
+
const clipPath = chunkFDR5W67L_js.getResolvedShapeClipPath(element);
|
|
2357
2322
|
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;
|
|
2358
2323
|
const rendersStrokeOnlyPreset = Boolean(getStrokeOnlyPresetPaths(element));
|
|
2359
2324
|
const fillOpacity = element.shapeStyle?.fillOpacity;
|
|
2360
2325
|
const strokeOpacity = element.shapeStyle?.strokeOpacity;
|
|
2361
|
-
const strokeDash =
|
|
2362
|
-
const fillGradient =
|
|
2326
|
+
const strokeDash = chunkFDR5W67L_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2327
|
+
const fillGradient = chunkFDR5W67L_js.buildCssGradientFromShapeStyle(element.shapeStyle, {
|
|
2363
2328
|
rotation: element.rotation,
|
|
2364
2329
|
width: element.width,
|
|
2365
2330
|
height: element.height
|
|
2366
2331
|
}) || element.shapeStyle?.fillGradient;
|
|
2367
|
-
const shadowCss =
|
|
2368
|
-
const innerShadowCss =
|
|
2369
|
-
const resolvedFillColor =
|
|
2370
|
-
const resolvedStrokeColor =
|
|
2332
|
+
const shadowCss = chunkFDR5W67L_js.buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
2333
|
+
const innerShadowCss = chunkFDR5W67L_js.buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
2334
|
+
const resolvedFillColor = chunkFDR5W67L_js.colorWithOpacity(fillColor, fillOpacity);
|
|
2335
|
+
const resolvedStrokeColor = chunkFDR5W67L_js.colorWithOpacity(strokeColor, strokeOpacity);
|
|
2371
2336
|
const ss = element.shapeStyle;
|
|
2372
2337
|
const gradientTiling = getGradientTilingCss(ss);
|
|
2373
|
-
const paintsGradientOutline =
|
|
2338
|
+
const paintsGradientOutline = chunkFDR5W67L_js.suppressesCssBorder(element);
|
|
2374
2339
|
const hasFillOverlayColor = Boolean(
|
|
2375
2340
|
ss?.dagFillOverlayColor && ss.dagFillOverlayColor !== "transparent"
|
|
2376
2341
|
);
|
|
2377
2342
|
const combinedShadowParts = [];
|
|
2378
|
-
const multiLayerShadow =
|
|
2343
|
+
const multiLayerShadow = chunkFDR5W67L_js.buildMultiLayerShadowCss(element.shapeStyle);
|
|
2379
2344
|
if (multiLayerShadow) {
|
|
2380
2345
|
combinedShadowParts.push(multiLayerShadow);
|
|
2381
2346
|
} else if (shadowCss) {
|
|
@@ -2384,7 +2349,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2384
2349
|
if (innerShadowCss) {
|
|
2385
2350
|
combinedShadowParts.push(innerShadowCss);
|
|
2386
2351
|
}
|
|
2387
|
-
const glowBoxShadow =
|
|
2352
|
+
const glowBoxShadow = chunkFDR5W67L_js.buildGlowBoxShadow(ss?.glowColor, ss?.glowRadius, ss?.glowOpacity);
|
|
2388
2353
|
if (glowBoxShadow) {
|
|
2389
2354
|
combinedShadowParts.push(glowBoxShadow);
|
|
2390
2355
|
}
|
|
@@ -2392,7 +2357,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2392
2357
|
if (lineShadow) {
|
|
2393
2358
|
combinedShadowParts.push(lineShadow);
|
|
2394
2359
|
}
|
|
2395
|
-
const compoundLineShadow =
|
|
2360
|
+
const compoundLineShadow = chunkFDR5W67L_js.getCompoundLineBoxShadow(
|
|
2396
2361
|
element.shapeStyle?.compoundLine,
|
|
2397
2362
|
strokeWidth,
|
|
2398
2363
|
resolvedStrokeColor
|
|
@@ -2405,11 +2370,11 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2405
2370
|
if (ss?.glowColor && ss.glowColor !== "transparent" && ss.glowRadius) {
|
|
2406
2371
|
const glowOpacity = typeof ss.glowOpacity === "number" ? ss.glowOpacity : 0.75;
|
|
2407
2372
|
const glowRad = Math.round(Math.max(0, ss.glowRadius));
|
|
2408
|
-
const glowCol =
|
|
2373
|
+
const glowCol = chunkFDR5W67L_js.colorWithOpacity(chunkFDR5W67L_js.normalizeHexColor(ss.glowColor, "#ffff00"), glowOpacity);
|
|
2409
2374
|
filterParts.push(`drop-shadow(0 0 ${glowRad}px ${glowCol})`);
|
|
2410
2375
|
}
|
|
2411
2376
|
if (typeof ss?.softEdgeRadius === "number" && ss.softEdgeRadius > 0) {
|
|
2412
|
-
filterParts.push(`url(#${
|
|
2377
|
+
filterParts.push(`url(#${chunkFDR5W67L_js.getSoftEdgeFilterId(element.id)})`);
|
|
2413
2378
|
}
|
|
2414
2379
|
if (typeof ss?.blurRadius === "number" && ss.blurRadius > 0) {
|
|
2415
2380
|
filterParts.push(`blur(${Math.round(ss.blurRadius)}px)`);
|
|
@@ -2418,13 +2383,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2418
2383
|
if (lineGlowCss) {
|
|
2419
2384
|
filterParts.push(lineGlowCss);
|
|
2420
2385
|
}
|
|
2421
|
-
const dagFilter =
|
|
2386
|
+
const dagFilter = chunkFDR5W67L_js.getEffectDagFilter(ss, element.id);
|
|
2422
2387
|
if (dagFilter) {
|
|
2423
2388
|
filterParts.push(dagFilter);
|
|
2424
2389
|
}
|
|
2425
2390
|
const lineJoinCss = ss?.lineJoin === "round" ? "round" : ss?.lineJoin === "bevel" ? "bevel" : ss?.lineJoin === "miter" ? "miter" : void 0;
|
|
2426
2391
|
const miterLimitCss = ss?.lineJoin === "miter" && typeof ss?.miterLimit === "number" ? Math.max(ss.miterLimit / 1e5, 1) : void 0;
|
|
2427
|
-
const patternFill =
|
|
2392
|
+
const patternFill = chunkFDR5W67L_js.buildPatternFillCss(element.shapeStyle);
|
|
2428
2393
|
const imageFillUrl = ss?.fillMode === "image" && ss.fillImageUrl ? ss.fillImageUrl : void 0;
|
|
2429
2394
|
const imageFillMode = ss?.fillImageMode || "stretch";
|
|
2430
2395
|
let reflectCss;
|
|
@@ -2436,7 +2401,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2436
2401
|
const endOpacity = typeof ss.reflectionEndOpacity === "number" ? ss.reflectionEndOpacity : 0;
|
|
2437
2402
|
const fadeLength = typeof ss.reflectionEndPosition === "number" ? Math.round(ss.reflectionEndPosition * Math.max(element.height, 1)) : 100;
|
|
2438
2403
|
const blurRadius = typeof ss.reflectionBlurRadius === "number" ? ss.reflectionBlurRadius : 0;
|
|
2439
|
-
reflectCss =
|
|
2404
|
+
reflectCss = chunkFDR5W67L_js.buildReflectionCss(distance, startOpacity, endOpacity, fadeLength, blurRadius);
|
|
2440
2405
|
}
|
|
2441
2406
|
}
|
|
2442
2407
|
const base = {
|
|
@@ -2482,9 +2447,9 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2482
2447
|
// path following the shape's geometry, because a CSS border can only take
|
|
2483
2448
|
// one colour. Keeping the border too would draw the parser's averaged
|
|
2484
2449
|
// solid underneath the gradient.
|
|
2485
|
-
borderWidth: strokeWidth > 0 && !paintsGradientOutline ?
|
|
2450
|
+
borderWidth: strokeWidth > 0 && !paintsGradientOutline ? chunkFDR5W67L_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : 0,
|
|
2486
2451
|
borderColor: strokeWidth > 0 && !paintsGradientOutline ? resolvedStrokeColor : void 0,
|
|
2487
|
-
borderStyle: strokeWidth > 0 && !paintsGradientOutline ?
|
|
2452
|
+
borderStyle: strokeWidth > 0 && !paintsGradientOutline ? chunkFDR5W67L_js.getCssBorderDashStyle(strokeDash, ss?.compoundLine) : void 0,
|
|
2488
2453
|
strokeLinejoin: lineJoinCss,
|
|
2489
2454
|
strokeMiterlimit: miterLimitCss,
|
|
2490
2455
|
strokeLinecap: ss?.lineCap === "rnd" ? "round" : ss?.lineCap === "sq" ? "square" : ss?.lineCap === "flat" ? "butt" : void 0
|
|
@@ -2540,7 +2505,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2540
2505
|
borderWidth: 0,
|
|
2541
2506
|
borderTopWidth: Math.max(strokeWidth, 2),
|
|
2542
2507
|
borderTopColor: resolvedStrokeColor,
|
|
2543
|
-
borderTopStyle:
|
|
2508
|
+
borderTopStyle: chunkFDR5W67L_js.getCssBorderDashStyle(strokeDash)
|
|
2544
2509
|
};
|
|
2545
2510
|
}
|
|
2546
2511
|
if (normalizedShapeType === "cylinder") {
|
|
@@ -2554,13 +2519,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2554
2519
|
function getConnectorAdjustment(element, key, fallback) {
|
|
2555
2520
|
const direct = element.shapeAdjustments?.[key];
|
|
2556
2521
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
2557
|
-
return
|
|
2522
|
+
return chunkFDR5W67L_js.clampUnitInterval(direct / 1e5);
|
|
2558
2523
|
}
|
|
2559
2524
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
2560
2525
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
2561
|
-
return
|
|
2526
|
+
return chunkFDR5W67L_js.clampUnitInterval(fallbackKey / 1e5);
|
|
2562
2527
|
}
|
|
2563
|
-
return
|
|
2528
|
+
return chunkFDR5W67L_js.clampUnitInterval(fallback);
|
|
2564
2529
|
}
|
|
2565
2530
|
function getConnectorPathGeometry(element) {
|
|
2566
2531
|
const width = Math.max(element.width, 0);
|
|
@@ -2697,11 +2662,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
|
|
|
2697
2662
|
strokePaint,
|
|
2698
2663
|
strokeWidth,
|
|
2699
2664
|
dashArray,
|
|
2700
|
-
lineCap:
|
|
2665
|
+
lineCap: chunkFDR5W67L_js.svgLineCap(shapeStyle?.lineCap),
|
|
2701
2666
|
lineJoin,
|
|
2702
2667
|
miterLimit,
|
|
2703
|
-
offsets:
|
|
2704
|
-
widths:
|
|
2668
|
+
offsets: chunkFDR5W67L_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
2669
|
+
widths: chunkFDR5W67L_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
|
|
2705
2670
|
};
|
|
2706
2671
|
}
|
|
2707
2672
|
function strokeStrands(d, keyBase, ctx) {
|
|
@@ -2749,9 +2714,9 @@ function gradientDefs(gradient) {
|
|
|
2749
2714
|
}
|
|
2750
2715
|
function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredPaths, shapeStyle, hasFill, fillColor, fillOpacity, strokePaint, strokeWidth, dashArray, animatesFill = false, gradient) {
|
|
2751
2716
|
const ctx = strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray);
|
|
2752
|
-
const subpaths = structuredPaths && structuredPaths.length > 0 ?
|
|
2717
|
+
const subpaths = structuredPaths && structuredPaths.length > 0 ? chunkFDR5W67L_js.customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
2753
2718
|
const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
|
|
2754
|
-
const gradientPaint = gradient ?
|
|
2719
|
+
const gradientPaint = gradient ? chunkFDR5W67L_js.svgGradientFillRef(gradient) : void 0;
|
|
2755
2720
|
const nodes = [];
|
|
2756
2721
|
if (subpaths && needsPerSubpath) {
|
|
2757
2722
|
const paints = buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity);
|
|
@@ -2783,7 +2748,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2783
2748
|
"path",
|
|
2784
2749
|
{
|
|
2785
2750
|
d: pathData,
|
|
2786
|
-
fill: animatesFill ? "inherit" : gradientPaint ??
|
|
2751
|
+
fill: animatesFill ? "inherit" : gradientPaint ?? chunkFDR5W67L_js.colorWithOpacity(fillColor, fillOpacity),
|
|
2787
2752
|
stroke: "none",
|
|
2788
2753
|
vectorEffect: "non-scaling-stroke"
|
|
2789
2754
|
},
|
|
@@ -2828,14 +2793,14 @@ function renderStrokeOnlyPreset(presetPaths, width, height, shapeStyle, strokePa
|
|
|
2828
2793
|
);
|
|
2829
2794
|
}
|
|
2830
2795
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2831
|
-
if (!
|
|
2796
|
+
if (!chunkFDR5W67L_js.hasShapeProperties(element)) {
|
|
2832
2797
|
return null;
|
|
2833
2798
|
}
|
|
2834
2799
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
2835
|
-
const fillPaint = animatesFill ? "inherit" :
|
|
2836
|
-
const strokePaint = animatesStroke ? "inherit" :
|
|
2837
|
-
const dashType =
|
|
2838
|
-
const dashArray =
|
|
2800
|
+
const fillPaint = animatesFill ? "inherit" : chunkFDR5W67L_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
2801
|
+
const strokePaint = animatesStroke ? "inherit" : chunkFDR5W67L_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
2802
|
+
const dashType = chunkFDR5W67L_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2803
|
+
const dashArray = chunkFDR5W67L_js.getSvgStrokeDasharray(
|
|
2839
2804
|
dashType,
|
|
2840
2805
|
Math.max(strokeWidth, 1),
|
|
2841
2806
|
element.shapeStyle?.customDashSegments
|
|
@@ -2916,21 +2881,21 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2916
2881
|
// container's `background-image` is suppressed for custom geometry, so
|
|
2917
2882
|
// without this the shape fell back to the parser's representative solid
|
|
2918
2883
|
// and lost every fade (issue #132).
|
|
2919
|
-
|
|
2884
|
+
chunkFDR5W67L_js.buildSvgGradientDef(element.shapeStyle, element.id)
|
|
2920
2885
|
);
|
|
2921
2886
|
}
|
|
2922
|
-
if (
|
|
2887
|
+
if (chunkFDR5W67L_js.isCalloutShape(normalizedType)) {
|
|
2923
2888
|
const width = Math.max(element.width, 1);
|
|
2924
2889
|
const height = Math.max(element.height, 1);
|
|
2925
|
-
const geometry =
|
|
2890
|
+
const geometry = chunkFDR5W67L_js.getCalloutLeaderLineGeometry(
|
|
2926
2891
|
normalizedType,
|
|
2927
2892
|
width,
|
|
2928
2893
|
height,
|
|
2929
2894
|
element.shapeAdjustments
|
|
2930
2895
|
);
|
|
2931
2896
|
if (geometry && geometry.points.length >= 2) {
|
|
2932
|
-
const leaderPath =
|
|
2933
|
-
const bounds =
|
|
2897
|
+
const leaderPath = chunkFDR5W67L_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
2898
|
+
const bounds = chunkFDR5W67L_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
2934
2899
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
2935
2900
|
const offsetLeft = bounds.minX;
|
|
2936
2901
|
const offsetTop = bounds.minY;
|
|
@@ -2993,10 +2958,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2993
2958
|
const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
|
|
2994
2959
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
2995
2960
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
2996
|
-
const connectorLineCap =
|
|
2961
|
+
const connectorLineCap = chunkFDR5W67L_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
2997
2962
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
2998
|
-
const offsets =
|
|
2999
|
-
const widths =
|
|
2963
|
+
const offsets = chunkFDR5W67L_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
2964
|
+
const widths = chunkFDR5W67L_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
3000
2965
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3001
2966
|
"svg",
|
|
3002
2967
|
{
|
|
@@ -3075,15 +3040,15 @@ function parseGradientFillCss(gradFill) {
|
|
|
3075
3040
|
}
|
|
3076
3041
|
const parsed = stops.map((gs) => {
|
|
3077
3042
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
3078
|
-
const color =
|
|
3079
|
-
const opacity =
|
|
3080
|
-
return { pos, color:
|
|
3043
|
+
const color = chunkFDR5W67L_js.parseDrawingColor(gs) ?? "#888888";
|
|
3044
|
+
const opacity = chunkFDR5W67L_js.parseDrawingColorOpacity(gs);
|
|
3045
|
+
return { pos, color: chunkFDR5W67L_js.colorWithOpacity(color, opacity) };
|
|
3081
3046
|
}).sort((a, b) => a.pos - b.pos);
|
|
3082
3047
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
3083
3048
|
const lin = gradFill["a:lin"];
|
|
3084
3049
|
if (lin) {
|
|
3085
3050
|
const angRaw = Number.parseInt(String(lin["@_ang"] || "0"), 10);
|
|
3086
|
-
const angleDeg = Math.round(
|
|
3051
|
+
const angleDeg = Math.round(chunkFDR5W67L_js.ooxmlGradientAngleToCssDegrees(angRaw / 6e4));
|
|
3087
3052
|
return `linear-gradient(${angleDeg}deg, ${stopStrings})`;
|
|
3088
3053
|
}
|
|
3089
3054
|
const path = gradFill["a:path"];
|
|
@@ -3118,8 +3083,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
3118
3083
|
if (!pattFill) {
|
|
3119
3084
|
return void 0;
|
|
3120
3085
|
}
|
|
3121
|
-
const fgColor =
|
|
3122
|
-
const bgColor =
|
|
3086
|
+
const fgColor = chunkFDR5W67L_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
3087
|
+
const bgColor = chunkFDR5W67L_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
3123
3088
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
3124
3089
|
switch (preset) {
|
|
3125
3090
|
case "ltHorz":
|
|
@@ -3230,11 +3195,11 @@ function parseCellBorders(cellProperties) {
|
|
|
3230
3195
|
const prstDash = ln["a:prstDash"];
|
|
3231
3196
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
3232
3197
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
3233
|
-
const color =
|
|
3198
|
+
const color = chunkFDR5W67L_js.parseDrawingColor(ln["a:solidFill"]);
|
|
3234
3199
|
if (color) {
|
|
3235
|
-
const opacity =
|
|
3200
|
+
const opacity = chunkFDR5W67L_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
3236
3201
|
const key = `${edge.prefix}`;
|
|
3237
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
3202
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkFDR5W67L_js.colorWithOpacity(color, opacity)}`;
|
|
3238
3203
|
}
|
|
3239
3204
|
}
|
|
3240
3205
|
return borderStyle;
|
|
@@ -3247,7 +3212,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3247
3212
|
const textShadowParts = [];
|
|
3248
3213
|
const outerShdw = effectLst["a:outerShdw"];
|
|
3249
3214
|
if (outerShdw) {
|
|
3250
|
-
const shdwColor =
|
|
3215
|
+
const shdwColor = chunkFDR5W67L_js.parseDrawingColor(outerShdw);
|
|
3251
3216
|
if (shdwColor) {
|
|
3252
3217
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
3253
3218
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -3265,7 +3230,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3265
3230
|
}
|
|
3266
3231
|
const glow = effectLst["a:glow"];
|
|
3267
3232
|
if (glow) {
|
|
3268
|
-
const glowColor =
|
|
3233
|
+
const glowColor = chunkFDR5W67L_js.parseDrawingColor(glow);
|
|
3269
3234
|
if (glowColor) {
|
|
3270
3235
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
3271
3236
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -3344,10 +3309,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3344
3309
|
if (runProps?.["@_u"] !== void 0) {
|
|
3345
3310
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
3346
3311
|
}
|
|
3347
|
-
const runColor =
|
|
3312
|
+
const runColor = chunkFDR5W67L_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkFDR5W67L_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
3348
3313
|
if (runColor) {
|
|
3349
|
-
const opacity =
|
|
3350
|
-
cellStyle.color =
|
|
3314
|
+
const opacity = chunkFDR5W67L_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
3315
|
+
cellStyle.color = chunkFDR5W67L_js.colorWithOpacity(runColor, opacity);
|
|
3351
3316
|
}
|
|
3352
3317
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
3353
3318
|
if (fontFamily) {
|
|
@@ -3357,15 +3322,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3357
3322
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
3358
3323
|
}
|
|
3359
3324
|
const cellProperties = cellXml["a:tcPr"];
|
|
3360
|
-
const cellFill =
|
|
3325
|
+
const cellFill = chunkFDR5W67L_js.parseDrawingColor(
|
|
3361
3326
|
cellProperties?.["a:solidFill"],
|
|
3362
3327
|
schemeColorOverrides
|
|
3363
3328
|
);
|
|
3364
3329
|
if (cellFill) {
|
|
3365
|
-
const opacity =
|
|
3330
|
+
const opacity = chunkFDR5W67L_js.parseDrawingColorOpacity(
|
|
3366
3331
|
cellProperties?.["a:solidFill"]
|
|
3367
3332
|
);
|
|
3368
|
-
cellStyle.backgroundColor =
|
|
3333
|
+
cellStyle.backgroundColor = chunkFDR5W67L_js.colorWithOpacity(cellFill, opacity);
|
|
3369
3334
|
} else {
|
|
3370
3335
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
3371
3336
|
if (gradCss) {
|
|
@@ -3380,16 +3345,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3380
3345
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
3381
3346
|
Object.assign(cellStyle, edgeBorders);
|
|
3382
3347
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
3383
|
-
const borderColor =
|
|
3348
|
+
const borderColor = chunkFDR5W67L_js.parseDrawingColor(
|
|
3384
3349
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
3385
3350
|
schemeColorOverrides
|
|
3386
|
-
) ||
|
|
3351
|
+
) || chunkFDR5W67L_js.parseDrawingColor(
|
|
3387
3352
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
3388
3353
|
schemeColorOverrides
|
|
3389
|
-
) ||
|
|
3354
|
+
) || chunkFDR5W67L_js.parseDrawingColor(
|
|
3390
3355
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
3391
3356
|
schemeColorOverrides
|
|
3392
|
-
) ||
|
|
3357
|
+
) || chunkFDR5W67L_js.parseDrawingColor(
|
|
3393
3358
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
3394
3359
|
schemeColorOverrides
|
|
3395
3360
|
);
|
|
@@ -3468,10 +3433,10 @@ function resolveTableStyleFillColor(fill, colorScheme) {
|
|
|
3468
3433
|
}
|
|
3469
3434
|
let color = base;
|
|
3470
3435
|
if (fill.tint !== void 0 && fill.tint > 0) {
|
|
3471
|
-
color =
|
|
3436
|
+
color = chunkFDR5W67L_js.tintColor2(color, fill.tint / 1e5);
|
|
3472
3437
|
}
|
|
3473
3438
|
if (fill.shade !== void 0 && fill.shade > 0) {
|
|
3474
|
-
color =
|
|
3439
|
+
color = chunkFDR5W67L_js.shadeColor2(color, 1 - fill.shade / 1e5);
|
|
3475
3440
|
}
|
|
3476
3441
|
return color;
|
|
3477
3442
|
}
|
|
@@ -3496,7 +3461,7 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3496
3461
|
style.fontFamily = text.fontFace;
|
|
3497
3462
|
applied = true;
|
|
3498
3463
|
} else {
|
|
3499
|
-
const refFont =
|
|
3464
|
+
const refFont = chunkFDR5W67L_js.resolveFontRefIdx(text.fontRefIdx, fontScheme);
|
|
3500
3465
|
if (refFont) {
|
|
3501
3466
|
style.fontFamily = refFont;
|
|
3502
3467
|
applied = true;
|
|
@@ -3507,10 +3472,10 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3507
3472
|
if (base) {
|
|
3508
3473
|
let color = base;
|
|
3509
3474
|
if (text.fontTint !== void 0 && text.fontTint > 0) {
|
|
3510
|
-
color =
|
|
3475
|
+
color = chunkFDR5W67L_js.tintColor2(color, text.fontTint / 1e5);
|
|
3511
3476
|
}
|
|
3512
3477
|
if (text.fontShade !== void 0 && text.fontShade > 0) {
|
|
3513
|
-
color =
|
|
3478
|
+
color = chunkFDR5W67L_js.shadeColor2(color, 1 - text.fontShade / 1e5);
|
|
3514
3479
|
}
|
|
3515
3480
|
style.color = color;
|
|
3516
3481
|
applied = true;
|
|
@@ -3699,7 +3664,7 @@ function parseTableElementData(element, fallbackTextStyle) {
|
|
|
3699
3664
|
};
|
|
3700
3665
|
}
|
|
3701
3666
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
3702
|
-
return
|
|
3667
|
+
return chunkFDR5W67L_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
3703
3668
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
3704
3669
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
3705
3670
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -3847,9 +3812,9 @@ function cellStyleToCss(style) {
|
|
|
3847
3812
|
if (style.gradientFillCss) {
|
|
3848
3813
|
css.background = style.gradientFillCss;
|
|
3849
3814
|
} else if (style.fillMode === "pattern" && style.patternFillPreset) {
|
|
3850
|
-
const fg =
|
|
3851
|
-
const bg =
|
|
3852
|
-
const svgPattern =
|
|
3815
|
+
const fg = chunkFDR5W67L_js.normalizeHexColor(style.patternFillForeground, "#000000");
|
|
3816
|
+
const bg = chunkFDR5W67L_js.normalizeHexColor(style.patternFillBackground, "#ffffff");
|
|
3817
|
+
const svgPattern = chunkFDR5W67L_js.getPatternSvg(style.patternFillPreset, fg, bg);
|
|
3853
3818
|
if (svgPattern) {
|
|
3854
3819
|
const encoded = encodeURIComponent(svgPattern);
|
|
3855
3820
|
css.backgroundImage = `url("data:image/svg+xml,${encoded}")`;
|
|
@@ -3925,7 +3890,7 @@ function cellStyleToCss(style) {
|
|
|
3925
3890
|
if (edge.width || edge.color) {
|
|
3926
3891
|
const w = edge.width ?? 1;
|
|
3927
3892
|
const c = edge.color ?? style.borderColor ?? "#000000";
|
|
3928
|
-
const s =
|
|
3893
|
+
const s = chunkFDR5W67L_js.ooxmlDashToCssBorderStyle(edge.dash);
|
|
3929
3894
|
css[edge.prefix] = `${w}px ${s} ${c}`;
|
|
3930
3895
|
}
|
|
3931
3896
|
}
|
|
@@ -3956,7 +3921,7 @@ function cellStyleToCss(style) {
|
|
|
3956
3921
|
css.textShadow = textShadowParts.join(", ");
|
|
3957
3922
|
}
|
|
3958
3923
|
if (style.cell3D) {
|
|
3959
|
-
Object.assign(css,
|
|
3924
|
+
Object.assign(css, chunkFDR5W67L_js.cell3DBevelCss(style.cell3D));
|
|
3960
3925
|
}
|
|
3961
3926
|
return css;
|
|
3962
3927
|
}
|
|
@@ -3970,7 +3935,7 @@ function TableResizeOverlay({
|
|
|
3970
3935
|
const containerRef = React6.useRef(null);
|
|
3971
3936
|
const [rowBounds, setRowBounds] = React6.useState([]);
|
|
3972
3937
|
const dragRef = React6.useRef(null);
|
|
3973
|
-
const colBoundaries = React6.useMemo(() =>
|
|
3938
|
+
const colBoundaries = React6.useMemo(() => chunkFDR5W67L_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
3974
3939
|
const measureRows = React6.useCallback(() => {
|
|
3975
3940
|
const container = containerRef.current;
|
|
3976
3941
|
if (!container) {
|
|
@@ -4017,11 +3982,11 @@ function TableResizeOverlay({
|
|
|
4017
3982
|
const rect = containerRef.current.getBoundingClientRect();
|
|
4018
3983
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
4019
3984
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
4020
|
-
onResizeColumns(
|
|
3985
|
+
onResizeColumns(chunkFDR5W67L_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
4021
3986
|
} else if (drag.type === "row" && onResizeRow) {
|
|
4022
3987
|
const deltaY = e.clientY - drag.startPos;
|
|
4023
|
-
const newHeight =
|
|
4024
|
-
drag.initialRowHeight ??
|
|
3988
|
+
const newHeight = chunkFDR5W67L_js.computeResizedRowHeight(
|
|
3989
|
+
drag.initialRowHeight ?? chunkFDR5W67L_js.DEFAULT_ROW_HEIGHT,
|
|
4025
3990
|
deltaY
|
|
4026
3991
|
);
|
|
4027
3992
|
onResizeRow(drag.index, newHeight);
|
|
@@ -4059,7 +4024,7 @@ function TableResizeOverlay({
|
|
|
4059
4024
|
e.stopPropagation();
|
|
4060
4025
|
const table = containerRef.current?.querySelector("table");
|
|
4061
4026
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
4062
|
-
const actualHeight = tr?.offsetHeight ??
|
|
4027
|
+
const actualHeight = tr?.offsetHeight ?? chunkFDR5W67L_js.DEFAULT_ROW_HEIGHT;
|
|
4063
4028
|
document.body.style.cursor = "row-resize";
|
|
4064
4029
|
document.body.style.userSelect = "none";
|
|
4065
4030
|
dragRef.current = {
|
|
@@ -4107,7 +4072,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4107
4072
|
}
|
|
4108
4073
|
const first = selectedCell.selectedCells[0];
|
|
4109
4074
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4110
|
-
return
|
|
4075
|
+
return chunkFDR5W67L_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
4111
4076
|
})();
|
|
4112
4077
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4113
4078
|
TableResizeOverlay,
|
|
@@ -4140,7 +4105,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4140
4105
|
return null;
|
|
4141
4106
|
}
|
|
4142
4107
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
4143
|
-
const isInMultiSelection =
|
|
4108
|
+
const isInMultiSelection = chunkFDR5W67L_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
4144
4109
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
4145
4110
|
const diag = getCellDiagonalBorders2(
|
|
4146
4111
|
cell.style,
|
|
@@ -4170,7 +4135,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4170
4135
|
}
|
|
4171
4136
|
event.stopPropagation();
|
|
4172
4137
|
if (event.shiftKey && selectedCell) {
|
|
4173
|
-
const rect =
|
|
4138
|
+
const rect = chunkFDR5W67L_js.computeSelectionRect(
|
|
4174
4139
|
selectedCell.rowIndex,
|
|
4175
4140
|
selectedCell.columnIndex,
|
|
4176
4141
|
rowIndex,
|
|
@@ -4180,7 +4145,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4180
4145
|
options?.onSelectCell?.({
|
|
4181
4146
|
rowIndex: selectedCell.rowIndex,
|
|
4182
4147
|
columnIndex: selectedCell.columnIndex,
|
|
4183
|
-
selectedCells:
|
|
4148
|
+
selectedCells: chunkFDR5W67L_js.rectToCells(rect)
|
|
4184
4149
|
});
|
|
4185
4150
|
} else {
|
|
4186
4151
|
options?.onSelectCell?.({
|
|
@@ -4257,7 +4222,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4257
4222
|
}
|
|
4258
4223
|
const first = selectedCell.selectedCells[0];
|
|
4259
4224
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4260
|
-
return
|
|
4225
|
+
return chunkFDR5W67L_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
4261
4226
|
})();
|
|
4262
4227
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
4263
4228
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4334,7 +4299,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4334
4299
|
"border px-1 py-0.5 align-top",
|
|
4335
4300
|
isEditable && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
4336
4301
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
4337
|
-
|
|
4302
|
+
chunkFDR5W67L_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
4338
4303
|
),
|
|
4339
4304
|
colSpan,
|
|
4340
4305
|
rowSpan: rSpan,
|
|
@@ -4345,7 +4310,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4345
4310
|
}
|
|
4346
4311
|
event.stopPropagation();
|
|
4347
4312
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
4348
|
-
const rect =
|
|
4313
|
+
const rect = chunkFDR5W67L_js.computeSelectionRect(
|
|
4349
4314
|
selectedCell.rowIndex,
|
|
4350
4315
|
selectedCell.columnIndex,
|
|
4351
4316
|
rowIndex,
|
|
@@ -4355,7 +4320,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4355
4320
|
options?.onSelectCell?.({
|
|
4356
4321
|
rowIndex: selectedCell.rowIndex,
|
|
4357
4322
|
columnIndex: selectedCell.columnIndex,
|
|
4358
|
-
selectedCells:
|
|
4323
|
+
selectedCells: chunkFDR5W67L_js.rectToCells(rect)
|
|
4359
4324
|
});
|
|
4360
4325
|
} else {
|
|
4361
4326
|
options?.onSelectCell?.({
|
|
@@ -4410,24 +4375,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4410
4375
|
}
|
|
4411
4376
|
var LEGEND_ITEM_WIDTH = 80;
|
|
4412
4377
|
function partAttrs(part) {
|
|
4413
|
-
return part ?
|
|
4378
|
+
return part ? chunkFDR5W67L_js.chartPartToAttrs(part) : void 0;
|
|
4414
4379
|
}
|
|
4415
4380
|
function resolveReactPalette(chartData) {
|
|
4416
4381
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
4417
4382
|
return chartData.colorPalette;
|
|
4418
4383
|
}
|
|
4419
|
-
return [...
|
|
4384
|
+
return [...chunkFDR5W67L_js.getChartStylePalette(chartData.style?.styleId)];
|
|
4420
4385
|
}
|
|
4421
4386
|
function buildReactChartViewModel(element) {
|
|
4422
4387
|
if (element.type !== "chart" || !element.chartData) {
|
|
4423
|
-
return
|
|
4388
|
+
return chunkFDR5W67L_js.buildChartViewModel(element);
|
|
4424
4389
|
}
|
|
4425
4390
|
const palette = resolveReactPalette(element.chartData);
|
|
4426
4391
|
const themedElement = {
|
|
4427
4392
|
...element,
|
|
4428
4393
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
4429
4394
|
};
|
|
4430
|
-
return
|
|
4395
|
+
return chunkFDR5W67L_js.buildChartViewModel(themedElement);
|
|
4431
4396
|
}
|
|
4432
4397
|
function renderPrimitive(prim, key) {
|
|
4433
4398
|
switch (prim.kind) {
|
|
@@ -4816,7 +4781,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4816
4781
|
const unmatchedRows = [];
|
|
4817
4782
|
categories.forEach((cat, i) => {
|
|
4818
4783
|
const value = values[i] ?? 0;
|
|
4819
|
-
const code =
|
|
4784
|
+
const code = chunkFDR5W67L_js.resolveRegionCode(cat);
|
|
4820
4785
|
if (code) {
|
|
4821
4786
|
regionValueMap.set(code, { value, label: cat });
|
|
4822
4787
|
} else {
|
|
@@ -4854,8 +4819,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4854
4819
|
let fill = "#e2e8f0";
|
|
4855
4820
|
let dataLabel = null;
|
|
4856
4821
|
if (entry) {
|
|
4857
|
-
const t =
|
|
4858
|
-
fill =
|
|
4822
|
+
const t = chunkFDR5W67L_js.normalizeValue(entry.value, minVal, maxVal);
|
|
4823
|
+
fill = chunkFDR5W67L_js.sequentialColorScale(t);
|
|
4859
4824
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
4860
4825
|
"text",
|
|
4861
4826
|
{
|
|
@@ -4866,7 +4831,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4866
4831
|
fontWeight: 600,
|
|
4867
4832
|
fill: "#1e293b",
|
|
4868
4833
|
style: { pointerEvents: "none" },
|
|
4869
|
-
children:
|
|
4834
|
+
children: chunkFDR5W67L_js.formatAxisValue(entry.value)
|
|
4870
4835
|
},
|
|
4871
4836
|
`${element.id}-map-dl-${region.code}`
|
|
4872
4837
|
);
|
|
@@ -4884,7 +4849,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4884
4849
|
opacity: 0.9,
|
|
4885
4850
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
4886
4851
|
region.name,
|
|
4887
|
-
entry ? `: ${
|
|
4852
|
+
entry ? `: ${chunkFDR5W67L_js.formatAxisValue(entry.value)}` : ""
|
|
4888
4853
|
] })
|
|
4889
4854
|
}
|
|
4890
4855
|
),
|
|
@@ -4922,7 +4887,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4922
4887
|
fontSize: 7,
|
|
4923
4888
|
fill: "#64748b",
|
|
4924
4889
|
textAnchor: "middle",
|
|
4925
|
-
children:
|
|
4890
|
+
children: chunkFDR5W67L_js.formatAxisValue(minVal)
|
|
4926
4891
|
},
|
|
4927
4892
|
`${element.id}-map-legend-min`
|
|
4928
4893
|
),
|
|
@@ -4934,7 +4899,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4934
4899
|
fontSize: 7,
|
|
4935
4900
|
fill: "#64748b",
|
|
4936
4901
|
textAnchor: "middle",
|
|
4937
|
-
children:
|
|
4902
|
+
children: chunkFDR5W67L_js.formatAxisValue(maxVal)
|
|
4938
4903
|
},
|
|
4939
4904
|
`${element.id}-map-legend-max`
|
|
4940
4905
|
)
|
|
@@ -5000,7 +4965,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
5000
4965
|
y,
|
|
5001
4966
|
fontSize,
|
|
5002
4967
|
fill: "#475569",
|
|
5003
|
-
children:
|
|
4968
|
+
children: chunkFDR5W67L_js.formatAxisValue(row.value)
|
|
5004
4969
|
},
|
|
5005
4970
|
`${element.id}-map-ft-val-${i}`
|
|
5006
4971
|
)
|
|
@@ -5071,7 +5036,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
5071
5036
|
|
|
5072
5037
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
5073
5038
|
function sColor(series, idx) {
|
|
5074
|
-
return
|
|
5039
|
+
return chunkFDR5W67L_js.seriesColor(series, idx);
|
|
5075
5040
|
}
|
|
5076
5041
|
function valToY(val, range, topY, bottomY) {
|
|
5077
5042
|
const usable = bottomY - topY;
|
|
@@ -5610,7 +5575,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5610
5575
|
width: 10,
|
|
5611
5576
|
height: 10,
|
|
5612
5577
|
rx: 2,
|
|
5613
|
-
fill:
|
|
5578
|
+
fill: chunkFDR5W67L_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5614
5579
|
},
|
|
5615
5580
|
`${id}-leg-r-${i}`
|
|
5616
5581
|
)
|
|
@@ -5634,7 +5599,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5634
5599
|
width: 10,
|
|
5635
5600
|
height: 10,
|
|
5636
5601
|
rx: 2,
|
|
5637
|
-
fill:
|
|
5602
|
+
fill: chunkFDR5W67L_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5638
5603
|
}
|
|
5639
5604
|
),
|
|
5640
5605
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -5647,9 +5612,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5647
5612
|
}
|
|
5648
5613
|
const lines = [];
|
|
5649
5614
|
if (range.logScale && range.logBase) {
|
|
5650
|
-
const ticks =
|
|
5615
|
+
const ticks = chunkFDR5W67L_js.generateLogTicks(range);
|
|
5651
5616
|
ticks.forEach((tickVal, i) => {
|
|
5652
|
-
const y =
|
|
5617
|
+
const y = chunkFDR5W67L_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5653
5618
|
lines.push(
|
|
5654
5619
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5655
5620
|
"line",
|
|
@@ -5670,7 +5635,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5670
5635
|
const steps = 4;
|
|
5671
5636
|
for (let i = 0; i <= steps; i++) {
|
|
5672
5637
|
const val = range.min + range.span * i / steps;
|
|
5673
|
-
const y =
|
|
5638
|
+
const y = chunkFDR5W67L_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5674
5639
|
lines.push(
|
|
5675
5640
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5676
5641
|
"line",
|
|
@@ -5694,9 +5659,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5694
5659
|
const labels = [];
|
|
5695
5660
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5696
5661
|
if (range.logScale && range.logBase) {
|
|
5697
|
-
const ticks =
|
|
5662
|
+
const ticks = chunkFDR5W67L_js.generateLogTicks(range);
|
|
5698
5663
|
ticks.forEach((tickVal, i) => {
|
|
5699
|
-
const y =
|
|
5664
|
+
const y = chunkFDR5W67L_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5700
5665
|
labels.push(
|
|
5701
5666
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5702
5667
|
"text",
|
|
@@ -5706,7 +5671,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5706
5671
|
textAnchor: "end",
|
|
5707
5672
|
fontSize: 8,
|
|
5708
5673
|
fill: "#64748b",
|
|
5709
|
-
children: hasDisplayUnits ?
|
|
5674
|
+
children: hasDisplayUnits ? chunkFDR5W67L_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunkFDR5W67L_js.formatAxisValue(tickVal)
|
|
5710
5675
|
},
|
|
5711
5676
|
`${id}-vaxis-log-${i}`
|
|
5712
5677
|
)
|
|
@@ -5716,7 +5681,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5716
5681
|
const steps = 4;
|
|
5717
5682
|
for (let i = 0; i <= steps; i++) {
|
|
5718
5683
|
const val = range.min + range.span * i / steps;
|
|
5719
|
-
const y =
|
|
5684
|
+
const y = chunkFDR5W67L_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5720
5685
|
labels.push(
|
|
5721
5686
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5722
5687
|
"text",
|
|
@@ -5726,7 +5691,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5726
5691
|
textAnchor: "end",
|
|
5727
5692
|
fontSize: 8,
|
|
5728
5693
|
fill: "#64748b",
|
|
5729
|
-
children: hasDisplayUnits ?
|
|
5694
|
+
children: hasDisplayUnits ? chunkFDR5W67L_js.formatAxisValueWithUnits(val, axisFormatting) : chunkFDR5W67L_js.formatAxisValue(val)
|
|
5730
5695
|
},
|
|
5731
5696
|
`${id}-vaxis-${i}`
|
|
5732
5697
|
)
|
|
@@ -5734,7 +5699,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5734
5699
|
}
|
|
5735
5700
|
}
|
|
5736
5701
|
if (hasDisplayUnits) {
|
|
5737
|
-
const unitLabel =
|
|
5702
|
+
const unitLabel = chunkFDR5W67L_js.getDisplayUnitLabel(
|
|
5738
5703
|
axisFormatting.displayUnits,
|
|
5739
5704
|
axisFormatting.displayUnitsLabel
|
|
5740
5705
|
);
|
|
@@ -5809,7 +5774,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
5809
5774
|
if (range.min >= 0) {
|
|
5810
5775
|
return null;
|
|
5811
5776
|
}
|
|
5812
|
-
const y =
|
|
5777
|
+
const y = chunkFDR5W67L_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
5813
5778
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5814
5779
|
"line",
|
|
5815
5780
|
{
|
|
@@ -5833,7 +5798,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5833
5798
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5834
5799
|
for (let i = 0; i <= steps; i++) {
|
|
5835
5800
|
const val = range.min + range.span * i / steps;
|
|
5836
|
-
const y =
|
|
5801
|
+
const y = chunkFDR5W67L_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5837
5802
|
labels.push(
|
|
5838
5803
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5839
5804
|
"text",
|
|
@@ -5845,7 +5810,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5845
5810
|
fontFamily,
|
|
5846
5811
|
fontWeight,
|
|
5847
5812
|
fill: fontColor,
|
|
5848
|
-
children: hasDisplayUnits ?
|
|
5813
|
+
children: hasDisplayUnits ? chunkFDR5W67L_js.formatAxisValueWithUnits(val, axisFormatting) : chunkFDR5W67L_js.formatAxisValue(val)
|
|
5849
5814
|
},
|
|
5850
5815
|
`${id}-sec-vaxis-${i}`
|
|
5851
5816
|
)
|
|
@@ -5869,7 +5834,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5869
5834
|
);
|
|
5870
5835
|
}
|
|
5871
5836
|
if (hasDisplayUnits) {
|
|
5872
|
-
const unitLabel =
|
|
5837
|
+
const unitLabel = chunkFDR5W67L_js.getDisplayUnitLabel(
|
|
5873
5838
|
axisFormatting.displayUnits,
|
|
5874
5839
|
axisFormatting.displayUnitsLabel
|
|
5875
5840
|
);
|
|
@@ -5900,7 +5865,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
5900
5865
|
const ticks = [];
|
|
5901
5866
|
for (let i = 0; i <= steps; i++) {
|
|
5902
5867
|
const val = range.min + range.span * i / steps;
|
|
5903
|
-
const y =
|
|
5868
|
+
const y = chunkFDR5W67L_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5904
5869
|
ticks.push(
|
|
5905
5870
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5906
5871
|
"line",
|
|
@@ -5927,7 +5892,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
5927
5892
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
5928
5893
|
for (let i = 0; i <= steps; i++) {
|
|
5929
5894
|
const val = range.min + range.span * i / steps;
|
|
5930
|
-
const y =
|
|
5895
|
+
const y = chunkFDR5W67L_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5931
5896
|
lines.push(
|
|
5932
5897
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5933
5898
|
"line",
|
|
@@ -6089,7 +6054,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6089
6054
|
width: 8,
|
|
6090
6055
|
height: 8,
|
|
6091
6056
|
borderRadius: 2,
|
|
6092
|
-
backgroundColor:
|
|
6057
|
+
backgroundColor: chunkFDR5W67L_js.seriesColor(
|
|
6093
6058
|
s,
|
|
6094
6059
|
si,
|
|
6095
6060
|
chartData.style?.styleId,
|
|
@@ -6127,10 +6092,10 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6127
6092
|
}
|
|
6128
6093
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
6129
6094
|
const style = chartData.style;
|
|
6130
|
-
const areaFill =
|
|
6095
|
+
const areaFill = chunkFDR5W67L_js.chartAreaFill(chartData);
|
|
6131
6096
|
const legendPos = style?.legendPosition || "b";
|
|
6132
|
-
const range =
|
|
6133
|
-
const layout =
|
|
6097
|
+
const range = chunkFDR5W67L_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6098
|
+
const layout = chunkFDR5W67L_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6134
6099
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6135
6100
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
6136
6101
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -6151,10 +6116,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6151
6116
|
const close = closeSeries.values[ci] ?? high;
|
|
6152
6117
|
const isUp = close >= open;
|
|
6153
6118
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
6154
|
-
const highY =
|
|
6155
|
-
const lowY =
|
|
6156
|
-
const openY =
|
|
6157
|
-
const closeY =
|
|
6119
|
+
const highY = chunkFDR5W67L_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
6120
|
+
const lowY = chunkFDR5W67L_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
6121
|
+
const openY = chunkFDR5W67L_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
6122
|
+
const closeY = chunkFDR5W67L_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
|
|
6158
6123
|
elements.push(
|
|
6159
6124
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6160
6125
|
"line",
|
|
@@ -6197,7 +6162,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6197
6162
|
textAnchor: "middle",
|
|
6198
6163
|
fontSize: 7,
|
|
6199
6164
|
fill: "#334155",
|
|
6200
|
-
children:
|
|
6165
|
+
children: chunkFDR5W67L_js.formatAxisValue(close)
|
|
6201
6166
|
},
|
|
6202
6167
|
`${element.id}-stock-dl-${ci}`
|
|
6203
6168
|
)
|
|
@@ -6239,7 +6204,7 @@ function FailedToLoad() {
|
|
|
6239
6204
|
var LazySurfaceChart3DScene = React6__default.default.lazy(
|
|
6240
6205
|
async () => {
|
|
6241
6206
|
try {
|
|
6242
|
-
return await import('./SurfaceChart3DScene-
|
|
6207
|
+
return await import('./SurfaceChart3DScene-OTKXQH5O.js');
|
|
6243
6208
|
} catch {
|
|
6244
6209
|
return { default: FailedToLoad };
|
|
6245
6210
|
}
|
|
@@ -6263,7 +6228,7 @@ var SurfaceChart3DErrorBoundary = class extends React6__default.default.Componen
|
|
|
6263
6228
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
6264
6229
|
const rows = chartData.series.length;
|
|
6265
6230
|
const cols = Math.max(categoryLabels.length, 1);
|
|
6266
|
-
const range =
|
|
6231
|
+
const range = chunkFDR5W67L_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6267
6232
|
const heightMap = new Float32Array(rows * cols);
|
|
6268
6233
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
6269
6234
|
for (let r = 0; r < rows; r++) {
|
|
@@ -6382,10 +6347,10 @@ function darkenRgb(r, g, b, factor) {
|
|
|
6382
6347
|
}
|
|
6383
6348
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
6384
6349
|
const style = chartData.style;
|
|
6385
|
-
const areaFill =
|
|
6350
|
+
const areaFill = chunkFDR5W67L_js.chartAreaFill(chartData);
|
|
6386
6351
|
const legendPos = style?.legendPosition || "b";
|
|
6387
|
-
const layout =
|
|
6388
|
-
const range =
|
|
6352
|
+
const layout = chunkFDR5W67L_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6353
|
+
const range = chunkFDR5W67L_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6389
6354
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6390
6355
|
const seriesCount = chartData.series.length;
|
|
6391
6356
|
const cols = catCount - 1;
|
|
@@ -6474,10 +6439,10 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6474
6439
|
}
|
|
6475
6440
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
6476
6441
|
const style = chartData.style;
|
|
6477
|
-
const areaFill =
|
|
6442
|
+
const areaFill = chunkFDR5W67L_js.chartAreaFill(chartData);
|
|
6478
6443
|
const legendPos = style?.legendPosition || "b";
|
|
6479
|
-
const layout =
|
|
6480
|
-
const range =
|
|
6444
|
+
const layout = chunkFDR5W67L_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6445
|
+
const range = chunkFDR5W67L_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6481
6446
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6482
6447
|
const seriesCount = chartData.series.length;
|
|
6483
6448
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -6539,9 +6504,9 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6539
6504
|
}
|
|
6540
6505
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
6541
6506
|
const style = chartData.style;
|
|
6542
|
-
const areaFill =
|
|
6507
|
+
const areaFill = chunkFDR5W67L_js.chartAreaFill(chartData);
|
|
6543
6508
|
const legendPos = style?.legendPosition || "b";
|
|
6544
|
-
const layout =
|
|
6509
|
+
const layout = chunkFDR5W67L_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6545
6510
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
6546
6511
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
6547
6512
|
const rects = [];
|
|
@@ -6564,7 +6529,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
6564
6529
|
y: curY,
|
|
6565
6530
|
width: Math.max(w - 1, 1),
|
|
6566
6531
|
height: Math.max(h - 1, 1),
|
|
6567
|
-
fill:
|
|
6532
|
+
fill: chunkFDR5W67L_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
6568
6533
|
rx: 2,
|
|
6569
6534
|
opacity: 0.85
|
|
6570
6535
|
},
|
|
@@ -6615,11 +6580,11 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
6615
6580
|
}
|
|
6616
6581
|
function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
6617
6582
|
const style = chartData.style;
|
|
6618
|
-
const areaFill =
|
|
6583
|
+
const areaFill = chunkFDR5W67L_js.chartAreaFill(chartData);
|
|
6619
6584
|
const legendPos = style?.legendPosition || "b";
|
|
6620
6585
|
const values = chartData.series[0]?.values ?? [];
|
|
6621
|
-
const range =
|
|
6622
|
-
const layout =
|
|
6586
|
+
const range = chunkFDR5W67L_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6587
|
+
const layout = chunkFDR5W67L_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6623
6588
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
6624
6589
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
6625
6590
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -6630,8 +6595,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6630
6595
|
const isLast = i === values.length - 1;
|
|
6631
6596
|
const startVal = isLast ? 0 : runningTotal;
|
|
6632
6597
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
6633
|
-
const barStartY =
|
|
6634
|
-
const barEndY =
|
|
6598
|
+
const barStartY = chunkFDR5W67L_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
6599
|
+
const barEndY = chunkFDR5W67L_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
|
|
6635
6600
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
6636
6601
|
const y = Math.min(barStartY, barEndY);
|
|
6637
6602
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -6660,7 +6625,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6660
6625
|
textAnchor: "middle",
|
|
6661
6626
|
fontSize: 7,
|
|
6662
6627
|
fill: "#334155",
|
|
6663
|
-
children:
|
|
6628
|
+
children: chunkFDR5W67L_js.formatAxisValue(isLast ? endVal : val)
|
|
6664
6629
|
},
|
|
6665
6630
|
`${element.id}-wf-dl-${i}`
|
|
6666
6631
|
)
|
|
@@ -6707,20 +6672,20 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6707
6672
|
}
|
|
6708
6673
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
6709
6674
|
const style = chartData.style;
|
|
6710
|
-
const areaFill =
|
|
6675
|
+
const areaFill = chunkFDR5W67L_js.chartAreaFill(chartData);
|
|
6711
6676
|
const legendPos = style?.legendPosition || "b";
|
|
6712
|
-
const layoutOpts =
|
|
6677
|
+
const layoutOpts = chunkFDR5W67L_js.computeLayoutOptions(
|
|
6713
6678
|
chartData.axes,
|
|
6714
6679
|
chartData.dataTable,
|
|
6715
6680
|
chartData.series.length
|
|
6716
6681
|
);
|
|
6717
|
-
const layout =
|
|
6718
|
-
const { primary, secondary } =
|
|
6682
|
+
const layout = chunkFDR5W67L_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
6683
|
+
const { primary, secondary } = chunkFDR5W67L_js.splitSeriesByAxis(chartData.series, chartData.axes);
|
|
6719
6684
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
6720
6685
|
const secondarySeries = secondary.map((e) => e.series);
|
|
6721
|
-
const range =
|
|
6722
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
6723
|
-
const secondaryAxisFmt =
|
|
6686
|
+
const range = chunkFDR5W67L_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
6687
|
+
const secondaryRange = secondarySeries.length > 0 ? chunkFDR5W67L_js.computeValueRange(secondarySeries) : void 0;
|
|
6688
|
+
const secondaryAxisFmt = chunkFDR5W67L_js.getSecondaryValueAxis(chartData.axes);
|
|
6724
6689
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6725
6690
|
const barSeriesCount = 1;
|
|
6726
6691
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -6736,8 +6701,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6736
6701
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
6737
6702
|
barSeries.values.forEach((val, vi) => {
|
|
6738
6703
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
6739
|
-
const zeroY =
|
|
6740
|
-
const valY =
|
|
6704
|
+
const zeroY = chunkFDR5W67L_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
6705
|
+
const valY = chunkFDR5W67L_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
|
|
6741
6706
|
const y = Math.min(zeroY, valY);
|
|
6742
6707
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
6743
6708
|
barElements.push(
|
|
@@ -6748,7 +6713,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6748
6713
|
y,
|
|
6749
6714
|
width: barWidth,
|
|
6750
6715
|
height: h,
|
|
6751
|
-
fill:
|
|
6716
|
+
fill: chunkFDR5W67L_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
6752
6717
|
rx: 1
|
|
6753
6718
|
},
|
|
6754
6719
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -6764,7 +6729,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6764
6729
|
textAnchor: "middle",
|
|
6765
6730
|
fontSize: 7,
|
|
6766
6731
|
fill: "#334155",
|
|
6767
|
-
children:
|
|
6732
|
+
children: chunkFDR5W67L_js.formatAxisValue(val)
|
|
6768
6733
|
},
|
|
6769
6734
|
`${element.id}-combo-bar-dl-${vi}`
|
|
6770
6735
|
)
|
|
@@ -6781,10 +6746,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6781
6746
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
6782
6747
|
const points = series.values.map((val, vi) => {
|
|
6783
6748
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
6784
|
-
const y =
|
|
6749
|
+
const y = chunkFDR5W67L_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
6785
6750
|
return { x, y, val };
|
|
6786
6751
|
});
|
|
6787
|
-
const c =
|
|
6752
|
+
const c = chunkFDR5W67L_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
6788
6753
|
lineElements.push(
|
|
6789
6754
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6790
6755
|
"polyline",
|
|
@@ -6811,7 +6776,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6811
6776
|
textAnchor: "middle",
|
|
6812
6777
|
fontSize: 7,
|
|
6813
6778
|
fill: "#334155",
|
|
6814
|
-
children:
|
|
6779
|
+
children: chunkFDR5W67L_js.formatAxisValue(p.val)
|
|
6815
6780
|
},
|
|
6816
6781
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
6817
6782
|
)
|
|
@@ -7957,14 +7922,14 @@ function buildNotesPdf(pages) {
|
|
|
7957
7922
|
notes: page.notes,
|
|
7958
7923
|
slideNumber: page.slideNumber
|
|
7959
7924
|
}));
|
|
7960
|
-
const bytes =
|
|
7925
|
+
const bytes = chunkFDR5W67L_js.buildNotesPdfBytes(images, meta);
|
|
7961
7926
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
7962
7927
|
return URL.createObjectURL(blob);
|
|
7963
7928
|
}
|
|
7964
7929
|
|
|
7965
7930
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
7966
7931
|
function buildPdfFromImageData(images) {
|
|
7967
|
-
const bytes =
|
|
7932
|
+
const bytes = chunkFDR5W67L_js.buildSlidesPdfBytes(images);
|
|
7968
7933
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
7969
7934
|
return URL.createObjectURL(blob);
|
|
7970
7935
|
}
|
|
@@ -7973,7 +7938,7 @@ function buildPdfFromImageData(images) {
|
|
|
7973
7938
|
var activePreview = null;
|
|
7974
7939
|
function startPreviewAnimation(elementId, preset, options) {
|
|
7975
7940
|
stopPreviewAnimation();
|
|
7976
|
-
const descriptor =
|
|
7941
|
+
const descriptor = chunkFDR5W67L_js.buildPreviewAnimation(preset, options);
|
|
7977
7942
|
if (!descriptor) {
|
|
7978
7943
|
return;
|
|
7979
7944
|
}
|
|
@@ -7986,7 +7951,7 @@ function startMotionPathPreview(elementId, path, options) {
|
|
|
7986
7951
|
return;
|
|
7987
7952
|
}
|
|
7988
7953
|
const stage = domEl.offsetParent;
|
|
7989
|
-
const descriptor =
|
|
7954
|
+
const descriptor = chunkFDR5W67L_js.buildMotionPathPreview({
|
|
7990
7955
|
path,
|
|
7991
7956
|
slideWidth: stage?.offsetWidth || DEFAULT_PREVIEW_SLIDE_WIDTH,
|
|
7992
7957
|
slideHeight: stage?.offsetHeight || DEFAULT_PREVIEW_SLIDE_HEIGHT,
|
|
@@ -8126,7 +8091,6 @@ exports.shouldRenderFallbackLabel = shouldRenderFallbackLabel;
|
|
|
8126
8091
|
exports.smartArtNodeGroupProps = smartArtNodeGroupProps;
|
|
8127
8092
|
exports.startMotionPathPreview = startMotionPathPreview;
|
|
8128
8093
|
exports.startPreviewAnimation = startPreviewAnimation;
|
|
8129
|
-
exports.stopAllPersistentAudio = stopAllPersistentAudio;
|
|
8130
8094
|
exports.stopPreviewAnimation = stopPreviewAnimation;
|
|
8131
8095
|
exports.styleShadow = styleShadow;
|
|
8132
8096
|
exports.styleStroke = styleStroke;
|