pptx-react-viewer 2.12.1 → 2.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/{AiChatPanel-UEFYTUJN.js → AiChatPanel-FXPGFU6H.js} +35 -27
- package/dist/AiChatPanel-FXPGFU6H.js.br +0 -0
- package/dist/AiChatPanel-FXPGFU6H.js.gz +0 -0
- package/dist/{AiChatPanel-CGGUPVQX.mjs → AiChatPanel-WMGS5TNX.mjs} +15 -7
- package/dist/AiChatPanel-WMGS5TNX.mjs.br +0 -0
- package/dist/AiChatPanel-WMGS5TNX.mjs.gz +0 -0
- package/dist/{Model3DScene-TU4NTHRM.mjs → Model3DScene-E2XRQAMR.mjs} +1 -1
- package/dist/Model3DScene-E2XRQAMR.mjs.br +0 -0
- package/dist/Model3DScene-E2XRQAMR.mjs.gz +0 -0
- package/dist/{Model3DScene-QYXJNALP.js → Model3DScene-K5FPZTRG.js} +2 -2
- package/dist/Model3DScene-K5FPZTRG.js.br +0 -0
- package/dist/Model3DScene-K5FPZTRG.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-VTJBKUQY.mjs → SurfaceChart3DScene-2W2IFPLE.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-VTJBKUQY.mjs.br → SurfaceChart3DScene-2W2IFPLE.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-2W2IFPLE.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-4VCO3DRP.js → SurfaceChart3DScene-JDCFTXYT.js} +2 -2
- package/dist/SurfaceChart3DScene-JDCFTXYT.js.br +0 -0
- package/dist/SurfaceChart3DScene-JDCFTXYT.js.gz +0 -0
- package/dist/{chunk-4SGXEGVL.mjs → chunk-3OV4FR6S.mjs} +26 -14
- package/dist/chunk-3OV4FR6S.mjs.br +0 -0
- package/dist/chunk-3OV4FR6S.mjs.gz +0 -0
- package/dist/{chunk-LE6YA5WB.js → chunk-66ZHD7Y4.js} +282 -299
- package/dist/chunk-66ZHD7Y4.js.br +0 -0
- package/dist/chunk-66ZHD7Y4.js.gz +0 -0
- package/dist/{chunk-N3NKU7SC.mjs → chunk-CQ2CKMG4.mjs} +1 -1
- package/dist/chunk-CQ2CKMG4.mjs.br +0 -0
- package/dist/chunk-CQ2CKMG4.mjs.gz +0 -0
- package/dist/{chunk-TDUDH7S4.js → chunk-DD2YRS6Z.js} +1328 -660
- package/dist/chunk-DD2YRS6Z.js.br +0 -0
- package/dist/chunk-DD2YRS6Z.js.gz +0 -0
- package/dist/{chunk-YIPR3GKG.mjs → chunk-GJEH27GD.mjs} +53 -69
- package/dist/chunk-GJEH27GD.mjs.br +0 -0
- package/dist/chunk-GJEH27GD.mjs.gz +0 -0
- package/dist/{chunk-4GYNTY2G.mjs → chunk-H5H57XMH.mjs} +16 -2
- package/dist/chunk-H5H57XMH.mjs.br +0 -0
- package/dist/chunk-H5H57XMH.mjs.gz +0 -0
- package/dist/{chunk-CABQXGPI.mjs → chunk-OWGPRVRK.mjs} +1322 -661
- package/dist/chunk-OWGPRVRK.mjs.br +0 -0
- package/dist/chunk-OWGPRVRK.mjs.gz +0 -0
- package/dist/{chunk-UIWY4XJT.js → chunk-PTFCMG3A.js} +3 -3
- package/dist/chunk-PTFCMG3A.js.br +0 -0
- package/dist/chunk-PTFCMG3A.js.gz +0 -0
- package/dist/{chunk-NUDH7TI2.js → chunk-QFNJCEMS.js} +340 -326
- package/dist/chunk-QFNJCEMS.js.br +0 -0
- package/dist/chunk-QFNJCEMS.js.gz +0 -0
- package/dist/{chunk-GBKIWNW6.js → chunk-ZMIFFURL.js} +1054 -1042
- package/dist/chunk-ZMIFFURL.js.br +0 -0
- package/dist/chunk-ZMIFFURL.js.gz +0 -0
- package/dist/index.d.ts +32 -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 +32 -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 +32 -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-CGGUPVQX.mjs.br +0 -0
- package/dist/AiChatPanel-CGGUPVQX.mjs.gz +0 -0
- package/dist/AiChatPanel-UEFYTUJN.js.br +0 -0
- package/dist/AiChatPanel-UEFYTUJN.js.gz +0 -0
- package/dist/Model3DScene-QYXJNALP.js.br +0 -0
- package/dist/Model3DScene-QYXJNALP.js.gz +0 -0
- package/dist/Model3DScene-TU4NTHRM.mjs.br +0 -0
- package/dist/Model3DScene-TU4NTHRM.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-4VCO3DRP.js.br +0 -0
- package/dist/SurfaceChart3DScene-4VCO3DRP.js.gz +0 -0
- package/dist/SurfaceChart3DScene-VTJBKUQY.mjs.gz +0 -0
- package/dist/chunk-4GYNTY2G.mjs.br +0 -0
- package/dist/chunk-4GYNTY2G.mjs.gz +0 -0
- package/dist/chunk-4SGXEGVL.mjs.br +0 -0
- package/dist/chunk-4SGXEGVL.mjs.gz +0 -0
- package/dist/chunk-CABQXGPI.mjs.br +0 -0
- package/dist/chunk-CABQXGPI.mjs.gz +0 -0
- package/dist/chunk-GBKIWNW6.js.br +0 -0
- package/dist/chunk-GBKIWNW6.js.gz +0 -0
- package/dist/chunk-LE6YA5WB.js.br +0 -0
- package/dist/chunk-LE6YA5WB.js.gz +0 -0
- package/dist/chunk-N3NKU7SC.mjs.br +0 -0
- package/dist/chunk-N3NKU7SC.mjs.gz +0 -0
- package/dist/chunk-NUDH7TI2.js.br +0 -0
- package/dist/chunk-NUDH7TI2.js.gz +0 -0
- package/dist/chunk-TDUDH7S4.js.br +0 -0
- package/dist/chunk-TDUDH7S4.js.gz +0 -0
- package/dist/chunk-UIWY4XJT.js.br +0 -0
- package/dist/chunk-UIWY4XJT.js.gz +0 -0
- package/dist/chunk-YIPR3GKG.mjs.br +0 -0
- package/dist/chunk-YIPR3GKG.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 chunkDD2YRS6Z_js = require('./chunk-DD2YRS6Z.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 chunkDD2YRS6Z_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 chunkDD2YRS6Z_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 = chunkDD2YRS6Z_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 = chunkDD2YRS6Z_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 (!chunkDD2YRS6Z_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) => chunkDD2YRS6Z_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) => !chunkDD2YRS6Z_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 (!chunkDD2YRS6Z_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 = chunkDD2YRS6Z_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 = chunkDD2YRS6Z_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
|
+
...chunkDD2YRS6Z_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 (!chunkDD2YRS6Z_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 (!chunkDD2YRS6Z_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 (!chunkDD2YRS6Z_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 chunkDD2YRS6Z_js.runMediaCommand(
|
|
694
663
|
command,
|
|
695
|
-
(targetId) => registry.get(targetId) ??
|
|
664
|
+
(targetId) => registry.get(targetId) ?? chunkDD2YRS6Z_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
|
+
} = chunkDD2YRS6Z_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
|
+
chunkDD2YRS6Z_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 = chunkDD2YRS6Z_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 chunkDD2YRS6Z_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 (!chunkDD2YRS6Z_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 = chunkDD2YRS6Z_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
1111
|
+
const textOrientation = chunkDD2YRS6Z_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
1112
|
+
const verticalDirection = chunkDD2YRS6Z_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 = chunkDD2YRS6Z_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 = chunkDD2YRS6Z_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 chunkDD2YRS6Z_js.buildTextFillCss(style);
|
|
1212
1177
|
}
|
|
1213
1178
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
1214
|
-
return
|
|
1179
|
+
return chunkDD2YRS6Z_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}${chunkDD2YRS6Z_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 = chunkDD2YRS6Z_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: chunkDD2YRS6Z_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 = chunkDD2YRS6Z_js.segmentByScript(text);
|
|
1568
1533
|
if (runs.length <= 1) {
|
|
1569
1534
|
if (runs.length === 1) {
|
|
1570
|
-
const font =
|
|
1535
|
+
const font = chunkDD2YRS6Z_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 = chunkDD2YRS6Z_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 = chunkDD2YRS6Z_js.convertOmmlToMathMl(equationXml);
|
|
1616
|
+
const safeMathml = mathml ? chunkDD2YRS6Z_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 = chunkDD2YRS6Z_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 = chunkDD2YRS6Z_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,31 +1724,44 @@ 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 ? chunkDD2YRS6Z_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, HYPERLINK_COLOR) : chunkDD2YRS6Z_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, fallbackColor);
|
|
1728
|
+
const underlineDecoration = chunkDD2YRS6Z_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 + ${chunkDD2YRS6Z_js.POWERPOINT_METRIC_TRACKING})` : chunkDD2YRS6Z_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 = chunkDD2YRS6Z_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 ? chunkDD2YRS6Z_js.getSubstituteFontFamily(
|
|
1745
|
+
rawFontFamily,
|
|
1746
|
+
chunkDD2YRS6Z_js.parsePanoseString(segmentStyle.latinFontPanose ?? element.textStyle?.latinFontPanose)
|
|
1747
|
+
) : DEFAULT_FONT_FAMILY;
|
|
1748
|
+
const scriptFont = (name, panose) => name ? chunkDD2YRS6Z_js.getSubstituteFontFamily(name, chunkDD2YRS6Z_js.parsePanoseString(panose)) : baseFontFamily;
|
|
1780
1749
|
const scriptFonts = {
|
|
1781
1750
|
latin: baseFontFamily,
|
|
1782
|
-
eastAsia:
|
|
1783
|
-
|
|
1784
|
-
|
|
1751
|
+
eastAsia: scriptFont(
|
|
1752
|
+
segmentStyle.eastAsiaFont || element.textStyle?.eastAsiaFont,
|
|
1753
|
+
segmentStyle.eastAsiaFontPanose ?? element.textStyle?.eastAsiaFontPanose
|
|
1754
|
+
),
|
|
1755
|
+
complexScript: scriptFont(
|
|
1756
|
+
segmentStyle.complexScriptFont || element.textStyle?.complexScriptFont,
|
|
1757
|
+
segmentStyle.complexScriptFontPanose ?? element.textStyle?.complexScriptFontPanose
|
|
1758
|
+
),
|
|
1759
|
+
symbol: scriptFont(
|
|
1760
|
+
segmentStyle.symbolFont || element.textStyle?.symbolFont,
|
|
1761
|
+
segmentStyle.symbolFontPanose ?? element.textStyle?.symbolFontPanose
|
|
1762
|
+
)
|
|
1785
1763
|
};
|
|
1786
|
-
const needsScriptFonts =
|
|
1764
|
+
const needsScriptFonts = chunkDD2YRS6Z_js.hasDistinctScriptFonts(scriptFonts);
|
|
1787
1765
|
const spanStyle = {
|
|
1788
1766
|
color: resolvedSegmentColor,
|
|
1789
1767
|
fontSize: baseFontSize * baselineFontScale,
|
|
@@ -1801,15 +1779,15 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1801
1779
|
fontVariantCaps: segmentStyle.textCaps === "small" ? "small-caps" : void 0,
|
|
1802
1780
|
letterSpacing,
|
|
1803
1781
|
fontKerning,
|
|
1804
|
-
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ?
|
|
1782
|
+
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ? chunkDD2YRS6Z_js.normalizeHexColor(segmentStyle.highlightColor, "transparent") : void 0,
|
|
1805
1783
|
...textFillStyles,
|
|
1806
|
-
textDecorationColor: segmentStyle.underlineColor ?
|
|
1807
|
-
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${
|
|
1784
|
+
textDecorationColor: segmentStyle.underlineColor ? chunkDD2YRS6Z_js.normalizeHexColor(segmentStyle.underlineColor, void 0) : void 0,
|
|
1785
|
+
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${chunkDD2YRS6Z_js.normalizeHexColor(segmentStyle.textOutlineColor, "#000000")}` : segmentStyle.textOutlineWidth ? `${segmentStyle.textOutlineWidth}px currentColor` : void 0,
|
|
1808
1786
|
paintOrder: segmentStyle.textOutlineWidth ? "stroke fill" : void 0,
|
|
1809
|
-
textShadow:
|
|
1810
|
-
filter:
|
|
1811
|
-
opacity:
|
|
1812
|
-
WebkitBoxReflect:
|
|
1787
|
+
textShadow: chunkDD2YRS6Z_js.buildTextShadowCss(segmentStyle),
|
|
1788
|
+
filter: chunkDD2YRS6Z_js.buildTextRunFilterChain(segmentStyle),
|
|
1789
|
+
opacity: chunkDD2YRS6Z_js.getTextAlphaOpacity(segmentStyle),
|
|
1790
|
+
WebkitBoxReflect: chunkDD2YRS6Z_js.buildTextReflectionCss(segmentStyle)
|
|
1813
1791
|
};
|
|
1814
1792
|
const runRtl = segmentStyle.rtl;
|
|
1815
1793
|
if (runRtl !== void 0 && runRtl !== paragraphRtl) {
|
|
@@ -1829,7 +1807,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1829
1807
|
spanStyle.fontSize = baseFontSize * (bulletInfo.sizePercent / 100) * baselineFontScale;
|
|
1830
1808
|
}
|
|
1831
1809
|
if (bulletInfo.color) {
|
|
1832
|
-
spanStyle.color =
|
|
1810
|
+
spanStyle.color = chunkDD2YRS6Z_js.normalizeHexColor(bulletInfo.color, resolvedSegmentColor);
|
|
1833
1811
|
}
|
|
1834
1812
|
if (typeof bulletHangPx === "number" && bulletHangPx > 0) {
|
|
1835
1813
|
spanStyle.display = "inline-block";
|
|
@@ -1874,7 +1852,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1874
1852
|
textAlign: segment.rubyAlignment === "l" ? "left" : segment.rubyAlignment === "r" ? "right" : segment.rubyAlignment === "dist" || segment.rubyAlignment === "distCat" || segment.rubyAlignment === "distLetter" ? "justify" : "center"
|
|
1875
1853
|
};
|
|
1876
1854
|
if (segment.rubyStyle?.color) {
|
|
1877
|
-
rubyStyle.color =
|
|
1855
|
+
rubyStyle.color = chunkDD2YRS6Z_js.normalizeHexColor(segment.rubyStyle.color, resolvedSegmentColor);
|
|
1878
1856
|
}
|
|
1879
1857
|
innerContent = /* @__PURE__ */ jsxRuntime.jsxs("ruby", { children: [
|
|
1880
1858
|
baseContent,
|
|
@@ -1947,7 +1925,7 @@ function resolveParagraphSpacing(input) {
|
|
|
1947
1925
|
if (typeof exactPt === "number" && exactPt > 0) {
|
|
1948
1926
|
result.lineHeight = `${exactPt * PT_TO_PX}px`;
|
|
1949
1927
|
} else if (typeof multiplier === "number" && multiplier > 0) {
|
|
1950
|
-
result.lineHeight = multiplier;
|
|
1928
|
+
result.lineHeight = chunkDD2YRS6Z_js.proportionalLineHeight(multiplier);
|
|
1951
1929
|
}
|
|
1952
1930
|
return result;
|
|
1953
1931
|
}
|
|
@@ -1969,7 +1947,7 @@ function groupSegmentsIntoParagraphs(segments) {
|
|
|
1969
1947
|
return paragraphs;
|
|
1970
1948
|
}
|
|
1971
1949
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick) {
|
|
1972
|
-
if (!
|
|
1950
|
+
if (!chunkDD2YRS6Z_js.hasTextProperties(element)) {
|
|
1973
1951
|
return emptyFallback || null;
|
|
1974
1952
|
}
|
|
1975
1953
|
const effectiveSegments = segmentOverrides ?? element.textSegments;
|
|
@@ -1990,10 +1968,10 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
1990
1968
|
return element.text || emptyFallback || "";
|
|
1991
1969
|
}
|
|
1992
1970
|
const paragraphs = groupSegmentsIntoParagraphs(effectiveSegments);
|
|
1993
|
-
const paragraphIndents =
|
|
1994
|
-
const elementRtl =
|
|
1995
|
-
const elementAlign =
|
|
1996
|
-
const bodyStyle =
|
|
1971
|
+
const paragraphIndents = chunkDD2YRS6Z_js.hasTextProperties(element) ? element.paragraphIndents : void 0;
|
|
1972
|
+
const elementRtl = chunkDD2YRS6Z_js.hasTextProperties(element) ? element.textStyle?.rtl : void 0;
|
|
1973
|
+
const elementAlign = chunkDD2YRS6Z_js.hasTextProperties(element) ? element.textStyle?.align : void 0;
|
|
1974
|
+
const bodyStyle = chunkDD2YRS6Z_js.hasTextProperties(element) ? element.textStyle : void 0;
|
|
1997
1975
|
const spaceFirstLast = bodyStyle?.spaceFirstLastParagraph !== false;
|
|
1998
1976
|
return paragraphs.map(({ entries: paraSegments, terminator }, paraIndex) => {
|
|
1999
1977
|
const paraIndent = paragraphIndents?.[paraIndex];
|
|
@@ -2008,14 +1986,14 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2008
1986
|
return Boolean(segment.text) && segment.text.trim().length > 0;
|
|
2009
1987
|
});
|
|
2010
1988
|
const hasBullet = bulletInfo && !bulletInfo.none && hasVisibleTextContent;
|
|
2011
|
-
const paraRtl =
|
|
1989
|
+
const paraRtl = chunkDD2YRS6Z_js.resolveParagraphRtl(paraSegments, elementRtl);
|
|
2012
1990
|
const isRtlParagraph = paraRtl === true;
|
|
2013
|
-
const paraAlign =
|
|
2014
|
-
const cssTextAlign =
|
|
1991
|
+
const paraAlign = chunkDD2YRS6Z_js.resolveParagraphAlign(paraSegments, elementAlign);
|
|
1992
|
+
const cssTextAlign = chunkDD2YRS6Z_js.resolveCssTextAlign(paraAlign, isRtlParagraph);
|
|
2015
1993
|
const paraMarginLeft = isRtlParagraph ? void 0 : rawMarginLeft;
|
|
2016
1994
|
const paraMarginRight = isRtlParagraph ? rawMarginLeft : void 0;
|
|
2017
1995
|
const paraTextIndent = rawTextIndent;
|
|
2018
|
-
const paraKinsokuStyle =
|
|
1996
|
+
const paraKinsokuStyle = chunkDD2YRS6Z_js.getKinsokuLineBreakStyles(firstSeg?.segment.style);
|
|
2019
1997
|
const hasParaKinsoku = Object.keys(paraKinsokuStyle).length > 0;
|
|
2020
1998
|
const paraProps = effectiveSegments[firstSeg?.globalIndex ?? -1]?.paragraphProperties ?? (paraSegments.length === 0 ? terminator?.paragraphProperties : void 0);
|
|
2021
1999
|
const spacing = resolveParagraphSpacing({
|
|
@@ -2025,7 +2003,7 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2025
2003
|
isLast: paraIndex === paragraphs.length - 1,
|
|
2026
2004
|
spaceFirstLast
|
|
2027
2005
|
});
|
|
2028
|
-
const strutFontSize =
|
|
2006
|
+
const strutFontSize = chunkDD2YRS6Z_js.resolveParagraphStrutFontSize(
|
|
2029
2007
|
paraSegments.length > 0 ? paraSegments.map(({ segment }) => segment) : terminator ? [terminator] : [],
|
|
2030
2008
|
bodyStyle?.fontSize
|
|
2031
2009
|
);
|
|
@@ -2129,13 +2107,13 @@ function hexToRgbUnit(hex) {
|
|
|
2129
2107
|
};
|
|
2130
2108
|
}
|
|
2131
2109
|
function getDuotoneColors(element) {
|
|
2132
|
-
if (!
|
|
2110
|
+
if (!chunkDD2YRS6Z_js.isImageLikeElement(element)) {
|
|
2133
2111
|
return void 0;
|
|
2134
2112
|
}
|
|
2135
2113
|
return element.imageEffects?.duotone;
|
|
2136
2114
|
}
|
|
2137
2115
|
function buildLineShadowCss(element) {
|
|
2138
|
-
if (!
|
|
2116
|
+
if (!chunkDD2YRS6Z_js.hasShapeProperties(element)) {
|
|
2139
2117
|
return void 0;
|
|
2140
2118
|
}
|
|
2141
2119
|
const ss = element.shapeStyle;
|
|
@@ -2146,13 +2124,13 @@ function buildLineShadowCss(element) {
|
|
|
2146
2124
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
2147
2125
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
2148
2126
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
2149
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
2150
|
-
|
|
2127
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkDD2YRS6Z_js.colorWithOpacity(
|
|
2128
|
+
chunkDD2YRS6Z_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
2151
2129
|
opacity
|
|
2152
2130
|
)}`;
|
|
2153
2131
|
}
|
|
2154
2132
|
function buildLineGlowFilter(element) {
|
|
2155
|
-
if (!
|
|
2133
|
+
if (!chunkDD2YRS6Z_js.hasShapeProperties(element)) {
|
|
2156
2134
|
return void 0;
|
|
2157
2135
|
}
|
|
2158
2136
|
const ss = element.shapeStyle;
|
|
@@ -2161,7 +2139,7 @@ function buildLineGlowFilter(element) {
|
|
|
2161
2139
|
}
|
|
2162
2140
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
2163
2141
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
2164
|
-
const glowCol =
|
|
2142
|
+
const glowCol = chunkDD2YRS6Z_js.colorWithOpacity(chunkDD2YRS6Z_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
2165
2143
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
2166
2144
|
}
|
|
2167
2145
|
function mapDagBlendModeToCss(blend) {
|
|
@@ -2185,7 +2163,7 @@ function getDagDuotoneFilterId(elementId) {
|
|
|
2185
2163
|
return `dag-duotone-${elementId}`;
|
|
2186
2164
|
}
|
|
2187
2165
|
function hasDagDuotoneEffect(element) {
|
|
2188
|
-
if (!
|
|
2166
|
+
if (!chunkDD2YRS6Z_js.hasShapeProperties(element)) {
|
|
2189
2167
|
return false;
|
|
2190
2168
|
}
|
|
2191
2169
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
@@ -2248,7 +2226,7 @@ function getRoundRectRadiusPx2(element) {
|
|
|
2248
2226
|
|
|
2249
2227
|
// src/viewer/utils/shape-visual-3d.ts
|
|
2250
2228
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
2251
|
-
return
|
|
2229
|
+
return chunkDD2YRS6Z_js.build3DExtrusionData(
|
|
2252
2230
|
shape3d,
|
|
2253
2231
|
scene3d,
|
|
2254
2232
|
fillColor,
|
|
@@ -2257,7 +2235,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
2257
2235
|
);
|
|
2258
2236
|
}
|
|
2259
2237
|
function apply3dEffects2(base, scene3d, shape3d, fillColorFallback) {
|
|
2260
|
-
|
|
2238
|
+
chunkDD2YRS6Z_js.apply3dEffects(base, scene3d, shape3d, fillColorFallback);
|
|
2261
2239
|
}
|
|
2262
2240
|
|
|
2263
2241
|
// src/viewer/utils/vector-subpath-paint.ts
|
|
@@ -2266,7 +2244,7 @@ function toHexByte(value) {
|
|
|
2266
2244
|
return clamped.toString(16).padStart(2, "0");
|
|
2267
2245
|
}
|
|
2268
2246
|
function shiftHex(hex, factor, towardsWhite) {
|
|
2269
|
-
const channels =
|
|
2247
|
+
const channels = chunkDD2YRS6Z_js.hexToRgbChannels(hex);
|
|
2270
2248
|
if (!channels) {
|
|
2271
2249
|
return hex;
|
|
2272
2250
|
}
|
|
@@ -2292,13 +2270,13 @@ function buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity) {
|
|
|
2292
2270
|
const fillOff = subpath.fillMode === "none" || !hasFill;
|
|
2293
2271
|
return {
|
|
2294
2272
|
d: subpath.d,
|
|
2295
|
-
fill: fillOff ? "none" :
|
|
2273
|
+
fill: fillOff ? "none" : chunkDD2YRS6Z_js.colorWithOpacity(adjustFillForMode(fillColor, subpath.fillMode), fillOpacity),
|
|
2296
2274
|
stroked: subpath.stroke !== false
|
|
2297
2275
|
};
|
|
2298
2276
|
});
|
|
2299
2277
|
}
|
|
2300
2278
|
function getStrokeOnlyPresetPaths(element) {
|
|
2301
|
-
if (element.type !== "shape" || !
|
|
2279
|
+
if (element.type !== "shape" || !chunkDD2YRS6Z_js.hasShapeProperties(element)) {
|
|
2302
2280
|
return void 0;
|
|
2303
2281
|
}
|
|
2304
2282
|
const shapeType = element.shapeType;
|
|
@@ -2308,7 +2286,7 @@ function getStrokeOnlyPresetPaths(element) {
|
|
|
2308
2286
|
if (element.pathData) {
|
|
2309
2287
|
return void 0;
|
|
2310
2288
|
}
|
|
2311
|
-
const result =
|
|
2289
|
+
const result = chunkDD2YRS6Z_js.evaluatePresetShape(
|
|
2312
2290
|
shapeType,
|
|
2313
2291
|
Math.max(element.width, 1),
|
|
2314
2292
|
Math.max(element.height, 1),
|
|
@@ -2326,43 +2304,43 @@ function getGradientTilingCss(style) {
|
|
|
2326
2304
|
if (!style || style.fillMode !== "gradient") {
|
|
2327
2305
|
return void 0;
|
|
2328
2306
|
}
|
|
2329
|
-
const isStructuredLinear = (style.fillGradientType || "linear") === "linear" &&
|
|
2307
|
+
const isStructuredLinear = (style.fillGradientType || "linear") === "linear" && chunkDD2YRS6Z_js.sanitizeGradientStops(style.fillGradientStops).length > 0;
|
|
2330
2308
|
if (isStructuredLinear) {
|
|
2331
|
-
const flip =
|
|
2309
|
+
const flip = chunkDD2YRS6Z_js.getGradientTileFlipCss(style.fillGradientFlip);
|
|
2332
2310
|
if (flip) {
|
|
2333
2311
|
return flip;
|
|
2334
2312
|
}
|
|
2335
2313
|
}
|
|
2336
|
-
return
|
|
2314
|
+
return chunkDD2YRS6Z_js.getGradientTileRectCss(style.fillGradientTileRect);
|
|
2337
2315
|
}
|
|
2338
2316
|
function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2339
|
-
if (!
|
|
2317
|
+
if (!chunkDD2YRS6Z_js.hasShapeProperties(element)) {
|
|
2340
2318
|
return {};
|
|
2341
2319
|
}
|
|
2342
2320
|
const normalizedShapeType = getShapeType(element.shapeType);
|
|
2343
|
-
const clipPath =
|
|
2321
|
+
const clipPath = chunkDD2YRS6Z_js.getResolvedShapeClipPath(element);
|
|
2344
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;
|
|
2345
2323
|
const rendersStrokeOnlyPreset = Boolean(getStrokeOnlyPresetPaths(element));
|
|
2346
2324
|
const fillOpacity = element.shapeStyle?.fillOpacity;
|
|
2347
2325
|
const strokeOpacity = element.shapeStyle?.strokeOpacity;
|
|
2348
|
-
const strokeDash =
|
|
2349
|
-
const fillGradient =
|
|
2326
|
+
const strokeDash = chunkDD2YRS6Z_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2327
|
+
const fillGradient = chunkDD2YRS6Z_js.buildCssGradientFromShapeStyle(element.shapeStyle, {
|
|
2350
2328
|
rotation: element.rotation,
|
|
2351
2329
|
width: element.width,
|
|
2352
2330
|
height: element.height
|
|
2353
2331
|
}) || element.shapeStyle?.fillGradient;
|
|
2354
|
-
const shadowCss =
|
|
2355
|
-
const innerShadowCss =
|
|
2356
|
-
const resolvedFillColor =
|
|
2357
|
-
const resolvedStrokeColor =
|
|
2332
|
+
const shadowCss = chunkDD2YRS6Z_js.buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
2333
|
+
const innerShadowCss = chunkDD2YRS6Z_js.buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
2334
|
+
const resolvedFillColor = chunkDD2YRS6Z_js.colorWithOpacity(fillColor, fillOpacity);
|
|
2335
|
+
const resolvedStrokeColor = chunkDD2YRS6Z_js.colorWithOpacity(strokeColor, strokeOpacity);
|
|
2358
2336
|
const ss = element.shapeStyle;
|
|
2359
2337
|
const gradientTiling = getGradientTilingCss(ss);
|
|
2360
|
-
const paintsGradientOutline =
|
|
2338
|
+
const paintsGradientOutline = chunkDD2YRS6Z_js.suppressesCssBorder(element);
|
|
2361
2339
|
const hasFillOverlayColor = Boolean(
|
|
2362
2340
|
ss?.dagFillOverlayColor && ss.dagFillOverlayColor !== "transparent"
|
|
2363
2341
|
);
|
|
2364
2342
|
const combinedShadowParts = [];
|
|
2365
|
-
const multiLayerShadow =
|
|
2343
|
+
const multiLayerShadow = chunkDD2YRS6Z_js.buildMultiLayerShadowCss(element.shapeStyle);
|
|
2366
2344
|
if (multiLayerShadow) {
|
|
2367
2345
|
combinedShadowParts.push(multiLayerShadow);
|
|
2368
2346
|
} else if (shadowCss) {
|
|
@@ -2371,7 +2349,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2371
2349
|
if (innerShadowCss) {
|
|
2372
2350
|
combinedShadowParts.push(innerShadowCss);
|
|
2373
2351
|
}
|
|
2374
|
-
const glowBoxShadow =
|
|
2352
|
+
const glowBoxShadow = chunkDD2YRS6Z_js.buildGlowBoxShadow(ss?.glowColor, ss?.glowRadius, ss?.glowOpacity);
|
|
2375
2353
|
if (glowBoxShadow) {
|
|
2376
2354
|
combinedShadowParts.push(glowBoxShadow);
|
|
2377
2355
|
}
|
|
@@ -2379,7 +2357,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2379
2357
|
if (lineShadow) {
|
|
2380
2358
|
combinedShadowParts.push(lineShadow);
|
|
2381
2359
|
}
|
|
2382
|
-
const compoundLineShadow =
|
|
2360
|
+
const compoundLineShadow = chunkDD2YRS6Z_js.getCompoundLineBoxShadow(
|
|
2383
2361
|
element.shapeStyle?.compoundLine,
|
|
2384
2362
|
strokeWidth,
|
|
2385
2363
|
resolvedStrokeColor
|
|
@@ -2392,11 +2370,11 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2392
2370
|
if (ss?.glowColor && ss.glowColor !== "transparent" && ss.glowRadius) {
|
|
2393
2371
|
const glowOpacity = typeof ss.glowOpacity === "number" ? ss.glowOpacity : 0.75;
|
|
2394
2372
|
const glowRad = Math.round(Math.max(0, ss.glowRadius));
|
|
2395
|
-
const glowCol =
|
|
2373
|
+
const glowCol = chunkDD2YRS6Z_js.colorWithOpacity(chunkDD2YRS6Z_js.normalizeHexColor(ss.glowColor, "#ffff00"), glowOpacity);
|
|
2396
2374
|
filterParts.push(`drop-shadow(0 0 ${glowRad}px ${glowCol})`);
|
|
2397
2375
|
}
|
|
2398
2376
|
if (typeof ss?.softEdgeRadius === "number" && ss.softEdgeRadius > 0) {
|
|
2399
|
-
filterParts.push(`url(#${
|
|
2377
|
+
filterParts.push(`url(#${chunkDD2YRS6Z_js.getSoftEdgeFilterId(element.id)})`);
|
|
2400
2378
|
}
|
|
2401
2379
|
if (typeof ss?.blurRadius === "number" && ss.blurRadius > 0) {
|
|
2402
2380
|
filterParts.push(`blur(${Math.round(ss.blurRadius)}px)`);
|
|
@@ -2405,13 +2383,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2405
2383
|
if (lineGlowCss) {
|
|
2406
2384
|
filterParts.push(lineGlowCss);
|
|
2407
2385
|
}
|
|
2408
|
-
const dagFilter =
|
|
2386
|
+
const dagFilter = chunkDD2YRS6Z_js.getEffectDagFilter(ss, element.id);
|
|
2409
2387
|
if (dagFilter) {
|
|
2410
2388
|
filterParts.push(dagFilter);
|
|
2411
2389
|
}
|
|
2412
2390
|
const lineJoinCss = ss?.lineJoin === "round" ? "round" : ss?.lineJoin === "bevel" ? "bevel" : ss?.lineJoin === "miter" ? "miter" : void 0;
|
|
2413
2391
|
const miterLimitCss = ss?.lineJoin === "miter" && typeof ss?.miterLimit === "number" ? Math.max(ss.miterLimit / 1e5, 1) : void 0;
|
|
2414
|
-
const patternFill =
|
|
2392
|
+
const patternFill = chunkDD2YRS6Z_js.buildPatternFillCss(element.shapeStyle);
|
|
2415
2393
|
const imageFillUrl = ss?.fillMode === "image" && ss.fillImageUrl ? ss.fillImageUrl : void 0;
|
|
2416
2394
|
const imageFillMode = ss?.fillImageMode || "stretch";
|
|
2417
2395
|
let reflectCss;
|
|
@@ -2423,7 +2401,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2423
2401
|
const endOpacity = typeof ss.reflectionEndOpacity === "number" ? ss.reflectionEndOpacity : 0;
|
|
2424
2402
|
const fadeLength = typeof ss.reflectionEndPosition === "number" ? Math.round(ss.reflectionEndPosition * Math.max(element.height, 1)) : 100;
|
|
2425
2403
|
const blurRadius = typeof ss.reflectionBlurRadius === "number" ? ss.reflectionBlurRadius : 0;
|
|
2426
|
-
reflectCss =
|
|
2404
|
+
reflectCss = chunkDD2YRS6Z_js.buildReflectionCss(distance, startOpacity, endOpacity, fadeLength, blurRadius);
|
|
2427
2405
|
}
|
|
2428
2406
|
}
|
|
2429
2407
|
const base = {
|
|
@@ -2469,9 +2447,9 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2469
2447
|
// path following the shape's geometry, because a CSS border can only take
|
|
2470
2448
|
// one colour. Keeping the border too would draw the parser's averaged
|
|
2471
2449
|
// solid underneath the gradient.
|
|
2472
|
-
borderWidth: strokeWidth > 0 && !paintsGradientOutline ?
|
|
2450
|
+
borderWidth: strokeWidth > 0 && !paintsGradientOutline ? chunkDD2YRS6Z_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : 0,
|
|
2473
2451
|
borderColor: strokeWidth > 0 && !paintsGradientOutline ? resolvedStrokeColor : void 0,
|
|
2474
|
-
borderStyle: strokeWidth > 0 && !paintsGradientOutline ?
|
|
2452
|
+
borderStyle: strokeWidth > 0 && !paintsGradientOutline ? chunkDD2YRS6Z_js.getCssBorderDashStyle(strokeDash, ss?.compoundLine) : void 0,
|
|
2475
2453
|
strokeLinejoin: lineJoinCss,
|
|
2476
2454
|
strokeMiterlimit: miterLimitCss,
|
|
2477
2455
|
strokeLinecap: ss?.lineCap === "rnd" ? "round" : ss?.lineCap === "sq" ? "square" : ss?.lineCap === "flat" ? "butt" : void 0
|
|
@@ -2527,7 +2505,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2527
2505
|
borderWidth: 0,
|
|
2528
2506
|
borderTopWidth: Math.max(strokeWidth, 2),
|
|
2529
2507
|
borderTopColor: resolvedStrokeColor,
|
|
2530
|
-
borderTopStyle:
|
|
2508
|
+
borderTopStyle: chunkDD2YRS6Z_js.getCssBorderDashStyle(strokeDash)
|
|
2531
2509
|
};
|
|
2532
2510
|
}
|
|
2533
2511
|
if (normalizedShapeType === "cylinder") {
|
|
@@ -2541,17 +2519,17 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2541
2519
|
function getConnectorAdjustment(element, key, fallback) {
|
|
2542
2520
|
const direct = element.shapeAdjustments?.[key];
|
|
2543
2521
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
2544
|
-
return
|
|
2522
|
+
return chunkDD2YRS6Z_js.clampUnitInterval(direct / 1e5);
|
|
2545
2523
|
}
|
|
2546
2524
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
2547
2525
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
2548
|
-
return
|
|
2526
|
+
return chunkDD2YRS6Z_js.clampUnitInterval(fallbackKey / 1e5);
|
|
2549
2527
|
}
|
|
2550
|
-
return
|
|
2528
|
+
return chunkDD2YRS6Z_js.clampUnitInterval(fallback);
|
|
2551
2529
|
}
|
|
2552
2530
|
function getConnectorPathGeometry(element) {
|
|
2553
|
-
const width = Math.max(element.width,
|
|
2554
|
-
const height = Math.max(element.height,
|
|
2531
|
+
const width = Math.max(element.width, 0);
|
|
2532
|
+
const height = Math.max(element.height, 0);
|
|
2555
2533
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
2556
2534
|
const mapX = (value) => value;
|
|
2557
2535
|
const mapY = (value) => value;
|
|
@@ -2684,11 +2662,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
|
|
|
2684
2662
|
strokePaint,
|
|
2685
2663
|
strokeWidth,
|
|
2686
2664
|
dashArray,
|
|
2687
|
-
lineCap:
|
|
2665
|
+
lineCap: chunkDD2YRS6Z_js.svgLineCap(shapeStyle?.lineCap),
|
|
2688
2666
|
lineJoin,
|
|
2689
2667
|
miterLimit,
|
|
2690
|
-
offsets:
|
|
2691
|
-
widths:
|
|
2668
|
+
offsets: chunkDD2YRS6Z_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
2669
|
+
widths: chunkDD2YRS6Z_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
|
|
2692
2670
|
};
|
|
2693
2671
|
}
|
|
2694
2672
|
function strokeStrands(d, keyBase, ctx) {
|
|
@@ -2736,9 +2714,9 @@ function gradientDefs(gradient) {
|
|
|
2736
2714
|
}
|
|
2737
2715
|
function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredPaths, shapeStyle, hasFill, fillColor, fillOpacity, strokePaint, strokeWidth, dashArray, animatesFill = false, gradient) {
|
|
2738
2716
|
const ctx = strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray);
|
|
2739
|
-
const subpaths = structuredPaths && structuredPaths.length > 0 ?
|
|
2717
|
+
const subpaths = structuredPaths && structuredPaths.length > 0 ? chunkDD2YRS6Z_js.customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
2740
2718
|
const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
|
|
2741
|
-
const gradientPaint = gradient ?
|
|
2719
|
+
const gradientPaint = gradient ? chunkDD2YRS6Z_js.svgGradientFillRef(gradient) : void 0;
|
|
2742
2720
|
const nodes = [];
|
|
2743
2721
|
if (subpaths && needsPerSubpath) {
|
|
2744
2722
|
const paints = buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity);
|
|
@@ -2770,7 +2748,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2770
2748
|
"path",
|
|
2771
2749
|
{
|
|
2772
2750
|
d: pathData,
|
|
2773
|
-
fill: animatesFill ? "inherit" : gradientPaint ??
|
|
2751
|
+
fill: animatesFill ? "inherit" : gradientPaint ?? chunkDD2YRS6Z_js.colorWithOpacity(fillColor, fillOpacity),
|
|
2774
2752
|
stroke: "none",
|
|
2775
2753
|
vectorEffect: "non-scaling-stroke"
|
|
2776
2754
|
},
|
|
@@ -2815,14 +2793,14 @@ function renderStrokeOnlyPreset(presetPaths, width, height, shapeStyle, strokePa
|
|
|
2815
2793
|
);
|
|
2816
2794
|
}
|
|
2817
2795
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2818
|
-
if (!
|
|
2796
|
+
if (!chunkDD2YRS6Z_js.hasShapeProperties(element)) {
|
|
2819
2797
|
return null;
|
|
2820
2798
|
}
|
|
2821
2799
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
2822
|
-
const fillPaint = animatesFill ? "inherit" :
|
|
2823
|
-
const strokePaint = animatesStroke ? "inherit" :
|
|
2824
|
-
const dashType =
|
|
2825
|
-
const dashArray =
|
|
2800
|
+
const fillPaint = animatesFill ? "inherit" : chunkDD2YRS6Z_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
2801
|
+
const strokePaint = animatesStroke ? "inherit" : chunkDD2YRS6Z_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
2802
|
+
const dashType = chunkDD2YRS6Z_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2803
|
+
const dashArray = chunkDD2YRS6Z_js.getSvgStrokeDasharray(
|
|
2826
2804
|
dashType,
|
|
2827
2805
|
Math.max(strokeWidth, 1),
|
|
2828
2806
|
element.shapeStyle?.customDashSegments
|
|
@@ -2903,21 +2881,21 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2903
2881
|
// container's `background-image` is suppressed for custom geometry, so
|
|
2904
2882
|
// without this the shape fell back to the parser's representative solid
|
|
2905
2883
|
// and lost every fade (issue #132).
|
|
2906
|
-
|
|
2884
|
+
chunkDD2YRS6Z_js.buildSvgGradientDef(element.shapeStyle, element.id)
|
|
2907
2885
|
);
|
|
2908
2886
|
}
|
|
2909
|
-
if (
|
|
2887
|
+
if (chunkDD2YRS6Z_js.isCalloutShape(normalizedType)) {
|
|
2910
2888
|
const width = Math.max(element.width, 1);
|
|
2911
2889
|
const height = Math.max(element.height, 1);
|
|
2912
|
-
const geometry =
|
|
2890
|
+
const geometry = chunkDD2YRS6Z_js.getCalloutLeaderLineGeometry(
|
|
2913
2891
|
normalizedType,
|
|
2914
2892
|
width,
|
|
2915
2893
|
height,
|
|
2916
2894
|
element.shapeAdjustments
|
|
2917
2895
|
);
|
|
2918
2896
|
if (geometry && geometry.points.length >= 2) {
|
|
2919
|
-
const leaderPath =
|
|
2920
|
-
const bounds =
|
|
2897
|
+
const leaderPath = chunkDD2YRS6Z_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
2898
|
+
const bounds = chunkDD2YRS6Z_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
2921
2899
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
2922
2900
|
const offsetLeft = bounds.minX;
|
|
2923
2901
|
const offsetTop = bounds.minY;
|
|
@@ -2980,10 +2958,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2980
2958
|
const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
|
|
2981
2959
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
2982
2960
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
2983
|
-
const connectorLineCap =
|
|
2961
|
+
const connectorLineCap = chunkDD2YRS6Z_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
2984
2962
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
2985
|
-
const offsets =
|
|
2986
|
-
const widths =
|
|
2963
|
+
const offsets = chunkDD2YRS6Z_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
2964
|
+
const widths = chunkDD2YRS6Z_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
2987
2965
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2988
2966
|
"svg",
|
|
2989
2967
|
{
|
|
@@ -3062,15 +3040,15 @@ function parseGradientFillCss(gradFill) {
|
|
|
3062
3040
|
}
|
|
3063
3041
|
const parsed = stops.map((gs) => {
|
|
3064
3042
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
3065
|
-
const color =
|
|
3066
|
-
const opacity =
|
|
3067
|
-
return { pos, color:
|
|
3043
|
+
const color = chunkDD2YRS6Z_js.parseDrawingColor(gs) ?? "#888888";
|
|
3044
|
+
const opacity = chunkDD2YRS6Z_js.parseDrawingColorOpacity(gs);
|
|
3045
|
+
return { pos, color: chunkDD2YRS6Z_js.colorWithOpacity(color, opacity) };
|
|
3068
3046
|
}).sort((a, b) => a.pos - b.pos);
|
|
3069
3047
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
3070
3048
|
const lin = gradFill["a:lin"];
|
|
3071
3049
|
if (lin) {
|
|
3072
3050
|
const angRaw = Number.parseInt(String(lin["@_ang"] || "0"), 10);
|
|
3073
|
-
const angleDeg = Math.round(
|
|
3051
|
+
const angleDeg = Math.round(chunkDD2YRS6Z_js.ooxmlGradientAngleToCssDegrees(angRaw / 6e4));
|
|
3074
3052
|
return `linear-gradient(${angleDeg}deg, ${stopStrings})`;
|
|
3075
3053
|
}
|
|
3076
3054
|
const path = gradFill["a:path"];
|
|
@@ -3105,8 +3083,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
3105
3083
|
if (!pattFill) {
|
|
3106
3084
|
return void 0;
|
|
3107
3085
|
}
|
|
3108
|
-
const fgColor =
|
|
3109
|
-
const bgColor =
|
|
3086
|
+
const fgColor = chunkDD2YRS6Z_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
3087
|
+
const bgColor = chunkDD2YRS6Z_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
3110
3088
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
3111
3089
|
switch (preset) {
|
|
3112
3090
|
case "ltHorz":
|
|
@@ -3217,11 +3195,11 @@ function parseCellBorders(cellProperties) {
|
|
|
3217
3195
|
const prstDash = ln["a:prstDash"];
|
|
3218
3196
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
3219
3197
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
3220
|
-
const color =
|
|
3198
|
+
const color = chunkDD2YRS6Z_js.parseDrawingColor(ln["a:solidFill"]);
|
|
3221
3199
|
if (color) {
|
|
3222
|
-
const opacity =
|
|
3200
|
+
const opacity = chunkDD2YRS6Z_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
3223
3201
|
const key = `${edge.prefix}`;
|
|
3224
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
3202
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkDD2YRS6Z_js.colorWithOpacity(color, opacity)}`;
|
|
3225
3203
|
}
|
|
3226
3204
|
}
|
|
3227
3205
|
return borderStyle;
|
|
@@ -3234,7 +3212,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3234
3212
|
const textShadowParts = [];
|
|
3235
3213
|
const outerShdw = effectLst["a:outerShdw"];
|
|
3236
3214
|
if (outerShdw) {
|
|
3237
|
-
const shdwColor =
|
|
3215
|
+
const shdwColor = chunkDD2YRS6Z_js.parseDrawingColor(outerShdw);
|
|
3238
3216
|
if (shdwColor) {
|
|
3239
3217
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
3240
3218
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -3252,7 +3230,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3252
3230
|
}
|
|
3253
3231
|
const glow = effectLst["a:glow"];
|
|
3254
3232
|
if (glow) {
|
|
3255
|
-
const glowColor =
|
|
3233
|
+
const glowColor = chunkDD2YRS6Z_js.parseDrawingColor(glow);
|
|
3256
3234
|
if (glowColor) {
|
|
3257
3235
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
3258
3236
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -3331,10 +3309,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3331
3309
|
if (runProps?.["@_u"] !== void 0) {
|
|
3332
3310
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
3333
3311
|
}
|
|
3334
|
-
const runColor =
|
|
3312
|
+
const runColor = chunkDD2YRS6Z_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkDD2YRS6Z_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
3335
3313
|
if (runColor) {
|
|
3336
|
-
const opacity =
|
|
3337
|
-
cellStyle.color =
|
|
3314
|
+
const opacity = chunkDD2YRS6Z_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
3315
|
+
cellStyle.color = chunkDD2YRS6Z_js.colorWithOpacity(runColor, opacity);
|
|
3338
3316
|
}
|
|
3339
3317
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
3340
3318
|
if (fontFamily) {
|
|
@@ -3344,15 +3322,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3344
3322
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
3345
3323
|
}
|
|
3346
3324
|
const cellProperties = cellXml["a:tcPr"];
|
|
3347
|
-
const cellFill =
|
|
3325
|
+
const cellFill = chunkDD2YRS6Z_js.parseDrawingColor(
|
|
3348
3326
|
cellProperties?.["a:solidFill"],
|
|
3349
3327
|
schemeColorOverrides
|
|
3350
3328
|
);
|
|
3351
3329
|
if (cellFill) {
|
|
3352
|
-
const opacity =
|
|
3330
|
+
const opacity = chunkDD2YRS6Z_js.parseDrawingColorOpacity(
|
|
3353
3331
|
cellProperties?.["a:solidFill"]
|
|
3354
3332
|
);
|
|
3355
|
-
cellStyle.backgroundColor =
|
|
3333
|
+
cellStyle.backgroundColor = chunkDD2YRS6Z_js.colorWithOpacity(cellFill, opacity);
|
|
3356
3334
|
} else {
|
|
3357
3335
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
3358
3336
|
if (gradCss) {
|
|
@@ -3367,16 +3345,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3367
3345
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
3368
3346
|
Object.assign(cellStyle, edgeBorders);
|
|
3369
3347
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
3370
|
-
const borderColor =
|
|
3348
|
+
const borderColor = chunkDD2YRS6Z_js.parseDrawingColor(
|
|
3371
3349
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
3372
3350
|
schemeColorOverrides
|
|
3373
|
-
) ||
|
|
3351
|
+
) || chunkDD2YRS6Z_js.parseDrawingColor(
|
|
3374
3352
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
3375
3353
|
schemeColorOverrides
|
|
3376
|
-
) ||
|
|
3354
|
+
) || chunkDD2YRS6Z_js.parseDrawingColor(
|
|
3377
3355
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
3378
3356
|
schemeColorOverrides
|
|
3379
|
-
) ||
|
|
3357
|
+
) || chunkDD2YRS6Z_js.parseDrawingColor(
|
|
3380
3358
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
3381
3359
|
schemeColorOverrides
|
|
3382
3360
|
);
|
|
@@ -3455,10 +3433,10 @@ function resolveTableStyleFillColor(fill, colorScheme) {
|
|
|
3455
3433
|
}
|
|
3456
3434
|
let color = base;
|
|
3457
3435
|
if (fill.tint !== void 0 && fill.tint > 0) {
|
|
3458
|
-
color =
|
|
3436
|
+
color = chunkDD2YRS6Z_js.tintColor2(color, fill.tint / 1e5);
|
|
3459
3437
|
}
|
|
3460
3438
|
if (fill.shade !== void 0 && fill.shade > 0) {
|
|
3461
|
-
color =
|
|
3439
|
+
color = chunkDD2YRS6Z_js.shadeColor2(color, 1 - fill.shade / 1e5);
|
|
3462
3440
|
}
|
|
3463
3441
|
return color;
|
|
3464
3442
|
}
|
|
@@ -3483,7 +3461,7 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3483
3461
|
style.fontFamily = text.fontFace;
|
|
3484
3462
|
applied = true;
|
|
3485
3463
|
} else {
|
|
3486
|
-
const refFont =
|
|
3464
|
+
const refFont = chunkDD2YRS6Z_js.resolveFontRefIdx(text.fontRefIdx, fontScheme);
|
|
3487
3465
|
if (refFont) {
|
|
3488
3466
|
style.fontFamily = refFont;
|
|
3489
3467
|
applied = true;
|
|
@@ -3494,10 +3472,10 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3494
3472
|
if (base) {
|
|
3495
3473
|
let color = base;
|
|
3496
3474
|
if (text.fontTint !== void 0 && text.fontTint > 0) {
|
|
3497
|
-
color =
|
|
3475
|
+
color = chunkDD2YRS6Z_js.tintColor2(color, text.fontTint / 1e5);
|
|
3498
3476
|
}
|
|
3499
3477
|
if (text.fontShade !== void 0 && text.fontShade > 0) {
|
|
3500
|
-
color =
|
|
3478
|
+
color = chunkDD2YRS6Z_js.shadeColor2(color, 1 - text.fontShade / 1e5);
|
|
3501
3479
|
}
|
|
3502
3480
|
style.color = color;
|
|
3503
3481
|
applied = true;
|
|
@@ -3686,7 +3664,7 @@ function parseTableElementData(element, fallbackTextStyle) {
|
|
|
3686
3664
|
};
|
|
3687
3665
|
}
|
|
3688
3666
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
3689
|
-
return
|
|
3667
|
+
return chunkDD2YRS6Z_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
3690
3668
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
3691
3669
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
3692
3670
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -3834,9 +3812,9 @@ function cellStyleToCss(style) {
|
|
|
3834
3812
|
if (style.gradientFillCss) {
|
|
3835
3813
|
css.background = style.gradientFillCss;
|
|
3836
3814
|
} else if (style.fillMode === "pattern" && style.patternFillPreset) {
|
|
3837
|
-
const fg =
|
|
3838
|
-
const bg =
|
|
3839
|
-
const svgPattern =
|
|
3815
|
+
const fg = chunkDD2YRS6Z_js.normalizeHexColor(style.patternFillForeground, "#000000");
|
|
3816
|
+
const bg = chunkDD2YRS6Z_js.normalizeHexColor(style.patternFillBackground, "#ffffff");
|
|
3817
|
+
const svgPattern = chunkDD2YRS6Z_js.getPatternSvg(style.patternFillPreset, fg, bg);
|
|
3840
3818
|
if (svgPattern) {
|
|
3841
3819
|
const encoded = encodeURIComponent(svgPattern);
|
|
3842
3820
|
css.backgroundImage = `url("data:image/svg+xml,${encoded}")`;
|
|
@@ -3912,7 +3890,7 @@ function cellStyleToCss(style) {
|
|
|
3912
3890
|
if (edge.width || edge.color) {
|
|
3913
3891
|
const w = edge.width ?? 1;
|
|
3914
3892
|
const c = edge.color ?? style.borderColor ?? "#000000";
|
|
3915
|
-
const s =
|
|
3893
|
+
const s = chunkDD2YRS6Z_js.ooxmlDashToCssBorderStyle(edge.dash);
|
|
3916
3894
|
css[edge.prefix] = `${w}px ${s} ${c}`;
|
|
3917
3895
|
}
|
|
3918
3896
|
}
|
|
@@ -3943,7 +3921,7 @@ function cellStyleToCss(style) {
|
|
|
3943
3921
|
css.textShadow = textShadowParts.join(", ");
|
|
3944
3922
|
}
|
|
3945
3923
|
if (style.cell3D) {
|
|
3946
|
-
Object.assign(css,
|
|
3924
|
+
Object.assign(css, chunkDD2YRS6Z_js.cell3DBevelCss(style.cell3D));
|
|
3947
3925
|
}
|
|
3948
3926
|
return css;
|
|
3949
3927
|
}
|
|
@@ -3957,7 +3935,7 @@ function TableResizeOverlay({
|
|
|
3957
3935
|
const containerRef = React6.useRef(null);
|
|
3958
3936
|
const [rowBounds, setRowBounds] = React6.useState([]);
|
|
3959
3937
|
const dragRef = React6.useRef(null);
|
|
3960
|
-
const colBoundaries = React6.useMemo(() =>
|
|
3938
|
+
const colBoundaries = React6.useMemo(() => chunkDD2YRS6Z_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
3961
3939
|
const measureRows = React6.useCallback(() => {
|
|
3962
3940
|
const container = containerRef.current;
|
|
3963
3941
|
if (!container) {
|
|
@@ -4004,11 +3982,11 @@ function TableResizeOverlay({
|
|
|
4004
3982
|
const rect = containerRef.current.getBoundingClientRect();
|
|
4005
3983
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
4006
3984
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
4007
|
-
onResizeColumns(
|
|
3985
|
+
onResizeColumns(chunkDD2YRS6Z_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
4008
3986
|
} else if (drag.type === "row" && onResizeRow) {
|
|
4009
3987
|
const deltaY = e.clientY - drag.startPos;
|
|
4010
|
-
const newHeight =
|
|
4011
|
-
drag.initialRowHeight ??
|
|
3988
|
+
const newHeight = chunkDD2YRS6Z_js.computeResizedRowHeight(
|
|
3989
|
+
drag.initialRowHeight ?? chunkDD2YRS6Z_js.DEFAULT_ROW_HEIGHT,
|
|
4012
3990
|
deltaY
|
|
4013
3991
|
);
|
|
4014
3992
|
onResizeRow(drag.index, newHeight);
|
|
@@ -4046,7 +4024,7 @@ function TableResizeOverlay({
|
|
|
4046
4024
|
e.stopPropagation();
|
|
4047
4025
|
const table = containerRef.current?.querySelector("table");
|
|
4048
4026
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
4049
|
-
const actualHeight = tr?.offsetHeight ??
|
|
4027
|
+
const actualHeight = tr?.offsetHeight ?? chunkDD2YRS6Z_js.DEFAULT_ROW_HEIGHT;
|
|
4050
4028
|
document.body.style.cursor = "row-resize";
|
|
4051
4029
|
document.body.style.userSelect = "none";
|
|
4052
4030
|
dragRef.current = {
|
|
@@ -4094,7 +4072,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4094
4072
|
}
|
|
4095
4073
|
const first = selectedCell.selectedCells[0];
|
|
4096
4074
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4097
|
-
return
|
|
4075
|
+
return chunkDD2YRS6Z_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
4098
4076
|
})();
|
|
4099
4077
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4100
4078
|
TableResizeOverlay,
|
|
@@ -4127,7 +4105,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4127
4105
|
return null;
|
|
4128
4106
|
}
|
|
4129
4107
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
4130
|
-
const isInMultiSelection =
|
|
4108
|
+
const isInMultiSelection = chunkDD2YRS6Z_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
4131
4109
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
4132
4110
|
const diag = getCellDiagonalBorders2(
|
|
4133
4111
|
cell.style,
|
|
@@ -4157,7 +4135,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4157
4135
|
}
|
|
4158
4136
|
event.stopPropagation();
|
|
4159
4137
|
if (event.shiftKey && selectedCell) {
|
|
4160
|
-
const rect =
|
|
4138
|
+
const rect = chunkDD2YRS6Z_js.computeSelectionRect(
|
|
4161
4139
|
selectedCell.rowIndex,
|
|
4162
4140
|
selectedCell.columnIndex,
|
|
4163
4141
|
rowIndex,
|
|
@@ -4167,7 +4145,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4167
4145
|
options?.onSelectCell?.({
|
|
4168
4146
|
rowIndex: selectedCell.rowIndex,
|
|
4169
4147
|
columnIndex: selectedCell.columnIndex,
|
|
4170
|
-
selectedCells:
|
|
4148
|
+
selectedCells: chunkDD2YRS6Z_js.rectToCells(rect)
|
|
4171
4149
|
});
|
|
4172
4150
|
} else {
|
|
4173
4151
|
options?.onSelectCell?.({
|
|
@@ -4244,7 +4222,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4244
4222
|
}
|
|
4245
4223
|
const first = selectedCell.selectedCells[0];
|
|
4246
4224
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4247
|
-
return
|
|
4225
|
+
return chunkDD2YRS6Z_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
4248
4226
|
})();
|
|
4249
4227
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
4250
4228
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4321,7 +4299,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4321
4299
|
"border px-1 py-0.5 align-top",
|
|
4322
4300
|
isEditable && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
4323
4301
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
4324
|
-
|
|
4302
|
+
chunkDD2YRS6Z_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
4325
4303
|
),
|
|
4326
4304
|
colSpan,
|
|
4327
4305
|
rowSpan: rSpan,
|
|
@@ -4332,7 +4310,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4332
4310
|
}
|
|
4333
4311
|
event.stopPropagation();
|
|
4334
4312
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
4335
|
-
const rect =
|
|
4313
|
+
const rect = chunkDD2YRS6Z_js.computeSelectionRect(
|
|
4336
4314
|
selectedCell.rowIndex,
|
|
4337
4315
|
selectedCell.columnIndex,
|
|
4338
4316
|
rowIndex,
|
|
@@ -4342,7 +4320,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4342
4320
|
options?.onSelectCell?.({
|
|
4343
4321
|
rowIndex: selectedCell.rowIndex,
|
|
4344
4322
|
columnIndex: selectedCell.columnIndex,
|
|
4345
|
-
selectedCells:
|
|
4323
|
+
selectedCells: chunkDD2YRS6Z_js.rectToCells(rect)
|
|
4346
4324
|
});
|
|
4347
4325
|
} else {
|
|
4348
4326
|
options?.onSelectCell?.({
|
|
@@ -4397,24 +4375,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4397
4375
|
}
|
|
4398
4376
|
var LEGEND_ITEM_WIDTH = 80;
|
|
4399
4377
|
function partAttrs(part) {
|
|
4400
|
-
return part ?
|
|
4378
|
+
return part ? chunkDD2YRS6Z_js.chartPartToAttrs(part) : void 0;
|
|
4401
4379
|
}
|
|
4402
4380
|
function resolveReactPalette(chartData) {
|
|
4403
4381
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
4404
4382
|
return chartData.colorPalette;
|
|
4405
4383
|
}
|
|
4406
|
-
return [...
|
|
4384
|
+
return [...chunkDD2YRS6Z_js.getChartStylePalette(chartData.style?.styleId)];
|
|
4407
4385
|
}
|
|
4408
4386
|
function buildReactChartViewModel(element) {
|
|
4409
4387
|
if (element.type !== "chart" || !element.chartData) {
|
|
4410
|
-
return
|
|
4388
|
+
return chunkDD2YRS6Z_js.buildChartViewModel(element);
|
|
4411
4389
|
}
|
|
4412
4390
|
const palette = resolveReactPalette(element.chartData);
|
|
4413
4391
|
const themedElement = {
|
|
4414
4392
|
...element,
|
|
4415
4393
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
4416
4394
|
};
|
|
4417
|
-
return
|
|
4395
|
+
return chunkDD2YRS6Z_js.buildChartViewModel(themedElement);
|
|
4418
4396
|
}
|
|
4419
4397
|
function renderPrimitive(prim, key) {
|
|
4420
4398
|
switch (prim.kind) {
|
|
@@ -4563,7 +4541,7 @@ function renderChartViewModel(elementId, vm, preserveAspectRatio = "none") {
|
|
|
4563
4541
|
viewBox: `0 0 ${vm.svgWidth} ${vm.svgHeight}`,
|
|
4564
4542
|
preserveAspectRatio,
|
|
4565
4543
|
children: [
|
|
4566
|
-
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: 0, width: vm.svgWidth, height: vm.svgHeight, fill:
|
|
4544
|
+
vm.areaFill && /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: 0, width: vm.svgWidth, height: vm.svgHeight, fill: vm.areaFill }),
|
|
4567
4545
|
vm.title && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4568
4546
|
"text",
|
|
4569
4547
|
{
|
|
@@ -4803,7 +4781,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4803
4781
|
const unmatchedRows = [];
|
|
4804
4782
|
categories.forEach((cat, i) => {
|
|
4805
4783
|
const value = values[i] ?? 0;
|
|
4806
|
-
const code =
|
|
4784
|
+
const code = chunkDD2YRS6Z_js.resolveRegionCode(cat);
|
|
4807
4785
|
if (code) {
|
|
4808
4786
|
regionValueMap.set(code, { value, label: cat });
|
|
4809
4787
|
} else {
|
|
@@ -4841,8 +4819,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4841
4819
|
let fill = "#e2e8f0";
|
|
4842
4820
|
let dataLabel = null;
|
|
4843
4821
|
if (entry) {
|
|
4844
|
-
const t =
|
|
4845
|
-
fill =
|
|
4822
|
+
const t = chunkDD2YRS6Z_js.normalizeValue(entry.value, minVal, maxVal);
|
|
4823
|
+
fill = chunkDD2YRS6Z_js.sequentialColorScale(t);
|
|
4846
4824
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
4847
4825
|
"text",
|
|
4848
4826
|
{
|
|
@@ -4853,7 +4831,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4853
4831
|
fontWeight: 600,
|
|
4854
4832
|
fill: "#1e293b",
|
|
4855
4833
|
style: { pointerEvents: "none" },
|
|
4856
|
-
children:
|
|
4834
|
+
children: chunkDD2YRS6Z_js.formatAxisValue(entry.value)
|
|
4857
4835
|
},
|
|
4858
4836
|
`${element.id}-map-dl-${region.code}`
|
|
4859
4837
|
);
|
|
@@ -4871,7 +4849,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4871
4849
|
opacity: 0.9,
|
|
4872
4850
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
4873
4851
|
region.name,
|
|
4874
|
-
entry ? `: ${
|
|
4852
|
+
entry ? `: ${chunkDD2YRS6Z_js.formatAxisValue(entry.value)}` : ""
|
|
4875
4853
|
] })
|
|
4876
4854
|
}
|
|
4877
4855
|
),
|
|
@@ -4909,7 +4887,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4909
4887
|
fontSize: 7,
|
|
4910
4888
|
fill: "#64748b",
|
|
4911
4889
|
textAnchor: "middle",
|
|
4912
|
-
children:
|
|
4890
|
+
children: chunkDD2YRS6Z_js.formatAxisValue(minVal)
|
|
4913
4891
|
},
|
|
4914
4892
|
`${element.id}-map-legend-min`
|
|
4915
4893
|
),
|
|
@@ -4921,7 +4899,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4921
4899
|
fontSize: 7,
|
|
4922
4900
|
fill: "#64748b",
|
|
4923
4901
|
textAnchor: "middle",
|
|
4924
|
-
children:
|
|
4902
|
+
children: chunkDD2YRS6Z_js.formatAxisValue(maxVal)
|
|
4925
4903
|
},
|
|
4926
4904
|
`${element.id}-map-legend-max`
|
|
4927
4905
|
)
|
|
@@ -4987,7 +4965,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4987
4965
|
y,
|
|
4988
4966
|
fontSize,
|
|
4989
4967
|
fill: "#475569",
|
|
4990
|
-
children:
|
|
4968
|
+
children: chunkDD2YRS6Z_js.formatAxisValue(row.value)
|
|
4991
4969
|
},
|
|
4992
4970
|
`${element.id}-map-ft-val-${i}`
|
|
4993
4971
|
)
|
|
@@ -5058,7 +5036,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
5058
5036
|
|
|
5059
5037
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
5060
5038
|
function sColor(series, idx) {
|
|
5061
|
-
return
|
|
5039
|
+
return chunkDD2YRS6Z_js.seriesColor(series, idx);
|
|
5062
5040
|
}
|
|
5063
5041
|
function valToY(val, range, topY, bottomY) {
|
|
5064
5042
|
const usable = bottomY - topY;
|
|
@@ -5597,7 +5575,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5597
5575
|
width: 10,
|
|
5598
5576
|
height: 10,
|
|
5599
5577
|
rx: 2,
|
|
5600
|
-
fill:
|
|
5578
|
+
fill: chunkDD2YRS6Z_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5601
5579
|
},
|
|
5602
5580
|
`${id}-leg-r-${i}`
|
|
5603
5581
|
)
|
|
@@ -5621,7 +5599,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5621
5599
|
width: 10,
|
|
5622
5600
|
height: 10,
|
|
5623
5601
|
rx: 2,
|
|
5624
|
-
fill:
|
|
5602
|
+
fill: chunkDD2YRS6Z_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5625
5603
|
}
|
|
5626
5604
|
),
|
|
5627
5605
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -5634,9 +5612,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5634
5612
|
}
|
|
5635
5613
|
const lines = [];
|
|
5636
5614
|
if (range.logScale && range.logBase) {
|
|
5637
|
-
const ticks =
|
|
5615
|
+
const ticks = chunkDD2YRS6Z_js.generateLogTicks(range);
|
|
5638
5616
|
ticks.forEach((tickVal, i) => {
|
|
5639
|
-
const y =
|
|
5617
|
+
const y = chunkDD2YRS6Z_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5640
5618
|
lines.push(
|
|
5641
5619
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5642
5620
|
"line",
|
|
@@ -5657,7 +5635,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5657
5635
|
const steps = 4;
|
|
5658
5636
|
for (let i = 0; i <= steps; i++) {
|
|
5659
5637
|
const val = range.min + range.span * i / steps;
|
|
5660
|
-
const y =
|
|
5638
|
+
const y = chunkDD2YRS6Z_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5661
5639
|
lines.push(
|
|
5662
5640
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5663
5641
|
"line",
|
|
@@ -5681,9 +5659,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5681
5659
|
const labels = [];
|
|
5682
5660
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5683
5661
|
if (range.logScale && range.logBase) {
|
|
5684
|
-
const ticks =
|
|
5662
|
+
const ticks = chunkDD2YRS6Z_js.generateLogTicks(range);
|
|
5685
5663
|
ticks.forEach((tickVal, i) => {
|
|
5686
|
-
const y =
|
|
5664
|
+
const y = chunkDD2YRS6Z_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5687
5665
|
labels.push(
|
|
5688
5666
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5689
5667
|
"text",
|
|
@@ -5693,7 +5671,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5693
5671
|
textAnchor: "end",
|
|
5694
5672
|
fontSize: 8,
|
|
5695
5673
|
fill: "#64748b",
|
|
5696
|
-
children: hasDisplayUnits ?
|
|
5674
|
+
children: hasDisplayUnits ? chunkDD2YRS6Z_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunkDD2YRS6Z_js.formatAxisValue(tickVal)
|
|
5697
5675
|
},
|
|
5698
5676
|
`${id}-vaxis-log-${i}`
|
|
5699
5677
|
)
|
|
@@ -5703,7 +5681,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5703
5681
|
const steps = 4;
|
|
5704
5682
|
for (let i = 0; i <= steps; i++) {
|
|
5705
5683
|
const val = range.min + range.span * i / steps;
|
|
5706
|
-
const y =
|
|
5684
|
+
const y = chunkDD2YRS6Z_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5707
5685
|
labels.push(
|
|
5708
5686
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5709
5687
|
"text",
|
|
@@ -5713,7 +5691,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5713
5691
|
textAnchor: "end",
|
|
5714
5692
|
fontSize: 8,
|
|
5715
5693
|
fill: "#64748b",
|
|
5716
|
-
children: hasDisplayUnits ?
|
|
5694
|
+
children: hasDisplayUnits ? chunkDD2YRS6Z_js.formatAxisValueWithUnits(val, axisFormatting) : chunkDD2YRS6Z_js.formatAxisValue(val)
|
|
5717
5695
|
},
|
|
5718
5696
|
`${id}-vaxis-${i}`
|
|
5719
5697
|
)
|
|
@@ -5721,7 +5699,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5721
5699
|
}
|
|
5722
5700
|
}
|
|
5723
5701
|
if (hasDisplayUnits) {
|
|
5724
|
-
const unitLabel =
|
|
5702
|
+
const unitLabel = chunkDD2YRS6Z_js.getDisplayUnitLabel(
|
|
5725
5703
|
axisFormatting.displayUnits,
|
|
5726
5704
|
axisFormatting.displayUnitsLabel
|
|
5727
5705
|
);
|
|
@@ -5796,7 +5774,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
5796
5774
|
if (range.min >= 0) {
|
|
5797
5775
|
return null;
|
|
5798
5776
|
}
|
|
5799
|
-
const y =
|
|
5777
|
+
const y = chunkDD2YRS6Z_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
5800
5778
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5801
5779
|
"line",
|
|
5802
5780
|
{
|
|
@@ -5820,7 +5798,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5820
5798
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5821
5799
|
for (let i = 0; i <= steps; i++) {
|
|
5822
5800
|
const val = range.min + range.span * i / steps;
|
|
5823
|
-
const y =
|
|
5801
|
+
const y = chunkDD2YRS6Z_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5824
5802
|
labels.push(
|
|
5825
5803
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5826
5804
|
"text",
|
|
@@ -5832,7 +5810,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5832
5810
|
fontFamily,
|
|
5833
5811
|
fontWeight,
|
|
5834
5812
|
fill: fontColor,
|
|
5835
|
-
children: hasDisplayUnits ?
|
|
5813
|
+
children: hasDisplayUnits ? chunkDD2YRS6Z_js.formatAxisValueWithUnits(val, axisFormatting) : chunkDD2YRS6Z_js.formatAxisValue(val)
|
|
5836
5814
|
},
|
|
5837
5815
|
`${id}-sec-vaxis-${i}`
|
|
5838
5816
|
)
|
|
@@ -5856,7 +5834,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5856
5834
|
);
|
|
5857
5835
|
}
|
|
5858
5836
|
if (hasDisplayUnits) {
|
|
5859
|
-
const unitLabel =
|
|
5837
|
+
const unitLabel = chunkDD2YRS6Z_js.getDisplayUnitLabel(
|
|
5860
5838
|
axisFormatting.displayUnits,
|
|
5861
5839
|
axisFormatting.displayUnitsLabel
|
|
5862
5840
|
);
|
|
@@ -5887,7 +5865,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
5887
5865
|
const ticks = [];
|
|
5888
5866
|
for (let i = 0; i <= steps; i++) {
|
|
5889
5867
|
const val = range.min + range.span * i / steps;
|
|
5890
|
-
const y =
|
|
5868
|
+
const y = chunkDD2YRS6Z_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5891
5869
|
ticks.push(
|
|
5892
5870
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5893
5871
|
"line",
|
|
@@ -5914,7 +5892,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
5914
5892
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
5915
5893
|
for (let i = 0; i <= steps; i++) {
|
|
5916
5894
|
const val = range.min + range.span * i / steps;
|
|
5917
|
-
const y =
|
|
5895
|
+
const y = chunkDD2YRS6Z_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5918
5896
|
lines.push(
|
|
5919
5897
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5920
5898
|
"line",
|
|
@@ -6076,7 +6054,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6076
6054
|
width: 8,
|
|
6077
6055
|
height: 8,
|
|
6078
6056
|
borderRadius: 2,
|
|
6079
|
-
backgroundColor:
|
|
6057
|
+
backgroundColor: chunkDD2YRS6Z_js.seriesColor(
|
|
6080
6058
|
s,
|
|
6081
6059
|
si,
|
|
6082
6060
|
chartData.style?.styleId,
|
|
@@ -6114,9 +6092,10 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6114
6092
|
}
|
|
6115
6093
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
6116
6094
|
const style = chartData.style;
|
|
6095
|
+
const areaFill = chunkDD2YRS6Z_js.chartAreaFill(chartData);
|
|
6117
6096
|
const legendPos = style?.legendPosition || "b";
|
|
6118
|
-
const range =
|
|
6119
|
-
const layout =
|
|
6097
|
+
const range = chunkDD2YRS6Z_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6098
|
+
const layout = chunkDD2YRS6Z_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6120
6099
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6121
6100
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
6122
6101
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -6137,10 +6116,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6137
6116
|
const close = closeSeries.values[ci] ?? high;
|
|
6138
6117
|
const isUp = close >= open;
|
|
6139
6118
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
6140
|
-
const highY =
|
|
6141
|
-
const lowY =
|
|
6142
|
-
const openY =
|
|
6143
|
-
const closeY =
|
|
6119
|
+
const highY = chunkDD2YRS6Z_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
6120
|
+
const lowY = chunkDD2YRS6Z_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
6121
|
+
const openY = chunkDD2YRS6Z_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
6122
|
+
const closeY = chunkDD2YRS6Z_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
|
|
6144
6123
|
elements.push(
|
|
6145
6124
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6146
6125
|
"line",
|
|
@@ -6183,7 +6162,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6183
6162
|
textAnchor: "middle",
|
|
6184
6163
|
fontSize: 7,
|
|
6185
6164
|
fill: "#334155",
|
|
6186
|
-
children:
|
|
6165
|
+
children: chunkDD2YRS6Z_js.formatAxisValue(close)
|
|
6187
6166
|
},
|
|
6188
6167
|
`${element.id}-stock-dl-${ci}`
|
|
6189
6168
|
)
|
|
@@ -6198,7 +6177,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6198
6177
|
viewBox: `0 0 ${layout.svgWidth} ${layout.svgHeight}`,
|
|
6199
6178
|
preserveAspectRatio: "none",
|
|
6200
6179
|
children: [
|
|
6201
|
-
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: 0, width: layout.svgWidth, height: layout.svgHeight, fill:
|
|
6180
|
+
areaFill && /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: 0, width: layout.svgWidth, height: layout.svgHeight, fill: areaFill }),
|
|
6202
6181
|
renderChrome(element.id, chartData, layout, range, categoryLabels, {
|
|
6203
6182
|
categoryAxisStyle: "bar"
|
|
6204
6183
|
}),
|
|
@@ -6225,7 +6204,7 @@ function FailedToLoad() {
|
|
|
6225
6204
|
var LazySurfaceChart3DScene = React6__default.default.lazy(
|
|
6226
6205
|
async () => {
|
|
6227
6206
|
try {
|
|
6228
|
-
return await import('./SurfaceChart3DScene-
|
|
6207
|
+
return await import('./SurfaceChart3DScene-JDCFTXYT.js');
|
|
6229
6208
|
} catch {
|
|
6230
6209
|
return { default: FailedToLoad };
|
|
6231
6210
|
}
|
|
@@ -6249,7 +6228,7 @@ var SurfaceChart3DErrorBoundary = class extends React6__default.default.Componen
|
|
|
6249
6228
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
6250
6229
|
const rows = chartData.series.length;
|
|
6251
6230
|
const cols = Math.max(categoryLabels.length, 1);
|
|
6252
|
-
const range =
|
|
6231
|
+
const range = chunkDD2YRS6Z_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6253
6232
|
const heightMap = new Float32Array(rows * cols);
|
|
6254
6233
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
6255
6234
|
for (let r = 0; r < rows; r++) {
|
|
@@ -6368,9 +6347,10 @@ function darkenRgb(r, g, b, factor) {
|
|
|
6368
6347
|
}
|
|
6369
6348
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
6370
6349
|
const style = chartData.style;
|
|
6350
|
+
const areaFill = chunkDD2YRS6Z_js.chartAreaFill(chartData);
|
|
6371
6351
|
const legendPos = style?.legendPosition || "b";
|
|
6372
|
-
const layout =
|
|
6373
|
-
const range =
|
|
6352
|
+
const layout = chunkDD2YRS6Z_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6353
|
+
const range = chunkDD2YRS6Z_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6374
6354
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6375
6355
|
const seriesCount = chartData.series.length;
|
|
6376
6356
|
const cols = catCount - 1;
|
|
@@ -6449,7 +6429,7 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6449
6429
|
viewBox: `0 0 ${layout.svgWidth} ${layout.svgHeight}`,
|
|
6450
6430
|
preserveAspectRatio: "xMidYMid meet",
|
|
6451
6431
|
children: [
|
|
6452
|
-
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: 0, width: layout.svgWidth, height: layout.svgHeight, fill:
|
|
6432
|
+
areaFill && /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: 0, width: layout.svgWidth, height: layout.svgHeight, fill: areaFill }),
|
|
6453
6433
|
renderTitle(element.id, style, chartData.title, layout.svgWidth),
|
|
6454
6434
|
renderLegend(element.id, style, chartData.series, layout),
|
|
6455
6435
|
polygons
|
|
@@ -6459,9 +6439,10 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6459
6439
|
}
|
|
6460
6440
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
6461
6441
|
const style = chartData.style;
|
|
6442
|
+
const areaFill = chunkDD2YRS6Z_js.chartAreaFill(chartData);
|
|
6462
6443
|
const legendPos = style?.legendPosition || "b";
|
|
6463
|
-
const layout =
|
|
6464
|
-
const range =
|
|
6444
|
+
const layout = chunkDD2YRS6Z_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6445
|
+
const range = chunkDD2YRS6Z_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6465
6446
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6466
6447
|
const seriesCount = chartData.series.length;
|
|
6467
6448
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -6495,7 +6476,7 @@ function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6495
6476
|
viewBox: `0 0 ${layout.svgWidth} ${layout.svgHeight}`,
|
|
6496
6477
|
preserveAspectRatio: "none",
|
|
6497
6478
|
children: [
|
|
6498
|
-
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: 0, width: layout.svgWidth, height: layout.svgHeight, fill:
|
|
6479
|
+
areaFill && /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: 0, width: layout.svgWidth, height: layout.svgHeight, fill: areaFill }),
|
|
6499
6480
|
renderChrome(element.id, chartData, layout, range, categoryLabels, {
|
|
6500
6481
|
categoryAxisStyle: "bar"
|
|
6501
6482
|
}),
|
|
@@ -6523,8 +6504,9 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6523
6504
|
}
|
|
6524
6505
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
6525
6506
|
const style = chartData.style;
|
|
6507
|
+
const areaFill = chunkDD2YRS6Z_js.chartAreaFill(chartData);
|
|
6526
6508
|
const legendPos = style?.legendPosition || "b";
|
|
6527
|
-
const layout =
|
|
6509
|
+
const layout = chunkDD2YRS6Z_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6528
6510
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
6529
6511
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
6530
6512
|
const rects = [];
|
|
@@ -6547,7 +6529,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
6547
6529
|
y: curY,
|
|
6548
6530
|
width: Math.max(w - 1, 1),
|
|
6549
6531
|
height: Math.max(h - 1, 1),
|
|
6550
|
-
fill:
|
|
6532
|
+
fill: chunkDD2YRS6Z_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
6551
6533
|
rx: 2,
|
|
6552
6534
|
opacity: 0.85
|
|
6553
6535
|
},
|
|
@@ -6588,7 +6570,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
6588
6570
|
viewBox: `0 0 ${layout.svgWidth} ${layout.svgHeight}`,
|
|
6589
6571
|
preserveAspectRatio: "none",
|
|
6590
6572
|
children: [
|
|
6591
|
-
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: 0, width: layout.svgWidth, height: layout.svgHeight, fill:
|
|
6573
|
+
areaFill && /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: 0, width: layout.svgWidth, height: layout.svgHeight, fill: areaFill }),
|
|
6592
6574
|
renderTitle(element.id, style, chartData.title, layout.svgWidth),
|
|
6593
6575
|
renderLegend(element.id, style, chartData.series, layout),
|
|
6594
6576
|
rects
|
|
@@ -6598,10 +6580,11 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
6598
6580
|
}
|
|
6599
6581
|
function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
6600
6582
|
const style = chartData.style;
|
|
6583
|
+
const areaFill = chunkDD2YRS6Z_js.chartAreaFill(chartData);
|
|
6601
6584
|
const legendPos = style?.legendPosition || "b";
|
|
6602
6585
|
const values = chartData.series[0]?.values ?? [];
|
|
6603
|
-
const range =
|
|
6604
|
-
const layout =
|
|
6586
|
+
const range = chunkDD2YRS6Z_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6587
|
+
const layout = chunkDD2YRS6Z_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6605
6588
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
6606
6589
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
6607
6590
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -6612,8 +6595,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6612
6595
|
const isLast = i === values.length - 1;
|
|
6613
6596
|
const startVal = isLast ? 0 : runningTotal;
|
|
6614
6597
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
6615
|
-
const barStartY =
|
|
6616
|
-
const barEndY =
|
|
6598
|
+
const barStartY = chunkDD2YRS6Z_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
6599
|
+
const barEndY = chunkDD2YRS6Z_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
|
|
6617
6600
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
6618
6601
|
const y = Math.min(barStartY, barEndY);
|
|
6619
6602
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -6642,7 +6625,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6642
6625
|
textAnchor: "middle",
|
|
6643
6626
|
fontSize: 7,
|
|
6644
6627
|
fill: "#334155",
|
|
6645
|
-
children:
|
|
6628
|
+
children: chunkDD2YRS6Z_js.formatAxisValue(isLast ? endVal : val)
|
|
6646
6629
|
},
|
|
6647
6630
|
`${element.id}-wf-dl-${i}`
|
|
6648
6631
|
)
|
|
@@ -6677,7 +6660,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6677
6660
|
viewBox: `0 0 ${layout.svgWidth} ${layout.svgHeight}`,
|
|
6678
6661
|
preserveAspectRatio: "none",
|
|
6679
6662
|
children: [
|
|
6680
|
-
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: 0, width: layout.svgWidth, height: layout.svgHeight, fill:
|
|
6663
|
+
areaFill && /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: 0, width: layout.svgWidth, height: layout.svgHeight, fill: areaFill }),
|
|
6681
6664
|
renderChrome(element.id, chartData, layout, range, categoryLabels, {
|
|
6682
6665
|
categoryAxisStyle: "bar"
|
|
6683
6666
|
}),
|
|
@@ -6689,19 +6672,20 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6689
6672
|
}
|
|
6690
6673
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
6691
6674
|
const style = chartData.style;
|
|
6675
|
+
const areaFill = chunkDD2YRS6Z_js.chartAreaFill(chartData);
|
|
6692
6676
|
const legendPos = style?.legendPosition || "b";
|
|
6693
|
-
const layoutOpts =
|
|
6677
|
+
const layoutOpts = chunkDD2YRS6Z_js.computeLayoutOptions(
|
|
6694
6678
|
chartData.axes,
|
|
6695
6679
|
chartData.dataTable,
|
|
6696
6680
|
chartData.series.length
|
|
6697
6681
|
);
|
|
6698
|
-
const layout =
|
|
6699
|
-
const { primary, secondary } =
|
|
6682
|
+
const layout = chunkDD2YRS6Z_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
6683
|
+
const { primary, secondary } = chunkDD2YRS6Z_js.splitSeriesByAxis(chartData.series, chartData.axes);
|
|
6700
6684
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
6701
6685
|
const secondarySeries = secondary.map((e) => e.series);
|
|
6702
|
-
const range =
|
|
6703
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
6704
|
-
const secondaryAxisFmt =
|
|
6686
|
+
const range = chunkDD2YRS6Z_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
6687
|
+
const secondaryRange = secondarySeries.length > 0 ? chunkDD2YRS6Z_js.computeValueRange(secondarySeries) : void 0;
|
|
6688
|
+
const secondaryAxisFmt = chunkDD2YRS6Z_js.getSecondaryValueAxis(chartData.axes);
|
|
6705
6689
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6706
6690
|
const barSeriesCount = 1;
|
|
6707
6691
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -6717,8 +6701,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6717
6701
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
6718
6702
|
barSeries.values.forEach((val, vi) => {
|
|
6719
6703
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
6720
|
-
const zeroY =
|
|
6721
|
-
const valY =
|
|
6704
|
+
const zeroY = chunkDD2YRS6Z_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
6705
|
+
const valY = chunkDD2YRS6Z_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
|
|
6722
6706
|
const y = Math.min(zeroY, valY);
|
|
6723
6707
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
6724
6708
|
barElements.push(
|
|
@@ -6729,7 +6713,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6729
6713
|
y,
|
|
6730
6714
|
width: barWidth,
|
|
6731
6715
|
height: h,
|
|
6732
|
-
fill:
|
|
6716
|
+
fill: chunkDD2YRS6Z_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
6733
6717
|
rx: 1
|
|
6734
6718
|
},
|
|
6735
6719
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -6745,7 +6729,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6745
6729
|
textAnchor: "middle",
|
|
6746
6730
|
fontSize: 7,
|
|
6747
6731
|
fill: "#334155",
|
|
6748
|
-
children:
|
|
6732
|
+
children: chunkDD2YRS6Z_js.formatAxisValue(val)
|
|
6749
6733
|
},
|
|
6750
6734
|
`${element.id}-combo-bar-dl-${vi}`
|
|
6751
6735
|
)
|
|
@@ -6762,10 +6746,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6762
6746
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
6763
6747
|
const points = series.values.map((val, vi) => {
|
|
6764
6748
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
6765
|
-
const y =
|
|
6749
|
+
const y = chunkDD2YRS6Z_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
6766
6750
|
return { x, y, val };
|
|
6767
6751
|
});
|
|
6768
|
-
const c =
|
|
6752
|
+
const c = chunkDD2YRS6Z_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
6769
6753
|
lineElements.push(
|
|
6770
6754
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6771
6755
|
"polyline",
|
|
@@ -6792,7 +6776,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6792
6776
|
textAnchor: "middle",
|
|
6793
6777
|
fontSize: 7,
|
|
6794
6778
|
fill: "#334155",
|
|
6795
|
-
children:
|
|
6779
|
+
children: chunkDD2YRS6Z_js.formatAxisValue(p.val)
|
|
6796
6780
|
},
|
|
6797
6781
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
6798
6782
|
)
|
|
@@ -6808,7 +6792,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6808
6792
|
viewBox: `0 0 ${layout.svgWidth} ${layout.svgHeight}`,
|
|
6809
6793
|
preserveAspectRatio: "none",
|
|
6810
6794
|
children: [
|
|
6811
|
-
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: 0, width: layout.svgWidth, height: layout.svgHeight, fill:
|
|
6795
|
+
areaFill && /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: 0, width: layout.svgWidth, height: layout.svgHeight, fill: areaFill }),
|
|
6812
6796
|
renderChrome(
|
|
6813
6797
|
element.id,
|
|
6814
6798
|
chartData,
|
|
@@ -7938,14 +7922,14 @@ function buildNotesPdf(pages) {
|
|
|
7938
7922
|
notes: page.notes,
|
|
7939
7923
|
slideNumber: page.slideNumber
|
|
7940
7924
|
}));
|
|
7941
|
-
const bytes =
|
|
7925
|
+
const bytes = chunkDD2YRS6Z_js.buildNotesPdfBytes(images, meta);
|
|
7942
7926
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
7943
7927
|
return URL.createObjectURL(blob);
|
|
7944
7928
|
}
|
|
7945
7929
|
|
|
7946
7930
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
7947
7931
|
function buildPdfFromImageData(images) {
|
|
7948
|
-
const bytes =
|
|
7932
|
+
const bytes = chunkDD2YRS6Z_js.buildSlidesPdfBytes(images);
|
|
7949
7933
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
7950
7934
|
return URL.createObjectURL(blob);
|
|
7951
7935
|
}
|
|
@@ -7954,7 +7938,7 @@ function buildPdfFromImageData(images) {
|
|
|
7954
7938
|
var activePreview = null;
|
|
7955
7939
|
function startPreviewAnimation(elementId, preset, options) {
|
|
7956
7940
|
stopPreviewAnimation();
|
|
7957
|
-
const descriptor =
|
|
7941
|
+
const descriptor = chunkDD2YRS6Z_js.buildPreviewAnimation(preset, options);
|
|
7958
7942
|
if (!descriptor) {
|
|
7959
7943
|
return;
|
|
7960
7944
|
}
|
|
@@ -7967,7 +7951,7 @@ function startMotionPathPreview(elementId, path, options) {
|
|
|
7967
7951
|
return;
|
|
7968
7952
|
}
|
|
7969
7953
|
const stage = domEl.offsetParent;
|
|
7970
|
-
const descriptor =
|
|
7954
|
+
const descriptor = chunkDD2YRS6Z_js.buildMotionPathPreview({
|
|
7971
7955
|
path,
|
|
7972
7956
|
slideWidth: stage?.offsetWidth || DEFAULT_PREVIEW_SLIDE_WIDTH,
|
|
7973
7957
|
slideHeight: stage?.offsetHeight || DEFAULT_PREVIEW_SLIDE_HEIGHT,
|
|
@@ -8107,7 +8091,6 @@ exports.shouldRenderFallbackLabel = shouldRenderFallbackLabel;
|
|
|
8107
8091
|
exports.smartArtNodeGroupProps = smartArtNodeGroupProps;
|
|
8108
8092
|
exports.startMotionPathPreview = startMotionPathPreview;
|
|
8109
8093
|
exports.startPreviewAnimation = startPreviewAnimation;
|
|
8110
|
-
exports.stopAllPersistentAudio = stopAllPersistentAudio;
|
|
8111
8094
|
exports.stopPreviewAnimation = stopPreviewAnimation;
|
|
8112
8095
|
exports.styleShadow = styleShadow;
|
|
8113
8096
|
exports.styleStroke = styleStroke;
|