pptx-react-viewer 2.3.0 → 2.4.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 +2 -0
- package/dist/{AiChatPanel-HC3CE3TL.js → AiChatPanel-HLLGXBZF.js} +23 -24
- package/dist/AiChatPanel-HLLGXBZF.js.br +0 -0
- package/dist/AiChatPanel-HLLGXBZF.js.gz +0 -0
- package/dist/{AiChatPanel-PXZYHJUB.mjs → AiChatPanel-SXYMXFYS.mjs} +4 -5
- package/dist/AiChatPanel-SXYMXFYS.mjs.br +0 -0
- package/dist/AiChatPanel-SXYMXFYS.mjs.gz +0 -0
- package/dist/{Model3DScene-ZG4HTMPX.mjs → Model3DScene-IECT4RWT.mjs} +1 -2
- package/dist/Model3DScene-IECT4RWT.mjs.br +0 -0
- package/dist/Model3DScene-IECT4RWT.mjs.gz +0 -0
- package/dist/{Model3DScene-37QZRHV5.js → Model3DScene-ZQBWLAMC.js} +2 -3
- package/dist/Model3DScene-ZQBWLAMC.js.br +0 -0
- package/dist/Model3DScene-ZQBWLAMC.js.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-4KRMRWW6.js} +2 -3
- package/dist/SurfaceChart3DScene-4KRMRWW6.js.br +0 -0
- package/dist/SurfaceChart3DScene-4KRMRWW6.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-Z7R6DZXN.mjs → SurfaceChart3DScene-52C3IMPQ.mjs} +1 -2
- package/dist/SurfaceChart3DScene-52C3IMPQ.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-52C3IMPQ.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-EUIFPDXZ.js → chunk-5GHLRHBR.js} +3 -3
- package/dist/chunk-5GHLRHBR.js.br +0 -0
- package/dist/chunk-5GHLRHBR.js.gz +0 -0
- package/dist/{chunk-P7UVBRFO.js → chunk-5TPQJWEO.js} +248 -249
- package/dist/chunk-5TPQJWEO.js.br +0 -0
- package/dist/chunk-5TPQJWEO.js.gz +0 -0
- package/dist/{chunk-VOHTAUN4.mjs → chunk-G6Q3NXRV.mjs} +3 -4
- package/dist/chunk-G6Q3NXRV.mjs.br +0 -0
- package/dist/chunk-G6Q3NXRV.mjs.gz +0 -0
- package/dist/{chunk-J5A22DZ7.mjs → chunk-KK7FWBGO.mjs} +36 -41
- package/dist/chunk-KK7FWBGO.mjs.br +0 -0
- package/dist/chunk-KK7FWBGO.mjs.gz +0 -0
- package/dist/{chunk-I5LEMC5C.mjs → chunk-LRIXPSVT.mjs} +4 -6
- package/dist/chunk-LRIXPSVT.mjs.br +0 -0
- package/dist/chunk-LRIXPSVT.mjs.gz +0 -0
- package/dist/{chunk-M5YR3QSB.mjs → chunk-Q6FC2552.mjs} +1 -1
- package/dist/chunk-Q6FC2552.mjs.br +0 -0
- package/dist/{chunk-M5YR3QSB.mjs.gz → chunk-Q6FC2552.mjs.gz} +0 -0
- package/dist/{chunk-3TB45PVK.js → chunk-QBZA2GMB.mjs} +47751 -32270
- package/dist/chunk-QBZA2GMB.mjs.br +0 -0
- package/dist/chunk-QBZA2GMB.mjs.gz +0 -0
- package/dist/{chunk-L7JNCVTF.js → chunk-VEZO33T2.js} +314 -316
- package/dist/chunk-VEZO33T2.js.br +0 -0
- package/dist/chunk-VEZO33T2.js.gz +0 -0
- package/dist/{chunk-JFNMD6TM.mjs → chunk-WK56SFN7.js} +48250 -31698
- package/dist/chunk-WK56SFN7.js.br +0 -0
- package/dist/chunk-WK56SFN7.js.gz +0 -0
- package/dist/{chunk-ZLSVW5GP.js → chunk-XSBFV6TL.js} +876 -881
- package/dist/chunk-XSBFV6TL.js.br +0 -0
- package/dist/chunk-XSBFV6TL.js.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 +79 -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 +506 -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 +79 -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-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 chunkWK56SFN7_js = require('./chunk-WK56SFN7.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 chunkWK56SFN7_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 chunkWK56SFN7_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 = chunkWK56SFN7_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 (!chunkWK56SFN7_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) => chunkWK56SFN7_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) => !chunkWK56SFN7_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 (!chunkWK56SFN7_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 = chunkWK56SFN7_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 = chunkWK56SFN7_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 (!chunkWK56SFN7_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 = chunkWK56SFN7_js.clampCropValue(element.cropLeft);
|
|
324
|
+
const cropTop = chunkWK56SFN7_js.clampCropValue(element.cropTop);
|
|
325
|
+
const cropRight = chunkWK56SFN7_js.clampCropValue(element.cropRight);
|
|
326
|
+
const cropBottom = chunkWK56SFN7_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 = chunkWK56SFN7_js.clampCropValue(cropLeft * safeHorizontalScale);
|
|
339
|
+
const normalizedRight = chunkWK56SFN7_js.clampCropValue(cropRight * safeHorizontalScale);
|
|
340
|
+
const normalizedTop = chunkWK56SFN7_js.clampCropValue(cropTop * safeVerticalScale);
|
|
341
|
+
const normalizedBottom = chunkWK56SFN7_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 (!chunkWK56SFN7_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 (!chunkWK56SFN7_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 (!chunkWK56SFN7_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 = chunkWK56SFN7_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 (!chunkWK56SFN7_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 ? chunkWK56SFN7_js.normalizeHexColor(element.textStyle?.color, HYPERLINK_COLOR) : chunkWK56SFN7_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 = chunkWK56SFN7_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
1194
|
+
const textOrientation = chunkWK56SFN7_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
1195
|
+
const verticalDirection = chunkWK56SFN7_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 ? chunkWK56SFN7_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: chunkWK56SFN7_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
|
+
...chunkWK56SFN7_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 (!chunkWK56SFN7_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 = chunkWK56SFN7_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
1269
|
+
const textOrientation = chunkWK56SFN7_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
1270
|
+
const verticalDirection = chunkWK56SFN7_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 = chunkWK56SFN7_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 = chunkWK56SFN7_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 chunkWK56SFN7_js.buildTextFillCss(style);
|
|
1336
1335
|
}
|
|
1337
1336
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
1338
|
-
return
|
|
1337
|
+
return chunkWK56SFN7_js.buildTextBody3DSceneStyle(textStyle);
|
|
1339
1338
|
}
|
|
1340
1339
|
|
|
1341
1340
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -1520,17 +1519,17 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1520
1519
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
1521
1520
|
return renderedSegments;
|
|
1522
1521
|
}
|
|
1523
|
-
const paraKey = `${elementId}${
|
|
1522
|
+
const paraKey = `${elementId}${chunkWK56SFN7_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 firstWordKey = `${elementId}${
|
|
1528
|
+
const firstWordKey = `${elementId}${chunkWK56SFN7_js.TEXT_BUILD_ID_SEP}w${paraIndex}-0`;
|
|
1530
1529
|
if (subElementAnimStates.has(firstWordKey)) {
|
|
1531
1530
|
return wrapByWord(elementId, paraIndex, paraSegments, subElementAnimStates);
|
|
1532
1531
|
}
|
|
1533
|
-
const firstCharKey = `${elementId}${
|
|
1532
|
+
const firstCharKey = `${elementId}${chunkWK56SFN7_js.TEXT_BUILD_ID_SEP}c${paraIndex}-0`;
|
|
1534
1533
|
if (subElementAnimStates.has(firstCharKey)) {
|
|
1535
1534
|
return wrapByChar(elementId, paraIndex, paraSegments, subElementAnimStates);
|
|
1536
1535
|
}
|
|
@@ -1551,7 +1550,7 @@ function wrapByWord(elementId, paraIndex, paraSegments, states) {
|
|
|
1551
1550
|
nodes.push(/* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Fragment, { children: w }, `ws-${i}`));
|
|
1552
1551
|
continue;
|
|
1553
1552
|
}
|
|
1554
|
-
const key = `${elementId}${
|
|
1553
|
+
const key = `${elementId}${chunkWK56SFN7_js.TEXT_BUILD_ID_SEP}w${paraIndex}-${wordIdx}`;
|
|
1555
1554
|
const state = states.get(key);
|
|
1556
1555
|
const style = buildAnimStyle(state);
|
|
1557
1556
|
nodes.push(
|
|
@@ -1565,7 +1564,7 @@ function wrapByChar(elementId, paraIndex, paraSegments, states) {
|
|
|
1565
1564
|
const fullText = paraSegments.map((e) => e.segment.text).join("");
|
|
1566
1565
|
const nodes = [];
|
|
1567
1566
|
for (let i = 0; i < fullText.length; i++) {
|
|
1568
|
-
const key = `${elementId}${
|
|
1567
|
+
const key = `${elementId}${chunkWK56SFN7_js.TEXT_BUILD_ID_SEP}c${paraIndex}-${i}`;
|
|
1569
1568
|
const state = states.get(key);
|
|
1570
1569
|
const style = buildAnimStyle(state);
|
|
1571
1570
|
nodes.push(
|
|
@@ -1711,10 +1710,10 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1711
1710
|
if (!needsScriptFonts || !text) {
|
|
1712
1711
|
return text;
|
|
1713
1712
|
}
|
|
1714
|
-
const runs =
|
|
1713
|
+
const runs = chunkWK56SFN7_js.segmentByScript(text);
|
|
1715
1714
|
if (runs.length <= 1) {
|
|
1716
1715
|
if (runs.length === 1) {
|
|
1717
|
-
const font =
|
|
1716
|
+
const font = chunkWK56SFN7_js.resolveFontForScript(runs[0].script, scriptFonts);
|
|
1718
1717
|
if (font && font !== baseFontFamily) {
|
|
1719
1718
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: text });
|
|
1720
1719
|
}
|
|
@@ -1722,7 +1721,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1722
1721
|
return text;
|
|
1723
1722
|
}
|
|
1724
1723
|
return runs.map((run, i) => {
|
|
1725
|
-
const font =
|
|
1724
|
+
const font = chunkWK56SFN7_js.resolveFontForScript(run.script, scriptFonts);
|
|
1726
1725
|
if (!font || font === baseFontFamily) {
|
|
1727
1726
|
return /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Fragment, { children: run.text }, `${keyPrefix}-r${i}`);
|
|
1728
1727
|
}
|
|
@@ -1794,8 +1793,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1794
1793
|
);
|
|
1795
1794
|
}
|
|
1796
1795
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
1797
|
-
const mathml =
|
|
1798
|
-
const safeMathml = mathml ?
|
|
1796
|
+
const mathml = chunkWK56SFN7_js.convertOmmlToMathMl(equationXml);
|
|
1797
|
+
const safeMathml = mathml ? chunkWK56SFN7_js.sanitizeMathMl(mathml) : "";
|
|
1799
1798
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1800
1799
|
"span",
|
|
1801
1800
|
{
|
|
@@ -1805,7 +1804,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1805
1804
|
},
|
|
1806
1805
|
dangerouslySetInnerHTML: { __html: safeMathml }
|
|
1807
1806
|
}
|
|
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:
|
|
1807
|
+
) : /* @__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
1808
|
if (equationNumber) {
|
|
1810
1809
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1811
1810
|
"span",
|
|
@@ -1845,7 +1844,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1845
1844
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: equationContent }, `${elementId}-seg-${segmentIndex}`);
|
|
1846
1845
|
}
|
|
1847
1846
|
function renderPictureBullet(elementId, segmentIndex, bulletInfo, baseFontSize) {
|
|
1848
|
-
const picture =
|
|
1847
|
+
const picture = chunkWK56SFN7_js.resolvePictureBullet(bulletInfo, baseFontSize) ?? {
|
|
1849
1848
|
sizePx: baseFontSize,
|
|
1850
1849
|
fallbackMarker: "\u2022",
|
|
1851
1850
|
accessibleLabel: "Bullet"
|
|
@@ -1895,7 +1894,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1895
1894
|
);
|
|
1896
1895
|
}
|
|
1897
1896
|
const segmentStyle = segment.style || {};
|
|
1898
|
-
const textValue =
|
|
1897
|
+
const textValue = chunkWK56SFN7_js.substituteFieldText(segment.text || "", segment.fieldType, fieldContext);
|
|
1899
1898
|
const lines = textValue.split("\n");
|
|
1900
1899
|
const textDecorationTokens = [];
|
|
1901
1900
|
if (segmentStyle.underline || segmentStyle.hyperlink) {
|
|
@@ -1905,8 +1904,8 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1905
1904
|
textDecorationTokens.push("line-through");
|
|
1906
1905
|
}
|
|
1907
1906
|
const isDoubleStrike = segmentStyle.strikethrough && segmentStyle.strikeType === "dblStrike";
|
|
1908
|
-
const resolvedSegmentColor = segmentStyle.hyperlink ?
|
|
1909
|
-
const underlineDecoration =
|
|
1907
|
+
const resolvedSegmentColor = segmentStyle.hyperlink ? chunkWK56SFN7_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, HYPERLINK_COLOR) : chunkWK56SFN7_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, fallbackColor);
|
|
1908
|
+
const underlineDecoration = chunkWK56SFN7_js.resolveUnderlineDecorationStyle(
|
|
1910
1909
|
Boolean(isDoubleStrike),
|
|
1911
1910
|
segmentStyle.underlineStyle
|
|
1912
1911
|
);
|
|
@@ -1922,14 +1921,14 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1922
1921
|
const baseFontSizePt = baseFontSize * (72 / 96);
|
|
1923
1922
|
const fontKerning = typeof segmentStyle.kerning === "number" ? segmentStyle.kerning === 0 ? "none" : baseFontSizePt >= segmentStyle.kerning / 100 ? "normal" : "none" : void 0;
|
|
1924
1923
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
1925
|
-
const baseFontFamily = rawFontFamily ?
|
|
1924
|
+
const baseFontFamily = rawFontFamily ? chunkWK56SFN7_js.getSubstituteFontFamily(rawFontFamily) : DEFAULT_FONT_FAMILY;
|
|
1926
1925
|
const scriptFonts = {
|
|
1927
1926
|
latin: baseFontFamily,
|
|
1928
1927
|
eastAsia: segmentStyle.eastAsiaFont || element.textStyle?.eastAsiaFont || baseFontFamily,
|
|
1929
1928
|
complexScript: segmentStyle.complexScriptFont || element.textStyle?.complexScriptFont || baseFontFamily,
|
|
1930
1929
|
symbol: segmentStyle.symbolFont || element.textStyle?.symbolFont || baseFontFamily
|
|
1931
1930
|
};
|
|
1932
|
-
const needsScriptFonts =
|
|
1931
|
+
const needsScriptFonts = chunkWK56SFN7_js.hasDistinctScriptFonts(scriptFonts);
|
|
1933
1932
|
const spanStyle = {
|
|
1934
1933
|
color: resolvedSegmentColor,
|
|
1935
1934
|
fontSize: baseFontSize * baselineFontScale,
|
|
@@ -1947,15 +1946,15 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1947
1946
|
fontVariantCaps: segmentStyle.textCaps === "small" ? "small-caps" : void 0,
|
|
1948
1947
|
letterSpacing,
|
|
1949
1948
|
fontKerning,
|
|
1950
|
-
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ?
|
|
1949
|
+
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ? chunkWK56SFN7_js.normalizeHexColor(segmentStyle.highlightColor, "transparent") : void 0,
|
|
1951
1950
|
...textFillStyles,
|
|
1952
|
-
textDecorationColor: segmentStyle.underlineColor ?
|
|
1953
|
-
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${
|
|
1951
|
+
textDecorationColor: segmentStyle.underlineColor ? chunkWK56SFN7_js.normalizeHexColor(segmentStyle.underlineColor, void 0) : void 0,
|
|
1952
|
+
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${chunkWK56SFN7_js.normalizeHexColor(segmentStyle.textOutlineColor, "#000000")}` : segmentStyle.textOutlineWidth ? `${segmentStyle.textOutlineWidth}px currentColor` : void 0,
|
|
1954
1953
|
paintOrder: segmentStyle.textOutlineWidth ? "stroke fill" : void 0,
|
|
1955
|
-
textShadow:
|
|
1956
|
-
filter:
|
|
1957
|
-
opacity:
|
|
1958
|
-
WebkitBoxReflect:
|
|
1954
|
+
textShadow: chunkWK56SFN7_js.buildTextShadowCss(segmentStyle),
|
|
1955
|
+
filter: chunkWK56SFN7_js.buildTextRunFilterChain(segmentStyle),
|
|
1956
|
+
opacity: chunkWK56SFN7_js.getTextAlphaOpacity(segmentStyle),
|
|
1957
|
+
WebkitBoxReflect: chunkWK56SFN7_js.buildTextReflectionCss(segmentStyle)
|
|
1959
1958
|
};
|
|
1960
1959
|
const runRtl = segmentStyle.rtl;
|
|
1961
1960
|
if (runRtl !== void 0 && runRtl !== paragraphRtl) {
|
|
@@ -1975,7 +1974,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1975
1974
|
spanStyle.fontSize = baseFontSize * (bulletInfo.sizePercent / 100) * baselineFontScale;
|
|
1976
1975
|
}
|
|
1977
1976
|
if (bulletInfo.color) {
|
|
1978
|
-
spanStyle.color =
|
|
1977
|
+
spanStyle.color = chunkWK56SFN7_js.normalizeHexColor(bulletInfo.color, resolvedSegmentColor);
|
|
1979
1978
|
}
|
|
1980
1979
|
}
|
|
1981
1980
|
if (bulletInfo?.imageDataUrl || bulletInfo?.imageRelId) {
|
|
@@ -2015,7 +2014,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
2015
2014
|
textAlign: segment.rubyAlignment === "l" ? "left" : segment.rubyAlignment === "r" ? "right" : segment.rubyAlignment === "dist" || segment.rubyAlignment === "distCat" || segment.rubyAlignment === "distLetter" ? "justify" : "center"
|
|
2016
2015
|
};
|
|
2017
2016
|
if (segment.rubyStyle?.color) {
|
|
2018
|
-
rubyStyle.color =
|
|
2017
|
+
rubyStyle.color = chunkWK56SFN7_js.normalizeHexColor(segment.rubyStyle.color, resolvedSegmentColor);
|
|
2019
2018
|
}
|
|
2020
2019
|
innerContent = /* @__PURE__ */ jsxRuntime.jsxs("ruby", { children: [
|
|
2021
2020
|
baseContent,
|
|
@@ -2110,7 +2109,7 @@ function groupSegmentsIntoParagraphs(segments) {
|
|
|
2110
2109
|
return paragraphs;
|
|
2111
2110
|
}
|
|
2112
2111
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick) {
|
|
2113
|
-
if (!
|
|
2112
|
+
if (!chunkWK56SFN7_js.hasTextProperties(element)) {
|
|
2114
2113
|
return emptyFallback || null;
|
|
2115
2114
|
}
|
|
2116
2115
|
const effectiveSegments = segmentOverrides ?? element.textSegments;
|
|
@@ -2131,10 +2130,10 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2131
2130
|
return element.text || emptyFallback || "";
|
|
2132
2131
|
}
|
|
2133
2132
|
const paragraphs = groupSegmentsIntoParagraphs(effectiveSegments);
|
|
2134
|
-
const paragraphIndents =
|
|
2135
|
-
const elementRtl =
|
|
2136
|
-
const elementAlign =
|
|
2137
|
-
const bodyStyle =
|
|
2133
|
+
const paragraphIndents = chunkWK56SFN7_js.hasTextProperties(element) ? element.paragraphIndents : void 0;
|
|
2134
|
+
const elementRtl = chunkWK56SFN7_js.hasTextProperties(element) ? element.textStyle?.rtl : void 0;
|
|
2135
|
+
const elementAlign = chunkWK56SFN7_js.hasTextProperties(element) ? element.textStyle?.align : void 0;
|
|
2136
|
+
const bodyStyle = chunkWK56SFN7_js.hasTextProperties(element) ? element.textStyle : void 0;
|
|
2138
2137
|
const spaceFirstLast = bodyStyle?.spaceFirstLastParagraph !== false;
|
|
2139
2138
|
return paragraphs.map((paraSegments, paraIndex) => {
|
|
2140
2139
|
const paraIndent = paragraphIndents?.[paraIndex];
|
|
@@ -2149,14 +2148,14 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
2149
2148
|
return Boolean(segment.text) && segment.text.trim().length > 0;
|
|
2150
2149
|
});
|
|
2151
2150
|
const hasBullet = bulletInfo && !bulletInfo.none && hasVisibleTextContent;
|
|
2152
|
-
const paraRtl =
|
|
2151
|
+
const paraRtl = chunkWK56SFN7_js.resolveParagraphRtl(paraSegments, elementRtl);
|
|
2153
2152
|
const isRtlParagraph = paraRtl === true;
|
|
2154
|
-
const paraAlign =
|
|
2155
|
-
const cssTextAlign =
|
|
2153
|
+
const paraAlign = chunkWK56SFN7_js.resolveParagraphAlign(paraSegments, elementAlign);
|
|
2154
|
+
const cssTextAlign = chunkWK56SFN7_js.resolveCssTextAlign(paraAlign, isRtlParagraph);
|
|
2156
2155
|
const paraMarginLeft = isRtlParagraph ? void 0 : rawMarginLeft;
|
|
2157
2156
|
const paraMarginRight = isRtlParagraph ? rawMarginLeft : void 0;
|
|
2158
2157
|
const paraTextIndent = rawTextIndent;
|
|
2159
|
-
const paraKinsokuStyle =
|
|
2158
|
+
const paraKinsokuStyle = chunkWK56SFN7_js.getKinsokuLineBreakStyles(firstSeg?.segment.style);
|
|
2160
2159
|
const hasParaKinsoku = Object.keys(paraKinsokuStyle).length > 0;
|
|
2161
2160
|
const paraProps = effectiveSegments[firstSeg?.globalIndex ?? -1]?.paragraphProperties;
|
|
2162
2161
|
const spacing = resolveParagraphSpacing({
|
|
@@ -2243,13 +2242,13 @@ function hexToRgbUnit(hex) {
|
|
|
2243
2242
|
};
|
|
2244
2243
|
}
|
|
2245
2244
|
function getDuotoneColors(element) {
|
|
2246
|
-
if (!
|
|
2245
|
+
if (!chunkWK56SFN7_js.isImageLikeElement(element)) {
|
|
2247
2246
|
return void 0;
|
|
2248
2247
|
}
|
|
2249
2248
|
return element.imageEffects?.duotone;
|
|
2250
2249
|
}
|
|
2251
2250
|
function buildLineShadowCss(element) {
|
|
2252
|
-
if (!
|
|
2251
|
+
if (!chunkWK56SFN7_js.hasShapeProperties(element)) {
|
|
2253
2252
|
return void 0;
|
|
2254
2253
|
}
|
|
2255
2254
|
const ss = element.shapeStyle;
|
|
@@ -2260,13 +2259,13 @@ function buildLineShadowCss(element) {
|
|
|
2260
2259
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
2261
2260
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
2262
2261
|
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
|
-
|
|
2262
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkWK56SFN7_js.colorWithOpacity(
|
|
2263
|
+
chunkWK56SFN7_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
2265
2264
|
opacity
|
|
2266
2265
|
)}`;
|
|
2267
2266
|
}
|
|
2268
2267
|
function buildLineGlowFilter(element) {
|
|
2269
|
-
if (!
|
|
2268
|
+
if (!chunkWK56SFN7_js.hasShapeProperties(element)) {
|
|
2270
2269
|
return void 0;
|
|
2271
2270
|
}
|
|
2272
2271
|
const ss = element.shapeStyle;
|
|
@@ -2275,7 +2274,7 @@ function buildLineGlowFilter(element) {
|
|
|
2275
2274
|
}
|
|
2276
2275
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
2277
2276
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
2278
|
-
const glowCol =
|
|
2277
|
+
const glowCol = chunkWK56SFN7_js.colorWithOpacity(chunkWK56SFN7_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
2279
2278
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
2280
2279
|
}
|
|
2281
2280
|
function mapDagBlendModeToCss(blend) {
|
|
@@ -2299,7 +2298,7 @@ function getDagDuotoneFilterId(elementId) {
|
|
|
2299
2298
|
return `dag-duotone-${elementId}`;
|
|
2300
2299
|
}
|
|
2301
2300
|
function hasDagDuotoneEffect(element) {
|
|
2302
|
-
if (!
|
|
2301
|
+
if (!chunkWK56SFN7_js.hasShapeProperties(element)) {
|
|
2303
2302
|
return false;
|
|
2304
2303
|
}
|
|
2305
2304
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
@@ -2362,7 +2361,7 @@ function getRoundRectRadiusPx2(element) {
|
|
|
2362
2361
|
|
|
2363
2362
|
// src/viewer/utils/shape-visual-3d.ts
|
|
2364
2363
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
2365
|
-
return
|
|
2364
|
+
return chunkWK56SFN7_js.build3DExtrusionData(
|
|
2366
2365
|
shape3d,
|
|
2367
2366
|
scene3d,
|
|
2368
2367
|
fillColor,
|
|
@@ -2371,7 +2370,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
2371
2370
|
);
|
|
2372
2371
|
}
|
|
2373
2372
|
function apply3dEffects2(base, scene3d, shape3d, fillColorFallback) {
|
|
2374
|
-
|
|
2373
|
+
chunkWK56SFN7_js.apply3dEffects(base, scene3d, shape3d, fillColorFallback);
|
|
2375
2374
|
}
|
|
2376
2375
|
|
|
2377
2376
|
// src/viewer/utils/vector-subpath-paint.ts
|
|
@@ -2380,7 +2379,7 @@ function toHexByte(value) {
|
|
|
2380
2379
|
return clamped.toString(16).padStart(2, "0");
|
|
2381
2380
|
}
|
|
2382
2381
|
function shiftHex(hex, factor, towardsWhite) {
|
|
2383
|
-
const channels =
|
|
2382
|
+
const channels = chunkWK56SFN7_js.hexToRgbChannels(hex);
|
|
2384
2383
|
if (!channels) {
|
|
2385
2384
|
return hex;
|
|
2386
2385
|
}
|
|
@@ -2406,13 +2405,13 @@ function buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity) {
|
|
|
2406
2405
|
const fillOff = subpath.fillMode === "none" || !hasFill;
|
|
2407
2406
|
return {
|
|
2408
2407
|
d: subpath.d,
|
|
2409
|
-
fill: fillOff ? "none" :
|
|
2408
|
+
fill: fillOff ? "none" : chunkWK56SFN7_js.colorWithOpacity(adjustFillForMode(fillColor, subpath.fillMode), fillOpacity),
|
|
2410
2409
|
stroked: subpath.stroke !== false
|
|
2411
2410
|
};
|
|
2412
2411
|
});
|
|
2413
2412
|
}
|
|
2414
2413
|
function getStrokeOnlyPresetPaths(element) {
|
|
2415
|
-
if (element.type !== "shape" || !
|
|
2414
|
+
if (element.type !== "shape" || !chunkWK56SFN7_js.hasShapeProperties(element)) {
|
|
2416
2415
|
return void 0;
|
|
2417
2416
|
}
|
|
2418
2417
|
const shapeType = element.shapeType;
|
|
@@ -2422,7 +2421,7 @@ function getStrokeOnlyPresetPaths(element) {
|
|
|
2422
2421
|
if (element.pathData) {
|
|
2423
2422
|
return void 0;
|
|
2424
2423
|
}
|
|
2425
|
-
const result =
|
|
2424
|
+
const result = chunkWK56SFN7_js.evaluatePresetShape(
|
|
2426
2425
|
shapeType,
|
|
2427
2426
|
Math.max(element.width, 1),
|
|
2428
2427
|
Math.max(element.height, 1),
|
|
@@ -2437,27 +2436,27 @@ function getStrokeOnlyPresetPaths(element) {
|
|
|
2437
2436
|
|
|
2438
2437
|
// src/viewer/utils/shape-visual-style.ts
|
|
2439
2438
|
function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2440
|
-
if (!
|
|
2439
|
+
if (!chunkWK56SFN7_js.hasShapeProperties(element)) {
|
|
2441
2440
|
return {};
|
|
2442
2441
|
}
|
|
2443
2442
|
const normalizedShapeType = getShapeType(element.shapeType);
|
|
2444
|
-
const clipPath =
|
|
2443
|
+
const clipPath = chunkWK56SFN7_js.getResolvedShapeClipPath(element);
|
|
2445
2444
|
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
2445
|
const rendersStrokeOnlyPreset = Boolean(getStrokeOnlyPresetPaths(element));
|
|
2447
2446
|
const fillOpacity = element.shapeStyle?.fillOpacity;
|
|
2448
2447
|
const strokeOpacity = element.shapeStyle?.strokeOpacity;
|
|
2449
|
-
const strokeDash =
|
|
2450
|
-
const fillGradient =
|
|
2451
|
-
const shadowCss =
|
|
2452
|
-
const innerShadowCss =
|
|
2453
|
-
const resolvedFillColor =
|
|
2454
|
-
const resolvedStrokeColor =
|
|
2448
|
+
const strokeDash = chunkWK56SFN7_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2449
|
+
const fillGradient = chunkWK56SFN7_js.buildCssGradientFromShapeStyle(element.shapeStyle) || element.shapeStyle?.fillGradient;
|
|
2450
|
+
const shadowCss = chunkWK56SFN7_js.buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
2451
|
+
const innerShadowCss = chunkWK56SFN7_js.buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
2452
|
+
const resolvedFillColor = chunkWK56SFN7_js.colorWithOpacity(fillColor, fillOpacity);
|
|
2453
|
+
const resolvedStrokeColor = chunkWK56SFN7_js.colorWithOpacity(strokeColor, strokeOpacity);
|
|
2455
2454
|
const ss = element.shapeStyle;
|
|
2456
2455
|
const hasFillOverlayColor = Boolean(
|
|
2457
2456
|
ss?.dagFillOverlayColor && ss.dagFillOverlayColor !== "transparent"
|
|
2458
2457
|
);
|
|
2459
2458
|
const combinedShadowParts = [];
|
|
2460
|
-
const multiLayerShadow =
|
|
2459
|
+
const multiLayerShadow = chunkWK56SFN7_js.buildMultiLayerShadowCss(element.shapeStyle);
|
|
2461
2460
|
if (multiLayerShadow) {
|
|
2462
2461
|
combinedShadowParts.push(multiLayerShadow);
|
|
2463
2462
|
} else if (shadowCss) {
|
|
@@ -2466,7 +2465,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2466
2465
|
if (innerShadowCss) {
|
|
2467
2466
|
combinedShadowParts.push(innerShadowCss);
|
|
2468
2467
|
}
|
|
2469
|
-
const glowBoxShadow =
|
|
2468
|
+
const glowBoxShadow = chunkWK56SFN7_js.buildGlowBoxShadow(ss?.glowColor, ss?.glowRadius, ss?.glowOpacity);
|
|
2470
2469
|
if (glowBoxShadow) {
|
|
2471
2470
|
combinedShadowParts.push(glowBoxShadow);
|
|
2472
2471
|
}
|
|
@@ -2474,7 +2473,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2474
2473
|
if (lineShadow) {
|
|
2475
2474
|
combinedShadowParts.push(lineShadow);
|
|
2476
2475
|
}
|
|
2477
|
-
const compoundLineShadow =
|
|
2476
|
+
const compoundLineShadow = chunkWK56SFN7_js.getCompoundLineBoxShadow(
|
|
2478
2477
|
element.shapeStyle?.compoundLine,
|
|
2479
2478
|
strokeWidth,
|
|
2480
2479
|
resolvedStrokeColor
|
|
@@ -2487,11 +2486,11 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2487
2486
|
if (ss?.glowColor && ss.glowColor !== "transparent" && ss.glowRadius) {
|
|
2488
2487
|
const glowOpacity = typeof ss.glowOpacity === "number" ? ss.glowOpacity : 0.75;
|
|
2489
2488
|
const glowRad = Math.round(Math.max(0, ss.glowRadius));
|
|
2490
|
-
const glowCol =
|
|
2489
|
+
const glowCol = chunkWK56SFN7_js.colorWithOpacity(chunkWK56SFN7_js.normalizeHexColor(ss.glowColor, "#ffff00"), glowOpacity);
|
|
2491
2490
|
filterParts.push(`drop-shadow(0 0 ${glowRad}px ${glowCol})`);
|
|
2492
2491
|
}
|
|
2493
2492
|
if (typeof ss?.softEdgeRadius === "number" && ss.softEdgeRadius > 0) {
|
|
2494
|
-
filterParts.push(`url(#${
|
|
2493
|
+
filterParts.push(`url(#${chunkWK56SFN7_js.getSoftEdgeFilterId(element.id)})`);
|
|
2495
2494
|
}
|
|
2496
2495
|
if (typeof ss?.blurRadius === "number" && ss.blurRadius > 0) {
|
|
2497
2496
|
filterParts.push(`blur(${Math.round(ss.blurRadius)}px)`);
|
|
@@ -2500,13 +2499,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2500
2499
|
if (lineGlowCss) {
|
|
2501
2500
|
filterParts.push(lineGlowCss);
|
|
2502
2501
|
}
|
|
2503
|
-
const dagFilter =
|
|
2502
|
+
const dagFilter = chunkWK56SFN7_js.getEffectDagFilter(ss, element.id);
|
|
2504
2503
|
if (dagFilter) {
|
|
2505
2504
|
filterParts.push(dagFilter);
|
|
2506
2505
|
}
|
|
2507
2506
|
const lineJoinCss = ss?.lineJoin === "round" ? "round" : ss?.lineJoin === "bevel" ? "bevel" : ss?.lineJoin === "miter" ? "miter" : void 0;
|
|
2508
2507
|
const miterLimitCss = ss?.lineJoin === "miter" && typeof ss?.miterLimit === "number" ? Math.max(ss.miterLimit / 1e5, 1) : void 0;
|
|
2509
|
-
const patternFill =
|
|
2508
|
+
const patternFill = chunkWK56SFN7_js.buildPatternFillCss(element.shapeStyle);
|
|
2510
2509
|
const imageFillUrl = ss?.fillMode === "image" && ss.fillImageUrl ? ss.fillImageUrl : void 0;
|
|
2511
2510
|
const imageFillMode = ss?.fillImageMode || "stretch";
|
|
2512
2511
|
let reflectCss;
|
|
@@ -2518,7 +2517,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2518
2517
|
const endOpacity = typeof ss.reflectionEndOpacity === "number" ? ss.reflectionEndOpacity : 0;
|
|
2519
2518
|
const fadeLength = typeof ss.reflectionEndPosition === "number" ? Math.round(ss.reflectionEndPosition * Math.max(element.height, 1)) : 100;
|
|
2520
2519
|
const blurRadius = typeof ss.reflectionBlurRadius === "number" ? ss.reflectionBlurRadius : 0;
|
|
2521
|
-
reflectCss =
|
|
2520
|
+
reflectCss = chunkWK56SFN7_js.buildReflectionCss(distance, startOpacity, endOpacity, fadeLength, blurRadius);
|
|
2522
2521
|
}
|
|
2523
2522
|
}
|
|
2524
2523
|
const base = {
|
|
@@ -2552,9 +2551,9 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2552
2551
|
// is present, `ShapeEffectOverlay` paints a separate blended tint layer so
|
|
2553
2552
|
// the colour is actually rendered (and text/children are not tinted).
|
|
2554
2553
|
mixBlendMode: hasFillOverlayColor ? void 0 : mapDagBlendModeToCss(ss?.dagFillOverlayBlend),
|
|
2555
|
-
borderWidth: strokeWidth > 0 ?
|
|
2554
|
+
borderWidth: strokeWidth > 0 ? chunkWK56SFN7_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : void 0,
|
|
2556
2555
|
borderColor: strokeWidth > 0 ? resolvedStrokeColor : void 0,
|
|
2557
|
-
borderStyle: strokeWidth > 0 ?
|
|
2556
|
+
borderStyle: strokeWidth > 0 ? chunkWK56SFN7_js.getCssBorderDashStyle(strokeDash, ss?.compoundLine) : void 0,
|
|
2558
2557
|
strokeLinejoin: lineJoinCss,
|
|
2559
2558
|
strokeMiterlimit: miterLimitCss,
|
|
2560
2559
|
strokeLinecap: ss?.lineCap === "rnd" ? "round" : ss?.lineCap === "sq" ? "square" : ss?.lineCap === "flat" ? "butt" : void 0
|
|
@@ -2610,7 +2609,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2610
2609
|
borderWidth: 0,
|
|
2611
2610
|
borderTopWidth: Math.max(strokeWidth, 2),
|
|
2612
2611
|
borderTopColor: resolvedStrokeColor,
|
|
2613
|
-
borderTopStyle:
|
|
2612
|
+
borderTopStyle: chunkWK56SFN7_js.getCssBorderDashStyle(strokeDash)
|
|
2614
2613
|
};
|
|
2615
2614
|
}
|
|
2616
2615
|
if (normalizedShapeType === "cylinder") {
|
|
@@ -2624,13 +2623,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2624
2623
|
function getConnectorAdjustment(element, key, fallback) {
|
|
2625
2624
|
const direct = element.shapeAdjustments?.[key];
|
|
2626
2625
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
2627
|
-
return
|
|
2626
|
+
return chunkWK56SFN7_js.clampUnitInterval(direct / 1e5);
|
|
2628
2627
|
}
|
|
2629
2628
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
2630
2629
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
2631
|
-
return
|
|
2630
|
+
return chunkWK56SFN7_js.clampUnitInterval(fallbackKey / 1e5);
|
|
2632
2631
|
}
|
|
2633
|
-
return
|
|
2632
|
+
return chunkWK56SFN7_js.clampUnitInterval(fallback);
|
|
2634
2633
|
}
|
|
2635
2634
|
function getConnectorPathGeometry(element) {
|
|
2636
2635
|
const width = Math.max(element.width, 1);
|
|
@@ -2767,11 +2766,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
|
|
|
2767
2766
|
strokePaint,
|
|
2768
2767
|
strokeWidth,
|
|
2769
2768
|
dashArray,
|
|
2770
|
-
lineCap:
|
|
2769
|
+
lineCap: chunkWK56SFN7_js.svgLineCap(shapeStyle?.lineCap),
|
|
2771
2770
|
lineJoin,
|
|
2772
2771
|
miterLimit,
|
|
2773
|
-
offsets:
|
|
2774
|
-
widths:
|
|
2772
|
+
offsets: chunkWK56SFN7_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
2773
|
+
widths: chunkWK56SFN7_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
|
|
2775
2774
|
};
|
|
2776
2775
|
}
|
|
2777
2776
|
function strokeStrands(d, keyBase, ctx) {
|
|
@@ -2794,7 +2793,7 @@ function strokeStrands(d, keyBase, ctx) {
|
|
|
2794
2793
|
}
|
|
2795
2794
|
function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredPaths, shapeStyle, hasFill, fillColor, fillOpacity, strokePaint, strokeWidth, dashArray, animatesFill = false) {
|
|
2796
2795
|
const ctx = strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray);
|
|
2797
|
-
const subpaths = structuredPaths && structuredPaths.length > 0 ?
|
|
2796
|
+
const subpaths = structuredPaths && structuredPaths.length > 0 ? chunkWK56SFN7_js.customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
2798
2797
|
const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
|
|
2799
2798
|
const nodes = [];
|
|
2800
2799
|
if (subpaths && needsPerSubpath) {
|
|
@@ -2825,7 +2824,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2825
2824
|
"path",
|
|
2826
2825
|
{
|
|
2827
2826
|
d: pathData,
|
|
2828
|
-
fill: animatesFill ? "inherit" :
|
|
2827
|
+
fill: animatesFill ? "inherit" : chunkWK56SFN7_js.colorWithOpacity(fillColor, fillOpacity),
|
|
2829
2828
|
stroke: "none",
|
|
2830
2829
|
vectorEffect: "non-scaling-stroke"
|
|
2831
2830
|
},
|
|
@@ -2867,14 +2866,14 @@ function renderStrokeOnlyPreset(presetPaths, width, height, shapeStyle, strokePa
|
|
|
2867
2866
|
);
|
|
2868
2867
|
}
|
|
2869
2868
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2870
|
-
if (!
|
|
2869
|
+
if (!chunkWK56SFN7_js.hasShapeProperties(element)) {
|
|
2871
2870
|
return null;
|
|
2872
2871
|
}
|
|
2873
2872
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
2874
|
-
const fillPaint = animatesFill ? "inherit" :
|
|
2875
|
-
const strokePaint = animatesStroke ? "inherit" :
|
|
2876
|
-
const dashType =
|
|
2877
|
-
const dashArray =
|
|
2873
|
+
const fillPaint = animatesFill ? "inherit" : chunkWK56SFN7_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
2874
|
+
const strokePaint = animatesStroke ? "inherit" : chunkWK56SFN7_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
2875
|
+
const dashType = chunkWK56SFN7_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2876
|
+
const dashArray = chunkWK56SFN7_js.getSvgStrokeDasharray(
|
|
2878
2877
|
dashType,
|
|
2879
2878
|
Math.max(strokeWidth, 1),
|
|
2880
2879
|
element.shapeStyle?.customDashSegments
|
|
@@ -2953,18 +2952,18 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2953
2952
|
Boolean(animatesFill)
|
|
2954
2953
|
);
|
|
2955
2954
|
}
|
|
2956
|
-
if (
|
|
2955
|
+
if (chunkWK56SFN7_js.isCalloutShape(normalizedType)) {
|
|
2957
2956
|
const width = Math.max(element.width, 1);
|
|
2958
2957
|
const height = Math.max(element.height, 1);
|
|
2959
|
-
const geometry =
|
|
2958
|
+
const geometry = chunkWK56SFN7_js.getCalloutLeaderLineGeometry(
|
|
2960
2959
|
normalizedType,
|
|
2961
2960
|
width,
|
|
2962
2961
|
height,
|
|
2963
2962
|
element.shapeAdjustments
|
|
2964
2963
|
);
|
|
2965
2964
|
if (geometry && geometry.points.length >= 2) {
|
|
2966
|
-
const leaderPath =
|
|
2967
|
-
const bounds =
|
|
2965
|
+
const leaderPath = chunkWK56SFN7_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
2966
|
+
const bounds = chunkWK56SFN7_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
2968
2967
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
2969
2968
|
const offsetLeft = bounds.minX;
|
|
2970
2969
|
const offsetTop = bounds.minY;
|
|
@@ -3027,10 +3026,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
3027
3026
|
const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
|
|
3028
3027
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
3029
3028
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
3030
|
-
const connectorLineCap =
|
|
3029
|
+
const connectorLineCap = chunkWK56SFN7_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
3031
3030
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
3032
|
-
const offsets =
|
|
3033
|
-
const widths =
|
|
3031
|
+
const offsets = chunkWK56SFN7_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
3032
|
+
const widths = chunkWK56SFN7_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
3034
3033
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3035
3034
|
"svg",
|
|
3036
3035
|
{
|
|
@@ -3109,15 +3108,15 @@ function parseGradientFillCss(gradFill) {
|
|
|
3109
3108
|
}
|
|
3110
3109
|
const parsed = stops.map((gs) => {
|
|
3111
3110
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
3112
|
-
const color =
|
|
3113
|
-
const opacity =
|
|
3114
|
-
return { pos, color:
|
|
3111
|
+
const color = chunkWK56SFN7_js.parseDrawingColor(gs) ?? "#888888";
|
|
3112
|
+
const opacity = chunkWK56SFN7_js.parseDrawingColorOpacity(gs);
|
|
3113
|
+
return { pos, color: chunkWK56SFN7_js.colorWithOpacity(color, opacity) };
|
|
3115
3114
|
}).sort((a, b) => a.pos - b.pos);
|
|
3116
3115
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
3117
3116
|
const lin = gradFill["a:lin"];
|
|
3118
3117
|
if (lin) {
|
|
3119
3118
|
const angRaw = Number.parseInt(String(lin["@_ang"] || "0"), 10);
|
|
3120
|
-
const angleDeg = Math.round(
|
|
3119
|
+
const angleDeg = Math.round(chunkWK56SFN7_js.ooxmlGradientAngleToCssDegrees(angRaw / 6e4));
|
|
3121
3120
|
return `linear-gradient(${angleDeg}deg, ${stopStrings})`;
|
|
3122
3121
|
}
|
|
3123
3122
|
const path = gradFill["a:path"];
|
|
@@ -3152,8 +3151,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
3152
3151
|
if (!pattFill) {
|
|
3153
3152
|
return void 0;
|
|
3154
3153
|
}
|
|
3155
|
-
const fgColor =
|
|
3156
|
-
const bgColor =
|
|
3154
|
+
const fgColor = chunkWK56SFN7_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
3155
|
+
const bgColor = chunkWK56SFN7_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
3157
3156
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
3158
3157
|
switch (preset) {
|
|
3159
3158
|
case "ltHorz":
|
|
@@ -3264,11 +3263,11 @@ function parseCellBorders(cellProperties) {
|
|
|
3264
3263
|
const prstDash = ln["a:prstDash"];
|
|
3265
3264
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
3266
3265
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
3267
|
-
const color =
|
|
3266
|
+
const color = chunkWK56SFN7_js.parseDrawingColor(ln["a:solidFill"]);
|
|
3268
3267
|
if (color) {
|
|
3269
|
-
const opacity =
|
|
3268
|
+
const opacity = chunkWK56SFN7_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
3270
3269
|
const key = `${edge.prefix}`;
|
|
3271
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
3270
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkWK56SFN7_js.colorWithOpacity(color, opacity)}`;
|
|
3272
3271
|
}
|
|
3273
3272
|
}
|
|
3274
3273
|
return borderStyle;
|
|
@@ -3281,7 +3280,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3281
3280
|
const textShadowParts = [];
|
|
3282
3281
|
const outerShdw = effectLst["a:outerShdw"];
|
|
3283
3282
|
if (outerShdw) {
|
|
3284
|
-
const shdwColor =
|
|
3283
|
+
const shdwColor = chunkWK56SFN7_js.parseDrawingColor(outerShdw);
|
|
3285
3284
|
if (shdwColor) {
|
|
3286
3285
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
3287
3286
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -3299,7 +3298,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3299
3298
|
}
|
|
3300
3299
|
const glow = effectLst["a:glow"];
|
|
3301
3300
|
if (glow) {
|
|
3302
|
-
const glowColor =
|
|
3301
|
+
const glowColor = chunkWK56SFN7_js.parseDrawingColor(glow);
|
|
3303
3302
|
if (glowColor) {
|
|
3304
3303
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
3305
3304
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -3378,10 +3377,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3378
3377
|
if (runProps?.["@_u"] !== void 0) {
|
|
3379
3378
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
3380
3379
|
}
|
|
3381
|
-
const runColor =
|
|
3380
|
+
const runColor = chunkWK56SFN7_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkWK56SFN7_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
3382
3381
|
if (runColor) {
|
|
3383
|
-
const opacity =
|
|
3384
|
-
cellStyle.color =
|
|
3382
|
+
const opacity = chunkWK56SFN7_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
3383
|
+
cellStyle.color = chunkWK56SFN7_js.colorWithOpacity(runColor, opacity);
|
|
3385
3384
|
}
|
|
3386
3385
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
3387
3386
|
if (fontFamily) {
|
|
@@ -3391,15 +3390,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3391
3390
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
3392
3391
|
}
|
|
3393
3392
|
const cellProperties = cellXml["a:tcPr"];
|
|
3394
|
-
const cellFill =
|
|
3393
|
+
const cellFill = chunkWK56SFN7_js.parseDrawingColor(
|
|
3395
3394
|
cellProperties?.["a:solidFill"],
|
|
3396
3395
|
schemeColorOverrides
|
|
3397
3396
|
);
|
|
3398
3397
|
if (cellFill) {
|
|
3399
|
-
const opacity =
|
|
3398
|
+
const opacity = chunkWK56SFN7_js.parseDrawingColorOpacity(
|
|
3400
3399
|
cellProperties?.["a:solidFill"]
|
|
3401
3400
|
);
|
|
3402
|
-
cellStyle.backgroundColor =
|
|
3401
|
+
cellStyle.backgroundColor = chunkWK56SFN7_js.colorWithOpacity(cellFill, opacity);
|
|
3403
3402
|
} else {
|
|
3404
3403
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
3405
3404
|
if (gradCss) {
|
|
@@ -3414,16 +3413,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3414
3413
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
3415
3414
|
Object.assign(cellStyle, edgeBorders);
|
|
3416
3415
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
3417
|
-
const borderColor =
|
|
3416
|
+
const borderColor = chunkWK56SFN7_js.parseDrawingColor(
|
|
3418
3417
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
3419
3418
|
schemeColorOverrides
|
|
3420
|
-
) ||
|
|
3419
|
+
) || chunkWK56SFN7_js.parseDrawingColor(
|
|
3421
3420
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
3422
3421
|
schemeColorOverrides
|
|
3423
|
-
) ||
|
|
3422
|
+
) || chunkWK56SFN7_js.parseDrawingColor(
|
|
3424
3423
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
3425
3424
|
schemeColorOverrides
|
|
3426
|
-
) ||
|
|
3425
|
+
) || chunkWK56SFN7_js.parseDrawingColor(
|
|
3427
3426
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
3428
3427
|
schemeColorOverrides
|
|
3429
3428
|
);
|
|
@@ -3502,10 +3501,10 @@ function resolveTableStyleFillColor(fill, colorScheme) {
|
|
|
3502
3501
|
}
|
|
3503
3502
|
let color = base;
|
|
3504
3503
|
if (fill.tint !== void 0 && fill.tint > 0) {
|
|
3505
|
-
color =
|
|
3504
|
+
color = chunkWK56SFN7_js.tintColor2(color, fill.tint / 1e5);
|
|
3506
3505
|
}
|
|
3507
3506
|
if (fill.shade !== void 0 && fill.shade > 0) {
|
|
3508
|
-
color =
|
|
3507
|
+
color = chunkWK56SFN7_js.shadeColor2(color, 1 - fill.shade / 1e5);
|
|
3509
3508
|
}
|
|
3510
3509
|
return color;
|
|
3511
3510
|
}
|
|
@@ -3530,7 +3529,7 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3530
3529
|
style.fontFamily = text.fontFace;
|
|
3531
3530
|
applied = true;
|
|
3532
3531
|
} else {
|
|
3533
|
-
const refFont =
|
|
3532
|
+
const refFont = chunkWK56SFN7_js.resolveFontRefIdx(text.fontRefIdx, fontScheme);
|
|
3534
3533
|
if (refFont) {
|
|
3535
3534
|
style.fontFamily = refFont;
|
|
3536
3535
|
applied = true;
|
|
@@ -3541,10 +3540,10 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3541
3540
|
if (base) {
|
|
3542
3541
|
let color = base;
|
|
3543
3542
|
if (text.fontTint !== void 0 && text.fontTint > 0) {
|
|
3544
|
-
color =
|
|
3543
|
+
color = chunkWK56SFN7_js.tintColor2(color, text.fontTint / 1e5);
|
|
3545
3544
|
}
|
|
3546
3545
|
if (text.fontShade !== void 0 && text.fontShade > 0) {
|
|
3547
|
-
color =
|
|
3546
|
+
color = chunkWK56SFN7_js.shadeColor2(color, 1 - text.fontShade / 1e5);
|
|
3548
3547
|
}
|
|
3549
3548
|
style.color = color;
|
|
3550
3549
|
applied = true;
|
|
@@ -3733,7 +3732,7 @@ function parseTableElementData(element, fallbackTextStyle) {
|
|
|
3733
3732
|
};
|
|
3734
3733
|
}
|
|
3735
3734
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
3736
|
-
return
|
|
3735
|
+
return chunkWK56SFN7_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
3737
3736
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
3738
3737
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
3739
3738
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -3881,9 +3880,9 @@ function cellStyleToCss(style) {
|
|
|
3881
3880
|
if (style.gradientFillCss) {
|
|
3882
3881
|
css.background = style.gradientFillCss;
|
|
3883
3882
|
} else if (style.fillMode === "pattern" && style.patternFillPreset) {
|
|
3884
|
-
const fg =
|
|
3885
|
-
const bg =
|
|
3886
|
-
const svgPattern =
|
|
3883
|
+
const fg = chunkWK56SFN7_js.normalizeHexColor(style.patternFillForeground, "#000000");
|
|
3884
|
+
const bg = chunkWK56SFN7_js.normalizeHexColor(style.patternFillBackground, "#ffffff");
|
|
3885
|
+
const svgPattern = chunkWK56SFN7_js.getPatternSvg(style.patternFillPreset, fg, bg);
|
|
3887
3886
|
if (svgPattern) {
|
|
3888
3887
|
const encoded = encodeURIComponent(svgPattern);
|
|
3889
3888
|
css.backgroundImage = `url("data:image/svg+xml,${encoded}")`;
|
|
@@ -3959,7 +3958,7 @@ function cellStyleToCss(style) {
|
|
|
3959
3958
|
if (edge.width || edge.color) {
|
|
3960
3959
|
const w = edge.width ?? 1;
|
|
3961
3960
|
const c = edge.color ?? style.borderColor ?? "#000000";
|
|
3962
|
-
const s =
|
|
3961
|
+
const s = chunkWK56SFN7_js.ooxmlDashToCssBorderStyle(edge.dash);
|
|
3963
3962
|
css[edge.prefix] = `${w}px ${s} ${c}`;
|
|
3964
3963
|
}
|
|
3965
3964
|
}
|
|
@@ -3990,7 +3989,7 @@ function cellStyleToCss(style) {
|
|
|
3990
3989
|
css.textShadow = textShadowParts.join(", ");
|
|
3991
3990
|
}
|
|
3992
3991
|
if (style.cell3D) {
|
|
3993
|
-
Object.assign(css,
|
|
3992
|
+
Object.assign(css, chunkWK56SFN7_js.cell3DBevelCss(style.cell3D));
|
|
3994
3993
|
}
|
|
3995
3994
|
return css;
|
|
3996
3995
|
}
|
|
@@ -4004,7 +4003,7 @@ function TableResizeOverlay({
|
|
|
4004
4003
|
const containerRef = React6.useRef(null);
|
|
4005
4004
|
const [rowBounds, setRowBounds] = React6.useState([]);
|
|
4006
4005
|
const dragRef = React6.useRef(null);
|
|
4007
|
-
const colBoundaries = React6.useMemo(() =>
|
|
4006
|
+
const colBoundaries = React6.useMemo(() => chunkWK56SFN7_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
4008
4007
|
const measureRows = React6.useCallback(() => {
|
|
4009
4008
|
const container = containerRef.current;
|
|
4010
4009
|
if (!container) {
|
|
@@ -4051,11 +4050,11 @@ function TableResizeOverlay({
|
|
|
4051
4050
|
const rect = containerRef.current.getBoundingClientRect();
|
|
4052
4051
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
4053
4052
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
4054
|
-
onResizeColumns(
|
|
4053
|
+
onResizeColumns(chunkWK56SFN7_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
4055
4054
|
} else if (drag.type === "row" && onResizeRow) {
|
|
4056
4055
|
const deltaY = e.clientY - drag.startPos;
|
|
4057
|
-
const newHeight =
|
|
4058
|
-
drag.initialRowHeight ??
|
|
4056
|
+
const newHeight = chunkWK56SFN7_js.computeResizedRowHeight(
|
|
4057
|
+
drag.initialRowHeight ?? chunkWK56SFN7_js.DEFAULT_ROW_HEIGHT,
|
|
4059
4058
|
deltaY
|
|
4060
4059
|
);
|
|
4061
4060
|
onResizeRow(drag.index, newHeight);
|
|
@@ -4093,7 +4092,7 @@ function TableResizeOverlay({
|
|
|
4093
4092
|
e.stopPropagation();
|
|
4094
4093
|
const table = containerRef.current?.querySelector("table");
|
|
4095
4094
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
4096
|
-
const actualHeight = tr?.offsetHeight ??
|
|
4095
|
+
const actualHeight = tr?.offsetHeight ?? chunkWK56SFN7_js.DEFAULT_ROW_HEIGHT;
|
|
4097
4096
|
document.body.style.cursor = "row-resize";
|
|
4098
4097
|
document.body.style.userSelect = "none";
|
|
4099
4098
|
dragRef.current = {
|
|
@@ -4141,7 +4140,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4141
4140
|
}
|
|
4142
4141
|
const first = selectedCell.selectedCells[0];
|
|
4143
4142
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4144
|
-
return
|
|
4143
|
+
return chunkWK56SFN7_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
4145
4144
|
})();
|
|
4146
4145
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4147
4146
|
TableResizeOverlay,
|
|
@@ -4174,7 +4173,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4174
4173
|
return null;
|
|
4175
4174
|
}
|
|
4176
4175
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
4177
|
-
const isInMultiSelection =
|
|
4176
|
+
const isInMultiSelection = chunkWK56SFN7_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
4178
4177
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
4179
4178
|
const diag = getCellDiagonalBorders2(
|
|
4180
4179
|
cell.style,
|
|
@@ -4204,7 +4203,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4204
4203
|
}
|
|
4205
4204
|
event.stopPropagation();
|
|
4206
4205
|
if (event.shiftKey && selectedCell) {
|
|
4207
|
-
const rect =
|
|
4206
|
+
const rect = chunkWK56SFN7_js.computeSelectionRect(
|
|
4208
4207
|
selectedCell.rowIndex,
|
|
4209
4208
|
selectedCell.columnIndex,
|
|
4210
4209
|
rowIndex,
|
|
@@ -4214,7 +4213,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4214
4213
|
options?.onSelectCell?.({
|
|
4215
4214
|
rowIndex: selectedCell.rowIndex,
|
|
4216
4215
|
columnIndex: selectedCell.columnIndex,
|
|
4217
|
-
selectedCells:
|
|
4216
|
+
selectedCells: chunkWK56SFN7_js.rectToCells(rect)
|
|
4218
4217
|
});
|
|
4219
4218
|
} else {
|
|
4220
4219
|
options?.onSelectCell?.({
|
|
@@ -4276,7 +4275,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4276
4275
|
if (tableEl2.tableData && tableEl2.tableData.rows.length > 0) {
|
|
4277
4276
|
return renderTableFromTableData(tableEl2, textStyle, options);
|
|
4278
4277
|
}
|
|
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:
|
|
4278
|
+
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
4279
|
}
|
|
4281
4280
|
const selectedCell = options?.selectedCell || null;
|
|
4282
4281
|
const isEditable = Boolean(options?.editable);
|
|
@@ -4291,7 +4290,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4291
4290
|
}
|
|
4292
4291
|
const first = selectedCell.selectedCells[0];
|
|
4293
4292
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4294
|
-
return
|
|
4293
|
+
return chunkWK56SFN7_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
4295
4294
|
})();
|
|
4296
4295
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
4297
4296
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4368,7 +4367,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4368
4367
|
"border px-1 py-0.5 align-top",
|
|
4369
4368
|
isEditable && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
4370
4369
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
4371
|
-
|
|
4370
|
+
chunkWK56SFN7_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
4371
|
),
|
|
4373
4372
|
colSpan,
|
|
4374
4373
|
rowSpan: rSpan,
|
|
@@ -4379,7 +4378,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4379
4378
|
}
|
|
4380
4379
|
event.stopPropagation();
|
|
4381
4380
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
4382
|
-
const rect =
|
|
4381
|
+
const rect = chunkWK56SFN7_js.computeSelectionRect(
|
|
4383
4382
|
selectedCell.rowIndex,
|
|
4384
4383
|
selectedCell.columnIndex,
|
|
4385
4384
|
rowIndex,
|
|
@@ -4389,7 +4388,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4389
4388
|
options?.onSelectCell?.({
|
|
4390
4389
|
rowIndex: selectedCell.rowIndex,
|
|
4391
4390
|
columnIndex: selectedCell.columnIndex,
|
|
4392
|
-
selectedCells:
|
|
4391
|
+
selectedCells: chunkWK56SFN7_js.rectToCells(rect)
|
|
4393
4392
|
});
|
|
4394
4393
|
} else {
|
|
4395
4394
|
options?.onSelectCell?.({
|
|
@@ -4444,24 +4443,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4444
4443
|
}
|
|
4445
4444
|
var LEGEND_ITEM_WIDTH = 80;
|
|
4446
4445
|
function partAttrs(part) {
|
|
4447
|
-
return part ?
|
|
4446
|
+
return part ? chunkWK56SFN7_js.chartPartToAttrs(part) : void 0;
|
|
4448
4447
|
}
|
|
4449
4448
|
function resolveReactPalette(chartData) {
|
|
4450
4449
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
4451
4450
|
return chartData.colorPalette;
|
|
4452
4451
|
}
|
|
4453
|
-
return [...
|
|
4452
|
+
return [...chunkWK56SFN7_js.getChartStylePalette(chartData.style?.styleId)];
|
|
4454
4453
|
}
|
|
4455
4454
|
function buildReactChartViewModel(element) {
|
|
4456
4455
|
if (element.type !== "chart" || !element.chartData) {
|
|
4457
|
-
return
|
|
4456
|
+
return chunkWK56SFN7_js.buildChartViewModel(element);
|
|
4458
4457
|
}
|
|
4459
4458
|
const palette = resolveReactPalette(element.chartData);
|
|
4460
4459
|
const themedElement = {
|
|
4461
4460
|
...element,
|
|
4462
4461
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
4463
4462
|
};
|
|
4464
|
-
return
|
|
4463
|
+
return chunkWK56SFN7_js.buildChartViewModel(themedElement);
|
|
4465
4464
|
}
|
|
4466
4465
|
function renderPrimitive(prim, key) {
|
|
4467
4466
|
switch (prim.kind) {
|
|
@@ -4850,7 +4849,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4850
4849
|
const unmatchedRows = [];
|
|
4851
4850
|
categories.forEach((cat, i) => {
|
|
4852
4851
|
const value = values[i] ?? 0;
|
|
4853
|
-
const code =
|
|
4852
|
+
const code = chunkWK56SFN7_js.resolveRegionCode(cat);
|
|
4854
4853
|
if (code) {
|
|
4855
4854
|
regionValueMap.set(code, { value, label: cat });
|
|
4856
4855
|
} else {
|
|
@@ -4888,8 +4887,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4888
4887
|
let fill = "#e2e8f0";
|
|
4889
4888
|
let dataLabel = null;
|
|
4890
4889
|
if (entry) {
|
|
4891
|
-
const t =
|
|
4892
|
-
fill =
|
|
4890
|
+
const t = chunkWK56SFN7_js.normalizeValue(entry.value, minVal, maxVal);
|
|
4891
|
+
fill = chunkWK56SFN7_js.sequentialColorScale(t);
|
|
4893
4892
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
4894
4893
|
"text",
|
|
4895
4894
|
{
|
|
@@ -4900,7 +4899,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4900
4899
|
fontWeight: 600,
|
|
4901
4900
|
fill: "#1e293b",
|
|
4902
4901
|
style: { pointerEvents: "none" },
|
|
4903
|
-
children:
|
|
4902
|
+
children: chunkWK56SFN7_js.formatAxisValue(entry.value)
|
|
4904
4903
|
},
|
|
4905
4904
|
`${element.id}-map-dl-${region.code}`
|
|
4906
4905
|
);
|
|
@@ -4918,7 +4917,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4918
4917
|
opacity: 0.9,
|
|
4919
4918
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
4920
4919
|
region.name,
|
|
4921
|
-
entry ? `: ${
|
|
4920
|
+
entry ? `: ${chunkWK56SFN7_js.formatAxisValue(entry.value)}` : ""
|
|
4922
4921
|
] })
|
|
4923
4922
|
}
|
|
4924
4923
|
),
|
|
@@ -4956,7 +4955,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4956
4955
|
fontSize: 7,
|
|
4957
4956
|
fill: "#64748b",
|
|
4958
4957
|
textAnchor: "middle",
|
|
4959
|
-
children:
|
|
4958
|
+
children: chunkWK56SFN7_js.formatAxisValue(minVal)
|
|
4960
4959
|
},
|
|
4961
4960
|
`${element.id}-map-legend-min`
|
|
4962
4961
|
),
|
|
@@ -4968,7 +4967,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4968
4967
|
fontSize: 7,
|
|
4969
4968
|
fill: "#64748b",
|
|
4970
4969
|
textAnchor: "middle",
|
|
4971
|
-
children:
|
|
4970
|
+
children: chunkWK56SFN7_js.formatAxisValue(maxVal)
|
|
4972
4971
|
},
|
|
4973
4972
|
`${element.id}-map-legend-max`
|
|
4974
4973
|
)
|
|
@@ -4987,7 +4986,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4987
4986
|
textAnchor: "middle",
|
|
4988
4987
|
fontSize: 7,
|
|
4989
4988
|
fill: "#94a3b8",
|
|
4990
|
-
children:
|
|
4989
|
+
children: chunk25VSL2BB_js.translationsEn["pptx.chart.additionalRegionsFallback"]
|
|
4991
4990
|
},
|
|
4992
4991
|
`${element.id}-map-ft-hdr`
|
|
4993
4992
|
)
|
|
@@ -5034,7 +5033,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
5034
5033
|
y,
|
|
5035
5034
|
fontSize,
|
|
5036
5035
|
fill: "#475569",
|
|
5037
|
-
children:
|
|
5036
|
+
children: chunkWK56SFN7_js.formatAxisValue(row.value)
|
|
5038
5037
|
},
|
|
5039
5038
|
`${element.id}-map-ft-val-${i}`
|
|
5040
5039
|
)
|
|
@@ -5105,7 +5104,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
5105
5104
|
|
|
5106
5105
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
5107
5106
|
function sColor(series, idx) {
|
|
5108
|
-
return
|
|
5107
|
+
return chunkWK56SFN7_js.seriesColor(series, idx);
|
|
5109
5108
|
}
|
|
5110
5109
|
function valToY(val, range, topY, bottomY) {
|
|
5111
5110
|
const usable = bottomY - topY;
|
|
@@ -5644,7 +5643,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5644
5643
|
width: 10,
|
|
5645
5644
|
height: 10,
|
|
5646
5645
|
rx: 2,
|
|
5647
|
-
fill:
|
|
5646
|
+
fill: chunkWK56SFN7_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5648
5647
|
},
|
|
5649
5648
|
`${id}-leg-r-${i}`
|
|
5650
5649
|
)
|
|
@@ -5668,7 +5667,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5668
5667
|
width: 10,
|
|
5669
5668
|
height: 10,
|
|
5670
5669
|
rx: 2,
|
|
5671
|
-
fill:
|
|
5670
|
+
fill: chunkWK56SFN7_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5672
5671
|
}
|
|
5673
5672
|
),
|
|
5674
5673
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -5681,9 +5680,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5681
5680
|
}
|
|
5682
5681
|
const lines = [];
|
|
5683
5682
|
if (range.logScale && range.logBase) {
|
|
5684
|
-
const ticks =
|
|
5683
|
+
const ticks = chunkWK56SFN7_js.generateLogTicks(range);
|
|
5685
5684
|
ticks.forEach((tickVal, i) => {
|
|
5686
|
-
const y =
|
|
5685
|
+
const y = chunkWK56SFN7_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5687
5686
|
lines.push(
|
|
5688
5687
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5689
5688
|
"line",
|
|
@@ -5704,7 +5703,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5704
5703
|
const steps = 4;
|
|
5705
5704
|
for (let i = 0; i <= steps; i++) {
|
|
5706
5705
|
const val = range.min + range.span * i / steps;
|
|
5707
|
-
const y =
|
|
5706
|
+
const y = chunkWK56SFN7_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5708
5707
|
lines.push(
|
|
5709
5708
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5710
5709
|
"line",
|
|
@@ -5728,9 +5727,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5728
5727
|
const labels = [];
|
|
5729
5728
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5730
5729
|
if (range.logScale && range.logBase) {
|
|
5731
|
-
const ticks =
|
|
5730
|
+
const ticks = chunkWK56SFN7_js.generateLogTicks(range);
|
|
5732
5731
|
ticks.forEach((tickVal, i) => {
|
|
5733
|
-
const y =
|
|
5732
|
+
const y = chunkWK56SFN7_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5734
5733
|
labels.push(
|
|
5735
5734
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5736
5735
|
"text",
|
|
@@ -5740,7 +5739,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5740
5739
|
textAnchor: "end",
|
|
5741
5740
|
fontSize: 8,
|
|
5742
5741
|
fill: "#64748b",
|
|
5743
|
-
children: hasDisplayUnits ?
|
|
5742
|
+
children: hasDisplayUnits ? chunkWK56SFN7_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunkWK56SFN7_js.formatAxisValue(tickVal)
|
|
5744
5743
|
},
|
|
5745
5744
|
`${id}-vaxis-log-${i}`
|
|
5746
5745
|
)
|
|
@@ -5750,7 +5749,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5750
5749
|
const steps = 4;
|
|
5751
5750
|
for (let i = 0; i <= steps; i++) {
|
|
5752
5751
|
const val = range.min + range.span * i / steps;
|
|
5753
|
-
const y =
|
|
5752
|
+
const y = chunkWK56SFN7_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5754
5753
|
labels.push(
|
|
5755
5754
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5756
5755
|
"text",
|
|
@@ -5760,7 +5759,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5760
5759
|
textAnchor: "end",
|
|
5761
5760
|
fontSize: 8,
|
|
5762
5761
|
fill: "#64748b",
|
|
5763
|
-
children: hasDisplayUnits ?
|
|
5762
|
+
children: hasDisplayUnits ? chunkWK56SFN7_js.formatAxisValueWithUnits(val, axisFormatting) : chunkWK56SFN7_js.formatAxisValue(val)
|
|
5764
5763
|
},
|
|
5765
5764
|
`${id}-vaxis-${i}`
|
|
5766
5765
|
)
|
|
@@ -5768,7 +5767,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5768
5767
|
}
|
|
5769
5768
|
}
|
|
5770
5769
|
if (hasDisplayUnits) {
|
|
5771
|
-
const unitLabel =
|
|
5770
|
+
const unitLabel = chunkWK56SFN7_js.getDisplayUnitLabel(
|
|
5772
5771
|
axisFormatting.displayUnits,
|
|
5773
5772
|
axisFormatting.displayUnitsLabel
|
|
5774
5773
|
);
|
|
@@ -5843,7 +5842,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
5843
5842
|
if (range.min >= 0) {
|
|
5844
5843
|
return null;
|
|
5845
5844
|
}
|
|
5846
|
-
const y =
|
|
5845
|
+
const y = chunkWK56SFN7_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
5847
5846
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5848
5847
|
"line",
|
|
5849
5848
|
{
|
|
@@ -5867,7 +5866,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5867
5866
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5868
5867
|
for (let i = 0; i <= steps; i++) {
|
|
5869
5868
|
const val = range.min + range.span * i / steps;
|
|
5870
|
-
const y =
|
|
5869
|
+
const y = chunkWK56SFN7_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5871
5870
|
labels.push(
|
|
5872
5871
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5873
5872
|
"text",
|
|
@@ -5879,7 +5878,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5879
5878
|
fontFamily,
|
|
5880
5879
|
fontWeight,
|
|
5881
5880
|
fill: fontColor,
|
|
5882
|
-
children: hasDisplayUnits ?
|
|
5881
|
+
children: hasDisplayUnits ? chunkWK56SFN7_js.formatAxisValueWithUnits(val, axisFormatting) : chunkWK56SFN7_js.formatAxisValue(val)
|
|
5883
5882
|
},
|
|
5884
5883
|
`${id}-sec-vaxis-${i}`
|
|
5885
5884
|
)
|
|
@@ -5903,7 +5902,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5903
5902
|
);
|
|
5904
5903
|
}
|
|
5905
5904
|
if (hasDisplayUnits) {
|
|
5906
|
-
const unitLabel =
|
|
5905
|
+
const unitLabel = chunkWK56SFN7_js.getDisplayUnitLabel(
|
|
5907
5906
|
axisFormatting.displayUnits,
|
|
5908
5907
|
axisFormatting.displayUnitsLabel
|
|
5909
5908
|
);
|
|
@@ -5934,7 +5933,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
5934
5933
|
const ticks = [];
|
|
5935
5934
|
for (let i = 0; i <= steps; i++) {
|
|
5936
5935
|
const val = range.min + range.span * i / steps;
|
|
5937
|
-
const y =
|
|
5936
|
+
const y = chunkWK56SFN7_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5938
5937
|
ticks.push(
|
|
5939
5938
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5940
5939
|
"line",
|
|
@@ -5961,7 +5960,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
5961
5960
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
5962
5961
|
for (let i = 0; i <= steps; i++) {
|
|
5963
5962
|
const val = range.min + range.span * i / steps;
|
|
5964
|
-
const y =
|
|
5963
|
+
const y = chunkWK56SFN7_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5965
5964
|
lines.push(
|
|
5966
5965
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5967
5966
|
"line",
|
|
@@ -6079,7 +6078,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6079
6078
|
showK && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6080
6079
|
"th",
|
|
6081
6080
|
{
|
|
6082
|
-
"aria-label":
|
|
6081
|
+
"aria-label": chunk25VSL2BB_js.translationsEn["pptx.chart.rowLabelsAria"],
|
|
6083
6082
|
style: {
|
|
6084
6083
|
padding: "1px 4px",
|
|
6085
6084
|
fontWeight: 400,
|
|
@@ -6123,7 +6122,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6123
6122
|
width: 8,
|
|
6124
6123
|
height: 8,
|
|
6125
6124
|
borderRadius: 2,
|
|
6126
|
-
backgroundColor:
|
|
6125
|
+
backgroundColor: chunkWK56SFN7_js.seriesColor(
|
|
6127
6126
|
s,
|
|
6128
6127
|
si,
|
|
6129
6128
|
chartData.style?.styleId,
|
|
@@ -6162,8 +6161,8 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6162
6161
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
6163
6162
|
const style = chartData.style;
|
|
6164
6163
|
const legendPos = style?.legendPosition || "b";
|
|
6165
|
-
const range =
|
|
6166
|
-
const layout =
|
|
6164
|
+
const range = chunkWK56SFN7_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6165
|
+
const layout = chunkWK56SFN7_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6167
6166
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6168
6167
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
6169
6168
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -6184,10 +6183,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6184
6183
|
const close = closeSeries.values[ci] ?? high;
|
|
6185
6184
|
const isUp = close >= open;
|
|
6186
6185
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
6187
|
-
const highY =
|
|
6188
|
-
const lowY =
|
|
6189
|
-
const openY =
|
|
6190
|
-
const closeY =
|
|
6186
|
+
const highY = chunkWK56SFN7_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
6187
|
+
const lowY = chunkWK56SFN7_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
6188
|
+
const openY = chunkWK56SFN7_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
6189
|
+
const closeY = chunkWK56SFN7_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
|
|
6191
6190
|
elements.push(
|
|
6192
6191
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6193
6192
|
"line",
|
|
@@ -6230,7 +6229,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6230
6229
|
textAnchor: "middle",
|
|
6231
6230
|
fontSize: 7,
|
|
6232
6231
|
fill: "#334155",
|
|
6233
|
-
children:
|
|
6232
|
+
children: chunkWK56SFN7_js.formatAxisValue(close)
|
|
6234
6233
|
},
|
|
6235
6234
|
`${element.id}-stock-dl-${ci}`
|
|
6236
6235
|
)
|
|
@@ -6272,7 +6271,7 @@ function FailedToLoad() {
|
|
|
6272
6271
|
var LazySurfaceChart3DScene = React6__default.default.lazy(
|
|
6273
6272
|
async () => {
|
|
6274
6273
|
try {
|
|
6275
|
-
return await import('./SurfaceChart3DScene-
|
|
6274
|
+
return await import('./SurfaceChart3DScene-4KRMRWW6.js');
|
|
6276
6275
|
} catch {
|
|
6277
6276
|
return { default: FailedToLoad };
|
|
6278
6277
|
}
|
|
@@ -6296,7 +6295,7 @@ var SurfaceChart3DErrorBoundary = class extends React6__default.default.Componen
|
|
|
6296
6295
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
6297
6296
|
const rows = chartData.series.length;
|
|
6298
6297
|
const cols = Math.max(categoryLabels.length, 1);
|
|
6299
|
-
const range =
|
|
6298
|
+
const range = chunkWK56SFN7_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6300
6299
|
const heightMap = new Float32Array(rows * cols);
|
|
6301
6300
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
6302
6301
|
for (let r = 0; r < rows; r++) {
|
|
@@ -6416,8 +6415,8 @@ function darkenRgb(r, g, b, factor) {
|
|
|
6416
6415
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
6417
6416
|
const style = chartData.style;
|
|
6418
6417
|
const legendPos = style?.legendPosition || "b";
|
|
6419
|
-
const layout =
|
|
6420
|
-
const range =
|
|
6418
|
+
const layout = chunkWK56SFN7_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6419
|
+
const range = chunkWK56SFN7_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6421
6420
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6422
6421
|
const seriesCount = chartData.series.length;
|
|
6423
6422
|
const cols = catCount - 1;
|
|
@@ -6507,8 +6506,8 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6507
6506
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
6508
6507
|
const style = chartData.style;
|
|
6509
6508
|
const legendPos = style?.legendPosition || "b";
|
|
6510
|
-
const layout =
|
|
6511
|
-
const range =
|
|
6509
|
+
const layout = chunkWK56SFN7_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6510
|
+
const range = chunkWK56SFN7_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6512
6511
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6513
6512
|
const seriesCount = chartData.series.length;
|
|
6514
6513
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -6571,7 +6570,7 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6571
6570
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
6572
6571
|
const style = chartData.style;
|
|
6573
6572
|
const legendPos = style?.legendPosition || "b";
|
|
6574
|
-
const layout =
|
|
6573
|
+
const layout = chunkWK56SFN7_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6575
6574
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
6576
6575
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
6577
6576
|
const rects = [];
|
|
@@ -6594,7 +6593,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
6594
6593
|
y: curY,
|
|
6595
6594
|
width: Math.max(w - 1, 1),
|
|
6596
6595
|
height: Math.max(h - 1, 1),
|
|
6597
|
-
fill:
|
|
6596
|
+
fill: chunkWK56SFN7_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
6598
6597
|
rx: 2,
|
|
6599
6598
|
opacity: 0.85
|
|
6600
6599
|
},
|
|
@@ -6647,8 +6646,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6647
6646
|
const style = chartData.style;
|
|
6648
6647
|
const legendPos = style?.legendPosition || "b";
|
|
6649
6648
|
const values = chartData.series[0]?.values ?? [];
|
|
6650
|
-
const range =
|
|
6651
|
-
const layout =
|
|
6649
|
+
const range = chunkWK56SFN7_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6650
|
+
const layout = chunkWK56SFN7_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6652
6651
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
6653
6652
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
6654
6653
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -6659,8 +6658,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6659
6658
|
const isLast = i === values.length - 1;
|
|
6660
6659
|
const startVal = isLast ? 0 : runningTotal;
|
|
6661
6660
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
6662
|
-
const barStartY =
|
|
6663
|
-
const barEndY =
|
|
6661
|
+
const barStartY = chunkWK56SFN7_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
6662
|
+
const barEndY = chunkWK56SFN7_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
|
|
6664
6663
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
6665
6664
|
const y = Math.min(barStartY, barEndY);
|
|
6666
6665
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -6689,7 +6688,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6689
6688
|
textAnchor: "middle",
|
|
6690
6689
|
fontSize: 7,
|
|
6691
6690
|
fill: "#334155",
|
|
6692
|
-
children:
|
|
6691
|
+
children: chunkWK56SFN7_js.formatAxisValue(isLast ? endVal : val)
|
|
6693
6692
|
},
|
|
6694
6693
|
`${element.id}-wf-dl-${i}`
|
|
6695
6694
|
)
|
|
@@ -6737,18 +6736,18 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6737
6736
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
6738
6737
|
const style = chartData.style;
|
|
6739
6738
|
const legendPos = style?.legendPosition || "b";
|
|
6740
|
-
const layoutOpts =
|
|
6739
|
+
const layoutOpts = chunkWK56SFN7_js.computeLayoutOptions(
|
|
6741
6740
|
chartData.axes,
|
|
6742
6741
|
chartData.dataTable,
|
|
6743
6742
|
chartData.series.length
|
|
6744
6743
|
);
|
|
6745
|
-
const layout =
|
|
6746
|
-
const { primary, secondary } =
|
|
6744
|
+
const layout = chunkWK56SFN7_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
6745
|
+
const { primary, secondary } = chunkWK56SFN7_js.splitSeriesByAxis(chartData.series, chartData.axes);
|
|
6747
6746
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
6748
6747
|
const secondarySeries = secondary.map((e) => e.series);
|
|
6749
|
-
const range =
|
|
6750
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
6751
|
-
const secondaryAxisFmt =
|
|
6748
|
+
const range = chunkWK56SFN7_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
6749
|
+
const secondaryRange = secondarySeries.length > 0 ? chunkWK56SFN7_js.computeValueRange(secondarySeries) : void 0;
|
|
6750
|
+
const secondaryAxisFmt = chunkWK56SFN7_js.getSecondaryValueAxis(chartData.axes);
|
|
6752
6751
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6753
6752
|
const barSeriesCount = 1;
|
|
6754
6753
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -6764,8 +6763,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6764
6763
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
6765
6764
|
barSeries.values.forEach((val, vi) => {
|
|
6766
6765
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
6767
|
-
const zeroY =
|
|
6768
|
-
const valY =
|
|
6766
|
+
const zeroY = chunkWK56SFN7_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
6767
|
+
const valY = chunkWK56SFN7_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
|
|
6769
6768
|
const y = Math.min(zeroY, valY);
|
|
6770
6769
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
6771
6770
|
barElements.push(
|
|
@@ -6776,7 +6775,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6776
6775
|
y,
|
|
6777
6776
|
width: barWidth,
|
|
6778
6777
|
height: h,
|
|
6779
|
-
fill:
|
|
6778
|
+
fill: chunkWK56SFN7_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
6780
6779
|
rx: 1
|
|
6781
6780
|
},
|
|
6782
6781
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -6792,7 +6791,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6792
6791
|
textAnchor: "middle",
|
|
6793
6792
|
fontSize: 7,
|
|
6794
6793
|
fill: "#334155",
|
|
6795
|
-
children:
|
|
6794
|
+
children: chunkWK56SFN7_js.formatAxisValue(val)
|
|
6796
6795
|
},
|
|
6797
6796
|
`${element.id}-combo-bar-dl-${vi}`
|
|
6798
6797
|
)
|
|
@@ -6809,10 +6808,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6809
6808
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
6810
6809
|
const points = series.values.map((val, vi) => {
|
|
6811
6810
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
6812
|
-
const y =
|
|
6811
|
+
const y = chunkWK56SFN7_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
6813
6812
|
return { x, y, val };
|
|
6814
6813
|
});
|
|
6815
|
-
const c =
|
|
6814
|
+
const c = chunkWK56SFN7_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
6816
6815
|
lineElements.push(
|
|
6817
6816
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6818
6817
|
"polyline",
|
|
@@ -6839,7 +6838,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6839
6838
|
textAnchor: "middle",
|
|
6840
6839
|
fontSize: 7,
|
|
6841
6840
|
fill: "#334155",
|
|
6842
|
-
children:
|
|
6841
|
+
children: chunkWK56SFN7_js.formatAxisValue(p.val)
|
|
6843
6842
|
},
|
|
6844
6843
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
6845
6844
|
)
|
|
@@ -6877,11 +6876,11 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6877
6876
|
}
|
|
6878
6877
|
function renderChartElement(element) {
|
|
6879
6878
|
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:
|
|
6879
|
+
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
6880
|
}
|
|
6882
6881
|
const chartData = element.chartData;
|
|
6883
6882
|
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:
|
|
6883
|
+
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
6884
|
}
|
|
6886
6885
|
const longestSeriesLength = chartData.series.reduce(
|
|
6887
6886
|
(maxLength, series) => Math.max(maxLength, series.values.length),
|
|
@@ -7985,14 +7984,14 @@ function buildNotesPdf(pages) {
|
|
|
7985
7984
|
notes: page.notes,
|
|
7986
7985
|
slideNumber: page.slideNumber
|
|
7987
7986
|
}));
|
|
7988
|
-
const bytes =
|
|
7987
|
+
const bytes = chunkWK56SFN7_js.buildNotesPdfBytes(images, meta);
|
|
7989
7988
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
7990
7989
|
return URL.createObjectURL(blob);
|
|
7991
7990
|
}
|
|
7992
7991
|
|
|
7993
7992
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
7994
7993
|
function buildPdfFromImageData(images) {
|
|
7995
|
-
const bytes =
|
|
7994
|
+
const bytes = chunkWK56SFN7_js.buildSlidesPdfBytes(images);
|
|
7996
7995
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
7997
7996
|
return URL.createObjectURL(blob);
|
|
7998
7997
|
}
|
|
@@ -8001,7 +8000,7 @@ function buildPdfFromImageData(images) {
|
|
|
8001
8000
|
var activePreview = null;
|
|
8002
8001
|
function startPreviewAnimation(elementId, preset, options) {
|
|
8003
8002
|
stopPreviewAnimation();
|
|
8004
|
-
const descriptor =
|
|
8003
|
+
const descriptor = chunkWK56SFN7_js.buildPreviewAnimation(preset, options);
|
|
8005
8004
|
if (!descriptor) {
|
|
8006
8005
|
return;
|
|
8007
8006
|
}
|