pptx-react-viewer 2.16.9 → 2.17.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-EPMBL6EA.js → AiChatPanel-HCHCVQN2.js} +24 -24
- package/dist/AiChatPanel-HCHCVQN2.js.br +0 -0
- package/dist/AiChatPanel-HCHCVQN2.js.gz +0 -0
- package/dist/{AiChatPanel-XHKYPYPH.mjs → AiChatPanel-RZ4A7P4H.mjs} +4 -4
- package/dist/AiChatPanel-RZ4A7P4H.mjs.br +0 -0
- package/dist/AiChatPanel-RZ4A7P4H.mjs.gz +0 -0
- package/dist/{Model3DScene-YMIAGRPG.mjs → Model3DScene-I7FR74AD.mjs} +1 -1
- package/dist/Model3DScene-I7FR74AD.mjs.br +0 -0
- package/dist/Model3DScene-I7FR74AD.mjs.gz +0 -0
- package/dist/{Model3DScene-DUJOZA2B.js → Model3DScene-LK7LSQNH.js} +2 -2
- package/dist/Model3DScene-LK7LSQNH.js.br +0 -0
- package/dist/Model3DScene-LK7LSQNH.js.gz +0 -0
- package/dist/PowerPointViewer-Du7u4INi.d.ts.map +1 -1
- package/dist/{SurfaceChart3DScene-Q47OEJXS.mjs → SurfaceChart3DScene-DEQP5O3U.mjs} +1 -1
- package/dist/SurfaceChart3DScene-DEQP5O3U.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-DEQP5O3U.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-TNCHWQAK.js → SurfaceChart3DScene-ODQY77SZ.js} +2 -2
- package/dist/SurfaceChart3DScene-ODQY77SZ.js.br +0 -0
- package/dist/SurfaceChart3DScene-ODQY77SZ.js.gz +0 -0
- package/dist/{chunk-3KIKPDAJ.mjs → chunk-422DF424.mjs} +742 -2294
- package/dist/chunk-422DF424.mjs.br +0 -0
- package/dist/chunk-422DF424.mjs.gz +0 -0
- package/dist/{chunk-WK22Z7PK.js → chunk-5BXATG54.js} +520 -868
- package/dist/chunk-5BXATG54.js.br +0 -0
- package/dist/chunk-5BXATG54.js.gz +0 -0
- package/dist/{chunk-Y2KIB3QH.js → chunk-7JPLVECA.js} +44829 -39322
- package/dist/chunk-7JPLVECA.js.br +0 -0
- package/dist/chunk-7JPLVECA.js.gz +0 -0
- package/dist/{chunk-DVZF4ARG.js → chunk-AONFHTTJ.js} +22 -0
- package/dist/chunk-AONFHTTJ.js.br +0 -0
- package/dist/chunk-AONFHTTJ.js.gz +0 -0
- package/dist/{chunk-PI5SFTDC.js → chunk-ATOUVRRQ.js} +3 -3
- package/dist/chunk-ATOUVRRQ.js.br +0 -0
- package/dist/chunk-ATOUVRRQ.js.gz +0 -0
- package/dist/{chunk-EL2YF26P.mjs → chunk-FXJOTEPO.mjs} +1 -1
- package/dist/chunk-FXJOTEPO.mjs.br +0 -0
- package/dist/chunk-FXJOTEPO.mjs.gz +0 -0
- package/dist/{chunk-YWKUIUQX.mjs → chunk-K2QU73KB.mjs} +44784 -39286
- package/dist/chunk-K2QU73KB.mjs.br +0 -0
- package/dist/chunk-K2QU73KB.mjs.gz +0 -0
- package/dist/{chunk-VHME5BE6.mjs → chunk-MQHC5TXI.mjs} +318 -665
- package/dist/chunk-MQHC5TXI.mjs.br +0 -0
- package/dist/chunk-MQHC5TXI.mjs.gz +0 -0
- package/dist/{chunk-VL7ZT3ID.js → chunk-NQJPPIVH.js} +1681 -3233
- package/dist/chunk-NQJPPIVH.js.br +0 -0
- package/dist/chunk-NQJPPIVH.js.gz +0 -0
- package/dist/{chunk-5IUEPQTK.mjs → chunk-S64T7C4V.mjs} +22 -0
- package/dist/chunk-S64T7C4V.mjs.br +0 -0
- package/dist/chunk-S64T7C4V.mjs.gz +0 -0
- package/dist/{chunk-FSVE6WUY.js → chunk-TCGXGD6E.js} +550 -463
- package/dist/chunk-TCGXGD6E.js.br +0 -0
- package/dist/chunk-TCGXGD6E.js.gz +0 -0
- package/dist/{chunk-J7EFC3GS.mjs → chunk-ZA5JONCW.mjs} +210 -123
- package/dist/chunk-ZA5JONCW.mjs.br +0 -0
- package/dist/chunk-ZA5JONCW.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 +205 -21
- package/dist/index.js +41 -41
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +380 -22
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +79 -79
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +4 -4
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/{useViewerBuildingBlocks-Xddn6SFj.d.ts → useViewerBuildingBlocks-C9-prKYB.d.ts} +32 -6
- package/dist/useViewerBuildingBlocks-C9-prKYB.d.ts.map +1 -0
- package/dist/viewer/index.d.ts +166 -17
- package/dist/viewer/index.js +27 -27
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +6 -6
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-EPMBL6EA.js.br +0 -0
- package/dist/AiChatPanel-EPMBL6EA.js.gz +0 -0
- package/dist/AiChatPanel-XHKYPYPH.mjs.br +0 -0
- package/dist/AiChatPanel-XHKYPYPH.mjs.gz +0 -0
- package/dist/Model3DScene-DUJOZA2B.js.br +0 -0
- package/dist/Model3DScene-DUJOZA2B.js.gz +0 -0
- package/dist/Model3DScene-YMIAGRPG.mjs.br +0 -0
- package/dist/Model3DScene-YMIAGRPG.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-Q47OEJXS.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-Q47OEJXS.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-TNCHWQAK.js.br +0 -0
- package/dist/SurfaceChart3DScene-TNCHWQAK.js.gz +0 -0
- package/dist/chunk-3KIKPDAJ.mjs.br +0 -0
- package/dist/chunk-3KIKPDAJ.mjs.gz +0 -0
- package/dist/chunk-5IUEPQTK.mjs.br +0 -0
- package/dist/chunk-5IUEPQTK.mjs.gz +0 -0
- package/dist/chunk-DVZF4ARG.js.br +0 -0
- package/dist/chunk-DVZF4ARG.js.gz +0 -0
- package/dist/chunk-EL2YF26P.mjs.br +0 -0
- package/dist/chunk-EL2YF26P.mjs.gz +0 -0
- package/dist/chunk-FSVE6WUY.js.br +0 -0
- package/dist/chunk-FSVE6WUY.js.gz +0 -0
- package/dist/chunk-J7EFC3GS.mjs.br +0 -0
- package/dist/chunk-J7EFC3GS.mjs.gz +0 -0
- package/dist/chunk-PI5SFTDC.js.br +0 -0
- package/dist/chunk-PI5SFTDC.js.gz +0 -0
- package/dist/chunk-VHME5BE6.mjs.br +0 -0
- package/dist/chunk-VHME5BE6.mjs.gz +0 -0
- package/dist/chunk-VL7ZT3ID.js.br +0 -0
- package/dist/chunk-VL7ZT3ID.js.gz +0 -0
- package/dist/chunk-WK22Z7PK.js.br +0 -0
- package/dist/chunk-WK22Z7PK.js.gz +0 -0
- package/dist/chunk-Y2KIB3QH.js.br +0 -0
- package/dist/chunk-Y2KIB3QH.js.gz +0 -0
- package/dist/chunk-YWKUIUQX.mjs.br +0 -0
- package/dist/chunk-YWKUIUQX.mjs.gz +0 -0
- package/dist/useViewerBuildingBlocks-Xddn6SFj.d.ts.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkAONFHTTJ_js = require('./chunk-AONFHTTJ.js');
|
|
4
|
+
var chunk7JPLVECA_js = require('./chunk-7JPLVECA.js');
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var tailwindMerge = require('tailwind-merge');
|
|
7
7
|
var React6 = require('react');
|
|
@@ -15,7 +15,7 @@ var React6__default = /*#__PURE__*/_interopDefault(React6);
|
|
|
15
15
|
|
|
16
16
|
// src/viewer/utils/animation-effects.ts
|
|
17
17
|
function getAnimationInitialStyle2(preset, nativeAnimation) {
|
|
18
|
-
return
|
|
18
|
+
return chunk7JPLVECA_js.getAnimationInitialStyle(preset, nativeAnimation);
|
|
19
19
|
}
|
|
20
20
|
function cn(...inputs) {
|
|
21
21
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
@@ -23,7 +23,7 @@ function cn(...inputs) {
|
|
|
23
23
|
|
|
24
24
|
// src/viewer/utils/clone.ts
|
|
25
25
|
function cloneHistorySnapshot2(snapshot) {
|
|
26
|
-
return
|
|
26
|
+
return chunk7JPLVECA_js.cloneHistorySnapshot(snapshot);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
// src/viewer/constants/scalar.ts
|
|
@@ -40,9 +40,6 @@ var DEFAULT_TEXT_FONT_SIZE = 24;
|
|
|
40
40
|
var HYPERLINK_COLOR = "#0563C1";
|
|
41
41
|
var DEFAULT_TABLE_ROWS = 3;
|
|
42
42
|
var DEFAULT_TABLE_COLUMNS = 3;
|
|
43
|
-
var SHAPE_ADJUSTMENT_MIN = 0;
|
|
44
|
-
var SHAPE_ADJUSTMENT_MAX = 5e4;
|
|
45
|
-
var DEFAULT_ROUND_RECT_ADJUSTMENT = 16667;
|
|
46
43
|
var ZOOM_TO_SELECTION_PADDING = 96;
|
|
47
44
|
var GRID_SIZE = 8;
|
|
48
45
|
var SLIDE_NAV_THUMBNAIL_WIDTH = 156;
|
|
@@ -63,7 +60,7 @@ var TOOLBAR_SECTIONS = [
|
|
|
63
60
|
{ id: "view", labelKey: "pptx.ribbon.tab.view" },
|
|
64
61
|
{ id: "help", labelKey: "pptx.ribbon.tab.help" }
|
|
65
62
|
];
|
|
66
|
-
var SHORTCUT_REFERENCE_ITEMS =
|
|
63
|
+
var SHORTCUT_REFERENCE_ITEMS = chunk7JPLVECA_js.VIEWER_SHORTCUT_REFERENCE;
|
|
67
64
|
|
|
68
65
|
// src/viewer/constants/theme.ts
|
|
69
66
|
var THEME_COLOR_SWATCHES = [
|
|
@@ -107,7 +104,7 @@ var GLYPH_COMPONENTS = {
|
|
|
107
104
|
plus: lu.LuPlus,
|
|
108
105
|
triangle: lu.LuTriangle
|
|
109
106
|
};
|
|
110
|
-
var SHAPE_PRESETS =
|
|
107
|
+
var SHAPE_PRESETS = chunk7JPLVECA_js.SHAPE_PRESET_DEFS.map(
|
|
111
108
|
(def) => ({
|
|
112
109
|
type: def.type,
|
|
113
110
|
label: def.label,
|
|
@@ -266,7 +263,7 @@ function isConnectorOrLineElement(element) {
|
|
|
266
263
|
if (element.type === "connector") {
|
|
267
264
|
return true;
|
|
268
265
|
}
|
|
269
|
-
if (!
|
|
266
|
+
if (!chunk7JPLVECA_js.hasShapeProperties(element)) {
|
|
270
267
|
return false;
|
|
271
268
|
}
|
|
272
269
|
const st = getShapeType(element.shapeType);
|
|
@@ -275,7 +272,7 @@ function isConnectorOrLineElement(element) {
|
|
|
275
272
|
|
|
276
273
|
// src/viewer/utils/image-style.ts
|
|
277
274
|
function getImageMaskStyle(element) {
|
|
278
|
-
if (!
|
|
275
|
+
if (!chunk7JPLVECA_js.hasShapeProperties(element)) {
|
|
279
276
|
return void 0;
|
|
280
277
|
}
|
|
281
278
|
const shapeType = element.shapeType;
|
|
@@ -284,7 +281,7 @@ function getImageMaskStyle(element) {
|
|
|
284
281
|
}
|
|
285
282
|
const normalized = shapeType.toLowerCase();
|
|
286
283
|
if (normalized === "roundrect" || normalized === "round1rect" || normalized === "round2samerect" || normalized === "round2diagrect" || normalized === "sniproundrect" || normalized === "snip1rect" || normalized === "snip2diagrect") {
|
|
287
|
-
const radiusPx =
|
|
284
|
+
const radiusPx = chunk7JPLVECA_js.getRoundRectRadiusPx2(element);
|
|
288
285
|
if (radiusPx <= 0.01) {
|
|
289
286
|
return void 0;
|
|
290
287
|
}
|
|
@@ -296,7 +293,7 @@ function getImageMaskStyle(element) {
|
|
|
296
293
|
if (normalized === "can" || normalized === "cylinder") {
|
|
297
294
|
return { borderRadius: "48% / 12%" };
|
|
298
295
|
}
|
|
299
|
-
const clipPath =
|
|
296
|
+
const clipPath = chunk7JPLVECA_js.getResolvedShapeClipPath(element);
|
|
300
297
|
if (!clipPath) {
|
|
301
298
|
return void 0;
|
|
302
299
|
}
|
|
@@ -305,7 +302,7 @@ function getImageMaskStyle(element) {
|
|
|
305
302
|
function getImageRenderStyle(element) {
|
|
306
303
|
return {
|
|
307
304
|
...getImageMaskStyle(element) || {},
|
|
308
|
-
...
|
|
305
|
+
...chunk7JPLVECA_js.getImageFitStyle(element)
|
|
309
306
|
};
|
|
310
307
|
}
|
|
311
308
|
var CROP_SHAPE_CLIP_PATHS = {
|
|
@@ -318,7 +315,7 @@ var CROP_SHAPE_CLIP_PATHS = {
|
|
|
318
315
|
star: "polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)"
|
|
319
316
|
};
|
|
320
317
|
function getCropShapeClipPath(element) {
|
|
321
|
-
if (!
|
|
318
|
+
if (!chunk7JPLVECA_js.isImageLikeElement(element)) {
|
|
322
319
|
return void 0;
|
|
323
320
|
}
|
|
324
321
|
const shape = element.cropShape;
|
|
@@ -327,86 +324,8 @@ function getCropShapeClipPath(element) {
|
|
|
327
324
|
}
|
|
328
325
|
return CROP_SHAPE_CLIP_PATHS[shape];
|
|
329
326
|
}
|
|
330
|
-
function
|
|
331
|
-
|
|
332
|
-
return false;
|
|
333
|
-
}
|
|
334
|
-
return typeof element.tileScaleX === "number" || typeof element.tileScaleY === "number";
|
|
335
|
-
}
|
|
336
|
-
function tileAlignmentToCssPosition(alignment) {
|
|
337
|
-
switch (alignment) {
|
|
338
|
-
case "tl":
|
|
339
|
-
return "top left";
|
|
340
|
-
case "t":
|
|
341
|
-
return "top center";
|
|
342
|
-
case "tr":
|
|
343
|
-
return "top right";
|
|
344
|
-
case "l":
|
|
345
|
-
return "center left";
|
|
346
|
-
case "ctr":
|
|
347
|
-
return "center center";
|
|
348
|
-
case "r":
|
|
349
|
-
return "center right";
|
|
350
|
-
case "bl":
|
|
351
|
-
return "bottom left";
|
|
352
|
-
case "b":
|
|
353
|
-
return "bottom center";
|
|
354
|
-
case "br":
|
|
355
|
-
return "bottom right";
|
|
356
|
-
default:
|
|
357
|
-
return void 0;
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
function buildMirrorTiledBackground(src, flip, scaleX, scaleY) {
|
|
361
|
-
if (!src.startsWith("data:")) {
|
|
362
|
-
return void 0;
|
|
363
|
-
}
|
|
364
|
-
const flipX = flip === "x" || flip === "xy";
|
|
365
|
-
const flipY = flip === "y" || flip === "xy";
|
|
366
|
-
const cols = flipX ? 2 : 1;
|
|
367
|
-
const rows = flipY ? 2 : 1;
|
|
368
|
-
const images = [];
|
|
369
|
-
for (let cy = 0; cy < rows; cy++) {
|
|
370
|
-
for (let cx = 0; cx < cols; cx++) {
|
|
371
|
-
const mirrorX = flipX && cx % 2 === 1;
|
|
372
|
-
const mirrorY = flipY && cy % 2 === 1;
|
|
373
|
-
const sx = mirrorX ? -1 : 1;
|
|
374
|
-
const sy = mirrorY ? -1 : 1;
|
|
375
|
-
const tx = cx + (mirrorX ? 1 : 0);
|
|
376
|
-
const ty = cy + (mirrorY ? 1 : 0);
|
|
377
|
-
images.push(
|
|
378
|
-
`<image href="${src}" x="0" y="0" width="1" height="1" preserveAspectRatio="none" transform="translate(${tx},${ty}) scale(${sx},${sy})"/>`
|
|
379
|
-
);
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${cols} ${rows}" width="${cols}" height="${rows}">${images.join("")}</svg>`;
|
|
383
|
-
return {
|
|
384
|
-
backgroundImage: `url("data:image/svg+xml,${encodeURIComponent(svg)}")`,
|
|
385
|
-
backgroundSize: `${scaleX * cols}% ${scaleY * rows}%`
|
|
386
|
-
};
|
|
387
|
-
}
|
|
388
|
-
function getImageTilingStyle(element) {
|
|
389
|
-
if (!chunkY2KIB3QH_js.isImageLikeElement(element) || !isImageTiled(element)) {
|
|
390
|
-
return void 0;
|
|
391
|
-
}
|
|
392
|
-
const scaleX = typeof element.tileScaleX === "number" ? element.tileScaleX * 100 : 100;
|
|
393
|
-
const scaleY = typeof element.tileScaleY === "number" ? element.tileScaleY * 100 : 100;
|
|
394
|
-
const offsetX = typeof element.tileOffsetX === "number" ? element.tileOffsetX : 0;
|
|
395
|
-
const offsetY = typeof element.tileOffsetY === "number" ? element.tileOffsetY : 0;
|
|
396
|
-
const alignmentPosition = tileAlignmentToCssPosition(element.tileAlignment);
|
|
397
|
-
const hasExplicitOffset = offsetX !== 0 || offsetY !== 0;
|
|
398
|
-
const bgPosition = hasExplicitOffset ? `${offsetX}px ${offsetY}px` : alignmentPosition || `${offsetX}px ${offsetY}px`;
|
|
399
|
-
const src = element.svgData || element.imageData;
|
|
400
|
-
const flip = element.tileFlip;
|
|
401
|
-
const mirror = src && flip && flip !== "none" ? buildMirrorTiledBackground(src, flip, scaleX, scaleY) : void 0;
|
|
402
|
-
return {
|
|
403
|
-
backgroundImage: mirror ? mirror.backgroundImage : src ? `url(${src})` : void 0,
|
|
404
|
-
backgroundRepeat: "repeat",
|
|
405
|
-
backgroundSize: mirror ? mirror.backgroundSize : `${scaleX}% ${scaleY}%`,
|
|
406
|
-
backgroundPosition: bgPosition,
|
|
407
|
-
width: "100%",
|
|
408
|
-
height: "100%"
|
|
409
|
-
};
|
|
327
|
+
function getImageTilingStyle2(element) {
|
|
328
|
+
return chunk7JPLVECA_js.getImageTilingStyle(element);
|
|
410
329
|
}
|
|
411
330
|
|
|
412
331
|
// src/viewer/utils/geometry-image.ts
|
|
@@ -606,9 +525,9 @@ function registerMediaElement(elementId, el) {
|
|
|
606
525
|
};
|
|
607
526
|
}
|
|
608
527
|
function executeMediaCommand(command, frameRoot) {
|
|
609
|
-
return
|
|
528
|
+
return chunk7JPLVECA_js.runMediaCommand(
|
|
610
529
|
command,
|
|
611
|
-
(targetId) => registry.get(targetId) ??
|
|
530
|
+
(targetId) => registry.get(targetId) ?? chunk7JPLVECA_js.findMediaElementByElementId(targetId, frameRoot?.())
|
|
612
531
|
);
|
|
613
532
|
}
|
|
614
533
|
function PresentationMediaController({
|
|
@@ -652,7 +571,7 @@ function PresentationMediaController({
|
|
|
652
571
|
loop: shouldLoop,
|
|
653
572
|
volume: playbackVolume,
|
|
654
573
|
playbackRate
|
|
655
|
-
} =
|
|
574
|
+
} = chunk7JPLVECA_js.mediaPlaybackAttributes({
|
|
656
575
|
loop: element.loop,
|
|
657
576
|
volume: element.volume,
|
|
658
577
|
playbackSpeed: element.playbackSpeed
|
|
@@ -788,7 +707,7 @@ function PresentationMediaController({
|
|
|
788
707
|
if (element.playAcrossSlides && element.mediaType === "audio") {
|
|
789
708
|
const dataUrl = element.mediaData ?? resolvedDataUrl;
|
|
790
709
|
if (dataUrl) {
|
|
791
|
-
|
|
710
|
+
chunk7JPLVECA_js.registerPersistentAudio(
|
|
792
711
|
element.id,
|
|
793
712
|
dataUrl,
|
|
794
713
|
element.mediaMimeType,
|
|
@@ -850,7 +769,7 @@ function PresentationMediaController({
|
|
|
850
769
|
] });
|
|
851
770
|
}
|
|
852
771
|
function label(key) {
|
|
853
|
-
return key === void 0 ? void 0 :
|
|
772
|
+
return key === void 0 ? void 0 : chunkAONFHTTJ_js.translationsEn[key];
|
|
854
773
|
}
|
|
855
774
|
function FallbackIcon({
|
|
856
775
|
paths,
|
|
@@ -886,17 +805,17 @@ function Badge({
|
|
|
886
805
|
"div",
|
|
887
806
|
{
|
|
888
807
|
className: `absolute inset-0 flex flex-col items-center justify-center ${isMissing ? "gap-1" : ""}`,
|
|
889
|
-
...{ [
|
|
808
|
+
...{ [chunk7JPLVECA_js.MEDIA_CHROME_ATTRIBUTE]: visual.badge },
|
|
890
809
|
children: [
|
|
891
810
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
892
811
|
FallbackIcon,
|
|
893
812
|
{
|
|
894
|
-
paths:
|
|
813
|
+
paths: chunk7JPLVECA_js.mediaFallbackIcon(visual, element.mediaType),
|
|
895
814
|
size: isMissing ? 32 : 48,
|
|
896
815
|
className: isMissing ? "text-white/60" : "text-white/80 drop-shadow-md"
|
|
897
816
|
}
|
|
898
817
|
),
|
|
899
|
-
isMissing && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: label(
|
|
818
|
+
isMissing && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: label(chunk7JPLVECA_js.mediaFallbackLabelKey(visual, element.mediaType)) })
|
|
900
819
|
]
|
|
901
820
|
}
|
|
902
821
|
);
|
|
@@ -913,17 +832,17 @@ function Placeholder({
|
|
|
913
832
|
"div",
|
|
914
833
|
{
|
|
915
834
|
className: `w-full h-full flex flex-col items-center justify-center gap-1 pointer-events-none rounded ${isMissing ? "bg-black/30 border border-dashed border-white/20" : element.mediaType === "audio" ? "bg-black/10" : "bg-black/20"}`,
|
|
916
|
-
...{ [
|
|
835
|
+
...{ [chunk7JPLVECA_js.MEDIA_CHROME_ATTRIBUTE]: visual.placeholder },
|
|
917
836
|
children: [
|
|
918
837
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
919
838
|
FallbackIcon,
|
|
920
839
|
{
|
|
921
|
-
paths:
|
|
840
|
+
paths: chunk7JPLVECA_js.mediaFallbackIcon(visual, element.mediaType),
|
|
922
841
|
size: isMissing ? 36 : element.mediaType === "audio" ? 24 : 32,
|
|
923
842
|
className: isMissing ? "text-white/50" : "text-white/70"
|
|
924
843
|
}
|
|
925
844
|
),
|
|
926
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `text-[10px] ${isMissing ? "text-white/50" : "text-white/70"}`, children: label(
|
|
845
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `text-[10px] ${isMissing ? "text-white/50" : "text-white/70"}`, children: label(chunk7JPLVECA_js.mediaFallbackLabelKey(visual, element.mediaType)) })
|
|
927
846
|
]
|
|
928
847
|
}
|
|
929
848
|
);
|
|
@@ -933,7 +852,7 @@ function renderMediaFallback({
|
|
|
933
852
|
posterUrl,
|
|
934
853
|
surface
|
|
935
854
|
}) {
|
|
936
|
-
const visual =
|
|
855
|
+
const visual = chunk7JPLVECA_js.mediaFallbackVisual(surface, {
|
|
937
856
|
hasPoster: Boolean(posterUrl),
|
|
938
857
|
missing: element.mediaMissing === true
|
|
939
858
|
});
|
|
@@ -943,7 +862,7 @@ function renderMediaFallback({
|
|
|
943
862
|
"img",
|
|
944
863
|
{
|
|
945
864
|
src: posterUrl,
|
|
946
|
-
alt: visual.dimPoster ?
|
|
865
|
+
alt: visual.dimPoster ? chunkAONFHTTJ_js.translationsEn["pptx.media.posterAlt"] : chunkAONFHTTJ_js.translationsEn["pptx.media.videoPosterAlt"],
|
|
947
866
|
className: `w-full h-full object-contain${visual.dimPoster ? " opacity-50" : ""}`
|
|
948
867
|
}
|
|
949
868
|
),
|
|
@@ -954,7 +873,7 @@ function renderMediaFallback({
|
|
|
954
873
|
}
|
|
955
874
|
function renderMediaElement(element, mediaDataUrls, options) {
|
|
956
875
|
if (element.type !== "media") {
|
|
957
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
876
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkAONFHTTJ_js.translationsEn["pptx.media.title"] });
|
|
958
877
|
}
|
|
959
878
|
const mediaType = element.mediaType;
|
|
960
879
|
const mediaPath = element.mediaPath;
|
|
@@ -962,7 +881,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
962
881
|
const dataUrl = element.mediaData ?? (mediaPath ? mediaDataUrls.get(mediaPath) : void 0);
|
|
963
882
|
const trimFragment = buildTrimFragment(element);
|
|
964
883
|
const posterUrl = element.posterFrameData ?? void 0;
|
|
965
|
-
const shouldLoop =
|
|
884
|
+
const shouldLoop = chunk7JPLVECA_js.mediaPlaybackAttributes(element).loop;
|
|
966
885
|
const shouldAutoPlay = options?.autoPlay === true || element.autoPlay === true;
|
|
967
886
|
const isFullScreen = options?.fullScreen === true;
|
|
968
887
|
const isPresentationMode = options?.isPresentationMode === true;
|
|
@@ -1040,12 +959,12 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
1040
959
|
if (surface.presenting || surface.preview) {
|
|
1041
960
|
return null;
|
|
1042
961
|
}
|
|
1043
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
962
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkAONFHTTJ_js.translationsEn["pptx.media.title"] });
|
|
1044
963
|
}
|
|
1045
964
|
|
|
1046
965
|
// src/viewer/utils/text-utils.tsx
|
|
1047
966
|
function getTextStyleForElement(element, fallbackColor) {
|
|
1048
|
-
return
|
|
967
|
+
return chunk7JPLVECA_js.buildTextBlockStyle(element, { fallbackColor });
|
|
1049
968
|
}
|
|
1050
969
|
|
|
1051
970
|
// src/viewer/utils/text-layout.tsx
|
|
@@ -1070,13 +989,13 @@ function computeTabSize(tabStops, defaultTabSize) {
|
|
|
1070
989
|
return avgGap > 0 ? `${Math.round(avgGap)}px` : fromDefault;
|
|
1071
990
|
}
|
|
1072
991
|
function getTextLayoutStyle(element) {
|
|
1073
|
-
if (!
|
|
992
|
+
if (!chunk7JPLVECA_js.hasTextProperties(element)) {
|
|
1074
993
|
return {};
|
|
1075
994
|
}
|
|
1076
995
|
const verticalAlign = element.textStyle?.vAlign || "top";
|
|
1077
|
-
const writingMode =
|
|
1078
|
-
const textOrientation =
|
|
1079
|
-
const verticalDirection =
|
|
996
|
+
const writingMode = chunk7JPLVECA_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
997
|
+
const textOrientation = chunk7JPLVECA_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
998
|
+
const verticalDirection = chunk7JPLVECA_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
1080
999
|
const parsedColumnCount = Number(element.textStyle?.columnCount);
|
|
1081
1000
|
const columnCount = Number.isFinite(parsedColumnCount) ? Math.max(1, Math.min(16, Math.round(parsedColumnCount))) : 1;
|
|
1082
1001
|
const hasColumns = columnCount > 1;
|
|
@@ -1084,7 +1003,7 @@ function getTextLayoutStyle(element) {
|
|
|
1084
1003
|
const tabStops = element.textStyle?.tabStops;
|
|
1085
1004
|
const tabSize = computeTabSize(tabStops, element.textStyle?.defaultTabSize);
|
|
1086
1005
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
1087
|
-
const hasParagraphIndents =
|
|
1006
|
+
const hasParagraphIndents = chunk7JPLVECA_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
1088
1007
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
1089
1008
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
1090
1009
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
@@ -1093,7 +1012,7 @@ function getTextLayoutStyle(element) {
|
|
|
1093
1012
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
1094
1013
|
const parsedColumnSpacing = Number(element.textStyle?.columnSpacing);
|
|
1095
1014
|
const columnGap = Number.isFinite(parsedColumnSpacing) && parsedColumnSpacing > 0 ? `${parsedColumnSpacing}px` : "0.75em";
|
|
1096
|
-
const kinsokuStyles =
|
|
1015
|
+
const kinsokuStyles = chunk7JPLVECA_js.getKinsokuLineBreakStyles(element.textStyle);
|
|
1097
1016
|
if (hasColumns) {
|
|
1098
1017
|
return {
|
|
1099
1018
|
display: "block",
|
|
@@ -1139,11 +1058,8 @@ function getTextLayoutStyle(element) {
|
|
|
1139
1058
|
}
|
|
1140
1059
|
|
|
1141
1060
|
// src/viewer/utils/text-effects.tsx
|
|
1142
|
-
function buildTextFillCss2(style) {
|
|
1143
|
-
return chunkY2KIB3QH_js.buildTextFillCss(style);
|
|
1144
|
-
}
|
|
1145
1061
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
1146
|
-
return
|
|
1062
|
+
return chunk7JPLVECA_js.buildTextBody3DSceneStyle(textStyle);
|
|
1147
1063
|
}
|
|
1148
1064
|
|
|
1149
1065
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -1324,27 +1240,27 @@ function buildAnimStyle(state) {
|
|
|
1324
1240
|
}
|
|
1325
1241
|
return Object.keys(style).length > 0 ? style : void 0;
|
|
1326
1242
|
}
|
|
1327
|
-
function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments,
|
|
1243
|
+
function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, paraRuns, subElementAnimStates, renderPiece) {
|
|
1328
1244
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
1329
1245
|
return renderedSegments;
|
|
1330
1246
|
}
|
|
1331
|
-
const paraKey = `${elementId}${
|
|
1247
|
+
const paraKey = `${elementId}${chunk7JPLVECA_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
1332
1248
|
const paraState = subElementAnimStates.get(paraKey);
|
|
1333
1249
|
if (paraState) {
|
|
1334
1250
|
const style = buildAnimStyle(paraState);
|
|
1335
1251
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
1336
1252
|
}
|
|
1337
|
-
const spec =
|
|
1253
|
+
const spec = chunk7JPLVECA_js.buildTextBuildSpec(
|
|
1338
1254
|
elementId,
|
|
1339
1255
|
paraIndex,
|
|
1340
|
-
|
|
1256
|
+
paraRuns.map((run) => ({ text: run.text, style: run })),
|
|
1341
1257
|
subElementAnimStates
|
|
1342
1258
|
);
|
|
1343
1259
|
if (!spec?.spans) {
|
|
1344
1260
|
return renderedSegments;
|
|
1345
1261
|
}
|
|
1346
1262
|
return spec.spans.map((span, index) => {
|
|
1347
|
-
const content = span.style && renderPiece ? renderPiece(span.style, span.text) : span.text;
|
|
1263
|
+
const content = span.style && renderPiece ? renderPiece(span.style, span.text, String(index)) : span.text;
|
|
1348
1264
|
if (!span.animId) {
|
|
1349
1265
|
return /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Fragment, { children: content }, `ws-${index}`);
|
|
1350
1266
|
}
|
|
@@ -1352,7 +1268,7 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1352
1268
|
"span",
|
|
1353
1269
|
{
|
|
1354
1270
|
"data-anim-id": span.animId,
|
|
1355
|
-
style:
|
|
1271
|
+
style: chunk7JPLVECA_js.textBuildSpanStyle(span),
|
|
1356
1272
|
children: content
|
|
1357
1273
|
},
|
|
1358
1274
|
span.animId
|
|
@@ -1496,10 +1412,10 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1496
1412
|
if (!needsScriptFonts || !text) {
|
|
1497
1413
|
return text;
|
|
1498
1414
|
}
|
|
1499
|
-
const runs =
|
|
1415
|
+
const runs = chunk7JPLVECA_js.segmentByScript(text);
|
|
1500
1416
|
if (runs.length <= 1) {
|
|
1501
1417
|
if (runs.length === 1) {
|
|
1502
|
-
const font =
|
|
1418
|
+
const font = chunk7JPLVECA_js.resolveFontForScript(runs[0].script, scriptFonts);
|
|
1503
1419
|
if (font && font !== baseFontFamily) {
|
|
1504
1420
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: text });
|
|
1505
1421
|
}
|
|
@@ -1507,7 +1423,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1507
1423
|
return text;
|
|
1508
1424
|
}
|
|
1509
1425
|
return runs.map((run, i) => {
|
|
1510
|
-
const font =
|
|
1426
|
+
const font = chunk7JPLVECA_js.resolveFontForScript(run.script, scriptFonts);
|
|
1511
1427
|
if (!font || font === baseFontFamily) {
|
|
1512
1428
|
return /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Fragment, { children: run.text }, `${keyPrefix}-r${i}`);
|
|
1513
1429
|
}
|
|
@@ -1518,14 +1434,14 @@ function renderMetricPieces(text, metric, keyPrefix, inner) {
|
|
|
1518
1434
|
if (!metric || !text) {
|
|
1519
1435
|
return inner(text, keyPrefix);
|
|
1520
1436
|
}
|
|
1521
|
-
const pieces =
|
|
1437
|
+
const pieces = chunk7JPLVECA_js.splitRunForMetrics(text, metric.font);
|
|
1522
1438
|
if (pieces.length <= 1) {
|
|
1523
1439
|
return inner(text, keyPrefix);
|
|
1524
1440
|
}
|
|
1525
1441
|
return pieces.map((piece, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1526
1442
|
"span",
|
|
1527
1443
|
{
|
|
1528
|
-
style: { letterSpacing:
|
|
1444
|
+
style: { letterSpacing: chunk7JPLVECA_js.pieceLetterSpacing(metric.authoredPx, piece.tracking) },
|
|
1529
1445
|
children: inner(piece.text, `${keyPrefix}-w${i}`)
|
|
1530
1446
|
},
|
|
1531
1447
|
`${keyPrefix}-w${i}`
|
|
@@ -1596,8 +1512,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1596
1512
|
});
|
|
1597
1513
|
}
|
|
1598
1514
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
1599
|
-
const mathml =
|
|
1600
|
-
const safeMathml = mathml ?
|
|
1515
|
+
const mathml = chunk7JPLVECA_js.convertOmmlToMathMl(equationXml);
|
|
1516
|
+
const safeMathml = mathml ? chunk7JPLVECA_js.sanitizeMathMl(mathml) : "";
|
|
1601
1517
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1602
1518
|
"span",
|
|
1603
1519
|
{
|
|
@@ -1607,7 +1523,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1607
1523
|
},
|
|
1608
1524
|
dangerouslySetInnerHTML: { __html: safeMathml }
|
|
1609
1525
|
}
|
|
1610
|
-
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children:
|
|
1526
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children: chunkAONFHTTJ_js.translationsEn["pptx.textSegment.equationFallback"] });
|
|
1611
1527
|
if (equationNumber) {
|
|
1612
1528
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1613
1529
|
"span",
|
|
@@ -1646,90 +1562,35 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1646
1562
|
}
|
|
1647
1563
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: equationContent }, `${elementId}-seg-${segmentIndex}`);
|
|
1648
1564
|
}
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1657
|
-
"span",
|
|
1658
|
-
{
|
|
1659
|
-
style: {
|
|
1660
|
-
fontSize: picture.sizePx,
|
|
1661
|
-
display: "inline-block",
|
|
1662
|
-
verticalAlign: "middle",
|
|
1663
|
-
marginInlineEnd: 4,
|
|
1664
|
-
color: bulletInfo.color || void 0,
|
|
1665
|
-
fontFamily: bulletInfo.fontFamily || void 0
|
|
1666
|
-
},
|
|
1667
|
-
"aria-label": picture.accessibleLabel,
|
|
1668
|
-
children: `${picture.fallbackMarker} `
|
|
1669
|
-
},
|
|
1670
|
-
`${elementId}-seg-${segmentIndex}-bullet-fallback`
|
|
1671
|
-
);
|
|
1672
|
-
}
|
|
1673
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1674
|
-
"img",
|
|
1675
|
-
{
|
|
1676
|
-
src: picture.src,
|
|
1677
|
-
alt: picture.accessibleLabel,
|
|
1678
|
-
style: {
|
|
1679
|
-
width: picture.sizePx,
|
|
1680
|
-
height: picture.sizePx,
|
|
1681
|
-
display: "inline-block",
|
|
1682
|
-
verticalAlign: "middle",
|
|
1683
|
-
marginInlineEnd: 4,
|
|
1684
|
-
objectFit: "contain"
|
|
1685
|
-
}
|
|
1686
|
-
},
|
|
1687
|
-
`${elementId}-seg-${segmentIndex}-bullet-img`
|
|
1688
|
-
);
|
|
1689
|
-
}
|
|
1690
|
-
function renderSingleSegment(element, segment, segmentIndex, fallbackColor, findHighlights, bulletInfo, onHyperlinkClick, fieldContext, paragraphRtl, requireCtrlClick, bulletHangPx) {
|
|
1691
|
-
if (segment.equationXml) {
|
|
1692
|
-
return renderEquationSegment(
|
|
1693
|
-
element.id,
|
|
1694
|
-
segmentIndex,
|
|
1695
|
-
segment.equationXml,
|
|
1696
|
-
segment.equationNumber
|
|
1697
|
-
);
|
|
1565
|
+
var BASELINE_FONT_SCALE = 0.65;
|
|
1566
|
+
function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
1567
|
+
const { element, fallbackColor, findHighlights, onHyperlinkClick } = ctx;
|
|
1568
|
+
const segmentIndex = run.segmentIndex ?? 0;
|
|
1569
|
+
const key = `${element.id}-seg-${segmentIndex}${keySuffix}`;
|
|
1570
|
+
if (run.equation) {
|
|
1571
|
+
return renderEquationSegment(element.id, segmentIndex, run.equation.xml, run.equation.number);
|
|
1698
1572
|
}
|
|
1699
|
-
const segmentStyle = segment
|
|
1700
|
-
const
|
|
1701
|
-
const textValue = chunkY2KIB3QH_js.substituteFieldText(rawText, segment.fieldType, fieldContext);
|
|
1573
|
+
const segmentStyle = segment?.style ?? {};
|
|
1574
|
+
const textValue = run.text;
|
|
1702
1575
|
const lines = textValue.split("\n");
|
|
1703
|
-
const
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
}
|
|
1707
|
-
if (segmentStyle.strikethrough) {
|
|
1708
|
-
textDecorationTokens.push("line-through");
|
|
1709
|
-
}
|
|
1710
|
-
const isDoubleStrike = segmentStyle.strikethrough && segmentStyle.strikeType === "dblStrike";
|
|
1711
|
-
const resolvedSegmentColor = segmentStyle.hyperlink ? chunkY2KIB3QH_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, HYPERLINK_COLOR) : chunkY2KIB3QH_js.normalizeHexColor(segmentStyle.color || element.textStyle?.color, fallbackColor);
|
|
1712
|
-
const underlineDecoration = chunkY2KIB3QH_js.resolveUnderlineDecorationStyle(
|
|
1713
|
-
Boolean(isDoubleStrike),
|
|
1714
|
-
segmentStyle.underlineStyle
|
|
1576
|
+
const resolvedSegmentColor = chunk7JPLVECA_js.normalizeHexColor(
|
|
1577
|
+
segmentStyle.color || element.textStyle?.color,
|
|
1578
|
+
run.hyperlink ? HYPERLINK_COLOR : fallbackColor
|
|
1715
1579
|
);
|
|
1716
1580
|
const rawBaseline = typeof segmentStyle.baseline === "number" ? segmentStyle.baseline : 0;
|
|
1717
1581
|
const baselineFraction = rawBaseline === 0 ? 0 : Math.abs(rawBaseline) >= 1e3 ? rawBaseline / 1e5 : rawBaseline / 100;
|
|
1718
|
-
const baselineFontScale = baselineFraction !== 0 ?
|
|
1719
|
-
const authoredLetterSpacing = typeof segmentStyle.characterSpacing === "number" && segmentStyle.characterSpacing !== 0 ? segmentStyle.characterSpacing / 100 * (96 / 72) : 0;
|
|
1720
|
-
const textFillStyles = buildTextFillCss2(segmentStyle);
|
|
1582
|
+
const baselineFontScale = baselineFraction !== 0 ? BASELINE_FONT_SCALE : 1;
|
|
1721
1583
|
const rawFontSize = segmentStyle.fontSize || element.textStyle?.fontSize || DEFAULT_TEXT_FONT_SIZE;
|
|
1722
|
-
const
|
|
1723
|
-
const baseFontSize = rawFontSize * autoFitScale;
|
|
1584
|
+
const baseFontSize = rawFontSize * chunk7JPLVECA_js.resolveAutoFitFontScale(element.textStyle);
|
|
1724
1585
|
const baselineShift = baselineFraction !== 0 ? `${baselineFraction * baseFontSize}px` : void 0;
|
|
1725
1586
|
const baseFontSizePt = baseFontSize * (72 / 96);
|
|
1726
1587
|
const fontKerning = typeof segmentStyle.kerning === "number" ? segmentStyle.kerning === 0 ? "none" : baseFontSizePt >= segmentStyle.kerning / 100 ? "normal" : "none" : void 0;
|
|
1727
1588
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
1728
|
-
const baseFontFamily = rawFontFamily ?
|
|
1589
|
+
const baseFontFamily = rawFontFamily ? chunk7JPLVECA_js.getSubstituteFontFamily(
|
|
1729
1590
|
rawFontFamily,
|
|
1730
|
-
|
|
1591
|
+
chunk7JPLVECA_js.parsePanoseString(segmentStyle.latinFontPanose ?? element.textStyle?.latinFontPanose)
|
|
1731
1592
|
) : DEFAULT_FONT_FAMILY2;
|
|
1732
|
-
const scriptFont = (name, panose) => name ?
|
|
1593
|
+
const scriptFont = (name, panose) => name ? chunk7JPLVECA_js.getSubstituteFontFamily(name, chunk7JPLVECA_js.parsePanoseString(panose)) : baseFontFamily;
|
|
1733
1594
|
const scriptFonts = {
|
|
1734
1595
|
latin: baseFontFamily,
|
|
1735
1596
|
eastAsia: scriptFont(
|
|
@@ -1745,7 +1606,8 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1745
1606
|
segmentStyle.symbolFontPanose ?? element.textStyle?.symbolFontPanose
|
|
1746
1607
|
)
|
|
1747
1608
|
};
|
|
1748
|
-
const needsScriptFonts =
|
|
1609
|
+
const needsScriptFonts = chunk7JPLVECA_js.hasDistinctScriptFonts(scriptFonts);
|
|
1610
|
+
const authoredLetterSpacing = typeof segmentStyle.characterSpacing === "number" && segmentStyle.characterSpacing !== 0 ? segmentStyle.characterSpacing / 100 * (96 / 72) : 0;
|
|
1749
1611
|
const metricFont = {
|
|
1750
1612
|
fontFamily: baseFontFamily,
|
|
1751
1613
|
fontSizePx: baseFontSize * baselineFontScale,
|
|
@@ -1753,73 +1615,21 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1753
1615
|
italic: Boolean(segmentStyle.italic)
|
|
1754
1616
|
};
|
|
1755
1617
|
const metricContext = { font: metricFont, authoredPx: authoredLetterSpacing };
|
|
1756
|
-
const
|
|
1618
|
+
const spanStyle = { ...run.style };
|
|
1619
|
+
spanStyle.color = resolvedSegmentColor;
|
|
1620
|
+
spanStyle.fontSize = baseFontSize * baselineFontScale;
|
|
1621
|
+
spanStyle.fontFamily = baseFontFamily;
|
|
1622
|
+
spanStyle.verticalAlign = baselineShift;
|
|
1623
|
+
spanStyle.fontKerning = fontKerning;
|
|
1624
|
+
spanStyle.letterSpacing = chunk7JPLVECA_js.pieceLetterSpacing(
|
|
1757
1625
|
authoredLetterSpacing,
|
|
1758
|
-
|
|
1626
|
+
chunk7JPLVECA_js.resolveMetricTrackingPx(textValue, metricFont)
|
|
1759
1627
|
);
|
|
1760
|
-
const spanStyle = {
|
|
1761
|
-
color: resolvedSegmentColor,
|
|
1762
|
-
fontSize: baseFontSize * baselineFontScale,
|
|
1763
|
-
fontWeight: segmentStyle.bold ? 700 : 400,
|
|
1764
|
-
fontStyle: segmentStyle.italic ? "italic" : "normal",
|
|
1765
|
-
textDecorationLine: textDecorationTokens.length > 0 ? textDecorationTokens.join(" ") : "none",
|
|
1766
|
-
textDecorationStyle: underlineDecoration?.textDecorationStyle,
|
|
1767
|
-
textDecorationThickness: underlineDecoration?.textDecorationThickness,
|
|
1768
|
-
textUnderlineOffset: underlineDecoration?.textUnderlineOffset,
|
|
1769
|
-
fontFamily: baseFontFamily,
|
|
1770
|
-
verticalAlign: baselineShift,
|
|
1771
|
-
// Text capitalization (a:rPr/@cap): all -> force uppercase glyphs;
|
|
1772
|
-
// small -> render lowercase as small caps.
|
|
1773
|
-
textTransform: segmentStyle.textCaps === "all" ? "uppercase" : void 0,
|
|
1774
|
-
fontVariantCaps: segmentStyle.textCaps === "small" ? "small-caps" : void 0,
|
|
1775
|
-
letterSpacing,
|
|
1776
|
-
fontKerning,
|
|
1777
|
-
backgroundColor: textFillStyles ? void 0 : segmentStyle.highlightColor ? chunkY2KIB3QH_js.normalizeHexColor(segmentStyle.highlightColor, "transparent") : void 0,
|
|
1778
|
-
...textFillStyles,
|
|
1779
|
-
textDecorationColor: segmentStyle.underlineColor ? chunkY2KIB3QH_js.normalizeHexColor(segmentStyle.underlineColor, void 0) : void 0,
|
|
1780
|
-
WebkitTextStroke: segmentStyle.textOutlineWidth && segmentStyle.textOutlineColor ? `${segmentStyle.textOutlineWidth}px ${chunkY2KIB3QH_js.normalizeHexColor(segmentStyle.textOutlineColor, "#000000")}` : segmentStyle.textOutlineWidth ? `${segmentStyle.textOutlineWidth}px currentColor` : void 0,
|
|
1781
|
-
paintOrder: segmentStyle.textOutlineWidth ? "stroke fill" : void 0,
|
|
1782
|
-
textShadow: chunkY2KIB3QH_js.buildTextShadowCss(segmentStyle),
|
|
1783
|
-
filter: chunkY2KIB3QH_js.buildTextRunFilterChain(segmentStyle),
|
|
1784
|
-
opacity: chunkY2KIB3QH_js.getTextAlphaOpacity(segmentStyle),
|
|
1785
|
-
WebkitBoxReflect: chunkY2KIB3QH_js.buildTextReflectionCss(segmentStyle)
|
|
1786
|
-
};
|
|
1787
1628
|
const runRtl = segmentStyle.rtl;
|
|
1788
|
-
if (runRtl !== void 0
|
|
1789
|
-
spanStyle.direction = runRtl ? "rtl" : "ltr";
|
|
1790
|
-
spanStyle.unicodeBidi = "bidi-override";
|
|
1791
|
-
} else if (runRtl !== void 0 && runRtl === paragraphRtl) {
|
|
1629
|
+
if (runRtl !== void 0) {
|
|
1792
1630
|
spanStyle.direction = runRtl ? "rtl" : "ltr";
|
|
1793
|
-
spanStyle.unicodeBidi = "embed";
|
|
1794
|
-
}
|
|
1795
|
-
if (bulletInfo) {
|
|
1796
|
-
if (bulletInfo.fontFamily) {
|
|
1797
|
-
spanStyle.fontFamily = bulletInfo.fontFamily;
|
|
1798
|
-
}
|
|
1799
|
-
if (typeof bulletInfo.sizePts === "number") {
|
|
1800
|
-
spanStyle.fontSize = bulletInfo.sizePts * baselineFontScale;
|
|
1801
|
-
} else if (typeof bulletInfo.sizePercent === "number") {
|
|
1802
|
-
spanStyle.fontSize = baseFontSize * (bulletInfo.sizePercent / 100) * baselineFontScale;
|
|
1803
|
-
}
|
|
1804
|
-
if (bulletInfo.color) {
|
|
1805
|
-
spanStyle.color = chunkY2KIB3QH_js.normalizeHexColor(bulletInfo.color, resolvedSegmentColor);
|
|
1806
|
-
}
|
|
1807
|
-
if (typeof bulletHangPx === "number" && bulletHangPx > 0) {
|
|
1808
|
-
spanStyle.display = "inline-block";
|
|
1809
|
-
spanStyle.minWidth = bulletHangPx;
|
|
1810
|
-
spanStyle.textIndent = 0;
|
|
1811
|
-
}
|
|
1631
|
+
spanStyle.unicodeBidi = runRtl !== ctx.paragraphRtl ? "bidi-override" : "embed";
|
|
1812
1632
|
}
|
|
1813
|
-
if (bulletInfo?.imageDataUrl || bulletInfo?.imageRelId) {
|
|
1814
|
-
return renderPictureBullet(element.id, segmentIndex, bulletInfo, baseFontSize);
|
|
1815
|
-
}
|
|
1816
|
-
let hyperlinkUrl = segmentStyle.hyperlink || segment.hyperlink;
|
|
1817
|
-
if (hyperlinkUrl && typeof segmentStyle.hyperlinkTargetSlideIndex === "number" && hyperlinkUrl.toLowerCase().startsWith("ppaction://")) {
|
|
1818
|
-
const separator = hyperlinkUrl.includes("?") ? "&" : "?";
|
|
1819
|
-
hyperlinkUrl = `${hyperlinkUrl}${separator}slideIndex=${segmentStyle.hyperlinkTargetSlideIndex}`;
|
|
1820
|
-
}
|
|
1821
|
-
const rubyText = segment.rubyText;
|
|
1822
|
-
const hasRuby = typeof rubyText === "string" && rubyText.length > 0;
|
|
1823
1633
|
const baseContent = renderSegmentContent(
|
|
1824
1634
|
element.id,
|
|
1825
1635
|
segmentIndex,
|
|
@@ -1839,232 +1649,211 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
|
|
|
1839
1649
|
),
|
|
1840
1650
|
metricContext
|
|
1841
1651
|
);
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
const displayUrl = hyperlinkUrl.startsWith("ppaction://") ? hyperlinkUrl.replace(/^ppaction:\/\//u, "").split("?")[0] : hyperlinkUrl;
|
|
1865
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1866
|
-
"span",
|
|
1867
|
-
{
|
|
1868
|
-
role: "link",
|
|
1869
|
-
tabIndex: 0,
|
|
1870
|
-
className: requireCtrlClick ? "group/link relative" : void 0,
|
|
1871
|
-
style: { cursor: requireCtrlClick ? void 0 : "pointer", pointerEvents: "auto" },
|
|
1872
|
-
onClick: (e) => {
|
|
1873
|
-
if (requireCtrlClick && !e.ctrlKey && !e.metaKey) {
|
|
1874
|
-
return;
|
|
1875
|
-
}
|
|
1876
|
-
e.stopPropagation();
|
|
1877
|
-
e.preventDefault();
|
|
1878
|
-
onHyperlinkClick(hyperlinkUrl);
|
|
1879
|
-
},
|
|
1880
|
-
onKeyDown: (e) => {
|
|
1881
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
1882
|
-
if (requireCtrlClick && !e.ctrlKey && !e.metaKey) {
|
|
1883
|
-
return;
|
|
1884
|
-
}
|
|
1885
|
-
e.preventDefault();
|
|
1886
|
-
e.stopPropagation();
|
|
1887
|
-
onHyperlinkClick(hyperlinkUrl);
|
|
1888
|
-
}
|
|
1889
|
-
},
|
|
1890
|
-
children: [
|
|
1891
|
-
spanNode,
|
|
1892
|
-
requireCtrlClick && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "pointer-events-none absolute left-0 top-full z-[9999] mt-1 max-w-64 opacity-0 transition-opacity duration-150 group-hover/link:opacity-100", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex flex-col rounded border border-border bg-popover px-2.5 py-1.5 shadow-lg", children: [
|
|
1893
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-xs text-foreground", children: displayUrl }),
|
|
1894
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-0.5 text-[10px] text-muted-foreground", children: "Ctrl+Click to follow link" })
|
|
1895
|
-
] }) })
|
|
1896
|
-
]
|
|
1897
|
-
},
|
|
1898
|
-
`${element.id}-seg-${segmentIndex}-link`
|
|
1899
|
-
);
|
|
1900
|
-
}
|
|
1901
|
-
return spanNode;
|
|
1652
|
+
const spanNode = /* @__PURE__ */ jsxRuntime.jsx("span", { "data-seg-idx": segmentIndex, style: spanStyle, children: renderRubyOrText(segment, baseContent, baseFontSize, baseFontFamily, resolvedSegmentColor) }, key);
|
|
1653
|
+
return run.hyperlink && onHyperlinkClick ? renderHyperlink(run, spanNode, key, ctx) : spanNode;
|
|
1654
|
+
}
|
|
1655
|
+
function renderRubyOrText(segment, baseContent, baseFontSize, baseFontFamily, resolvedColor) {
|
|
1656
|
+
const rubyText = segment?.rubyText;
|
|
1657
|
+
if (typeof rubyText !== "string" || rubyText.length === 0) {
|
|
1658
|
+
return baseContent;
|
|
1659
|
+
}
|
|
1660
|
+
const rubyStyle = {
|
|
1661
|
+
fontSize: segment?.rubyFontSize ?? baseFontSize * 0.5,
|
|
1662
|
+
fontFamily: segment?.rubyStyle?.fontFamily ?? baseFontFamily,
|
|
1663
|
+
textAlign: segment?.rubyAlignment === "l" ? "left" : segment?.rubyAlignment === "r" ? "right" : segment?.rubyAlignment === "dist" || segment?.rubyAlignment === "distCat" || segment?.rubyAlignment === "distLetter" ? "justify" : "center"
|
|
1664
|
+
};
|
|
1665
|
+
if (segment?.rubyStyle?.color) {
|
|
1666
|
+
rubyStyle.color = chunk7JPLVECA_js.normalizeHexColor(segment.rubyStyle.color, resolvedColor);
|
|
1667
|
+
}
|
|
1668
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("ruby", { children: [
|
|
1669
|
+
baseContent,
|
|
1670
|
+
/* @__PURE__ */ jsxRuntime.jsx("rp", { children: "(" }),
|
|
1671
|
+
/* @__PURE__ */ jsxRuntime.jsx("rt", { style: rubyStyle, children: rubyText }),
|
|
1672
|
+
/* @__PURE__ */ jsxRuntime.jsx("rp", { children: ")" })
|
|
1673
|
+
] });
|
|
1902
1674
|
}
|
|
1903
|
-
function
|
|
1904
|
-
const
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
if (seg.text === "\n") {
|
|
1909
|
-
paragraphs.push({ entries: current, terminator: seg });
|
|
1910
|
-
current = [];
|
|
1911
|
-
} else {
|
|
1912
|
-
current.push({ segment: seg, globalIndex: i });
|
|
1913
|
-
}
|
|
1675
|
+
function renderHyperlink(run, spanNode, key, ctx) {
|
|
1676
|
+
const url = run.hyperlink?.url;
|
|
1677
|
+
const onHyperlinkClick = ctx.onHyperlinkClick;
|
|
1678
|
+
if (!url || !onHyperlinkClick) {
|
|
1679
|
+
return spanNode;
|
|
1914
1680
|
}
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1681
|
+
const requireCtrlClick = ctx.requireCtrlClick;
|
|
1682
|
+
const displayUrl = url.startsWith("ppaction://") ? url.replace(/^ppaction:\/\//u, "").split("?")[0] : url;
|
|
1683
|
+
const follow = (modified) => {
|
|
1684
|
+
if (requireCtrlClick && !modified) {
|
|
1685
|
+
return false;
|
|
1686
|
+
}
|
|
1687
|
+
onHyperlinkClick(url);
|
|
1688
|
+
return true;
|
|
1689
|
+
};
|
|
1690
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1691
|
+
"span",
|
|
1692
|
+
{
|
|
1693
|
+
role: "link",
|
|
1694
|
+
tabIndex: 0,
|
|
1695
|
+
className: requireCtrlClick ? "group/link relative" : void 0,
|
|
1696
|
+
style: { cursor: requireCtrlClick ? void 0 : "pointer", pointerEvents: "auto" },
|
|
1697
|
+
title: run.hyperlink?.tooltip,
|
|
1698
|
+
onClick: (e) => {
|
|
1699
|
+
if (!follow(e.ctrlKey || e.metaKey)) {
|
|
1700
|
+
return;
|
|
1701
|
+
}
|
|
1702
|
+
e.stopPropagation();
|
|
1703
|
+
e.preventDefault();
|
|
1704
|
+
},
|
|
1705
|
+
onKeyDown: (e) => {
|
|
1706
|
+
if (e.key !== "Enter" && e.key !== " ") {
|
|
1707
|
+
return;
|
|
1708
|
+
}
|
|
1709
|
+
if (!follow(e.ctrlKey || e.metaKey)) {
|
|
1710
|
+
return;
|
|
1711
|
+
}
|
|
1712
|
+
e.preventDefault();
|
|
1713
|
+
e.stopPropagation();
|
|
1714
|
+
},
|
|
1715
|
+
children: [
|
|
1716
|
+
spanNode,
|
|
1717
|
+
requireCtrlClick && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "pointer-events-none absolute left-0 top-full z-[9999] mt-1 max-w-64 opacity-0 transition-opacity duration-150 group-hover/link:opacity-100", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex flex-col rounded border border-border bg-popover px-2.5 py-1.5 shadow-lg", children: [
|
|
1718
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-xs text-foreground", children: displayUrl }),
|
|
1719
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-0.5 text-[10px] text-muted-foreground", children: "Ctrl+Click to follow link" })
|
|
1720
|
+
] }) })
|
|
1721
|
+
]
|
|
1722
|
+
},
|
|
1723
|
+
`${key}-link`
|
|
1724
|
+
);
|
|
1919
1725
|
}
|
|
1920
1726
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick) {
|
|
1921
|
-
if (!
|
|
1727
|
+
if (!chunk7JPLVECA_js.hasTextProperties(element)) {
|
|
1922
1728
|
return emptyFallback || null;
|
|
1923
1729
|
}
|
|
1924
|
-
const
|
|
1925
|
-
if (!
|
|
1730
|
+
const segments = segmentOverrides ?? element.textSegments;
|
|
1731
|
+
if (!segments || segments.length === 0) {
|
|
1926
1732
|
if (!element.text && element.promptText) {
|
|
1927
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1928
|
-
"span",
|
|
1929
|
-
{
|
|
1930
|
-
style: {
|
|
1931
|
-
opacity: 0.5,
|
|
1932
|
-
color: "#888888",
|
|
1933
|
-
pointerEvents: "none"
|
|
1934
|
-
},
|
|
1935
|
-
children: element.promptText
|
|
1936
|
-
}
|
|
1937
|
-
);
|
|
1733
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { opacity: 0.5, color: "#888888", pointerEvents: "none" }, children: element.promptText });
|
|
1938
1734
|
}
|
|
1939
1735
|
return element.text || emptyFallback || "";
|
|
1940
1736
|
}
|
|
1941
|
-
const paragraphs =
|
|
1942
|
-
const
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
const paraRtl = chunkY2KIB3QH_js.resolveParagraphRtl(paraSegments, elementRtl);
|
|
1961
|
-
const isRtlParagraph = paraRtl === true;
|
|
1962
|
-
const paraAlign = chunkY2KIB3QH_js.resolveParagraphAlign(paraSegments, elementAlign);
|
|
1963
|
-
const cssTextAlign = chunkY2KIB3QH_js.resolveCssTextAlign(paraAlign, isRtlParagraph);
|
|
1964
|
-
const paraMarginLeft = isRtlParagraph ? void 0 : rawMarginLeft;
|
|
1965
|
-
const paraMarginRight = isRtlParagraph ? rawMarginLeft : void 0;
|
|
1966
|
-
const paraTextIndent = rawTextIndent;
|
|
1967
|
-
const paraKinsokuStyle = chunkY2KIB3QH_js.getKinsokuLineBreakStyles(firstSeg?.segment.style);
|
|
1968
|
-
const hasParaKinsoku = Object.keys(paraKinsokuStyle).length > 0;
|
|
1969
|
-
const paraProps = effectiveSegments[firstSeg?.globalIndex ?? -1]?.paragraphProperties ?? (paraSegments.length === 0 ? terminator?.paragraphProperties : void 0);
|
|
1970
|
-
const spacing = chunkY2KIB3QH_js.resolveParagraphSpacing({
|
|
1971
|
-
paraProps,
|
|
1972
|
-
bodyStyle,
|
|
1973
|
-
isFirst: paraIndex === 0,
|
|
1974
|
-
isLast: paraIndex === paragraphs.length - 1,
|
|
1975
|
-
spaceFirstLast
|
|
1976
|
-
});
|
|
1977
|
-
const strutFontSize = chunkY2KIB3QH_js.resolveParagraphStrutFontSize(
|
|
1978
|
-
paraSegments.length > 0 ? paraSegments.map(({ segment }) => segment) : terminator ? [terminator] : [],
|
|
1979
|
-
bodyStyle?.fontSize
|
|
1980
|
-
);
|
|
1981
|
-
const hasParaSpacing = spacing.spaceBeforePx !== void 0 || spacing.spaceAfterPx !== void 0 || spacing.lineHeight !== void 0;
|
|
1982
|
-
const paraStyle = {
|
|
1983
|
-
...paraKinsokuStyle
|
|
1984
|
-
};
|
|
1985
|
-
if (strutFontSize !== void 0) {
|
|
1986
|
-
paraStyle.fontSize = strutFontSize;
|
|
1987
|
-
}
|
|
1988
|
-
if (spacing.spaceBeforePx !== void 0) {
|
|
1989
|
-
paraStyle.marginTop = spacing.spaceBeforePx;
|
|
1990
|
-
}
|
|
1991
|
-
if (spacing.spaceAfterPx !== void 0) {
|
|
1992
|
-
paraStyle.marginBottom = spacing.spaceAfterPx;
|
|
1993
|
-
}
|
|
1994
|
-
if (spacing.lineHeight !== void 0) {
|
|
1995
|
-
paraStyle.lineHeight = spacing.lineHeight;
|
|
1996
|
-
}
|
|
1997
|
-
if (paraMarginLeft !== void 0) {
|
|
1998
|
-
paraStyle.marginLeft = paraMarginLeft;
|
|
1999
|
-
}
|
|
2000
|
-
if (paraMarginRight !== void 0) {
|
|
2001
|
-
paraStyle.marginRight = paraMarginRight;
|
|
2002
|
-
}
|
|
2003
|
-
if (paraTextIndent !== void 0) {
|
|
2004
|
-
paraStyle.textIndent = paraTextIndent;
|
|
2005
|
-
}
|
|
2006
|
-
if (paraRtl !== void 0) {
|
|
2007
|
-
paraStyle.direction = paraRtl ? "rtl" : "ltr";
|
|
2008
|
-
paraStyle.unicodeBidi = "embed";
|
|
1737
|
+
const paragraphs = chunk7JPLVECA_js.buildParagraphs(element, fieldContext, segmentOverrides);
|
|
1738
|
+
const ctx = {
|
|
1739
|
+
element,
|
|
1740
|
+
fallbackColor,
|
|
1741
|
+
findHighlights,
|
|
1742
|
+
onHyperlinkClick,
|
|
1743
|
+
requireCtrlClick
|
|
1744
|
+
};
|
|
1745
|
+
return paragraphs.map(
|
|
1746
|
+
(para, paraIndex) => renderParagraph(para, paraIndex, paragraphs.length, segments, ctx, subElementAnimStates)
|
|
1747
|
+
);
|
|
1748
|
+
}
|
|
1749
|
+
function joinRunsBySegment(runs) {
|
|
1750
|
+
const out = [];
|
|
1751
|
+
for (const run of runs) {
|
|
1752
|
+
const last = out[out.length - 1];
|
|
1753
|
+
if (last && run.segmentIndex !== void 0 && last.segmentIndex === run.segmentIndex && !last.equation && !run.equation) {
|
|
1754
|
+
last.text += run.text;
|
|
1755
|
+
continue;
|
|
2009
1756
|
}
|
|
2010
|
-
|
|
2011
|
-
|
|
1757
|
+
out.push({ ...run });
|
|
1758
|
+
}
|
|
1759
|
+
return out;
|
|
1760
|
+
}
|
|
1761
|
+
function renderParagraph(para, paraIndex, paraCount, segments, ctx, subElementAnimStates) {
|
|
1762
|
+
const element = ctx.element;
|
|
1763
|
+
const runCtx = { ...ctx, paragraphRtl: para.rtl };
|
|
1764
|
+
const runs = joinRunsBySegment(para.runs);
|
|
1765
|
+
const renderedRuns = runs.map(
|
|
1766
|
+
(run) => renderParagraphRun(run, segments[run.segmentIndex ?? -1], runCtx)
|
|
1767
|
+
);
|
|
1768
|
+
const paraStyle = {
|
|
1769
|
+
// `text-align`, BiDi `direction` / `unicode-bidi` and the kinsoku
|
|
1770
|
+
// line-break rules, resolved by shared from this paragraph's own `a:pPr`.
|
|
1771
|
+
...para.paragraphStyle
|
|
1772
|
+
};
|
|
1773
|
+
if (para.strutFontSizePx !== void 0) {
|
|
1774
|
+
paraStyle.fontSize = para.strutFontSizePx;
|
|
1775
|
+
}
|
|
1776
|
+
if (para.spaceBeforePx !== void 0) {
|
|
1777
|
+
paraStyle.marginTop = para.spaceBeforePx;
|
|
1778
|
+
}
|
|
1779
|
+
if (para.spaceAfterPx !== void 0) {
|
|
1780
|
+
paraStyle.marginBottom = para.spaceAfterPx;
|
|
1781
|
+
}
|
|
1782
|
+
if (para.lineHeight !== void 0) {
|
|
1783
|
+
paraStyle.lineHeight = para.lineHeight;
|
|
1784
|
+
}
|
|
1785
|
+
if (para.marginLeftPx !== void 0) {
|
|
1786
|
+
if (para.rtl === true) {
|
|
1787
|
+
paraStyle.marginRight = para.marginLeftPx;
|
|
1788
|
+
} else {
|
|
1789
|
+
paraStyle.marginLeft = para.marginLeftPx;
|
|
2012
1790
|
}
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
1791
|
+
}
|
|
1792
|
+
if (para.textIndentPx !== void 0) {
|
|
1793
|
+
paraStyle.textIndent = para.textIndentPx;
|
|
1794
|
+
}
|
|
1795
|
+
const marker = renderBulletMarker(para, paraIndex, element.id);
|
|
1796
|
+
const wrappedContent = wrapWithTextBuildAnimation(
|
|
1797
|
+
element.id,
|
|
1798
|
+
paraIndex,
|
|
1799
|
+
renderedRuns,
|
|
1800
|
+
runs,
|
|
1801
|
+
subElementAnimStates,
|
|
1802
|
+
// A staged build splits the paragraph but must not flatten it: each piece
|
|
1803
|
+
// is re-rendered through the SAME run renderer, so it keeps its run's
|
|
1804
|
+
// font, size, colour and decoration while it animates.
|
|
1805
|
+
(run, text, pieceKey) => renderParagraphRun(
|
|
1806
|
+
{ ...run, text },
|
|
1807
|
+
segments[run.segmentIndex ?? -1],
|
|
1808
|
+
runCtx,
|
|
1809
|
+
`-build-${pieceKey}`
|
|
1810
|
+
)
|
|
1811
|
+
);
|
|
1812
|
+
const needsWrapper = Object.keys(paraStyle).length > 0 || marker !== null;
|
|
1813
|
+
if (!needsWrapper) {
|
|
1814
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React6__default.default.Fragment, { children: [
|
|
1815
|
+
wrappedContent,
|
|
1816
|
+
paraIndex < paraCount - 1 ? /* @__PURE__ */ jsxRuntime.jsx("br", {}) : null
|
|
1817
|
+
] }, `${element.id}-para-${paraIndex}`);
|
|
1818
|
+
}
|
|
1819
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: paraStyle, children: [
|
|
1820
|
+
marker,
|
|
1821
|
+
para.isEmpty ? /* @__PURE__ */ jsxRuntime.jsx("br", {}) : wrappedContent
|
|
1822
|
+
] }, `${element.id}-para-${paraIndex}`);
|
|
1823
|
+
}
|
|
1824
|
+
function renderBulletMarker(para, paraIndex, elementId) {
|
|
1825
|
+
const picture = para.bulletPicture;
|
|
1826
|
+
if (picture?.src) {
|
|
1827
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1828
|
+
"img",
|
|
1829
|
+
{
|
|
1830
|
+
src: picture.src,
|
|
1831
|
+
alt: picture.accessibleLabel,
|
|
1832
|
+
style: {
|
|
1833
|
+
width: picture.sizePx,
|
|
1834
|
+
height: picture.sizePx,
|
|
1835
|
+
display: "inline-block",
|
|
1836
|
+
verticalAlign: "middle",
|
|
1837
|
+
marginInlineEnd: 4,
|
|
1838
|
+
objectFit: "contain"
|
|
1839
|
+
}
|
|
1840
|
+
},
|
|
1841
|
+
`${elementId}-para-${paraIndex}-bullet-img`
|
|
2058
1842
|
);
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
1843
|
+
}
|
|
1844
|
+
if (para.bulletMarker === void 0) {
|
|
1845
|
+
return null;
|
|
1846
|
+
}
|
|
1847
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1848
|
+
"span",
|
|
1849
|
+
{
|
|
1850
|
+
className: "pptx-bullet",
|
|
1851
|
+
style: para.bulletStyle,
|
|
1852
|
+
"aria-label": picture?.accessibleLabel,
|
|
1853
|
+
children: para.bulletMarker
|
|
1854
|
+
},
|
|
1855
|
+
`${elementId}-para-${paraIndex}-bullet`
|
|
1856
|
+
);
|
|
2068
1857
|
}
|
|
2069
1858
|
function hexToRgbUnit(hex) {
|
|
2070
1859
|
const clean = hex.replace("#", "");
|
|
@@ -2078,13 +1867,13 @@ function hexToRgbUnit(hex) {
|
|
|
2078
1867
|
};
|
|
2079
1868
|
}
|
|
2080
1869
|
function getDuotoneColors(element) {
|
|
2081
|
-
if (!
|
|
1870
|
+
if (!chunk7JPLVECA_js.isImageLikeElement(element)) {
|
|
2082
1871
|
return void 0;
|
|
2083
1872
|
}
|
|
2084
1873
|
return element.imageEffects?.duotone;
|
|
2085
1874
|
}
|
|
2086
1875
|
function buildLineShadowCss(element) {
|
|
2087
|
-
if (!
|
|
1876
|
+
if (!chunk7JPLVECA_js.hasShapeProperties(element)) {
|
|
2088
1877
|
return void 0;
|
|
2089
1878
|
}
|
|
2090
1879
|
const ss = element.shapeStyle;
|
|
@@ -2095,13 +1884,13 @@ function buildLineShadowCss(element) {
|
|
|
2095
1884
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
2096
1885
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
2097
1886
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
2098
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
2099
|
-
|
|
1887
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunk7JPLVECA_js.colorWithOpacity(
|
|
1888
|
+
chunk7JPLVECA_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
2100
1889
|
opacity
|
|
2101
1890
|
)}`;
|
|
2102
1891
|
}
|
|
2103
1892
|
function buildLineGlowFilter(element) {
|
|
2104
|
-
if (!
|
|
1893
|
+
if (!chunk7JPLVECA_js.hasShapeProperties(element)) {
|
|
2105
1894
|
return void 0;
|
|
2106
1895
|
}
|
|
2107
1896
|
const ss = element.shapeStyle;
|
|
@@ -2110,31 +1899,14 @@ function buildLineGlowFilter(element) {
|
|
|
2110
1899
|
}
|
|
2111
1900
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
2112
1901
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
2113
|
-
const glowCol =
|
|
1902
|
+
const glowCol = chunk7JPLVECA_js.colorWithOpacity(chunk7JPLVECA_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
2114
1903
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
2115
1904
|
}
|
|
2116
|
-
function mapDagBlendModeToCss(blend) {
|
|
2117
|
-
if (!blend) {
|
|
2118
|
-
return void 0;
|
|
2119
|
-
}
|
|
2120
|
-
switch (blend) {
|
|
2121
|
-
case "mult":
|
|
2122
|
-
return "multiply";
|
|
2123
|
-
case "screen":
|
|
2124
|
-
return "screen";
|
|
2125
|
-
case "darken":
|
|
2126
|
-
return "darken";
|
|
2127
|
-
case "lighten":
|
|
2128
|
-
return "lighten";
|
|
2129
|
-
default:
|
|
2130
|
-
return void 0;
|
|
2131
|
-
}
|
|
2132
|
-
}
|
|
2133
1905
|
function getDagDuotoneFilterId(elementId) {
|
|
2134
1906
|
return `dag-duotone-${elementId}`;
|
|
2135
1907
|
}
|
|
2136
1908
|
function hasDagDuotoneEffect(element) {
|
|
2137
|
-
if (!
|
|
1909
|
+
if (!chunk7JPLVECA_js.hasShapeProperties(element)) {
|
|
2138
1910
|
return false;
|
|
2139
1911
|
}
|
|
2140
1912
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
@@ -2184,20 +1956,9 @@ function renderDagDuotoneSvgFilter(elementId, color1, color2) {
|
|
|
2184
1956
|
);
|
|
2185
1957
|
}
|
|
2186
1958
|
|
|
2187
|
-
// src/viewer/utils/shape-round-rect.ts
|
|
2188
|
-
function localClampAdjustment(value) {
|
|
2189
|
-
return Math.max(SHAPE_ADJUSTMENT_MIN, Math.min(SHAPE_ADJUSTMENT_MAX, Math.round(value)));
|
|
2190
|
-
}
|
|
2191
|
-
function getRoundRectRadiusPx(element) {
|
|
2192
|
-
const adjustment = element.shapeAdjustments?.adj;
|
|
2193
|
-
const adjValue = typeof adjustment === "number" && Number.isFinite(adjustment) ? localClampAdjustment(adjustment) : DEFAULT_ROUND_RECT_ADJUSTMENT;
|
|
2194
|
-
const normalizedAdjustment = adjValue / SHAPE_ADJUSTMENT_MAX;
|
|
2195
|
-
return Math.min(Math.max(element.width, 1), Math.max(element.height, 1)) * 0.5 * normalizedAdjustment;
|
|
2196
|
-
}
|
|
2197
|
-
|
|
2198
1959
|
// src/viewer/utils/shape-visual-3d.ts
|
|
2199
1960
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
2200
|
-
return
|
|
1961
|
+
return chunk7JPLVECA_js.build3DExtrusionData(
|
|
2201
1962
|
shape3d,
|
|
2202
1963
|
scene3d,
|
|
2203
1964
|
fillColor,
|
|
@@ -2206,166 +1967,56 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
2206
1967
|
);
|
|
2207
1968
|
}
|
|
2208
1969
|
function apply3dEffects2(base, scene3d, shape3d, fillColorFallback) {
|
|
2209
|
-
|
|
1970
|
+
chunk7JPLVECA_js.apply3dEffects(base, scene3d, shape3d, fillColorFallback);
|
|
2210
1971
|
}
|
|
2211
1972
|
|
|
2212
1973
|
// src/viewer/utils/shape-visual-style.ts
|
|
2213
|
-
function
|
|
2214
|
-
|
|
2215
|
-
return void 0;
|
|
2216
|
-
}
|
|
2217
|
-
const isStructuredLinear = (style.fillGradientType || "linear") === "linear" && chunkY2KIB3QH_js.sanitizeGradientStops(style.fillGradientStops).length > 0;
|
|
2218
|
-
if (isStructuredLinear) {
|
|
2219
|
-
const flip = chunkY2KIB3QH_js.getGradientTileFlipCss(style.fillGradientFlip);
|
|
2220
|
-
if (flip) {
|
|
2221
|
-
return flip;
|
|
2222
|
-
}
|
|
2223
|
-
}
|
|
2224
|
-
return chunkY2KIB3QH_js.getGradientTileRectCss(style.fillGradientTileRect);
|
|
1974
|
+
function rendersCustomVectorPath(element) {
|
|
1975
|
+
return (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;
|
|
2225
1976
|
}
|
|
2226
|
-
function getShapeVisualStyle(element,
|
|
2227
|
-
if (!
|
|
1977
|
+
function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _strokeColor, animatesFill, animatesStroke, parentGroupFill) {
|
|
1978
|
+
if (!chunk7JPLVECA_js.hasShapeProperties(element)) {
|
|
2228
1979
|
return {};
|
|
2229
1980
|
}
|
|
2230
|
-
const normalizedShapeType = getShapeType(element.shapeType);
|
|
2231
|
-
const clipPath = chunkY2KIB3QH_js.isIdentityRectClip(element) ? void 0 : chunkY2KIB3QH_js.getResolvedShapeClipPath(element);
|
|
2232
|
-
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;
|
|
2233
|
-
const rendersStrokeOnlyPreset = chunkY2KIB3QH_js.isStrokeOnlyPresetElement(element);
|
|
2234
|
-
const fillOpacity = element.shapeStyle?.fillOpacity;
|
|
2235
|
-
const strokeOpacity = element.shapeStyle?.strokeOpacity;
|
|
2236
|
-
const strokeDash = chunkY2KIB3QH_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2237
|
-
const fillGradient = chunkY2KIB3QH_js.buildCssGradientFromShapeStyle(element.shapeStyle, {
|
|
2238
|
-
rotation: element.rotation,
|
|
2239
|
-
width: element.width,
|
|
2240
|
-
height: element.height
|
|
2241
|
-
}) || element.shapeStyle?.fillGradient;
|
|
2242
|
-
const shadowCss = chunkY2KIB3QH_js.buildShadowCssFromShapeStyle(element.shapeStyle);
|
|
2243
|
-
const innerShadowCss = chunkY2KIB3QH_js.buildInnerShadowCssFromShapeStyle(element.shapeStyle);
|
|
2244
|
-
const resolvedFillColor = chunkY2KIB3QH_js.colorWithOpacity(fillColor, fillOpacity);
|
|
2245
|
-
const resolvedStrokeColor = chunkY2KIB3QH_js.colorWithOpacity(strokeColor, strokeOpacity);
|
|
2246
1981
|
const ss = element.shapeStyle;
|
|
2247
|
-
const
|
|
2248
|
-
const
|
|
2249
|
-
const
|
|
2250
|
-
ss?.dagFillOverlayColor && ss.dagFillOverlayColor !== "transparent"
|
|
2251
|
-
);
|
|
2252
|
-
const combinedShadowParts = [];
|
|
2253
|
-
const multiLayerShadow = chunkY2KIB3QH_js.buildMultiLayerShadowCss(element.shapeStyle);
|
|
2254
|
-
if (multiLayerShadow) {
|
|
2255
|
-
combinedShadowParts.push(multiLayerShadow);
|
|
2256
|
-
} else if (shadowCss) {
|
|
2257
|
-
combinedShadowParts.push(shadowCss);
|
|
2258
|
-
}
|
|
2259
|
-
if (innerShadowCss) {
|
|
2260
|
-
combinedShadowParts.push(innerShadowCss);
|
|
2261
|
-
}
|
|
2262
|
-
const glowBoxShadow = chunkY2KIB3QH_js.buildGlowBoxShadow(ss?.glowColor, ss?.glowRadius, ss?.glowOpacity);
|
|
2263
|
-
if (glowBoxShadow) {
|
|
2264
|
-
combinedShadowParts.push(glowBoxShadow);
|
|
2265
|
-
}
|
|
2266
|
-
const lineShadow = buildLineShadowCss(element);
|
|
2267
|
-
if (lineShadow) {
|
|
2268
|
-
combinedShadowParts.push(lineShadow);
|
|
2269
|
-
}
|
|
2270
|
-
const compoundLineShadow = chunkY2KIB3QH_js.getCompoundLineBoxShadow(
|
|
2271
|
-
element.shapeStyle?.compoundLine,
|
|
2272
|
-
strokeWidth,
|
|
2273
|
-
resolvedStrokeColor
|
|
2274
|
-
);
|
|
2275
|
-
if (compoundLineShadow) {
|
|
2276
|
-
combinedShadowParts.push(compoundLineShadow);
|
|
2277
|
-
}
|
|
2278
|
-
const combinedBoxShadow = combinedShadowParts.length > 0 ? combinedShadowParts.join(", ") : void 0;
|
|
2279
|
-
const filterParts = [];
|
|
2280
|
-
if (ss?.glowColor && ss.glowColor !== "transparent" && ss.glowRadius) {
|
|
2281
|
-
const glowOpacity = typeof ss.glowOpacity === "number" ? ss.glowOpacity : 0.75;
|
|
2282
|
-
const glowRad = Math.round(Math.max(0, ss.glowRadius));
|
|
2283
|
-
const glowCol = chunkY2KIB3QH_js.colorWithOpacity(chunkY2KIB3QH_js.normalizeHexColor(ss.glowColor, "#ffff00"), glowOpacity);
|
|
2284
|
-
filterParts.push(`drop-shadow(0 0 ${glowRad}px ${glowCol})`);
|
|
2285
|
-
}
|
|
2286
|
-
if (typeof ss?.softEdgeRadius === "number" && ss.softEdgeRadius > 0) {
|
|
2287
|
-
filterParts.push(`url(#${chunkY2KIB3QH_js.getSoftEdgeFilterId(element.id)})`);
|
|
2288
|
-
}
|
|
2289
|
-
if (typeof ss?.blurRadius === "number" && ss.blurRadius > 0) {
|
|
2290
|
-
filterParts.push(`blur(${Math.round(ss.blurRadius)}px)`);
|
|
2291
|
-
}
|
|
2292
|
-
const lineGlowCss = buildLineGlowFilter(element);
|
|
2293
|
-
if (lineGlowCss) {
|
|
2294
|
-
filterParts.push(lineGlowCss);
|
|
2295
|
-
}
|
|
2296
|
-
const dagFilter = chunkY2KIB3QH_js.getEffectDagFilter(ss, element.id);
|
|
2297
|
-
if (dagFilter) {
|
|
2298
|
-
filterParts.push(dagFilter);
|
|
2299
|
-
}
|
|
2300
|
-
const lineJoinCss = ss?.lineJoin === "round" ? "round" : ss?.lineJoin === "bevel" ? "bevel" : ss?.lineJoin === "miter" ? "miter" : void 0;
|
|
2301
|
-
const miterLimitCss = ss?.lineJoin === "miter" && typeof ss?.miterLimit === "number" ? Math.max(ss.miterLimit / 1e5, 1) : void 0;
|
|
2302
|
-
const patternFill = chunkY2KIB3QH_js.buildPatternFillCss(element.shapeStyle);
|
|
2303
|
-
const imageFillUrl = ss?.fillMode === "image" && ss.fillImageUrl ? ss.fillImageUrl : void 0;
|
|
2304
|
-
const imageFillMode = ss?.fillImageMode || "stretch";
|
|
2305
|
-
let reflectCss;
|
|
2306
|
-
if (ss) {
|
|
2307
|
-
const hasReflection = typeof ss.reflectionStartOpacity === "number" && ss.reflectionStartOpacity > 0 || typeof ss.reflectionDistance === "number" && ss.reflectionDistance > 0 || typeof ss.reflectionBlurRadius === "number" && ss.reflectionBlurRadius > 0;
|
|
2308
|
-
if (hasReflection) {
|
|
2309
|
-
const distance = ss.reflectionDistance ?? 0;
|
|
2310
|
-
const startOpacity = typeof ss.reflectionStartOpacity === "number" ? ss.reflectionStartOpacity : 0.5;
|
|
2311
|
-
const endOpacity = typeof ss.reflectionEndOpacity === "number" ? ss.reflectionEndOpacity : 0;
|
|
2312
|
-
const fadeLength = typeof ss.reflectionEndPosition === "number" ? Math.round(ss.reflectionEndPosition * Math.max(element.height, 1)) : 100;
|
|
2313
|
-
const blurRadius = typeof ss.reflectionBlurRadius === "number" ? ss.reflectionBlurRadius : 0;
|
|
2314
|
-
reflectCss = chunkY2KIB3QH_js.buildReflectionCss(distance, startOpacity, endOpacity, fadeLength, blurRadius);
|
|
2315
|
-
}
|
|
2316
|
-
}
|
|
1982
|
+
const fill = animatesFill ? void 0 : chunk7JPLVECA_js.getComputedFillStyle(element, parentGroupFill);
|
|
1983
|
+
const fx = chunk7JPLVECA_js.getComputedEffectStyle(element);
|
|
1984
|
+
const stroke = chunk7JPLVECA_js.getComputedStrokeStyle(element);
|
|
2317
1985
|
const base = {
|
|
2318
|
-
// A gradient fill REPLACES the solid fill, it does not sit on top of it
|
|
2319
|
-
//
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
//
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
backgroundSize: imageFillUrl ? imageFillMode === "tile" ? "auto" : "100% 100%" : patternFill ? "auto" : hasFill && fillGradient ? gradientTiling?.backgroundSize ?? "100% 100%" : void 0,
|
|
2330
|
-
// The container always carries a 1px border (transparent unless the shape
|
|
2331
|
-
// has a stroke or is hovered) and `box-sizing: border-box`, so the default
|
|
2332
|
-
// `background-origin: padding-box` sizes the paint 2px smaller than the
|
|
2333
|
-
// shape. Combined with the default `background-repeat: repeat` that made a
|
|
2334
|
-
// gradient tile wrap, painting a 1px sliver of its opposite end along the
|
|
2335
|
-
// edge - a fade-to-transparent overlay grew a hard opaque line down its
|
|
2336
|
-
// side. Paint from the border box so the fill matches the shape outline.
|
|
1986
|
+
// A gradient fill REPLACES the solid fill, it does not sit on top of it;
|
|
1987
|
+
// the whole precedence lives in shared's `getComputedFillStyle`.
|
|
1988
|
+
backgroundColor: fill?.backgroundColor ?? "transparent",
|
|
1989
|
+
backgroundImage: fill?.backgroundImage,
|
|
1990
|
+
backgroundRepeat: fill?.backgroundRepeat,
|
|
1991
|
+
backgroundSize: fill?.backgroundSize,
|
|
1992
|
+
backgroundPosition: fill?.backgroundPosition,
|
|
1993
|
+
// The container always carries `box-sizing: border-box`, so the default
|
|
1994
|
+
// `background-origin: padding-box` would size the paint 2px smaller than
|
|
1995
|
+
// the shape and make a gradient tile wrap, painting a 1px sliver of its
|
|
1996
|
+
// opposite end along the edge. Paint from the border box instead.
|
|
2337
1997
|
backgroundOrigin: "border-box",
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
//
|
|
2344
|
-
//
|
|
2345
|
-
|
|
2346
|
-
//
|
|
2347
|
-
|
|
2348
|
-
//
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
//
|
|
2353
|
-
//
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
// path following the shape's geometry, because a CSS border can only take
|
|
2358
|
-
// one colour. Keeping the border too would draw the parser's averaged
|
|
2359
|
-
// solid underneath the gradient.
|
|
2360
|
-
borderWidth: strokeWidth > 0 && !paintsGradientOutline ? chunkY2KIB3QH_js.getCompoundLineBorderWidth(ss?.compoundLine, strokeWidth) : 0,
|
|
2361
|
-
borderColor: strokeWidth > 0 && !paintsGradientOutline ? resolvedStrokeColor : void 0,
|
|
2362
|
-
borderStyle: strokeWidth > 0 && !paintsGradientOutline ? chunkY2KIB3QH_js.getCssBorderDashStyle(strokeDash, ss?.compoundLine) : void 0,
|
|
2363
|
-
strokeLinejoin: lineJoinCss,
|
|
2364
|
-
strokeMiterlimit: miterLimitCss,
|
|
2365
|
-
strokeLinecap: ss?.lineCap === "rnd" ? "round" : ss?.lineCap === "sq" ? "square" : ss?.lineCap === "flat" ? "butt" : void 0
|
|
1998
|
+
boxShadow: fx.boxShadow,
|
|
1999
|
+
WebkitBoxReflect: fx.webkitBoxReflect,
|
|
2000
|
+
filter: fx.filter,
|
|
2001
|
+
opacity: fx.opacity,
|
|
2002
|
+
// Only proxy the DAG blend onto the whole element for the blend-only case:
|
|
2003
|
+
// with an overlay colour, `ShapeEffectOverlay` paints a separate blended
|
|
2004
|
+
// tint layer (shared decides which, and returns only one of the two).
|
|
2005
|
+
mixBlendMode: fx.mixBlendMode,
|
|
2006
|
+
// An unstroked element must occupy EXACTLY its authored box, so the
|
|
2007
|
+
// selection/hover affordance is an `outline` (see `ElementRenderer`) and
|
|
2008
|
+
// the border collapses to 0 rather than to a transparent 1px.
|
|
2009
|
+
borderWidth: stroke.borderWidth,
|
|
2010
|
+
borderColor: animatesStroke ? void 0 : stroke.borderColor,
|
|
2011
|
+
borderStyle: stroke.borderStyle,
|
|
2012
|
+
// Inherited SVG presentation properties: written on the container so the
|
|
2013
|
+
// freeform `<path>` and the stroke overlay both pick them up.
|
|
2014
|
+
strokeLinejoin: stroke.strokeLinejoin,
|
|
2015
|
+
strokeMiterlimit: stroke.strokeMiterlimit,
|
|
2016
|
+
strokeLinecap: stroke.strokeLinecap
|
|
2366
2017
|
};
|
|
2367
2018
|
apply3dEffects2(base, ss?.scene3d, ss?.shape3d, ss?.fillColor ?? fillColor);
|
|
2368
|
-
if (rendersCustomVectorPath ||
|
|
2019
|
+
if (rendersCustomVectorPath(element) || chunk7JPLVECA_js.isStrokeOnlyPresetElement(element)) {
|
|
2369
2020
|
base.backgroundColor = "transparent";
|
|
2370
2021
|
base.backgroundImage = void 0;
|
|
2371
2022
|
base.borderWidth = void 0;
|
|
@@ -2376,70 +2027,39 @@ function getShapeVisualStyle(element, hasFill, fillColor, strokeWidth, strokeCol
|
|
|
2376
2027
|
base.backgroundColor = void 0;
|
|
2377
2028
|
base.backgroundImage = void 0;
|
|
2378
2029
|
}
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
backgroundColor: "transparent",
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2030
|
+
const geometry = chunk7JPLVECA_js.resolveShapeGeometry(element);
|
|
2031
|
+
switch (geometry.kind) {
|
|
2032
|
+
case "bare":
|
|
2033
|
+
return { backgroundColor: "transparent", borderWidth: 0, borderStyle: "none" };
|
|
2034
|
+
case "strokeOnly":
|
|
2035
|
+
return { ...base, backgroundColor: "transparent", backgroundImage: void 0 };
|
|
2036
|
+
case "borderRadius":
|
|
2037
|
+
return { ...base, borderRadius: geometry.radius };
|
|
2038
|
+
case "clipPath":
|
|
2039
|
+
return { ...base, clipPath: geometry.clipPath };
|
|
2040
|
+
case "lineEdge":
|
|
2041
|
+
return {
|
|
2042
|
+
...base,
|
|
2043
|
+
backgroundColor: "transparent",
|
|
2044
|
+
borderWidth: 0,
|
|
2045
|
+
borderTopWidth: geometry.strokeWidth,
|
|
2046
|
+
borderTopColor: stroke.borderColor,
|
|
2047
|
+
borderTopStyle: stroke.borderStyle ?? "solid"
|
|
2048
|
+
};
|
|
2049
|
+
default:
|
|
2392
2050
|
return base;
|
|
2393
|
-
}
|
|
2394
|
-
return {
|
|
2395
|
-
...base,
|
|
2396
|
-
borderRadius: radiusPx
|
|
2397
|
-
};
|
|
2398
|
-
}
|
|
2399
|
-
if (normalizedShapeType === "ellipse") {
|
|
2400
|
-
return {
|
|
2401
|
-
...base,
|
|
2402
|
-
// `50%`, not a huge px value: CSS clamps over-large radii by scaling
|
|
2403
|
-
// them all down uniformly, so `9999px` on a non-square box collapses to
|
|
2404
|
-
// half the SHORT side on every corner - a pill with flat long edges,
|
|
2405
|
-
// not an ellipse. `50%` resolves per-axis and inscribes correctly.
|
|
2406
|
-
borderRadius: "50%"
|
|
2407
|
-
};
|
|
2408
|
-
}
|
|
2409
|
-
if (clipPath && !rendersStrokeOnlyPreset) {
|
|
2410
|
-
return {
|
|
2411
|
-
...base,
|
|
2412
|
-
clipPath
|
|
2413
|
-
};
|
|
2414
2051
|
}
|
|
2415
|
-
if (normalizedShapeType === "line" && !rendersStrokeOnlyPreset) {
|
|
2416
|
-
return {
|
|
2417
|
-
...base,
|
|
2418
|
-
backgroundColor: "transparent",
|
|
2419
|
-
borderWidth: 0,
|
|
2420
|
-
borderTopWidth: Math.max(strokeWidth, 2),
|
|
2421
|
-
borderTopColor: resolvedStrokeColor,
|
|
2422
|
-
borderTopStyle: chunkY2KIB3QH_js.getCssBorderDashStyle(strokeDash)
|
|
2423
|
-
};
|
|
2424
|
-
}
|
|
2425
|
-
if (normalizedShapeType === "cylinder") {
|
|
2426
|
-
return {
|
|
2427
|
-
...base,
|
|
2428
|
-
borderRadius: "48% / 12%"
|
|
2429
|
-
};
|
|
2430
|
-
}
|
|
2431
|
-
return base;
|
|
2432
2052
|
}
|
|
2433
2053
|
function getConnectorAdjustment(element, key, fallback) {
|
|
2434
2054
|
const direct = element.shapeAdjustments?.[key];
|
|
2435
2055
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
2436
|
-
return
|
|
2056
|
+
return chunk7JPLVECA_js.clampUnitInterval(direct / 1e5);
|
|
2437
2057
|
}
|
|
2438
2058
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
2439
2059
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
2440
|
-
return
|
|
2060
|
+
return chunk7JPLVECA_js.clampUnitInterval(fallbackKey / 1e5);
|
|
2441
2061
|
}
|
|
2442
|
-
return
|
|
2062
|
+
return chunk7JPLVECA_js.clampUnitInterval(fallback);
|
|
2443
2063
|
}
|
|
2444
2064
|
function getConnectorPathGeometry(element) {
|
|
2445
2065
|
const width = Math.max(element.width, 0);
|
|
@@ -2572,7 +2192,7 @@ function toHexByte(value) {
|
|
|
2572
2192
|
return clamped.toString(16).padStart(2, "0");
|
|
2573
2193
|
}
|
|
2574
2194
|
function shiftHex(hex, factor, towardsWhite) {
|
|
2575
|
-
const channels =
|
|
2195
|
+
const channels = chunk7JPLVECA_js.hexToRgbChannels(hex);
|
|
2576
2196
|
if (!channels) {
|
|
2577
2197
|
return hex;
|
|
2578
2198
|
}
|
|
@@ -2598,7 +2218,7 @@ function buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity) {
|
|
|
2598
2218
|
const fillOff = subpath.fillMode === "none" || !hasFill;
|
|
2599
2219
|
return {
|
|
2600
2220
|
d: subpath.d,
|
|
2601
|
-
fill: fillOff ? "none" :
|
|
2221
|
+
fill: fillOff ? "none" : chunk7JPLVECA_js.colorWithOpacity(adjustFillForMode(fillColor, subpath.fillMode), fillOpacity),
|
|
2602
2222
|
stroked: subpath.stroke !== false
|
|
2603
2223
|
};
|
|
2604
2224
|
});
|
|
@@ -2614,11 +2234,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
|
|
|
2614
2234
|
strokePaint,
|
|
2615
2235
|
strokeWidth,
|
|
2616
2236
|
dashArray,
|
|
2617
|
-
lineCap:
|
|
2237
|
+
lineCap: chunk7JPLVECA_js.svgLineCap(shapeStyle?.lineCap),
|
|
2618
2238
|
lineJoin,
|
|
2619
2239
|
miterLimit,
|
|
2620
|
-
offsets:
|
|
2621
|
-
widths:
|
|
2240
|
+
offsets: chunk7JPLVECA_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
2241
|
+
widths: chunk7JPLVECA_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
|
|
2622
2242
|
};
|
|
2623
2243
|
}
|
|
2624
2244
|
function strokeStrands(d, keyBase, ctx) {
|
|
@@ -2666,9 +2286,9 @@ function gradientDefs(gradient) {
|
|
|
2666
2286
|
}
|
|
2667
2287
|
function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredPaths, shapeStyle, hasFill, fillColor, fillOpacity, strokePaint, strokeWidth, dashArray, animatesFill = false, gradient) {
|
|
2668
2288
|
const ctx = strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray);
|
|
2669
|
-
const subpaths = structuredPaths && structuredPaths.length > 0 ?
|
|
2289
|
+
const subpaths = structuredPaths && structuredPaths.length > 0 ? chunk7JPLVECA_js.customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
2670
2290
|
const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
|
|
2671
|
-
const gradientPaint = gradient ?
|
|
2291
|
+
const gradientPaint = gradient ? chunk7JPLVECA_js.svgGradientFillRef(gradient) : void 0;
|
|
2672
2292
|
const nodes = [];
|
|
2673
2293
|
if (subpaths && needsPerSubpath) {
|
|
2674
2294
|
const paints = buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity);
|
|
@@ -2700,7 +2320,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2700
2320
|
"path",
|
|
2701
2321
|
{
|
|
2702
2322
|
d: pathData,
|
|
2703
|
-
fill: animatesFill ? "inherit" : gradientPaint ??
|
|
2323
|
+
fill: animatesFill ? "inherit" : gradientPaint ?? chunk7JPLVECA_js.colorWithOpacity(fillColor, fillOpacity),
|
|
2704
2324
|
stroke: "none",
|
|
2705
2325
|
vectorEffect: "non-scaling-stroke"
|
|
2706
2326
|
},
|
|
@@ -2726,14 +2346,14 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2726
2346
|
);
|
|
2727
2347
|
}
|
|
2728
2348
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2729
|
-
if (!
|
|
2349
|
+
if (!chunk7JPLVECA_js.hasShapeProperties(element)) {
|
|
2730
2350
|
return null;
|
|
2731
2351
|
}
|
|
2732
2352
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
2733
|
-
const fillPaint = animatesFill ? "inherit" :
|
|
2734
|
-
const strokePaint = animatesStroke ? "inherit" :
|
|
2735
|
-
const dashType =
|
|
2736
|
-
const dashArray =
|
|
2353
|
+
const fillPaint = animatesFill ? "inherit" : chunk7JPLVECA_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
2354
|
+
const strokePaint = animatesStroke ? "inherit" : chunk7JPLVECA_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
2355
|
+
const dashType = chunk7JPLVECA_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2356
|
+
const dashArray = chunk7JPLVECA_js.getSvgStrokeDasharray(
|
|
2737
2357
|
dashType,
|
|
2738
2358
|
Math.max(strokeWidth, 1),
|
|
2739
2359
|
element.shapeStyle?.customDashSegments
|
|
@@ -2814,21 +2434,21 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2814
2434
|
// container's `background-image` is suppressed for custom geometry, so
|
|
2815
2435
|
// without this the shape fell back to the parser's representative solid
|
|
2816
2436
|
// and lost every fade (issue #132).
|
|
2817
|
-
|
|
2437
|
+
chunk7JPLVECA_js.buildSvgGradientDef(element.shapeStyle, element.id)
|
|
2818
2438
|
);
|
|
2819
2439
|
}
|
|
2820
|
-
if (
|
|
2440
|
+
if (chunk7JPLVECA_js.isCalloutShape(normalizedType)) {
|
|
2821
2441
|
const width = Math.max(element.width, 1);
|
|
2822
2442
|
const height = Math.max(element.height, 1);
|
|
2823
|
-
const geometry =
|
|
2443
|
+
const geometry = chunk7JPLVECA_js.getCalloutLeaderLineGeometry(
|
|
2824
2444
|
normalizedType,
|
|
2825
2445
|
width,
|
|
2826
2446
|
height,
|
|
2827
2447
|
element.shapeAdjustments
|
|
2828
2448
|
);
|
|
2829
2449
|
if (geometry && geometry.points.length >= 2) {
|
|
2830
|
-
const leaderPath =
|
|
2831
|
-
const bounds =
|
|
2450
|
+
const leaderPath = chunk7JPLVECA_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
2451
|
+
const bounds = chunk7JPLVECA_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
2832
2452
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
2833
2453
|
const offsetLeft = bounds.minX;
|
|
2834
2454
|
const offsetTop = bounds.minY;
|
|
@@ -2891,10 +2511,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2891
2511
|
const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
|
|
2892
2512
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
2893
2513
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
2894
|
-
const connectorLineCap =
|
|
2514
|
+
const connectorLineCap = chunk7JPLVECA_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
2895
2515
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
2896
|
-
const offsets =
|
|
2897
|
-
const widths =
|
|
2516
|
+
const offsets = chunk7JPLVECA_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
2517
|
+
const widths = chunk7JPLVECA_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
2898
2518
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2899
2519
|
"svg",
|
|
2900
2520
|
{
|
|
@@ -2961,15 +2581,15 @@ function parseGradientFillCss(gradFill) {
|
|
|
2961
2581
|
}
|
|
2962
2582
|
const parsed = stops.map((gs) => {
|
|
2963
2583
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
2964
|
-
const color =
|
|
2965
|
-
const opacity =
|
|
2966
|
-
return { pos, color:
|
|
2584
|
+
const color = chunk7JPLVECA_js.parseDrawingColor(gs) ?? "#888888";
|
|
2585
|
+
const opacity = chunk7JPLVECA_js.parseDrawingColorOpacity(gs);
|
|
2586
|
+
return { pos, color: chunk7JPLVECA_js.colorWithOpacity(color, opacity) };
|
|
2967
2587
|
}).sort((a, b) => a.pos - b.pos);
|
|
2968
2588
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
2969
2589
|
const lin = gradFill["a:lin"];
|
|
2970
2590
|
if (lin) {
|
|
2971
2591
|
const angRaw = Number.parseInt(String(lin["@_ang"] || "0"), 10);
|
|
2972
|
-
const angleDeg = Math.round(
|
|
2592
|
+
const angleDeg = Math.round(chunk7JPLVECA_js.ooxmlGradientAngleToCssDegrees(angRaw / 6e4));
|
|
2973
2593
|
return `linear-gradient(${angleDeg}deg, ${stopStrings})`;
|
|
2974
2594
|
}
|
|
2975
2595
|
const path = gradFill["a:path"];
|
|
@@ -3004,8 +2624,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
3004
2624
|
if (!pattFill) {
|
|
3005
2625
|
return void 0;
|
|
3006
2626
|
}
|
|
3007
|
-
const fgColor =
|
|
3008
|
-
const bgColor =
|
|
2627
|
+
const fgColor = chunk7JPLVECA_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
2628
|
+
const bgColor = chunk7JPLVECA_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
3009
2629
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
3010
2630
|
switch (preset) {
|
|
3011
2631
|
case "ltHorz":
|
|
@@ -3116,11 +2736,11 @@ function parseCellBorders(cellProperties) {
|
|
|
3116
2736
|
const prstDash = ln["a:prstDash"];
|
|
3117
2737
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
3118
2738
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
3119
|
-
const color =
|
|
2739
|
+
const color = chunk7JPLVECA_js.parseDrawingColor(ln["a:solidFill"]);
|
|
3120
2740
|
if (color) {
|
|
3121
|
-
const opacity =
|
|
2741
|
+
const opacity = chunk7JPLVECA_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
3122
2742
|
const key = `${edge.prefix}`;
|
|
3123
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
2743
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunk7JPLVECA_js.colorWithOpacity(color, opacity)}`;
|
|
3124
2744
|
}
|
|
3125
2745
|
}
|
|
3126
2746
|
return borderStyle;
|
|
@@ -3133,7 +2753,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3133
2753
|
const textShadowParts = [];
|
|
3134
2754
|
const outerShdw = effectLst["a:outerShdw"];
|
|
3135
2755
|
if (outerShdw) {
|
|
3136
|
-
const shdwColor =
|
|
2756
|
+
const shdwColor = chunk7JPLVECA_js.parseDrawingColor(outerShdw);
|
|
3137
2757
|
if (shdwColor) {
|
|
3138
2758
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
3139
2759
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -3151,7 +2771,7 @@ function parseCellTextEffects(runProps) {
|
|
|
3151
2771
|
}
|
|
3152
2772
|
const glow = effectLst["a:glow"];
|
|
3153
2773
|
if (glow) {
|
|
3154
|
-
const glowColor =
|
|
2774
|
+
const glowColor = chunk7JPLVECA_js.parseDrawingColor(glow);
|
|
3155
2775
|
if (glowColor) {
|
|
3156
2776
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
3157
2777
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -3230,10 +2850,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3230
2850
|
if (runProps?.["@_u"] !== void 0) {
|
|
3231
2851
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
3232
2852
|
}
|
|
3233
|
-
const runColor =
|
|
2853
|
+
const runColor = chunk7JPLVECA_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunk7JPLVECA_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
3234
2854
|
if (runColor) {
|
|
3235
|
-
const opacity =
|
|
3236
|
-
cellStyle.color =
|
|
2855
|
+
const opacity = chunk7JPLVECA_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
2856
|
+
cellStyle.color = chunk7JPLVECA_js.colorWithOpacity(runColor, opacity);
|
|
3237
2857
|
}
|
|
3238
2858
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
3239
2859
|
if (fontFamily) {
|
|
@@ -3243,15 +2863,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3243
2863
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
3244
2864
|
}
|
|
3245
2865
|
const cellProperties = cellXml["a:tcPr"];
|
|
3246
|
-
const cellFill =
|
|
2866
|
+
const cellFill = chunk7JPLVECA_js.parseDrawingColor(
|
|
3247
2867
|
cellProperties?.["a:solidFill"],
|
|
3248
2868
|
schemeColorOverrides
|
|
3249
2869
|
);
|
|
3250
2870
|
if (cellFill) {
|
|
3251
|
-
const opacity =
|
|
2871
|
+
const opacity = chunk7JPLVECA_js.parseDrawingColorOpacity(
|
|
3252
2872
|
cellProperties?.["a:solidFill"]
|
|
3253
2873
|
);
|
|
3254
|
-
cellStyle.backgroundColor =
|
|
2874
|
+
cellStyle.backgroundColor = chunk7JPLVECA_js.colorWithOpacity(cellFill, opacity);
|
|
3255
2875
|
} else {
|
|
3256
2876
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
3257
2877
|
if (gradCss) {
|
|
@@ -3266,16 +2886,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
3266
2886
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
3267
2887
|
Object.assign(cellStyle, edgeBorders);
|
|
3268
2888
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
3269
|
-
const borderColor =
|
|
2889
|
+
const borderColor = chunk7JPLVECA_js.parseDrawingColor(
|
|
3270
2890
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
3271
2891
|
schemeColorOverrides
|
|
3272
|
-
) ||
|
|
2892
|
+
) || chunk7JPLVECA_js.parseDrawingColor(
|
|
3273
2893
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
3274
2894
|
schemeColorOverrides
|
|
3275
|
-
) ||
|
|
2895
|
+
) || chunk7JPLVECA_js.parseDrawingColor(
|
|
3276
2896
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
3277
2897
|
schemeColorOverrides
|
|
3278
|
-
) ||
|
|
2898
|
+
) || chunk7JPLVECA_js.parseDrawingColor(
|
|
3279
2899
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
3280
2900
|
schemeColorOverrides
|
|
3281
2901
|
);
|
|
@@ -3347,7 +2967,7 @@ function getTableCellBandStyle2(element, rowIndex, cellIndex, rowCount, columnCo
|
|
|
3347
2967
|
if (element.type !== "table") {
|
|
3348
2968
|
return void 0;
|
|
3349
2969
|
}
|
|
3350
|
-
return
|
|
2970
|
+
return chunk7JPLVECA_js.getTableCellBandStyle(element.tableData, rowIndex, cellIndex, rowCount, columnCount, {
|
|
3351
2971
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
3352
2972
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
3353
2973
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -3408,8 +3028,30 @@ function parseTableElementData(element, fallbackTextStyle) {
|
|
|
3408
3028
|
cells
|
|
3409
3029
|
};
|
|
3410
3030
|
}
|
|
3031
|
+
function renderTableCellContent(cell, fallbackText) {
|
|
3032
|
+
const runs = cell?.textRuns;
|
|
3033
|
+
if (!runs || runs.length === 0) {
|
|
3034
|
+
return fallbackText || "\xA0";
|
|
3035
|
+
}
|
|
3036
|
+
return runs.map((run, index) => {
|
|
3037
|
+
if (run.isParagraphBreak) {
|
|
3038
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "block", height: 0 } }, `p-${index}`);
|
|
3039
|
+
}
|
|
3040
|
+
if (run.isLineBreak) {
|
|
3041
|
+
return /* @__PURE__ */ jsxRuntime.jsx("br", {}, `br-${index}`);
|
|
3042
|
+
}
|
|
3043
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3044
|
+
"span",
|
|
3045
|
+
{
|
|
3046
|
+
style: { position: "relative", ...chunk7JPLVECA_js.cellRunStyle(run) },
|
|
3047
|
+
children: run.text
|
|
3048
|
+
},
|
|
3049
|
+
`r-${index}`
|
|
3050
|
+
);
|
|
3051
|
+
});
|
|
3052
|
+
}
|
|
3411
3053
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
3412
|
-
return
|
|
3054
|
+
return chunk7JPLVECA_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
3413
3055
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
3414
3056
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
3415
3057
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -3542,7 +3184,7 @@ function TableResizeOverlay({
|
|
|
3542
3184
|
const containerRef = React6.useRef(null);
|
|
3543
3185
|
const [rowBounds, setRowBounds] = React6.useState([]);
|
|
3544
3186
|
const dragRef = React6.useRef(null);
|
|
3545
|
-
const colBoundaries = React6.useMemo(() =>
|
|
3187
|
+
const colBoundaries = React6.useMemo(() => chunk7JPLVECA_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
3546
3188
|
const measureRows = React6.useCallback(() => {
|
|
3547
3189
|
const container = containerRef.current;
|
|
3548
3190
|
if (!container) {
|
|
@@ -3589,11 +3231,11 @@ function TableResizeOverlay({
|
|
|
3589
3231
|
const rect = containerRef.current.getBoundingClientRect();
|
|
3590
3232
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
3591
3233
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
3592
|
-
onResizeColumns(
|
|
3234
|
+
onResizeColumns(chunk7JPLVECA_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
3593
3235
|
} else if (drag.type === "row" && onResizeRow) {
|
|
3594
3236
|
const deltaY = e.clientY - drag.startPos;
|
|
3595
|
-
const newHeight =
|
|
3596
|
-
drag.initialRowHeight ??
|
|
3237
|
+
const newHeight = chunk7JPLVECA_js.computeResizedRowHeight(
|
|
3238
|
+
drag.initialRowHeight ?? chunk7JPLVECA_js.DEFAULT_ROW_HEIGHT,
|
|
3597
3239
|
deltaY
|
|
3598
3240
|
);
|
|
3599
3241
|
onResizeRow(drag.index, newHeight);
|
|
@@ -3631,7 +3273,7 @@ function TableResizeOverlay({
|
|
|
3631
3273
|
e.stopPropagation();
|
|
3632
3274
|
const table = containerRef.current?.querySelector("table");
|
|
3633
3275
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
3634
|
-
const actualHeight = tr?.offsetHeight ??
|
|
3276
|
+
const actualHeight = tr?.offsetHeight ?? chunk7JPLVECA_js.DEFAULT_ROW_HEIGHT;
|
|
3635
3277
|
document.body.style.cursor = "row-resize";
|
|
3636
3278
|
document.body.style.userSelect = "none";
|
|
3637
3279
|
dragRef.current = {
|
|
@@ -3679,7 +3321,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3679
3321
|
}
|
|
3680
3322
|
const first = selectedCell.selectedCells[0];
|
|
3681
3323
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
3682
|
-
return
|
|
3324
|
+
return chunk7JPLVECA_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
3683
3325
|
})();
|
|
3684
3326
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3685
3327
|
TableResizeOverlay,
|
|
@@ -3699,7 +3341,11 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3699
3341
|
"table",
|
|
3700
3342
|
{
|
|
3701
3343
|
className: "w-full h-full border-collapse table-fixed",
|
|
3702
|
-
style: {
|
|
3344
|
+
style: {
|
|
3345
|
+
fontFamily: chunk7JPLVECA_js.DEFAULT_FONT_FAMILY,
|
|
3346
|
+
// `a:tblPr@rtl` mirrors the column order for RTL decks.
|
|
3347
|
+
...chunk7JPLVECA_js.tableContainerCss(tableData)
|
|
3348
|
+
},
|
|
3703
3349
|
children: [
|
|
3704
3350
|
tableData.columnWidths.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: tableData.columnWidths.map((w, ci) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3705
3351
|
"col",
|
|
@@ -3717,7 +3363,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3717
3363
|
return null;
|
|
3718
3364
|
}
|
|
3719
3365
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
3720
|
-
const isInMultiSelection =
|
|
3366
|
+
const isInMultiSelection = chunk7JPLVECA_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
3721
3367
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
3722
3368
|
const diag = getCellDiagonalBorders2(
|
|
3723
3369
|
cell.style,
|
|
@@ -3738,7 +3384,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3738
3384
|
rowSpan: cell.rowSpan && cell.rowSpan > 1 ? cell.rowSpan : void 0,
|
|
3739
3385
|
style: {
|
|
3740
3386
|
...textStyle,
|
|
3741
|
-
...
|
|
3387
|
+
...chunk7JPLVECA_js.cellStyleToCss(cell.style),
|
|
3742
3388
|
...diag ? { position: "relative" } : void 0
|
|
3743
3389
|
},
|
|
3744
3390
|
onClick: (event) => {
|
|
@@ -3747,7 +3393,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3747
3393
|
}
|
|
3748
3394
|
event.stopPropagation();
|
|
3749
3395
|
if (event.shiftKey && selectedCell) {
|
|
3750
|
-
const rect =
|
|
3396
|
+
const rect = chunk7JPLVECA_js.computeSelectionRect(
|
|
3751
3397
|
selectedCell.rowIndex,
|
|
3752
3398
|
selectedCell.columnIndex,
|
|
3753
3399
|
rowIndex,
|
|
@@ -3757,7 +3403,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3757
3403
|
options?.onSelectCell?.({
|
|
3758
3404
|
rowIndex: selectedCell.rowIndex,
|
|
3759
3405
|
columnIndex: selectedCell.columnIndex,
|
|
3760
|
-
selectedCells:
|
|
3406
|
+
selectedCells: chunk7JPLVECA_js.rectToCells(rect)
|
|
3761
3407
|
});
|
|
3762
3408
|
} else {
|
|
3763
3409
|
options?.onSelectCell?.({
|
|
@@ -3785,7 +3431,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3785
3431
|
initialText: cell.text ?? "",
|
|
3786
3432
|
style: {
|
|
3787
3433
|
...textStyle,
|
|
3788
|
-
...
|
|
3434
|
+
...chunk7JPLVECA_js.cellStyleToCss(cell.style)
|
|
3789
3435
|
},
|
|
3790
3436
|
onCommit: (text) => {
|
|
3791
3437
|
options?.onCommitCellEdit?.(rowIndex, cellIndex, text);
|
|
@@ -3797,7 +3443,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3797
3443
|
});
|
|
3798
3444
|
}
|
|
3799
3445
|
}
|
|
3800
|
-
) : cell.text || "\xA0"
|
|
3446
|
+
) : renderTableCellContent(cell, cell.text || "\xA0")
|
|
3801
3447
|
]
|
|
3802
3448
|
},
|
|
3803
3449
|
`${element.id}-cell-${rowIndex}-${cellIndex}`
|
|
@@ -3821,7 +3467,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3821
3467
|
if (tableEl2.tableData && tableEl2.tableData.rows.length > 0) {
|
|
3822
3468
|
return renderTableFromTableData(tableEl2, textStyle, options);
|
|
3823
3469
|
}
|
|
3824
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
3470
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkAONFHTTJ_js.translationsEn["pptx.table.title"] });
|
|
3825
3471
|
}
|
|
3826
3472
|
const selectedCell = options?.selectedCell || null;
|
|
3827
3473
|
const isEditable = Boolean(options?.editable);
|
|
@@ -3836,7 +3482,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3836
3482
|
}
|
|
3837
3483
|
const first = selectedCell.selectedCells[0];
|
|
3838
3484
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
3839
|
-
return
|
|
3485
|
+
return chunk7JPLVECA_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
3840
3486
|
})();
|
|
3841
3487
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
3842
3488
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3857,7 +3503,11 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3857
3503
|
"table",
|
|
3858
3504
|
{
|
|
3859
3505
|
className: "w-full h-full border-collapse table-fixed",
|
|
3860
|
-
style: {
|
|
3506
|
+
style: {
|
|
3507
|
+
fontFamily: chunk7JPLVECA_js.DEFAULT_FONT_FAMILY,
|
|
3508
|
+
// `a:tblPr@rtl` mirrors the column order for RTL decks.
|
|
3509
|
+
...chunk7JPLVECA_js.tableContainerCss(tableEl.tableData)
|
|
3510
|
+
},
|
|
3861
3511
|
children: [
|
|
3862
3512
|
parsedTable.columnPercentages.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: parsedTable.columnPercentages.map((percentage, columnIndex) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3863
3513
|
"col",
|
|
@@ -3908,7 +3558,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3908
3558
|
const mergedStyle = {
|
|
3909
3559
|
...bandStyle,
|
|
3910
3560
|
...xmlCellStyle,
|
|
3911
|
-
...tdCellOverride ?
|
|
3561
|
+
...tdCellOverride ? chunk7JPLVECA_js.cellStyleToCss(tdCellOverride) : void 0,
|
|
3912
3562
|
...diag ? { position: "relative" } : void 0
|
|
3913
3563
|
};
|
|
3914
3564
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3918,7 +3568,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3918
3568
|
"border px-1 py-0.5 align-top",
|
|
3919
3569
|
isEditable && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
3920
3570
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
3921
|
-
|
|
3571
|
+
chunk7JPLVECA_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
3922
3572
|
),
|
|
3923
3573
|
colSpan,
|
|
3924
3574
|
rowSpan: rSpan,
|
|
@@ -3929,7 +3579,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3929
3579
|
}
|
|
3930
3580
|
event.stopPropagation();
|
|
3931
3581
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
3932
|
-
const rect =
|
|
3582
|
+
const rect = chunk7JPLVECA_js.computeSelectionRect(
|
|
3933
3583
|
selectedCell.rowIndex,
|
|
3934
3584
|
selectedCell.columnIndex,
|
|
3935
3585
|
rowIndex,
|
|
@@ -3939,7 +3589,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3939
3589
|
options?.onSelectCell?.({
|
|
3940
3590
|
rowIndex: selectedCell.rowIndex,
|
|
3941
3591
|
columnIndex: selectedCell.columnIndex,
|
|
3942
|
-
selectedCells:
|
|
3592
|
+
selectedCells: chunk7JPLVECA_js.rectToCells(rect)
|
|
3943
3593
|
});
|
|
3944
3594
|
} else {
|
|
3945
3595
|
options?.onSelectCell?.({
|
|
@@ -3976,7 +3626,10 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3976
3626
|
});
|
|
3977
3627
|
}
|
|
3978
3628
|
}
|
|
3979
|
-
) :
|
|
3629
|
+
) : renderTableCellContent(
|
|
3630
|
+
tableEl.tableData?.rows[rowIndex]?.cells[cellIndex],
|
|
3631
|
+
extractCellText(cell) || "\xA0"
|
|
3632
|
+
)
|
|
3980
3633
|
]
|
|
3981
3634
|
},
|
|
3982
3635
|
`${element.id}-cell-${rowIndex}-${cellIndex}`
|
|
@@ -3996,24 +3649,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3996
3649
|
}
|
|
3997
3650
|
var LEGEND_ITEM_WIDTH = 80;
|
|
3998
3651
|
function partAttrs(part) {
|
|
3999
|
-
return part ?
|
|
3652
|
+
return part ? chunk7JPLVECA_js.chartPartToAttrs(part) : void 0;
|
|
4000
3653
|
}
|
|
4001
3654
|
function resolveReactPalette(chartData) {
|
|
4002
3655
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
4003
3656
|
return chartData.colorPalette;
|
|
4004
3657
|
}
|
|
4005
|
-
return [...
|
|
3658
|
+
return [...chunk7JPLVECA_js.getChartStylePalette(chartData.style?.styleId)];
|
|
4006
3659
|
}
|
|
4007
3660
|
function buildReactChartViewModel(element) {
|
|
4008
3661
|
if (element.type !== "chart" || !element.chartData) {
|
|
4009
|
-
return
|
|
3662
|
+
return chunk7JPLVECA_js.buildChartViewModel(element);
|
|
4010
3663
|
}
|
|
4011
3664
|
const palette = resolveReactPalette(element.chartData);
|
|
4012
3665
|
const themedElement = {
|
|
4013
3666
|
...element,
|
|
4014
3667
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
4015
3668
|
};
|
|
4016
|
-
return
|
|
3669
|
+
return chunk7JPLVECA_js.buildChartViewModel(themedElement);
|
|
4017
3670
|
}
|
|
4018
3671
|
function renderPrimitive(prim, key) {
|
|
4019
3672
|
switch (prim.kind) {
|
|
@@ -4402,7 +4055,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4402
4055
|
const unmatchedRows = [];
|
|
4403
4056
|
categories.forEach((cat, i) => {
|
|
4404
4057
|
const value = values[i] ?? 0;
|
|
4405
|
-
const code =
|
|
4058
|
+
const code = chunk7JPLVECA_js.resolveRegionCode(cat);
|
|
4406
4059
|
if (code) {
|
|
4407
4060
|
regionValueMap.set(code, { value, label: cat });
|
|
4408
4061
|
} else {
|
|
@@ -4440,8 +4093,8 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4440
4093
|
let fill = "#e2e8f0";
|
|
4441
4094
|
let dataLabel = null;
|
|
4442
4095
|
if (entry) {
|
|
4443
|
-
const t =
|
|
4444
|
-
fill =
|
|
4096
|
+
const t = chunk7JPLVECA_js.normalizeValue(entry.value, minVal, maxVal);
|
|
4097
|
+
fill = chunk7JPLVECA_js.sequentialColorScale(t);
|
|
4445
4098
|
dataLabel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
4446
4099
|
"text",
|
|
4447
4100
|
{
|
|
@@ -4452,7 +4105,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4452
4105
|
fontWeight: 600,
|
|
4453
4106
|
fill: "#1e293b",
|
|
4454
4107
|
style: { pointerEvents: "none" },
|
|
4455
|
-
children:
|
|
4108
|
+
children: chunk7JPLVECA_js.formatAxisValue(entry.value)
|
|
4456
4109
|
},
|
|
4457
4110
|
`${element.id}-map-dl-${region.code}`
|
|
4458
4111
|
);
|
|
@@ -4470,7 +4123,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4470
4123
|
opacity: 0.9,
|
|
4471
4124
|
children: /* @__PURE__ */ jsxRuntime.jsxs("title", { children: [
|
|
4472
4125
|
region.name,
|
|
4473
|
-
entry ? `: ${
|
|
4126
|
+
entry ? `: ${chunk7JPLVECA_js.formatAxisValue(entry.value)}` : ""
|
|
4474
4127
|
] })
|
|
4475
4128
|
}
|
|
4476
4129
|
),
|
|
@@ -4508,7 +4161,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4508
4161
|
fontSize: 7,
|
|
4509
4162
|
fill: "#64748b",
|
|
4510
4163
|
textAnchor: "middle",
|
|
4511
|
-
children:
|
|
4164
|
+
children: chunk7JPLVECA_js.formatAxisValue(minVal)
|
|
4512
4165
|
},
|
|
4513
4166
|
`${element.id}-map-legend-min`
|
|
4514
4167
|
),
|
|
@@ -4520,7 +4173,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4520
4173
|
fontSize: 7,
|
|
4521
4174
|
fill: "#64748b",
|
|
4522
4175
|
textAnchor: "middle",
|
|
4523
|
-
children:
|
|
4176
|
+
children: chunk7JPLVECA_js.formatAxisValue(maxVal)
|
|
4524
4177
|
},
|
|
4525
4178
|
`${element.id}-map-legend-max`
|
|
4526
4179
|
)
|
|
@@ -4539,7 +4192,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4539
4192
|
textAnchor: "middle",
|
|
4540
4193
|
fontSize: 7,
|
|
4541
4194
|
fill: "#94a3b8",
|
|
4542
|
-
children:
|
|
4195
|
+
children: chunkAONFHTTJ_js.translationsEn["pptx.chart.additionalRegionsFallback"]
|
|
4543
4196
|
},
|
|
4544
4197
|
`${element.id}-map-ft-hdr`
|
|
4545
4198
|
)
|
|
@@ -4586,7 +4239,7 @@ function renderMapChart(element, chartData, categoryLabels) {
|
|
|
4586
4239
|
y,
|
|
4587
4240
|
fontSize,
|
|
4588
4241
|
fill: "#475569",
|
|
4589
|
-
children:
|
|
4242
|
+
children: chunk7JPLVECA_js.formatAxisValue(row.value)
|
|
4590
4243
|
},
|
|
4591
4244
|
`${element.id}-map-ft-val-${i}`
|
|
4592
4245
|
)
|
|
@@ -4657,7 +4310,7 @@ function renderStackedBarChart(element, _chartData, _categoryLabels) {
|
|
|
4657
4310
|
|
|
4658
4311
|
// src/viewer/utils/chart-overlay-utils.ts
|
|
4659
4312
|
function sColor(series, idx) {
|
|
4660
|
-
return
|
|
4313
|
+
return chunk7JPLVECA_js.seriesColor(series, idx);
|
|
4661
4314
|
}
|
|
4662
4315
|
function valToY(val, range, topY, bottomY) {
|
|
4663
4316
|
const usable = bottomY - topY;
|
|
@@ -5196,7 +4849,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5196
4849
|
width: 10,
|
|
5197
4850
|
height: 10,
|
|
5198
4851
|
rx: 2,
|
|
5199
|
-
fill:
|
|
4852
|
+
fill: chunk7JPLVECA_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5200
4853
|
},
|
|
5201
4854
|
`${id}-leg-r-${i}`
|
|
5202
4855
|
)
|
|
@@ -5220,7 +4873,7 @@ function renderLegend(id, style, series, layout, colorPalette) {
|
|
|
5220
4873
|
width: 10,
|
|
5221
4874
|
height: 10,
|
|
5222
4875
|
rx: 2,
|
|
5223
|
-
fill:
|
|
4876
|
+
fill: chunk7JPLVECA_js.seriesColor(s, i, style?.styleId, colorPalette)
|
|
5224
4877
|
}
|
|
5225
4878
|
),
|
|
5226
4879
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: cy + 8, fontSize: 9, fill: "#475569", children: s.name || `Series ${i + 1}` })
|
|
@@ -5233,9 +4886,9 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5233
4886
|
}
|
|
5234
4887
|
const lines = [];
|
|
5235
4888
|
if (range.logScale && range.logBase) {
|
|
5236
|
-
const ticks =
|
|
4889
|
+
const ticks = chunk7JPLVECA_js.generateLogTicks(range);
|
|
5237
4890
|
ticks.forEach((tickVal, i) => {
|
|
5238
|
-
const y =
|
|
4891
|
+
const y = chunk7JPLVECA_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5239
4892
|
lines.push(
|
|
5240
4893
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5241
4894
|
"line",
|
|
@@ -5256,7 +4909,7 @@ function renderGridlines(id, style, range, layout) {
|
|
|
5256
4909
|
const steps = 4;
|
|
5257
4910
|
for (let i = 0; i <= steps; i++) {
|
|
5258
4911
|
const val = range.min + range.span * i / steps;
|
|
5259
|
-
const y =
|
|
4912
|
+
const y = chunk7JPLVECA_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5260
4913
|
lines.push(
|
|
5261
4914
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5262
4915
|
"line",
|
|
@@ -5280,9 +4933,9 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5280
4933
|
const labels = [];
|
|
5281
4934
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5282
4935
|
if (range.logScale && range.logBase) {
|
|
5283
|
-
const ticks =
|
|
4936
|
+
const ticks = chunk7JPLVECA_js.generateLogTicks(range);
|
|
5284
4937
|
ticks.forEach((tickVal, i) => {
|
|
5285
|
-
const y =
|
|
4938
|
+
const y = chunk7JPLVECA_js.valueToY(tickVal, range, layout.plotTop, layout.plotBottom);
|
|
5286
4939
|
labels.push(
|
|
5287
4940
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5288
4941
|
"text",
|
|
@@ -5292,7 +4945,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5292
4945
|
textAnchor: "end",
|
|
5293
4946
|
fontSize: 8,
|
|
5294
4947
|
fill: "#64748b",
|
|
5295
|
-
children: hasDisplayUnits ?
|
|
4948
|
+
children: hasDisplayUnits ? chunk7JPLVECA_js.formatAxisValueWithUnits(tickVal, axisFormatting) : chunk7JPLVECA_js.formatAxisValue(tickVal)
|
|
5296
4949
|
},
|
|
5297
4950
|
`${id}-vaxis-log-${i}`
|
|
5298
4951
|
)
|
|
@@ -5302,7 +4955,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5302
4955
|
const steps = 4;
|
|
5303
4956
|
for (let i = 0; i <= steps; i++) {
|
|
5304
4957
|
const val = range.min + range.span * i / steps;
|
|
5305
|
-
const y =
|
|
4958
|
+
const y = chunk7JPLVECA_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5306
4959
|
labels.push(
|
|
5307
4960
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5308
4961
|
"text",
|
|
@@ -5312,7 +4965,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5312
4965
|
textAnchor: "end",
|
|
5313
4966
|
fontSize: 8,
|
|
5314
4967
|
fill: "#64748b",
|
|
5315
|
-
children: hasDisplayUnits ?
|
|
4968
|
+
children: hasDisplayUnits ? chunk7JPLVECA_js.formatAxisValueWithUnits(val, axisFormatting) : chunk7JPLVECA_js.formatAxisValue(val)
|
|
5316
4969
|
},
|
|
5317
4970
|
`${id}-vaxis-${i}`
|
|
5318
4971
|
)
|
|
@@ -5320,7 +4973,7 @@ function renderValueAxis(id, range, layout, axisFormatting) {
|
|
|
5320
4973
|
}
|
|
5321
4974
|
}
|
|
5322
4975
|
if (hasDisplayUnits) {
|
|
5323
|
-
const unitLabel =
|
|
4976
|
+
const unitLabel = chunk7JPLVECA_js.getDisplayUnitLabel(
|
|
5324
4977
|
axisFormatting.displayUnits,
|
|
5325
4978
|
axisFormatting.displayUnitsLabel
|
|
5326
4979
|
);
|
|
@@ -5395,7 +5048,7 @@ function renderZeroLine(id, range, layout) {
|
|
|
5395
5048
|
if (range.min >= 0) {
|
|
5396
5049
|
return null;
|
|
5397
5050
|
}
|
|
5398
|
-
const y =
|
|
5051
|
+
const y = chunk7JPLVECA_js.valueToY(0, range, layout.plotTop, layout.plotBottom);
|
|
5399
5052
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5400
5053
|
"line",
|
|
5401
5054
|
{
|
|
@@ -5419,7 +5072,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5419
5072
|
const hasDisplayUnits = Boolean(axisFormatting?.displayUnits);
|
|
5420
5073
|
for (let i = 0; i <= steps; i++) {
|
|
5421
5074
|
const val = range.min + range.span * i / steps;
|
|
5422
|
-
const y =
|
|
5075
|
+
const y = chunk7JPLVECA_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5423
5076
|
labels.push(
|
|
5424
5077
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5425
5078
|
"text",
|
|
@@ -5431,7 +5084,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5431
5084
|
fontFamily,
|
|
5432
5085
|
fontWeight,
|
|
5433
5086
|
fill: fontColor,
|
|
5434
|
-
children: hasDisplayUnits ?
|
|
5087
|
+
children: hasDisplayUnits ? chunk7JPLVECA_js.formatAxisValueWithUnits(val, axisFormatting) : chunk7JPLVECA_js.formatAxisValue(val)
|
|
5435
5088
|
},
|
|
5436
5089
|
`${id}-sec-vaxis-${i}`
|
|
5437
5090
|
)
|
|
@@ -5455,7 +5108,7 @@ function renderSecondaryValueAxis(id, range, layout, axisFormatting) {
|
|
|
5455
5108
|
);
|
|
5456
5109
|
}
|
|
5457
5110
|
if (hasDisplayUnits) {
|
|
5458
|
-
const unitLabel =
|
|
5111
|
+
const unitLabel = chunk7JPLVECA_js.getDisplayUnitLabel(
|
|
5459
5112
|
axisFormatting.displayUnits,
|
|
5460
5113
|
axisFormatting.displayUnitsLabel
|
|
5461
5114
|
);
|
|
@@ -5486,7 +5139,7 @@ function renderSecondaryAxisTicks(id, range, layout) {
|
|
|
5486
5139
|
const ticks = [];
|
|
5487
5140
|
for (let i = 0; i <= steps; i++) {
|
|
5488
5141
|
const val = range.min + range.span * i / steps;
|
|
5489
|
-
const y =
|
|
5142
|
+
const y = chunk7JPLVECA_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5490
5143
|
ticks.push(
|
|
5491
5144
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5492
5145
|
"line",
|
|
@@ -5513,7 +5166,7 @@ function renderSecondaryGridlines(id, range, layout, axisFormatting) {
|
|
|
5513
5166
|
const gridColor = axisFormatting.majorGridlinesSpPr?.strokeColor ?? "#e2e8f0";
|
|
5514
5167
|
for (let i = 0; i <= steps; i++) {
|
|
5515
5168
|
const val = range.min + range.span * i / steps;
|
|
5516
|
-
const y =
|
|
5169
|
+
const y = chunk7JPLVECA_js.valueToY(val, range, layout.plotTop, layout.plotBottom);
|
|
5517
5170
|
lines.push(
|
|
5518
5171
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5519
5172
|
"line",
|
|
@@ -5631,7 +5284,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
5631
5284
|
showK && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5632
5285
|
"th",
|
|
5633
5286
|
{
|
|
5634
|
-
"aria-label":
|
|
5287
|
+
"aria-label": chunkAONFHTTJ_js.translationsEn["pptx.chart.rowLabelsAria"],
|
|
5635
5288
|
style: {
|
|
5636
5289
|
padding: "1px 4px",
|
|
5637
5290
|
fontWeight: 400,
|
|
@@ -5675,7 +5328,7 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
5675
5328
|
width: 8,
|
|
5676
5329
|
height: 8,
|
|
5677
5330
|
borderRadius: 2,
|
|
5678
|
-
backgroundColor:
|
|
5331
|
+
backgroundColor: chunk7JPLVECA_js.seriesColor(
|
|
5679
5332
|
s,
|
|
5680
5333
|
si,
|
|
5681
5334
|
chartData.style?.styleId,
|
|
@@ -5713,10 +5366,10 @@ function renderChartDataTable(elementId, chartData, svgWidth) {
|
|
|
5713
5366
|
}
|
|
5714
5367
|
function renderStockChart(element, chartData, categoryLabels) {
|
|
5715
5368
|
const style = chartData.style;
|
|
5716
|
-
const areaFill =
|
|
5369
|
+
const areaFill = chunk7JPLVECA_js.chartAreaFill(chartData);
|
|
5717
5370
|
const legendPos = style?.legendPosition || "b";
|
|
5718
|
-
const range =
|
|
5719
|
-
const layout =
|
|
5371
|
+
const range = chunk7JPLVECA_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
5372
|
+
const layout = chunk7JPLVECA_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
5720
5373
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
5721
5374
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
5722
5375
|
const candleWidth = barGroupWidth * 0.5;
|
|
@@ -5737,10 +5390,10 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
5737
5390
|
const close = closeSeries.values[ci] ?? high;
|
|
5738
5391
|
const isUp = close >= open;
|
|
5739
5392
|
const cx = layout.plotLeft + barGroupWidth * ci + barGroupWidth / 2;
|
|
5740
|
-
const highY =
|
|
5741
|
-
const lowY =
|
|
5742
|
-
const openY =
|
|
5743
|
-
const closeY =
|
|
5393
|
+
const highY = chunk7JPLVECA_js.valueToY(high, range, layout.plotTop, layout.plotBottom);
|
|
5394
|
+
const lowY = chunk7JPLVECA_js.valueToY(low, range, layout.plotTop, layout.plotBottom);
|
|
5395
|
+
const openY = chunk7JPLVECA_js.valueToY(open, range, layout.plotTop, layout.plotBottom);
|
|
5396
|
+
const closeY = chunk7JPLVECA_js.valueToY(close, range, layout.plotTop, layout.plotBottom);
|
|
5744
5397
|
elements.push(
|
|
5745
5398
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5746
5399
|
"line",
|
|
@@ -5783,7 +5436,7 @@ function renderStockChart(element, chartData, categoryLabels) {
|
|
|
5783
5436
|
textAnchor: "middle",
|
|
5784
5437
|
fontSize: 7,
|
|
5785
5438
|
fill: "#334155",
|
|
5786
|
-
children:
|
|
5439
|
+
children: chunk7JPLVECA_js.formatAxisValue(close)
|
|
5787
5440
|
},
|
|
5788
5441
|
`${element.id}-stock-dl-${ci}`
|
|
5789
5442
|
)
|
|
@@ -5825,7 +5478,7 @@ function FailedToLoad() {
|
|
|
5825
5478
|
var LazySurfaceChart3DScene = React6__default.default.lazy(
|
|
5826
5479
|
async () => {
|
|
5827
5480
|
try {
|
|
5828
|
-
return await import('./SurfaceChart3DScene-
|
|
5481
|
+
return await import('./SurfaceChart3DScene-ODQY77SZ.js');
|
|
5829
5482
|
} catch {
|
|
5830
5483
|
return { default: FailedToLoad };
|
|
5831
5484
|
}
|
|
@@ -5849,7 +5502,7 @@ var SurfaceChart3DErrorBoundary = class extends React6__default.default.Componen
|
|
|
5849
5502
|
function buildSurfaceData(chartData, categoryLabels) {
|
|
5850
5503
|
const rows = chartData.series.length;
|
|
5851
5504
|
const cols = Math.max(categoryLabels.length, 1);
|
|
5852
|
-
const range =
|
|
5505
|
+
const range = chunk7JPLVECA_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
5853
5506
|
const heightMap = new Float32Array(rows * cols);
|
|
5854
5507
|
const colorMap = new Float32Array(rows * cols * 3);
|
|
5855
5508
|
for (let r = 0; r < rows; r++) {
|
|
@@ -5968,10 +5621,10 @@ function darkenRgb(r, g, b, factor) {
|
|
|
5968
5621
|
}
|
|
5969
5622
|
function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
5970
5623
|
const style = chartData.style;
|
|
5971
|
-
const areaFill =
|
|
5624
|
+
const areaFill = chunk7JPLVECA_js.chartAreaFill(chartData);
|
|
5972
5625
|
const legendPos = style?.legendPosition || "b";
|
|
5973
|
-
const layout =
|
|
5974
|
-
const range =
|
|
5626
|
+
const layout = chunk7JPLVECA_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
5627
|
+
const range = chunk7JPLVECA_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
5975
5628
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
5976
5629
|
const seriesCount = chartData.series.length;
|
|
5977
5630
|
const cols = catCount - 1;
|
|
@@ -6060,10 +5713,10 @@ function renderIsometricSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6060
5713
|
}
|
|
6061
5714
|
function renderFlatSurfaceChart(element, chartData, categoryLabels) {
|
|
6062
5715
|
const style = chartData.style;
|
|
6063
|
-
const areaFill =
|
|
5716
|
+
const areaFill = chunk7JPLVECA_js.chartAreaFill(chartData);
|
|
6064
5717
|
const legendPos = style?.legendPosition || "b";
|
|
6065
|
-
const layout =
|
|
6066
|
-
const range =
|
|
5718
|
+
const layout = chunk7JPLVECA_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
5719
|
+
const range = chunk7JPLVECA_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
6067
5720
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6068
5721
|
const seriesCount = chartData.series.length;
|
|
6069
5722
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -6125,9 +5778,9 @@ function renderSurfaceChart(element, chartData, categoryLabels) {
|
|
|
6125
5778
|
}
|
|
6126
5779
|
function renderTreemapChart(element, chartData, categoryLabels) {
|
|
6127
5780
|
const style = chartData.style;
|
|
6128
|
-
const areaFill =
|
|
5781
|
+
const areaFill = chunk7JPLVECA_js.chartAreaFill(chartData);
|
|
6129
5782
|
const legendPos = style?.legendPosition || "b";
|
|
6130
|
-
const layout =
|
|
5783
|
+
const layout = chunk7JPLVECA_js.computeLayout(element.width, element.height, style, false, legendPos);
|
|
6131
5784
|
const allValues = chartData.series.flatMap((s) => s.values);
|
|
6132
5785
|
const totalAbs = allValues.reduce((sum, v) => sum + Math.abs(v), 0) || 1;
|
|
6133
5786
|
const rects = [];
|
|
@@ -6150,7 +5803,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
6150
5803
|
y: curY,
|
|
6151
5804
|
width: Math.max(w - 1, 1),
|
|
6152
5805
|
height: Math.max(h - 1, 1),
|
|
6153
|
-
fill:
|
|
5806
|
+
fill: chunk7JPLVECA_js.paletteColor(item.index, chartData.style?.styleId, chartData.colorPalette),
|
|
6154
5807
|
rx: 2,
|
|
6155
5808
|
opacity: 0.85
|
|
6156
5809
|
},
|
|
@@ -6201,11 +5854,11 @@ function renderTreemapChart(element, chartData, categoryLabels) {
|
|
|
6201
5854
|
}
|
|
6202
5855
|
function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
6203
5856
|
const style = chartData.style;
|
|
6204
|
-
const areaFill =
|
|
5857
|
+
const areaFill = chunk7JPLVECA_js.chartAreaFill(chartData);
|
|
6205
5858
|
const legendPos = style?.legendPosition || "b";
|
|
6206
5859
|
const values = chartData.series[0]?.values ?? [];
|
|
6207
|
-
const range =
|
|
6208
|
-
const layout =
|
|
5860
|
+
const range = chunk7JPLVECA_js.computeValueRangeForChart(chartData.series, chartData.axes);
|
|
5861
|
+
const layout = chunk7JPLVECA_js.computeLayout(element.width, element.height, style, true, legendPos);
|
|
6209
5862
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
6210
5863
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
6211
5864
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -6216,8 +5869,8 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6216
5869
|
const isLast = i === values.length - 1;
|
|
6217
5870
|
const startVal = isLast ? 0 : runningTotal;
|
|
6218
5871
|
const endVal = isLast ? runningTotal + val : runningTotal + val;
|
|
6219
|
-
const barStartY =
|
|
6220
|
-
const barEndY =
|
|
5872
|
+
const barStartY = chunk7JPLVECA_js.valueToY(startVal, range, layout.plotTop, layout.plotBottom);
|
|
5873
|
+
const barEndY = chunk7JPLVECA_js.valueToY(endVal, range, layout.plotTop, layout.plotBottom);
|
|
6221
5874
|
const x = layout.plotLeft + layout.plotWidth / catCount * i + gap;
|
|
6222
5875
|
const y = Math.min(barStartY, barEndY);
|
|
6223
5876
|
const h = Math.max(Math.abs(barEndY - barStartY), 1);
|
|
@@ -6246,7 +5899,7 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6246
5899
|
textAnchor: "middle",
|
|
6247
5900
|
fontSize: 7,
|
|
6248
5901
|
fill: "#334155",
|
|
6249
|
-
children:
|
|
5902
|
+
children: chunk7JPLVECA_js.formatAxisValue(isLast ? endVal : val)
|
|
6250
5903
|
},
|
|
6251
5904
|
`${element.id}-wf-dl-${i}`
|
|
6252
5905
|
)
|
|
@@ -6293,20 +5946,20 @@ function renderWaterfallChart(element, chartData, categoryLabels) {
|
|
|
6293
5946
|
}
|
|
6294
5947
|
function renderComboChart(element, chartData, categoryLabels) {
|
|
6295
5948
|
const style = chartData.style;
|
|
6296
|
-
const areaFill =
|
|
5949
|
+
const areaFill = chunk7JPLVECA_js.chartAreaFill(chartData);
|
|
6297
5950
|
const legendPos = style?.legendPosition || "b";
|
|
6298
|
-
const layoutOpts =
|
|
5951
|
+
const layoutOpts = chunk7JPLVECA_js.computeLayoutOptions(
|
|
6299
5952
|
chartData.axes,
|
|
6300
5953
|
chartData.dataTable,
|
|
6301
5954
|
chartData.series.length
|
|
6302
5955
|
);
|
|
6303
|
-
const layout =
|
|
6304
|
-
const { primary, secondary } =
|
|
5956
|
+
const layout = chunk7JPLVECA_js.computeLayout(element.width, element.height, style, true, legendPos, layoutOpts);
|
|
5957
|
+
const { primary, secondary } = chunk7JPLVECA_js.splitSeriesByAxis(chartData.series, chartData.axes);
|
|
6305
5958
|
const primarySeries = primary.length > 0 ? primary.map((e) => e.series) : chartData.series;
|
|
6306
5959
|
const secondarySeries = secondary.map((e) => e.series);
|
|
6307
|
-
const range =
|
|
6308
|
-
const secondaryRange = secondarySeries.length > 0 ?
|
|
6309
|
-
const secondaryAxisFmt =
|
|
5960
|
+
const range = chunk7JPLVECA_js.computeValueRangeForChart(primarySeries, chartData.axes);
|
|
5961
|
+
const secondaryRange = secondarySeries.length > 0 ? chunk7JPLVECA_js.computeValueRange(secondarySeries) : void 0;
|
|
5962
|
+
const secondaryAxisFmt = chunk7JPLVECA_js.getSecondaryValueAxis(chartData.axes);
|
|
6310
5963
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
6311
5964
|
const barSeriesCount = 1;
|
|
6312
5965
|
const barGroupWidth = layout.plotWidth / catCount;
|
|
@@ -6322,8 +5975,8 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6322
5975
|
const barRange = isBarSecondary && secondaryRange ? secondaryRange : range;
|
|
6323
5976
|
barSeries.values.forEach((val, vi) => {
|
|
6324
5977
|
const x = layout.plotLeft + barGroupWidth * vi + barOffset;
|
|
6325
|
-
const zeroY =
|
|
6326
|
-
const valY =
|
|
5978
|
+
const zeroY = chunk7JPLVECA_js.valueToY(0, barRange, layout.plotTop, layout.plotBottom);
|
|
5979
|
+
const valY = chunk7JPLVECA_js.valueToY(val, barRange, layout.plotTop, layout.plotBottom);
|
|
6327
5980
|
const y = Math.min(zeroY, valY);
|
|
6328
5981
|
const h = Math.max(Math.abs(zeroY - valY), 1);
|
|
6329
5982
|
barElements.push(
|
|
@@ -6334,7 +5987,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6334
5987
|
y,
|
|
6335
5988
|
width: barWidth,
|
|
6336
5989
|
height: h,
|
|
6337
|
-
fill:
|
|
5990
|
+
fill: chunk7JPLVECA_js.seriesColor(barSeries, 0, chartData.style?.styleId, chartData.colorPalette),
|
|
6338
5991
|
rx: 1
|
|
6339
5992
|
},
|
|
6340
5993
|
`${element.id}-combo-bar-${vi}`
|
|
@@ -6350,7 +6003,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6350
6003
|
textAnchor: "middle",
|
|
6351
6004
|
fontSize: 7,
|
|
6352
6005
|
fill: "#334155",
|
|
6353
|
-
children:
|
|
6006
|
+
children: chunk7JPLVECA_js.formatAxisValue(val)
|
|
6354
6007
|
},
|
|
6355
6008
|
`${element.id}-combo-bar-dl-${vi}`
|
|
6356
6009
|
)
|
|
@@ -6367,10 +6020,10 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6367
6020
|
const activeRange = isSecondary && secondaryRange ? secondaryRange : range;
|
|
6368
6021
|
const points = series.values.map((val, vi) => {
|
|
6369
6022
|
const x = layout.plotLeft + barGroupWidth * vi + barGroupWidth / 2;
|
|
6370
|
-
const y =
|
|
6023
|
+
const y = chunk7JPLVECA_js.valueToY(val, activeRange, layout.plotTop, layout.plotBottom);
|
|
6371
6024
|
return { x, y, val };
|
|
6372
6025
|
});
|
|
6373
|
-
const c =
|
|
6026
|
+
const c = chunk7JPLVECA_js.seriesColor(series, seriesIdx, chartData.style?.styleId, chartData.colorPalette);
|
|
6374
6027
|
lineElements.push(
|
|
6375
6028
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6376
6029
|
"polyline",
|
|
@@ -6397,7 +6050,7 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6397
6050
|
textAnchor: "middle",
|
|
6398
6051
|
fontSize: 7,
|
|
6399
6052
|
fill: "#334155",
|
|
6400
|
-
children:
|
|
6053
|
+
children: chunk7JPLVECA_js.formatAxisValue(p.val)
|
|
6401
6054
|
},
|
|
6402
6055
|
`${element.id}-combo-line-dl-${si}-${vi}`
|
|
6403
6056
|
)
|
|
@@ -6435,11 +6088,11 @@ function renderComboChart(element, chartData, categoryLabels) {
|
|
|
6435
6088
|
}
|
|
6436
6089
|
function renderChartElement(element) {
|
|
6437
6090
|
if (element.type !== "chart") {
|
|
6438
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
6091
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkAONFHTTJ_js.translationsEn["pptx.chart.heading"] });
|
|
6439
6092
|
}
|
|
6440
6093
|
const chartData = element.chartData;
|
|
6441
6094
|
if (!chartData || chartData.series.length === 0) {
|
|
6442
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
6095
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkAONFHTTJ_js.translationsEn["pptx.chart.heading"] });
|
|
6443
6096
|
}
|
|
6444
6097
|
const longestSeriesLength = chartData.series.reduce(
|
|
6445
6098
|
(maxLength, series) => Math.max(maxLength, series.values.length),
|
|
@@ -6517,14 +6170,14 @@ function buildNotesPdf(pages) {
|
|
|
6517
6170
|
notes: page.notes,
|
|
6518
6171
|
slideNumber: page.slideNumber
|
|
6519
6172
|
}));
|
|
6520
|
-
const bytes =
|
|
6173
|
+
const bytes = chunk7JPLVECA_js.buildNotesPdfBytes(images, meta);
|
|
6521
6174
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
6522
6175
|
return URL.createObjectURL(blob);
|
|
6523
6176
|
}
|
|
6524
6177
|
|
|
6525
6178
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
6526
6179
|
function buildPdfFromImageData(images) {
|
|
6527
|
-
const bytes =
|
|
6180
|
+
const bytes = chunk7JPLVECA_js.buildSlidesPdfBytes(images);
|
|
6528
6181
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
6529
6182
|
return URL.createObjectURL(blob);
|
|
6530
6183
|
}
|
|
@@ -6533,7 +6186,7 @@ function buildPdfFromImageData(images) {
|
|
|
6533
6186
|
var activePreview = null;
|
|
6534
6187
|
function startPreviewAnimation(elementId, preset, options) {
|
|
6535
6188
|
stopPreviewAnimation();
|
|
6536
|
-
const descriptor =
|
|
6189
|
+
const descriptor = chunk7JPLVECA_js.buildPreviewAnimation(preset, options);
|
|
6537
6190
|
if (!descriptor) {
|
|
6538
6191
|
return;
|
|
6539
6192
|
}
|
|
@@ -6546,7 +6199,7 @@ function startMotionPathPreview(elementId, path, options) {
|
|
|
6546
6199
|
return;
|
|
6547
6200
|
}
|
|
6548
6201
|
const stage = domEl.offsetParent;
|
|
6549
|
-
const descriptor =
|
|
6202
|
+
const descriptor = chunk7JPLVECA_js.buildMotionPathPreview({
|
|
6550
6203
|
path,
|
|
6551
6204
|
slideWidth: stage?.offsetWidth || DEFAULT_PREVIEW_SLIDE_WIDTH,
|
|
6552
6205
|
slideHeight: stage?.offsetHeight || DEFAULT_PREVIEW_SLIDE_HEIGHT,
|
|
@@ -6644,14 +6297,13 @@ exports.getConnectorPathGeometry = getConnectorPathGeometry;
|
|
|
6644
6297
|
exports.getCropShapeClipPath = getCropShapeClipPath;
|
|
6645
6298
|
exports.getDuotoneColors = getDuotoneColors;
|
|
6646
6299
|
exports.getImageRenderStyle = getImageRenderStyle;
|
|
6647
|
-
exports.getImageTilingStyle =
|
|
6300
|
+
exports.getImageTilingStyle = getImageTilingStyle2;
|
|
6648
6301
|
exports.getShapeVisualStyle = getShapeVisualStyle;
|
|
6649
6302
|
exports.getTextLayoutStyle = getTextLayoutStyle;
|
|
6650
6303
|
exports.getTextStyleForElement = getTextStyleForElement;
|
|
6651
6304
|
exports.getTextWarpStyle = getTextWarpStyle;
|
|
6652
6305
|
exports.hasDagDuotoneEffect = hasDagDuotoneEffect;
|
|
6653
6306
|
exports.isConnectorOrLineElement = isConnectorOrLineElement;
|
|
6654
|
-
exports.isImageTiled = isImageTiled;
|
|
6655
6307
|
exports.renderChartElement = renderChartElement;
|
|
6656
6308
|
exports.renderConnectorMarker = renderConnectorMarker;
|
|
6657
6309
|
exports.renderDagDuotoneSvgFilter = renderDagDuotoneSvgFilter;
|