pptx-react-viewer 4.3.0 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +143 -0
- package/dist/{AiChatPanel-UCEK3ZTD.mjs → AiChatPanel-HXGCZPUX.mjs} +4 -4
- package/dist/AiChatPanel-HXGCZPUX.mjs.br +0 -0
- package/dist/AiChatPanel-HXGCZPUX.mjs.gz +0 -0
- package/dist/{AiChatPanel-7UQA25FA.js → AiChatPanel-P2N6X2KB.js} +28 -28
- package/dist/AiChatPanel-P2N6X2KB.js.br +0 -0
- package/dist/AiChatPanel-P2N6X2KB.js.gz +0 -0
- package/dist/{Model3DScene-X3DS3ELB.js → Model3DScene-PIFMH2TU.js} +2 -2
- package/dist/Model3DScene-PIFMH2TU.js.br +0 -0
- package/dist/Model3DScene-PIFMH2TU.js.gz +0 -0
- package/dist/{Model3DScene-AI2JTBQM.mjs → Model3DScene-QXMMJRV3.mjs} +1 -1
- package/dist/Model3DScene-QXMMJRV3.mjs.br +0 -0
- package/dist/Model3DScene-QXMMJRV3.mjs.gz +0 -0
- package/dist/{chunk-E7O4HTS5.js → chunk-6FVYG27J.js} +211 -187
- package/dist/chunk-6FVYG27J.js.br +0 -0
- package/dist/chunk-6FVYG27J.js.gz +0 -0
- package/dist/{chunk-OBQ453H6.mjs → chunk-APAVAD2A.mjs} +37 -0
- package/dist/chunk-APAVAD2A.mjs.br +0 -0
- package/dist/chunk-APAVAD2A.mjs.gz +0 -0
- package/dist/{chunk-YQJOCGOK.mjs → chunk-DX2JCSQ4.mjs} +1 -1
- package/dist/chunk-DX2JCSQ4.mjs.br +0 -0
- package/dist/chunk-DX2JCSQ4.mjs.gz +0 -0
- package/dist/{chunk-RXYLPESV.mjs → chunk-IDV2ITXM.mjs} +607 -102
- package/dist/chunk-IDV2ITXM.mjs.br +0 -0
- package/dist/chunk-IDV2ITXM.mjs.gz +0 -0
- package/dist/{chunk-UTI4CLYJ.js → chunk-LYZQLV7R.js} +3417 -1722
- package/dist/chunk-LYZQLV7R.js.br +0 -0
- package/dist/chunk-LYZQLV7R.js.gz +0 -0
- package/dist/{chunk-SKTZSG7Q.mjs → chunk-PRXJ3J5W.mjs} +325 -48
- package/dist/chunk-PRXJ3J5W.mjs.br +0 -0
- package/dist/chunk-PRXJ3J5W.mjs.gz +0 -0
- package/dist/{chunk-KAO5USPE.js → chunk-T35BGKZG.js} +5 -5
- package/dist/chunk-T35BGKZG.js.br +0 -0
- package/dist/chunk-T35BGKZG.js.gz +0 -0
- package/dist/{chunk-W5KLLGVH.js → chunk-UMQV2432.js} +37 -0
- package/dist/chunk-UMQV2432.js.br +0 -0
- package/dist/chunk-UMQV2432.js.gz +0 -0
- package/dist/{chunk-42XEZVUQ.js → chunk-UZFCFYK6.js} +1667 -1162
- package/dist/chunk-UZFCFYK6.js.br +0 -0
- package/dist/chunk-UZFCFYK6.js.gz +0 -0
- package/dist/{chunk-3UWJWJCR.mjs → chunk-VZNIVS3X.mjs} +3397 -1723
- package/dist/chunk-VZNIVS3X.mjs.br +0 -0
- package/dist/chunk-VZNIVS3X.mjs.gz +0 -0
- package/dist/{chunk-Y7LI2JIR.js → chunk-Y4VRYQQS.js} +1123 -846
- package/dist/chunk-Y4VRYQQS.js.br +0 -0
- package/dist/chunk-Y4VRYQQS.js.gz +0 -0
- package/dist/{chunk-PLDG3CXW.mjs → chunk-ZF5S3HHW.mjs} +31 -7
- package/dist/chunk-ZF5S3HHW.mjs.br +0 -0
- package/dist/chunk-ZF5S3HHW.mjs.gz +0 -0
- package/dist/i18n/de.cjs +33 -0
- package/dist/i18n/de.cjs.br +0 -0
- package/dist/i18n/de.cjs.gz +0 -0
- package/dist/i18n/de.mjs +33 -0
- package/dist/i18n/de.mjs.br +0 -0
- package/dist/i18n/de.mjs.gz +0 -0
- package/dist/i18n/es.cjs +33 -0
- package/dist/i18n/es.cjs.br +0 -0
- package/dist/i18n/es.cjs.gz +0 -0
- package/dist/i18n/es.mjs +33 -0
- package/dist/i18n/es.mjs.br +0 -0
- package/dist/i18n/es.mjs.gz +0 -0
- package/dist/i18n/fr.cjs +33 -0
- package/dist/i18n/fr.cjs.br +0 -0
- package/dist/i18n/fr.cjs.gz +0 -0
- package/dist/i18n/fr.mjs +33 -0
- package/dist/i18n/fr.mjs.br +0 -0
- package/dist/i18n/fr.mjs.gz +0 -0
- package/dist/i18n/zh-CN.cjs +33 -0
- package/dist/i18n/zh-CN.cjs.br +0 -0
- package/dist/i18n/zh-CN.cjs.gz +0 -0
- package/dist/i18n/zh-CN.mjs +33 -0
- package/dist/i18n/zh-CN.mjs.br +0 -0
- package/dist/i18n/zh-CN.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 +116 -8
- package/dist/index.js +49 -49
- 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 +228 -44
- package/dist/internals.js +105 -105
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +4 -4
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/viewer/index.d.ts +97 -8
- 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-7UQA25FA.js.br +0 -0
- package/dist/AiChatPanel-7UQA25FA.js.gz +0 -0
- package/dist/AiChatPanel-UCEK3ZTD.mjs.br +0 -0
- package/dist/AiChatPanel-UCEK3ZTD.mjs.gz +0 -0
- package/dist/Model3DScene-AI2JTBQM.mjs.br +0 -0
- package/dist/Model3DScene-AI2JTBQM.mjs.gz +0 -0
- package/dist/Model3DScene-X3DS3ELB.js.br +0 -0
- package/dist/Model3DScene-X3DS3ELB.js.gz +0 -0
- package/dist/chunk-3UWJWJCR.mjs.br +0 -0
- package/dist/chunk-3UWJWJCR.mjs.gz +0 -0
- package/dist/chunk-42XEZVUQ.js.br +0 -0
- package/dist/chunk-42XEZVUQ.js.gz +0 -0
- package/dist/chunk-E7O4HTS5.js.br +0 -0
- package/dist/chunk-E7O4HTS5.js.gz +0 -0
- package/dist/chunk-KAO5USPE.js.br +0 -0
- package/dist/chunk-KAO5USPE.js.gz +0 -0
- package/dist/chunk-OBQ453H6.mjs.br +0 -0
- package/dist/chunk-OBQ453H6.mjs.gz +0 -0
- package/dist/chunk-PLDG3CXW.mjs.br +0 -0
- package/dist/chunk-PLDG3CXW.mjs.gz +0 -0
- package/dist/chunk-RXYLPESV.mjs.br +0 -0
- package/dist/chunk-RXYLPESV.mjs.gz +0 -0
- package/dist/chunk-SKTZSG7Q.mjs.br +0 -0
- package/dist/chunk-SKTZSG7Q.mjs.gz +0 -0
- package/dist/chunk-UTI4CLYJ.js.br +0 -0
- package/dist/chunk-UTI4CLYJ.js.gz +0 -0
- package/dist/chunk-W5KLLGVH.js.br +0 -0
- package/dist/chunk-W5KLLGVH.js.gz +0 -0
- package/dist/chunk-Y7LI2JIR.js.br +0 -0
- package/dist/chunk-Y7LI2JIR.js.gz +0 -0
- package/dist/chunk-YQJOCGOK.mjs.br +0 -0
- package/dist/chunk-YQJOCGOK.mjs.gz +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkLYZQLV7R_js = require('./chunk-LYZQLV7R.js');
|
|
4
|
+
var chunkUMQV2432_js = require('./chunk-UMQV2432.js');
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var tailwindMerge = require('tailwind-merge');
|
|
7
7
|
var React7 = require('react');
|
|
@@ -15,7 +15,7 @@ var React7__default = /*#__PURE__*/_interopDefault(React7);
|
|
|
15
15
|
|
|
16
16
|
// src/viewer/utils/animation-effects.ts
|
|
17
17
|
function getAnimationInitialStyle2(preset, nativeAnimation) {
|
|
18
|
-
return
|
|
18
|
+
return chunkLYZQLV7R_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 chunkLYZQLV7R_js.cloneHistorySnapshot(snapshot);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
// src/viewer/constants/scalar.ts
|
|
@@ -61,7 +61,7 @@ var TOOLBAR_SECTIONS = [
|
|
|
61
61
|
{ id: "view", labelKey: "pptx.ribbon.tab.view" },
|
|
62
62
|
{ id: "help", labelKey: "pptx.ribbon.tab.help" }
|
|
63
63
|
];
|
|
64
|
-
var SHORTCUT_REFERENCE_ITEMS =
|
|
64
|
+
var SHORTCUT_REFERENCE_ITEMS = chunkLYZQLV7R_js.VIEWER_SHORTCUT_REFERENCE;
|
|
65
65
|
|
|
66
66
|
// src/viewer/constants/transitions-animations.ts
|
|
67
67
|
var ANIMATION_PRESET_OPTIONS = [
|
|
@@ -89,7 +89,7 @@ var GLYPH_COMPONENTS = {
|
|
|
89
89
|
plus: lu.LuPlus,
|
|
90
90
|
triangle: lu.LuTriangle
|
|
91
91
|
};
|
|
92
|
-
var SHAPE_PRESETS =
|
|
92
|
+
var SHAPE_PRESETS = chunkLYZQLV7R_js.SHAPE_PRESET_DEFS.map(
|
|
93
93
|
(def) => ({
|
|
94
94
|
type: def.type,
|
|
95
95
|
label: def.label,
|
|
@@ -114,7 +114,7 @@ var ARROW_SIZE_OPTIONS = [
|
|
|
114
114
|
{ value: "med", label: "Medium", i18nKey: "pptx.connectorOptions.sizeMedium" },
|
|
115
115
|
{ value: "lg", label: "Large", i18nKey: "pptx.connectorOptions.sizeLarge" }
|
|
116
116
|
];
|
|
117
|
-
var STROKE_DASH_OPTIONS2 =
|
|
117
|
+
var STROKE_DASH_OPTIONS2 = chunkLYZQLV7R_js.STROKE_DASH_OPTIONS;
|
|
118
118
|
|
|
119
119
|
// src/viewer/utils/shape-types.tsx
|
|
120
120
|
function getShapeType(shapeType) {
|
|
@@ -223,7 +223,7 @@ function isConnectorOrLineElement(element) {
|
|
|
223
223
|
if (element.type === "connector") {
|
|
224
224
|
return true;
|
|
225
225
|
}
|
|
226
|
-
if (!
|
|
226
|
+
if (!chunkLYZQLV7R_js.hasShapeProperties(element)) {
|
|
227
227
|
return false;
|
|
228
228
|
}
|
|
229
229
|
const st = getShapeType(element.shapeType);
|
|
@@ -232,18 +232,18 @@ function isConnectorOrLineElement(element) {
|
|
|
232
232
|
|
|
233
233
|
// src/viewer/utils/image-style.ts
|
|
234
234
|
function getImageMaskStyle(element) {
|
|
235
|
-
if (!
|
|
235
|
+
if (!chunkLYZQLV7R_js.hasShapeProperties(element)) {
|
|
236
236
|
return void 0;
|
|
237
237
|
}
|
|
238
|
-
const geometry =
|
|
238
|
+
const geometry = chunkLYZQLV7R_js.resolveShapeGeometry(element);
|
|
239
239
|
if (geometry.kind === "borderRadius") {
|
|
240
240
|
return { borderRadius: geometry.radius };
|
|
241
241
|
}
|
|
242
242
|
return geometry.kind === "clipPath" ? { clipPath: geometry.clipPath } : void 0;
|
|
243
243
|
}
|
|
244
244
|
function getImageRenderStyle(element) {
|
|
245
|
-
const fit =
|
|
246
|
-
const counterTransform =
|
|
245
|
+
const fit = chunkLYZQLV7R_js.getImageFitStyle(element);
|
|
246
|
+
const counterTransform = chunkLYZQLV7R_js.getImageFillCounterTransform(element, Boolean(fit.transform));
|
|
247
247
|
return {
|
|
248
248
|
// A translated/scaled crop, or a rotWithShape=false counter-transform,
|
|
249
249
|
// must be masked by the stationary wrapper, not by the moving/counter-
|
|
@@ -262,7 +262,7 @@ function getImageSurfaceMaskStyle(element) {
|
|
|
262
262
|
};
|
|
263
263
|
}
|
|
264
264
|
function getImageSurfaceStyle(element) {
|
|
265
|
-
const fill =
|
|
265
|
+
const fill = chunkLYZQLV7R_js.hasShapeProperties(element) ? chunkLYZQLV7R_js.getComputedFillStyle(element) : void 0;
|
|
266
266
|
return {
|
|
267
267
|
position: "absolute",
|
|
268
268
|
inset: 0,
|
|
@@ -275,13 +275,13 @@ function getImageSurfaceStyle(element) {
|
|
|
275
275
|
};
|
|
276
276
|
}
|
|
277
277
|
function getCropShapeClipPath2(element) {
|
|
278
|
-
if (!
|
|
278
|
+
if (!chunkLYZQLV7R_js.isImageLikeElement(element)) {
|
|
279
279
|
return void 0;
|
|
280
280
|
}
|
|
281
|
-
return
|
|
281
|
+
return chunkLYZQLV7R_js.getCropShapeClipPath(element.cropShape, element.width, element.height);
|
|
282
282
|
}
|
|
283
283
|
function getImageTilingStyle2(element, nativeSize) {
|
|
284
|
-
return
|
|
284
|
+
return chunkLYZQLV7R_js.getImageTilingStyle(element, nativeSize);
|
|
285
285
|
}
|
|
286
286
|
|
|
287
287
|
// src/viewer/utils/geometry-image.ts
|
|
@@ -413,7 +413,7 @@ function VideoWithMetadata({
|
|
|
413
413
|
{
|
|
414
414
|
ref: mediaRef,
|
|
415
415
|
className: "w-full h-full pointer-events-auto",
|
|
416
|
-
style: isFullScreen ? { objectFit: "cover" } :
|
|
416
|
+
style: isFullScreen ? { objectFit: "cover" } : chunkLYZQLV7R_js.getImageFitStyle(element),
|
|
417
417
|
controls: showTransport,
|
|
418
418
|
preload: "metadata",
|
|
419
419
|
playsInline: true,
|
|
@@ -470,7 +470,7 @@ function PresentationMediaController({
|
|
|
470
470
|
const [isMediaPlaying, setIsMediaPlaying] = React7.useState(false);
|
|
471
471
|
const trimStartSec = element.trimStartMs !== void 0 ? element.trimStartMs / 1e3 : 0;
|
|
472
472
|
const hideWhenNotPlaying = isPresentationMode && element.hideWhenNotPlaying === true;
|
|
473
|
-
const { volume: playbackVolume, playbackRate } =
|
|
473
|
+
const { volume: playbackVolume, playbackRate } = chunkLYZQLV7R_js.mediaPlaybackAttributes({
|
|
474
474
|
loop: element.loop,
|
|
475
475
|
volume: element.volume,
|
|
476
476
|
playbackSpeed: element.playbackSpeed
|
|
@@ -518,7 +518,7 @@ function PresentationMediaController({
|
|
|
518
518
|
if (!el || !isPresentationMode) {
|
|
519
519
|
return;
|
|
520
520
|
}
|
|
521
|
-
return
|
|
521
|
+
return chunkLYZQLV7R_js.scheduleMediaTrimAndFade(el, {
|
|
522
522
|
trimStartMs: element.trimStartMs,
|
|
523
523
|
trimEndMs: element.trimEndMs,
|
|
524
524
|
fadeInDuration: element.fadeInDuration,
|
|
@@ -539,7 +539,7 @@ function PresentationMediaController({
|
|
|
539
539
|
}
|
|
540
540
|
if (element.playAcrossSlides && element.mediaType === "audio") {
|
|
541
541
|
const dataUrl = element.mediaData ?? resolvedDataUrl;
|
|
542
|
-
if (
|
|
542
|
+
if (chunkLYZQLV7R_js.registerCrossSlideAudio(element, dataUrl)) {
|
|
543
543
|
return;
|
|
544
544
|
}
|
|
545
545
|
}
|
|
@@ -571,7 +571,7 @@ function PresentationMediaController({
|
|
|
571
571
|
}, []);
|
|
572
572
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full h-full", style: wrapperStyle, children: [
|
|
573
573
|
children({ mediaRef, onPlay: noopOnPlay, isMediaPlaying }),
|
|
574
|
-
|
|
574
|
+
chunkLYZQLV7R_js.shouldShowMediaFullscreenStopButton({
|
|
575
575
|
fullScreen: isFullScreen,
|
|
576
576
|
presenting: isPresentationMode,
|
|
577
577
|
playing: isMediaPlaying
|
|
@@ -588,7 +588,7 @@ function PresentationMediaController({
|
|
|
588
588
|
] });
|
|
589
589
|
}
|
|
590
590
|
function label(key) {
|
|
591
|
-
return key === void 0 ? void 0 :
|
|
591
|
+
return key === void 0 ? void 0 : chunkUMQV2432_js.translationsEn[key];
|
|
592
592
|
}
|
|
593
593
|
function FallbackIcon({
|
|
594
594
|
paths,
|
|
@@ -624,17 +624,17 @@ function Badge({
|
|
|
624
624
|
"div",
|
|
625
625
|
{
|
|
626
626
|
className: `absolute inset-0 flex flex-col items-center justify-center ${isMissing ? "gap-1" : ""}`,
|
|
627
|
-
...{ [
|
|
627
|
+
...{ [chunkLYZQLV7R_js.MEDIA_CHROME_ATTRIBUTE]: visual.badge },
|
|
628
628
|
children: [
|
|
629
629
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
630
630
|
FallbackIcon,
|
|
631
631
|
{
|
|
632
|
-
paths:
|
|
632
|
+
paths: chunkLYZQLV7R_js.mediaFallbackIcon(visual, element.mediaType),
|
|
633
633
|
size: isMissing ? 32 : 48,
|
|
634
634
|
className: isMissing ? "text-white/60" : "text-white/80 drop-shadow-md"
|
|
635
635
|
}
|
|
636
636
|
),
|
|
637
|
-
isMissing && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: label(
|
|
637
|
+
isMissing && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: label(chunkLYZQLV7R_js.mediaFallbackLabelKey(visual, element.mediaType)) })
|
|
638
638
|
]
|
|
639
639
|
}
|
|
640
640
|
);
|
|
@@ -651,17 +651,17 @@ function Placeholder({
|
|
|
651
651
|
"div",
|
|
652
652
|
{
|
|
653
653
|
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"}`,
|
|
654
|
-
...{ [
|
|
654
|
+
...{ [chunkLYZQLV7R_js.MEDIA_CHROME_ATTRIBUTE]: visual.placeholder },
|
|
655
655
|
children: [
|
|
656
656
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
657
657
|
FallbackIcon,
|
|
658
658
|
{
|
|
659
|
-
paths:
|
|
659
|
+
paths: chunkLYZQLV7R_js.mediaFallbackIcon(visual, element.mediaType),
|
|
660
660
|
size: isMissing ? 36 : element.mediaType === "audio" ? 24 : 32,
|
|
661
661
|
className: isMissing ? "text-white/50" : "text-white/70"
|
|
662
662
|
}
|
|
663
663
|
),
|
|
664
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `text-[10px] ${isMissing ? "text-white/50" : "text-white/70"}`, children: label(
|
|
664
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `text-[10px] ${isMissing ? "text-white/50" : "text-white/70"}`, children: label(chunkLYZQLV7R_js.mediaFallbackLabelKey(visual, element.mediaType)) })
|
|
665
665
|
]
|
|
666
666
|
}
|
|
667
667
|
);
|
|
@@ -671,7 +671,7 @@ function renderMediaFallback({
|
|
|
671
671
|
posterUrl,
|
|
672
672
|
surface
|
|
673
673
|
}) {
|
|
674
|
-
const visual =
|
|
674
|
+
const visual = chunkLYZQLV7R_js.mediaFallbackVisual(surface, {
|
|
675
675
|
hasPoster: Boolean(posterUrl),
|
|
676
676
|
missing: element.mediaMissing === true
|
|
677
677
|
});
|
|
@@ -681,9 +681,9 @@ function renderMediaFallback({
|
|
|
681
681
|
"img",
|
|
682
682
|
{
|
|
683
683
|
src: posterUrl,
|
|
684
|
-
alt: visual.dimPoster ?
|
|
684
|
+
alt: visual.dimPoster ? chunkUMQV2432_js.translationsEn["pptx.media.posterAlt"] : chunkUMQV2432_js.translationsEn["pptx.media.videoPosterAlt"],
|
|
685
685
|
className: `w-full h-full${visual.dimPoster ? " opacity-50" : ""}`,
|
|
686
|
-
style:
|
|
686
|
+
style: chunkLYZQLV7R_js.getImageFitStyle(element)
|
|
687
687
|
}
|
|
688
688
|
),
|
|
689
689
|
/* @__PURE__ */ jsxRuntime.jsx(Badge, { visual, element })
|
|
@@ -693,7 +693,7 @@ function renderMediaFallback({
|
|
|
693
693
|
}
|
|
694
694
|
function renderMediaElement(element, mediaDataUrls, options) {
|
|
695
695
|
if (element.type !== "media") {
|
|
696
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
696
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkUMQV2432_js.translationsEn["pptx.media.title"] });
|
|
697
697
|
}
|
|
698
698
|
const mediaType = element.mediaType;
|
|
699
699
|
const mediaPath = element.mediaPath;
|
|
@@ -701,7 +701,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
701
701
|
const dataUrl = element.mediaData ?? (mediaPath ? mediaDataUrls.get(mediaPath) : void 0);
|
|
702
702
|
const trimFragment = buildTrimFragment(element);
|
|
703
703
|
const posterUrl = element.posterFrameData ?? void 0;
|
|
704
|
-
const shouldLoop =
|
|
704
|
+
const shouldLoop = chunkLYZQLV7R_js.mediaPlaybackAttributes(element).loop;
|
|
705
705
|
const shouldAutoPlay = options?.autoPlay === true || element.autoPlay === true;
|
|
706
706
|
const isFullScreen = options?.fullScreen === true;
|
|
707
707
|
const isPresentationMode = options?.isPresentationMode === true;
|
|
@@ -714,6 +714,20 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
714
714
|
return renderMediaFallback({ element, posterUrl, surface });
|
|
715
715
|
}
|
|
716
716
|
if (mediaType === "video") {
|
|
717
|
+
const onlineVideo = chunkLYZQLV7R_js.getOnlineVideoEmbed(element);
|
|
718
|
+
if (onlineVideo) {
|
|
719
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
720
|
+
"iframe",
|
|
721
|
+
{
|
|
722
|
+
src: onlineVideo.embedUrl,
|
|
723
|
+
title: chunkUMQV2432_js.translationsEn["pptx.media.onlineVideoTitle"],
|
|
724
|
+
className: "w-full h-full border-0 pointer-events-auto",
|
|
725
|
+
allow: chunkLYZQLV7R_js.ONLINE_VIDEO_IFRAME_ALLOW,
|
|
726
|
+
allowFullScreen: true,
|
|
727
|
+
sandbox: chunkLYZQLV7R_js.ONLINE_VIDEO_IFRAME_SANDBOX
|
|
728
|
+
}
|
|
729
|
+
);
|
|
730
|
+
}
|
|
717
731
|
if (dataUrl) {
|
|
718
732
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
719
733
|
PresentationMediaController,
|
|
@@ -779,32 +793,32 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
779
793
|
if (surface.presenting || surface.preview) {
|
|
780
794
|
return null;
|
|
781
795
|
}
|
|
782
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
796
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkUMQV2432_js.translationsEn["pptx.media.title"] });
|
|
783
797
|
}
|
|
784
798
|
|
|
785
799
|
// src/viewer/utils/text-utils.tsx
|
|
786
800
|
function getTextStyleForElement(element, fallbackColor) {
|
|
787
|
-
return
|
|
801
|
+
return chunkLYZQLV7R_js.buildTextBlockStyle(element, { fallbackColor });
|
|
788
802
|
}
|
|
789
803
|
|
|
790
804
|
// src/viewer/utils/text-layout.tsx
|
|
791
805
|
function getTextLayoutStyle(element) {
|
|
792
|
-
if (!
|
|
806
|
+
if (!chunkLYZQLV7R_js.hasTextProperties(element)) {
|
|
793
807
|
return {};
|
|
794
808
|
}
|
|
795
|
-
const writingMode =
|
|
796
|
-
const textOrientation =
|
|
797
|
-
const verticalDirection =
|
|
809
|
+
const writingMode = chunkLYZQLV7R_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
810
|
+
const textOrientation = chunkLYZQLV7R_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
811
|
+
const verticalDirection = chunkLYZQLV7R_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
798
812
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
799
813
|
const shapeAutoFitTextBox = element.textStyle?.autoFitMode === "shrink" && (element.type === "text" || element.locks?.txBox === true);
|
|
800
|
-
const hasParagraphIndents =
|
|
814
|
+
const hasParagraphIndents = chunkLYZQLV7R_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
801
815
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
802
816
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
803
817
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
804
818
|
const textIndent = !hasParagraphIndents && typeof paragraphIndent === "number" && paragraphIndent !== 0 ? paragraphIndent : void 0;
|
|
805
819
|
const bodyTop = element.textStyle?.bodyInsetTop ?? DEFAULT_BODY_INSET_TB_PX;
|
|
806
820
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
807
|
-
const bodyLayoutStyle =
|
|
821
|
+
const bodyLayoutStyle = chunkLYZQLV7R_js.buildTextBodyLayoutStyle(element);
|
|
808
822
|
return {
|
|
809
823
|
...bodyLayoutStyle,
|
|
810
824
|
// Body inset only. Paragraph spacing (spcBef/spcAft) is applied
|
|
@@ -834,7 +848,7 @@ function getTextLayoutStyle(element) {
|
|
|
834
848
|
|
|
835
849
|
// src/viewer/utils/text-effects.tsx
|
|
836
850
|
function buildTextBody3DSceneStyle2(textStyle, elementSize) {
|
|
837
|
-
return
|
|
851
|
+
return chunkLYZQLV7R_js.buildTextBody3DSceneStyle(textStyle, elementSize);
|
|
838
852
|
}
|
|
839
853
|
|
|
840
854
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -1019,13 +1033,13 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1019
1033
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
1020
1034
|
return renderedSegments;
|
|
1021
1035
|
}
|
|
1022
|
-
const paraKey = `${elementId}${
|
|
1036
|
+
const paraKey = `${elementId}${chunkLYZQLV7R_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
1023
1037
|
const paraState = subElementAnimStates.get(paraKey);
|
|
1024
1038
|
if (paraState) {
|
|
1025
1039
|
const style = buildAnimStyle(paraState);
|
|
1026
1040
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
1027
1041
|
}
|
|
1028
|
-
const spec =
|
|
1042
|
+
const spec = chunkLYZQLV7R_js.buildTextBuildSpec(
|
|
1029
1043
|
elementId,
|
|
1030
1044
|
paraIndex,
|
|
1031
1045
|
paraRuns.map((run) => ({ text: run.text, style: run })),
|
|
@@ -1043,7 +1057,7 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1043
1057
|
"span",
|
|
1044
1058
|
{
|
|
1045
1059
|
"data-anim-id": span.animId,
|
|
1046
|
-
style:
|
|
1060
|
+
style: chunkLYZQLV7R_js.textBuildSpanStyle(span),
|
|
1047
1061
|
children: content
|
|
1048
1062
|
},
|
|
1049
1063
|
span.animId
|
|
@@ -1054,13 +1068,13 @@ function renderUnderlineWords(text, isUnderlineWords, wordDecoration, metric, ke
|
|
|
1054
1068
|
if (!isUnderlineWords || !text) {
|
|
1055
1069
|
return inner(text, keyPrefix, metric);
|
|
1056
1070
|
}
|
|
1057
|
-
const pieces =
|
|
1071
|
+
const pieces = chunkLYZQLV7R_js.splitWordsForUnderline(text);
|
|
1058
1072
|
if (pieces.length === 0) {
|
|
1059
1073
|
return inner(text, keyPrefix, metric);
|
|
1060
1074
|
}
|
|
1061
1075
|
const gapMetric = metric ? {
|
|
1062
1076
|
...metric,
|
|
1063
|
-
nestedStyle: metric.nestedStyle ?
|
|
1077
|
+
nestedStyle: metric.nestedStyle ? chunkLYZQLV7R_js.stripUnderlineDecoration(metric.nestedStyle) : void 0
|
|
1064
1078
|
} : void 0;
|
|
1065
1079
|
return pieces.map((piece, i) => {
|
|
1066
1080
|
const key = `${keyPrefix}-u${i}`;
|
|
@@ -1093,7 +1107,7 @@ function makeSegmentPieceRenderer(needsScriptFonts, scriptFonts, baseFontFamily,
|
|
|
1093
1107
|
);
|
|
1094
1108
|
}
|
|
1095
1109
|
function renderTabbedLine(line, ctx, keyPrefix, renderPiece, nestedStyle, underlineWords = false) {
|
|
1096
|
-
const [lineLayout] =
|
|
1110
|
+
const [lineLayout] = chunkLYZQLV7R_js.buildRunTabLines(
|
|
1097
1111
|
line,
|
|
1098
1112
|
ctx,
|
|
1099
1113
|
nestedStyle,
|
|
@@ -1112,7 +1126,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1112
1126
|
if (!needsScriptFonts || !text) {
|
|
1113
1127
|
return text;
|
|
1114
1128
|
}
|
|
1115
|
-
const pieces =
|
|
1129
|
+
const pieces = chunkLYZQLV7R_js.splitRunByScriptFont(
|
|
1116
1130
|
text,
|
|
1117
1131
|
scriptFonts,
|
|
1118
1132
|
baseFontFamily,
|
|
@@ -1129,7 +1143,7 @@ function renderMetricPieces(text, metric, keyPrefix, inner) {
|
|
|
1129
1143
|
if (!metric || !text) {
|
|
1130
1144
|
return inner(text, keyPrefix);
|
|
1131
1145
|
}
|
|
1132
|
-
const pieces =
|
|
1146
|
+
const pieces = chunkLYZQLV7R_js.splitRunForMetrics(text, metric.font);
|
|
1133
1147
|
if (pieces.length <= 1) {
|
|
1134
1148
|
return inner(text, keyPrefix);
|
|
1135
1149
|
}
|
|
@@ -1138,7 +1152,7 @@ function renderMetricPieces(text, metric, keyPrefix, inner) {
|
|
|
1138
1152
|
{
|
|
1139
1153
|
style: {
|
|
1140
1154
|
...metric.nestedStyle,
|
|
1141
|
-
letterSpacing:
|
|
1155
|
+
letterSpacing: chunkLYZQLV7R_js.pieceLetterSpacing(metric.authoredPx, piece.tracking)
|
|
1142
1156
|
},
|
|
1143
1157
|
children: inner(piece.text, `${keyPrefix}-w${i}`)
|
|
1144
1158
|
},
|
|
@@ -1213,9 +1227,9 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1213
1227
|
) : /* @__PURE__ */ jsxRuntime.jsx(React7__default.default.Fragment, { children: renderLeaf(chunk.text, chunkKey) }, chunkKey);
|
|
1214
1228
|
});
|
|
1215
1229
|
}
|
|
1216
|
-
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
1217
|
-
const mathml =
|
|
1218
|
-
const safeMathml = mathml ?
|
|
1230
|
+
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber, fontSize) {
|
|
1231
|
+
const mathml = chunkLYZQLV7R_js.convertOmmlToMathMl(equationXml);
|
|
1232
|
+
const safeMathml = mathml ? chunkLYZQLV7R_js.sanitizeMathMl(mathml) : "";
|
|
1219
1233
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1220
1234
|
"span",
|
|
1221
1235
|
{
|
|
@@ -1225,7 +1239,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1225
1239
|
},
|
|
1226
1240
|
dangerouslySetInnerHTML: { __html: safeMathml }
|
|
1227
1241
|
}
|
|
1228
|
-
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children:
|
|
1242
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children: chunkUMQV2432_js.translationsEn["pptx.textSegment.equationFallback"] });
|
|
1229
1243
|
if (equationNumber) {
|
|
1230
1244
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1231
1245
|
"span",
|
|
@@ -1234,7 +1248,8 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1234
1248
|
display: "flex",
|
|
1235
1249
|
justifyContent: "space-between",
|
|
1236
1250
|
alignItems: "center",
|
|
1237
|
-
width: "100%"
|
|
1251
|
+
width: "100%",
|
|
1252
|
+
fontSize
|
|
1238
1253
|
},
|
|
1239
1254
|
children: [
|
|
1240
1255
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: { visibility: "hidden", whiteSpace: "nowrap" }, children: [
|
|
@@ -1262,7 +1277,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1262
1277
|
`${elementId}-seg-${segmentIndex}`
|
|
1263
1278
|
);
|
|
1264
1279
|
}
|
|
1265
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: equationContent }, `${elementId}-seg-${segmentIndex}`);
|
|
1280
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: fontSize ? { fontSize } : void 0, children: equationContent }, `${elementId}-seg-${segmentIndex}`);
|
|
1266
1281
|
}
|
|
1267
1282
|
function renderHyperlink(run, spanNode, key, ctx) {
|
|
1268
1283
|
const url = run.hyperlink?.url;
|
|
@@ -1343,12 +1358,18 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1343
1358
|
const segmentIndex = run.segmentIndex ?? 0;
|
|
1344
1359
|
const key = `${element.id}-seg-${segmentIndex}${keySuffix}`;
|
|
1345
1360
|
if (run.equation) {
|
|
1346
|
-
return renderEquationSegment(
|
|
1361
|
+
return renderEquationSegment(
|
|
1362
|
+
element.id,
|
|
1363
|
+
segmentIndex,
|
|
1364
|
+
run.equation.xml,
|
|
1365
|
+
run.equation.number,
|
|
1366
|
+
typeof run.style.fontSize === "string" ? run.style.fontSize : void 0
|
|
1367
|
+
);
|
|
1347
1368
|
}
|
|
1348
1369
|
const segmentStyle = segment?.style ?? {};
|
|
1349
1370
|
const textValue = run.text;
|
|
1350
1371
|
const lines = textValue.split("\n");
|
|
1351
|
-
const resolvedSegmentColor =
|
|
1372
|
+
const resolvedSegmentColor = chunkLYZQLV7R_js.normalizeHexColor(
|
|
1352
1373
|
segmentStyle.color || element.textStyle?.color,
|
|
1353
1374
|
run.hyperlink ? HYPERLINK_COLOR : fallbackColor
|
|
1354
1375
|
);
|
|
@@ -1356,19 +1377,22 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1356
1377
|
const baselineFraction = rawBaseline === 0 ? 0 : Math.abs(rawBaseline) >= 1e3 ? rawBaseline / 1e5 : rawBaseline / 100;
|
|
1357
1378
|
const baselineFontScale = baselineFraction !== 0 ? BASELINE_FONT_SCALE : 1;
|
|
1358
1379
|
const rawFontSize = segmentStyle.fontSize || element.textStyle?.fontSize || DEFAULT_TEXT_FONT_SIZE;
|
|
1359
|
-
const baseFontSize =
|
|
1380
|
+
const baseFontSize = chunkLYZQLV7R_js.scaleFontSizeForAutoFit(
|
|
1381
|
+
rawFontSize,
|
|
1382
|
+
chunkLYZQLV7R_js.resolveAutoFitFontScale(element.textStyle)
|
|
1383
|
+
);
|
|
1360
1384
|
const baselineShift = baselineFraction !== 0 ? `${baselineFraction * baseFontSize}px` : void 0;
|
|
1361
|
-
const fontKerning =
|
|
1385
|
+
const fontKerning = chunkLYZQLV7R_js.resolveFontKerning(segmentStyle.kerning, baseFontSize);
|
|
1362
1386
|
const scriptFallbackWins = Boolean(
|
|
1363
1387
|
segmentStyle.scriptFallbackFont && segmentStyle.fontFamilyIsCascadeDefault
|
|
1364
1388
|
);
|
|
1365
1389
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
1366
|
-
const baseFontFamily = scriptFallbackWins ?
|
|
1390
|
+
const baseFontFamily = scriptFallbackWins ? chunkLYZQLV7R_js.getSubstituteFontFamily(segmentStyle.scriptFallbackFont) : rawFontFamily ? chunkLYZQLV7R_js.getSubstituteFontFamily(
|
|
1367
1391
|
rawFontFamily,
|
|
1368
|
-
|
|
1392
|
+
chunkLYZQLV7R_js.parsePanoseString(segmentStyle.latinFontPanose ?? element.textStyle?.latinFontPanose)
|
|
1369
1393
|
) : DEFAULT_FONT_FAMILY2;
|
|
1370
|
-
const scriptFonts =
|
|
1371
|
-
const needsScriptFonts =
|
|
1394
|
+
const scriptFonts = chunkLYZQLV7R_js.resolveScriptFontSet(segmentStyle, element.textStyle, baseFontFamily);
|
|
1395
|
+
const needsScriptFonts = chunkLYZQLV7R_js.hasDistinctScriptFonts(scriptFonts);
|
|
1372
1396
|
const authoredLetterSpacing = typeof segmentStyle.characterSpacing === "number" && segmentStyle.characterSpacing !== 0 ? segmentStyle.characterSpacing / 100 * (96 / 72) : 0;
|
|
1373
1397
|
const metricFont = {
|
|
1374
1398
|
fontFamily: baseFontFamily,
|
|
@@ -1376,7 +1400,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1376
1400
|
bold: Boolean(segmentStyle.bold),
|
|
1377
1401
|
italic: Boolean(segmentStyle.italic)
|
|
1378
1402
|
};
|
|
1379
|
-
const nestedStyle =
|
|
1403
|
+
const nestedStyle = chunkLYZQLV7R_js.nestedTextDecorationStyle(run.style);
|
|
1380
1404
|
const metricContext = { font: metricFont, authoredPx: authoredLetterSpacing, nestedStyle };
|
|
1381
1405
|
const spanStyle = { ...run.style };
|
|
1382
1406
|
spanStyle.color = resolvedSegmentColor;
|
|
@@ -1384,11 +1408,11 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1384
1408
|
spanStyle.fontFamily = baseFontFamily;
|
|
1385
1409
|
spanStyle.verticalAlign = baselineShift;
|
|
1386
1410
|
spanStyle.fontKerning = fontKerning;
|
|
1387
|
-
spanStyle.letterSpacing =
|
|
1411
|
+
spanStyle.letterSpacing = chunkLYZQLV7R_js.pieceLetterSpacing(
|
|
1388
1412
|
authoredLetterSpacing,
|
|
1389
|
-
|
|
1413
|
+
chunkLYZQLV7R_js.resolveMetricTrackingPx(textValue, metricFont)
|
|
1390
1414
|
);
|
|
1391
|
-
const hollow =
|
|
1415
|
+
const hollow = chunkLYZQLV7R_js.hollowTextFillStyle(segmentStyle, {
|
|
1392
1416
|
color: resolvedSegmentColor,
|
|
1393
1417
|
textStroke: typeof spanStyle.WebkitTextStroke === "string" ? spanStyle.WebkitTextStroke : void 0
|
|
1394
1418
|
});
|
|
@@ -1403,7 +1427,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1403
1427
|
const isUnderlineWords = Boolean(segmentStyle.underline) && segmentStyle.underlineStyle === "words";
|
|
1404
1428
|
const wordDecoration = isUnderlineWords ? nestedStyle ?? run.underlineWordPieces?.find((piece) => piece.style)?.style : void 0;
|
|
1405
1429
|
if (isUnderlineWords) {
|
|
1406
|
-
const stripped =
|
|
1430
|
+
const stripped = chunkLYZQLV7R_js.stripUnderlineDecoration(spanStyle);
|
|
1407
1431
|
spanStyle.textDecoration = stripped.textDecoration;
|
|
1408
1432
|
delete spanStyle.textDecorationStyle;
|
|
1409
1433
|
delete spanStyle.textDecorationThickness;
|
|
@@ -1419,7 +1443,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1419
1443
|
scriptFonts,
|
|
1420
1444
|
baseFontFamily,
|
|
1421
1445
|
findHighlights,
|
|
1422
|
-
|
|
1446
|
+
chunkLYZQLV7R_js.buildTabContext(
|
|
1423
1447
|
element.textStyle?.tabStops,
|
|
1424
1448
|
element.textStyle?.defaultTabSize,
|
|
1425
1449
|
baseFontSize,
|
|
@@ -1451,14 +1475,14 @@ function renderSeededListRun(seed, runs, segments, context) {
|
|
|
1451
1475
|
const segment = sourceRun ? segments[seed.segmentIndex] : { text: seed.text, style: seed.style };
|
|
1452
1476
|
const resolvedSegment = {
|
|
1453
1477
|
...segment,
|
|
1454
|
-
style:
|
|
1478
|
+
style: chunkLYZQLV7R_js.withInlineListDecorationDefaults(segment.style, context.element.textStyle)
|
|
1455
1479
|
};
|
|
1456
|
-
const decorationCss =
|
|
1480
|
+
const decorationCss = chunkLYZQLV7R_js.segmentStyleToCss(
|
|
1457
1481
|
resolvedSegment,
|
|
1458
|
-
|
|
1482
|
+
chunkLYZQLV7R_js.resolveAutoFitFontScale(context.element.textStyle)
|
|
1459
1483
|
);
|
|
1460
|
-
|
|
1461
|
-
const run = sourceRun ? { ...sourceRun, style: { ...sourceRun.style, ...
|
|
1484
|
+
chunkLYZQLV7R_js.applyUnderlineVariant(decorationCss, resolvedSegment);
|
|
1485
|
+
const run = sourceRun ? { ...sourceRun, style: { ...sourceRun.style, ...chunkLYZQLV7R_js.nestedTextDecorationStyle(decorationCss) } } : {
|
|
1462
1486
|
text: seed.text,
|
|
1463
1487
|
style: decorationCss,
|
|
1464
1488
|
segmentIndex: seed.segmentIndex
|
|
@@ -1473,7 +1497,7 @@ function renderSeededListRun(seed, runs, segments, context) {
|
|
|
1473
1497
|
});
|
|
1474
1498
|
}
|
|
1475
1499
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick, placeholderPrompt, inlineListSeed) {
|
|
1476
|
-
if (!
|
|
1500
|
+
if (!chunkLYZQLV7R_js.hasTextProperties(element)) {
|
|
1477
1501
|
return emptyFallback || null;
|
|
1478
1502
|
}
|
|
1479
1503
|
const segments = segmentOverrides ?? element.textSegments;
|
|
@@ -1483,7 +1507,7 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
1483
1507
|
}
|
|
1484
1508
|
return element.text || emptyFallback || "";
|
|
1485
1509
|
}
|
|
1486
|
-
const paragraphs =
|
|
1510
|
+
const paragraphs = chunkLYZQLV7R_js.buildParagraphs(
|
|
1487
1511
|
element,
|
|
1488
1512
|
fieldContext,
|
|
1489
1513
|
segmentOverrides,
|
|
@@ -1629,13 +1653,13 @@ function renderBulletMarker(para, paraIndex, elementId) {
|
|
|
1629
1653
|
);
|
|
1630
1654
|
}
|
|
1631
1655
|
function getDuotoneColors(element) {
|
|
1632
|
-
if (!
|
|
1656
|
+
if (!chunkLYZQLV7R_js.isImageLikeElement(element)) {
|
|
1633
1657
|
return void 0;
|
|
1634
1658
|
}
|
|
1635
1659
|
return element.imageEffects?.duotone;
|
|
1636
1660
|
}
|
|
1637
1661
|
function buildLineShadowCss(element) {
|
|
1638
|
-
if (!
|
|
1662
|
+
if (!chunkLYZQLV7R_js.hasShapeProperties(element)) {
|
|
1639
1663
|
return void 0;
|
|
1640
1664
|
}
|
|
1641
1665
|
const ss = element.shapeStyle;
|
|
@@ -1646,13 +1670,13 @@ function buildLineShadowCss(element) {
|
|
|
1646
1670
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
1647
1671
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
1648
1672
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
1649
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
1650
|
-
|
|
1673
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkLYZQLV7R_js.colorWithOpacity(
|
|
1674
|
+
chunkLYZQLV7R_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
1651
1675
|
opacity
|
|
1652
1676
|
)}`;
|
|
1653
1677
|
}
|
|
1654
1678
|
function buildLineGlowFilter(element) {
|
|
1655
|
-
if (!
|
|
1679
|
+
if (!chunkLYZQLV7R_js.hasShapeProperties(element)) {
|
|
1656
1680
|
return void 0;
|
|
1657
1681
|
}
|
|
1658
1682
|
const ss = element.shapeStyle;
|
|
@@ -1661,22 +1685,22 @@ function buildLineGlowFilter(element) {
|
|
|
1661
1685
|
}
|
|
1662
1686
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
1663
1687
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
1664
|
-
const glowCol =
|
|
1688
|
+
const glowCol = chunkLYZQLV7R_js.colorWithOpacity(chunkLYZQLV7R_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
1665
1689
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
1666
1690
|
}
|
|
1667
1691
|
function getDagDuotoneFilterId(elementId) {
|
|
1668
1692
|
return `dag-duotone-${elementId}`;
|
|
1669
1693
|
}
|
|
1670
1694
|
function hasDagDuotoneEffect(element) {
|
|
1671
|
-
if (!
|
|
1695
|
+
if (!chunkLYZQLV7R_js.hasShapeProperties(element)) {
|
|
1672
1696
|
return false;
|
|
1673
1697
|
}
|
|
1674
1698
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
1675
1699
|
}
|
|
1676
1700
|
function renderDagDuotoneSvgFilter(elementId, color1, color2) {
|
|
1677
1701
|
const filterId = getDagDuotoneFilterId(elementId);
|
|
1678
|
-
const c1 =
|
|
1679
|
-
const c2 =
|
|
1702
|
+
const c1 = chunkLYZQLV7R_js.hexToRgbUnit(color1);
|
|
1703
|
+
const c2 = chunkLYZQLV7R_js.hexToRgbUnit(color2);
|
|
1680
1704
|
const grayscaleMatrix = [
|
|
1681
1705
|
0.2126,
|
|
1682
1706
|
0.7152,
|
|
@@ -1720,7 +1744,7 @@ function renderDagDuotoneSvgFilter(elementId, color1, color2) {
|
|
|
1720
1744
|
|
|
1721
1745
|
// src/viewer/utils/shape-visual-3d.ts
|
|
1722
1746
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
1723
|
-
return
|
|
1747
|
+
return chunkLYZQLV7R_js.build3DExtrusionData(
|
|
1724
1748
|
shape3d,
|
|
1725
1749
|
scene3d,
|
|
1726
1750
|
fillColor,
|
|
@@ -1729,7 +1753,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
1729
1753
|
);
|
|
1730
1754
|
}
|
|
1731
1755
|
function apply3dEffects2(base, scene3d, shape3d, fillColorFallback, elementSize, elementId) {
|
|
1732
|
-
|
|
1756
|
+
chunkLYZQLV7R_js.apply3dEffects(
|
|
1733
1757
|
base,
|
|
1734
1758
|
scene3d,
|
|
1735
1759
|
shape3d,
|
|
@@ -1744,11 +1768,11 @@ function rendersCustomVectorPath(element) {
|
|
|
1744
1768
|
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;
|
|
1745
1769
|
}
|
|
1746
1770
|
function rendersWedgeCalloutVector(element) {
|
|
1747
|
-
return element.type === "shape" &&
|
|
1771
|
+
return element.type === "shape" && chunkLYZQLV7R_js.isWedgeCalloutPresetShape(element.shapeType);
|
|
1748
1772
|
}
|
|
1749
1773
|
function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _strokeColor, animatesFill, animatesStroke, parentGroupFill) {
|
|
1750
1774
|
if (element.type === "group") {
|
|
1751
|
-
const fx2 =
|
|
1775
|
+
const fx2 = chunkLYZQLV7R_js.getComputedEffectStyle(element);
|
|
1752
1776
|
const groupStyle = {};
|
|
1753
1777
|
if (fx2.filter) {
|
|
1754
1778
|
groupStyle.filter = fx2.filter;
|
|
@@ -1758,13 +1782,13 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1758
1782
|
}
|
|
1759
1783
|
return groupStyle;
|
|
1760
1784
|
}
|
|
1761
|
-
if (!
|
|
1785
|
+
if (!chunkLYZQLV7R_js.hasShapeProperties(element)) {
|
|
1762
1786
|
return {};
|
|
1763
1787
|
}
|
|
1764
1788
|
const ss = element.shapeStyle;
|
|
1765
|
-
const fill = animatesFill ? void 0 :
|
|
1766
|
-
const fx =
|
|
1767
|
-
const stroke =
|
|
1789
|
+
const fill = animatesFill ? void 0 : chunkLYZQLV7R_js.getComputedFillStyle(element, parentGroupFill);
|
|
1790
|
+
const fx = chunkLYZQLV7R_js.getComputedEffectStyle(element);
|
|
1791
|
+
const stroke = chunkLYZQLV7R_js.getComputedStrokeStyle(element);
|
|
1768
1792
|
const base = {
|
|
1769
1793
|
// A gradient fill REPLACES the solid fill, it does not sit on top of it;
|
|
1770
1794
|
// the whole precedence lives in shared's `getComputedFillStyle`.
|
|
@@ -1803,7 +1827,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1803
1827
|
};
|
|
1804
1828
|
Object.assign(
|
|
1805
1829
|
base,
|
|
1806
|
-
|
|
1830
|
+
chunkLYZQLV7R_js.getAnimationColorBaseStyle(element, {
|
|
1807
1831
|
animatesFill,
|
|
1808
1832
|
animatesStroke,
|
|
1809
1833
|
parentGroupFill
|
|
@@ -1825,7 +1849,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1825
1849
|
},
|
|
1826
1850
|
element.id
|
|
1827
1851
|
);
|
|
1828
|
-
if (rendersCustomVectorPath(element) || rendersWedgeCalloutVector(element) ||
|
|
1852
|
+
if (rendersCustomVectorPath(element) || rendersWedgeCalloutVector(element) || chunkLYZQLV7R_js.isStrokeOnlyPresetElement(element)) {
|
|
1829
1853
|
base.backgroundColor = "transparent";
|
|
1830
1854
|
base.backgroundImage = void 0;
|
|
1831
1855
|
base.borderWidth = void 0;
|
|
@@ -1839,7 +1863,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1839
1863
|
if (rendersWedgeCalloutVector(element)) {
|
|
1840
1864
|
return base;
|
|
1841
1865
|
}
|
|
1842
|
-
const geometry =
|
|
1866
|
+
const geometry = chunkLYZQLV7R_js.resolveShapeGeometry(element);
|
|
1843
1867
|
switch (geometry.kind) {
|
|
1844
1868
|
case "bare":
|
|
1845
1869
|
return { backgroundColor: "transparent", borderWidth: 0, borderStyle: "none" };
|
|
@@ -1863,7 +1887,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1863
1887
|
}
|
|
1864
1888
|
}
|
|
1865
1889
|
function getConnectorPathGeometry2(element) {
|
|
1866
|
-
return
|
|
1890
|
+
return chunkLYZQLV7R_js.getConnectorPathGeometry(element);
|
|
1867
1891
|
}
|
|
1868
1892
|
var ARROW_SIZE_SCALE = {
|
|
1869
1893
|
sm: 0.6,
|
|
@@ -1932,11 +1956,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
|
|
|
1932
1956
|
strokePaint,
|
|
1933
1957
|
strokeWidth,
|
|
1934
1958
|
dashArray,
|
|
1935
|
-
lineCap:
|
|
1959
|
+
lineCap: chunkLYZQLV7R_js.svgLineCap(shapeStyle?.lineCap),
|
|
1936
1960
|
lineJoin,
|
|
1937
1961
|
miterLimit,
|
|
1938
|
-
offsets:
|
|
1939
|
-
widths:
|
|
1962
|
+
offsets: chunkLYZQLV7R_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
1963
|
+
widths: chunkLYZQLV7R_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
|
|
1940
1964
|
};
|
|
1941
1965
|
}
|
|
1942
1966
|
function strokeStrands(d, keyBase, ctx) {
|
|
@@ -1959,12 +1983,12 @@ function strokeStrands(d, keyBase, ctx) {
|
|
|
1959
1983
|
}
|
|
1960
1984
|
function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredPaths, shapeStyle, hasFill, fillColor, fillOpacity, strokePaint, strokeWidth, dashArray, animatesFill = false, gradient) {
|
|
1961
1985
|
const ctx = strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray);
|
|
1962
|
-
const subpaths = structuredPaths && structuredPaths.length > 0 ?
|
|
1986
|
+
const subpaths = structuredPaths && structuredPaths.length > 0 ? chunkLYZQLV7R_js.customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
1963
1987
|
const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
|
|
1964
|
-
const gradientPaint = gradient ?
|
|
1988
|
+
const gradientPaint = gradient ? chunkLYZQLV7R_js.svgGradientFillRef(gradient) : void 0;
|
|
1965
1989
|
const nodes = [];
|
|
1966
1990
|
if (subpaths && needsPerSubpath) {
|
|
1967
|
-
const paints =
|
|
1991
|
+
const paints = chunkLYZQLV7R_js.buildSubpathPaints(subpaths, hasFill, fillColor, fillOpacity);
|
|
1968
1992
|
paints.forEach((paint, idx) => {
|
|
1969
1993
|
if (paint.fill !== "none") {
|
|
1970
1994
|
const mode = subpaths[idx]?.fillMode;
|
|
@@ -1993,7 +2017,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
1993
2017
|
"path",
|
|
1994
2018
|
{
|
|
1995
2019
|
d: pathData,
|
|
1996
|
-
fill: animatesFill ? "inherit" : gradientPaint ??
|
|
2020
|
+
fill: animatesFill ? "inherit" : gradientPaint ?? chunkLYZQLV7R_js.colorWithOpacity(fillColor, fillOpacity),
|
|
1997
2021
|
stroke: "none",
|
|
1998
2022
|
vectorEffect: "non-scaling-stroke"
|
|
1999
2023
|
},
|
|
@@ -2019,14 +2043,14 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2019
2043
|
);
|
|
2020
2044
|
}
|
|
2021
2045
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2022
|
-
if (!
|
|
2046
|
+
if (!chunkLYZQLV7R_js.hasShapeProperties(element)) {
|
|
2023
2047
|
return null;
|
|
2024
2048
|
}
|
|
2025
2049
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
2026
|
-
const fillPaint = animatesFill ? "inherit" :
|
|
2027
|
-
const strokePaint = animatesStroke ? "inherit" :
|
|
2028
|
-
const dashType =
|
|
2029
|
-
const dashArray =
|
|
2050
|
+
const fillPaint = animatesFill ? "inherit" : chunkLYZQLV7R_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
2051
|
+
const strokePaint = animatesStroke ? "inherit" : chunkLYZQLV7R_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
2052
|
+
const dashType = chunkLYZQLV7R_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2053
|
+
const dashArray = chunkLYZQLV7R_js.getSvgStrokeDasharray(
|
|
2030
2054
|
dashType,
|
|
2031
2055
|
Math.max(strokeWidth, 1),
|
|
2032
2056
|
element.shapeStyle?.customDashSegments
|
|
@@ -2107,13 +2131,13 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2107
2131
|
// container's `background-image` is suppressed for custom geometry, so
|
|
2108
2132
|
// without this the shape fell back to the parser's representative solid
|
|
2109
2133
|
// and lost every fade (issue #132).
|
|
2110
|
-
|
|
2134
|
+
chunkLYZQLV7R_js.buildSvgGradientDef(element.shapeStyle, element.id)
|
|
2111
2135
|
);
|
|
2112
2136
|
}
|
|
2113
|
-
if ((element.type === "image" || element.type === "picture") && strokeWidth > 0 && !
|
|
2137
|
+
if ((element.type === "image" || element.type === "picture") && strokeWidth > 0 && !chunkLYZQLV7R_js.buildStrokeOutline(element)) {
|
|
2114
2138
|
const width = Math.max(element.width, 1);
|
|
2115
2139
|
const height = Math.max(element.height, 1);
|
|
2116
|
-
const geometry =
|
|
2140
|
+
const geometry = chunkLYZQLV7R_js.getPresetShapeVectorGeometry(
|
|
2117
2141
|
element.shapeType || "rect",
|
|
2118
2142
|
width,
|
|
2119
2143
|
height,
|
|
@@ -2141,18 +2165,18 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2141
2165
|
);
|
|
2142
2166
|
}
|
|
2143
2167
|
}
|
|
2144
|
-
if (element.type === "shape" &&
|
|
2168
|
+
if (element.type === "shape" && chunkLYZQLV7R_js.isWedgeCalloutPresetShape(element.shapeType)) {
|
|
2145
2169
|
const width = Math.max(element.width, 1);
|
|
2146
2170
|
const height = Math.max(element.height, 1);
|
|
2147
|
-
const geometry =
|
|
2171
|
+
const geometry = chunkLYZQLV7R_js.getPresetShapeVectorGeometry(
|
|
2148
2172
|
element.shapeType,
|
|
2149
2173
|
width,
|
|
2150
2174
|
height,
|
|
2151
2175
|
element.shapeAdjustments
|
|
2152
2176
|
);
|
|
2153
2177
|
if (geometry) {
|
|
2154
|
-
const gradient =
|
|
2155
|
-
const gradientPaint = gradient ?
|
|
2178
|
+
const gradient = chunkLYZQLV7R_js.buildSvgGradientDef(element.shapeStyle, element.id);
|
|
2179
|
+
const gradientPaint = gradient ? chunkLYZQLV7R_js.svgGradientFillRef(gradient) : void 0;
|
|
2156
2180
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2157
2181
|
"svg",
|
|
2158
2182
|
{
|
|
@@ -2185,18 +2209,18 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2185
2209
|
);
|
|
2186
2210
|
}
|
|
2187
2211
|
}
|
|
2188
|
-
if (
|
|
2212
|
+
if (chunkLYZQLV7R_js.isCalloutShape(normalizedType)) {
|
|
2189
2213
|
const width = Math.max(element.width, 1);
|
|
2190
2214
|
const height = Math.max(element.height, 1);
|
|
2191
|
-
const geometry =
|
|
2215
|
+
const geometry = chunkLYZQLV7R_js.getCalloutLeaderLineGeometry(
|
|
2192
2216
|
normalizedType,
|
|
2193
2217
|
width,
|
|
2194
2218
|
height,
|
|
2195
2219
|
element.shapeAdjustments
|
|
2196
2220
|
);
|
|
2197
2221
|
if (geometry && geometry.points.length >= 2) {
|
|
2198
|
-
const leaderPath =
|
|
2199
|
-
const bounds =
|
|
2222
|
+
const leaderPath = chunkLYZQLV7R_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
2223
|
+
const bounds = chunkLYZQLV7R_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
2200
2224
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
2201
2225
|
const offsetLeft = bounds.minX;
|
|
2202
2226
|
const offsetTop = bounds.minY;
|
|
@@ -2259,10 +2283,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2259
2283
|
const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
|
|
2260
2284
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
2261
2285
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
2262
|
-
const connectorLineCap =
|
|
2286
|
+
const connectorLineCap = chunkLYZQLV7R_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
2263
2287
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
2264
|
-
const offsets =
|
|
2265
|
-
const widths =
|
|
2288
|
+
const offsets = chunkLYZQLV7R_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
2289
|
+
const widths = chunkLYZQLV7R_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
2266
2290
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2267
2291
|
"svg",
|
|
2268
2292
|
{
|
|
@@ -2329,15 +2353,15 @@ function parseGradientFillCss(gradFill) {
|
|
|
2329
2353
|
}
|
|
2330
2354
|
const rawStops = stops.map((gs) => {
|
|
2331
2355
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
2332
|
-
const color =
|
|
2333
|
-
const opacity =
|
|
2356
|
+
const color = chunkLYZQLV7R_js.parseDrawingColor(gs) ?? "#888888";
|
|
2357
|
+
const opacity = chunkLYZQLV7R_js.parseDrawingColorOpacity(gs);
|
|
2334
2358
|
return { position: pos, color, opacity };
|
|
2335
2359
|
}).sort((a, b) => a.position - b.position);
|
|
2336
|
-
const stopStrings = rawStops.map((s) => `${
|
|
2360
|
+
const stopStrings = rawStops.map((s) => `${chunkLYZQLV7R_js.colorWithOpacity(s.color, s.opacity)} ${s.position.toFixed(1)}%`).join(", ");
|
|
2337
2361
|
const lin = gradFill["a:lin"];
|
|
2338
2362
|
if (lin) {
|
|
2339
2363
|
const angRaw = Number.parseInt(String(lin["@_ang"] || "0"), 10);
|
|
2340
|
-
const angleDeg = Math.round(
|
|
2364
|
+
const angleDeg = Math.round(chunkLYZQLV7R_js.ooxmlGradientAngleToCssDegrees(angRaw / 6e4));
|
|
2341
2365
|
return `linear-gradient(${angleDeg}deg, ${stopStrings})`;
|
|
2342
2366
|
}
|
|
2343
2367
|
const path = gradFill["a:path"];
|
|
@@ -2351,7 +2375,7 @@ function parseGradientFillCss(gradFill) {
|
|
|
2351
2375
|
b: Number.parseInt(String(fillToRectXml["@_b"] || "0"), 10) / 1e5
|
|
2352
2376
|
} : void 0;
|
|
2353
2377
|
if (pathType === "rect") {
|
|
2354
|
-
return
|
|
2378
|
+
return chunkLYZQLV7R_js.buildRectPathGradient(rawStops, void 0, fillToRect);
|
|
2355
2379
|
}
|
|
2356
2380
|
let cx = 50;
|
|
2357
2381
|
let cy = 50;
|
|
@@ -2373,8 +2397,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
2373
2397
|
if (!pattFill) {
|
|
2374
2398
|
return void 0;
|
|
2375
2399
|
}
|
|
2376
|
-
const fgColor =
|
|
2377
|
-
const bgColor =
|
|
2400
|
+
const fgColor = chunkLYZQLV7R_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
2401
|
+
const bgColor = chunkLYZQLV7R_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
2378
2402
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
2379
2403
|
switch (preset) {
|
|
2380
2404
|
case "ltHorz":
|
|
@@ -2485,11 +2509,11 @@ function parseCellBorders(cellProperties) {
|
|
|
2485
2509
|
const prstDash = ln["a:prstDash"];
|
|
2486
2510
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
2487
2511
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
2488
|
-
const color =
|
|
2512
|
+
const color = chunkLYZQLV7R_js.parseDrawingColor(ln["a:solidFill"]);
|
|
2489
2513
|
if (color) {
|
|
2490
|
-
const opacity =
|
|
2514
|
+
const opacity = chunkLYZQLV7R_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
2491
2515
|
const key = `${edge.prefix}`;
|
|
2492
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
2516
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkLYZQLV7R_js.colorWithOpacity(color, opacity)}`;
|
|
2493
2517
|
}
|
|
2494
2518
|
}
|
|
2495
2519
|
return borderStyle;
|
|
@@ -2502,7 +2526,7 @@ function parseCellTextEffects(runProps) {
|
|
|
2502
2526
|
const textShadowParts = [];
|
|
2503
2527
|
const outerShdw = effectLst["a:outerShdw"];
|
|
2504
2528
|
if (outerShdw) {
|
|
2505
|
-
const shdwColor =
|
|
2529
|
+
const shdwColor = chunkLYZQLV7R_js.parseDrawingColor(outerShdw);
|
|
2506
2530
|
if (shdwColor) {
|
|
2507
2531
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
2508
2532
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -2520,7 +2544,7 @@ function parseCellTextEffects(runProps) {
|
|
|
2520
2544
|
}
|
|
2521
2545
|
const glow = effectLst["a:glow"];
|
|
2522
2546
|
if (glow) {
|
|
2523
|
-
const glowColor =
|
|
2547
|
+
const glowColor = chunkLYZQLV7R_js.parseDrawingColor(glow);
|
|
2524
2548
|
if (glowColor) {
|
|
2525
2549
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
2526
2550
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -2542,11 +2566,11 @@ function extractCellText(cellXml) {
|
|
|
2542
2566
|
const textParts = [];
|
|
2543
2567
|
const runs = ensureArrayValue(paragraph["a:r"]);
|
|
2544
2568
|
runs.forEach((run) => {
|
|
2545
|
-
textParts.push(
|
|
2569
|
+
textParts.push(chunkLYZQLV7R_js.xmlText(run["a:t"]) ?? "");
|
|
2546
2570
|
});
|
|
2547
2571
|
const fields = ensureArrayValue(paragraph["a:fld"]);
|
|
2548
2572
|
fields.forEach((field) => {
|
|
2549
|
-
textParts.push(
|
|
2573
|
+
textParts.push(chunkLYZQLV7R_js.xmlText(field["a:t"]) ?? "");
|
|
2550
2574
|
});
|
|
2551
2575
|
paragraphTexts.push(textParts.join(""));
|
|
2552
2576
|
});
|
|
@@ -2590,10 +2614,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2590
2614
|
if (runProps?.["@_u"] !== void 0) {
|
|
2591
2615
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
2592
2616
|
}
|
|
2593
|
-
const runColor =
|
|
2617
|
+
const runColor = chunkLYZQLV7R_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkLYZQLV7R_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
2594
2618
|
if (runColor) {
|
|
2595
|
-
const opacity =
|
|
2596
|
-
cellStyle.color =
|
|
2619
|
+
const opacity = chunkLYZQLV7R_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
2620
|
+
cellStyle.color = chunkLYZQLV7R_js.colorWithOpacity(runColor, opacity);
|
|
2597
2621
|
}
|
|
2598
2622
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
2599
2623
|
if (fontFamily) {
|
|
@@ -2603,15 +2627,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2603
2627
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
2604
2628
|
}
|
|
2605
2629
|
const cellProperties = cellXml["a:tcPr"];
|
|
2606
|
-
const cellFill =
|
|
2630
|
+
const cellFill = chunkLYZQLV7R_js.parseDrawingColor(
|
|
2607
2631
|
cellProperties?.["a:solidFill"],
|
|
2608
2632
|
schemeColorOverrides
|
|
2609
2633
|
);
|
|
2610
2634
|
if (cellFill) {
|
|
2611
|
-
const opacity =
|
|
2635
|
+
const opacity = chunkLYZQLV7R_js.parseDrawingColorOpacity(
|
|
2612
2636
|
cellProperties?.["a:solidFill"]
|
|
2613
2637
|
);
|
|
2614
|
-
cellStyle.backgroundColor =
|
|
2638
|
+
cellStyle.backgroundColor = chunkLYZQLV7R_js.colorWithOpacity(cellFill, opacity);
|
|
2615
2639
|
} else {
|
|
2616
2640
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
2617
2641
|
if (gradCss) {
|
|
@@ -2626,16 +2650,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2626
2650
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
2627
2651
|
Object.assign(cellStyle, edgeBorders);
|
|
2628
2652
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
2629
|
-
const borderColor =
|
|
2653
|
+
const borderColor = chunkLYZQLV7R_js.parseDrawingColor(
|
|
2630
2654
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
2631
2655
|
schemeColorOverrides
|
|
2632
|
-
) ||
|
|
2656
|
+
) || chunkLYZQLV7R_js.parseDrawingColor(
|
|
2633
2657
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
2634
2658
|
schemeColorOverrides
|
|
2635
|
-
) ||
|
|
2659
|
+
) || chunkLYZQLV7R_js.parseDrawingColor(
|
|
2636
2660
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
2637
2661
|
schemeColorOverrides
|
|
2638
|
-
) ||
|
|
2662
|
+
) || chunkLYZQLV7R_js.parseDrawingColor(
|
|
2639
2663
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
2640
2664
|
schemeColorOverrides
|
|
2641
2665
|
);
|
|
@@ -2707,7 +2731,7 @@ function getTableCellBandStyle2(element, rowIndex, cellIndex, rowCount, columnCo
|
|
|
2707
2731
|
if (element.type !== "table") {
|
|
2708
2732
|
return void 0;
|
|
2709
2733
|
}
|
|
2710
|
-
return
|
|
2734
|
+
return chunkLYZQLV7R_js.getTableCellBandStyle(element.tableData, rowIndex, cellIndex, rowCount, columnCount, {
|
|
2711
2735
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
2712
2736
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
2713
2737
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -2787,7 +2811,7 @@ function renderTableCellContent(cell, fallbackText) {
|
|
|
2787
2811
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2788
2812
|
"span",
|
|
2789
2813
|
{
|
|
2790
|
-
style: { position: "relative", ...
|
|
2814
|
+
style: { position: "relative", ...chunkLYZQLV7R_js.cellRunStyle(run) },
|
|
2791
2815
|
children: run.text
|
|
2792
2816
|
},
|
|
2793
2817
|
`r-${index}`
|
|
@@ -2795,7 +2819,7 @@ function renderTableCellContent(cell, fallbackText) {
|
|
|
2795
2819
|
});
|
|
2796
2820
|
}
|
|
2797
2821
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
2798
|
-
return
|
|
2822
|
+
return chunkLYZQLV7R_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
2799
2823
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
2800
2824
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
2801
2825
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -2928,7 +2952,7 @@ function TableResizeOverlay({
|
|
|
2928
2952
|
const containerRef = React7.useRef(null);
|
|
2929
2953
|
const [rowBounds, setRowBounds] = React7.useState([]);
|
|
2930
2954
|
const dragRef = React7.useRef(null);
|
|
2931
|
-
const colBoundaries = React7.useMemo(() =>
|
|
2955
|
+
const colBoundaries = React7.useMemo(() => chunkLYZQLV7R_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
2932
2956
|
const measureRows = React7.useCallback(() => {
|
|
2933
2957
|
const container = containerRef.current;
|
|
2934
2958
|
if (!container) {
|
|
@@ -2975,11 +2999,11 @@ function TableResizeOverlay({
|
|
|
2975
2999
|
const rect = containerRef.current.getBoundingClientRect();
|
|
2976
3000
|
if (e.clientX !== drag.startPos && drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
2977
3001
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
2978
|
-
onResizeColumns(
|
|
3002
|
+
onResizeColumns(chunkLYZQLV7R_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
2979
3003
|
} else if (e.clientY !== drag.startPos && drag.type === "row" && onResizeRow) {
|
|
2980
3004
|
const deltaY = e.clientY - drag.startPos;
|
|
2981
|
-
const newHeight =
|
|
2982
|
-
drag.initialRowHeight ??
|
|
3005
|
+
const newHeight = chunkLYZQLV7R_js.computeResizedRowHeight(
|
|
3006
|
+
drag.initialRowHeight ?? chunkLYZQLV7R_js.DEFAULT_ROW_HEIGHT,
|
|
2983
3007
|
deltaY
|
|
2984
3008
|
);
|
|
2985
3009
|
onResizeRow(drag.index, newHeight);
|
|
@@ -3017,7 +3041,7 @@ function TableResizeOverlay({
|
|
|
3017
3041
|
e.stopPropagation();
|
|
3018
3042
|
const table = containerRef.current?.querySelector("table");
|
|
3019
3043
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
3020
|
-
const actualHeight = tr?.offsetHeight ??
|
|
3044
|
+
const actualHeight = tr?.offsetHeight ?? chunkLYZQLV7R_js.DEFAULT_ROW_HEIGHT;
|
|
3021
3045
|
document.body.style.cursor = "row-resize";
|
|
3022
3046
|
document.body.style.userSelect = "none";
|
|
3023
3047
|
dragRef.current = {
|
|
@@ -3057,14 +3081,14 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3057
3081
|
const rowCount = tableData.rows.length;
|
|
3058
3082
|
const columnCount = tableData.columnWidths.length;
|
|
3059
3083
|
const selectedCell = options?.selectedCell || null;
|
|
3060
|
-
const isEditable = Boolean(options?.editable) &&
|
|
3084
|
+
const isEditable = Boolean(options?.editable) && chunkLYZQLV7R_js.canDrillDown(element);
|
|
3061
3085
|
const hasCellSelectionHandler = typeof options?.onSelectCell === "function";
|
|
3062
3086
|
const sharedCtx = {
|
|
3063
3087
|
tableStyleMap: options?.styleCtx?.tableStyleMap,
|
|
3064
3088
|
colorScheme: options?.styleCtx?.theme?.colorScheme,
|
|
3065
3089
|
fontScheme: options?.styleCtx?.theme?.fontScheme
|
|
3066
3090
|
};
|
|
3067
|
-
const cellCss = (cell, rowIndex, cellIndex) =>
|
|
3091
|
+
const cellCss = (cell, rowIndex, cellIndex) => chunkLYZQLV7R_js.tableCellCss(
|
|
3068
3092
|
tableData,
|
|
3069
3093
|
cell,
|
|
3070
3094
|
{ rowIndex, cellIndex, rowCount, columnCount },
|
|
@@ -3077,7 +3101,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3077
3101
|
}
|
|
3078
3102
|
const first = selectedCell.selectedCells[0];
|
|
3079
3103
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
3080
|
-
return
|
|
3104
|
+
return chunkLYZQLV7R_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
3081
3105
|
})();
|
|
3082
3106
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3083
3107
|
TableResizeOverlay,
|
|
@@ -3098,9 +3122,9 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3098
3122
|
{
|
|
3099
3123
|
className: "w-full h-full border-collapse table-fixed",
|
|
3100
3124
|
style: {
|
|
3101
|
-
fontFamily:
|
|
3125
|
+
fontFamily: chunkLYZQLV7R_js.DEFAULT_FONT_FAMILY,
|
|
3102
3126
|
// `a:tblPr@rtl` mirrors the column order for RTL decks.
|
|
3103
|
-
...
|
|
3127
|
+
...chunkLYZQLV7R_js.tableContainerCss(tableData)
|
|
3104
3128
|
},
|
|
3105
3129
|
children: [
|
|
3106
3130
|
tableData.columnWidths.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: tableData.columnWidths.map((w, ci) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3119,7 +3143,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3119
3143
|
return null;
|
|
3120
3144
|
}
|
|
3121
3145
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
3122
|
-
const isInMultiSelection =
|
|
3146
|
+
const isInMultiSelection = chunkLYZQLV7R_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
3123
3147
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
3124
3148
|
const diag = getCellDiagonalBorders2(
|
|
3125
3149
|
cell.style,
|
|
@@ -3148,7 +3172,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3148
3172
|
}
|
|
3149
3173
|
event.stopPropagation();
|
|
3150
3174
|
if (event.shiftKey && selectedCell) {
|
|
3151
|
-
const rect =
|
|
3175
|
+
const rect = chunkLYZQLV7R_js.computeSelectionRect(
|
|
3152
3176
|
selectedCell.rowIndex,
|
|
3153
3177
|
selectedCell.columnIndex,
|
|
3154
3178
|
rowIndex,
|
|
@@ -3158,7 +3182,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3158
3182
|
options?.onSelectCell?.({
|
|
3159
3183
|
rowIndex: selectedCell.rowIndex,
|
|
3160
3184
|
columnIndex: selectedCell.columnIndex,
|
|
3161
|
-
selectedCells:
|
|
3185
|
+
selectedCells: chunkLYZQLV7R_js.rectToCells(rect)
|
|
3162
3186
|
});
|
|
3163
3187
|
} else {
|
|
3164
3188
|
options?.onSelectCell?.({
|
|
@@ -3219,10 +3243,10 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3219
3243
|
if (tableEl2.tableData && tableEl2.tableData.rows.length > 0) {
|
|
3220
3244
|
return renderTableFromTableData(tableEl2, textStyle, options);
|
|
3221
3245
|
}
|
|
3222
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
3246
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkUMQV2432_js.translationsEn["pptx.table.title"] });
|
|
3223
3247
|
}
|
|
3224
3248
|
const selectedCell = options?.selectedCell || null;
|
|
3225
|
-
const isEditable = Boolean(options?.editable) &&
|
|
3249
|
+
const isEditable = Boolean(options?.editable) && chunkLYZQLV7R_js.canDrillDown(element);
|
|
3226
3250
|
const hasCellSelectionHandler = typeof options?.onSelectCell === "function";
|
|
3227
3251
|
const tableEl = element;
|
|
3228
3252
|
const xmlSelectionRect = (() => {
|
|
@@ -3234,7 +3258,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3234
3258
|
}
|
|
3235
3259
|
const first = selectedCell.selectedCells[0];
|
|
3236
3260
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
3237
|
-
return
|
|
3261
|
+
return chunkLYZQLV7R_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
3238
3262
|
})();
|
|
3239
3263
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
3240
3264
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3256,9 +3280,9 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3256
3280
|
{
|
|
3257
3281
|
className: "w-full h-full border-collapse table-fixed",
|
|
3258
3282
|
style: {
|
|
3259
|
-
fontFamily:
|
|
3283
|
+
fontFamily: chunkLYZQLV7R_js.DEFAULT_FONT_FAMILY,
|
|
3260
3284
|
// `a:tblPr@rtl` mirrors the column order for RTL decks.
|
|
3261
|
-
...
|
|
3285
|
+
...chunkLYZQLV7R_js.tableContainerCss(tableEl.tableData)
|
|
3262
3286
|
},
|
|
3263
3287
|
children: [
|
|
3264
3288
|
parsedTable.columnPercentages.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: parsedTable.columnPercentages.map((percentage, columnIndex) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3315,7 +3339,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3315
3339
|
color: textStyle.color,
|
|
3316
3340
|
...bandStyle,
|
|
3317
3341
|
...xmlCellStyle,
|
|
3318
|
-
...tdCellOverride ?
|
|
3342
|
+
...tdCellOverride ? chunkLYZQLV7R_js.cellStyleToCss(tdCellOverride) : void 0,
|
|
3319
3343
|
...diag ? { position: "relative" } : void 0
|
|
3320
3344
|
};
|
|
3321
3345
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3325,7 +3349,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3325
3349
|
"border px-1 py-0.5 align-top",
|
|
3326
3350
|
isEditable && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
3327
3351
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
3328
|
-
|
|
3352
|
+
chunkLYZQLV7R_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
3329
3353
|
),
|
|
3330
3354
|
colSpan,
|
|
3331
3355
|
rowSpan: rSpan,
|
|
@@ -3336,7 +3360,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3336
3360
|
}
|
|
3337
3361
|
event.stopPropagation();
|
|
3338
3362
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
3339
|
-
const rect =
|
|
3363
|
+
const rect = chunkLYZQLV7R_js.computeSelectionRect(
|
|
3340
3364
|
selectedCell.rowIndex,
|
|
3341
3365
|
selectedCell.columnIndex,
|
|
3342
3366
|
rowIndex,
|
|
@@ -3346,7 +3370,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3346
3370
|
options?.onSelectCell?.({
|
|
3347
3371
|
rowIndex: selectedCell.rowIndex,
|
|
3348
3372
|
columnIndex: selectedCell.columnIndex,
|
|
3349
|
-
selectedCells:
|
|
3373
|
+
selectedCells: chunkLYZQLV7R_js.rectToCells(rect)
|
|
3350
3374
|
});
|
|
3351
3375
|
} else {
|
|
3352
3376
|
options?.onSelectCell?.({
|
|
@@ -3405,23 +3429,23 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3405
3429
|
);
|
|
3406
3430
|
}
|
|
3407
3431
|
function partAttrs(part) {
|
|
3408
|
-
return part ?
|
|
3432
|
+
return part ? chunkLYZQLV7R_js.chartPartToAttrs(part) : void 0;
|
|
3409
3433
|
}
|
|
3410
3434
|
function resolveReactPalette(chartData) {
|
|
3411
3435
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
3412
3436
|
return chartData.colorPalette;
|
|
3413
3437
|
}
|
|
3414
|
-
return [...
|
|
3438
|
+
return [...chunkLYZQLV7R_js.getChartStylePalette(chartData.style?.styleId)];
|
|
3415
3439
|
}
|
|
3416
3440
|
function buildReactChartViewModel(element) {
|
|
3417
3441
|
if (element.type !== "chart" || !element.chartData) {
|
|
3418
|
-
return
|
|
3442
|
+
return chunkLYZQLV7R_js.buildChartViewModel(element);
|
|
3419
3443
|
}
|
|
3420
3444
|
const palette = resolveReactPalette(element.chartData), themedElement = {
|
|
3421
3445
|
...element,
|
|
3422
3446
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
3423
3447
|
};
|
|
3424
|
-
return
|
|
3448
|
+
return chunkLYZQLV7R_js.buildChartViewModel(themedElement);
|
|
3425
3449
|
}
|
|
3426
3450
|
function renderPrimitive(prim, key) {
|
|
3427
3451
|
switch (prim.kind) {
|
|
@@ -3573,7 +3597,7 @@ function renderText(t, key) {
|
|
|
3573
3597
|
);
|
|
3574
3598
|
}
|
|
3575
3599
|
function renderChartViewModel(elementId, vm, preserveAspectRatio = "none") {
|
|
3576
|
-
const legendItems =
|
|
3600
|
+
const legendItems = chunkLYZQLV7R_js.computeChartLegendLayout(vm);
|
|
3577
3601
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3578
3602
|
"svg",
|
|
3579
3603
|
{
|
|
@@ -3713,17 +3737,17 @@ function renderChartViewModel(elementId, vm, preserveAspectRatio = "none") {
|
|
|
3713
3737
|
}
|
|
3714
3738
|
function renderChartElement(element) {
|
|
3715
3739
|
if (element.type !== "chart") {
|
|
3716
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
3740
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkUMQV2432_js.translationsEn["pptx.chart.heading"] });
|
|
3717
3741
|
}
|
|
3718
3742
|
const chartData = element.chartData;
|
|
3719
3743
|
if (!chartData || chartData.series.length === 0) {
|
|
3720
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
3744
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkUMQV2432_js.translationsEn["pptx.chart.heading"] });
|
|
3721
3745
|
}
|
|
3722
|
-
const kind =
|
|
3746
|
+
const kind = chunkLYZQLV7R_js.resolveChartKind(chartData.chartType ?? "bar");
|
|
3723
3747
|
return renderChartViewModel(
|
|
3724
3748
|
element.id,
|
|
3725
3749
|
buildReactChartViewModel(element),
|
|
3726
|
-
|
|
3750
|
+
chunkLYZQLV7R_js.chartPreserveAspectRatio(kind)
|
|
3727
3751
|
);
|
|
3728
3752
|
}
|
|
3729
3753
|
|
|
@@ -3743,14 +3767,14 @@ function buildNotesPdf(pages) {
|
|
|
3743
3767
|
notes: page.notes,
|
|
3744
3768
|
slideNumber: page.slideNumber
|
|
3745
3769
|
}));
|
|
3746
|
-
const bytes =
|
|
3770
|
+
const bytes = chunkLYZQLV7R_js.buildNotesPdfBytes(images, meta);
|
|
3747
3771
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
3748
3772
|
return URL.createObjectURL(blob);
|
|
3749
3773
|
}
|
|
3750
3774
|
|
|
3751
3775
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
3752
3776
|
function buildPdfFromTiledImageData(pages) {
|
|
3753
|
-
const bytes =
|
|
3777
|
+
const bytes = chunkLYZQLV7R_js.buildTiledSlidesPdfBytes(pages);
|
|
3754
3778
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
3755
3779
|
return URL.createObjectURL(blob);
|
|
3756
3780
|
}
|
|
@@ -3759,7 +3783,7 @@ function buildPdfFromTiledImageData(pages) {
|
|
|
3759
3783
|
var activePreview = null;
|
|
3760
3784
|
function startPreviewAnimation(elementId, preset, options) {
|
|
3761
3785
|
stopPreviewAnimation();
|
|
3762
|
-
const descriptor =
|
|
3786
|
+
const descriptor = chunkLYZQLV7R_js.buildPreviewAnimation(preset, options);
|
|
3763
3787
|
if (!descriptor) {
|
|
3764
3788
|
return;
|
|
3765
3789
|
}
|
|
@@ -3772,7 +3796,7 @@ function startMotionPathPreview(elementId, path, options) {
|
|
|
3772
3796
|
return;
|
|
3773
3797
|
}
|
|
3774
3798
|
const stage = domEl.offsetParent;
|
|
3775
|
-
const descriptor =
|
|
3799
|
+
const descriptor = chunkLYZQLV7R_js.buildMotionPathPreview({
|
|
3776
3800
|
path,
|
|
3777
3801
|
slideWidth: stage?.offsetWidth || DEFAULT_PREVIEW_SLIDE_WIDTH,
|
|
3778
3802
|
slideHeight: stage?.offsetHeight || DEFAULT_PREVIEW_SLIDE_HEIGHT,
|