pptx-react-viewer 2.11.1 → 2.12.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-RMQIJDUJ.mjs → AiChatPanel-CGGUPVQX.mjs} +4 -4
- package/dist/AiChatPanel-CGGUPVQX.mjs.br +0 -0
- package/dist/AiChatPanel-CGGUPVQX.mjs.gz +0 -0
- package/dist/{AiChatPanel-E6W3EACA.js → AiChatPanel-UEFYTUJN.js} +23 -23
- package/dist/AiChatPanel-UEFYTUJN.js.br +0 -0
- package/dist/AiChatPanel-UEFYTUJN.js.gz +0 -0
- package/dist/{Model3DScene-U4B4NZJT.js → Model3DScene-QYXJNALP.js} +2 -2
- package/dist/{Model3DScene-U4B4NZJT.js.br → Model3DScene-QYXJNALP.js.br} +0 -0
- package/dist/Model3DScene-QYXJNALP.js.gz +0 -0
- package/dist/{Model3DScene-WHSHBMR5.mjs → Model3DScene-TU4NTHRM.mjs} +1 -1
- package/dist/Model3DScene-TU4NTHRM.mjs.br +0 -0
- package/dist/Model3DScene-TU4NTHRM.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-5S43UBRD.js → SurfaceChart3DScene-4VCO3DRP.js} +2 -2
- package/dist/SurfaceChart3DScene-4VCO3DRP.js.br +0 -0
- package/dist/SurfaceChart3DScene-4VCO3DRP.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-77JP5XH5.mjs → SurfaceChart3DScene-VTJBKUQY.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-77JP5XH5.mjs.br → SurfaceChart3DScene-VTJBKUQY.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-VTJBKUQY.mjs.gz +0 -0
- package/dist/{chunk-NJ4PTG4F.mjs → chunk-4GYNTY2G.mjs} +28 -48
- package/dist/chunk-4GYNTY2G.mjs.br +0 -0
- package/dist/chunk-4GYNTY2G.mjs.gz +0 -0
- package/dist/{chunk-PXYZFWDA.mjs → chunk-4SGXEGVL.mjs} +339 -256
- package/dist/chunk-4SGXEGVL.mjs.br +0 -0
- package/dist/chunk-4SGXEGVL.mjs.gz +0 -0
- package/dist/{chunk-IOVOQ6ZJ.js → chunk-BXAK3JFM.js} +301 -1
- package/dist/chunk-BXAK3JFM.js.br +0 -0
- package/dist/chunk-BXAK3JFM.js.gz +0 -0
- package/dist/{chunk-FV7HEYCX.mjs → chunk-CABQXGPI.mjs} +621 -70
- package/dist/chunk-CABQXGPI.mjs.br +0 -0
- package/dist/chunk-CABQXGPI.mjs.gz +0 -0
- package/dist/{chunk-IXBM3HWH.js → chunk-GBKIWNW6.js} +2047 -1964
- package/dist/chunk-GBKIWNW6.js.br +0 -0
- package/dist/chunk-GBKIWNW6.js.gz +0 -0
- package/dist/{chunk-FAP6OPLL.js → chunk-LE6YA5WB.js} +262 -296
- package/dist/chunk-LE6YA5WB.js.br +0 -0
- package/dist/chunk-LE6YA5WB.js.gz +0 -0
- package/dist/{chunk-HF6L2CTF.mjs → chunk-N3NKU7SC.mjs} +1 -1
- package/dist/chunk-N3NKU7SC.mjs.br +0 -0
- package/dist/{chunk-HF6L2CTF.mjs.gz → chunk-N3NKU7SC.mjs.gz} +0 -0
- package/dist/{chunk-QT6BPOZM.js → chunk-NUDH7TI2.js} +355 -375
- package/dist/chunk-NUDH7TI2.js.br +0 -0
- package/dist/chunk-NUDH7TI2.js.gz +0 -0
- package/dist/{chunk-KDJBWJJH.js → chunk-TDUDH7S4.js} +648 -71
- package/dist/chunk-TDUDH7S4.js.br +0 -0
- package/dist/chunk-TDUDH7S4.js.gz +0 -0
- package/dist/{chunk-RHR7GTDX.mjs → chunk-TEXIGSA6.mjs} +301 -1
- package/dist/chunk-TEXIGSA6.mjs.br +0 -0
- package/dist/chunk-TEXIGSA6.mjs.gz +0 -0
- package/dist/{chunk-X3SFCKAF.js → chunk-UIWY4XJT.js} +3 -3
- package/dist/chunk-UIWY4XJT.js.br +0 -0
- package/dist/chunk-UIWY4XJT.js.gz +0 -0
- package/dist/{chunk-DD54KUDG.mjs → chunk-YIPR3GKG.mjs} +24 -58
- package/dist/chunk-YIPR3GKG.mjs.br +0 -0
- package/dist/chunk-YIPR3GKG.mjs.gz +0 -0
- package/dist/i18n.js +4 -4
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.js +36 -36
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +79 -79
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +4 -4
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/viewer/index.js +22 -22
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +6 -6
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-E6W3EACA.js.br +0 -0
- package/dist/AiChatPanel-E6W3EACA.js.gz +0 -0
- package/dist/AiChatPanel-RMQIJDUJ.mjs.br +0 -0
- package/dist/AiChatPanel-RMQIJDUJ.mjs.gz +0 -0
- package/dist/Model3DScene-U4B4NZJT.js.gz +0 -0
- package/dist/Model3DScene-WHSHBMR5.mjs.br +0 -0
- package/dist/Model3DScene-WHSHBMR5.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-5S43UBRD.js.br +0 -0
- package/dist/SurfaceChart3DScene-5S43UBRD.js.gz +0 -0
- package/dist/SurfaceChart3DScene-77JP5XH5.mjs.gz +0 -0
- package/dist/chunk-DD54KUDG.mjs.br +0 -0
- package/dist/chunk-DD54KUDG.mjs.gz +0 -0
- package/dist/chunk-FAP6OPLL.js.br +0 -0
- package/dist/chunk-FAP6OPLL.js.gz +0 -0
- package/dist/chunk-FV7HEYCX.mjs.br +0 -0
- package/dist/chunk-FV7HEYCX.mjs.gz +0 -0
- package/dist/chunk-HF6L2CTF.mjs.br +0 -0
- package/dist/chunk-IOVOQ6ZJ.js.br +0 -0
- package/dist/chunk-IOVOQ6ZJ.js.gz +0 -0
- package/dist/chunk-IXBM3HWH.js.br +0 -0
- package/dist/chunk-IXBM3HWH.js.gz +0 -0
- package/dist/chunk-KDJBWJJH.js.br +0 -0
- package/dist/chunk-KDJBWJJH.js.gz +0 -0
- package/dist/chunk-NJ4PTG4F.mjs.br +0 -0
- package/dist/chunk-NJ4PTG4F.mjs.gz +0 -0
- package/dist/chunk-PXYZFWDA.mjs.br +0 -0
- package/dist/chunk-PXYZFWDA.mjs.gz +0 -0
- package/dist/chunk-QT6BPOZM.js.br +0 -0
- package/dist/chunk-QT6BPOZM.js.gz +0 -0
- package/dist/chunk-RHR7GTDX.mjs.br +0 -0
- package/dist/chunk-RHR7GTDX.mjs.gz +0 -0
- package/dist/chunk-X3SFCKAF.js.br +0 -0
- package/dist/chunk-X3SFCKAF.js.gz +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkBXAK3JFM_js = require('./chunk-BXAK3JFM.js');
|
|
4
|
+
var chunkTDUDH7S4_js = require('./chunk-TDUDH7S4.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 chunkTDUDH7S4_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 chunkTDUDH7S4_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 = chunkTDUDH7S4_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 = chunkTDUDH7S4_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 (!chunkTDUDH7S4_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) => chunkTDUDH7S4_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) => !chunkTDUDH7S4_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 (!chunkTDUDH7S4_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 = chunkTDUDH7S4_js.getRoundRectRadiusPx(element);
|
|
311
311
|
if (radiusPx <= 0.01) {
|
|
312
312
|
return void 0;
|
|
313
313
|
}
|
|
@@ -319,57 +319,16 @@ function getImageMaskStyle(element) {
|
|
|
319
319
|
if (normalized === "can" || normalized === "cylinder") {
|
|
320
320
|
return { borderRadius: "48% / 12%" };
|
|
321
321
|
}
|
|
322
|
-
const clipPath =
|
|
322
|
+
const clipPath = chunkTDUDH7S4_js.getResolvedShapeClipPath(element);
|
|
323
323
|
if (!clipPath) {
|
|
324
324
|
return void 0;
|
|
325
325
|
}
|
|
326
326
|
return { clipPath };
|
|
327
327
|
}
|
|
328
328
|
function getImageRenderStyle(element) {
|
|
329
|
-
const maskStyle = getImageMaskStyle(element) || {};
|
|
330
|
-
if (!chunkKDJBWJJH_js.isImageLikeElement(element)) {
|
|
331
|
-
return {
|
|
332
|
-
...maskStyle,
|
|
333
|
-
width: "100%",
|
|
334
|
-
height: "100%",
|
|
335
|
-
objectFit: "cover"
|
|
336
|
-
};
|
|
337
|
-
}
|
|
338
|
-
const cropLeft = chunkKDJBWJJH_js.clampCropValue(element.cropLeft);
|
|
339
|
-
const cropTop = chunkKDJBWJJH_js.clampCropValue(element.cropTop);
|
|
340
|
-
const cropRight = chunkKDJBWJJH_js.clampCropValue(element.cropRight);
|
|
341
|
-
const cropBottom = chunkKDJBWJJH_js.clampCropValue(element.cropBottom);
|
|
342
|
-
const hasCrop = cropLeft + cropRight > 1e-4 || cropTop + cropBottom > 1e-4;
|
|
343
|
-
if (!hasCrop) {
|
|
344
|
-
return {
|
|
345
|
-
...maskStyle,
|
|
346
|
-
width: "100%",
|
|
347
|
-
height: "100%",
|
|
348
|
-
objectFit: "cover"
|
|
349
|
-
};
|
|
350
|
-
}
|
|
351
|
-
const safeHorizontalScale = cropLeft + cropRight >= 0.99 ? 0.99 / (cropLeft + cropRight) : 1;
|
|
352
|
-
const safeVerticalScale = cropTop + cropBottom >= 0.99 ? 0.99 / (cropTop + cropBottom) : 1;
|
|
353
|
-
const normalizedLeft = chunkKDJBWJJH_js.clampCropValue(cropLeft * safeHorizontalScale);
|
|
354
|
-
const normalizedRight = chunkKDJBWJJH_js.clampCropValue(cropRight * safeHorizontalScale);
|
|
355
|
-
const normalizedTop = chunkKDJBWJJH_js.clampCropValue(cropTop * safeVerticalScale);
|
|
356
|
-
const normalizedBottom = chunkKDJBWJJH_js.clampCropValue(cropBottom * safeVerticalScale);
|
|
357
|
-
const remainingWidth = Math.max(0.01, 1 - normalizedLeft - normalizedRight);
|
|
358
|
-
const remainingHeight = Math.max(0.01, 1 - normalizedTop - normalizedBottom);
|
|
359
|
-
const tx = Math.round(-normalizedLeft / remainingWidth * 1e4) / 100;
|
|
360
|
-
const ty = Math.round(-normalizedTop / remainingHeight * 1e4) / 100;
|
|
361
|
-
const sx = Math.round(1 / remainingWidth * 1e6) / 1e6;
|
|
362
|
-
const sy = Math.round(1 / remainingHeight * 1e6) / 1e6;
|
|
363
329
|
return {
|
|
364
|
-
...
|
|
365
|
-
|
|
366
|
-
width: "100%",
|
|
367
|
-
height: "100%",
|
|
368
|
-
maxWidth: "none",
|
|
369
|
-
maxHeight: "none",
|
|
370
|
-
objectFit: "fill",
|
|
371
|
-
transformOrigin: "top left",
|
|
372
|
-
transform: `translate(${tx}%, ${ty}%) scale(${sx}, ${sy})`
|
|
330
|
+
...getImageMaskStyle(element) || {},
|
|
331
|
+
...chunkTDUDH7S4_js.getImageFitStyle(element)
|
|
373
332
|
};
|
|
374
333
|
}
|
|
375
334
|
var CROP_SHAPE_CLIP_PATHS = {
|
|
@@ -382,7 +341,7 @@ var CROP_SHAPE_CLIP_PATHS = {
|
|
|
382
341
|
star: "polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)"
|
|
383
342
|
};
|
|
384
343
|
function getCropShapeClipPath(element) {
|
|
385
|
-
if (!
|
|
344
|
+
if (!chunkTDUDH7S4_js.isImageLikeElement(element)) {
|
|
386
345
|
return void 0;
|
|
387
346
|
}
|
|
388
347
|
const shape = element.cropShape;
|
|
@@ -392,7 +351,7 @@ function getCropShapeClipPath(element) {
|
|
|
392
351
|
return CROP_SHAPE_CLIP_PATHS[shape];
|
|
393
352
|
}
|
|
394
353
|
function isImageTiled(element) {
|
|
395
|
-
if (!
|
|
354
|
+
if (!chunkTDUDH7S4_js.isImageLikeElement(element)) {
|
|
396
355
|
return false;
|
|
397
356
|
}
|
|
398
357
|
return typeof element.tileScaleX === "number" || typeof element.tileScaleY === "number";
|
|
@@ -450,7 +409,7 @@ function buildMirrorTiledBackground(src, flip, scaleX, scaleY) {
|
|
|
450
409
|
};
|
|
451
410
|
}
|
|
452
411
|
function getImageTilingStyle(element) {
|
|
453
|
-
if (!
|
|
412
|
+
if (!chunkTDUDH7S4_js.isImageLikeElement(element) || !isImageTiled(element)) {
|
|
454
413
|
return void 0;
|
|
455
414
|
}
|
|
456
415
|
const scaleX = typeof element.tileScaleX === "number" ? element.tileScaleX * 100 : 100;
|
|
@@ -663,7 +622,8 @@ function VideoWithMetadata({
|
|
|
663
622
|
shouldLoop,
|
|
664
623
|
shouldAutoPlay,
|
|
665
624
|
isFullScreen,
|
|
666
|
-
isPresentationMode
|
|
625
|
+
isPresentationMode,
|
|
626
|
+
showTransport
|
|
667
627
|
}) {
|
|
668
628
|
useMediaMetadataExtraction(mediaRef, element);
|
|
669
629
|
const captionTracks = element.captionTracks ?? [];
|
|
@@ -672,7 +632,7 @@ function VideoWithMetadata({
|
|
|
672
632
|
{
|
|
673
633
|
ref: mediaRef,
|
|
674
634
|
className: `w-full h-full pointer-events-auto ${isFullScreen ? "object-cover" : "object-contain"}`,
|
|
675
|
-
controls:
|
|
635
|
+
controls: showTransport,
|
|
676
636
|
preload: "metadata",
|
|
677
637
|
playsInline: true,
|
|
678
638
|
autoPlay: shouldAutoPlay,
|
|
@@ -697,7 +657,7 @@ function AudioWithMetadata({
|
|
|
697
657
|
mediaMimeType,
|
|
698
658
|
shouldLoop,
|
|
699
659
|
shouldAutoPlay,
|
|
700
|
-
|
|
660
|
+
showTransport
|
|
701
661
|
}) {
|
|
702
662
|
useMediaMetadataExtraction(mediaRef, element);
|
|
703
663
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center p-2 pointer-events-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -705,7 +665,7 @@ function AudioWithMetadata({
|
|
|
705
665
|
{
|
|
706
666
|
ref: mediaRef,
|
|
707
667
|
className: "w-full",
|
|
708
|
-
controls:
|
|
668
|
+
controls: showTransport,
|
|
709
669
|
preload: "metadata",
|
|
710
670
|
autoPlay: shouldAutoPlay,
|
|
711
671
|
loop: shouldLoop,
|
|
@@ -730,9 +690,9 @@ function registerMediaElement(elementId, el) {
|
|
|
730
690
|
};
|
|
731
691
|
}
|
|
732
692
|
function executeMediaCommand(command, frameRoot) {
|
|
733
|
-
return
|
|
693
|
+
return chunkTDUDH7S4_js.runMediaCommand(
|
|
734
694
|
command,
|
|
735
|
-
(targetId) => registry.get(targetId) ??
|
|
695
|
+
(targetId) => registry.get(targetId) ?? chunkTDUDH7S4_js.findMediaElementByElementId(targetId, frameRoot?.())
|
|
736
696
|
);
|
|
737
697
|
}
|
|
738
698
|
function PresentationMediaController({
|
|
@@ -771,19 +731,23 @@ function PresentationMediaController({
|
|
|
771
731
|
}
|
|
772
732
|
return registerMediaElement(element.id, el);
|
|
773
733
|
}, [element.id]);
|
|
734
|
+
const { volume: playbackVolume, playbackRate } = chunkTDUDH7S4_js.mediaPlaybackAttributes({
|
|
735
|
+
loop: element.loop,
|
|
736
|
+
volume: element.volume,
|
|
737
|
+
playbackSpeed: element.playbackSpeed
|
|
738
|
+
});
|
|
774
739
|
React6.useEffect(() => {
|
|
775
740
|
const el = mediaRef.current;
|
|
776
741
|
if (el) {
|
|
777
|
-
el.volume =
|
|
742
|
+
el.volume = playbackVolume;
|
|
778
743
|
}
|
|
779
|
-
}, [
|
|
780
|
-
const playbackSpeed = element.playbackSpeed ?? 1;
|
|
744
|
+
}, [playbackVolume]);
|
|
781
745
|
React6.useEffect(() => {
|
|
782
746
|
const el = mediaRef.current;
|
|
783
747
|
if (el) {
|
|
784
|
-
el.playbackRate =
|
|
748
|
+
el.playbackRate = playbackRate;
|
|
785
749
|
}
|
|
786
|
-
}, [
|
|
750
|
+
}, [playbackRate]);
|
|
787
751
|
React6.useEffect(() => {
|
|
788
752
|
const el = mediaRef.current;
|
|
789
753
|
if (!el) {
|
|
@@ -966,7 +930,7 @@ function PresentationMediaController({
|
|
|
966
930
|
}
|
|
967
931
|
function renderMediaElement(element, mediaDataUrls, options) {
|
|
968
932
|
if (element.type !== "media") {
|
|
969
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
933
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkBXAK3JFM_js.translationsEn["pptx.media.title"] });
|
|
970
934
|
}
|
|
971
935
|
const mediaType = element.mediaType;
|
|
972
936
|
const mediaPath = element.mediaPath;
|
|
@@ -974,10 +938,11 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
974
938
|
const dataUrl = element.mediaData ?? (mediaPath ? mediaDataUrls.get(mediaPath) : void 0);
|
|
975
939
|
const trimFragment = buildTrimFragment(element);
|
|
976
940
|
const posterUrl = element.posterFrameData ?? void 0;
|
|
977
|
-
const shouldLoop = element.loop
|
|
941
|
+
const shouldLoop = chunkTDUDH7S4_js.mediaPlaybackAttributes(element).loop;
|
|
978
942
|
const shouldAutoPlay = options?.autoPlay === true || element.autoPlay === true;
|
|
979
943
|
const isFullScreen = options?.fullScreen === true;
|
|
980
944
|
const isPresentationMode = options?.isPresentationMode === true;
|
|
945
|
+
const showTransport = options?.showTransport ?? !isPresentationMode;
|
|
981
946
|
if (isPresentationMode && shouldAutoPlay && element.playAcrossSlides && element.mediaType === "audio" && dataUrl && !element.mediaData) {
|
|
982
947
|
const trimStartSec = element.trimStartMs !== void 0 ? element.trimStartMs / 1e3 : 0;
|
|
983
948
|
registerPersistentAudio(
|
|
@@ -996,7 +961,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
996
961
|
"img",
|
|
997
962
|
{
|
|
998
963
|
src: posterUrl,
|
|
999
|
-
alt:
|
|
964
|
+
alt: chunkBXAK3JFM_js.translationsEn["pptx.media.posterAlt"],
|
|
1000
965
|
className: "w-full h-full object-contain opacity-50"
|
|
1001
966
|
}
|
|
1002
967
|
),
|
|
@@ -1017,7 +982,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1017
982
|
]
|
|
1018
983
|
}
|
|
1019
984
|
),
|
|
1020
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children:
|
|
985
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: chunkBXAK3JFM_js.translationsEn["pptx.media.notFound"] })
|
|
1021
986
|
] })
|
|
1022
987
|
] });
|
|
1023
988
|
}
|
|
@@ -1046,7 +1011,8 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1046
1011
|
shouldLoop,
|
|
1047
1012
|
shouldAutoPlay,
|
|
1048
1013
|
isFullScreen,
|
|
1049
|
-
isPresentationMode
|
|
1014
|
+
isPresentationMode,
|
|
1015
|
+
showTransport
|
|
1050
1016
|
}
|
|
1051
1017
|
)
|
|
1052
1018
|
}
|
|
@@ -1058,7 +1024,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1058
1024
|
"img",
|
|
1059
1025
|
{
|
|
1060
1026
|
src: posterUrl,
|
|
1061
|
-
alt:
|
|
1027
|
+
alt: chunkBXAK3JFM_js.translationsEn["pptx.media.videoPosterAlt"],
|
|
1062
1028
|
className: "w-full h-full object-contain"
|
|
1063
1029
|
}
|
|
1064
1030
|
),
|
|
@@ -1115,7 +1081,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1115
1081
|
mediaMimeType,
|
|
1116
1082
|
shouldLoop,
|
|
1117
1083
|
shouldAutoPlay,
|
|
1118
|
-
|
|
1084
|
+
showTransport
|
|
1119
1085
|
}
|
|
1120
1086
|
)
|
|
1121
1087
|
}
|
|
@@ -1147,7 +1113,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1147
1113
|
|
|
1148
1114
|
// src/viewer/utils/text-utils.tsx
|
|
1149
1115
|
function getTextStyleForElement(element, fallbackColor) {
|
|
1150
|
-
return
|
|
1116
|
+
return chunkTDUDH7S4_js.buildTextBlockStyle(element, { fallbackColor });
|
|
1151
1117
|
}
|
|
1152
1118
|
|
|
1153
1119
|
// src/viewer/utils/text-layout.tsx
|
|
@@ -1172,13 +1138,13 @@ function computeTabSize(tabStops, defaultTabSize) {
|
|
|
1172
1138
|
return avgGap > 0 ? `${Math.round(avgGap)}px` : fromDefault;
|
|
1173
1139
|
}
|
|
1174
1140
|
function getTextLayoutStyle(element) {
|
|
1175
|
-
if (!
|
|
1141
|
+
if (!chunkTDUDH7S4_js.hasTextProperties(element)) {
|
|
1176
1142
|
return {};
|
|
1177
1143
|
}
|
|
1178
1144
|
const verticalAlign = element.textStyle?.vAlign || "top";
|
|
1179
|
-
const writingMode =
|
|
1180
|
-
const textOrientation =
|
|
1181
|
-
const verticalDirection =
|
|
1145
|
+
const writingMode = chunkTDUDH7S4_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
1146
|
+
const textOrientation = chunkTDUDH7S4_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
1147
|
+
const verticalDirection = chunkTDUDH7S4_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
1182
1148
|
const parsedColumnCount = Number(element.textStyle?.columnCount);
|
|
1183
1149
|
const columnCount = Number.isFinite(parsedColumnCount) ? Math.max(1, Math.min(16, Math.round(parsedColumnCount))) : 1;
|
|
1184
1150
|
const hasColumns = columnCount > 1;
|
|
@@ -1186,7 +1152,7 @@ function getTextLayoutStyle(element) {
|
|
|
1186
1152
|
const tabStops = element.textStyle?.tabStops;
|
|
1187
1153
|
const tabSize = computeTabSize(tabStops, element.textStyle?.defaultTabSize);
|
|
1188
1154
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
1189
|
-
const hasParagraphIndents =
|
|
1155
|
+
const hasParagraphIndents = chunkTDUDH7S4_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
1190
1156
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
1191
1157
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
1192
1158
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
@@ -1195,7 +1161,7 @@ function getTextLayoutStyle(element) {
|
|
|
1195
1161
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
1196
1162
|
const parsedColumnSpacing = Number(element.textStyle?.columnSpacing);
|
|
1197
1163
|
const columnGap = Number.isFinite(parsedColumnSpacing) && parsedColumnSpacing > 0 ? `${parsedColumnSpacing}px` : "0.75em";
|
|
1198
|
-
const kinsokuStyles =
|
|
1164
|
+
const kinsokuStyles = chunkTDUDH7S4_js.getKinsokuLineBreakStyles(element.textStyle);
|
|
1199
1165
|
if (hasColumns) {
|
|
1200
1166
|
return {
|
|
1201
1167
|
display: "block",
|
|
@@ -1242,10 +1208,10 @@ function getTextLayoutStyle(element) {
|
|
|
1242
1208
|
|
|
1243
1209
|
// src/viewer/utils/text-effects.tsx
|
|
1244
1210
|
function buildTextFillCss2(style) {
|
|
1245
|
-
return
|
|
1211
|
+
return chunkTDUDH7S4_js.buildTextFillCss(style);
|
|
1246
1212
|
}
|
|
1247
1213
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
1248
|
-
return
|
|
1214
|
+
return chunkTDUDH7S4_js.buildTextBody3DSceneStyle(textStyle);
|
|
1249
1215
|
}
|
|
1250
1216
|
|
|
1251
1217
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -1430,13 +1396,13 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1430
1396
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
1431
1397
|
return renderedSegments;
|
|
1432
1398
|
}
|
|
1433
|
-
const paraKey = `${elementId}${
|
|
1399
|
+
const paraKey = `${elementId}${chunkTDUDH7S4_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
1434
1400
|
const paraState = subElementAnimStates.get(paraKey);
|
|
1435
1401
|
if (paraState) {
|
|
1436
1402
|
const style = buildAnimStyle(paraState);
|
|
1437
1403
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
1438
1404
|
}
|
|
1439
|
-
const spec =
|
|
1405
|
+
const spec = chunkTDUDH7S4_js.buildTextBuildSpec(
|
|
1440
1406
|
elementId,
|
|
1441
1407
|
paraIndex,
|
|
1442
1408
|
paraSegments.map((entry) => ({ text: entry.segment.text, style: entry })),
|
|
@@ -1454,7 +1420,7 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1454
1420
|
"span",
|
|
1455
1421
|
{
|
|
1456
1422
|
"data-anim-id": span.animId,
|
|
1457
|
-
style:
|
|
1423
|
+
style: chunkTDUDH7S4_js.textBuildSpanStyle(span),
|
|
1458
1424
|
children: content
|
|
1459
1425
|
},
|
|
1460
1426
|
span.animId
|
|
@@ -1598,10 +1564,10 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1598
1564
|
if (!needsScriptFonts || !text) {
|
|
1599
1565
|
return text;
|
|
1600
1566
|
}
|
|
1601
|
-
const runs =
|
|
1567
|
+
const runs = chunkTDUDH7S4_js.segmentByScript(text);
|
|
1602
1568
|
if (runs.length <= 1) {
|
|
1603
1569
|
if (runs.length === 1) {
|
|
1604
|
-
const font =
|
|
1570
|
+
const font = chunkTDUDH7S4_js.resolveFontForScript(runs[0].script, scriptFonts);
|
|
1605
1571
|
if (font && font !== baseFontFamily) {
|
|
1606
1572
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: text });
|
|
1607
1573
|
}
|
|
@@ -1609,7 +1575,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1609
1575
|
return text;
|
|
1610
1576
|
}
|
|
1611
1577
|
return runs.map((run, i) => {
|
|
1612
|
-
const font =
|
|
1578
|
+
const font = chunkTDUDH7S4_js.resolveFontForScript(run.script, scriptFonts);
|
|
1613
1579
|
if (!font || font === baseFontFamily) {
|
|
1614
1580
|
return /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Fragment, { children: run.text }, `${keyPrefix}-r${i}`);
|
|
1615
1581
|
}
|
|
@@ -1681,8 +1647,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1681
1647
|
);
|
|
1682
1648
|
}
|
|
1683
1649
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
1684
|
-
const mathml =
|
|
1685
|
-
const safeMathml = mathml ?
|
|
1650
|
+
const mathml = chunkTDUDH7S4_js.convertOmmlToMathMl(equationXml);
|
|
1651
|
+
const safeMathml = mathml ? chunkTDUDH7S4_js.sanitizeMathMl(mathml) : "";
|
|
1686
1652
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1687
1653
|
"span",
|
|
1688
1654
|
{
|
|
@@ -1692,7 +1658,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1692
1658
|
},
|
|
1693
1659
|
dangerouslySetInnerHTML: { __html: safeMathml }
|
|
1694
1660
|
}
|
|
1695
|
-
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children:
|
|
1661
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children: chunkBXAK3JFM_js.translationsEn["pptx.textSegment.equationFallback"] });
|
|
1696
1662
|
if (equationNumber) {
|
|
1697
1663
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1698
1664
|
"span",
|
|
@@ -1732,7 +1698,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1732
1698
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: equationContent }, `${elementId}-seg-${segmentIndex}`);
|
|
1733
1699
|
}
|
|
1734
1700
|
function renderPictureBullet(elementId, segmentIndex, bulletInfo, baseFontSize) {
|
|
1735
|
-
const picture =
|
|
1701
|
+
const picture = chunkTDUDH7S4_js.resolvePictureBullet(bulletInfo, baseFontSize) ?? {
|
|
1736
1702
|
sizePx: baseFontSize,
|
|
1737
1703
|
fallbackMarker: "\u2022",
|
|
1738
1704
|
accessibleLabel: "Bullet"
|
|
@@ -1783,7 +1749,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1783
1749
|
}
|
|
1784
1750
|
const segmentStyle = segment.style || {};
|
|
1785
1751
|
const rawText = bulletInfo && typeof bulletHangPx === "number" ? (segment.text || "").trimEnd() : segment.text || "";
|
|
1786
|
-
const textValue =
|
|
1752
|
+
const textValue = chunkTDUDH7S4_js.substituteFieldText(rawText, segment.fieldType, fieldContext);
|
|
1787
1753
|
const lines = textValue.split("\n");
|
|
1788
1754
|
const textDecorationTokens = [];
|
|
1789
1755
|
if (segmentStyle.underline || segmentStyle.hyperlink) {
|
|
@@ -1793,8 +1759,8 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1793
1759
|
textDecorationTokens.push("line-through");
|
|
1794
1760
|
}
|
|
1795
1761
|
const isDoubleStrike = segmentStyle.strikethrough && segmentStyle.strikeType === "dblStrike";
|
|
1796
|
-
const resolvedSegmentColor = segmentStyle.hyperlink ?
|
|
1797
|
-
const underlineDecoration =
|
|
1762
|
+
const resolvedSegmentColor = segmentStyle.hyperlink ? chunkTDUDH7S4_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, HYPERLINK_COLOR) : chunkTDUDH7S4_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, fallbackColor);
|
|
1763
|
+
const underlineDecoration = chunkTDUDH7S4_js.resolveUnderlineDecorationStyle(
|
|
1798
1764
|
Boolean(isDoubleStrike),
|
|
1799
1765
|
segmentStyle.underlineStyle
|
|
1800
1766
|
);
|
|
@@ -1804,20 +1770,20 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1804
1770
|
const letterSpacing = typeof segmentStyle.characterSpacing === "number" && segmentStyle.characterSpacing !== 0 ? `${segmentStyle.characterSpacing / 100 * (96 / 72)}px` : void 0;
|
|
1805
1771
|
const textFillStyles = buildTextFillCss2(segmentStyle);
|
|
1806
1772
|
const rawFontSize = segmentStyle.fontSize || element.textStyle?.fontSize || DEFAULT_TEXT_FONT_SIZE;
|
|
1807
|
-
const autoFitScale =
|
|
1773
|
+
const autoFitScale = chunkTDUDH7S4_js.resolveAutoFitFontScale(element.textStyle);
|
|
1808
1774
|
const baseFontSize = rawFontSize * autoFitScale;
|
|
1809
1775
|
const baselineShift = baselineFraction !== 0 ? `${baselineFraction * baseFontSize}px` : void 0;
|
|
1810
1776
|
const baseFontSizePt = baseFontSize * (72 / 96);
|
|
1811
1777
|
const fontKerning = typeof segmentStyle.kerning === "number" ? segmentStyle.kerning === 0 ? "none" : baseFontSizePt >= segmentStyle.kerning / 100 ? "normal" : "none" : void 0;
|
|
1812
1778
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
1813
|
-
const baseFontFamily = rawFontFamily ?
|
|
1779
|
+
const baseFontFamily = rawFontFamily ? chunkTDUDH7S4_js.getSubstituteFontFamily(rawFontFamily) : DEFAULT_FONT_FAMILY;
|
|
1814
1780
|
const scriptFonts = {
|
|
1815
1781
|
latin: baseFontFamily,
|
|
1816
1782
|
eastAsia: segmentStyle.eastAsiaFont || element.textStyle?.eastAsiaFont || baseFontFamily,
|
|
1817
1783
|
complexScript: segmentStyle.complexScriptFont || element.textStyle?.complexScriptFont || baseFontFamily,
|
|
1818
1784
|
symbol: segmentStyle.symbolFont || element.textStyle?.symbolFont || baseFontFamily
|
|
1819
1785
|
};
|
|
1820
|
-
const needsScriptFonts =
|
|
1786
|
+
const needsScriptFonts = chunkTDUDH7S4_js.hasDistinctScriptFonts(scriptFonts);
|
|
1821
1787
|
const spanStyle = {
|
|
1822
1788
|
color: resolvedSegmentColor,
|
|
1823
1789
|
fontSize: baseFontSize * baselineFontScale,
|
|
@@ -1835,15 +1801,15 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1835
1801
|
fontVariantCaps: segmentStyle.textCaps === "small" ? "small-caps" : void 0,
|
|
1836
1802
|
letterSpacing,
|
|
1837
1803
|
fontKerning,
|
|
1838
|
-
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ?
|
|
1804
|
+
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ? chunkTDUDH7S4_js.normalizeHexColor(segmentStyle.highlightColor, "transparent") : void 0,
|
|
1839
1805
|
...textFillStyles,
|
|
1840
|
-
textDecorationColor: segmentStyle.underlineColor ?
|
|
1841
|
-
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${
|
|
1806
|
+
textDecorationColor: segmentStyle.underlineColor ? chunkTDUDH7S4_js.normalizeHexColor(segmentStyle.underlineColor, void 0) : void 0,
|
|
1807
|
+
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${chunkTDUDH7S4_js.normalizeHexColor(segmentStyle.textOutlineColor, "#000000")}` : segmentStyle.textOutlineWidth ? `${segmentStyle.textOutlineWidth}px currentColor` : void 0,
|
|
1842
1808
|
paintOrder: segmentStyle.textOutlineWidth ? "stroke fill" : void 0,
|
|
1843
|
-
textShadow:
|
|
1844
|
-
filter:
|
|
1845
|
-
opacity:
|
|
1846
|
-
WebkitBoxReflect:
|
|
1809
|
+
textShadow: chunkTDUDH7S4_js.buildTextShadowCss(segmentStyle),
|
|
1810
|
+
filter: chunkTDUDH7S4_js.buildTextRunFilterChain(segmentStyle),
|
|
1811
|
+
opacity: chunkTDUDH7S4_js.getTextAlphaOpacity(segmentStyle),
|
|
1812
|
+
WebkitBoxReflect: chunkTDUDH7S4_js.buildTextReflectionCss(segmentStyle)
|
|
1847
1813
|
};
|
|
1848
1814
|
const runRtl = segmentStyle.rtl;
|
|
1849
1815
|
if (runRtl !== void 0 && runRtl !== paragraphRtl) {
|
|
@@ -1863,7 +1829,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1863
1829
|
spanStyle.fontSize = baseFontSize * (bulletInfo.sizePercent / 100) * baselineFontScale;
|
|
1864
1830
|
}
|
|
1865
1831
|
if (bulletInfo.color) {
|
|
1866
|
-
spanStyle.color =
|
|
1832
|
+
spanStyle.color = chunkTDUDH7S4_js.normalizeHexColor(bulletInfo.color, resolvedSegmentColor);
|
|
1867
1833
|
}
|
|
1868
1834
|
if (typeof bulletHangPx === "number" && bulletHangPx > 0) {
|
|
1869
1835
|
spanStyle.display = "inline-block";
|
|
@@ -1908,7 +1874,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1908
1874
|
textAlign: segment.rubyAlignment === "l" ? "left" : segment.rubyAlignment === "r" ? "right" : segment.rubyAlignment === "dist" || segment.rubyAlignment === "distCat" || segment.rubyAlignment === "distLetter" ? "justify" : "center"
|
|
1909
1875
|
};
|
|
1910
1876
|
if (segment.rubyStyle?.color) {
|
|
1911
|
-
rubyStyle.color =
|
|
1877
|
+
rubyStyle.color = chunkTDUDH7S4_js.normalizeHexColor(segment.rubyStyle.color, resolvedSegmentColor);
|
|
1912
1878
|
}
|
|
1913
1879
|
innerContent = /* @__PURE__ */ jsxRuntime.jsxs("ruby", { children: [
|
|
1914
1880
|
baseContent,
|
|
@@ -2003,7 +1969,7 @@ function groupSegmentsIntoParagraphs(segments) {
|
|
|
2003
1969
|
return paragraphs;
|
|
2004
1970
|
}
|
|
2005
1971
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick) {
|
|
2006
|
-
if (!
|
|
1972
|
+
if (!chunkTDUDH7S4_js.hasTextProperties(element)) {
|
|
2007
1973
|
return emptyFallback || null;
|
|
2008
1974
|
}
|
|
2009
1975
|
const effectiveSegments = segmentOverrides ?? element.textSegments;
|
|
@@ -2024,10 +1990,10 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2024
1990
|
return element.text || emptyFallback || "";
|
|
2025
1991
|
}
|
|
2026
1992
|
const paragraphs = groupSegmentsIntoParagraphs(effectiveSegments);
|
|
2027
|
-
const paragraphIndents =
|
|
2028
|
-
const elementRtl =
|
|
2029
|
-
const elementAlign =
|
|
2030
|
-
const bodyStyle =
|
|
1993
|
+
const paragraphIndents = chunkTDUDH7S4_js.hasTextProperties(element) ? element.paragraphIndents : void 0;
|
|
1994
|
+
const elementRtl = chunkTDUDH7S4_js.hasTextProperties(element) ? element.textStyle?.rtl : void 0;
|
|
1995
|
+
const elementAlign = chunkTDUDH7S4_js.hasTextProperties(element) ? element.textStyle?.align : void 0;
|
|
1996
|
+
const bodyStyle = chunkTDUDH7S4_js.hasTextProperties(element) ? element.textStyle : void 0;
|
|
2031
1997
|
const spaceFirstLast = bodyStyle?.spaceFirstLastParagraph !== false;
|
|
2032
1998
|
return paragraphs.map(({ entries: paraSegments, terminator }, paraIndex) => {
|
|
2033
1999
|
const paraIndent = paragraphIndents?.[paraIndex];
|
|
@@ -2042,14 +2008,14 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2042
2008
|
return Boolean(segment.text) && segment.text.trim().length > 0;
|
|
2043
2009
|
});
|
|
2044
2010
|
const hasBullet = bulletInfo && !bulletInfo.none && hasVisibleTextContent;
|
|
2045
|
-
const paraRtl =
|
|
2011
|
+
const paraRtl = chunkTDUDH7S4_js.resolveParagraphRtl(paraSegments, elementRtl);
|
|
2046
2012
|
const isRtlParagraph = paraRtl === true;
|
|
2047
|
-
const paraAlign =
|
|
2048
|
-
const cssTextAlign =
|
|
2013
|
+
const paraAlign = chunkTDUDH7S4_js.resolveParagraphAlign(paraSegments, elementAlign);
|
|
2014
|
+
const cssTextAlign = chunkTDUDH7S4_js.resolveCssTextAlign(paraAlign, isRtlParagraph);
|
|
2049
2015
|
const paraMarginLeft = isRtlParagraph ? void 0 : rawMarginLeft;
|
|
2050
2016
|
const paraMarginRight = isRtlParagraph ? rawMarginLeft : void 0;
|
|
2051
2017
|
const paraTextIndent = rawTextIndent;
|
|
2052
|
-
const paraKinsokuStyle =
|
|
2018
|
+
const paraKinsokuStyle = chunkTDUDH7S4_js.getKinsokuLineBreakStyles(firstSeg?.segment.style);
|
|
2053
2019
|
const hasParaKinsoku = Object.keys(paraKinsokuStyle).length > 0;
|
|
2054
2020
|
const paraProps = effectiveSegments[firstSeg?.globalIndex ?? -1]?.paragraphProperties ?? (paraSegments.length === 0 ? terminator?.paragraphProperties : void 0);
|
|
2055
2021
|
const spacing = resolveParagraphSpacing({
|
|
@@ -2059,7 +2025,7 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2059
2025
|
isLast: paraIndex === paragraphs.length - 1,
|
|
2060
2026
|
spaceFirstLast
|
|
2061
2027
|
});
|
|
2062
|
-
const strutFontSize =
|
|
2028
|
+
const strutFontSize = chunkTDUDH7S4_js.resolveParagraphStrutFontSize(
|
|
2063
2029
|
paraSegments.length > 0 ? paraSegments.map(({ segment }) => segment) : terminator ? [terminator] : [],
|
|
2064
2030
|
bodyStyle?.fontSize
|
|
2065
2031
|
);
|
|
@@ -2163,13 +2129,13 @@ function hexToRgbUnit(hex) {
|
|
|
2163
2129
|
};
|
|
2164
2130
|
}
|
|
2165
2131
|
function getDuotoneColors(element) {
|
|
2166
|
-
if (!
|
|
2132
|
+
if (!chunkTDUDH7S4_js.isImageLikeElement(element)) {
|
|
2167
2133
|
return void 0;
|
|
2168
2134
|
}
|
|
2169
2135
|
return element.imageEffects?.duotone;
|
|
2170
2136
|
}
|
|
2171
2137
|
function buildLineShadowCss(element) {
|
|
2172
|
-
if (!
|
|
2138
|
+
if (!chunkTDUDH7S4_js.hasShapeProperties(element)) {
|
|
2173
2139
|
return void 0;
|
|
2174
2140
|
}
|
|
2175
2141
|
const ss = element.shapeStyle;
|
|
@@ -2180,13 +2146,13 @@ function buildLineShadowCss(element) {
|
|
|
2180
2146
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
2181
2147
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
2182
2148
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
2183
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
2184
|
-
|
|
2149
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkTDUDH7S4_js.colorWithOpacity(
|
|
2150
|
+
chunkTDUDH7S4_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
2185
2151
|
opacity
|
|
2186
2152
|
)}`;
|
|
2187
2153
|
}
|
|
2188
2154
|
function buildLineGlowFilter(element) {
|
|
2189
|
-
if (!
|
|
2155
|
+
if (!chunkTDUDH7S4_js.hasShapeProperties(element)) {
|
|
2190
2156
|
return void 0;
|
|
2191
2157
|
}
|
|
2192
2158
|
const ss = element.shapeStyle;
|
|
@@ -2195,7 +2161,7 @@ function buildLineGlowFilter(element) {
|
|
|
2195
2161
|
}
|
|
2196
2162
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
2197
2163
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
2198
|
-
const glowCol =
|
|
2164
|
+
const glowCol = chunkTDUDH7S4_js.colorWithOpacity(chunkTDUDH7S4_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
2199
2165
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
2200
2166
|
}
|
|
2201
2167
|
function mapDagBlendModeToCss(blend) {
|
|
@@ -2219,7 +2185,7 @@ function getDagDuotoneFilterId(elementId) {
|
|
|
2219
2185
|
return `dag-duotone-${elementId}`;
|
|
2220
2186
|
}
|
|
2221
2187
|
function hasDagDuotoneEffect(element) {
|
|
2222
|
-
if (!
|
|
2188
|
+
if (!chunkTDUDH7S4_js.hasShapeProperties(element)) {
|
|
2223
2189
|
return false;
|
|
2224
2190
|
}
|
|
2225
2191
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
@@ -2282,7 +2248,7 @@ function getRoundRectRadiusPx2(element) {
|
|
|
2282
2248
|
|
|
2283
2249
|
// src/viewer/utils/shape-visual-3d.ts
|
|
2284
2250
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
2285
|
-
return
|
|
2251
|
+
return chunkTDUDH7S4_js.build3DExtrusionData(
|
|
2286
2252
|
shape3d,
|
|
2287
2253
|
scene3d,
|
|
2288
2254
|
fillColor,
|
|
@@ -2291,7 +2257,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
2291
2257
|
);
|
|
2292
2258
|
}
|
|
2293
2259
|
function apply3dEffects2(base, scene3d, shape3d, fillColorFallback) {
|
|
2294
|
-
|
|
2260
|
+
chunkTDUDH7S4_js.apply3dEffects(base, scene3d, shape3d, fillColorFallback);
|
|
2295
2261
|
}
|
|
2296
2262
|
|
|
2297
2263
|
// src/viewer/utils/vector-subpath-paint.ts
|
|
@@ -2300,7 +2266,7 @@ function toHexByte(value) {
|
|
|
2300
2266
|
return clamped.toString(16).padStart(2, "0");
|
|
2301
2267
|
}
|
|
2302
2268
|
function shiftHex(hex, factor, towardsWhite) {
|
|
2303
|
-
const channels =
|
|
2269
|
+
const channels = chunkTDUDH7S4_js.hexToRgbChannels(hex);
|
|
2304
2270
|
if (!channels) {
|
|
2305
2271
|
return hex;
|
|
2306
2272
|
}
|
|
@@ -2326,13 +2292,13 @@ function buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity) {
|
|
|
2326
2292
|
const fillOff = subpath.fillMode === "none" || !hasFill;
|
|
2327
2293
|
return {
|
|
2328
2294
|
d: subpath.d,
|
|
2329
|
-
fill: fillOff ? "none" :
|
|
2295
|
+
fill: fillOff ? "none" : chunkTDUDH7S4_js.colorWithOpacity(adjustFillForMode(fillColor, subpath.fillMode), fillOpacity),
|
|
2330
2296
|
stroked: subpath.stroke !== false
|
|
2331
2297
|
};
|
|
2332
2298
|
});
|
|
2333
2299
|
}
|
|
2334
2300
|
function getStrokeOnlyPresetPaths(element) {
|
|
2335
|
-
if (element.type !== "shape" || !
|
|
2301
|
+
if (element.type !== "shape" || !chunkTDUDH7S4_js.hasShapeProperties(element)) {
|
|
2336
2302
|
return void 0;
|
|
2337
2303
|
}
|
|
2338
2304
|
const shapeType = element.shapeType;
|
|
@@ -2342,7 +2308,7 @@ function getStrokeOnlyPresetPaths(element) {
|
|
|
2342
2308
|
if (element.pathData) {
|
|
2343
2309
|
return void 0;
|
|
2344
2310
|
}
|
|
2345
|
-
const result =
|
|
2311
|
+
const result = chunkTDUDH7S4_js.evaluatePresetShape(
|
|
2346
2312
|
shapeType,
|
|
2347
2313
|
Math.max(element.width, 1),
|
|
2348
2314
|
Math.max(element.height, 1),
|
|
@@ -2360,43 +2326,43 @@ function getGradientTilingCss(style) {
|
|
|
2360
2326
|
if (!style || style.fillMode !== "gradient") {
|
|
2361
2327
|
return void 0;
|
|
2362
2328
|
}
|
|
2363
|
-
const isStructuredLinear = (style.fillGradientType || "linear") === "linear" &&
|
|
2329
|
+
const isStructuredLinear = (style.fillGradientType || "linear") === "linear" && chunkTDUDH7S4_js.sanitizeGradientStops(style.fillGradientStops).length > 0;
|
|
2364
2330
|
if (isStructuredLinear) {
|
|
2365
|
-
const flip =
|
|
2331
|
+
const flip = chunkTDUDH7S4_js.getGradientTileFlipCss(style.fillGradientFlip);
|
|
2366
2332
|
if (flip) {
|
|
2367
2333
|
return flip;
|
|
2368
2334
|
}
|
|
2369
2335
|
}
|
|
2370
|
-
return
|
|
2336
|
+
return chunkTDUDH7S4_js.getGradientTileRectCss(style.fillGradientTileRect);
|
|
2371
2337
|
}
|
|
2372
2338
|
function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2373
|
-
if (!
|
|
2339
|
+
if (!chunkTDUDH7S4_js.hasShapeProperties(element)) {
|
|
2374
2340
|
return {};
|
|
2375
2341
|
}
|
|
2376
2342
|
const normalizedShapeType = getShapeType(element.shapeType);
|
|
2377
|
-
const clipPath =
|
|
2343
|
+
const clipPath = chunkTDUDH7S4_js.getResolvedShapeClipPath(element);
|
|
2378
2344
|
const rendersCustomVectorPath = (element.type === "shape" || element.type === "image" || element.type === "picture") && Boolean(element.pathData) && typeof element.pathWidth === "number" && element.pathWidth > 0 && typeof element.pathHeight === "number" && element.pathHeight > 0;
|
|
2379
2345
|
const rendersStrokeOnlyPreset = Boolean(getStrokeOnlyPresetPaths(element));
|
|
2380
2346
|
const fillOpacity = element.shapeStyle?.fillOpacity;
|
|
2381
2347
|
const strokeOpacity = element.shapeStyle?.strokeOpacity;
|
|
2382
|
-
const strokeDash =
|
|
2383
|
-
const fillGradient =
|
|
2348
|
+
const strokeDash = chunkTDUDH7S4_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2349
|
+
const fillGradient = chunkTDUDH7S4_js.buildCssGradientFromShapeStyle(element.shapeStyle, {
|
|
2384
2350
|
rotation: element.rotation,
|
|
2385
2351
|
width: element.width,
|
|
2386
2352
|
height: element.height
|
|
2387
2353
|
}) || element.shapeStyle?.fillGradient;
|
|
2388
|
-
const shadowCss =
|
|
2389
|
-
const innerShadowCss =
|
|
2390
|
-
const resolvedFillColor =
|
|
2391
|
-
const resolvedStrokeColor =
|
|
2354
|
+
const shadowCss = chunkTDUDH7S4_js.buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
2355
|
+
const innerShadowCss = chunkTDUDH7S4_js.buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
2356
|
+
const resolvedFillColor = chunkTDUDH7S4_js.colorWithOpacity(fillColor, fillOpacity);
|
|
2357
|
+
const resolvedStrokeColor = chunkTDUDH7S4_js.colorWithOpacity(strokeColor, strokeOpacity);
|
|
2392
2358
|
const ss = element.shapeStyle;
|
|
2393
2359
|
const gradientTiling = getGradientTilingCss(ss);
|
|
2394
|
-
const paintsGradientOutline =
|
|
2360
|
+
const paintsGradientOutline = chunkTDUDH7S4_js.suppressesCssBorder(element);
|
|
2395
2361
|
const hasFillOverlayColor = Boolean(
|
|
2396
2362
|
ss?.dagFillOverlayColor && ss.dagFillOverlayColor !== "transparent"
|
|
2397
2363
|
);
|
|
2398
2364
|
const combinedShadowParts = [];
|
|
2399
|
-
const multiLayerShadow =
|
|
2365
|
+
const multiLayerShadow = chunkTDUDH7S4_js.buildMultiLayerShadowCss(element.shapeStyle);
|
|
2400
2366
|
if (multiLayerShadow) {
|
|
2401
2367
|
combinedShadowParts.push(multiLayerShadow);
|
|
2402
2368
|
} else if (shadowCss) {
|
|
@@ -2405,7 +2371,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2405
2371
|
if (innerShadowCss) {
|
|
2406
2372
|
combinedShadowParts.push(innerShadowCss);
|
|
2407
2373
|
}
|
|
2408
|
-
const glowBoxShadow =
|
|
2374
|
+
const glowBoxShadow = chunkTDUDH7S4_js.buildGlowBoxShadow(ss?.glowColor, ss?.glowRadius, ss?.glowOpacity);
|
|
2409
2375
|
if (glowBoxShadow) {
|
|
2410
2376
|
combinedShadowParts.push(glowBoxShadow);
|
|
2411
2377
|
}
|
|
@@ -2413,7 +2379,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2413
2379
|
if (lineShadow) {
|
|
2414
2380
|
combinedShadowParts.push(lineShadow);
|
|
2415
2381
|
}
|
|
2416
|
-
const compoundLineShadow =
|
|
2382
|
+
const compoundLineShadow = chunkTDUDH7S4_js.getCompoundLineBoxShadow(
|
|
2417
2383
|
element.shapeStyle?.compoundLine,
|
|
2418
2384
|
strokeWidth,
|
|
2419
2385
|
resolvedStrokeColor
|
|
@@ -2426,11 +2392,11 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2426
2392
|
if (ss?.glowColor && ss.glowColor !== "transparent" && ss.glowRadius) {
|
|
2427
2393
|
const glowOpacity = typeof ss.glowOpacity === "number" ? ss.glowOpacity : 0.75;
|
|
2428
2394
|
const glowRad = Math.round(Math.max(0, ss.glowRadius));
|
|
2429
|
-
const glowCol =
|
|
2395
|
+
const glowCol = chunkTDUDH7S4_js.colorWithOpacity(chunkTDUDH7S4_js.normalizeHexColor(ss.glowColor, "#ffff00"), glowOpacity);
|
|
2430
2396
|
filterParts.push(`drop-shadow(0 0 ${glowRad}px ${glowCol})`);
|
|
2431
2397
|
}
|
|
2432
2398
|
if (typeof ss?.softEdgeRadius === "number" && ss.softEdgeRadius > 0) {
|
|
2433
|
-
filterParts.push(`url(#${
|
|
2399
|
+
filterParts.push(`url(#${chunkTDUDH7S4_js.getSoftEdgeFilterId(element.id)})`);
|
|
2434
2400
|
}
|
|
2435
2401
|
if (typeof ss?.blurRadius === "number" && ss.blurRadius > 0) {
|
|
2436
2402
|
filterParts.push(`blur(${Math.round(ss.blurRadius)}px)`);
|
|
@@ -2439,13 +2405,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2439
2405
|
if (lineGlowCss) {
|
|
2440
2406
|
filterParts.push(lineGlowCss);
|
|
2441
2407
|
}
|
|
2442
|
-
const dagFilter =
|
|
2408
|
+
const dagFilter = chunkTDUDH7S4_js.getEffectDagFilter(ss, element.id);
|
|
2443
2409
|
if (dagFilter) {
|
|
2444
2410
|
filterParts.push(dagFilter);
|
|
2445
2411
|
}
|
|
2446
2412
|
const lineJoinCss = ss?.lineJoin === "round" ? "round" : ss?.lineJoin === "bevel" ? "bevel" : ss?.lineJoin === "miter" ? "miter" : void 0;
|
|
2447
2413
|
const miterLimitCss = ss?.lineJoin === "miter" && typeof ss?.miterLimit === "number" ? Math.max(ss.miterLimit / 1e5, 1) : void 0;
|
|
2448
|
-
const patternFill =
|
|
2414
|
+
const patternFill = chunkTDUDH7S4_js.buildPatternFillCss(element.shapeStyle);
|
|
2449
2415
|
const imageFillUrl = ss?.fillMode === "image" && ss.fillImageUrl ? ss.fillImageUrl : void 0;
|
|
2450
2416
|
const imageFillMode = ss?.fillImageMode || "stretch";
|
|
2451
2417
|
let reflectCss;
|
|
@@ -2457,7 +2423,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2457
2423
|
const endOpacity = typeof ss.reflectionEndOpacity === "number" ? ss.reflectionEndOpacity : 0;
|
|
2458
2424
|
const fadeLength = typeof ss.reflectionEndPosition === "number" ? Math.round(ss.reflectionEndPosition * Math.max(element.height, 1)) : 100;
|
|
2459
2425
|
const blurRadius = typeof ss.reflectionBlurRadius === "number" ? ss.reflectionBlurRadius : 0;
|
|
2460
|
-
reflectCss =
|
|
2426
|
+
reflectCss = chunkTDUDH7S4_js.buildReflectionCss(distance, startOpacity, endOpacity, fadeLength, blurRadius);
|
|
2461
2427
|
}
|
|
2462
2428
|
}
|
|
2463
2429
|
const base = {
|
|
@@ -2503,9 +2469,9 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2503
2469
|
// path following the shape's geometry, because a CSS border can only take
|
|
2504
2470
|
// one colour. Keeping the border too would draw the parser's averaged
|
|
2505
2471
|
// solid underneath the gradient.
|
|
2506
|
-
borderWidth: strokeWidth > 0 && !paintsGradientOutline ?
|
|
2472
|
+
borderWidth: strokeWidth > 0 && !paintsGradientOutline ? chunkTDUDH7S4_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : 0,
|
|
2507
2473
|
borderColor: strokeWidth > 0 && !paintsGradientOutline ? resolvedStrokeColor : void 0,
|
|
2508
|
-
borderStyle: strokeWidth > 0 && !paintsGradientOutline ?
|
|
2474
|
+
borderStyle: strokeWidth > 0 && !paintsGradientOutline ? chunkTDUDH7S4_js.getCssBorderDashStyle(strokeDash, ss?.compoundLine) : void 0,
|
|
2509
2475
|
strokeLinejoin: lineJoinCss,
|
|
2510
2476
|
strokeMiterlimit: miterLimitCss,
|
|
2511
2477
|
strokeLinecap: ss?.lineCap === "rnd" ? "round" : ss?.lineCap === "sq" ? "square" : ss?.lineCap === "flat" ? "butt" : void 0
|
|
@@ -2561,7 +2527,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2561
2527
|
borderWidth: 0,
|
|
2562
2528
|
borderTopWidth: Math.max(strokeWidth, 2),
|
|
2563
2529
|
borderTopColor: resolvedStrokeColor,
|
|
2564
|
-
borderTopStyle:
|
|
2530
|
+
borderTopStyle: chunkTDUDH7S4_js.getCssBorderDashStyle(strokeDash)
|
|
2565
2531
|
};
|
|
2566
2532
|
}
|
|
2567
2533
|
if (normalizedShapeType === "cylinder") {
|
|
@@ -2575,13 +2541,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2575
2541
|
function getConnectorAdjustment(element, key, fallback) {
|
|
2576
2542
|
const direct = element.shapeAdjustments?.[key];
|
|
2577
2543
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
2578
|
-
return
|
|
2544
|
+
return chunkTDUDH7S4_js.clampUnitInterval(direct / 1e5);
|
|
2579
2545
|
}
|
|
2580
2546
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
2581
2547
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
2582
|
-
return
|
|
2548
|
+
return chunkTDUDH7S4_js.clampUnitInterval(fallbackKey / 1e5);
|
|
2583
2549
|
}
|
|
2584
|
-
return
|
|
2550
|
+
return chunkTDUDH7S4_js.clampUnitInterval(fallback);
|
|
2585
2551
|
}
|
|
2586
2552
|
function getConnectorPathGeometry(element) {
|
|
2587
2553
|
const width = Math.max(element.width, 1);
|
|
@@ -2718,11 +2684,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
|
|
|
2718
2684
|
strokePaint,
|
|
2719
2685
|
strokeWidth,
|
|
2720
2686
|
dashArray,
|
|
2721
|
-
lineCap:
|
|
2687
|
+
lineCap: chunkTDUDH7S4_js.svgLineCap(shapeStyle?.lineCap),
|
|
2722
2688
|
lineJoin,
|
|
2723
2689
|
miterLimit,
|
|
2724
|
-
offsets:
|
|
2725
|
-
widths:
|
|
2690
|
+
offsets: chunkTDUDH7S4_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
2691
|
+
widths: chunkTDUDH7S4_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
|
|
2726
2692
|
};
|
|
2727
2693
|
}
|
|
2728
2694
|
function strokeStrands(d, keyBase, ctx) {
|
|
@@ -2770,9 +2736,9 @@ function gradientDefs(gradient) {
|
|
|
2770
2736
|
}
|
|
2771
2737
|
function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredPaths, shapeStyle, hasFill, fillColor, fillOpacity, strokePaint, strokeWidth, dashArray, animatesFill = false, gradient) {
|
|
2772
2738
|
const ctx = strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray);
|
|
2773
|
-
const subpaths = structuredPaths && structuredPaths.length > 0 ?
|
|
2739
|
+
const subpaths = structuredPaths && structuredPaths.length > 0 ? chunkTDUDH7S4_js.customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
2774
2740
|
const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
|
|
2775
|
-
const gradientPaint = gradient ?
|
|
2741
|
+
const gradientPaint = gradient ? chunkTDUDH7S4_js.svgGradientFillRef(gradient) : void 0;
|
|
2776
2742
|
const nodes = [];
|
|
2777
2743
|
if (subpaths && needsPerSubpath) {
|
|
2778
2744
|
const paints = buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity);
|
|
@@ -2804,7 +2770,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2804
2770
|
"path",
|
|
2805
2771
|
{
|
|
2806
2772
|
d: pathData,
|
|
2807
|
-
fill: animatesFill ? "inherit" : gradientPaint ??
|
|
2773
|
+
fill: animatesFill ? "inherit" : gradientPaint ?? chunkTDUDH7S4_js.colorWithOpacity(fillColor, fillOpacity),
|
|
2808
2774
|
stroke: "none",
|
|
2809
2775
|
vectorEffect: "non-scaling-stroke"
|
|
2810
2776
|
},
|
|
@@ -2849,14 +2815,14 @@ function renderStrokeOnlyPreset(presetPaths, width, height, shapeStyle, strokePa
|
|
|
2849
2815
|
);
|
|
2850
2816
|
}
|
|
2851
2817
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2852
|
-
if (!
|
|
2818
|
+
if (!chunkTDUDH7S4_js.hasShapeProperties(element)) {
|
|
2853
2819
|
return null;
|
|
2854
2820
|
}
|
|
2855
2821
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
2856
|
-
const fillPaint = animatesFill ? "inherit" :
|
|
2857
|
-
const strokePaint = animatesStroke ? "inherit" :
|
|
2858
|
-
const dashType =
|
|
2859
|
-
const dashArray =
|
|
2822
|
+
const fillPaint = animatesFill ? "inherit" : chunkTDUDH7S4_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
2823
|
+
const strokePaint = animatesStroke ? "inherit" : chunkTDUDH7S4_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
2824
|
+
const dashType = chunkTDUDH7S4_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2825
|
+
const dashArray = chunkTDUDH7S4_js.getSvgStrokeDasharray(
|
|
2860
2826
|
dashType,
|
|
2861
2827
|
Math.max(strokeWidth, 1),
|
|
2862
2828
|
element.shapeStyle?.customDashSegments
|
|
@@ -2937,21 +2903,21 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2937
2903
|
// container's `background-image` is suppressed for custom geometry, so
|
|
2938
2904
|
// without this the shape fell back to the parser's representative solid
|
|
2939
2905
|
// and lost every fade (issue #132).
|
|
2940
|
-
|
|
2906
|
+
chunkTDUDH7S4_js.buildSvgGradientDef(element.shapeStyle, element.id)
|
|
2941
2907
|
);
|
|
2942
2908
|
}
|
|
2943
|
-
if (
|
|
2909
|
+
if (chunkTDUDH7S4_js.isCalloutShape(normalizedType)) {
|
|
2944
2910
|
const width = Math.max(element.width, 1);
|
|
2945
2911
|
const height = Math.max(element.height, 1);
|
|
2946
|
-
const geometry =
|
|
2912
|
+
const geometry = chunkTDUDH7S4_js.getCalloutLeaderLineGeometry(
|
|
2947
2913
|
normalizedType,
|
|
2948
2914
|
width,
|
|
2949
2915
|
height,
|
|
2950
2916
|
element.shapeAdjustments
|
|
2951
2917
|
);
|
|
2952
2918
|
if (geometry && geometry.points.length >= 2) {
|
|
2953
|
-
const leaderPath =
|
|
2954
|
-
const bounds =
|
|
2919
|
+
const leaderPath = chunkTDUDH7S4_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
2920
|
+
const bounds = chunkTDUDH7S4_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
2955
2921
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
2956
2922
|
const offsetLeft = bounds.minX;
|
|
2957
2923
|
const offsetTop = bounds.minY;
|
|
@@ -3014,10 +2980,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
3014
2980
|
const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
|
|
3015
2981
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
3016
2982
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
3017
|
-
const connectorLineCap =
|
|
2983
|
+
const connectorLineCap = chunkTDUDH7S4_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
3018
2984
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
3019
|
-
const offsets =
|
|
3020
|
-
const widths =
|
|
2985
|
+
const offsets = chunkTDUDH7S4_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
2986
|
+
const widths = chunkTDUDH7S4_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
3021
2987
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3022
2988
|
"svg",
|
|
3023
2989
|
{
|
|
@@ -3096,15 +3062,15 @@ function parseGradientFillCss(gradFill) {
|
|
|
3096
3062
|
}
|
|
3097
3063
|
const parsed = stops.map((gs) => {
|
|
3098
3064
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
3099
|
-
const color =
|
|
3100
|
-
const opacity =
|
|
3101
|
-
return { pos, color:
|
|
3065
|
+
const color = chunkTDUDH7S4_js.parseDrawingColor(gs) ?? "#888888";
|
|
3066
|
+
const opacity = chunkTDUDH7S4_js.parseDrawingColorOpacity(gs);
|
|
3067
|
+
return { pos, color: chunkTDUDH7S4_js.colorWithOpacity(color, opacity) };
|
|
3102
3068
|
}).sort((a, b) => a.pos - b.pos);
|
|
3103
3069
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
3104
3070
|
const lin = gradFill["a:lin"];
|
|
3105
3071
|
if (lin) {
|
|
3106
3072
|
const angRaw = Number.parseInt(String(lin["@_ang"] || "0"), 10);
|
|
3107
|
-
const angleDeg = Math.round(
|
|
3073
|
+
const angleDeg = Math.round(chunkTDUDH7S4_js.ooxmlGradientAngleToCssDegrees(angRaw / 6e4));
|
|
3108
3074
|
return `linear-gradient(${angleDeg}deg, ${stopStrings})`;
|
|
3109
3075
|
}
|
|
3110
3076
|
const path = gradFill["a:path"];
|
|
@@ -3139,8 +3105,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
3139
3105
|
if (!pattFill) {
|
|
3140
3106
|
return void 0;
|
|
3141
3107
|
}
|
|
3142
|
-
const fgColor =
|
|
3143
|
-
const bgColor =
|
|
3108
|
+
const fgColor = chunkTDUDH7S4_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
3109
|
+
const bgColor = chunkTDUDH7S4_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
3144
3110
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
3145
3111
|
switch (preset) {
|
|
3146
3112
|
case "ltHorz":
|
|
@@ -3251,11 +3217,11 @@ function parseCellBorders(cellProperties) {
|
|
|
3251
3217
|
const prstDash = ln["a:prstDash"];
|
|
3252
3218
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
3253
3219
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
3254
|
-
const color =
|
|
3220
|
+
const color = chunkTDUDH7S4_js.parseDrawingColor(ln["a:solidFill"]);
|
|
3255
3221
|
if (color) {
|
|
3256
|
-
const opacity =
|
|
3222
|
+
const opacity = chunkTDUDH7S4_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
3257
3223
|
const key = `${edge.prefix}`;
|
|
3258
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
3224
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkTDUDH7S4_js.colorWithOpacity(color, opacity)}`;
|
|
3259
3225
|
}
|
|
3260
3226
|
}
|
|
3261
3227
|
return borderStyle;
|
|
@@ -3268,7 +3234,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3268
3234
|
const textShadowParts = [];
|
|
3269
3235
|
const outerShdw = effectLst["a:outerShdw"];
|
|
3270
3236
|
if (outerShdw) {
|
|
3271
|
-
const shdwColor =
|
|
3237
|
+
const shdwColor = chunkTDUDH7S4_js.parseDrawingColor(outerShdw);
|
|
3272
3238
|
if (shdwColor) {
|
|
3273
3239
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
3274
3240
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -3286,7 +3252,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3286
3252
|
}
|
|
3287
3253
|
const glow = effectLst["a:glow"];
|
|
3288
3254
|
if (glow) {
|
|
3289
|
-
const glowColor =
|
|
3255
|
+
const glowColor = chunkTDUDH7S4_js.parseDrawingColor(glow);
|
|
3290
3256
|
if (glowColor) {
|
|
3291
3257
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
3292
3258
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -3365,10 +3331,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3365
3331
|
if (runProps?.["@_u"] !== void 0) {
|
|
3366
3332
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
3367
3333
|
}
|
|
3368
|
-
const runColor =
|
|
3334
|
+
const runColor = chunkTDUDH7S4_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkTDUDH7S4_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
3369
3335
|
if (runColor) {
|
|
3370
|
-
const opacity =
|
|
3371
|
-
cellStyle.color =
|
|
3336
|
+
const opacity = chunkTDUDH7S4_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
3337
|
+
cellStyle.color = chunkTDUDH7S4_js.colorWithOpacity(runColor, opacity);
|
|
3372
3338
|
}
|
|
3373
3339
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
3374
3340
|
if (fontFamily) {
|
|
@@ -3378,15 +3344,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3378
3344
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
3379
3345
|
}
|
|
3380
3346
|
const cellProperties = cellXml["a:tcPr"];
|
|
3381
|
-
const cellFill =
|
|
3347
|
+
const cellFill = chunkTDUDH7S4_js.parseDrawingColor(
|
|
3382
3348
|
cellProperties?.["a:solidFill"],
|
|
3383
3349
|
schemeColorOverrides
|
|
3384
3350
|
);
|
|
3385
3351
|
if (cellFill) {
|
|
3386
|
-
const opacity =
|
|
3352
|
+
const opacity = chunkTDUDH7S4_js.parseDrawingColorOpacity(
|
|
3387
3353
|
cellProperties?.["a:solidFill"]
|
|
3388
3354
|
);
|
|
3389
|
-
cellStyle.backgroundColor =
|
|
3355
|
+
cellStyle.backgroundColor = chunkTDUDH7S4_js.colorWithOpacity(cellFill, opacity);
|
|
3390
3356
|
} else {
|
|
3391
3357
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
3392
3358
|
if (gradCss) {
|
|
@@ -3401,16 +3367,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3401
3367
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
3402
3368
|
Object.assign(cellStyle, edgeBorders);
|
|
3403
3369
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
3404
|
-
const borderColor =
|
|
3370
|
+
const borderColor = chunkTDUDH7S4_js.parseDrawingColor(
|
|
3405
3371
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
3406
3372
|
schemeColorOverrides
|
|
3407
|
-
) ||
|
|
3373
|
+
) || chunkTDUDH7S4_js.parseDrawingColor(
|
|
3408
3374
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
3409
3375
|
schemeColorOverrides
|
|
3410
|
-
) ||
|
|
3376
|
+
) || chunkTDUDH7S4_js.parseDrawingColor(
|
|
3411
3377
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
3412
3378
|
schemeColorOverrides
|
|
3413
|
-
) ||
|
|
3379
|
+
) || chunkTDUDH7S4_js.parseDrawingColor(
|
|
3414
3380
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
3415
3381
|
schemeColorOverrides
|
|
3416
3382
|
);
|
|
@@ -3489,10 +3455,10 @@ function resolveTableStyleFillColor(fill, colorScheme) {
|
|
|
3489
3455
|
}
|
|
3490
3456
|
let color = base;
|
|
3491
3457
|
if (fill.tint !== void 0 && fill.tint > 0) {
|
|
3492
|
-
color =
|
|
3458
|
+
color = chunkTDUDH7S4_js.tintColor2(color, fill.tint / 1e5);
|
|
3493
3459
|
}
|
|
3494
3460
|
if (fill.shade !== void 0 && fill.shade > 0) {
|
|
3495
|
-
color =
|
|
3461
|
+
color = chunkTDUDH7S4_js.shadeColor2(color, 1 - fill.shade / 1e5);
|
|
3496
3462
|
}
|
|
3497
3463
|
return color;
|
|
3498
3464
|
}
|
|
@@ -3517,7 +3483,7 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3517
3483
|
style.fontFamily = text.fontFace;
|
|
3518
3484
|
applied = true;
|
|
3519
3485
|
} else {
|
|
3520
|
-
const refFont =
|
|
3486
|
+
const refFont = chunkTDUDH7S4_js.resolveFontRefIdx(text.fontRefIdx, fontScheme);
|
|
3521
3487
|
if (refFont) {
|
|
3522
3488
|
style.fontFamily = refFont;
|
|
3523
3489
|
applied = true;
|
|
@@ -3528,10 +3494,10 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3528
3494
|
if (base) {
|
|
3529
3495
|
let color = base;
|
|
3530
3496
|
if (text.fontTint !== void 0 && text.fontTint > 0) {
|
|
3531
|
-
color =
|
|
3497
|
+
color = chunkTDUDH7S4_js.tintColor2(color, text.fontTint / 1e5);
|
|
3532
3498
|
}
|
|
3533
3499
|
if (text.fontShade !== void 0 && text.fontShade > 0) {
|
|
3534
|
-
color =
|
|
3500
|
+
color = chunkTDUDH7S4_js.shadeColor2(color, 1 - text.fontShade / 1e5);
|
|
3535
3501
|
}
|
|
3536
3502
|
style.color = color;
|
|
3537
3503
|
applied = true;
|
|
@@ -3720,7 +3686,7 @@ function parseTableElementData(element, fallbackTextStyle) {
|
|
|
3720
3686
|
};
|
|
3721
3687
|
}
|
|
3722
3688
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
3723
|
-
return
|
|
3689
|
+
return chunkTDUDH7S4_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
3724
3690
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
3725
3691
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
3726
3692
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -3868,9 +3834,9 @@ function cellStyleToCss(style) {
|
|
|
3868
3834
|
if (style.gradientFillCss) {
|
|
3869
3835
|
css.background = style.gradientFillCss;
|
|
3870
3836
|
} else if (style.fillMode === "pattern" && style.patternFillPreset) {
|
|
3871
|
-
const fg =
|
|
3872
|
-
const bg =
|
|
3873
|
-
const svgPattern =
|
|
3837
|
+
const fg = chunkTDUDH7S4_js.normalizeHexColor(style.patternFillForeground, "#000000");
|
|
3838
|
+
const bg = chunkTDUDH7S4_js.normalizeHexColor(style.patternFillBackground, "#ffffff");
|
|
3839
|
+
const svgPattern = chunkTDUDH7S4_js.getPatternSvg(style.patternFillPreset, fg, bg);
|
|
3874
3840
|
if (svgPattern) {
|
|
3875
3841
|
const encoded = encodeURIComponent(svgPattern);
|
|
3876
3842
|
css.backgroundImage = `url("data:image/svg+xml,${encoded}")`;
|
|
@@ -3946,7 +3912,7 @@ function cellStyleToCss(style) {
|
|
|
3946
3912
|
if (edge.width || edge.color) {
|
|
3947
3913
|
const w = edge.width ?? 1;
|
|
3948
3914
|
const c = edge.color ?? style.borderColor ?? "#000000";
|
|
3949
|
-
const s =
|
|
3915
|
+
const s = chunkTDUDH7S4_js.ooxmlDashToCssBorderStyle(edge.dash);
|
|
3950
3916
|
css[edge.prefix] = `${w}px ${s} ${c}`;
|
|
3951
3917
|
}
|
|
3952
3918
|
}
|
|
@@ -3977,7 +3943,7 @@ function cellStyleToCss(style) {
|
|
|
3977
3943
|
css.textShadow = textShadowParts.join(", ");
|
|
3978
3944
|
}
|
|
3979
3945
|
if (style.cell3D) {
|
|
3980
|
-
Object.assign(css,
|
|
3946
|
+
Object.assign(css, chunkTDUDH7S4_js.cell3DBevelCss(style.cell3D));
|
|
3981
3947
|
}
|
|
3982
3948
|
return css;
|
|
3983
3949
|
}
|
|
@@ -3991,7 +3957,7 @@ function TableResizeOverlay({
|
|
|
3991
3957
|
const containerRef = React6.useRef(null);
|
|
3992
3958
|
const [rowBounds, setRowBounds] = React6.useState([]);
|
|
3993
3959
|
const dragRef = React6.useRef(null);
|
|
3994
|
-
const colBoundaries = React6.useMemo(() =>
|
|
3960
|
+
const colBoundaries = React6.useMemo(() => chunkTDUDH7S4_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
3995
3961
|
const measureRows = React6.useCallback(() => {
|
|
3996
3962
|
const container = containerRef.current;
|
|
3997
3963
|
if (!container) {
|
|
@@ -4038,11 +4004,11 @@ function TableResizeOverlay({
|
|
|
4038
4004
|
const rect = containerRef.current.getBoundingClientRect();
|
|
4039
4005
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
4040
4006
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
4041
|
-
onResizeColumns(
|
|
4007
|
+
onResizeColumns(chunkTDUDH7S4_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
4042
4008
|
} else if (drag.type === "row" && onResizeRow) {
|
|
4043
4009
|
const deltaY = e.clientY - drag.startPos;
|
|
4044
|
-
const newHeight =
|
|
4045
|
-
drag.initialRowHeight ??
|
|
4010
|
+
const newHeight = chunkTDUDH7S4_js.computeResizedRowHeight(
|
|
4011
|
+
drag.initialRowHeight ?? chunkTDUDH7S4_js.DEFAULT_ROW_HEIGHT,
|
|
4046
4012
|
deltaY
|
|
4047
4013
|
);
|
|
4048
4014
|
onResizeRow(drag.index, newHeight);
|
|
@@ -4080,7 +4046,7 @@ function TableResizeOverlay({
|
|
|
4080
4046
|
e.stopPropagation();
|
|
4081
4047
|
const table = containerRef.current?.querySelector("table");
|
|
4082
4048
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
4083
|
-
const actualHeight = tr?.offsetHeight ??
|
|
4049
|
+
const actualHeight = tr?.offsetHeight ?? chunkTDUDH7S4_js.DEFAULT_ROW_HEIGHT;
|
|
4084
4050
|
document.body.style.cursor = "row-resize";
|
|
4085
4051
|
document.body.style.userSelect = "none";
|
|
4086
4052
|
dragRef.current = {
|
|
@@ -4128,7 +4094,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4128
4094
|
}
|
|
4129
4095
|
const first = selectedCell.selectedCells[0];
|
|
4130
4096
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4131
|
-
return
|
|
4097
|
+
return chunkTDUDH7S4_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
4132
4098
|
})();
|
|
4133
4099
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4134
4100
|
TableResizeOverlay,
|
|
@@ -4161,7 +4127,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4161
4127
|
return null;
|
|
4162
4128
|
}
|
|
4163
4129
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
4164
|
-
const isInMultiSelection =
|
|
4130
|
+
const isInMultiSelection = chunkTDUDH7S4_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
4165
4131
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
4166
4132
|
const diag = getCellDiagonalBorders2(
|
|
4167
4133
|
cell.style,
|
|
@@ -4191,7 +4157,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4191
4157
|
}
|
|
4192
4158
|
event.stopPropagation();
|
|
4193
4159
|
if (event.shiftKey && selectedCell) {
|
|
4194
|
-
const rect =
|
|
4160
|
+
const rect = chunkTDUDH7S4_js.computeSelectionRect(
|
|
4195
4161
|
selectedCell.rowIndex,
|
|
4196
4162
|
selectedCell.columnIndex,
|
|
4197
4163
|
rowIndex,
|
|
@@ -4201,7 +4167,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4201
4167
|
options?.onSelectCell?.({
|
|
4202
4168
|
rowIndex: selectedCell.rowIndex,
|
|
4203
4169
|
columnIndex: selectedCell.columnIndex,
|
|
4204
|
-
selectedCells:
|
|
4170
|
+
selectedCells: chunkTDUDH7S4_js.rectToCells(rect)
|
|
4205
4171
|
});
|
|
4206
4172
|
} else {
|
|
4207
4173
|
options?.onSelectCell?.({
|
|
@@ -4263,7 +4229,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4263
4229
|
if (tableEl2.tableData && tableEl2.tableData.rows.length > 0) {
|
|
4264
4230
|
return renderTableFromTableData(tableEl2, textStyle, options);
|
|
4265
4231
|
}
|
|
4266
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
4232
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkBXAK3JFM_js.translationsEn["pptx.table.title"] });
|
|
4267
4233
|
}
|
|
4268
4234
|
const selectedCell = options?.selectedCell || null;
|
|
4269
4235
|
const isEditable = Boolean(options?.editable);
|
|
@@ -4278,7 +4244,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4278
4244
|
}
|
|
4279
4245
|
const first = selectedCell.selectedCells[0];
|
|
4280
4246
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4281
|
-
return
|
|
4247
|
+
return chunkTDUDH7S4_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
4282
4248
|
})();
|
|
4283
4249
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
4284
4250
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4355,7 +4321,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4355
4321
|
"border px-1 py-0.5 align-top",
|
|
4356
4322
|
isEditable && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
4357
4323
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
4358
|
-
|
|
4324
|
+
chunkTDUDH7S4_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
4359
4325
|
),
|
|
4360
4326
|
colSpan,
|
|
4361
4327
|
rowSpan: rSpan,
|
|
@@ -4366,7 +4332,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4366
4332
|
}
|
|
4367
4333
|
event.stopPropagation();
|
|
4368
4334
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
4369
|
-
const rect =
|
|
4335
|
+
const rect = chunkTDUDH7S4_js.computeSelectionRect(
|
|
4370
4336
|
selectedCell.rowIndex,
|
|
4371
4337
|
selectedCell.columnIndex,
|
|
4372
4338
|
rowIndex,
|
|
@@ -4376,7 +4342,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4376
4342
|
options?.onSelectCell?.({
|
|
4377
4343
|
rowIndex: selectedCell.rowIndex,
|
|
4378
4344
|
columnIndex: selectedCell.columnIndex,
|
|
4379
|
-
selectedCells:
|
|
4345
|
+
selectedCells: chunkTDUDH7S4_js.rectToCells(rect)
|
|
4380
4346
|
});
|
|
4381
4347
|
} else {
|
|
4382
4348
|
options?.onSelectCell?.({
|
|
@@ -4431,24 +4397,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4431
4397
|
}
|
|
4432
4398
|
var LEGEND_ITEM_WIDTH = 80;
|
|
4433
4399
|
function partAttrs(part) {
|
|
4434
|
-
return part ?
|
|
4400
|
+
return part ? chunkTDUDH7S4_js.chartPartToAttrs(part) : void 0;
|
|
4435
4401
|
}
|
|
4436
4402
|
function resolveReactPalette(chartData) {
|
|
4437
4403
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
4438
4404
|
return chartData.colorPalette;
|
|
4439
4405
|
}
|
|
4440
|
-
return [...
|
|
4406
|
+
return [...chunkTDUDH7S4_js.getChartStylePalette(chartData.style?.styleId)];
|
|
4441
4407
|
}
|
|
4442
4408
|
function buildReactChartViewModel(element) {
|
|
4443
4409
|
if (element.type !== "chart" || !element.chartData) {
|
|
4444
|
-
return
|
|
4410
|
+
return chunkTDUDH7S4_js.buildChartViewModel(element);
|
|
4445
4411
|
}
|
|
4446
4412
|
const palette = resolveReactPalette(element.chartData);
|
|
4447
4413
|
const themedElement = {
|
|
4448
4414
|
...element,
|
|
4449
4415
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
4450
4416
|
};
|
|
4451
|
-
return
|
|
4417
|
+
return chunkTDUDH7S4_js.buildChartViewModel(themedElement);
|
|
4452
4418
|
}
|
|
4453
4419
|
function renderPrimitive(prim, key) {
|
|
4454
4420
|
switch (prim.kind) {
|
|
@@ -4837,7 +4803,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4837
4803
|
const unmatchedRows = [];
|
|
4838
4804
|
categories.forEach((cat, i) => {
|
|
4839
4805
|
const value = values[i] ?? 0;
|
|
4840
|
-
const code =
|
|
4806
|
+
const code = chunkTDUDH7S4_js.resolveRegionCode(cat);
|
|
4841
4807
|
if (code) {
|
|
4842
4808
|
regionValueMap.set(code, { value, label: cat });
|
|
4843
4809
|
} else {
|
|
@@ -4875,8 +4841,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4875
4841
|
let fill = "#e2e8f0";
|
|
4876
4842
|
let dataLabel = null;
|
|
4877
4843
|
if (entry) {
|
|
4878
|
-
const t =
|
|
4879
|
-
fill =
|
|
4844
|
+
const t = chunkTDUDH7S4_js.normalizeValue(entry.value, minVal, maxVal);
|
|
4845
|
+
fill = chunkTDUDH7S4_js.sequentialColorScale(t);
|
|
4880
4846
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
4881
4847
|
"text",
|
|
4882
4848
|
{
|
|
@@ -4887,7 +4853,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4887
4853
|
fontWeight: 600,
|
|
4888
4854
|
fill: "#1e293b",
|
|
4889
4855
|
style: { pointerEvents: "none" },
|
|
4890
|
-
children:
|
|
4856
|
+
children: chunkTDUDH7S4_js.formatAxisValue(entry.value)
|
|
4891
4857
|
},
|
|
4892
4858
|
`${element.id}-map-dl-${region.code}`
|
|
4893
4859
|
);
|
|
@@ -4905,7 +4871,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4905
4871
|
opacity: 0.9,
|
|
4906
4872
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
4907
4873
|
region.name,
|
|
4908
|
-
entry ? `: ${
|
|
4874
|
+
entry ? `: ${chunkTDUDH7S4_js.formatAxisValue(entry.value)}` : ""
|
|
4909
4875
|
] })
|
|
4910
4876
|
}
|
|
4911
4877
|
),
|
|
@@ -4943,7 +4909,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4943
4909
|
fontSize: 7,
|
|
4944
4910
|
fill: "#64748b",
|
|
4945
4911
|
textAnchor: "middle",
|
|
4946
|
-
children:
|
|
4912
|
+
children: chunkTDUDH7S4_js.formatAxisValue(minVal)
|
|
4947
4913
|
},
|
|
4948
4914
|
`${element.id}-map-legend-min`
|
|
4949
4915
|
),
|
|
@@ -4955,7 +4921,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4955
4921
|
fontSize: 7,
|
|
4956
4922
|
fill: "#64748b",
|
|
4957
4923
|
textAnchor: "middle",
|
|
4958
|
-
children:
|
|
4924
|
+
children: chunkTDUDH7S4_js.formatAxisValue(maxVal)
|
|
4959
4925
|
},
|
|
4960
4926
|
`${element.id}-map-legend-max`
|
|
4961
4927
|
)
|
|
@@ -4974,7 +4940,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4974
4940
|
textAnchor: "middle",
|
|
4975
4941
|
fontSize: 7,
|
|
4976
4942
|
fill: "#94a3b8",
|
|
4977
|
-
children:
|
|
4943
|
+
children: chunkBXAK3JFM_js.translationsEn["pptx.chart.additionalRegionsFallback"]
|
|
4978
4944
|
},
|
|
4979
4945
|
`${element.id}-map-ft-hdr`
|
|
4980
4946
|
)
|
|
@@ -5021,7 +4987,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
5021
4987
|
y,
|
|
5022
4988
|
fontSize,
|
|
5023
4989
|
fill: "#475569",
|
|
5024
|
-
children:
|
|
4990
|
+
children: chunkTDUDH7S4_js.formatAxisValue(row.value)
|
|
5025
4991
|
},
|
|
5026
4992
|
`${element.id}-map-ft-val-${i}`
|
|
5027
4993
|
)
|
|
@@ -5092,7 +5058,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
5092
5058
|
|
|
5093
5059
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
5094
5060
|
function sColor(series, idx) {
|
|
5095
|
-
return
|
|
5061
|
+
return chunkTDUDH7S4_js.seriesColor(series, idx);
|
|
5096
5062
|
}
|
|
5097
5063
|
function valToY(val, range, topY, bottomY) {
|
|
5098
5064
|
const usable = bottomY - topY;
|
|
@@ -5631,7 +5597,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5631
5597
|
width: 10,
|
|
5632
5598
|
height: 10,
|
|
5633
5599
|
rx: 2,
|
|
5634
|
-
fill:
|
|
5600
|
+
fill: chunkTDUDH7S4_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5635
5601
|
},
|
|
5636
5602
|
`${id}-leg-r-${i}`
|
|
5637
5603
|
)
|
|
@@ -5655,7 +5621,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5655
5621
|
width: 10,
|
|
5656
5622
|
height: 10,
|
|
5657
5623
|
rx: 2,
|
|
5658
|
-
fill:
|
|
5624
|
+
fill: chunkTDUDH7S4_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5659
5625
|
}
|
|
5660
5626
|
),
|
|
5661
5627
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -5668,9 +5634,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5668
5634
|
}
|
|
5669
5635
|
const lines = [];
|
|
5670
5636
|
if (range.logScale && range.logBase) {
|
|
5671
|
-
const ticks =
|
|
5637
|
+
const ticks = chunkTDUDH7S4_js.generateLogTicks(range);
|
|
5672
5638
|
ticks.forEach((tickVal, i) => {
|
|
5673
|
-
const y =
|
|
5639
|
+
const y = chunkTDUDH7S4_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5674
5640
|
lines.push(
|
|
5675
5641
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5676
5642
|
"line",
|
|
@@ -5691,7 +5657,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5691
5657
|
const steps = 4;
|
|
5692
5658
|
for (let i = 0; i <= steps; i++) {
|
|
5693
5659
|
const val = range.min + range.span * i / steps;
|
|
5694
|
-
const y =
|
|
5660
|
+
const y = chunkTDUDH7S4_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5695
5661
|
lines.push(
|
|
5696
5662
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5697
5663
|
"line",
|
|
@@ -5715,9 +5681,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5715
5681
|
const labels = [];
|
|
5716
5682
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5717
5683
|
if (range.logScale && range.logBase) {
|
|
5718
|
-
const ticks =
|
|
5684
|
+
const ticks = chunkTDUDH7S4_js.generateLogTicks(range);
|
|
5719
5685
|
ticks.forEach((tickVal, i) => {
|
|
5720
|
-
const y =
|
|
5686
|
+
const y = chunkTDUDH7S4_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5721
5687
|
labels.push(
|
|
5722
5688
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5723
5689
|
"text",
|
|
@@ -5727,7 +5693,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5727
5693
|
textAnchor: "end",
|
|
5728
5694
|
fontSize: 8,
|
|
5729
5695
|
fill: "#64748b",
|
|
5730
|
-
children: hasDisplayUnits ?
|
|
5696
|
+
children: hasDisplayUnits ? chunkTDUDH7S4_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunkTDUDH7S4_js.formatAxisValue(tickVal)
|
|
5731
5697
|
},
|
|
5732
5698
|
`${id}-vaxis-log-${i}`
|
|
5733
5699
|
)
|
|
@@ -5737,7 +5703,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5737
5703
|
const steps = 4;
|
|
5738
5704
|
for (let i = 0; i <= steps; i++) {
|
|
5739
5705
|
const val = range.min + range.span * i / steps;
|
|
5740
|
-
const y =
|
|
5706
|
+
const y = chunkTDUDH7S4_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5741
5707
|
labels.push(
|
|
5742
5708
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5743
5709
|
"text",
|
|
@@ -5747,7 +5713,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5747
5713
|
textAnchor: "end",
|
|
5748
5714
|
fontSize: 8,
|
|
5749
5715
|
fill: "#64748b",
|
|
5750
|
-
children: hasDisplayUnits ?
|
|
5716
|
+
children: hasDisplayUnits ? chunkTDUDH7S4_js.formatAxisValueWithUnits(val, axisFormatting) : chunkTDUDH7S4_js.formatAxisValue(val)
|
|
5751
5717
|
},
|
|
5752
5718
|
`${id}-vaxis-${i}`
|
|
5753
5719
|
)
|
|
@@ -5755,7 +5721,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5755
5721
|
}
|
|
5756
5722
|
}
|
|
5757
5723
|
if (hasDisplayUnits) {
|
|
5758
|
-
const unitLabel =
|
|
5724
|
+
const unitLabel = chunkTDUDH7S4_js.getDisplayUnitLabel(
|
|
5759
5725
|
axisFormatting.displayUnits,
|
|
5760
5726
|
axisFormatting.displayUnitsLabel
|
|
5761
5727
|
);
|
|
@@ -5830,7 +5796,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
5830
5796
|
if (range.min >= 0) {
|
|
5831
5797
|
return null;
|
|
5832
5798
|
}
|
|
5833
|
-
const y =
|
|
5799
|
+
const y = chunkTDUDH7S4_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
5834
5800
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5835
5801
|
"line",
|
|
5836
5802
|
{
|
|
@@ -5854,7 +5820,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5854
5820
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5855
5821
|
for (let i = 0; i <= steps; i++) {
|
|
5856
5822
|
const val = range.min + range.span * i / steps;
|
|
5857
|
-
const y =
|
|
5823
|
+
const y = chunkTDUDH7S4_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5858
5824
|
labels.push(
|
|
5859
5825
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5860
5826
|
"text",
|
|
@@ -5866,7 +5832,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5866
5832
|
fontFamily,
|
|
5867
5833
|
fontWeight,
|
|
5868
5834
|
fill: fontColor,
|
|
5869
|
-
children: hasDisplayUnits ?
|
|
5835
|
+
children: hasDisplayUnits ? chunkTDUDH7S4_js.formatAxisValueWithUnits(val, axisFormatting) : chunkTDUDH7S4_js.formatAxisValue(val)
|
|
5870
5836
|
},
|
|
5871
5837
|
`${id}-sec-vaxis-${i}`
|
|
5872
5838
|
)
|
|
@@ -5890,7 +5856,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5890
5856
|
);
|
|
5891
5857
|
}
|
|
5892
5858
|
if (hasDisplayUnits) {
|
|
5893
|
-
const unitLabel =
|
|
5859
|
+
const unitLabel = chunkTDUDH7S4_js.getDisplayUnitLabel(
|
|
5894
5860
|
axisFormatting.displayUnits,
|
|
5895
5861
|
axisFormatting.displayUnitsLabel
|
|
5896
5862
|
);
|
|
@@ -5921,7 +5887,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
5921
5887
|
const ticks = [];
|
|
5922
5888
|
for (let i = 0; i <= steps; i++) {
|
|
5923
5889
|
const val = range.min + range.span * i / steps;
|
|
5924
|
-
const y =
|
|
5890
|
+
const y = chunkTDUDH7S4_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5925
5891
|
ticks.push(
|
|
5926
5892
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5927
5893
|
"line",
|
|
@@ -5948,7 +5914,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
5948
5914
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
5949
5915
|
for (let i = 0; i <= steps; i++) {
|
|
5950
5916
|
const val = range.min + range.span * i / steps;
|
|
5951
|
-
const y =
|
|
5917
|
+
const y = chunkTDUDH7S4_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5952
5918
|
lines.push(
|
|
5953
5919
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5954
5920
|
"line",
|
|
@@ -6066,7 +6032,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6066
6032
|
showK && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6067
6033
|
"th",
|
|
6068
6034
|
{
|
|
6069
|
-
"aria-label":
|
|
6035
|
+
"aria-label": chunkBXAK3JFM_js.translationsEn["pptx.chart.rowLabelsAria"],
|
|
6070
6036
|
style: {
|
|
6071
6037
|
padding: "1px 4px",
|
|
6072
6038
|
fontWeight: 400,
|
|
@@ -6110,7 +6076,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6110
6076
|
width: 8,
|
|
6111
6077
|
height: 8,
|
|
6112
6078
|
borderRadius: 2,
|
|
6113
|
-
backgroundColor:
|
|
6079
|
+
backgroundColor: chunkTDUDH7S4_js.seriesColor(
|
|
6114
6080
|
s,
|
|
6115
6081
|
si,
|
|
6116
6082
|
chartData.style?.styleId,
|
|
@@ -6149,8 +6115,8 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6149
6115
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
6150
6116
|
const style = chartData.style;
|
|
6151
6117
|
const legendPos = style?.legendPosition || "b";
|
|
6152
|
-
const range =
|
|
6153
|
-
const layout =
|
|
6118
|
+
const range = chunkTDUDH7S4_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6119
|
+
const layout = chunkTDUDH7S4_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6154
6120
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6155
6121
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
6156
6122
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -6171,10 +6137,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6171
6137
|
const close = closeSeries.values[ci] ?? high;
|
|
6172
6138
|
const isUp = close >= open;
|
|
6173
6139
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
6174
|
-
const highY =
|
|
6175
|
-
const lowY =
|
|
6176
|
-
const openY =
|
|
6177
|
-
const closeY =
|
|
6140
|
+
const highY = chunkTDUDH7S4_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
6141
|
+
const lowY = chunkTDUDH7S4_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
6142
|
+
const openY = chunkTDUDH7S4_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
6143
|
+
const closeY = chunkTDUDH7S4_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
|
|
6178
6144
|
elements.push(
|
|
6179
6145
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6180
6146
|
"line",
|
|
@@ -6217,7 +6183,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6217
6183
|
textAnchor: "middle",
|
|
6218
6184
|
fontSize: 7,
|
|
6219
6185
|
fill: "#334155",
|
|
6220
|
-
children:
|
|
6186
|
+
children: chunkTDUDH7S4_js.formatAxisValue(close)
|
|
6221
6187
|
},
|
|
6222
6188
|
`${element.id}-stock-dl-${ci}`
|
|
6223
6189
|
)
|
|
@@ -6259,7 +6225,7 @@ function FailedToLoad() {
|
|
|
6259
6225
|
var LazySurfaceChart3DScene = React6__default.default.lazy(
|
|
6260
6226
|
async () => {
|
|
6261
6227
|
try {
|
|
6262
|
-
return await import('./SurfaceChart3DScene-
|
|
6228
|
+
return await import('./SurfaceChart3DScene-4VCO3DRP.js');
|
|
6263
6229
|
} catch {
|
|
6264
6230
|
return { default: FailedToLoad };
|
|
6265
6231
|
}
|
|
@@ -6283,7 +6249,7 @@ var SurfaceChart3DErrorBoundary = class extends React6__default.default.Componen
|
|
|
6283
6249
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
6284
6250
|
const rows = chartData.series.length;
|
|
6285
6251
|
const cols = Math.max(categoryLabels.length, 1);
|
|
6286
|
-
const range =
|
|
6252
|
+
const range = chunkTDUDH7S4_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6287
6253
|
const heightMap = new Float32Array(rows * cols);
|
|
6288
6254
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
6289
6255
|
for (let r = 0; r < rows; r++) {
|
|
@@ -6403,8 +6369,8 @@ function darkenRgb(r, g, b, factor) {
|
|
|
6403
6369
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
6404
6370
|
const style = chartData.style;
|
|
6405
6371
|
const legendPos = style?.legendPosition || "b";
|
|
6406
|
-
const layout =
|
|
6407
|
-
const range =
|
|
6372
|
+
const layout = chunkTDUDH7S4_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6373
|
+
const range = chunkTDUDH7S4_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6408
6374
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6409
6375
|
const seriesCount = chartData.series.length;
|
|
6410
6376
|
const cols = catCount - 1;
|
|
@@ -6494,8 +6460,8 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6494
6460
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
6495
6461
|
const style = chartData.style;
|
|
6496
6462
|
const legendPos = style?.legendPosition || "b";
|
|
6497
|
-
const layout =
|
|
6498
|
-
const range =
|
|
6463
|
+
const layout = chunkTDUDH7S4_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6464
|
+
const range = chunkTDUDH7S4_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6499
6465
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6500
6466
|
const seriesCount = chartData.series.length;
|
|
6501
6467
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -6558,7 +6524,7 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6558
6524
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
6559
6525
|
const style = chartData.style;
|
|
6560
6526
|
const legendPos = style?.legendPosition || "b";
|
|
6561
|
-
const layout =
|
|
6527
|
+
const layout = chunkTDUDH7S4_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6562
6528
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
6563
6529
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
6564
6530
|
const rects = [];
|
|
@@ -6581,7 +6547,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
6581
6547
|
y: curY,
|
|
6582
6548
|
width: Math.max(w - 1, 1),
|
|
6583
6549
|
height: Math.max(h - 1, 1),
|
|
6584
|
-
fill:
|
|
6550
|
+
fill: chunkTDUDH7S4_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
6585
6551
|
rx: 2,
|
|
6586
6552
|
opacity: 0.85
|
|
6587
6553
|
},
|
|
@@ -6634,8 +6600,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6634
6600
|
const style = chartData.style;
|
|
6635
6601
|
const legendPos = style?.legendPosition || "b";
|
|
6636
6602
|
const values = chartData.series[0]?.values ?? [];
|
|
6637
|
-
const range =
|
|
6638
|
-
const layout =
|
|
6603
|
+
const range = chunkTDUDH7S4_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6604
|
+
const layout = chunkTDUDH7S4_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6639
6605
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
6640
6606
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
6641
6607
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -6646,8 +6612,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6646
6612
|
const isLast = i === values.length - 1;
|
|
6647
6613
|
const startVal = isLast ? 0 : runningTotal;
|
|
6648
6614
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
6649
|
-
const barStartY =
|
|
6650
|
-
const barEndY =
|
|
6615
|
+
const barStartY = chunkTDUDH7S4_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
6616
|
+
const barEndY = chunkTDUDH7S4_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
|
|
6651
6617
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
6652
6618
|
const y = Math.min(barStartY, barEndY);
|
|
6653
6619
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -6676,7 +6642,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6676
6642
|
textAnchor: "middle",
|
|
6677
6643
|
fontSize: 7,
|
|
6678
6644
|
fill: "#334155",
|
|
6679
|
-
children:
|
|
6645
|
+
children: chunkTDUDH7S4_js.formatAxisValue(isLast ? endVal : val)
|
|
6680
6646
|
},
|
|
6681
6647
|
`${element.id}-wf-dl-${i}`
|
|
6682
6648
|
)
|
|
@@ -6724,18 +6690,18 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6724
6690
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
6725
6691
|
const style = chartData.style;
|
|
6726
6692
|
const legendPos = style?.legendPosition || "b";
|
|
6727
|
-
const layoutOpts =
|
|
6693
|
+
const layoutOpts = chunkTDUDH7S4_js.computeLayoutOptions(
|
|
6728
6694
|
chartData.axes,
|
|
6729
6695
|
chartData.dataTable,
|
|
6730
6696
|
chartData.series.length
|
|
6731
6697
|
);
|
|
6732
|
-
const layout =
|
|
6733
|
-
const { primary, secondary } =
|
|
6698
|
+
const layout = chunkTDUDH7S4_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
6699
|
+
const { primary, secondary } = chunkTDUDH7S4_js.splitSeriesByAxis(chartData.series, chartData.axes);
|
|
6734
6700
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
6735
6701
|
const secondarySeries = secondary.map((e) => e.series);
|
|
6736
|
-
const range =
|
|
6737
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
6738
|
-
const secondaryAxisFmt =
|
|
6702
|
+
const range = chunkTDUDH7S4_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
6703
|
+
const secondaryRange = secondarySeries.length > 0 ? chunkTDUDH7S4_js.computeValueRange(secondarySeries) : void 0;
|
|
6704
|
+
const secondaryAxisFmt = chunkTDUDH7S4_js.getSecondaryValueAxis(chartData.axes);
|
|
6739
6705
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6740
6706
|
const barSeriesCount = 1;
|
|
6741
6707
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -6751,8 +6717,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6751
6717
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
6752
6718
|
barSeries.values.forEach((val, vi) => {
|
|
6753
6719
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
6754
|
-
const zeroY =
|
|
6755
|
-
const valY =
|
|
6720
|
+
const zeroY = chunkTDUDH7S4_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
6721
|
+
const valY = chunkTDUDH7S4_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
|
|
6756
6722
|
const y = Math.min(zeroY, valY);
|
|
6757
6723
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
6758
6724
|
barElements.push(
|
|
@@ -6763,7 +6729,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6763
6729
|
y,
|
|
6764
6730
|
width: barWidth,
|
|
6765
6731
|
height: h,
|
|
6766
|
-
fill:
|
|
6732
|
+
fill: chunkTDUDH7S4_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
6767
6733
|
rx: 1
|
|
6768
6734
|
},
|
|
6769
6735
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -6779,7 +6745,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6779
6745
|
textAnchor: "middle",
|
|
6780
6746
|
fontSize: 7,
|
|
6781
6747
|
fill: "#334155",
|
|
6782
|
-
children:
|
|
6748
|
+
children: chunkTDUDH7S4_js.formatAxisValue(val)
|
|
6783
6749
|
},
|
|
6784
6750
|
`${element.id}-combo-bar-dl-${vi}`
|
|
6785
6751
|
)
|
|
@@ -6796,10 +6762,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6796
6762
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
6797
6763
|
const points = series.values.map((val, vi) => {
|
|
6798
6764
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
6799
|
-
const y =
|
|
6765
|
+
const y = chunkTDUDH7S4_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
6800
6766
|
return { x, y, val };
|
|
6801
6767
|
});
|
|
6802
|
-
const c =
|
|
6768
|
+
const c = chunkTDUDH7S4_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
6803
6769
|
lineElements.push(
|
|
6804
6770
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6805
6771
|
"polyline",
|
|
@@ -6826,7 +6792,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6826
6792
|
textAnchor: "middle",
|
|
6827
6793
|
fontSize: 7,
|
|
6828
6794
|
fill: "#334155",
|
|
6829
|
-
children:
|
|
6795
|
+
children: chunkTDUDH7S4_js.formatAxisValue(p.val)
|
|
6830
6796
|
},
|
|
6831
6797
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
6832
6798
|
)
|
|
@@ -6864,11 +6830,11 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6864
6830
|
}
|
|
6865
6831
|
function renderChartElement(element) {
|
|
6866
6832
|
if (element.type !== "chart") {
|
|
6867
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
6833
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkBXAK3JFM_js.translationsEn["pptx.chart.heading"] });
|
|
6868
6834
|
}
|
|
6869
6835
|
const chartData = element.chartData;
|
|
6870
6836
|
if (!chartData || chartData.series.length === 0) {
|
|
6871
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
6837
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkBXAK3JFM_js.translationsEn["pptx.chart.heading"] });
|
|
6872
6838
|
}
|
|
6873
6839
|
const longestSeriesLength = chartData.series.reduce(
|
|
6874
6840
|
(maxLength, series) => Math.max(maxLength, series.values.length),
|
|
@@ -7972,14 +7938,14 @@ function buildNotesPdf(pages) {
|
|
|
7972
7938
|
notes: page.notes,
|
|
7973
7939
|
slideNumber: page.slideNumber
|
|
7974
7940
|
}));
|
|
7975
|
-
const bytes =
|
|
7941
|
+
const bytes = chunkTDUDH7S4_js.buildNotesPdfBytes(images, meta);
|
|
7976
7942
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
7977
7943
|
return URL.createObjectURL(blob);
|
|
7978
7944
|
}
|
|
7979
7945
|
|
|
7980
7946
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
7981
7947
|
function buildPdfFromImageData(images) {
|
|
7982
|
-
const bytes =
|
|
7948
|
+
const bytes = chunkTDUDH7S4_js.buildSlidesPdfBytes(images);
|
|
7983
7949
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
7984
7950
|
return URL.createObjectURL(blob);
|
|
7985
7951
|
}
|
|
@@ -7988,7 +7954,7 @@ function buildPdfFromImageData(images) {
|
|
|
7988
7954
|
var activePreview = null;
|
|
7989
7955
|
function startPreviewAnimation(elementId, preset, options) {
|
|
7990
7956
|
stopPreviewAnimation();
|
|
7991
|
-
const descriptor =
|
|
7957
|
+
const descriptor = chunkTDUDH7S4_js.buildPreviewAnimation(preset, options);
|
|
7992
7958
|
if (!descriptor) {
|
|
7993
7959
|
return;
|
|
7994
7960
|
}
|
|
@@ -8001,7 +7967,7 @@ function startMotionPathPreview(elementId, path, options) {
|
|
|
8001
7967
|
return;
|
|
8002
7968
|
}
|
|
8003
7969
|
const stage = domEl.offsetParent;
|
|
8004
|
-
const descriptor =
|
|
7970
|
+
const descriptor = chunkTDUDH7S4_js.buildMotionPathPreview({
|
|
8005
7971
|
path,
|
|
8006
7972
|
slideWidth: stage?.offsetWidth || DEFAULT_PREVIEW_SLIDE_WIDTH,
|
|
8007
7973
|
slideHeight: stage?.offsetHeight || DEFAULT_PREVIEW_SLIDE_HEIGHT,
|