pptx-react-viewer 2.2.1 → 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 +4 -0
- package/dist/{AiChatPanel-O4NYWO3D.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-XRKEPXAM.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-JN5F5C4Z.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-HYE6HA2C.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-FDJ6LC4E.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-V7P3LQVV.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-XJTWUXXC.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-2U243ZEP.js → chunk-5TPQJWEO.js} +267 -252
- package/dist/chunk-5TPQJWEO.js.br +0 -0
- package/dist/chunk-5TPQJWEO.js.gz +0 -0
- package/dist/{chunk-O75FHZQJ.mjs → chunk-G6Q3NXRV.mjs} +23 -8
- package/dist/chunk-G6Q3NXRV.mjs.br +0 -0
- package/dist/chunk-G6Q3NXRV.mjs.gz +0 -0
- package/dist/{chunk-RYHBWTPI.mjs → chunk-KK7FWBGO.mjs} +89 -69
- package/dist/chunk-KK7FWBGO.mjs.br +0 -0
- package/dist/chunk-KK7FWBGO.mjs.gz +0 -0
- package/dist/{chunk-7NSLKNCT.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-I2HF7ZPO.mjs → chunk-Q6FC2552.mjs} +1 -1
- package/dist/chunk-Q6FC2552.mjs.br +0 -0
- package/dist/chunk-Q6FC2552.mjs.gz +0 -0
- package/dist/{chunk-R2H3FHK6.js → chunk-QBZA2GMB.mjs} +47788 -32364
- package/dist/chunk-QBZA2GMB.mjs.br +0 -0
- package/dist/chunk-QBZA2GMB.mjs.gz +0 -0
- package/dist/{chunk-K2AW5UXT.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-PE2I5L6R.mjs → chunk-WK56SFN7.js} +48287 -31794
- package/dist/chunk-WK56SFN7.js.br +0 -0
- package/dist/chunk-WK56SFN7.js.gz +0 -0
- package/dist/{chunk-QULJW7LU.js → chunk-XSBFV6TL.js} +929 -909
- 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 +92 -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 +519 -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 +92 -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-O4NYWO3D.js.br +0 -0
- package/dist/AiChatPanel-O4NYWO3D.js.gz +0 -0
- package/dist/AiChatPanel-XRKEPXAM.mjs.br +0 -0
- package/dist/AiChatPanel-XRKEPXAM.mjs.gz +0 -0
- package/dist/Model3DScene-HYE6HA2C.js.br +0 -0
- package/dist/Model3DScene-HYE6HA2C.js.gz +0 -0
- package/dist/Model3DScene-JN5F5C4Z.mjs.br +0 -0
- package/dist/Model3DScene-JN5F5C4Z.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-FDJ6LC4E.js.br +0 -0
- package/dist/SurfaceChart3DScene-FDJ6LC4E.js.gz +0 -0
- package/dist/SurfaceChart3DScene-V7P3LQVV.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-V7P3LQVV.mjs.gz +0 -0
- package/dist/animation-timeline-eb5z0SHW.d.ts.map +0 -1
- package/dist/chunk-2QHCOESN.js +0 -28037
- package/dist/chunk-2QHCOESN.js.br +0 -0
- package/dist/chunk-2QHCOESN.js.gz +0 -0
- package/dist/chunk-2U243ZEP.js.br +0 -0
- package/dist/chunk-2U243ZEP.js.gz +0 -0
- package/dist/chunk-6G6S7PEI.mjs +0 -27604
- package/dist/chunk-6G6S7PEI.mjs.br +0 -0
- package/dist/chunk-6G6S7PEI.mjs.gz +0 -0
- package/dist/chunk-7NSLKNCT.mjs.br +0 -0
- package/dist/chunk-7NSLKNCT.mjs.gz +0 -0
- package/dist/chunk-I2HF7ZPO.mjs.br +0 -0
- package/dist/chunk-I2HF7ZPO.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-K2AW5UXT.js.br +0 -0
- package/dist/chunk-K2AW5UXT.js.gz +0 -0
- package/dist/chunk-O75FHZQJ.mjs.br +0 -0
- package/dist/chunk-O75FHZQJ.mjs.gz +0 -0
- package/dist/chunk-PE2I5L6R.mjs.br +0 -0
- package/dist/chunk-PE2I5L6R.mjs.gz +0 -0
- package/dist/chunk-PZTPX3HK.mjs.br +0 -0
- package/dist/chunk-PZTPX3HK.mjs.gz +0 -0
- package/dist/chunk-QULJW7LU.js.br +0 -0
- package/dist/chunk-QULJW7LU.js.gz +0 -0
- package/dist/chunk-R2H3FHK6.js.br +0 -0
- package/dist/chunk-R2H3FHK6.js.gz +0 -0
- package/dist/chunk-RYHBWTPI.mjs.br +0 -0
- package/dist/chunk-RYHBWTPI.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-XJTWUXXC.js.br +0 -0
- package/dist/chunk-XJTWUXXC.js.gz +0 -0
- package/dist/chunk-YIFO3WQO.js.br +0 -0
- package/dist/chunk-YIFO3WQO.js.gz +0 -0
- package/dist/dist-VEWYRBTB.mjs +0 -2
- package/dist/dist-VEWYRBTB.mjs.br +0 -0
- package/dist/dist-VEWYRBTB.mjs.gz +0 -0
- package/dist/dist-ZCJLIRYG.js +0 -2275
- package/dist/dist-ZCJLIRYG.js.br +0 -0
- package/dist/dist-ZCJLIRYG.js.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 chunkR2H3FHK6_js = require('./chunk-R2H3FHK6.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,14 +2517,30 @@ 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 = {
|
|
2525
|
-
|
|
2524
|
+
// A gradient fill REPLACES the solid fill, it does not sit on top of it.
|
|
2525
|
+
// The parser also records a representative `fillColor`/`fillOpacity` for a
|
|
2526
|
+
// `a:gradFill` (used by thumbnails and the inspector), and painting that as
|
|
2527
|
+
// a `backgroundColor` under the gradient washed the whole shape: wherever
|
|
2528
|
+
// the gradient's own stops were transparent the solid still showed, so a
|
|
2529
|
+
// fade-to-transparent overlay dimmed everything behind it and its edge read
|
|
2530
|
+
// as a hard line. Mirrors the fill precedence in shared's
|
|
2531
|
+
// `getComputedFillStyle` (image -> gradient -> pattern -> solid).
|
|
2532
|
+
backgroundColor: imageFillUrl ? "transparent" : patternFill ? patternFill.backgroundColor : hasFill && !fillGradient ? resolvedFillColor : "transparent",
|
|
2526
2533
|
backgroundImage: imageFillUrl ? `url(${imageFillUrl})` : patternFill ? patternFill.backgroundImage : hasFill && fillGradient ? fillGradient : void 0,
|
|
2527
|
-
backgroundRepeat: imageFillUrl ? imageFillMode === "tile" ? "repeat" : "no-repeat" : patternFill ? "repeat" : void 0,
|
|
2528
|
-
backgroundSize: imageFillUrl ? imageFillMode === "tile" ? "auto" : "100% 100%" : patternFill ? "auto" : void 0,
|
|
2534
|
+
backgroundRepeat: imageFillUrl ? imageFillMode === "tile" ? "repeat" : "no-repeat" : patternFill ? "repeat" : hasFill && fillGradient ? "no-repeat" : void 0,
|
|
2535
|
+
backgroundSize: imageFillUrl ? imageFillMode === "tile" ? "auto" : "100% 100%" : patternFill ? "auto" : hasFill && fillGradient ? "100% 100%" : void 0,
|
|
2536
|
+
// The container always carries a 1px border (transparent unless the shape
|
|
2537
|
+
// has a stroke or is hovered) and `box-sizing: border-box`, so the default
|
|
2538
|
+
// `background-origin: padding-box` sizes the paint 2px smaller than the
|
|
2539
|
+
// shape. Combined with the default `background-repeat: repeat` that made a
|
|
2540
|
+
// gradient tile wrap, painting a 1px sliver of its opposite end along the
|
|
2541
|
+
// edge - a fade-to-transparent overlay grew a hard opaque line down its
|
|
2542
|
+
// side. Paint from the border box so the fill matches the shape outline.
|
|
2543
|
+
backgroundOrigin: "border-box",
|
|
2529
2544
|
backgroundPosition: imageFillUrl ? "center" : void 0,
|
|
2530
2545
|
boxShadow: combinedBoxShadow,
|
|
2531
2546
|
WebkitBoxReflect: reflectCss,
|
|
@@ -2536,9 +2551,9 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2536
2551
|
// is present, `ShapeEffectOverlay` paints a separate blended tint layer so
|
|
2537
2552
|
// the colour is actually rendered (and text/children are not tinted).
|
|
2538
2553
|
mixBlendMode: hasFillOverlayColor ? void 0 : mapDagBlendModeToCss(ss?.dagFillOverlayBlend),
|
|
2539
|
-
borderWidth: strokeWidth > 0 ?
|
|
2554
|
+
borderWidth: strokeWidth > 0 ? chunkWK56SFN7_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : void 0,
|
|
2540
2555
|
borderColor: strokeWidth > 0 ? resolvedStrokeColor : void 0,
|
|
2541
|
-
borderStyle: strokeWidth > 0 ?
|
|
2556
|
+
borderStyle: strokeWidth > 0 ? chunkWK56SFN7_js.getCssBorderDashStyle(strokeDash, ss?.compoundLine) : void 0,
|
|
2542
2557
|
strokeLinejoin: lineJoinCss,
|
|
2543
2558
|
strokeMiterlimit: miterLimitCss,
|
|
2544
2559
|
strokeLinecap: ss?.lineCap === "rnd" ? "round" : ss?.lineCap === "sq" ? "square" : ss?.lineCap === "flat" ? "butt" : void 0
|
|
@@ -2594,7 +2609,7 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2594
2609
|
borderWidth: 0,
|
|
2595
2610
|
borderTopWidth: Math.max(strokeWidth, 2),
|
|
2596
2611
|
borderTopColor: resolvedStrokeColor,
|
|
2597
|
-
borderTopStyle:
|
|
2612
|
+
borderTopStyle: chunkWK56SFN7_js.getCssBorderDashStyle(strokeDash)
|
|
2598
2613
|
};
|
|
2599
2614
|
}
|
|
2600
2615
|
if (normalizedShapeType === "cylinder") {
|
|
@@ -2608,13 +2623,13 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2608
2623
|
function getConnectorAdjustment(element, key, fallback) {
|
|
2609
2624
|
const direct = element.shapeAdjustments?.[key];
|
|
2610
2625
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
2611
|
-
return
|
|
2626
|
+
return chunkWK56SFN7_js.clampUnitInterval(direct / 1e5);
|
|
2612
2627
|
}
|
|
2613
2628
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
2614
2629
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
2615
|
-
return
|
|
2630
|
+
return chunkWK56SFN7_js.clampUnitInterval(fallbackKey / 1e5);
|
|
2616
2631
|
}
|
|
2617
|
-
return
|
|
2632
|
+
return chunkWK56SFN7_js.clampUnitInterval(fallback);
|
|
2618
2633
|
}
|
|
2619
2634
|
function getConnectorPathGeometry(element) {
|
|
2620
2635
|
const width = Math.max(element.width, 1);
|
|
@@ -2751,11 +2766,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
|
|
|
2751
2766
|
strokePaint,
|
|
2752
2767
|
strokeWidth,
|
|
2753
2768
|
dashArray,
|
|
2754
|
-
lineCap:
|
|
2769
|
+
lineCap: chunkWK56SFN7_js.svgLineCap(shapeStyle?.lineCap),
|
|
2755
2770
|
lineJoin,
|
|
2756
2771
|
miterLimit,
|
|
2757
|
-
offsets:
|
|
2758
|
-
widths:
|
|
2772
|
+
offsets: chunkWK56SFN7_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
2773
|
+
widths: chunkWK56SFN7_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
|
|
2759
2774
|
};
|
|
2760
2775
|
}
|
|
2761
2776
|
function strokeStrands(d, keyBase, ctx) {
|
|
@@ -2778,7 +2793,7 @@ function strokeStrands(d, keyBase, ctx) {
|
|
|
2778
2793
|
}
|
|
2779
2794
|
function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredPaths, shapeStyle, hasFill, fillColor, fillOpacity, strokePaint, strokeWidth, dashArray, animatesFill = false) {
|
|
2780
2795
|
const ctx = strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray);
|
|
2781
|
-
const subpaths = structuredPaths && structuredPaths.length > 0 ?
|
|
2796
|
+
const subpaths = structuredPaths && structuredPaths.length > 0 ? chunkWK56SFN7_js.customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
2782
2797
|
const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
|
|
2783
2798
|
const nodes = [];
|
|
2784
2799
|
if (subpaths && needsPerSubpath) {
|
|
@@ -2809,7 +2824,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2809
2824
|
"path",
|
|
2810
2825
|
{
|
|
2811
2826
|
d: pathData,
|
|
2812
|
-
fill: animatesFill ? "inherit" :
|
|
2827
|
+
fill: animatesFill ? "inherit" : chunkWK56SFN7_js.colorWithOpacity(fillColor, fillOpacity),
|
|
2813
2828
|
stroke: "none",
|
|
2814
2829
|
vectorEffect: "non-scaling-stroke"
|
|
2815
2830
|
},
|
|
@@ -2851,14 +2866,14 @@ function renderStrokeOnlyPreset(presetPaths, width, height, shapeStyle, strokePa
|
|
|
2851
2866
|
);
|
|
2852
2867
|
}
|
|
2853
2868
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2854
|
-
if (!
|
|
2869
|
+
if (!chunkWK56SFN7_js.hasShapeProperties(element)) {
|
|
2855
2870
|
return null;
|
|
2856
2871
|
}
|
|
2857
2872
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
2858
|
-
const fillPaint = animatesFill ? "inherit" :
|
|
2859
|
-
const strokePaint = animatesStroke ? "inherit" :
|
|
2860
|
-
const dashType =
|
|
2861
|
-
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(
|
|
2862
2877
|
dashType,
|
|
2863
2878
|
Math.max(strokeWidth, 1),
|
|
2864
2879
|
element.shapeStyle?.customDashSegments
|
|
@@ -2937,18 +2952,18 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2937
2952
|
Boolean(animatesFill)
|
|
2938
2953
|
);
|
|
2939
2954
|
}
|
|
2940
|
-
if (
|
|
2955
|
+
if (chunkWK56SFN7_js.isCalloutShape(normalizedType)) {
|
|
2941
2956
|
const width = Math.max(element.width, 1);
|
|
2942
2957
|
const height = Math.max(element.height, 1);
|
|
2943
|
-
const geometry =
|
|
2958
|
+
const geometry = chunkWK56SFN7_js.getCalloutLeaderLineGeometry(
|
|
2944
2959
|
normalizedType,
|
|
2945
2960
|
width,
|
|
2946
2961
|
height,
|
|
2947
2962
|
element.shapeAdjustments
|
|
2948
2963
|
);
|
|
2949
2964
|
if (geometry && geometry.points.length >= 2) {
|
|
2950
|
-
const leaderPath =
|
|
2951
|
-
const bounds =
|
|
2965
|
+
const leaderPath = chunkWK56SFN7_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
2966
|
+
const bounds = chunkWK56SFN7_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
2952
2967
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
2953
2968
|
const offsetLeft = bounds.minX;
|
|
2954
2969
|
const offsetTop = bounds.minY;
|
|
@@ -3011,10 +3026,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
3011
3026
|
const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
|
|
3012
3027
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
3013
3028
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
3014
|
-
const connectorLineCap =
|
|
3029
|
+
const connectorLineCap = chunkWK56SFN7_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
3015
3030
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
3016
|
-
const offsets =
|
|
3017
|
-
const widths =
|
|
3031
|
+
const offsets = chunkWK56SFN7_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
3032
|
+
const widths = chunkWK56SFN7_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
3018
3033
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3019
3034
|
"svg",
|
|
3020
3035
|
{
|
|
@@ -3093,15 +3108,15 @@ function parseGradientFillCss(gradFill) {
|
|
|
3093
3108
|
}
|
|
3094
3109
|
const parsed = stops.map((gs) => {
|
|
3095
3110
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
3096
|
-
const color =
|
|
3097
|
-
const opacity =
|
|
3098
|
-
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) };
|
|
3099
3114
|
}).sort((a, b) => a.pos - b.pos);
|
|
3100
3115
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
3101
3116
|
const lin = gradFill["a:lin"];
|
|
3102
3117
|
if (lin) {
|
|
3103
3118
|
const angRaw = Number.parseInt(String(lin["@_ang"] || "0"), 10);
|
|
3104
|
-
const angleDeg = Math.round(angRaw / 6e4);
|
|
3119
|
+
const angleDeg = Math.round(chunkWK56SFN7_js.ooxmlGradientAngleToCssDegrees(angRaw / 6e4));
|
|
3105
3120
|
return `linear-gradient(${angleDeg}deg, ${stopStrings})`;
|
|
3106
3121
|
}
|
|
3107
3122
|
const path = gradFill["a:path"];
|
|
@@ -3136,8 +3151,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
3136
3151
|
if (!pattFill) {
|
|
3137
3152
|
return void 0;
|
|
3138
3153
|
}
|
|
3139
|
-
const fgColor =
|
|
3140
|
-
const bgColor =
|
|
3154
|
+
const fgColor = chunkWK56SFN7_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
3155
|
+
const bgColor = chunkWK56SFN7_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
3141
3156
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
3142
3157
|
switch (preset) {
|
|
3143
3158
|
case "ltHorz":
|
|
@@ -3248,11 +3263,11 @@ function parseCellBorders(cellProperties) {
|
|
|
3248
3263
|
const prstDash = ln["a:prstDash"];
|
|
3249
3264
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
3250
3265
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
3251
|
-
const color =
|
|
3266
|
+
const color = chunkWK56SFN7_js.parseDrawingColor(ln["a:solidFill"]);
|
|
3252
3267
|
if (color) {
|
|
3253
|
-
const opacity =
|
|
3268
|
+
const opacity = chunkWK56SFN7_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
3254
3269
|
const key = `${edge.prefix}`;
|
|
3255
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
3270
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkWK56SFN7_js.colorWithOpacity(color, opacity)}`;
|
|
3256
3271
|
}
|
|
3257
3272
|
}
|
|
3258
3273
|
return borderStyle;
|
|
@@ -3265,7 +3280,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3265
3280
|
const textShadowParts = [];
|
|
3266
3281
|
const outerShdw = effectLst["a:outerShdw"];
|
|
3267
3282
|
if (outerShdw) {
|
|
3268
|
-
const shdwColor =
|
|
3283
|
+
const shdwColor = chunkWK56SFN7_js.parseDrawingColor(outerShdw);
|
|
3269
3284
|
if (shdwColor) {
|
|
3270
3285
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
3271
3286
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -3283,7 +3298,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3283
3298
|
}
|
|
3284
3299
|
const glow = effectLst["a:glow"];
|
|
3285
3300
|
if (glow) {
|
|
3286
|
-
const glowColor =
|
|
3301
|
+
const glowColor = chunkWK56SFN7_js.parseDrawingColor(glow);
|
|
3287
3302
|
if (glowColor) {
|
|
3288
3303
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
3289
3304
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -3362,10 +3377,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3362
3377
|
if (runProps?.["@_u"] !== void 0) {
|
|
3363
3378
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
3364
3379
|
}
|
|
3365
|
-
const runColor =
|
|
3380
|
+
const runColor = chunkWK56SFN7_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkWK56SFN7_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
3366
3381
|
if (runColor) {
|
|
3367
|
-
const opacity =
|
|
3368
|
-
cellStyle.color =
|
|
3382
|
+
const opacity = chunkWK56SFN7_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
3383
|
+
cellStyle.color = chunkWK56SFN7_js.colorWithOpacity(runColor, opacity);
|
|
3369
3384
|
}
|
|
3370
3385
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
3371
3386
|
if (fontFamily) {
|
|
@@ -3375,15 +3390,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3375
3390
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
3376
3391
|
}
|
|
3377
3392
|
const cellProperties = cellXml["a:tcPr"];
|
|
3378
|
-
const cellFill =
|
|
3393
|
+
const cellFill = chunkWK56SFN7_js.parseDrawingColor(
|
|
3379
3394
|
cellProperties?.["a:solidFill"],
|
|
3380
3395
|
schemeColorOverrides
|
|
3381
3396
|
);
|
|
3382
3397
|
if (cellFill) {
|
|
3383
|
-
const opacity =
|
|
3398
|
+
const opacity = chunkWK56SFN7_js.parseDrawingColorOpacity(
|
|
3384
3399
|
cellProperties?.["a:solidFill"]
|
|
3385
3400
|
);
|
|
3386
|
-
cellStyle.backgroundColor =
|
|
3401
|
+
cellStyle.backgroundColor = chunkWK56SFN7_js.colorWithOpacity(cellFill, opacity);
|
|
3387
3402
|
} else {
|
|
3388
3403
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
3389
3404
|
if (gradCss) {
|
|
@@ -3398,16 +3413,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3398
3413
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
3399
3414
|
Object.assign(cellStyle, edgeBorders);
|
|
3400
3415
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
3401
|
-
const borderColor =
|
|
3416
|
+
const borderColor = chunkWK56SFN7_js.parseDrawingColor(
|
|
3402
3417
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
3403
3418
|
schemeColorOverrides
|
|
3404
|
-
) ||
|
|
3419
|
+
) || chunkWK56SFN7_js.parseDrawingColor(
|
|
3405
3420
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
3406
3421
|
schemeColorOverrides
|
|
3407
|
-
) ||
|
|
3422
|
+
) || chunkWK56SFN7_js.parseDrawingColor(
|
|
3408
3423
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
3409
3424
|
schemeColorOverrides
|
|
3410
|
-
) ||
|
|
3425
|
+
) || chunkWK56SFN7_js.parseDrawingColor(
|
|
3411
3426
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
3412
3427
|
schemeColorOverrides
|
|
3413
3428
|
);
|
|
@@ -3486,10 +3501,10 @@ function resolveTableStyleFillColor(fill, colorScheme) {
|
|
|
3486
3501
|
}
|
|
3487
3502
|
let color = base;
|
|
3488
3503
|
if (fill.tint !== void 0 && fill.tint > 0) {
|
|
3489
|
-
color =
|
|
3504
|
+
color = chunkWK56SFN7_js.tintColor2(color, fill.tint / 1e5);
|
|
3490
3505
|
}
|
|
3491
3506
|
if (fill.shade !== void 0 && fill.shade > 0) {
|
|
3492
|
-
color =
|
|
3507
|
+
color = chunkWK56SFN7_js.shadeColor2(color, 1 - fill.shade / 1e5);
|
|
3493
3508
|
}
|
|
3494
3509
|
return color;
|
|
3495
3510
|
}
|
|
@@ -3514,7 +3529,7 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3514
3529
|
style.fontFamily = text.fontFace;
|
|
3515
3530
|
applied = true;
|
|
3516
3531
|
} else {
|
|
3517
|
-
const refFont =
|
|
3532
|
+
const refFont = chunkWK56SFN7_js.resolveFontRefIdx(text.fontRefIdx, fontScheme);
|
|
3518
3533
|
if (refFont) {
|
|
3519
3534
|
style.fontFamily = refFont;
|
|
3520
3535
|
applied = true;
|
|
@@ -3525,10 +3540,10 @@ function applyTableStyleText(text, colorScheme, style, fontScheme) {
|
|
|
3525
3540
|
if (base) {
|
|
3526
3541
|
let color = base;
|
|
3527
3542
|
if (text.fontTint !== void 0 && text.fontTint > 0) {
|
|
3528
|
-
color =
|
|
3543
|
+
color = chunkWK56SFN7_js.tintColor2(color, text.fontTint / 1e5);
|
|
3529
3544
|
}
|
|
3530
3545
|
if (text.fontShade !== void 0 && text.fontShade > 0) {
|
|
3531
|
-
color =
|
|
3546
|
+
color = chunkWK56SFN7_js.shadeColor2(color, 1 - text.fontShade / 1e5);
|
|
3532
3547
|
}
|
|
3533
3548
|
style.color = color;
|
|
3534
3549
|
applied = true;
|
|
@@ -3717,7 +3732,7 @@ function parseTableElementData(element, fallbackTextStyle) {
|
|
|
3717
3732
|
};
|
|
3718
3733
|
}
|
|
3719
3734
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
3720
|
-
return
|
|
3735
|
+
return chunkWK56SFN7_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
3721
3736
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
3722
3737
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
3723
3738
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -3865,9 +3880,9 @@ function cellStyleToCss(style) {
|
|
|
3865
3880
|
if (style.gradientFillCss) {
|
|
3866
3881
|
css.background = style.gradientFillCss;
|
|
3867
3882
|
} else if (style.fillMode === "pattern" && style.patternFillPreset) {
|
|
3868
|
-
const fg =
|
|
3869
|
-
const bg =
|
|
3870
|
-
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);
|
|
3871
3886
|
if (svgPattern) {
|
|
3872
3887
|
const encoded = encodeURIComponent(svgPattern);
|
|
3873
3888
|
css.backgroundImage = `url("data:image/svg+xml,${encoded}")`;
|
|
@@ -3943,7 +3958,7 @@ function cellStyleToCss(style) {
|
|
|
3943
3958
|
if (edge.width || edge.color) {
|
|
3944
3959
|
const w = edge.width ?? 1;
|
|
3945
3960
|
const c = edge.color ?? style.borderColor ?? "#000000";
|
|
3946
|
-
const s =
|
|
3961
|
+
const s = chunkWK56SFN7_js.ooxmlDashToCssBorderStyle(edge.dash);
|
|
3947
3962
|
css[edge.prefix] = `${w}px ${s} ${c}`;
|
|
3948
3963
|
}
|
|
3949
3964
|
}
|
|
@@ -3974,7 +3989,7 @@ function cellStyleToCss(style) {
|
|
|
3974
3989
|
css.textShadow = textShadowParts.join(", ");
|
|
3975
3990
|
}
|
|
3976
3991
|
if (style.cell3D) {
|
|
3977
|
-
Object.assign(css,
|
|
3992
|
+
Object.assign(css, chunkWK56SFN7_js.cell3DBevelCss(style.cell3D));
|
|
3978
3993
|
}
|
|
3979
3994
|
return css;
|
|
3980
3995
|
}
|
|
@@ -3988,7 +4003,7 @@ function TableResizeOverlay({
|
|
|
3988
4003
|
const containerRef = React6.useRef(null);
|
|
3989
4004
|
const [rowBounds, setRowBounds] = React6.useState([]);
|
|
3990
4005
|
const dragRef = React6.useRef(null);
|
|
3991
|
-
const colBoundaries = React6.useMemo(() =>
|
|
4006
|
+
const colBoundaries = React6.useMemo(() => chunkWK56SFN7_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
3992
4007
|
const measureRows = React6.useCallback(() => {
|
|
3993
4008
|
const container = containerRef.current;
|
|
3994
4009
|
if (!container) {
|
|
@@ -4035,11 +4050,11 @@ function TableResizeOverlay({
|
|
|
4035
4050
|
const rect = containerRef.current.getBoundingClientRect();
|
|
4036
4051
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
4037
4052
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
4038
|
-
onResizeColumns(
|
|
4053
|
+
onResizeColumns(chunkWK56SFN7_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
4039
4054
|
} else if (drag.type === "row" && onResizeRow) {
|
|
4040
4055
|
const deltaY = e.clientY - drag.startPos;
|
|
4041
|
-
const newHeight =
|
|
4042
|
-
drag.initialRowHeight ??
|
|
4056
|
+
const newHeight = chunkWK56SFN7_js.computeResizedRowHeight(
|
|
4057
|
+
drag.initialRowHeight ?? chunkWK56SFN7_js.DEFAULT_ROW_HEIGHT,
|
|
4043
4058
|
deltaY
|
|
4044
4059
|
);
|
|
4045
4060
|
onResizeRow(drag.index, newHeight);
|
|
@@ -4077,7 +4092,7 @@ function TableResizeOverlay({
|
|
|
4077
4092
|
e.stopPropagation();
|
|
4078
4093
|
const table = containerRef.current?.querySelector("table");
|
|
4079
4094
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
4080
|
-
const actualHeight = tr?.offsetHeight ??
|
|
4095
|
+
const actualHeight = tr?.offsetHeight ?? chunkWK56SFN7_js.DEFAULT_ROW_HEIGHT;
|
|
4081
4096
|
document.body.style.cursor = "row-resize";
|
|
4082
4097
|
document.body.style.userSelect = "none";
|
|
4083
4098
|
dragRef.current = {
|
|
@@ -4125,7 +4140,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4125
4140
|
}
|
|
4126
4141
|
const first = selectedCell.selectedCells[0];
|
|
4127
4142
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4128
|
-
return
|
|
4143
|
+
return chunkWK56SFN7_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
4129
4144
|
})();
|
|
4130
4145
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4131
4146
|
TableResizeOverlay,
|
|
@@ -4158,7 +4173,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4158
4173
|
return null;
|
|
4159
4174
|
}
|
|
4160
4175
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
4161
|
-
const isInMultiSelection =
|
|
4176
|
+
const isInMultiSelection = chunkWK56SFN7_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
4162
4177
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
4163
4178
|
const diag = getCellDiagonalBorders2(
|
|
4164
4179
|
cell.style,
|
|
@@ -4188,7 +4203,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4188
4203
|
}
|
|
4189
4204
|
event.stopPropagation();
|
|
4190
4205
|
if (event.shiftKey && selectedCell) {
|
|
4191
|
-
const rect =
|
|
4206
|
+
const rect = chunkWK56SFN7_js.computeSelectionRect(
|
|
4192
4207
|
selectedCell.rowIndex,
|
|
4193
4208
|
selectedCell.columnIndex,
|
|
4194
4209
|
rowIndex,
|
|
@@ -4198,7 +4213,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
4198
4213
|
options?.onSelectCell?.({
|
|
4199
4214
|
rowIndex: selectedCell.rowIndex,
|
|
4200
4215
|
columnIndex: selectedCell.columnIndex,
|
|
4201
|
-
selectedCells:
|
|
4216
|
+
selectedCells: chunkWK56SFN7_js.rectToCells(rect)
|
|
4202
4217
|
});
|
|
4203
4218
|
} else {
|
|
4204
4219
|
options?.onSelectCell?.({
|
|
@@ -4260,7 +4275,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4260
4275
|
if (tableEl2.tableData && tableEl2.tableData.rows.length > 0) {
|
|
4261
4276
|
return renderTableFromTableData(tableEl2, textStyle, options);
|
|
4262
4277
|
}
|
|
4263
|
-
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"] });
|
|
4264
4279
|
}
|
|
4265
4280
|
const selectedCell = options?.selectedCell || null;
|
|
4266
4281
|
const isEditable = Boolean(options?.editable);
|
|
@@ -4275,7 +4290,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4275
4290
|
}
|
|
4276
4291
|
const first = selectedCell.selectedCells[0];
|
|
4277
4292
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
4278
|
-
return
|
|
4293
|
+
return chunkWK56SFN7_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
4279
4294
|
})();
|
|
4280
4295
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
4281
4296
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4352,7 +4367,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4352
4367
|
"border px-1 py-0.5 align-top",
|
|
4353
4368
|
isEditable && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
4354
4369
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
4355
|
-
|
|
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
|
|
4356
4371
|
),
|
|
4357
4372
|
colSpan,
|
|
4358
4373
|
rowSpan: rSpan,
|
|
@@ -4363,7 +4378,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4363
4378
|
}
|
|
4364
4379
|
event.stopPropagation();
|
|
4365
4380
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
4366
|
-
const rect =
|
|
4381
|
+
const rect = chunkWK56SFN7_js.computeSelectionRect(
|
|
4367
4382
|
selectedCell.rowIndex,
|
|
4368
4383
|
selectedCell.columnIndex,
|
|
4369
4384
|
rowIndex,
|
|
@@ -4373,7 +4388,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4373
4388
|
options?.onSelectCell?.({
|
|
4374
4389
|
rowIndex: selectedCell.rowIndex,
|
|
4375
4390
|
columnIndex: selectedCell.columnIndex,
|
|
4376
|
-
selectedCells:
|
|
4391
|
+
selectedCells: chunkWK56SFN7_js.rectToCells(rect)
|
|
4377
4392
|
});
|
|
4378
4393
|
} else {
|
|
4379
4394
|
options?.onSelectCell?.({
|
|
@@ -4428,24 +4443,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
4428
4443
|
}
|
|
4429
4444
|
var LEGEND_ITEM_WIDTH = 80;
|
|
4430
4445
|
function partAttrs(part) {
|
|
4431
|
-
return part ?
|
|
4446
|
+
return part ? chunkWK56SFN7_js.chartPartToAttrs(part) : void 0;
|
|
4432
4447
|
}
|
|
4433
4448
|
function resolveReactPalette(chartData) {
|
|
4434
4449
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
4435
4450
|
return chartData.colorPalette;
|
|
4436
4451
|
}
|
|
4437
|
-
return [...
|
|
4452
|
+
return [...chunkWK56SFN7_js.getChartStylePalette(chartData.style?.styleId)];
|
|
4438
4453
|
}
|
|
4439
4454
|
function buildReactChartViewModel(element) {
|
|
4440
4455
|
if (element.type !== "chart" || !element.chartData) {
|
|
4441
|
-
return
|
|
4456
|
+
return chunkWK56SFN7_js.buildChartViewModel(element);
|
|
4442
4457
|
}
|
|
4443
4458
|
const palette = resolveReactPalette(element.chartData);
|
|
4444
4459
|
const themedElement = {
|
|
4445
4460
|
...element,
|
|
4446
4461
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
4447
4462
|
};
|
|
4448
|
-
return
|
|
4463
|
+
return chunkWK56SFN7_js.buildChartViewModel(themedElement);
|
|
4449
4464
|
}
|
|
4450
4465
|
function renderPrimitive(prim, key) {
|
|
4451
4466
|
switch (prim.kind) {
|
|
@@ -4834,7 +4849,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4834
4849
|
const unmatchedRows = [];
|
|
4835
4850
|
categories.forEach((cat, i) => {
|
|
4836
4851
|
const value = values[i] ?? 0;
|
|
4837
|
-
const code =
|
|
4852
|
+
const code = chunkWK56SFN7_js.resolveRegionCode(cat);
|
|
4838
4853
|
if (code) {
|
|
4839
4854
|
regionValueMap.set(code, { value, label: cat });
|
|
4840
4855
|
} else {
|
|
@@ -4872,8 +4887,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4872
4887
|
let fill = "#e2e8f0";
|
|
4873
4888
|
let dataLabel = null;
|
|
4874
4889
|
if (entry) {
|
|
4875
|
-
const t =
|
|
4876
|
-
fill =
|
|
4890
|
+
const t = chunkWK56SFN7_js.normalizeValue(entry.value, minVal, maxVal);
|
|
4891
|
+
fill = chunkWK56SFN7_js.sequentialColorScale(t);
|
|
4877
4892
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
4878
4893
|
"text",
|
|
4879
4894
|
{
|
|
@@ -4884,7 +4899,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4884
4899
|
fontWeight: 600,
|
|
4885
4900
|
fill: "#1e293b",
|
|
4886
4901
|
style: { pointerEvents: "none" },
|
|
4887
|
-
children:
|
|
4902
|
+
children: chunkWK56SFN7_js.formatAxisValue(entry.value)
|
|
4888
4903
|
},
|
|
4889
4904
|
`${element.id}-map-dl-${region.code}`
|
|
4890
4905
|
);
|
|
@@ -4902,7 +4917,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4902
4917
|
opacity: 0.9,
|
|
4903
4918
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
4904
4919
|
region.name,
|
|
4905
|
-
entry ? `: ${
|
|
4920
|
+
entry ? `: ${chunkWK56SFN7_js.formatAxisValue(entry.value)}` : ""
|
|
4906
4921
|
] })
|
|
4907
4922
|
}
|
|
4908
4923
|
),
|
|
@@ -4940,7 +4955,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4940
4955
|
fontSize: 7,
|
|
4941
4956
|
fill: "#64748b",
|
|
4942
4957
|
textAnchor: "middle",
|
|
4943
|
-
children:
|
|
4958
|
+
children: chunkWK56SFN7_js.formatAxisValue(minVal)
|
|
4944
4959
|
},
|
|
4945
4960
|
`${element.id}-map-legend-min`
|
|
4946
4961
|
),
|
|
@@ -4952,7 +4967,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4952
4967
|
fontSize: 7,
|
|
4953
4968
|
fill: "#64748b",
|
|
4954
4969
|
textAnchor: "middle",
|
|
4955
|
-
children:
|
|
4970
|
+
children: chunkWK56SFN7_js.formatAxisValue(maxVal)
|
|
4956
4971
|
},
|
|
4957
4972
|
`${element.id}-map-legend-max`
|
|
4958
4973
|
)
|
|
@@ -4971,7 +4986,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4971
4986
|
textAnchor: "middle",
|
|
4972
4987
|
fontSize: 7,
|
|
4973
4988
|
fill: "#94a3b8",
|
|
4974
|
-
children:
|
|
4989
|
+
children: chunk25VSL2BB_js.translationsEn["pptx.chart.additionalRegionsFallback"]
|
|
4975
4990
|
},
|
|
4976
4991
|
`${element.id}-map-ft-hdr`
|
|
4977
4992
|
)
|
|
@@ -5018,7 +5033,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
5018
5033
|
y,
|
|
5019
5034
|
fontSize,
|
|
5020
5035
|
fill: "#475569",
|
|
5021
|
-
children:
|
|
5036
|
+
children: chunkWK56SFN7_js.formatAxisValue(row.value)
|
|
5022
5037
|
},
|
|
5023
5038
|
`${element.id}-map-ft-val-${i}`
|
|
5024
5039
|
)
|
|
@@ -5089,7 +5104,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
5089
5104
|
|
|
5090
5105
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
5091
5106
|
function sColor(series, idx) {
|
|
5092
|
-
return
|
|
5107
|
+
return chunkWK56SFN7_js.seriesColor(series, idx);
|
|
5093
5108
|
}
|
|
5094
5109
|
function valToY(val, range, topY, bottomY) {
|
|
5095
5110
|
const usable = bottomY - topY;
|
|
@@ -5628,7 +5643,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5628
5643
|
width: 10,
|
|
5629
5644
|
height: 10,
|
|
5630
5645
|
rx: 2,
|
|
5631
|
-
fill:
|
|
5646
|
+
fill: chunkWK56SFN7_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5632
5647
|
},
|
|
5633
5648
|
`${id}-leg-r-${i}`
|
|
5634
5649
|
)
|
|
@@ -5652,7 +5667,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5652
5667
|
width: 10,
|
|
5653
5668
|
height: 10,
|
|
5654
5669
|
rx: 2,
|
|
5655
|
-
fill:
|
|
5670
|
+
fill: chunkWK56SFN7_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5656
5671
|
}
|
|
5657
5672
|
),
|
|
5658
5673
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -5665,9 +5680,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5665
5680
|
}
|
|
5666
5681
|
const lines = [];
|
|
5667
5682
|
if (range.logScale && range.logBase) {
|
|
5668
|
-
const ticks =
|
|
5683
|
+
const ticks = chunkWK56SFN7_js.generateLogTicks(range);
|
|
5669
5684
|
ticks.forEach((tickVal, i) => {
|
|
5670
|
-
const y =
|
|
5685
|
+
const y = chunkWK56SFN7_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5671
5686
|
lines.push(
|
|
5672
5687
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5673
5688
|
"line",
|
|
@@ -5688,7 +5703,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5688
5703
|
const steps = 4;
|
|
5689
5704
|
for (let i = 0; i <= steps; i++) {
|
|
5690
5705
|
const val = range.min + range.span * i / steps;
|
|
5691
|
-
const y =
|
|
5706
|
+
const y = chunkWK56SFN7_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5692
5707
|
lines.push(
|
|
5693
5708
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5694
5709
|
"line",
|
|
@@ -5712,9 +5727,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5712
5727
|
const labels = [];
|
|
5713
5728
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5714
5729
|
if (range.logScale && range.logBase) {
|
|
5715
|
-
const ticks =
|
|
5730
|
+
const ticks = chunkWK56SFN7_js.generateLogTicks(range);
|
|
5716
5731
|
ticks.forEach((tickVal, i) => {
|
|
5717
|
-
const y =
|
|
5732
|
+
const y = chunkWK56SFN7_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5718
5733
|
labels.push(
|
|
5719
5734
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5720
5735
|
"text",
|
|
@@ -5724,7 +5739,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5724
5739
|
textAnchor: "end",
|
|
5725
5740
|
fontSize: 8,
|
|
5726
5741
|
fill: "#64748b",
|
|
5727
|
-
children: hasDisplayUnits ?
|
|
5742
|
+
children: hasDisplayUnits ? chunkWK56SFN7_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunkWK56SFN7_js.formatAxisValue(tickVal)
|
|
5728
5743
|
},
|
|
5729
5744
|
`${id}-vaxis-log-${i}`
|
|
5730
5745
|
)
|
|
@@ -5734,7 +5749,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5734
5749
|
const steps = 4;
|
|
5735
5750
|
for (let i = 0; i <= steps; i++) {
|
|
5736
5751
|
const val = range.min + range.span * i / steps;
|
|
5737
|
-
const y =
|
|
5752
|
+
const y = chunkWK56SFN7_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5738
5753
|
labels.push(
|
|
5739
5754
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5740
5755
|
"text",
|
|
@@ -5744,7 +5759,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5744
5759
|
textAnchor: "end",
|
|
5745
5760
|
fontSize: 8,
|
|
5746
5761
|
fill: "#64748b",
|
|
5747
|
-
children: hasDisplayUnits ?
|
|
5762
|
+
children: hasDisplayUnits ? chunkWK56SFN7_js.formatAxisValueWithUnits(val, axisFormatting) : chunkWK56SFN7_js.formatAxisValue(val)
|
|
5748
5763
|
},
|
|
5749
5764
|
`${id}-vaxis-${i}`
|
|
5750
5765
|
)
|
|
@@ -5752,7 +5767,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5752
5767
|
}
|
|
5753
5768
|
}
|
|
5754
5769
|
if (hasDisplayUnits) {
|
|
5755
|
-
const unitLabel =
|
|
5770
|
+
const unitLabel = chunkWK56SFN7_js.getDisplayUnitLabel(
|
|
5756
5771
|
axisFormatting.displayUnits,
|
|
5757
5772
|
axisFormatting.displayUnitsLabel
|
|
5758
5773
|
);
|
|
@@ -5827,7 +5842,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
5827
5842
|
if (range.min >= 0) {
|
|
5828
5843
|
return null;
|
|
5829
5844
|
}
|
|
5830
|
-
const y =
|
|
5845
|
+
const y = chunkWK56SFN7_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
5831
5846
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5832
5847
|
"line",
|
|
5833
5848
|
{
|
|
@@ -5851,7 +5866,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5851
5866
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5852
5867
|
for (let i = 0; i <= steps; i++) {
|
|
5853
5868
|
const val = range.min + range.span * i / steps;
|
|
5854
|
-
const y =
|
|
5869
|
+
const y = chunkWK56SFN7_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5855
5870
|
labels.push(
|
|
5856
5871
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5857
5872
|
"text",
|
|
@@ -5863,7 +5878,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5863
5878
|
fontFamily,
|
|
5864
5879
|
fontWeight,
|
|
5865
5880
|
fill: fontColor,
|
|
5866
|
-
children: hasDisplayUnits ?
|
|
5881
|
+
children: hasDisplayUnits ? chunkWK56SFN7_js.formatAxisValueWithUnits(val, axisFormatting) : chunkWK56SFN7_js.formatAxisValue(val)
|
|
5867
5882
|
},
|
|
5868
5883
|
`${id}-sec-vaxis-${i}`
|
|
5869
5884
|
)
|
|
@@ -5887,7 +5902,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5887
5902
|
);
|
|
5888
5903
|
}
|
|
5889
5904
|
if (hasDisplayUnits) {
|
|
5890
|
-
const unitLabel =
|
|
5905
|
+
const unitLabel = chunkWK56SFN7_js.getDisplayUnitLabel(
|
|
5891
5906
|
axisFormatting.displayUnits,
|
|
5892
5907
|
axisFormatting.displayUnitsLabel
|
|
5893
5908
|
);
|
|
@@ -5918,7 +5933,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
5918
5933
|
const ticks = [];
|
|
5919
5934
|
for (let i = 0; i <= steps; i++) {
|
|
5920
5935
|
const val = range.min + range.span * i / steps;
|
|
5921
|
-
const y =
|
|
5936
|
+
const y = chunkWK56SFN7_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5922
5937
|
ticks.push(
|
|
5923
5938
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5924
5939
|
"line",
|
|
@@ -5945,7 +5960,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
5945
5960
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
5946
5961
|
for (let i = 0; i <= steps; i++) {
|
|
5947
5962
|
const val = range.min + range.span * i / steps;
|
|
5948
|
-
const y =
|
|
5963
|
+
const y = chunkWK56SFN7_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5949
5964
|
lines.push(
|
|
5950
5965
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5951
5966
|
"line",
|
|
@@ -6063,7 +6078,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6063
6078
|
showK && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6064
6079
|
"th",
|
|
6065
6080
|
{
|
|
6066
|
-
"aria-label":
|
|
6081
|
+
"aria-label": chunk25VSL2BB_js.translationsEn["pptx.chart.rowLabelsAria"],
|
|
6067
6082
|
style: {
|
|
6068
6083
|
padding: "1px 4px",
|
|
6069
6084
|
fontWeight: 400,
|
|
@@ -6107,7 +6122,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6107
6122
|
width: 8,
|
|
6108
6123
|
height: 8,
|
|
6109
6124
|
borderRadius: 2,
|
|
6110
|
-
backgroundColor:
|
|
6125
|
+
backgroundColor: chunkWK56SFN7_js.seriesColor(
|
|
6111
6126
|
s,
|
|
6112
6127
|
si,
|
|
6113
6128
|
chartData.style?.styleId,
|
|
@@ -6146,8 +6161,8 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
6146
6161
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
6147
6162
|
const style = chartData.style;
|
|
6148
6163
|
const legendPos = style?.legendPosition || "b";
|
|
6149
|
-
const range =
|
|
6150
|
-
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);
|
|
6151
6166
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6152
6167
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
6153
6168
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -6168,10 +6183,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6168
6183
|
const close = closeSeries.values[ci] ?? high;
|
|
6169
6184
|
const isUp = close >= open;
|
|
6170
6185
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
6171
|
-
const highY =
|
|
6172
|
-
const lowY =
|
|
6173
|
-
const openY =
|
|
6174
|
-
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);
|
|
6175
6190
|
elements.push(
|
|
6176
6191
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6177
6192
|
"line",
|
|
@@ -6214,7 +6229,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
6214
6229
|
textAnchor: "middle",
|
|
6215
6230
|
fontSize: 7,
|
|
6216
6231
|
fill: "#334155",
|
|
6217
|
-
children:
|
|
6232
|
+
children: chunkWK56SFN7_js.formatAxisValue(close)
|
|
6218
6233
|
},
|
|
6219
6234
|
`${element.id}-stock-dl-${ci}`
|
|
6220
6235
|
)
|
|
@@ -6256,7 +6271,7 @@ function FailedToLoad() {
|
|
|
6256
6271
|
var LazySurfaceChart3DScene = React6__default.default.lazy(
|
|
6257
6272
|
async () => {
|
|
6258
6273
|
try {
|
|
6259
|
-
return await import('./SurfaceChart3DScene-
|
|
6274
|
+
return await import('./SurfaceChart3DScene-4KRMRWW6.js');
|
|
6260
6275
|
} catch {
|
|
6261
6276
|
return { default: FailedToLoad };
|
|
6262
6277
|
}
|
|
@@ -6280,7 +6295,7 @@ var SurfaceChart3DErrorBoundary = class extends React6__default.default.Componen
|
|
|
6280
6295
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
6281
6296
|
const rows = chartData.series.length;
|
|
6282
6297
|
const cols = Math.max(categoryLabels.length, 1);
|
|
6283
|
-
const range =
|
|
6298
|
+
const range = chunkWK56SFN7_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6284
6299
|
const heightMap = new Float32Array(rows * cols);
|
|
6285
6300
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
6286
6301
|
for (let r = 0; r < rows; r++) {
|
|
@@ -6400,8 +6415,8 @@ function darkenRgb(r, g, b, factor) {
|
|
|
6400
6415
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
6401
6416
|
const style = chartData.style;
|
|
6402
6417
|
const legendPos = style?.legendPosition || "b";
|
|
6403
|
-
const layout =
|
|
6404
|
-
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);
|
|
6405
6420
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6406
6421
|
const seriesCount = chartData.series.length;
|
|
6407
6422
|
const cols = catCount - 1;
|
|
@@ -6491,8 +6506,8 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6491
6506
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
6492
6507
|
const style = chartData.style;
|
|
6493
6508
|
const legendPos = style?.legendPosition || "b";
|
|
6494
|
-
const layout =
|
|
6495
|
-
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);
|
|
6496
6511
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6497
6512
|
const seriesCount = chartData.series.length;
|
|
6498
6513
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -6555,7 +6570,7 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6555
6570
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
6556
6571
|
const style = chartData.style;
|
|
6557
6572
|
const legendPos = style?.legendPosition || "b";
|
|
6558
|
-
const layout =
|
|
6573
|
+
const layout = chunkWK56SFN7_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6559
6574
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
6560
6575
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
6561
6576
|
const rects = [];
|
|
@@ -6578,7 +6593,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
6578
6593
|
y: curY,
|
|
6579
6594
|
width: Math.max(w - 1, 1),
|
|
6580
6595
|
height: Math.max(h - 1, 1),
|
|
6581
|
-
fill:
|
|
6596
|
+
fill: chunkWK56SFN7_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
6582
6597
|
rx: 2,
|
|
6583
6598
|
opacity: 0.85
|
|
6584
6599
|
},
|
|
@@ -6631,8 +6646,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6631
6646
|
const style = chartData.style;
|
|
6632
6647
|
const legendPos = style?.legendPosition || "b";
|
|
6633
6648
|
const values = chartData.series[0]?.values ?? [];
|
|
6634
|
-
const range =
|
|
6635
|
-
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);
|
|
6636
6651
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
6637
6652
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
6638
6653
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -6643,8 +6658,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6643
6658
|
const isLast = i === values.length - 1;
|
|
6644
6659
|
const startVal = isLast ? 0 : runningTotal;
|
|
6645
6660
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
6646
|
-
const barStartY =
|
|
6647
|
-
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);
|
|
6648
6663
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
6649
6664
|
const y = Math.min(barStartY, barEndY);
|
|
6650
6665
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -6673,7 +6688,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6673
6688
|
textAnchor: "middle",
|
|
6674
6689
|
fontSize: 7,
|
|
6675
6690
|
fill: "#334155",
|
|
6676
|
-
children:
|
|
6691
|
+
children: chunkWK56SFN7_js.formatAxisValue(isLast ? endVal : val)
|
|
6677
6692
|
},
|
|
6678
6693
|
`${element.id}-wf-dl-${i}`
|
|
6679
6694
|
)
|
|
@@ -6721,18 +6736,18 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6721
6736
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
6722
6737
|
const style = chartData.style;
|
|
6723
6738
|
const legendPos = style?.legendPosition || "b";
|
|
6724
|
-
const layoutOpts =
|
|
6739
|
+
const layoutOpts = chunkWK56SFN7_js.computeLayoutOptions(
|
|
6725
6740
|
chartData.axes,
|
|
6726
6741
|
chartData.dataTable,
|
|
6727
6742
|
chartData.series.length
|
|
6728
6743
|
);
|
|
6729
|
-
const layout =
|
|
6730
|
-
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);
|
|
6731
6746
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
6732
6747
|
const secondarySeries = secondary.map((e) => e.series);
|
|
6733
|
-
const range =
|
|
6734
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
6735
|
-
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);
|
|
6736
6751
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6737
6752
|
const barSeriesCount = 1;
|
|
6738
6753
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -6748,8 +6763,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6748
6763
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
6749
6764
|
barSeries.values.forEach((val, vi) => {
|
|
6750
6765
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
6751
|
-
const zeroY =
|
|
6752
|
-
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);
|
|
6753
6768
|
const y = Math.min(zeroY, valY);
|
|
6754
6769
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
6755
6770
|
barElements.push(
|
|
@@ -6760,7 +6775,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6760
6775
|
y,
|
|
6761
6776
|
width: barWidth,
|
|
6762
6777
|
height: h,
|
|
6763
|
-
fill:
|
|
6778
|
+
fill: chunkWK56SFN7_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
6764
6779
|
rx: 1
|
|
6765
6780
|
},
|
|
6766
6781
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -6776,7 +6791,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6776
6791
|
textAnchor: "middle",
|
|
6777
6792
|
fontSize: 7,
|
|
6778
6793
|
fill: "#334155",
|
|
6779
|
-
children:
|
|
6794
|
+
children: chunkWK56SFN7_js.formatAxisValue(val)
|
|
6780
6795
|
},
|
|
6781
6796
|
`${element.id}-combo-bar-dl-${vi}`
|
|
6782
6797
|
)
|
|
@@ -6793,10 +6808,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6793
6808
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
6794
6809
|
const points = series.values.map((val, vi) => {
|
|
6795
6810
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
6796
|
-
const y =
|
|
6811
|
+
const y = chunkWK56SFN7_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
6797
6812
|
return { x, y, val };
|
|
6798
6813
|
});
|
|
6799
|
-
const c =
|
|
6814
|
+
const c = chunkWK56SFN7_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
6800
6815
|
lineElements.push(
|
|
6801
6816
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6802
6817
|
"polyline",
|
|
@@ -6823,7 +6838,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6823
6838
|
textAnchor: "middle",
|
|
6824
6839
|
fontSize: 7,
|
|
6825
6840
|
fill: "#334155",
|
|
6826
|
-
children:
|
|
6841
|
+
children: chunkWK56SFN7_js.formatAxisValue(p.val)
|
|
6827
6842
|
},
|
|
6828
6843
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
6829
6844
|
)
|
|
@@ -6861,11 +6876,11 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6861
6876
|
}
|
|
6862
6877
|
function renderChartElement(element) {
|
|
6863
6878
|
if (element.type !== "chart") {
|
|
6864
|
-
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"] });
|
|
6865
6880
|
}
|
|
6866
6881
|
const chartData = element.chartData;
|
|
6867
6882
|
if (!chartData || chartData.series.length === 0) {
|
|
6868
|
-
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"] });
|
|
6869
6884
|
}
|
|
6870
6885
|
const longestSeriesLength = chartData.series.reduce(
|
|
6871
6886
|
(maxLength, series) => Math.max(maxLength, series.values.length),
|
|
@@ -7969,14 +7984,14 @@ function buildNotesPdf(pages) {
|
|
|
7969
7984
|
notes: page.notes,
|
|
7970
7985
|
slideNumber: page.slideNumber
|
|
7971
7986
|
}));
|
|
7972
|
-
const bytes =
|
|
7987
|
+
const bytes = chunkWK56SFN7_js.buildNotesPdfBytes(images, meta);
|
|
7973
7988
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
7974
7989
|
return URL.createObjectURL(blob);
|
|
7975
7990
|
}
|
|
7976
7991
|
|
|
7977
7992
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
7978
7993
|
function buildPdfFromImageData(images) {
|
|
7979
|
-
const bytes =
|
|
7994
|
+
const bytes = chunkWK56SFN7_js.buildSlidesPdfBytes(images);
|
|
7980
7995
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
7981
7996
|
return URL.createObjectURL(blob);
|
|
7982
7997
|
}
|
|
@@ -7985,7 +8000,7 @@ function buildPdfFromImageData(images) {
|
|
|
7985
8000
|
var activePreview = null;
|
|
7986
8001
|
function startPreviewAnimation(elementId, preset, options) {
|
|
7987
8002
|
stopPreviewAnimation();
|
|
7988
|
-
const descriptor =
|
|
8003
|
+
const descriptor = chunkWK56SFN7_js.buildPreviewAnimation(preset, options);
|
|
7989
8004
|
if (!descriptor) {
|
|
7990
8005
|
return;
|
|
7991
8006
|
}
|