pptx-react-viewer 2.3.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/{AiChatPanel-PXZYHJUB.mjs → AiChatPanel-EMF3UYCE.mjs} +4 -5
- package/dist/AiChatPanel-EMF3UYCE.mjs.br +0 -0
- package/dist/AiChatPanel-EMF3UYCE.mjs.gz +0 -0
- package/dist/{AiChatPanel-HC3CE3TL.js → AiChatPanel-OHSLJNYG.js} +23 -24
- package/dist/AiChatPanel-OHSLJNYG.js.br +0 -0
- package/dist/AiChatPanel-OHSLJNYG.js.gz +0 -0
- package/dist/{Model3DScene-37QZRHV5.js → Model3DScene-ULHIJPMU.js} +2 -3
- package/dist/Model3DScene-ULHIJPMU.js.br +0 -0
- package/dist/Model3DScene-ULHIJPMU.js.gz +0 -0
- package/dist/{Model3DScene-ZG4HTMPX.mjs → Model3DScene-X6QJTWHV.mjs} +1 -2
- package/dist/Model3DScene-X6QJTWHV.mjs.br +0 -0
- package/dist/Model3DScene-X6QJTWHV.mjs.gz +0 -0
- package/dist/{PowerPointViewer-gmU5rc7K.d.ts → PowerPointViewer-Cjn1RgSz.d.ts} +2 -2
- package/dist/{PowerPointViewer-gmU5rc7K.d.ts.map → PowerPointViewer-Cjn1RgSz.d.ts.map} +1 -1
- package/dist/{SurfaceChart3DScene-QIREQ66D.js → SurfaceChart3DScene-K7Q5NYZ4.js} +2 -3
- package/dist/SurfaceChart3DScene-K7Q5NYZ4.js.br +0 -0
- package/dist/SurfaceChart3DScene-K7Q5NYZ4.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-Z7R6DZXN.mjs → SurfaceChart3DScene-PRCKQJQQ.mjs} +1 -2
- package/dist/SurfaceChart3DScene-PRCKQJQQ.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-PRCKQJQQ.mjs.gz +0 -0
- package/dist/audience-content-store-BMlth_3U.d.ts +386 -0
- package/dist/audience-content-store-BMlth_3U.d.ts.map +1 -0
- package/dist/{chunk-YIFO3WQO.js → chunk-25VSL2BB.js} +1 -0
- package/dist/chunk-25VSL2BB.js.br +0 -0
- package/dist/chunk-25VSL2BB.js.gz +0 -0
- package/dist/{chunk-L7JNCVTF.js → chunk-7Q7AEPO7.js} +384 -332
- package/dist/chunk-7Q7AEPO7.js.br +0 -0
- package/dist/chunk-7Q7AEPO7.js.gz +0 -0
- package/dist/{chunk-ZLSVW5GP.js → chunk-I4AFCPUC.js} +876 -882
- package/dist/chunk-I4AFCPUC.js.br +0 -0
- package/dist/chunk-I4AFCPUC.js.gz +0 -0
- package/dist/{chunk-J5A22DZ7.mjs → chunk-JSFUU2BB.mjs} +36 -42
- package/dist/chunk-JSFUU2BB.mjs.br +0 -0
- package/dist/chunk-JSFUU2BB.mjs.gz +0 -0
- package/dist/{chunk-I5LEMC5C.mjs → chunk-LIQGO45T.mjs} +74 -22
- package/dist/chunk-LIQGO45T.mjs.br +0 -0
- package/dist/chunk-LIQGO45T.mjs.gz +0 -0
- package/dist/{chunk-JFNMD6TM.mjs → chunk-LTEDT475.js} +48579 -31703
- package/dist/chunk-LTEDT475.js.br +0 -0
- package/dist/chunk-LTEDT475.js.gz +0 -0
- package/dist/{chunk-EUIFPDXZ.js → chunk-MJAEB43A.js} +3 -3
- package/dist/chunk-MJAEB43A.js.br +0 -0
- package/dist/chunk-MJAEB43A.js.gz +0 -0
- package/dist/{chunk-P7UVBRFO.js → chunk-NVH3RIN7.js} +282 -291
- package/dist/chunk-NVH3RIN7.js.br +0 -0
- package/dist/chunk-NVH3RIN7.js.gz +0 -0
- package/dist/{chunk-VOHTAUN4.mjs → chunk-TGVID6BB.mjs} +41 -50
- package/dist/chunk-TGVID6BB.mjs.br +0 -0
- package/dist/chunk-TGVID6BB.mjs.gz +0 -0
- package/dist/{chunk-3TB45PVK.js → chunk-VOV2N3NY.mjs} +48075 -32275
- package/dist/chunk-VOV2N3NY.mjs.br +0 -0
- package/dist/chunk-VOV2N3NY.mjs.gz +0 -0
- package/dist/{chunk-M5YR3QSB.mjs → chunk-WJKMTDXS.mjs} +1 -1
- package/dist/chunk-WJKMTDXS.mjs.br +0 -0
- package/dist/chunk-WJKMTDXS.mjs.gz +0 -0
- package/dist/{chunk-PZTPX3HK.mjs → chunk-Z6HIZWIQ.mjs} +1 -0
- package/dist/chunk-Z6HIZWIQ.mjs.br +0 -0
- package/dist/chunk-Z6HIZWIQ.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.d.ts +112 -87
- package/dist/index.js +39 -40
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +6 -7
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +563 -514
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +79 -81
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +4 -6
- 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/{animation-timeline-eb5z0SHW.d.ts → types-DciBT90G.d.ts} +4 -3
- package/dist/types-DciBT90G.d.ts.map +1 -0
- package/dist/{useViewerBuildingBlocks-CjureTRf.d.ts → useViewerBuildingBlocks-DMDZRawe.d.ts} +4 -4
- package/dist/{useViewerBuildingBlocks-CjureTRf.d.ts.map → useViewerBuildingBlocks-DMDZRawe.d.ts.map} +1 -1
- package/dist/viewer/index.d.ts +112 -88
- package/dist/viewer/index.js +22 -24
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +6 -8
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +4 -4
- package/dist/AiChatPanel-HC3CE3TL.js.br +0 -0
- package/dist/AiChatPanel-HC3CE3TL.js.gz +0 -0
- package/dist/AiChatPanel-PXZYHJUB.mjs.br +0 -0
- package/dist/AiChatPanel-PXZYHJUB.mjs.gz +0 -0
- package/dist/Model3DScene-37QZRHV5.js.br +0 -0
- package/dist/Model3DScene-37QZRHV5.js.gz +0 -0
- package/dist/Model3DScene-ZG4HTMPX.mjs.br +0 -0
- package/dist/Model3DScene-ZG4HTMPX.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-QIREQ66D.js.br +0 -0
- package/dist/SurfaceChart3DScene-QIREQ66D.js.gz +0 -0
- package/dist/SurfaceChart3DScene-Z7R6DZXN.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-Z7R6DZXN.mjs.gz +0 -0
- package/dist/animation-timeline-eb5z0SHW.d.ts.map +0 -1
- package/dist/chunk-3TB45PVK.js.br +0 -0
- package/dist/chunk-3TB45PVK.js.gz +0 -0
- package/dist/chunk-4AAFZFGH.mjs +0 -27633
- package/dist/chunk-4AAFZFGH.mjs.br +0 -0
- package/dist/chunk-4AAFZFGH.mjs.gz +0 -0
- package/dist/chunk-EUIFPDXZ.js.br +0 -0
- package/dist/chunk-EUIFPDXZ.js.gz +0 -0
- package/dist/chunk-I5LEMC5C.mjs.br +0 -0
- package/dist/chunk-I5LEMC5C.mjs.gz +0 -0
- package/dist/chunk-IKBO6CZC.js +0 -2
- package/dist/chunk-IKBO6CZC.js.br +0 -3
- package/dist/chunk-IKBO6CZC.js.gz +0 -0
- package/dist/chunk-J5A22DZ7.mjs.br +0 -0
- package/dist/chunk-J5A22DZ7.mjs.gz +0 -0
- package/dist/chunk-JFNMD6TM.mjs.br +0 -0
- package/dist/chunk-JFNMD6TM.mjs.gz +0 -0
- package/dist/chunk-KDW3LLG5.js +0 -28067
- package/dist/chunk-KDW3LLG5.js.br +0 -0
- package/dist/chunk-KDW3LLG5.js.gz +0 -0
- package/dist/chunk-L7JNCVTF.js.br +0 -0
- package/dist/chunk-L7JNCVTF.js.gz +0 -0
- package/dist/chunk-M5YR3QSB.mjs.br +0 -0
- package/dist/chunk-M5YR3QSB.mjs.gz +0 -0
- package/dist/chunk-P7UVBRFO.js.br +0 -0
- package/dist/chunk-P7UVBRFO.js.gz +0 -0
- package/dist/chunk-PZTPX3HK.mjs.br +0 -0
- package/dist/chunk-PZTPX3HK.mjs.gz +0 -0
- package/dist/chunk-T5U6P2JH.mjs +0 -1
- package/dist/chunk-T5U6P2JH.mjs.br +0 -0
- package/dist/chunk-T5U6P2JH.mjs.gz +0 -0
- package/dist/chunk-VOHTAUN4.mjs.br +0 -0
- package/dist/chunk-VOHTAUN4.mjs.gz +0 -0
- package/dist/chunk-YIFO3WQO.js.br +0 -0
- package/dist/chunk-YIFO3WQO.js.gz +0 -0
- package/dist/chunk-ZLSVW5GP.js.br +0 -0
- package/dist/chunk-ZLSVW5GP.js.gz +0 -0
- package/dist/dist-FTEVZZPM.js +0 -2283
- package/dist/dist-FTEVZZPM.js.br +0 -0
- package/dist/dist-FTEVZZPM.js.gz +0 -0
- package/dist/dist-L7GZVBMG.mjs +0 -2
- package/dist/dist-L7GZVBMG.mjs.br +0 -0
- package/dist/dist-L7GZVBMG.mjs.gz +0 -0
- package/dist/index-CDCSXtK3.d.ts +0 -685
- package/dist/index-CDCSXtK3.d.ts.map +0 -1
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var chunk3TB45PVK_js = require('./chunk-3TB45PVK.js');
|
|
3
|
+
var chunk25VSL2BB_js = require('./chunk-25VSL2BB.js');
|
|
4
|
+
var chunkLTEDT475_js = require('./chunk-LTEDT475.js');
|
|
6
5
|
var clsx = require('clsx');
|
|
7
6
|
var tailwindMerge = require('tailwind-merge');
|
|
8
7
|
var React6 = require('react');
|
|
@@ -16,7 +15,7 @@ var React6__default = /*#__PURE__*/_interopDefault(React6);
|
|
|
16
15
|
|
|
17
16
|
// src/viewer/utils/animation-effects.ts
|
|
18
17
|
function getAnimationInitialStyle2(preset, nativeAnimation) {
|
|
19
|
-
return
|
|
18
|
+
return chunkLTEDT475_js.getAnimationInitialStyle(preset, nativeAnimation);
|
|
20
19
|
}
|
|
21
20
|
function cn(...inputs) {
|
|
22
21
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
@@ -24,7 +23,7 @@ function cn(...inputs) {
|
|
|
24
23
|
|
|
25
24
|
// src/viewer/utils/clone.ts
|
|
26
25
|
function cloneHistorySnapshot2(snapshot) {
|
|
27
|
-
return
|
|
26
|
+
return chunkLTEDT475_js.cloneHistorySnapshot(snapshot);
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
// src/viewer/constants/scalar.ts
|
|
@@ -134,7 +133,7 @@ var GLYPH_COMPONENTS = {
|
|
|
134
133
|
plus: lu.LuPlus,
|
|
135
134
|
triangle: lu.LuTriangle
|
|
136
135
|
};
|
|
137
|
-
var SHAPE_PRESETS =
|
|
136
|
+
var SHAPE_PRESETS = chunkLTEDT475_js.SHAPE_PRESET_DEFS.map(
|
|
138
137
|
(def) => ({
|
|
139
138
|
type: def.type,
|
|
140
139
|
label: def.label,
|
|
@@ -252,7 +251,7 @@ function isConnectorOrLineElement(element) {
|
|
|
252
251
|
if (element.type === "connector") {
|
|
253
252
|
return true;
|
|
254
253
|
}
|
|
255
|
-
if (!
|
|
254
|
+
if (!chunkLTEDT475_js.hasShapeProperties(element)) {
|
|
256
255
|
return false;
|
|
257
256
|
}
|
|
258
257
|
const st = getShapeType(element.shapeType);
|
|
@@ -263,12 +262,12 @@ function isConnectorOrLineElement(element) {
|
|
|
263
262
|
function partitionTemplateElements(slides) {
|
|
264
263
|
const templateElementsBySlideId = {};
|
|
265
264
|
const nextSlides = slides.map((slide) => {
|
|
266
|
-
const template = slide.elements.filter((el) =>
|
|
265
|
+
const template = slide.elements.filter((el) => chunkLTEDT475_js.isTemplateElement(el));
|
|
267
266
|
if (template.length === 0) {
|
|
268
267
|
return slide;
|
|
269
268
|
}
|
|
270
269
|
templateElementsBySlideId[slide.id] = template;
|
|
271
|
-
return { ...slide, elements: slide.elements.filter((el) => !
|
|
270
|
+
return { ...slide, elements: slide.elements.filter((el) => !chunkLTEDT475_js.isTemplateElement(el)) };
|
|
272
271
|
});
|
|
273
272
|
return { slides: nextSlides, templateElementsBySlideId };
|
|
274
273
|
}
|
|
@@ -284,7 +283,7 @@ function buildSaveSlides(slides, templateElementsBySlideId) {
|
|
|
284
283
|
|
|
285
284
|
// src/viewer/utils/image-style.ts
|
|
286
285
|
function getImageMaskStyle(element) {
|
|
287
|
-
if (!
|
|
286
|
+
if (!chunkLTEDT475_js.hasShapeProperties(element)) {
|
|
288
287
|
return void 0;
|
|
289
288
|
}
|
|
290
289
|
const shapeType = element.shapeType;
|
|
@@ -293,7 +292,7 @@ function getImageMaskStyle(element) {
|
|
|
293
292
|
}
|
|
294
293
|
const normalized = shapeType.toLowerCase();
|
|
295
294
|
if (normalized === "roundrect" || normalized === "round1rect" || normalized === "round2samerect" || normalized === "round2diagrect" || normalized === "sniproundrect" || normalized === "snip1rect" || normalized === "snip2diagrect") {
|
|
296
|
-
const radiusPx =
|
|
295
|
+
const radiusPx = chunkLTEDT475_js.getRoundRectRadiusPx(element);
|
|
297
296
|
if (radiusPx <= 0.01) {
|
|
298
297
|
return void 0;
|
|
299
298
|
}
|
|
@@ -305,7 +304,7 @@ function getImageMaskStyle(element) {
|
|
|
305
304
|
if (normalized === "can" || normalized === "cylinder") {
|
|
306
305
|
return { borderRadius: "48% / 12%" };
|
|
307
306
|
}
|
|
308
|
-
const clipPath =
|
|
307
|
+
const clipPath = chunkLTEDT475_js.getResolvedShapeClipPath(element);
|
|
309
308
|
if (!clipPath) {
|
|
310
309
|
return void 0;
|
|
311
310
|
}
|
|
@@ -313,7 +312,7 @@ function getImageMaskStyle(element) {
|
|
|
313
312
|
}
|
|
314
313
|
function getImageRenderStyle(element) {
|
|
315
314
|
const maskStyle = getImageMaskStyle(element) || {};
|
|
316
|
-
if (!
|
|
315
|
+
if (!chunkLTEDT475_js.isImageLikeElement(element)) {
|
|
317
316
|
return {
|
|
318
317
|
...maskStyle,
|
|
319
318
|
width: "100%",
|
|
@@ -321,10 +320,10 @@ function getImageRenderStyle(element) {
|
|
|
321
320
|
objectFit: "cover"
|
|
322
321
|
};
|
|
323
322
|
}
|
|
324
|
-
const cropLeft =
|
|
325
|
-
const cropTop =
|
|
326
|
-
const cropRight =
|
|
327
|
-
const cropBottom =
|
|
323
|
+
const cropLeft = chunkLTEDT475_js.clampCropValue(element.cropLeft);
|
|
324
|
+
const cropTop = chunkLTEDT475_js.clampCropValue(element.cropTop);
|
|
325
|
+
const cropRight = chunkLTEDT475_js.clampCropValue(element.cropRight);
|
|
326
|
+
const cropBottom = chunkLTEDT475_js.clampCropValue(element.cropBottom);
|
|
328
327
|
const hasCrop = cropLeft + cropRight > 1e-4 || cropTop + cropBottom > 1e-4;
|
|
329
328
|
if (!hasCrop) {
|
|
330
329
|
return {
|
|
@@ -336,10 +335,10 @@ function getImageRenderStyle(element) {
|
|
|
336
335
|
}
|
|
337
336
|
const safeHorizontalScale = cropLeft + cropRight >= 0.99 ? 0.99 / (cropLeft + cropRight) : 1;
|
|
338
337
|
const safeVerticalScale = cropTop + cropBottom >= 0.99 ? 0.99 / (cropTop + cropBottom) : 1;
|
|
339
|
-
const normalizedLeft =
|
|
340
|
-
const normalizedRight =
|
|
341
|
-
const normalizedTop =
|
|
342
|
-
const normalizedBottom =
|
|
338
|
+
const normalizedLeft = chunkLTEDT475_js.clampCropValue(cropLeft * safeHorizontalScale);
|
|
339
|
+
const normalizedRight = chunkLTEDT475_js.clampCropValue(cropRight * safeHorizontalScale);
|
|
340
|
+
const normalizedTop = chunkLTEDT475_js.clampCropValue(cropTop * safeVerticalScale);
|
|
341
|
+
const normalizedBottom = chunkLTEDT475_js.clampCropValue(cropBottom * safeVerticalScale);
|
|
343
342
|
const remainingWidth = Math.max(0.01, 1 - normalizedLeft - normalizedRight);
|
|
344
343
|
const remainingHeight = Math.max(0.01, 1 - normalizedTop - normalizedBottom);
|
|
345
344
|
const tx = Math.round(-normalizedLeft / remainingWidth * 1e4) / 100;
|
|
@@ -368,7 +367,7 @@ var CROP_SHAPE_CLIP_PATHS = {
|
|
|
368
367
|
star: "polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)"
|
|
369
368
|
};
|
|
370
369
|
function getCropShapeClipPath(element) {
|
|
371
|
-
if (!
|
|
370
|
+
if (!chunkLTEDT475_js.isImageLikeElement(element)) {
|
|
372
371
|
return void 0;
|
|
373
372
|
}
|
|
374
373
|
const shape = element.cropShape;
|
|
@@ -378,7 +377,7 @@ function getCropShapeClipPath(element) {
|
|
|
378
377
|
return CROP_SHAPE_CLIP_PATHS[shape];
|
|
379
378
|
}
|
|
380
379
|
function isImageTiled(element) {
|
|
381
|
-
if (!
|
|
380
|
+
if (!chunkLTEDT475_js.isImageLikeElement(element)) {
|
|
382
381
|
return false;
|
|
383
382
|
}
|
|
384
383
|
return typeof element.tileScaleX === "number" || typeof element.tileScaleY === "number";
|
|
@@ -436,7 +435,7 @@ function buildMirrorTiledBackground(src, flip, scaleX, scaleY) {
|
|
|
436
435
|
};
|
|
437
436
|
}
|
|
438
437
|
function getImageTilingStyle(element) {
|
|
439
|
-
if (!
|
|
438
|
+
if (!chunkLTEDT475_js.isImageLikeElement(element) || !isImageTiled(element)) {
|
|
440
439
|
return void 0;
|
|
441
440
|
}
|
|
442
441
|
const scaleX = typeof element.tileScaleX === "number" ? element.tileScaleX * 100 : 100;
|
|
@@ -720,7 +719,7 @@ function executeMediaCommand(command) {
|
|
|
720
719
|
if (!el) {
|
|
721
720
|
return false;
|
|
722
721
|
}
|
|
723
|
-
const parsed =
|
|
722
|
+
const parsed = chunkLTEDT475_js.parseMediaCommand(command.command);
|
|
724
723
|
if (!parsed) {
|
|
725
724
|
return false;
|
|
726
725
|
}
|
|
@@ -991,7 +990,7 @@ function PresentationMediaController({
|
|
|
991
990
|
}
|
|
992
991
|
function renderMediaElement(element, mediaDataUrls, options) {
|
|
993
992
|
if (element.type !== "media") {
|
|
994
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
993
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunk25VSL2BB_js.translationsEn["pptx.media.title"] });
|
|
995
994
|
}
|
|
996
995
|
const mediaType = element.mediaType;
|
|
997
996
|
const mediaPath = element.mediaPath;
|
|
@@ -1021,7 +1020,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1021
1020
|
"img",
|
|
1022
1021
|
{
|
|
1023
1022
|
src: posterUrl,
|
|
1024
|
-
alt:
|
|
1023
|
+
alt: chunk25VSL2BB_js.translationsEn["pptx.media.posterAlt"],
|
|
1025
1024
|
className: "w-full h-full object-contain opacity-50"
|
|
1026
1025
|
}
|
|
1027
1026
|
),
|
|
@@ -1042,7 +1041,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1042
1041
|
]
|
|
1043
1042
|
}
|
|
1044
1043
|
),
|
|
1045
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children:
|
|
1044
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: chunk25VSL2BB_js.translationsEn["pptx.media.notFound"] })
|
|
1046
1045
|
] })
|
|
1047
1046
|
] });
|
|
1048
1047
|
}
|
|
@@ -1083,7 +1082,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1083
1082
|
"img",
|
|
1084
1083
|
{
|
|
1085
1084
|
src: posterUrl,
|
|
1086
|
-
alt:
|
|
1085
|
+
alt: chunk25VSL2BB_js.translationsEn["pptx.media.videoPosterAlt"],
|
|
1087
1086
|
className: "w-full h-full object-contain"
|
|
1088
1087
|
}
|
|
1089
1088
|
),
|
|
@@ -1172,7 +1171,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1172
1171
|
|
|
1173
1172
|
// src/viewer/utils/text-utils.tsx
|
|
1174
1173
|
function getTextStyleForElement(element, fallbackColor) {
|
|
1175
|
-
if (!
|
|
1174
|
+
if (!chunkLTEDT475_js.hasTextProperties(element)) {
|
|
1176
1175
|
return { color: fallbackColor };
|
|
1177
1176
|
}
|
|
1178
1177
|
const textDecorationTokens = [];
|
|
@@ -1186,20 +1185,20 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
1186
1185
|
const textDecorationStyle = isDoubleStrike ? "double" : void 0;
|
|
1187
1186
|
const hasItalicRuns = element.textStyle?.italic || Boolean(element.textSegments?.some((segment) => segment.style?.italic));
|
|
1188
1187
|
const isRtl = element.textStyle?.rtl === true;
|
|
1189
|
-
const resolvedTextColor = element.textStyle?.hyperlink ?
|
|
1188
|
+
const resolvedTextColor = element.textStyle?.hyperlink ? chunkLTEDT475_js.normalizeHexColor(element.textStyle?.color, HYPERLINK_COLOR) : chunkLTEDT475_js.normalizeHexColor(element.textStyle?.color, fallbackColor);
|
|
1190
1189
|
const bodyTop = element.textStyle?.bodyInsetTop ?? DEFAULT_BODY_INSET_TB_PX;
|
|
1191
1190
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
1192
1191
|
const bodyLeft = element.textStyle?.bodyInsetLeft ?? DEFAULT_BODY_INSET_LR_PX;
|
|
1193
1192
|
const bodyRight = element.textStyle?.bodyInsetRight ?? DEFAULT_BODY_INSET_LR_PX;
|
|
1194
|
-
const writingMode =
|
|
1195
|
-
const textOrientation =
|
|
1196
|
-
const verticalDirection =
|
|
1193
|
+
const writingMode = chunkLTEDT475_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
1194
|
+
const textOrientation = chunkLTEDT475_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
1195
|
+
const verticalDirection = chunkLTEDT475_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
1197
1196
|
const resolvedDirection = verticalDirection || (isRtl ? "rtl" : "ltr");
|
|
1198
1197
|
const resolvedUnicodeBidi = isRtl ? "plaintext" : void 0;
|
|
1199
1198
|
const hasSegments = (element.textSegments?.length ?? 0) > 0;
|
|
1200
1199
|
return {
|
|
1201
1200
|
color: resolvedTextColor,
|
|
1202
|
-
backgroundColor: !hasSegments && element.textStyle?.highlightColor ?
|
|
1201
|
+
backgroundColor: !hasSegments && element.textStyle?.highlightColor ? chunkLTEDT475_js.normalizeHexColor(element.textStyle.highlightColor, void 0) : void 0,
|
|
1203
1202
|
textAlign: (() => {
|
|
1204
1203
|
const a = element.textStyle?.align;
|
|
1205
1204
|
if (a === "justLow" || a === "dist" || a === "thaiDist") {
|
|
@@ -1215,7 +1214,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
1215
1214
|
textDecorationLine: textDecorationTokens.length > 0 ? textDecorationTokens.join(" ") : "none",
|
|
1216
1215
|
textDecorationStyle,
|
|
1217
1216
|
fontFamily: element.textStyle?.fontFamily || DEFAULT_FONT_FAMILY,
|
|
1218
|
-
lineHeight:
|
|
1217
|
+
lineHeight: chunkLTEDT475_js.resolveLineHeight(element.textStyle, hasItalicRuns),
|
|
1219
1218
|
paddingTop: bodyTop + (hasItalicRuns ? 1 : 0),
|
|
1220
1219
|
paddingBottom: bodyBottom + (hasItalicRuns ? 1 : 0),
|
|
1221
1220
|
paddingLeft: bodyLeft + (element.textStyle?.paragraphMarginLeft || 0),
|
|
@@ -1228,7 +1227,7 @@ function getTextStyleForElement(element, fallbackColor) {
|
|
|
1228
1227
|
// Auto-fit: use OOXML-provided fontScale/lnSpcReduction when available,
|
|
1229
1228
|
// otherwise fall back to heuristic estimation. The pure font-scale maths
|
|
1230
1229
|
// now lives in pptx-viewer-shared (computeAutoFitTextStyle).
|
|
1231
|
-
...
|
|
1230
|
+
...chunkLTEDT475_js.computeAutoFitTextStyle({
|
|
1232
1231
|
textStyle: element.textStyle,
|
|
1233
1232
|
text: element.text ?? "",
|
|
1234
1233
|
width: element.width,
|
|
@@ -1262,13 +1261,13 @@ function computeTabSize(tabStops, defaultTabSize) {
|
|
|
1262
1261
|
return avgGap > 0 ? `${Math.round(avgGap)}px` : fromDefault;
|
|
1263
1262
|
}
|
|
1264
1263
|
function getTextLayoutStyle(element) {
|
|
1265
|
-
if (!
|
|
1264
|
+
if (!chunkLTEDT475_js.hasTextProperties(element)) {
|
|
1266
1265
|
return {};
|
|
1267
1266
|
}
|
|
1268
1267
|
const verticalAlign = element.textStyle?.vAlign || "top";
|
|
1269
|
-
const writingMode =
|
|
1270
|
-
const textOrientation =
|
|
1271
|
-
const verticalDirection =
|
|
1268
|
+
const writingMode = chunkLTEDT475_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
1269
|
+
const textOrientation = chunkLTEDT475_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
1270
|
+
const verticalDirection = chunkLTEDT475_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
1272
1271
|
const parsedColumnCount = Number(element.textStyle?.columnCount);
|
|
1273
1272
|
const columnCount = Number.isFinite(parsedColumnCount) ? Math.max(1, Math.min(16, Math.round(parsedColumnCount))) : 1;
|
|
1274
1273
|
const hasColumns = columnCount > 1;
|
|
@@ -1276,7 +1275,7 @@ function getTextLayoutStyle(element) {
|
|
|
1276
1275
|
const tabStops = element.textStyle?.tabStops;
|
|
1277
1276
|
const tabSize = computeTabSize(tabStops, element.textStyle?.defaultTabSize);
|
|
1278
1277
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
1279
|
-
const hasParagraphIndents =
|
|
1278
|
+
const hasParagraphIndents = chunkLTEDT475_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
1280
1279
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
1281
1280
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
1282
1281
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
@@ -1285,7 +1284,7 @@ function getTextLayoutStyle(element) {
|
|
|
1285
1284
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
1286
1285
|
const parsedColumnSpacing = Number(element.textStyle?.columnSpacing);
|
|
1287
1286
|
const columnGap = Number.isFinite(parsedColumnSpacing) && parsedColumnSpacing > 0 ? `${parsedColumnSpacing}px` : "0.75em";
|
|
1288
|
-
const kinsokuStyles =
|
|
1287
|
+
const kinsokuStyles = chunkLTEDT475_js.getKinsokuLineBreakStyles(element.textStyle);
|
|
1289
1288
|
if (hasColumns) {
|
|
1290
1289
|
return {
|
|
1291
1290
|
display: "block",
|
|
@@ -1332,10 +1331,10 @@ function getTextLayoutStyle(element) {
|
|
|
1332
1331
|
|
|
1333
1332
|
// src/viewer/utils/text-effects.tsx
|
|
1334
1333
|
function buildTextFillCss2(style) {
|
|
1335
|
-
return
|
|
1334
|
+
return chunkLTEDT475_js.buildTextFillCss(style);
|
|
1336
1335
|
}
|
|
1337
1336
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
1338
|
-
return
|
|
1337
|
+
return chunkLTEDT475_js.buildTextBody3DSceneStyle(textStyle);
|
|
1339
1338
|
}
|
|
1340
1339
|
|
|
1341
1340
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -1516,63 +1515,40 @@ function buildAnimStyle(state) {
|
|
|
1516
1515
|
}
|
|
1517
1516
|
return Object.keys(style).length > 0 ? style : void 0;
|
|
1518
1517
|
}
|
|
1519
|
-
function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, paraSegments, subElementAnimStates) {
|
|
1518
|
+
function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, paraSegments, subElementAnimStates, renderPiece) {
|
|
1520
1519
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
1521
1520
|
return renderedSegments;
|
|
1522
1521
|
}
|
|
1523
|
-
const paraKey = `${elementId}${
|
|
1522
|
+
const paraKey = `${elementId}${chunkLTEDT475_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
1524
1523
|
const paraState = subElementAnimStates.get(paraKey);
|
|
1525
1524
|
if (paraState) {
|
|
1526
1525
|
const style = buildAnimStyle(paraState);
|
|
1527
1526
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
1528
1527
|
}
|
|
1529
|
-
const
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1528
|
+
const spec = chunkLTEDT475_js.buildTextBuildSpec(
|
|
1529
|
+
elementId,
|
|
1530
|
+
paraIndex,
|
|
1531
|
+
paraSegments.map((entry) => ({ text: entry.segment.text, style: entry })),
|
|
1532
|
+
subElementAnimStates
|
|
1533
|
+
);
|
|
1534
|
+
if (!spec?.spans) {
|
|
1535
|
+
return renderedSegments;
|
|
1536
1536
|
}
|
|
1537
|
-
return
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
const words = fullText.split(/(\s+)/);
|
|
1542
|
-
let wordIdx = 0;
|
|
1543
|
-
const nodes = [];
|
|
1544
|
-
for (let i = 0; i < words.length; i++) {
|
|
1545
|
-
const w = words[i];
|
|
1546
|
-
if (!w) {
|
|
1547
|
-
continue;
|
|
1548
|
-
}
|
|
1549
|
-
const isWhitespace = /^\s+$/.test(w);
|
|
1550
|
-
if (isWhitespace) {
|
|
1551
|
-
nodes.push(/* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Fragment, { children: w }, `ws-${i}`));
|
|
1552
|
-
continue;
|
|
1537
|
+
return spec.spans.map((span, index) => {
|
|
1538
|
+
const content = span.style && renderPiece ? renderPiece(span.style, span.text) : span.text;
|
|
1539
|
+
if (!span.animId) {
|
|
1540
|
+
return /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Fragment, { children: content }, `ws-${index}`);
|
|
1553
1541
|
}
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
return nodes;
|
|
1563
|
-
}
|
|
1564
|
-
function wrapByChar(elementId, paraIndex, paraSegments, states) {
|
|
1565
|
-
const fullText = paraSegments.map((e) => e.segment.text).join("");
|
|
1566
|
-
const nodes = [];
|
|
1567
|
-
for (let i = 0; i < fullText.length; i++) {
|
|
1568
|
-
const key = `${elementId}${chunkKDW3LLG5_js.TEXT_BUILD_ID_SEP}c${paraIndex}-${i}`;
|
|
1569
|
-
const state = states.get(key);
|
|
1570
|
-
const style = buildAnimStyle(state);
|
|
1571
|
-
nodes.push(
|
|
1572
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": key, style: { display: "inline", ...style }, children: fullText[i] }, key)
|
|
1542
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1543
|
+
"span",
|
|
1544
|
+
{
|
|
1545
|
+
"data-anim-id": span.animId,
|
|
1546
|
+
style: chunkLTEDT475_js.textBuildSpanStyle(span),
|
|
1547
|
+
children: content
|
|
1548
|
+
},
|
|
1549
|
+
span.animId
|
|
1573
1550
|
);
|
|
1574
|
-
}
|
|
1575
|
-
return nodes;
|
|
1551
|
+
});
|
|
1576
1552
|
}
|
|
1577
1553
|
var EPS = 0.01;
|
|
1578
1554
|
var FALLBACK_STEP_PX = 48;
|
|
@@ -1711,10 +1687,10 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1711
1687
|
if (!needsScriptFonts || !text) {
|
|
1712
1688
|
return text;
|
|
1713
1689
|
}
|
|
1714
|
-
const runs =
|
|
1690
|
+
const runs = chunkLTEDT475_js.segmentByScript(text);
|
|
1715
1691
|
if (runs.length <= 1) {
|
|
1716
1692
|
if (runs.length === 1) {
|
|
1717
|
-
const font =
|
|
1693
|
+
const font = chunkLTEDT475_js.resolveFontForScript(runs[0].script, scriptFonts);
|
|
1718
1694
|
if (font && font !== baseFontFamily) {
|
|
1719
1695
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: text });
|
|
1720
1696
|
}
|
|
@@ -1722,7 +1698,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1722
1698
|
return text;
|
|
1723
1699
|
}
|
|
1724
1700
|
return runs.map((run, i) => {
|
|
1725
|
-
const font =
|
|
1701
|
+
const font = chunkLTEDT475_js.resolveFontForScript(run.script, scriptFonts);
|
|
1726
1702
|
if (!font || font === baseFontFamily) {
|
|
1727
1703
|
return /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Fragment, { children: run.text }, `${keyPrefix}-r${i}`);
|
|
1728
1704
|
}
|
|
@@ -1794,8 +1770,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1794
1770
|
);
|
|
1795
1771
|
}
|
|
1796
1772
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
1797
|
-
const mathml =
|
|
1798
|
-
const safeMathml = mathml ?
|
|
1773
|
+
const mathml = chunkLTEDT475_js.convertOmmlToMathMl(equationXml);
|
|
1774
|
+
const safeMathml = mathml ? chunkLTEDT475_js.sanitizeMathMl(mathml) : "";
|
|
1799
1775
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1800
1776
|
"span",
|
|
1801
1777
|
{
|
|
@@ -1805,7 +1781,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1805
1781
|
},
|
|
1806
1782
|
dangerouslySetInnerHTML: { __html: safeMathml }
|
|
1807
1783
|
}
|
|
1808
|
-
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children:
|
|
1784
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children: chunk25VSL2BB_js.translationsEn["pptx.textSegment.equationFallback"] });
|
|
1809
1785
|
if (equationNumber) {
|
|
1810
1786
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1811
1787
|
"span",
|
|
@@ -1845,7 +1821,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1845
1821
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: equationContent }, `${elementId}-seg-${segmentIndex}`);
|
|
1846
1822
|
}
|
|
1847
1823
|
function renderPictureBullet(elementId, segmentIndex, bulletInfo, baseFontSize) {
|
|
1848
|
-
const picture =
|
|
1824
|
+
const picture = chunkLTEDT475_js.resolvePictureBullet(bulletInfo, baseFontSize) ?? {
|
|
1849
1825
|
sizePx: baseFontSize,
|
|
1850
1826
|
fallbackMarker: "\u2022",
|
|
1851
1827
|
accessibleLabel: "Bullet"
|
|
@@ -1895,7 +1871,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1895
1871
|
);
|
|
1896
1872
|
}
|
|
1897
1873
|
const segmentStyle = segment.style || {};
|
|
1898
|
-
const textValue =
|
|
1874
|
+
const textValue = chunkLTEDT475_js.substituteFieldText(segment.text || "", segment.fieldType, fieldContext);
|
|
1899
1875
|
const lines = textValue.split("\n");
|
|
1900
1876
|
const textDecorationTokens = [];
|
|
1901
1877
|
if (segmentStyle.underline || segmentStyle.hyperlink) {
|
|
@@ -1905,8 +1881,8 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1905
1881
|
textDecorationTokens.push("line-through");
|
|
1906
1882
|
}
|
|
1907
1883
|
const isDoubleStrike = segmentStyle.strikethrough && segmentStyle.strikeType === "dblStrike";
|
|
1908
|
-
const resolvedSegmentColor = segmentStyle.hyperlink ?
|
|
1909
|
-
const underlineDecoration =
|
|
1884
|
+
const resolvedSegmentColor = segmentStyle.hyperlink ? chunkLTEDT475_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, HYPERLINK_COLOR) : chunkLTEDT475_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, fallbackColor);
|
|
1885
|
+
const underlineDecoration = chunkLTEDT475_js.resolveUnderlineDecorationStyle(
|
|
1910
1886
|
Boolean(isDoubleStrike),
|
|
1911
1887
|
segmentStyle.underlineStyle
|
|
1912
1888
|
);
|
|
@@ -1922,14 +1898,14 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1922
1898
|
const baseFontSizePt = baseFontSize * (72 / 96);
|
|
1923
1899
|
const fontKerning = typeof segmentStyle.kerning === "number" ? segmentStyle.kerning === 0 ? "none" : baseFontSizePt >= segmentStyle.kerning / 100 ? "normal" : "none" : void 0;
|
|
1924
1900
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
1925
|
-
const baseFontFamily = rawFontFamily ?
|
|
1901
|
+
const baseFontFamily = rawFontFamily ? chunkLTEDT475_js.getSubstituteFontFamily(rawFontFamily) : DEFAULT_FONT_FAMILY;
|
|
1926
1902
|
const scriptFonts = {
|
|
1927
1903
|
latin: baseFontFamily,
|
|
1928
1904
|
eastAsia: segmentStyle.eastAsiaFont || element.textStyle?.eastAsiaFont || baseFontFamily,
|
|
1929
1905
|
complexScript: segmentStyle.complexScriptFont || element.textStyle?.complexScriptFont || baseFontFamily,
|
|
1930
1906
|
symbol: segmentStyle.symbolFont || element.textStyle?.symbolFont || baseFontFamily
|
|
1931
1907
|
};
|
|
1932
|
-
const needsScriptFonts =
|
|
1908
|
+
const needsScriptFonts = chunkLTEDT475_js.hasDistinctScriptFonts(scriptFonts);
|
|
1933
1909
|
const spanStyle = {
|
|
1934
1910
|
color: resolvedSegmentColor,
|
|
1935
1911
|
fontSize: baseFontSize * baselineFontScale,
|
|
@@ -1947,15 +1923,15 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1947
1923
|
fontVariantCaps: segmentStyle.textCaps === "small" ? "small-caps" : void 0,
|
|
1948
1924
|
letterSpacing,
|
|
1949
1925
|
fontKerning,
|
|
1950
|
-
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ?
|
|
1926
|
+
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ? chunkLTEDT475_js.normalizeHexColor(segmentStyle.highlightColor, "transparent") : void 0,
|
|
1951
1927
|
...textFillStyles,
|
|
1952
|
-
textDecorationColor: segmentStyle.underlineColor ?
|
|
1953
|
-
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${
|
|
1928
|
+
textDecorationColor: segmentStyle.underlineColor ? chunkLTEDT475_js.normalizeHexColor(segmentStyle.underlineColor, void 0) : void 0,
|
|
1929
|
+
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${chunkLTEDT475_js.normalizeHexColor(segmentStyle.textOutlineColor, "#000000")}` : segmentStyle.textOutlineWidth ? `${segmentStyle.textOutlineWidth}px currentColor` : void 0,
|
|
1954
1930
|
paintOrder: segmentStyle.textOutlineWidth ? "stroke fill" : void 0,
|
|
1955
|
-
textShadow:
|
|
1956
|
-
filter:
|
|
1957
|
-
opacity:
|
|
1958
|
-
WebkitBoxReflect:
|
|
1931
|
+
textShadow: chunkLTEDT475_js.buildTextShadowCss(segmentStyle),
|
|
1932
|
+
filter: chunkLTEDT475_js.buildTextRunFilterChain(segmentStyle),
|
|
1933
|
+
opacity: chunkLTEDT475_js.getTextAlphaOpacity(segmentStyle),
|
|
1934
|
+
WebkitBoxReflect: chunkLTEDT475_js.buildTextReflectionCss(segmentStyle)
|
|
1959
1935
|
};
|
|
1960
1936
|
const runRtl = segmentStyle.rtl;
|
|
1961
1937
|
if (runRtl !== void 0 && runRtl !== paragraphRtl) {
|
|
@@ -1975,7 +1951,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1975
1951
|
spanStyle.fontSize = baseFontSize * (bulletInfo.sizePercent / 100) * baselineFontScale;
|
|
1976
1952
|
}
|
|
1977
1953
|
if (bulletInfo.color) {
|
|
1978
|
-
spanStyle.color =
|
|
1954
|
+
spanStyle.color = chunkLTEDT475_js.normalizeHexColor(bulletInfo.color, resolvedSegmentColor);
|
|
1979
1955
|
}
|
|
1980
1956
|
}
|
|
1981
1957
|
if (bulletInfo?.imageDataUrl || bulletInfo?.imageRelId) {
|
|
@@ -2015,7 +1991,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
2015
1991
|
textAlign: segment.rubyAlignment === "l" ? "left" : segment.rubyAlignment === "r" ? "right" : segment.rubyAlignment === "dist" || segment.rubyAlignment === "distCat" || segment.rubyAlignment === "distLetter" ? "justify" : "center"
|
|
2016
1992
|
};
|
|
2017
1993
|
if (segment.rubyStyle?.color) {
|
|
2018
|
-
rubyStyle.color =
|
|
1994
|
+
rubyStyle.color = chunkLTEDT475_js.normalizeHexColor(segment.rubyStyle.color, resolvedSegmentColor);
|
|
2019
1995
|
}
|
|
2020
1996
|
innerContent = /* @__PURE__ */ jsxRuntime.jsxs("ruby", { children: [
|
|
2021
1997
|
baseContent,
|
|
@@ -2110,7 +2086,7 @@ function groupSegmentsIntoParagraphs(segments) {
|
|
|
2110
2086
|
return paragraphs;
|
|
2111
2087
|
}
|
|
2112
2088
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick) {
|
|
2113
|
-
if (!
|
|
2089
|
+
if (!chunkLTEDT475_js.hasTextProperties(element)) {
|
|
2114
2090
|
return emptyFallback || null;
|
|
2115
2091
|
}
|
|
2116
2092
|
const effectiveSegments = segmentOverrides ?? element.textSegments;
|
|
@@ -2131,10 +2107,10 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2131
2107
|
return element.text || emptyFallback || "";
|
|
2132
2108
|
}
|
|
2133
2109
|
const paragraphs = groupSegmentsIntoParagraphs(effectiveSegments);
|
|
2134
|
-
const paragraphIndents =
|
|
2135
|
-
const elementRtl =
|
|
2136
|
-
const elementAlign =
|
|
2137
|
-
const bodyStyle =
|
|
2110
|
+
const paragraphIndents = chunkLTEDT475_js.hasTextProperties(element) ? element.paragraphIndents : void 0;
|
|
2111
|
+
const elementRtl = chunkLTEDT475_js.hasTextProperties(element) ? element.textStyle?.rtl : void 0;
|
|
2112
|
+
const elementAlign = chunkLTEDT475_js.hasTextProperties(element) ? element.textStyle?.align : void 0;
|
|
2113
|
+
const bodyStyle = chunkLTEDT475_js.hasTextProperties(element) ? element.textStyle : void 0;
|
|
2138
2114
|
const spaceFirstLast = bodyStyle?.spaceFirstLastParagraph !== false;
|
|
2139
2115
|
return paragraphs.map((paraSegments, paraIndex) => {
|
|
2140
2116
|
const paraIndent = paragraphIndents?.[paraIndex];
|
|
@@ -2149,14 +2125,14 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2149
2125
|
return Boolean(segment.text) && segment.text.trim().length > 0;
|
|
2150
2126
|
});
|
|
2151
2127
|
const hasBullet = bulletInfo && !bulletInfo.none && hasVisibleTextContent;
|
|
2152
|
-
const paraRtl =
|
|
2128
|
+
const paraRtl = chunkLTEDT475_js.resolveParagraphRtl(paraSegments, elementRtl);
|
|
2153
2129
|
const isRtlParagraph = paraRtl === true;
|
|
2154
|
-
const paraAlign =
|
|
2155
|
-
const cssTextAlign =
|
|
2130
|
+
const paraAlign = chunkLTEDT475_js.resolveParagraphAlign(paraSegments, elementAlign);
|
|
2131
|
+
const cssTextAlign = chunkLTEDT475_js.resolveCssTextAlign(paraAlign, isRtlParagraph);
|
|
2156
2132
|
const paraMarginLeft = isRtlParagraph ? void 0 : rawMarginLeft;
|
|
2157
2133
|
const paraMarginRight = isRtlParagraph ? rawMarginLeft : void 0;
|
|
2158
2134
|
const paraTextIndent = rawTextIndent;
|
|
2159
|
-
const paraKinsokuStyle =
|
|
2135
|
+
const paraKinsokuStyle = chunkLTEDT475_js.getKinsokuLineBreakStyles(firstSeg?.segment.style);
|
|
2160
2136
|
const hasParaKinsoku = Object.keys(paraKinsokuStyle).length > 0;
|
|
2161
2137
|
const paraProps = effectiveSegments[firstSeg?.globalIndex ?? -1]?.paragraphProperties;
|
|
2162
2138
|
const spacing = resolveParagraphSpacing({
|
|
@@ -2220,7 +2196,22 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2220
2196
|
paraIndex,
|
|
2221
2197
|
renderedSegments,
|
|
2222
2198
|
paraSegments,
|
|
2223
|
-
subElementAnimStates
|
|
2199
|
+
subElementAnimStates,
|
|
2200
|
+
// A staged build splits the paragraph but must not flatten it: each
|
|
2201
|
+
// piece is re-rendered through the SAME segment renderer, so it keeps
|
|
2202
|
+
// its run's font, size, colour and decoration while it animates.
|
|
2203
|
+
({ segment, globalIndex }, text) => renderSingleSegment(
|
|
2204
|
+
element,
|
|
2205
|
+
{ ...segment, text },
|
|
2206
|
+
globalIndex,
|
|
2207
|
+
fallbackColor,
|
|
2208
|
+
findHighlights,
|
|
2209
|
+
void 0,
|
|
2210
|
+
onHyperlinkClick,
|
|
2211
|
+
fieldContext,
|
|
2212
|
+
paraRtl,
|
|
2213
|
+
requireCtrlClick
|
|
2214
|
+
)
|
|
2224
2215
|
);
|
|
2225
2216
|
if (!needsWrapper) {
|
|
2226
2217
|
return /* @__PURE__ */ jsxRuntime.jsxs(React6__default.default.Fragment, { children: [
|
|
@@ -2243,13 +2234,13 @@ function hexToRgbUnit(hex) {
|
|
|
2243
2234
|
};
|
|
2244
2235
|
}
|
|
2245
2236
|
function getDuotoneColors(element) {
|
|
2246
|
-
if (!
|
|
2237
|
+
if (!chunkLTEDT475_js.isImageLikeElement(element)) {
|
|
2247
2238
|
return void 0;
|
|
2248
2239
|
}
|
|
2249
2240
|
return element.imageEffects?.duotone;
|
|
2250
2241
|
}
|
|
2251
2242
|
function buildLineShadowCss(element) {
|
|
2252
|
-
if (!
|
|
2243
|
+
if (!chunkLTEDT475_js.hasShapeProperties(element)) {
|
|
2253
2244
|
return void 0;
|
|
2254
2245
|
}
|
|
2255
2246
|
const ss = element.shapeStyle;
|
|
@@ -2260,13 +2251,13 @@ function buildLineShadowCss(element) {
|
|
|
2260
2251
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
2261
2252
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
2262
2253
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
2263
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
2264
|
-
|
|
2254
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkLTEDT475_js.colorWithOpacity(
|
|
2255
|
+
chunkLTEDT475_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
2265
2256
|
opacity
|
|
2266
2257
|
)}`;
|
|
2267
2258
|
}
|
|
2268
2259
|
function buildLineGlowFilter(element) {
|
|
2269
|
-
if (!
|
|
2260
|
+
if (!chunkLTEDT475_js.hasShapeProperties(element)) {
|
|
2270
2261
|
return void 0;
|
|
2271
2262
|
}
|
|
2272
2263
|
const ss = element.shapeStyle;
|
|
@@ -2275,7 +2266,7 @@ function buildLineGlowFilter(element) {
|
|
|
2275
2266
|
}
|
|
2276
2267
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
2277
2268
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
2278
|
-
const glowCol =
|
|
2269
|
+
const glowCol = chunkLTEDT475_js.colorWithOpacity(chunkLTEDT475_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
2279
2270
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
2280
2271
|
}
|
|
2281
2272
|
function mapDagBlendModeToCss(blend) {
|
|
@@ -2299,7 +2290,7 @@ function getDagDuotoneFilterId(elementId) {
|
|
|
2299
2290
|
return `dag-duotone-${elementId}`;
|
|
2300
2291
|
}
|
|
2301
2292
|
function hasDagDuotoneEffect(element) {
|
|
2302
|
-
if (!
|
|
2293
|
+
if (!chunkLTEDT475_js.hasShapeProperties(element)) {
|
|
2303
2294
|
return false;
|
|
2304
2295
|
}
|
|
2305
2296
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
@@ -2362,7 +2353,7 @@ function getRoundRectRadiusPx2(element) {
|
|
|
2362
2353
|
|
|
2363
2354
|
// src/viewer/utils/shape-visual-3d.ts
|
|
2364
2355
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
2365
|
-
return
|
|
2356
|
+
return chunkLTEDT475_js.build3DExtrusionData(
|
|
2366
2357
|
shape3d,
|
|
2367
2358
|
scene3d,
|
|
2368
2359
|
fillColor,
|
|
@@ -2371,7 +2362,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
2371
2362
|
);
|
|
2372
2363
|
}
|
|
2373
2364
|
function apply3dEffects2(base, scene3d, shape3d, fillColorFallback) {
|
|
2374
|
-
|
|
2365
|
+
chunkLTEDT475_js.apply3dEffects(base, scene3d, shape3d, fillColorFallback);
|
|
2375
2366
|
}
|
|
2376
2367
|
|
|
2377
2368
|
// src/viewer/utils/vector-subpath-paint.ts
|
|
@@ -2380,7 +2371,7 @@ function toHexByte(value) {
|
|
|
2380
2371
|
return clamped.toString(16).padStart(2, "0");
|
|
2381
2372
|
}
|
|
2382
2373
|
function shiftHex(hex, factor, towardsWhite) {
|
|
2383
|
-
const channels =
|
|
2374
|
+
const channels = chunkLTEDT475_js.hexToRgbChannels(hex);
|
|
2384
2375
|
if (!channels) {
|
|
2385
2376
|
return hex;
|
|
2386
2377
|
}
|
|
@@ -2406,13 +2397,13 @@ function buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity) {
|
|
|
2406
2397
|
const fillOff = subpath.fillMode === "none" || !hasFill;
|
|
2407
2398
|
return {
|
|
2408
2399
|
d: subpath.d,
|
|
2409
|
-
fill: fillOff ? "none" :
|
|
2400
|
+
fill: fillOff ? "none" : chunkLTEDT475_js.colorWithOpacity(adjustFillForMode(fillColor, subpath.fillMode), fillOpacity),
|
|
2410
2401
|
stroked: subpath.stroke !== false
|
|
2411
2402
|
};
|
|
2412
2403
|
});
|
|
2413
2404
|
}
|
|
2414
2405
|
function getStrokeOnlyPresetPaths(element) {
|
|
2415
|
-
if (element.type !== "shape" || !
|
|
2406
|
+
if (element.type !== "shape" || !chunkLTEDT475_js.hasShapeProperties(element)) {
|
|
2416
2407
|
return void 0;
|
|
2417
2408
|
}
|
|
2418
2409
|
const shapeType = element.shapeType;
|
|
@@ -2422,7 +2413,7 @@ function getStrokeOnlyPresetPaths(element) {
|
|
|
2422
2413
|
if (element.pathData) {
|
|
2423
2414
|
return void 0;
|
|
2424
2415
|
}
|
|
2425
|
-
const result =
|
|
2416
|
+
const result = chunkLTEDT475_js.evaluatePresetShape(
|
|
2426
2417
|
shapeType,
|
|
2427
2418
|
Math.max(element.width, 1),
|
|
2428
2419
|
Math.max(element.height, 1),
|
|
@@ -2437,27 +2428,27 @@ function getStrokeOnlyPresetPaths(element) {
|
|
|
2437
2428
|
|
|
2438
2429
|
// src/viewer/utils/shape-visual-style.ts
|
|
2439
2430
|
function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2440
|
-
if (!
|
|
2431
|
+
if (!chunkLTEDT475_js.hasShapeProperties(element)) {
|
|
2441
2432
|
return {};
|
|
2442
2433
|
}
|
|
2443
2434
|
const normalizedShapeType = getShapeType(element.shapeType);
|
|
2444
|
-
const clipPath =
|
|
2435
|
+
const clipPath = chunkLTEDT475_js.getResolvedShapeClipPath(element);
|
|
2445
2436
|
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;
|
|
2446
2437
|
const rendersStrokeOnlyPreset = Boolean(getStrokeOnlyPresetPaths(element));
|
|
2447
2438
|
const fillOpacity = element.shapeStyle?.fillOpacity;
|
|
2448
2439
|
const strokeOpacity = element.shapeStyle?.strokeOpacity;
|
|
2449
|
-
const strokeDash =
|
|
2450
|
-
const fillGradient =
|
|
2451
|
-
const shadowCss =
|
|
2452
|
-
const innerShadowCss =
|
|
2453
|
-
const resolvedFillColor =
|
|
2454
|
-
const resolvedStrokeColor =
|
|
2440
|
+
const strokeDash = chunkLTEDT475_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2441
|
+
const fillGradient = chunkLTEDT475_js.buildCssGradientFromShapeStyle(element.shapeStyle) || element.shapeStyle?.fillGradient;
|
|
2442
|
+
const shadowCss = chunkLTEDT475_js.buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
2443
|
+
const innerShadowCss = chunkLTEDT475_js.buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
2444
|
+
const resolvedFillColor = chunkLTEDT475_js.colorWithOpacity(fillColor, fillOpacity);
|
|
2445
|
+
const resolvedStrokeColor = chunkLTEDT475_js.colorWithOpacity(strokeColor, strokeOpacity);
|
|
2455
2446
|
const ss = element.shapeStyle;
|
|
2456
2447
|
const hasFillOverlayColor = Boolean(
|
|
2457
2448
|
ss?.dagFillOverlayColor && ss.dagFillOverlayColor !== "transparent"
|
|
2458
2449
|
);
|
|
2459
2450
|
const combinedShadowParts = [];
|
|
2460
|
-
const multiLayerShadow =
|
|
2451
|
+
const multiLayerShadow = chunkLTEDT475_js.buildMultiLayerShadowCss(element.shapeStyle);
|
|
2461
2452
|
if (multiLayerShadow) {
|
|
2462
2453
|
combinedShadowParts.push(multiLayerShadow);
|
|
2463
2454
|
} else if (shadowCss) {
|
|
@@ -2466,7 +2457,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2466
2457
|
if (innerShadowCss) {
|
|
2467
2458
|
combinedShadowParts.push(innerShadowCss);
|
|
2468
2459
|
}
|
|
2469
|
-
const glowBoxShadow =
|
|
2460
|
+
const glowBoxShadow = chunkLTEDT475_js.buildGlowBoxShadow(ss?.glowColor, ss?.glowRadius, ss?.glowOpacity);
|
|
2470
2461
|
if (glowBoxShadow) {
|
|
2471
2462
|
combinedShadowParts.push(glowBoxShadow);
|
|
2472
2463
|
}
|
|
@@ -2474,7 +2465,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2474
2465
|
if (lineShadow) {
|
|
2475
2466
|
combinedShadowParts.push(lineShadow);
|
|
2476
2467
|
}
|
|
2477
|
-
const compoundLineShadow =
|
|
2468
|
+
const compoundLineShadow = chunkLTEDT475_js.getCompoundLineBoxShadow(
|
|
2478
2469
|
element.shapeStyle?.compoundLine,
|
|
2479
2470
|
strokeWidth,
|
|
2480
2471
|
resolvedStrokeColor
|
|
@@ -2487,11 +2478,11 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2487
2478
|
if (ss?.glowColor && ss.glowColor !== "transparent" && ss.glowRadius) {
|
|
2488
2479
|
const glowOpacity = typeof ss.glowOpacity === "number" ? ss.glowOpacity : 0.75;
|
|
2489
2480
|
const glowRad = Math.round(Math.max(0, ss.glowRadius));
|
|
2490
|
-
const glowCol =
|
|
2481
|
+
const glowCol = chunkLTEDT475_js.colorWithOpacity(chunkLTEDT475_js.normalizeHexColor(ss.glowColor, "#ffff00"), glowOpacity);
|
|
2491
2482
|
filterParts.push(`drop-shadow(0 0 ${glowRad}px ${glowCol})`);
|
|
2492
2483
|
}
|
|
2493
2484
|
if (typeof ss?.softEdgeRadius === "number" && ss.softEdgeRadius > 0) {
|
|
2494
|
-
filterParts.push(`url(#${
|
|
2485
|
+
filterParts.push(`url(#${chunkLTEDT475_js.getSoftEdgeFilterId(element.id)})`);
|
|
2495
2486
|
}
|
|
2496
2487
|
if (typeof ss?.blurRadius === "number" && ss.blurRadius > 0) {
|
|
2497
2488
|
filterParts.push(`blur(${Math.round(ss.blurRadius)}px)`);
|
|
@@ -2500,13 +2491,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2500
2491
|
if (lineGlowCss) {
|
|
2501
2492
|
filterParts.push(lineGlowCss);
|
|
2502
2493
|
}
|
|
2503
|
-
const dagFilter =
|
|
2494
|
+
const dagFilter = chunkLTEDT475_js.getEffectDagFilter(ss, element.id);
|
|
2504
2495
|
if (dagFilter) {
|
|
2505
2496
|
filterParts.push(dagFilter);
|
|
2506
2497
|
}
|
|
2507
2498
|
const lineJoinCss = ss?.lineJoin === "round" ? "round" : ss?.lineJoin === "bevel" ? "bevel" : ss?.lineJoin === "miter" ? "miter" : void 0;
|
|
2508
2499
|
const miterLimitCss = ss?.lineJoin === "miter" && typeof ss?.miterLimit === "number" ? Math.max(ss.miterLimit / 1e5, 1) : void 0;
|
|
2509
|
-
const patternFill =
|
|
2500
|
+
const patternFill = chunkLTEDT475_js.buildPatternFillCss(element.shapeStyle);
|
|
2510
2501
|
const imageFillUrl = ss?.fillMode === "image" && ss.fillImageUrl ? ss.fillImageUrl : void 0;
|
|
2511
2502
|
const imageFillMode = ss?.fillImageMode || "stretch";
|
|
2512
2503
|
let reflectCss;
|
|
@@ -2518,7 +2509,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2518
2509
|
const endOpacity = typeof ss.reflectionEndOpacity === "number" ? ss.reflectionEndOpacity : 0;
|
|
2519
2510
|
const fadeLength = typeof ss.reflectionEndPosition === "number" ? Math.round(ss.reflectionEndPosition * Math.max(element.height, 1)) : 100;
|
|
2520
2511
|
const blurRadius = typeof ss.reflectionBlurRadius === "number" ? ss.reflectionBlurRadius : 0;
|
|
2521
|
-
reflectCss =
|
|
2512
|
+
reflectCss = chunkLTEDT475_js.buildReflectionCss(distance, startOpacity, endOpacity, fadeLength, blurRadius);
|
|
2522
2513
|
}
|
|
2523
2514
|
}
|
|
2524
2515
|
const base = {
|
|
@@ -2552,9 +2543,9 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2552
2543
|
// is present, `ShapeEffectOverlay` paints a separate blended tint layer so
|
|
2553
2544
|
// the colour is actually rendered (and text/children are not tinted).
|
|
2554
2545
|
mixBlendMode: hasFillOverlayColor ? void 0 : mapDagBlendModeToCss(ss?.dagFillOverlayBlend),
|
|
2555
|
-
borderWidth: strokeWidth > 0 ?
|
|
2546
|
+
borderWidth: strokeWidth > 0 ? chunkLTEDT475_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : void 0,
|
|
2556
2547
|
borderColor: strokeWidth > 0 ? resolvedStrokeColor : void 0,
|
|
2557
|
-
borderStyle: strokeWidth > 0 ?
|
|
2548
|
+
borderStyle: strokeWidth > 0 ? chunkLTEDT475_js.getCssBorderDashStyle(strokeDash, ss?.compoundLine) : void 0,
|
|
2558
2549
|
strokeLinejoin: lineJoinCss,
|
|
2559
2550
|
strokeMiterlimit: miterLimitCss,
|
|
2560
2551
|
strokeLinecap: ss?.lineCap === "rnd" ? "round" : ss?.lineCap === "sq" ? "square" : ss?.lineCap === "flat" ? "butt" : void 0
|
|
@@ -2610,7 +2601,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2610
2601
|
borderWidth: 0,
|
|
2611
2602
|
borderTopWidth: Math.max(strokeWidth, 2),
|
|
2612
2603
|
borderTopColor: resolvedStrokeColor,
|
|
2613
|
-
borderTopStyle:
|
|
2604
|
+
borderTopStyle: chunkLTEDT475_js.getCssBorderDashStyle(strokeDash)
|
|
2614
2605
|
};
|
|
2615
2606
|
}
|
|
2616
2607
|
if (normalizedShapeType === "cylinder") {
|
|
@@ -2624,13 +2615,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2624
2615
|
function getConnectorAdjustment(element, key, fallback) {
|
|
2625
2616
|
const direct = element.shapeAdjustments?.[key];
|
|
2626
2617
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
2627
|
-
return
|
|
2618
|
+
return chunkLTEDT475_js.clampUnitInterval(direct / 1e5);
|
|
2628
2619
|
}
|
|
2629
2620
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
2630
2621
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
2631
|
-
return
|
|
2622
|
+
return chunkLTEDT475_js.clampUnitInterval(fallbackKey / 1e5);
|
|
2632
2623
|
}
|
|
2633
|
-
return
|
|
2624
|
+
return chunkLTEDT475_js.clampUnitInterval(fallback);
|
|
2634
2625
|
}
|
|
2635
2626
|
function getConnectorPathGeometry(element) {
|
|
2636
2627
|
const width = Math.max(element.width, 1);
|
|
@@ -2767,11 +2758,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
|
|
|
2767
2758
|
strokePaint,
|
|
2768
2759
|
strokeWidth,
|
|
2769
2760
|
dashArray,
|
|
2770
|
-
lineCap:
|
|
2761
|
+
lineCap: chunkLTEDT475_js.svgLineCap(shapeStyle?.lineCap),
|
|
2771
2762
|
lineJoin,
|
|
2772
2763
|
miterLimit,
|
|
2773
|
-
offsets:
|
|
2774
|
-
widths:
|
|
2764
|
+
offsets: chunkLTEDT475_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
2765
|
+
widths: chunkLTEDT475_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
|
|
2775
2766
|
};
|
|
2776
2767
|
}
|
|
2777
2768
|
function strokeStrands(d, keyBase, ctx) {
|
|
@@ -2794,7 +2785,7 @@ function strokeStrands(d, keyBase, ctx) {
|
|
|
2794
2785
|
}
|
|
2795
2786
|
function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredPaths, shapeStyle, hasFill, fillColor, fillOpacity, strokePaint, strokeWidth, dashArray, animatesFill = false) {
|
|
2796
2787
|
const ctx = strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray);
|
|
2797
|
-
const subpaths = structuredPaths && structuredPaths.length > 0 ?
|
|
2788
|
+
const subpaths = structuredPaths && structuredPaths.length > 0 ? chunkLTEDT475_js.customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
2798
2789
|
const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
|
|
2799
2790
|
const nodes = [];
|
|
2800
2791
|
if (subpaths && needsPerSubpath) {
|
|
@@ -2825,7 +2816,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2825
2816
|
"path",
|
|
2826
2817
|
{
|
|
2827
2818
|
d: pathData,
|
|
2828
|
-
fill: animatesFill ? "inherit" :
|
|
2819
|
+
fill: animatesFill ? "inherit" : chunkLTEDT475_js.colorWithOpacity(fillColor, fillOpacity),
|
|
2829
2820
|
stroke: "none",
|
|
2830
2821
|
vectorEffect: "non-scaling-stroke"
|
|
2831
2822
|
},
|
|
@@ -2867,14 +2858,14 @@ function renderStrokeOnlyPreset(presetPaths, width, height, shapeStyle, strokePa
|
|
|
2867
2858
|
);
|
|
2868
2859
|
}
|
|
2869
2860
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2870
|
-
if (!
|
|
2861
|
+
if (!chunkLTEDT475_js.hasShapeProperties(element)) {
|
|
2871
2862
|
return null;
|
|
2872
2863
|
}
|
|
2873
2864
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
2874
|
-
const fillPaint = animatesFill ? "inherit" :
|
|
2875
|
-
const strokePaint = animatesStroke ? "inherit" :
|
|
2876
|
-
const dashType =
|
|
2877
|
-
const dashArray =
|
|
2865
|
+
const fillPaint = animatesFill ? "inherit" : chunkLTEDT475_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
2866
|
+
const strokePaint = animatesStroke ? "inherit" : chunkLTEDT475_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
2867
|
+
const dashType = chunkLTEDT475_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2868
|
+
const dashArray = chunkLTEDT475_js.getSvgStrokeDasharray(
|
|
2878
2869
|
dashType,
|
|
2879
2870
|
Math.max(strokeWidth, 1),
|
|
2880
2871
|
element.shapeStyle?.customDashSegments
|
|
@@ -2953,18 +2944,18 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2953
2944
|
Boolean(animatesFill)
|
|
2954
2945
|
);
|
|
2955
2946
|
}
|
|
2956
|
-
if (
|
|
2947
|
+
if (chunkLTEDT475_js.isCalloutShape(normalizedType)) {
|
|
2957
2948
|
const width = Math.max(element.width, 1);
|
|
2958
2949
|
const height = Math.max(element.height, 1);
|
|
2959
|
-
const geometry =
|
|
2950
|
+
const geometry = chunkLTEDT475_js.getCalloutLeaderLineGeometry(
|
|
2960
2951
|
normalizedType,
|
|
2961
2952
|
width,
|
|
2962
2953
|
height,
|
|
2963
2954
|
element.shapeAdjustments
|
|
2964
2955
|
);
|
|
2965
2956
|
if (geometry && geometry.points.length >= 2) {
|
|
2966
|
-
const leaderPath =
|
|
2967
|
-
const bounds =
|
|
2957
|
+
const leaderPath = chunkLTEDT475_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
2958
|
+
const bounds = chunkLTEDT475_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
2968
2959
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
2969
2960
|
const offsetLeft = bounds.minX;
|
|
2970
2961
|
const offsetTop = bounds.minY;
|
|
@@ -3027,10 +3018,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
3027
3018
|
const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
|
|
3028
3019
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
3029
3020
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
3030
|
-
const connectorLineCap =
|
|
3021
|
+
const connectorLineCap = chunkLTEDT475_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
3031
3022
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
3032
|
-
const offsets =
|
|
3033
|
-
const widths =
|
|
3023
|
+
const offsets = chunkLTEDT475_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
3024
|
+
const widths = chunkLTEDT475_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
3034
3025
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3035
3026
|
"svg",
|
|
3036
3027
|
{
|
|
@@ -3109,15 +3100,15 @@ function parseGradientFillCss(gradFill) {
|
|
|
3109
3100
|
}
|
|
3110
3101
|
const parsed = stops.map((gs) => {
|
|
3111
3102
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
3112
|
-
const color =
|
|
3113
|
-
const opacity =
|
|
3114
|
-
return { pos, color:
|
|
3103
|
+
const color = chunkLTEDT475_js.parseDrawingColor(gs) ?? "#888888";
|
|
3104
|
+
const opacity = chunkLTEDT475_js.parseDrawingColorOpacity(gs);
|
|
3105
|
+
return { pos, color: chunkLTEDT475_js.colorWithOpacity(color, opacity) };
|
|
3115
3106
|
}).sort((a, b) => a.pos - b.pos);
|
|
3116
3107
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
3117
3108
|
const lin = gradFill["a:lin"];
|
|
3118
3109
|
if (lin) {
|
|
3119
3110
|
const angRaw = Number.parseInt(String(lin["@_ang"] || "0"), 10);
|
|
3120
|
-
const angleDeg = Math.round(
|
|
3111
|
+
const angleDeg = Math.round(chunkLTEDT475_js.ooxmlGradientAngleToCssDegrees(angRaw / 6e4));
|
|
3121
3112
|
return `linear-gradient(${angleDeg}deg, ${stopStrings})`;
|
|
3122
3113
|
}
|
|
3123
3114
|
const path = gradFill["a:path"];
|
|
@@ -3152,8 +3143,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
3152
3143
|
if (!pattFill) {
|
|
3153
3144
|
return void 0;
|
|
3154
3145
|
}
|
|
3155
|
-
const fgColor =
|
|
3156
|
-
const bgColor =
|
|
3146
|
+
const fgColor = chunkLTEDT475_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
3147
|
+
const bgColor = chunkLTEDT475_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
3157
3148
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
3158
3149
|
switch (preset) {
|
|
3159
3150
|
case "ltHorz":
|
|
@@ -3264,11 +3255,11 @@ function parseCellBorders(cellProperties) {
|
|
|
3264
3255
|
const prstDash = ln["a:prstDash"];
|
|
3265
3256
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
3266
3257
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
3267
|
-
const color =
|
|
3258
|
+
const color = chunkLTEDT475_js.parseDrawingColor(ln["a:solidFill"]);
|
|
3268
3259
|
if (color) {
|
|
3269
|
-
const opacity =
|
|
3260
|
+
const opacity = chunkLTEDT475_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
3270
3261
|
const key = `${edge.prefix}`;
|
|
3271
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
3262
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkLTEDT475_js.colorWithOpacity(color, opacity)}`;
|
|
3272
3263
|
}
|
|
3273
3264
|
}
|
|
3274
3265
|
return borderStyle;
|
|
@@ -3281,7 +3272,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3281
3272
|
const textShadowParts = [];
|
|
3282
3273
|
const outerShdw = effectLst["a:outerShdw"];
|
|
3283
3274
|
if (outerShdw) {
|
|
3284
|
-
const shdwColor =
|
|
3275
|
+
const shdwColor = chunkLTEDT475_js.parseDrawingColor(outerShdw);
|
|
3285
3276
|
if (shdwColor) {
|
|
3286
3277
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
3287
3278
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -3299,7 +3290,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3299
3290
|
}
|
|
3300
3291
|
const glow = effectLst["a:glow"];
|
|
3301
3292
|
if (glow) {
|
|
3302
|
-
const glowColor =
|
|
3293
|
+
const glowColor = chunkLTEDT475_js.parseDrawingColor(glow);
|
|
3303
3294
|
if (glowColor) {
|
|
3304
3295
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
3305
3296
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -3378,10 +3369,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3378
3369
|
if (runProps?.["@_u"] !== void 0) {
|
|
3379
3370
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
3380
3371
|
}
|
|
3381
|
-
const runColor =
|
|
3372
|
+
const runColor = chunkLTEDT475_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkLTEDT475_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
3382
3373
|
if (runColor) {
|
|
3383
|
-
const opacity =
|
|
3384
|
-
cellStyle.color =
|
|
3374
|
+
const opacity = chunkLTEDT475_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
3375
|
+
cellStyle.color = chunkLTEDT475_js.colorWithOpacity(runColor, opacity);
|
|
3385
3376
|
}
|
|
3386
3377
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
3387
3378
|
if (fontFamily) {
|
|
@@ -3391,15 +3382,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3391
3382
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
3392
3383
|
}
|
|
3393
3384
|
const cellProperties = cellXml["a:tcPr"];
|
|
3394
|
-
const cellFill =
|
|
3385
|
+
const cellFill = chunkLTEDT475_js.parseDrawingColor(
|
|
3395
3386
|
cellProperties?.["a:solidFill"],
|
|
3396
3387
|
schemeColorOverrides
|
|
3397
3388
|
);
|
|
3398
3389
|
if (cellFill) {
|
|
3399
|
-
const opacity =
|
|
3390
|
+
const opacity = chunkLTEDT475_js.parseDrawingColorOpacity(
|
|
3400
3391
|
cellProperties?.["a:solidFill"]
|
|
3401
3392
|
);
|
|
3402
|
-
cellStyle.backgroundColor =
|
|
3393
|
+
cellStyle.backgroundColor = chunkLTEDT475_js.colorWithOpacity(cellFill, opacity);
|
|
3403
3394
|
} else {
|
|
3404
3395
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
3405
3396
|
if (gradCss) {
|
|
@@ -3414,16 +3405,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3414
3405
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
3415
3406
|
Object.assign(cellStyle, edgeBorders);
|
|
3416
3407
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
3417
|
-
const borderColor =
|
|
3408
|
+
const borderColor = chunkLTEDT475_js.parseDrawingColor(
|
|
3418
3409
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
3419
3410
|
schemeColorOverrides
|
|
3420
|
-
) ||
|
|
3411
|
+
) || chunkLTEDT475_js.parseDrawingColor(
|
|
3421
3412
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
3422
3413
|
schemeColorOverrides
|
|
3423
|
-
) ||
|
|
3414
|
+
) || chunkLTEDT475_js.parseDrawingColor(
|
|
3424
3415
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
3425
3416
|
schemeColorOverrides
|
|
3426
|
-
) ||
|
|
3417
|
+
) || chunkLTEDT475_js.parseDrawingColor(
|
|
3427
3418
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
3428
3419
|
schemeColorOverrides
|
|
3429
3420
|
);
|
|
@@ -3502,10 +3493,10 @@ function resolveTableStyleFillColor(fill, colorScheme) {
|
|
|
3502
3493
|
}
|
|
3503
3494
|
let color = base;
|
|
3504
3495
|
if (fill.tint !== void 0 && fill.tint > 0) {
|
|
3505
|
-
color =
|
|
3496
|
+
color = chunkLTEDT475_js.tintColor2(color, fill.tint / 1e5);
|
|
3506
3497
|
}
|
|
3507
3498
|
if (fill.shade !== void 0 && fill.shade > 0) {
|
|
3508
|
-
color =
|
|
3499
|
+
color = chunkLTEDT475_js.shadeColor2(color, 1 - fill.shade / 1e5);
|
|
3509
3500
|
}
|
|
3510
3501
|
return color;
|
|
3511
3502
|
}
|
|
@@ -3530,7 +3521,7 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3530
3521
|
style.fontFamily = text.fontFace;
|
|
3531
3522
|
applied = true;
|
|
3532
3523
|
} else {
|
|
3533
|
-
const refFont =
|
|
3524
|
+
const refFont = chunkLTEDT475_js.resolveFontRefIdx(text.fontRefIdx, fontScheme);
|
|
3534
3525
|
if (refFont) {
|
|
3535
3526
|
style.fontFamily = refFont;
|
|
3536
3527
|
applied = true;
|
|
@@ -3541,10 +3532,10 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3541
3532
|
if (base) {
|
|
3542
3533
|
let color = base;
|
|
3543
3534
|
if (text.fontTint !== void 0 && text.fontTint > 0) {
|
|
3544
|
-
color =
|
|
3535
|
+
color = chunkLTEDT475_js.tintColor2(color, text.fontTint / 1e5);
|
|
3545
3536
|
}
|
|
3546
3537
|
if (text.fontShade !== void 0 && text.fontShade > 0) {
|
|
3547
|
-
color =
|
|
3538
|
+
color = chunkLTEDT475_js.shadeColor2(color, 1 - text.fontShade / 1e5);
|
|
3548
3539
|
}
|
|
3549
3540
|
style.color = color;
|
|
3550
3541
|
applied = true;
|
|
@@ -3733,7 +3724,7 @@ function parseTableElementData(element, fallbackTextStyle) {
|
|
|
3733
3724
|
};
|
|
3734
3725
|
}
|
|
3735
3726
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
3736
|
-
return
|
|
3727
|
+
return chunkLTEDT475_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
3737
3728
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
3738
3729
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
3739
3730
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -3881,9 +3872,9 @@ function cellStyleToCss(style) {
|
|
|
3881
3872
|
if (style.gradientFillCss) {
|
|
3882
3873
|
css.background = style.gradientFillCss;
|
|
3883
3874
|
} else if (style.fillMode === "pattern" && style.patternFillPreset) {
|
|
3884
|
-
const fg =
|
|
3885
|
-
const bg =
|
|
3886
|
-
const svgPattern =
|
|
3875
|
+
const fg = chunkLTEDT475_js.normalizeHexColor(style.patternFillForeground, "#000000");
|
|
3876
|
+
const bg = chunkLTEDT475_js.normalizeHexColor(style.patternFillBackground, "#ffffff");
|
|
3877
|
+
const svgPattern = chunkLTEDT475_js.getPatternSvg(style.patternFillPreset, fg, bg);
|
|
3887
3878
|
if (svgPattern) {
|
|
3888
3879
|
const encoded = encodeURIComponent(svgPattern);
|
|
3889
3880
|
css.backgroundImage = `url("data:image/svg+xml,${encoded}")`;
|
|
@@ -3959,7 +3950,7 @@ function cellStyleToCss(style) {
|
|
|
3959
3950
|
if (edge.width || edge.color) {
|
|
3960
3951
|
const w = edge.width ?? 1;
|
|
3961
3952
|
const c = edge.color ?? style.borderColor ?? "#000000";
|
|
3962
|
-
const s =
|
|
3953
|
+
const s = chunkLTEDT475_js.ooxmlDashToCssBorderStyle(edge.dash);
|
|
3963
3954
|
css[edge.prefix] = `${w}px ${s} ${c}`;
|
|
3964
3955
|
}
|
|
3965
3956
|
}
|
|
@@ -3990,7 +3981,7 @@ function cellStyleToCss(style) {
|
|
|
3990
3981
|
css.textShadow = textShadowParts.join(", ");
|
|
3991
3982
|
}
|
|
3992
3983
|
if (style.cell3D) {
|
|
3993
|
-
Object.assign(css,
|
|
3984
|
+
Object.assign(css, chunkLTEDT475_js.cell3DBevelCss(style.cell3D));
|
|
3994
3985
|
}
|
|
3995
3986
|
return css;
|
|
3996
3987
|
}
|
|
@@ -4004,7 +3995,7 @@ function TableResizeOverlay({
|
|
|
4004
3995
|
const containerRef = React6.useRef(null);
|
|
4005
3996
|
const [rowBounds, setRowBounds] = React6.useState([]);
|
|
4006
3997
|
const dragRef = React6.useRef(null);
|
|
4007
|
-
const colBoundaries = React6.useMemo(() =>
|
|
3998
|
+
const colBoundaries = React6.useMemo(() => chunkLTEDT475_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
4008
3999
|
const measureRows = React6.useCallback(() => {
|
|
4009
4000
|
const container = containerRef.current;
|
|
4010
4001
|
if (!container) {
|
|
@@ -4051,11 +4042,11 @@ function TableResizeOverlay({
|
|
|
4051
4042
|
const rect = containerRef.current.getBoundingClientRect();
|
|
4052
4043
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
4053
4044
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
4054
|
-
onResizeColumns(
|
|
4045
|
+
onResizeColumns(chunkLTEDT475_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
4055
4046
|
} else if (drag.type === "row" && onResizeRow) {
|
|
4056
4047
|
const deltaY = e.clientY - drag.startPos;
|
|
4057
|
-
const newHeight =
|
|
4058
|
-
drag.initialRowHeight ??
|
|
4048
|
+
const newHeight = chunkLTEDT475_js.computeResizedRowHeight(
|
|
4049
|
+
drag.initialRowHeight ?? chunkLTEDT475_js.DEFAULT_ROW_HEIGHT,
|
|
4059
4050
|
deltaY
|
|
4060
4051
|
);
|
|
4061
4052
|
onResizeRow(drag.index, newHeight);
|
|
@@ -4093,7 +4084,7 @@ function TableResizeOverlay({
|
|
|
4093
4084
|
e.stopPropagation();
|
|
4094
4085
|
const table = containerRef.current?.querySelector("table");
|
|
4095
4086
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
4096
|
-
const actualHeight = tr?.offsetHeight ??
|
|
4087
|
+
const actualHeight = tr?.offsetHeight ?? chunkLTEDT475_js.DEFAULT_ROW_HEIGHT;
|
|
4097
4088
|
document.body.style.cursor = "row-resize";
|
|
4098
4089
|
document.body.style.userSelect = "none";
|
|
4099
4090
|
dragRef.current = {
|
|
@@ -4141,7 +4132,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4141
4132
|
}
|
|
4142
4133
|
const first = selectedCell.selectedCells[0];
|
|
4143
4134
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4144
|
-
return
|
|
4135
|
+
return chunkLTEDT475_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
4145
4136
|
})();
|
|
4146
4137
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4147
4138
|
TableResizeOverlay,
|
|
@@ -4174,7 +4165,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4174
4165
|
return null;
|
|
4175
4166
|
}
|
|
4176
4167
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
4177
|
-
const isInMultiSelection =
|
|
4168
|
+
const isInMultiSelection = chunkLTEDT475_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
4178
4169
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
4179
4170
|
const diag = getCellDiagonalBorders2(
|
|
4180
4171
|
cell.style,
|
|
@@ -4204,7 +4195,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4204
4195
|
}
|
|
4205
4196
|
event.stopPropagation();
|
|
4206
4197
|
if (event.shiftKey && selectedCell) {
|
|
4207
|
-
const rect =
|
|
4198
|
+
const rect = chunkLTEDT475_js.computeSelectionRect(
|
|
4208
4199
|
selectedCell.rowIndex,
|
|
4209
4200
|
selectedCell.columnIndex,
|
|
4210
4201
|
rowIndex,
|
|
@@ -4214,7 +4205,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4214
4205
|
options?.onSelectCell?.({
|
|
4215
4206
|
rowIndex: selectedCell.rowIndex,
|
|
4216
4207
|
columnIndex: selectedCell.columnIndex,
|
|
4217
|
-
selectedCells:
|
|
4208
|
+
selectedCells: chunkLTEDT475_js.rectToCells(rect)
|
|
4218
4209
|
});
|
|
4219
4210
|
} else {
|
|
4220
4211
|
options?.onSelectCell?.({
|
|
@@ -4276,7 +4267,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4276
4267
|
if (tableEl2.tableData && tableEl2.tableData.rows.length > 0) {
|
|
4277
4268
|
return renderTableFromTableData(tableEl2, textStyle, options);
|
|
4278
4269
|
}
|
|
4279
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
4270
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunk25VSL2BB_js.translationsEn["pptx.table.title"] });
|
|
4280
4271
|
}
|
|
4281
4272
|
const selectedCell = options?.selectedCell || null;
|
|
4282
4273
|
const isEditable = Boolean(options?.editable);
|
|
@@ -4291,7 +4282,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4291
4282
|
}
|
|
4292
4283
|
const first = selectedCell.selectedCells[0];
|
|
4293
4284
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4294
|
-
return
|
|
4285
|
+
return chunkLTEDT475_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
4295
4286
|
})();
|
|
4296
4287
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
4297
4288
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4368,7 +4359,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4368
4359
|
"border px-1 py-0.5 align-top",
|
|
4369
4360
|
isEditable && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
4370
4361
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
4371
|
-
|
|
4362
|
+
chunkLTEDT475_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
4372
4363
|
),
|
|
4373
4364
|
colSpan,
|
|
4374
4365
|
rowSpan: rSpan,
|
|
@@ -4379,7 +4370,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4379
4370
|
}
|
|
4380
4371
|
event.stopPropagation();
|
|
4381
4372
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
4382
|
-
const rect =
|
|
4373
|
+
const rect = chunkLTEDT475_js.computeSelectionRect(
|
|
4383
4374
|
selectedCell.rowIndex,
|
|
4384
4375
|
selectedCell.columnIndex,
|
|
4385
4376
|
rowIndex,
|
|
@@ -4389,7 +4380,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4389
4380
|
options?.onSelectCell?.({
|
|
4390
4381
|
rowIndex: selectedCell.rowIndex,
|
|
4391
4382
|
columnIndex: selectedCell.columnIndex,
|
|
4392
|
-
selectedCells:
|
|
4383
|
+
selectedCells: chunkLTEDT475_js.rectToCells(rect)
|
|
4393
4384
|
});
|
|
4394
4385
|
} else {
|
|
4395
4386
|
options?.onSelectCell?.({
|
|
@@ -4444,24 +4435,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4444
4435
|
}
|
|
4445
4436
|
var LEGEND_ITEM_WIDTH = 80;
|
|
4446
4437
|
function partAttrs(part) {
|
|
4447
|
-
return part ?
|
|
4438
|
+
return part ? chunkLTEDT475_js.chartPartToAttrs(part) : void 0;
|
|
4448
4439
|
}
|
|
4449
4440
|
function resolveReactPalette(chartData) {
|
|
4450
4441
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
4451
4442
|
return chartData.colorPalette;
|
|
4452
4443
|
}
|
|
4453
|
-
return [...
|
|
4444
|
+
return [...chunkLTEDT475_js.getChartStylePalette(chartData.style?.styleId)];
|
|
4454
4445
|
}
|
|
4455
4446
|
function buildReactChartViewModel(element) {
|
|
4456
4447
|
if (element.type !== "chart" || !element.chartData) {
|
|
4457
|
-
return
|
|
4448
|
+
return chunkLTEDT475_js.buildChartViewModel(element);
|
|
4458
4449
|
}
|
|
4459
4450
|
const palette = resolveReactPalette(element.chartData);
|
|
4460
4451
|
const themedElement = {
|
|
4461
4452
|
...element,
|
|
4462
4453
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
4463
4454
|
};
|
|
4464
|
-
return
|
|
4455
|
+
return chunkLTEDT475_js.buildChartViewModel(themedElement);
|
|
4465
4456
|
}
|
|
4466
4457
|
function renderPrimitive(prim, key) {
|
|
4467
4458
|
switch (prim.kind) {
|
|
@@ -4850,7 +4841,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4850
4841
|
const unmatchedRows = [];
|
|
4851
4842
|
categories.forEach((cat, i) => {
|
|
4852
4843
|
const value = values[i] ?? 0;
|
|
4853
|
-
const code =
|
|
4844
|
+
const code = chunkLTEDT475_js.resolveRegionCode(cat);
|
|
4854
4845
|
if (code) {
|
|
4855
4846
|
regionValueMap.set(code, { value, label: cat });
|
|
4856
4847
|
} else {
|
|
@@ -4888,8 +4879,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4888
4879
|
let fill = "#e2e8f0";
|
|
4889
4880
|
let dataLabel = null;
|
|
4890
4881
|
if (entry) {
|
|
4891
|
-
const t =
|
|
4892
|
-
fill =
|
|
4882
|
+
const t = chunkLTEDT475_js.normalizeValue(entry.value, minVal, maxVal);
|
|
4883
|
+
fill = chunkLTEDT475_js.sequentialColorScale(t);
|
|
4893
4884
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
4894
4885
|
"text",
|
|
4895
4886
|
{
|
|
@@ -4900,7 +4891,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4900
4891
|
fontWeight: 600,
|
|
4901
4892
|
fill: "#1e293b",
|
|
4902
4893
|
style: { pointerEvents: "none" },
|
|
4903
|
-
children:
|
|
4894
|
+
children: chunkLTEDT475_js.formatAxisValue(entry.value)
|
|
4904
4895
|
},
|
|
4905
4896
|
`${element.id}-map-dl-${region.code}`
|
|
4906
4897
|
);
|
|
@@ -4918,7 +4909,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4918
4909
|
opacity: 0.9,
|
|
4919
4910
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
4920
4911
|
region.name,
|
|
4921
|
-
entry ? `: ${
|
|
4912
|
+
entry ? `: ${chunkLTEDT475_js.formatAxisValue(entry.value)}` : ""
|
|
4922
4913
|
] })
|
|
4923
4914
|
}
|
|
4924
4915
|
),
|
|
@@ -4956,7 +4947,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4956
4947
|
fontSize: 7,
|
|
4957
4948
|
fill: "#64748b",
|
|
4958
4949
|
textAnchor: "middle",
|
|
4959
|
-
children:
|
|
4950
|
+
children: chunkLTEDT475_js.formatAxisValue(minVal)
|
|
4960
4951
|
},
|
|
4961
4952
|
`${element.id}-map-legend-min`
|
|
4962
4953
|
),
|
|
@@ -4968,7 +4959,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4968
4959
|
fontSize: 7,
|
|
4969
4960
|
fill: "#64748b",
|
|
4970
4961
|
textAnchor: "middle",
|
|
4971
|
-
children:
|
|
4962
|
+
children: chunkLTEDT475_js.formatAxisValue(maxVal)
|
|
4972
4963
|
},
|
|
4973
4964
|
`${element.id}-map-legend-max`
|
|
4974
4965
|
)
|
|
@@ -4987,7 +4978,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4987
4978
|
textAnchor: "middle",
|
|
4988
4979
|
fontSize: 7,
|
|
4989
4980
|
fill: "#94a3b8",
|
|
4990
|
-
children:
|
|
4981
|
+
children: chunk25VSL2BB_js.translationsEn["pptx.chart.additionalRegionsFallback"]
|
|
4991
4982
|
},
|
|
4992
4983
|
`${element.id}-map-ft-hdr`
|
|
4993
4984
|
)
|
|
@@ -5034,7 +5025,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
5034
5025
|
y,
|
|
5035
5026
|
fontSize,
|
|
5036
5027
|
fill: "#475569",
|
|
5037
|
-
children:
|
|
5028
|
+
children: chunkLTEDT475_js.formatAxisValue(row.value)
|
|
5038
5029
|
},
|
|
5039
5030
|
`${element.id}-map-ft-val-${i}`
|
|
5040
5031
|
)
|
|
@@ -5105,7 +5096,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
5105
5096
|
|
|
5106
5097
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
5107
5098
|
function sColor(series, idx) {
|
|
5108
|
-
return
|
|
5099
|
+
return chunkLTEDT475_js.seriesColor(series, idx);
|
|
5109
5100
|
}
|
|
5110
5101
|
function valToY(val, range, topY, bottomY) {
|
|
5111
5102
|
const usable = bottomY - topY;
|
|
@@ -5644,7 +5635,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5644
5635
|
width: 10,
|
|
5645
5636
|
height: 10,
|
|
5646
5637
|
rx: 2,
|
|
5647
|
-
fill:
|
|
5638
|
+
fill: chunkLTEDT475_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5648
5639
|
},
|
|
5649
5640
|
`${id}-leg-r-${i}`
|
|
5650
5641
|
)
|
|
@@ -5668,7 +5659,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5668
5659
|
width: 10,
|
|
5669
5660
|
height: 10,
|
|
5670
5661
|
rx: 2,
|
|
5671
|
-
fill:
|
|
5662
|
+
fill: chunkLTEDT475_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5672
5663
|
}
|
|
5673
5664
|
),
|
|
5674
5665
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -5681,9 +5672,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5681
5672
|
}
|
|
5682
5673
|
const lines = [];
|
|
5683
5674
|
if (range.logScale && range.logBase) {
|
|
5684
|
-
const ticks =
|
|
5675
|
+
const ticks = chunkLTEDT475_js.generateLogTicks(range);
|
|
5685
5676
|
ticks.forEach((tickVal, i) => {
|
|
5686
|
-
const y =
|
|
5677
|
+
const y = chunkLTEDT475_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5687
5678
|
lines.push(
|
|
5688
5679
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5689
5680
|
"line",
|
|
@@ -5704,7 +5695,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5704
5695
|
const steps = 4;
|
|
5705
5696
|
for (let i = 0; i <= steps; i++) {
|
|
5706
5697
|
const val = range.min + range.span * i / steps;
|
|
5707
|
-
const y =
|
|
5698
|
+
const y = chunkLTEDT475_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5708
5699
|
lines.push(
|
|
5709
5700
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5710
5701
|
"line",
|
|
@@ -5728,9 +5719,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5728
5719
|
const labels = [];
|
|
5729
5720
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5730
5721
|
if (range.logScale && range.logBase) {
|
|
5731
|
-
const ticks =
|
|
5722
|
+
const ticks = chunkLTEDT475_js.generateLogTicks(range);
|
|
5732
5723
|
ticks.forEach((tickVal, i) => {
|
|
5733
|
-
const y =
|
|
5724
|
+
const y = chunkLTEDT475_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5734
5725
|
labels.push(
|
|
5735
5726
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5736
5727
|
"text",
|
|
@@ -5740,7 +5731,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5740
5731
|
textAnchor: "end",
|
|
5741
5732
|
fontSize: 8,
|
|
5742
5733
|
fill: "#64748b",
|
|
5743
|
-
children: hasDisplayUnits ?
|
|
5734
|
+
children: hasDisplayUnits ? chunkLTEDT475_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunkLTEDT475_js.formatAxisValue(tickVal)
|
|
5744
5735
|
},
|
|
5745
5736
|
`${id}-vaxis-log-${i}`
|
|
5746
5737
|
)
|
|
@@ -5750,7 +5741,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5750
5741
|
const steps = 4;
|
|
5751
5742
|
for (let i = 0; i <= steps; i++) {
|
|
5752
5743
|
const val = range.min + range.span * i / steps;
|
|
5753
|
-
const y =
|
|
5744
|
+
const y = chunkLTEDT475_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5754
5745
|
labels.push(
|
|
5755
5746
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5756
5747
|
"text",
|
|
@@ -5760,7 +5751,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5760
5751
|
textAnchor: "end",
|
|
5761
5752
|
fontSize: 8,
|
|
5762
5753
|
fill: "#64748b",
|
|
5763
|
-
children: hasDisplayUnits ?
|
|
5754
|
+
children: hasDisplayUnits ? chunkLTEDT475_js.formatAxisValueWithUnits(val, axisFormatting) : chunkLTEDT475_js.formatAxisValue(val)
|
|
5764
5755
|
},
|
|
5765
5756
|
`${id}-vaxis-${i}`
|
|
5766
5757
|
)
|
|
@@ -5768,7 +5759,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5768
5759
|
}
|
|
5769
5760
|
}
|
|
5770
5761
|
if (hasDisplayUnits) {
|
|
5771
|
-
const unitLabel =
|
|
5762
|
+
const unitLabel = chunkLTEDT475_js.getDisplayUnitLabel(
|
|
5772
5763
|
axisFormatting.displayUnits,
|
|
5773
5764
|
axisFormatting.displayUnitsLabel
|
|
5774
5765
|
);
|
|
@@ -5843,7 +5834,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
5843
5834
|
if (range.min >= 0) {
|
|
5844
5835
|
return null;
|
|
5845
5836
|
}
|
|
5846
|
-
const y =
|
|
5837
|
+
const y = chunkLTEDT475_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
5847
5838
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5848
5839
|
"line",
|
|
5849
5840
|
{
|
|
@@ -5867,7 +5858,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5867
5858
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5868
5859
|
for (let i = 0; i <= steps; i++) {
|
|
5869
5860
|
const val = range.min + range.span * i / steps;
|
|
5870
|
-
const y =
|
|
5861
|
+
const y = chunkLTEDT475_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5871
5862
|
labels.push(
|
|
5872
5863
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5873
5864
|
"text",
|
|
@@ -5879,7 +5870,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5879
5870
|
fontFamily,
|
|
5880
5871
|
fontWeight,
|
|
5881
5872
|
fill: fontColor,
|
|
5882
|
-
children: hasDisplayUnits ?
|
|
5873
|
+
children: hasDisplayUnits ? chunkLTEDT475_js.formatAxisValueWithUnits(val, axisFormatting) : chunkLTEDT475_js.formatAxisValue(val)
|
|
5883
5874
|
},
|
|
5884
5875
|
`${id}-sec-vaxis-${i}`
|
|
5885
5876
|
)
|
|
@@ -5903,7 +5894,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5903
5894
|
);
|
|
5904
5895
|
}
|
|
5905
5896
|
if (hasDisplayUnits) {
|
|
5906
|
-
const unitLabel =
|
|
5897
|
+
const unitLabel = chunkLTEDT475_js.getDisplayUnitLabel(
|
|
5907
5898
|
axisFormatting.displayUnits,
|
|
5908
5899
|
axisFormatting.displayUnitsLabel
|
|
5909
5900
|
);
|
|
@@ -5934,7 +5925,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
5934
5925
|
const ticks = [];
|
|
5935
5926
|
for (let i = 0; i <= steps; i++) {
|
|
5936
5927
|
const val = range.min + range.span * i / steps;
|
|
5937
|
-
const y =
|
|
5928
|
+
const y = chunkLTEDT475_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5938
5929
|
ticks.push(
|
|
5939
5930
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5940
5931
|
"line",
|
|
@@ -5961,7 +5952,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
5961
5952
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
5962
5953
|
for (let i = 0; i <= steps; i++) {
|
|
5963
5954
|
const val = range.min + range.span * i / steps;
|
|
5964
|
-
const y =
|
|
5955
|
+
const y = chunkLTEDT475_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5965
5956
|
lines.push(
|
|
5966
5957
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5967
5958
|
"line",
|
|
@@ -6079,7 +6070,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6079
6070
|
showK && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6080
6071
|
"th",
|
|
6081
6072
|
{
|
|
6082
|
-
"aria-label":
|
|
6073
|
+
"aria-label": chunk25VSL2BB_js.translationsEn["pptx.chart.rowLabelsAria"],
|
|
6083
6074
|
style: {
|
|
6084
6075
|
padding: "1px 4px",
|
|
6085
6076
|
fontWeight: 400,
|
|
@@ -6123,7 +6114,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6123
6114
|
width: 8,
|
|
6124
6115
|
height: 8,
|
|
6125
6116
|
borderRadius: 2,
|
|
6126
|
-
backgroundColor:
|
|
6117
|
+
backgroundColor: chunkLTEDT475_js.seriesColor(
|
|
6127
6118
|
s,
|
|
6128
6119
|
si,
|
|
6129
6120
|
chartData.style?.styleId,
|
|
@@ -6162,8 +6153,8 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6162
6153
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
6163
6154
|
const style = chartData.style;
|
|
6164
6155
|
const legendPos = style?.legendPosition || "b";
|
|
6165
|
-
const range =
|
|
6166
|
-
const layout =
|
|
6156
|
+
const range = chunkLTEDT475_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6157
|
+
const layout = chunkLTEDT475_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6167
6158
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6168
6159
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
6169
6160
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -6184,10 +6175,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6184
6175
|
const close = closeSeries.values[ci] ?? high;
|
|
6185
6176
|
const isUp = close >= open;
|
|
6186
6177
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
6187
|
-
const highY =
|
|
6188
|
-
const lowY =
|
|
6189
|
-
const openY =
|
|
6190
|
-
const closeY =
|
|
6178
|
+
const highY = chunkLTEDT475_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
6179
|
+
const lowY = chunkLTEDT475_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
6180
|
+
const openY = chunkLTEDT475_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
6181
|
+
const closeY = chunkLTEDT475_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
|
|
6191
6182
|
elements.push(
|
|
6192
6183
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6193
6184
|
"line",
|
|
@@ -6230,7 +6221,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6230
6221
|
textAnchor: "middle",
|
|
6231
6222
|
fontSize: 7,
|
|
6232
6223
|
fill: "#334155",
|
|
6233
|
-
children:
|
|
6224
|
+
children: chunkLTEDT475_js.formatAxisValue(close)
|
|
6234
6225
|
},
|
|
6235
6226
|
`${element.id}-stock-dl-${ci}`
|
|
6236
6227
|
)
|
|
@@ -6272,7 +6263,7 @@ function FailedToLoad() {
|
|
|
6272
6263
|
var LazySurfaceChart3DScene = React6__default.default.lazy(
|
|
6273
6264
|
async () => {
|
|
6274
6265
|
try {
|
|
6275
|
-
return await import('./SurfaceChart3DScene-
|
|
6266
|
+
return await import('./SurfaceChart3DScene-K7Q5NYZ4.js');
|
|
6276
6267
|
} catch {
|
|
6277
6268
|
return { default: FailedToLoad };
|
|
6278
6269
|
}
|
|
@@ -6296,7 +6287,7 @@ var SurfaceChart3DErrorBoundary = class extends React6__default.default.Componen
|
|
|
6296
6287
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
6297
6288
|
const rows = chartData.series.length;
|
|
6298
6289
|
const cols = Math.max(categoryLabels.length, 1);
|
|
6299
|
-
const range =
|
|
6290
|
+
const range = chunkLTEDT475_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6300
6291
|
const heightMap = new Float32Array(rows * cols);
|
|
6301
6292
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
6302
6293
|
for (let r = 0; r < rows; r++) {
|
|
@@ -6416,8 +6407,8 @@ function darkenRgb(r, g, b, factor) {
|
|
|
6416
6407
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
6417
6408
|
const style = chartData.style;
|
|
6418
6409
|
const legendPos = style?.legendPosition || "b";
|
|
6419
|
-
const layout =
|
|
6420
|
-
const range =
|
|
6410
|
+
const layout = chunkLTEDT475_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6411
|
+
const range = chunkLTEDT475_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6421
6412
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6422
6413
|
const seriesCount = chartData.series.length;
|
|
6423
6414
|
const cols = catCount - 1;
|
|
@@ -6507,8 +6498,8 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6507
6498
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
6508
6499
|
const style = chartData.style;
|
|
6509
6500
|
const legendPos = style?.legendPosition || "b";
|
|
6510
|
-
const layout =
|
|
6511
|
-
const range =
|
|
6501
|
+
const layout = chunkLTEDT475_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6502
|
+
const range = chunkLTEDT475_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6512
6503
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6513
6504
|
const seriesCount = chartData.series.length;
|
|
6514
6505
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -6571,7 +6562,7 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6571
6562
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
6572
6563
|
const style = chartData.style;
|
|
6573
6564
|
const legendPos = style?.legendPosition || "b";
|
|
6574
|
-
const layout =
|
|
6565
|
+
const layout = chunkLTEDT475_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6575
6566
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
6576
6567
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
6577
6568
|
const rects = [];
|
|
@@ -6594,7 +6585,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
6594
6585
|
y: curY,
|
|
6595
6586
|
width: Math.max(w - 1, 1),
|
|
6596
6587
|
height: Math.max(h - 1, 1),
|
|
6597
|
-
fill:
|
|
6588
|
+
fill: chunkLTEDT475_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
6598
6589
|
rx: 2,
|
|
6599
6590
|
opacity: 0.85
|
|
6600
6591
|
},
|
|
@@ -6647,8 +6638,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6647
6638
|
const style = chartData.style;
|
|
6648
6639
|
const legendPos = style?.legendPosition || "b";
|
|
6649
6640
|
const values = chartData.series[0]?.values ?? [];
|
|
6650
|
-
const range =
|
|
6651
|
-
const layout =
|
|
6641
|
+
const range = chunkLTEDT475_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6642
|
+
const layout = chunkLTEDT475_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6652
6643
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
6653
6644
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
6654
6645
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -6659,8 +6650,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6659
6650
|
const isLast = i === values.length - 1;
|
|
6660
6651
|
const startVal = isLast ? 0 : runningTotal;
|
|
6661
6652
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
6662
|
-
const barStartY =
|
|
6663
|
-
const barEndY =
|
|
6653
|
+
const barStartY = chunkLTEDT475_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
6654
|
+
const barEndY = chunkLTEDT475_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
|
|
6664
6655
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
6665
6656
|
const y = Math.min(barStartY, barEndY);
|
|
6666
6657
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -6689,7 +6680,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6689
6680
|
textAnchor: "middle",
|
|
6690
6681
|
fontSize: 7,
|
|
6691
6682
|
fill: "#334155",
|
|
6692
|
-
children:
|
|
6683
|
+
children: chunkLTEDT475_js.formatAxisValue(isLast ? endVal : val)
|
|
6693
6684
|
},
|
|
6694
6685
|
`${element.id}-wf-dl-${i}`
|
|
6695
6686
|
)
|
|
@@ -6737,18 +6728,18 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6737
6728
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
6738
6729
|
const style = chartData.style;
|
|
6739
6730
|
const legendPos = style?.legendPosition || "b";
|
|
6740
|
-
const layoutOpts =
|
|
6731
|
+
const layoutOpts = chunkLTEDT475_js.computeLayoutOptions(
|
|
6741
6732
|
chartData.axes,
|
|
6742
6733
|
chartData.dataTable,
|
|
6743
6734
|
chartData.series.length
|
|
6744
6735
|
);
|
|
6745
|
-
const layout =
|
|
6746
|
-
const { primary, secondary } =
|
|
6736
|
+
const layout = chunkLTEDT475_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
6737
|
+
const { primary, secondary } = chunkLTEDT475_js.splitSeriesByAxis(chartData.series, chartData.axes);
|
|
6747
6738
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
6748
6739
|
const secondarySeries = secondary.map((e) => e.series);
|
|
6749
|
-
const range =
|
|
6750
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
6751
|
-
const secondaryAxisFmt =
|
|
6740
|
+
const range = chunkLTEDT475_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
6741
|
+
const secondaryRange = secondarySeries.length > 0 ? chunkLTEDT475_js.computeValueRange(secondarySeries) : void 0;
|
|
6742
|
+
const secondaryAxisFmt = chunkLTEDT475_js.getSecondaryValueAxis(chartData.axes);
|
|
6752
6743
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6753
6744
|
const barSeriesCount = 1;
|
|
6754
6745
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -6764,8 +6755,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6764
6755
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
6765
6756
|
barSeries.values.forEach((val, vi) => {
|
|
6766
6757
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
6767
|
-
const zeroY =
|
|
6768
|
-
const valY =
|
|
6758
|
+
const zeroY = chunkLTEDT475_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
6759
|
+
const valY = chunkLTEDT475_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
|
|
6769
6760
|
const y = Math.min(zeroY, valY);
|
|
6770
6761
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
6771
6762
|
barElements.push(
|
|
@@ -6776,7 +6767,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6776
6767
|
y,
|
|
6777
6768
|
width: barWidth,
|
|
6778
6769
|
height: h,
|
|
6779
|
-
fill:
|
|
6770
|
+
fill: chunkLTEDT475_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
6780
6771
|
rx: 1
|
|
6781
6772
|
},
|
|
6782
6773
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -6792,7 +6783,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6792
6783
|
textAnchor: "middle",
|
|
6793
6784
|
fontSize: 7,
|
|
6794
6785
|
fill: "#334155",
|
|
6795
|
-
children:
|
|
6786
|
+
children: chunkLTEDT475_js.formatAxisValue(val)
|
|
6796
6787
|
},
|
|
6797
6788
|
`${element.id}-combo-bar-dl-${vi}`
|
|
6798
6789
|
)
|
|
@@ -6809,10 +6800,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6809
6800
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
6810
6801
|
const points = series.values.map((val, vi) => {
|
|
6811
6802
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
6812
|
-
const y =
|
|
6803
|
+
const y = chunkLTEDT475_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
6813
6804
|
return { x, y, val };
|
|
6814
6805
|
});
|
|
6815
|
-
const c =
|
|
6806
|
+
const c = chunkLTEDT475_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
6816
6807
|
lineElements.push(
|
|
6817
6808
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6818
6809
|
"polyline",
|
|
@@ -6839,7 +6830,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6839
6830
|
textAnchor: "middle",
|
|
6840
6831
|
fontSize: 7,
|
|
6841
6832
|
fill: "#334155",
|
|
6842
|
-
children:
|
|
6833
|
+
children: chunkLTEDT475_js.formatAxisValue(p.val)
|
|
6843
6834
|
},
|
|
6844
6835
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
6845
6836
|
)
|
|
@@ -6877,11 +6868,11 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6877
6868
|
}
|
|
6878
6869
|
function renderChartElement(element) {
|
|
6879
6870
|
if (element.type !== "chart") {
|
|
6880
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
6871
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunk25VSL2BB_js.translationsEn["pptx.chart.heading"] });
|
|
6881
6872
|
}
|
|
6882
6873
|
const chartData = element.chartData;
|
|
6883
6874
|
if (!chartData || chartData.series.length === 0) {
|
|
6884
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
6875
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunk25VSL2BB_js.translationsEn["pptx.chart.heading"] });
|
|
6885
6876
|
}
|
|
6886
6877
|
const longestSeriesLength = chartData.series.reduce(
|
|
6887
6878
|
(maxLength, series) => Math.max(maxLength, series.values.length),
|
|
@@ -7985,14 +7976,14 @@ function buildNotesPdf(pages) {
|
|
|
7985
7976
|
notes: page.notes,
|
|
7986
7977
|
slideNumber: page.slideNumber
|
|
7987
7978
|
}));
|
|
7988
|
-
const bytes =
|
|
7979
|
+
const bytes = chunkLTEDT475_js.buildNotesPdfBytes(images, meta);
|
|
7989
7980
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
7990
7981
|
return URL.createObjectURL(blob);
|
|
7991
7982
|
}
|
|
7992
7983
|
|
|
7993
7984
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
7994
7985
|
function buildPdfFromImageData(images) {
|
|
7995
|
-
const bytes =
|
|
7986
|
+
const bytes = chunkLTEDT475_js.buildSlidesPdfBytes(images);
|
|
7996
7987
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
7997
7988
|
return URL.createObjectURL(blob);
|
|
7998
7989
|
}
|
|
@@ -8001,7 +7992,7 @@ function buildPdfFromImageData(images) {
|
|
|
8001
7992
|
var activePreview = null;
|
|
8002
7993
|
function startPreviewAnimation(elementId, preset, options) {
|
|
8003
7994
|
stopPreviewAnimation();
|
|
8004
|
-
const descriptor =
|
|
7995
|
+
const descriptor = chunkLTEDT475_js.buildPreviewAnimation(preset, options);
|
|
8005
7996
|
if (!descriptor) {
|
|
8006
7997
|
return;
|
|
8007
7998
|
}
|