pptx-react-viewer 4.8.0 → 4.10.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 +139 -0
- package/dist/{AiChatPanel-4LMJIJUU.js → AiChatPanel-RBQFM6JK.js} +28 -28
- package/dist/AiChatPanel-RBQFM6JK.js.br +0 -0
- package/dist/AiChatPanel-RBQFM6JK.js.gz +0 -0
- package/dist/{AiChatPanel-XWYLYN26.mjs → AiChatPanel-SIEMT43N.mjs} +4 -4
- package/dist/AiChatPanel-SIEMT43N.mjs.br +0 -0
- package/dist/AiChatPanel-SIEMT43N.mjs.gz +0 -0
- package/dist/{Model3DScene-N6IZ7Q57.mjs → Model3DScene-HZ7SOUFQ.mjs} +1 -1
- package/dist/{Model3DScene-N6IZ7Q57.mjs.br → Model3DScene-HZ7SOUFQ.mjs.br} +0 -0
- package/dist/Model3DScene-HZ7SOUFQ.mjs.gz +0 -0
- package/dist/{Model3DScene-YAPQ5BCI.js → Model3DScene-ITAVIIVY.js} +2 -2
- package/dist/Model3DScene-ITAVIIVY.js.br +0 -0
- package/dist/Model3DScene-ITAVIIVY.js.gz +0 -0
- package/dist/{chunk-KHEJXP4I.mjs → chunk-3UZYGG6W.mjs} +2547 -1856
- package/dist/chunk-3UZYGG6W.mjs.br +0 -0
- package/dist/chunk-3UZYGG6W.mjs.gz +0 -0
- package/dist/{chunk-SOMUGI3Y.mjs → chunk-A5A6B2PA.mjs} +18 -14
- package/dist/chunk-A5A6B2PA.mjs.br +0 -0
- package/dist/chunk-A5A6B2PA.mjs.gz +0 -0
- package/dist/{chunk-YF2BQIW3.js → chunk-E5565MDK.js} +11989 -4273
- package/dist/chunk-E5565MDK.js.br +0 -0
- package/dist/chunk-E5565MDK.js.gz +0 -0
- package/dist/{chunk-YPDPSXPK.mjs → chunk-HDH4KFDK.mjs} +259 -0
- package/dist/chunk-HDH4KFDK.mjs.br +0 -0
- package/dist/chunk-HDH4KFDK.mjs.gz +0 -0
- package/dist/{chunk-LTBTG2QB.js → chunk-KPKO2ELT.js} +259 -0
- package/dist/chunk-KPKO2ELT.js.br +0 -0
- package/dist/chunk-KPKO2ELT.js.gz +0 -0
- package/dist/{chunk-SSXGPYBF.mjs → chunk-LMJU46E5.mjs} +34 -16
- package/dist/chunk-LMJU46E5.mjs.br +0 -0
- package/dist/chunk-LMJU46E5.mjs.gz +0 -0
- package/dist/{chunk-SAYZSUNQ.js → chunk-NTMJSTXL.js} +221 -203
- package/dist/chunk-NTMJSTXL.js.br +0 -0
- package/dist/chunk-NTMJSTXL.js.gz +0 -0
- package/dist/{chunk-UTP22QYH.js → chunk-PPDIZ3XP.js} +5 -5
- package/dist/chunk-PPDIZ3XP.js.br +0 -0
- package/dist/chunk-PPDIZ3XP.js.gz +0 -0
- package/dist/{chunk-Q4XJSJYI.mjs → chunk-WM33FDLD.mjs} +1 -1
- package/dist/chunk-WM33FDLD.mjs.br +0 -0
- package/dist/chunk-WM33FDLD.mjs.gz +0 -0
- package/dist/{chunk-NPZOVIHG.mjs → chunk-ZBFDEYLQ.mjs} +11968 -4273
- package/dist/chunk-ZBFDEYLQ.mjs.br +0 -0
- package/dist/chunk-ZBFDEYLQ.mjs.gz +0 -0
- package/dist/{chunk-NV2H57Q4.js → chunk-ZEQVK2FT.js} +4565 -3874
- package/dist/chunk-ZEQVK2FT.js.br +0 -0
- package/dist/chunk-ZEQVK2FT.js.gz +0 -0
- package/dist/{chunk-Q7NWWIPQ.js → chunk-ZI57KREY.js} +830 -826
- package/dist/chunk-ZI57KREY.js.br +0 -0
- package/dist/chunk-ZI57KREY.js.gz +0 -0
- package/dist/i18n/de.cjs +276 -9
- package/dist/i18n/de.cjs.br +0 -0
- package/dist/i18n/de.cjs.gz +0 -0
- package/dist/i18n/de.mjs +276 -9
- package/dist/i18n/de.mjs.br +0 -0
- package/dist/i18n/de.mjs.gz +0 -0
- package/dist/i18n/es.cjs +276 -9
- package/dist/i18n/es.cjs.br +0 -0
- package/dist/i18n/es.cjs.gz +0 -0
- package/dist/i18n/es.mjs +276 -9
- package/dist/i18n/es.mjs.br +0 -0
- package/dist/i18n/es.mjs.gz +0 -0
- package/dist/i18n/fr.cjs +276 -9
- package/dist/i18n/fr.cjs.br +0 -0
- package/dist/i18n/fr.cjs.gz +0 -0
- package/dist/i18n/fr.mjs +276 -9
- package/dist/i18n/fr.mjs.br +0 -0
- package/dist/i18n/fr.mjs.gz +0 -0
- package/dist/i18n/zh-CN.cjs +279 -12
- package/dist/i18n/zh-CN.cjs.br +0 -0
- package/dist/i18n/zh-CN.cjs.gz +0 -0
- package/dist/i18n/zh-CN.mjs +279 -12
- 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 +683 -23
- package/dist/index.js +63 -63
- 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 +677 -14
- 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 +677 -23
- 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 +4 -3
- package/dist/AiChatPanel-4LMJIJUU.js.br +0 -0
- package/dist/AiChatPanel-4LMJIJUU.js.gz +0 -0
- package/dist/AiChatPanel-XWYLYN26.mjs.br +0 -0
- package/dist/AiChatPanel-XWYLYN26.mjs.gz +0 -0
- package/dist/Model3DScene-N6IZ7Q57.mjs.gz +0 -0
- package/dist/Model3DScene-YAPQ5BCI.js.br +0 -0
- package/dist/Model3DScene-YAPQ5BCI.js.gz +0 -0
- package/dist/chunk-KHEJXP4I.mjs.br +0 -0
- package/dist/chunk-KHEJXP4I.mjs.gz +0 -0
- package/dist/chunk-LTBTG2QB.js.br +0 -0
- package/dist/chunk-LTBTG2QB.js.gz +0 -0
- package/dist/chunk-NPZOVIHG.mjs.br +0 -0
- package/dist/chunk-NPZOVIHG.mjs.gz +0 -0
- package/dist/chunk-NV2H57Q4.js.br +0 -0
- package/dist/chunk-NV2H57Q4.js.gz +0 -0
- package/dist/chunk-Q4XJSJYI.mjs.br +0 -0
- package/dist/chunk-Q4XJSJYI.mjs.gz +0 -0
- package/dist/chunk-Q7NWWIPQ.js.br +0 -0
- package/dist/chunk-Q7NWWIPQ.js.gz +0 -0
- package/dist/chunk-SAYZSUNQ.js.br +0 -0
- package/dist/chunk-SAYZSUNQ.js.gz +0 -0
- package/dist/chunk-SOMUGI3Y.mjs.br +0 -0
- package/dist/chunk-SOMUGI3Y.mjs.gz +0 -0
- package/dist/chunk-SSXGPYBF.mjs.br +0 -0
- package/dist/chunk-SSXGPYBF.mjs.gz +0 -0
- package/dist/chunk-UTP22QYH.js.br +0 -0
- package/dist/chunk-UTP22QYH.js.gz +0 -0
- package/dist/chunk-YF2BQIW3.js.br +0 -0
- package/dist/chunk-YF2BQIW3.js.gz +0 -0
- package/dist/chunk-YPDPSXPK.mjs.br +0 -0
- package/dist/chunk-YPDPSXPK.mjs.gz +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkE5565MDK_js = require('./chunk-E5565MDK.js');
|
|
4
|
+
var chunkKPKO2ELT_js = require('./chunk-KPKO2ELT.js');
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var tailwindMerge = require('tailwind-merge');
|
|
7
7
|
var React8 = require('react');
|
|
@@ -15,7 +15,7 @@ var React8__default = /*#__PURE__*/_interopDefault(React8);
|
|
|
15
15
|
|
|
16
16
|
// src/viewer/utils/animation-effects.ts
|
|
17
17
|
function getAnimationInitialStyle2(preset, nativeAnimation) {
|
|
18
|
-
return
|
|
18
|
+
return chunkE5565MDK_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 chunkE5565MDK_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 = chunkE5565MDK_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 = chunkE5565MDK_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 = chunkE5565MDK_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 (!chunkE5565MDK_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 (!chunkE5565MDK_js.hasShapeProperties(element)) {
|
|
236
236
|
return void 0;
|
|
237
237
|
}
|
|
238
|
-
const geometry =
|
|
238
|
+
const geometry = chunkE5565MDK_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 = chunkE5565MDK_js.getImageFitStyle(element);
|
|
246
|
+
const counterTransform = chunkE5565MDK_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 = chunkE5565MDK_js.hasShapeProperties(element) ? chunkE5565MDK_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 (!chunkE5565MDK_js.isImageLikeElement(element)) {
|
|
279
279
|
return void 0;
|
|
280
280
|
}
|
|
281
|
-
return
|
|
281
|
+
return chunkE5565MDK_js.getCropShapeClipPath(element.cropShape, element.width, element.height);
|
|
282
282
|
}
|
|
283
283
|
function getImageTilingStyle2(element, nativeSize) {
|
|
284
|
-
return
|
|
284
|
+
return chunkE5565MDK_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" } : chunkE5565MDK_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] = React8.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 } = chunkE5565MDK_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 chunkE5565MDK_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 (chunkE5565MDK_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
|
+
chunkE5565MDK_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 : chunkKPKO2ELT_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
|
+
...{ [chunkE5565MDK_js.MEDIA_CHROME_ATTRIBUTE]: visual.badge },
|
|
628
628
|
children: [
|
|
629
629
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
630
630
|
FallbackIcon,
|
|
631
631
|
{
|
|
632
|
-
paths:
|
|
632
|
+
paths: chunkE5565MDK_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(chunkE5565MDK_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
|
+
...{ [chunkE5565MDK_js.MEDIA_CHROME_ATTRIBUTE]: visual.placeholder },
|
|
655
655
|
children: [
|
|
656
656
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
657
657
|
FallbackIcon,
|
|
658
658
|
{
|
|
659
|
-
paths:
|
|
659
|
+
paths: chunkE5565MDK_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(chunkE5565MDK_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 = chunkE5565MDK_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 ? chunkKPKO2ELT_js.translationsEn["pptx.media.posterAlt"] : chunkKPKO2ELT_js.translationsEn["pptx.media.videoPosterAlt"],
|
|
685
685
|
className: `w-full h-full${visual.dimPoster ? " opacity-50" : ""}`,
|
|
686
|
-
style:
|
|
686
|
+
style: chunkE5565MDK_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: chunkKPKO2ELT_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 = chunkE5565MDK_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,17 +714,17 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
714
714
|
return renderMediaFallback({ element, posterUrl, surface });
|
|
715
715
|
}
|
|
716
716
|
if (mediaType === "video") {
|
|
717
|
-
const onlineVideo =
|
|
717
|
+
const onlineVideo = chunkE5565MDK_js.getOnlineVideoEmbed(element);
|
|
718
718
|
if (onlineVideo) {
|
|
719
719
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
720
720
|
"iframe",
|
|
721
721
|
{
|
|
722
722
|
src: onlineVideo.embedUrl,
|
|
723
|
-
title:
|
|
723
|
+
title: chunkKPKO2ELT_js.translationsEn["pptx.media.onlineVideoTitle"],
|
|
724
724
|
className: "w-full h-full border-0 pointer-events-auto",
|
|
725
|
-
allow:
|
|
725
|
+
allow: chunkE5565MDK_js.ONLINE_VIDEO_IFRAME_ALLOW,
|
|
726
726
|
allowFullScreen: true,
|
|
727
|
-
sandbox:
|
|
727
|
+
sandbox: chunkE5565MDK_js.ONLINE_VIDEO_IFRAME_SANDBOX
|
|
728
728
|
}
|
|
729
729
|
);
|
|
730
730
|
}
|
|
@@ -793,32 +793,32 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
793
793
|
if (surface.presenting || surface.preview) {
|
|
794
794
|
return null;
|
|
795
795
|
}
|
|
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:
|
|
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: chunkKPKO2ELT_js.translationsEn["pptx.media.title"] });
|
|
797
797
|
}
|
|
798
798
|
|
|
799
799
|
// src/viewer/utils/text-utils.tsx
|
|
800
800
|
function getTextStyleForElement(element, fallbackColor) {
|
|
801
|
-
return
|
|
801
|
+
return chunkE5565MDK_js.buildTextBlockStyle(element, { fallbackColor });
|
|
802
802
|
}
|
|
803
803
|
|
|
804
804
|
// src/viewer/utils/text-layout.tsx
|
|
805
805
|
function getTextLayoutStyle(element) {
|
|
806
|
-
if (!
|
|
806
|
+
if (!chunkE5565MDK_js.hasTextProperties(element)) {
|
|
807
807
|
return {};
|
|
808
808
|
}
|
|
809
|
-
const writingMode =
|
|
810
|
-
const textOrientation =
|
|
811
|
-
const verticalDirection =
|
|
809
|
+
const writingMode = chunkE5565MDK_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
810
|
+
const textOrientation = chunkE5565MDK_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
811
|
+
const verticalDirection = chunkE5565MDK_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
812
812
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
813
813
|
const shapeAutoFitTextBox = element.textStyle?.autoFitMode === "shrink" && (element.type === "text" || element.locks?.txBox === true);
|
|
814
|
-
const hasParagraphIndents =
|
|
814
|
+
const hasParagraphIndents = chunkE5565MDK_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
815
815
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
816
816
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
817
817
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
818
818
|
const textIndent = !hasParagraphIndents && typeof paragraphIndent === "number" && paragraphIndent !== 0 ? paragraphIndent : void 0;
|
|
819
819
|
const bodyTop = element.textStyle?.bodyInsetTop ?? DEFAULT_BODY_INSET_TB_PX;
|
|
820
820
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
821
|
-
const bodyLayoutStyle =
|
|
821
|
+
const bodyLayoutStyle = chunkE5565MDK_js.buildTextBodyLayoutStyle(element);
|
|
822
822
|
return {
|
|
823
823
|
...bodyLayoutStyle,
|
|
824
824
|
// Body inset only. Paragraph spacing (spcBef/spcAft) is applied
|
|
@@ -848,7 +848,7 @@ function getTextLayoutStyle(element) {
|
|
|
848
848
|
|
|
849
849
|
// src/viewer/utils/text-effects.tsx
|
|
850
850
|
function buildTextBody3DSceneStyle2(textStyle, elementSize) {
|
|
851
|
-
return
|
|
851
|
+
return chunkE5565MDK_js.buildTextBody3DSceneStyle(textStyle, elementSize);
|
|
852
852
|
}
|
|
853
853
|
|
|
854
854
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -1033,13 +1033,13 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1033
1033
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
1034
1034
|
return renderedSegments;
|
|
1035
1035
|
}
|
|
1036
|
-
const paraKey = `${elementId}${
|
|
1036
|
+
const paraKey = `${elementId}${chunkE5565MDK_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
1037
1037
|
const paraState = subElementAnimStates.get(paraKey);
|
|
1038
1038
|
if (paraState) {
|
|
1039
1039
|
const style = buildAnimStyle(paraState);
|
|
1040
1040
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
1041
1041
|
}
|
|
1042
|
-
const spec =
|
|
1042
|
+
const spec = chunkE5565MDK_js.buildTextBuildSpec(
|
|
1043
1043
|
elementId,
|
|
1044
1044
|
paraIndex,
|
|
1045
1045
|
paraRuns.map((run) => ({ text: run.text, style: run })),
|
|
@@ -1057,7 +1057,7 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1057
1057
|
"span",
|
|
1058
1058
|
{
|
|
1059
1059
|
"data-anim-id": span.animId,
|
|
1060
|
-
style:
|
|
1060
|
+
style: chunkE5565MDK_js.textBuildSpanStyle(span),
|
|
1061
1061
|
children: content
|
|
1062
1062
|
},
|
|
1063
1063
|
span.animId
|
|
@@ -1068,28 +1068,29 @@ function renderUnderlineWords(text, isUnderlineWords, wordDecoration, metric, ke
|
|
|
1068
1068
|
if (!isUnderlineWords || !text) {
|
|
1069
1069
|
return inner(text, keyPrefix, metric);
|
|
1070
1070
|
}
|
|
1071
|
-
const pieces =
|
|
1071
|
+
const pieces = chunkE5565MDK_js.splitWordsForUnderline(text);
|
|
1072
1072
|
if (pieces.length === 0) {
|
|
1073
1073
|
return inner(text, keyPrefix, metric);
|
|
1074
1074
|
}
|
|
1075
1075
|
const gapMetric = metric ? {
|
|
1076
1076
|
...metric,
|
|
1077
|
-
nestedStyle: metric.nestedStyle ?
|
|
1077
|
+
nestedStyle: metric.nestedStyle ? chunkE5565MDK_js.stripUnderlineDecoration(metric.nestedStyle) : void 0
|
|
1078
1078
|
} : void 0;
|
|
1079
1079
|
return pieces.map((piece, i) => {
|
|
1080
1080
|
const key = `${keyPrefix}-u${i}`;
|
|
1081
|
+
const following = chunkE5565MDK_js.followingText(pieces, i, metric?.following);
|
|
1081
1082
|
if (!piece.underline) {
|
|
1082
|
-
return /* @__PURE__ */ jsxRuntime.jsx(React8__default.default.Fragment, { children: inner(piece.text, key, gapMetric) }, key);
|
|
1083
|
+
return /* @__PURE__ */ jsxRuntime.jsx(React8__default.default.Fragment, { children: inner(piece.text, key, gapMetric && { ...gapMetric, following }) }, key);
|
|
1083
1084
|
}
|
|
1084
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: wordDecoration, children: inner(piece.text, key, metric) }, key);
|
|
1085
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: wordDecoration, children: inner(piece.text, key, metric && { ...metric, following }) }, key);
|
|
1085
1086
|
});
|
|
1086
1087
|
}
|
|
1087
1088
|
function makeSegmentPieceRenderer(needsScriptFonts, scriptFonts, baseFontFamily, isUnderlineWords, wordDecoration, metric) {
|
|
1088
|
-
return (text, key) => renderUnderlineWords(
|
|
1089
|
+
return (text, key, following) => renderUnderlineWords(
|
|
1089
1090
|
text,
|
|
1090
1091
|
isUnderlineWords,
|
|
1091
1092
|
wordDecoration,
|
|
1092
|
-
metric,
|
|
1093
|
+
metric && { ...metric, following },
|
|
1093
1094
|
key,
|
|
1094
1095
|
(subText, subKey, subMetric) => renderMetricPieces(
|
|
1095
1096
|
subText,
|
|
@@ -1107,7 +1108,7 @@ function makeSegmentPieceRenderer(needsScriptFonts, scriptFonts, baseFontFamily,
|
|
|
1107
1108
|
);
|
|
1108
1109
|
}
|
|
1109
1110
|
function renderTabbedLine(line, ctx, keyPrefix, renderPiece, nestedStyle, underlineWords = false) {
|
|
1110
|
-
const [lineLayout] =
|
|
1111
|
+
const [lineLayout] = chunkE5565MDK_js.buildRunTabLines(
|
|
1111
1112
|
line,
|
|
1112
1113
|
ctx,
|
|
1113
1114
|
nestedStyle,
|
|
@@ -1122,8 +1123,8 @@ function renderTabbedLine(line, ctx, keyPrefix, renderPiece, nestedStyle, underl
|
|
|
1122
1123
|
] }, key);
|
|
1123
1124
|
}) });
|
|
1124
1125
|
}
|
|
1125
|
-
function renderEastAsianPieces(text, metric, keyPrefix, inner, baseStyle) {
|
|
1126
|
-
const parts =
|
|
1126
|
+
function renderEastAsianPieces(text, metric, keyPrefix, inner, baseStyle, following) {
|
|
1127
|
+
const parts = chunkE5565MDK_js.splitEastAsianBreaks(text, metric.eastAsian, metric.font, following);
|
|
1127
1128
|
if (parts.length === 1 && !parts[0].style) {
|
|
1128
1129
|
return inner(parts[0].text, keyPrefix);
|
|
1129
1130
|
}
|
|
@@ -1136,24 +1137,31 @@ function renderMetricPieces(text, metric, keyPrefix, inner) {
|
|
|
1136
1137
|
if (!metric || !text) {
|
|
1137
1138
|
return inner(text, keyPrefix);
|
|
1138
1139
|
}
|
|
1139
|
-
const pieces =
|
|
1140
|
+
const pieces = chunkE5565MDK_js.splitRunForMetrics(text, metric.font);
|
|
1140
1141
|
if (pieces.length <= 1) {
|
|
1141
|
-
return renderEastAsianPieces(text, metric, keyPrefix, inner, void 0);
|
|
1142
|
+
return renderEastAsianPieces(text, metric, keyPrefix, inner, void 0, metric.following);
|
|
1142
1143
|
}
|
|
1143
1144
|
return pieces.map((piece, i) => {
|
|
1144
1145
|
const key = `${keyPrefix}-w${i}`;
|
|
1145
1146
|
const style = {
|
|
1146
1147
|
...metric.nestedStyle,
|
|
1147
|
-
letterSpacing:
|
|
1148
|
+
letterSpacing: chunkE5565MDK_js.pieceLetterSpacing(metric.authoredPx, piece.tracking)
|
|
1148
1149
|
};
|
|
1149
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { style, children: renderEastAsianPieces(
|
|
1150
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { style, children: renderEastAsianPieces(
|
|
1151
|
+
piece.text,
|
|
1152
|
+
metric,
|
|
1153
|
+
key,
|
|
1154
|
+
inner,
|
|
1155
|
+
style,
|
|
1156
|
+
chunkE5565MDK_js.followingText(pieces, i, metric.following)
|
|
1157
|
+
) }, key);
|
|
1150
1158
|
});
|
|
1151
1159
|
}
|
|
1152
1160
|
function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFamily, keyPrefix, nestedStyle) {
|
|
1153
1161
|
if (!needsScriptFonts || !text) {
|
|
1154
1162
|
return text;
|
|
1155
1163
|
}
|
|
1156
|
-
const pieces =
|
|
1164
|
+
const pieces = chunkE5565MDK_js.splitRunByScriptFont(
|
|
1157
1165
|
text,
|
|
1158
1166
|
scriptFonts,
|
|
1159
1167
|
baseFontFamily,
|
|
@@ -1187,7 +1195,7 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1187
1195
|
renderLeaf,
|
|
1188
1196
|
metric?.nestedStyle,
|
|
1189
1197
|
isUnderlineWords
|
|
1190
|
-
) : renderLeaf(line, lineKey),
|
|
1198
|
+
) : renderLeaf(line, lineKey, lineIndex < lines.length - 1 ? "\n" : metric?.following),
|
|
1191
1199
|
lineIndex < lines.length - 1 ? /* @__PURE__ */ jsxRuntime.jsx("br", {}) : null
|
|
1192
1200
|
] }, lineKey);
|
|
1193
1201
|
});
|
|
@@ -1228,15 +1236,15 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1228
1236
|
color: "inherit",
|
|
1229
1237
|
borderRadius: 2
|
|
1230
1238
|
},
|
|
1231
|
-
children: renderLeaf(chunk.text, chunkKey)
|
|
1239
|
+
children: renderLeaf(chunk.text, chunkKey, chunkE5565MDK_js.followingText(chunks, ci, metric?.following))
|
|
1232
1240
|
},
|
|
1233
1241
|
chunkKey
|
|
1234
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(React8__default.default.Fragment, { children: renderLeaf(chunk.text, chunkKey) }, chunkKey);
|
|
1242
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(React8__default.default.Fragment, { children: renderLeaf(chunk.text, chunkKey, chunkE5565MDK_js.followingText(chunks, ci, metric?.following)) }, chunkKey);
|
|
1235
1243
|
});
|
|
1236
1244
|
}
|
|
1237
1245
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber, fontSize) {
|
|
1238
|
-
const mathml =
|
|
1239
|
-
const safeMathml = mathml ?
|
|
1246
|
+
const mathml = chunkE5565MDK_js.convertOmmlToMathMl(equationXml);
|
|
1247
|
+
const safeMathml = mathml ? chunkE5565MDK_js.sanitizeMathMl(mathml) : "";
|
|
1240
1248
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1241
1249
|
"span",
|
|
1242
1250
|
{
|
|
@@ -1246,7 +1254,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1246
1254
|
},
|
|
1247
1255
|
dangerouslySetInnerHTML: { __html: safeMathml }
|
|
1248
1256
|
}
|
|
1249
|
-
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children:
|
|
1257
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children: chunkKPKO2ELT_js.translationsEn["pptx.textSegment.equationFallback"] });
|
|
1250
1258
|
if (equationNumber) {
|
|
1251
1259
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1252
1260
|
"span",
|
|
@@ -1376,7 +1384,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1376
1384
|
const segmentStyle = segment?.style ?? {};
|
|
1377
1385
|
const textValue = run.text;
|
|
1378
1386
|
const lines = textValue.split("\n");
|
|
1379
|
-
const resolvedSegmentColor =
|
|
1387
|
+
const resolvedSegmentColor = chunkE5565MDK_js.normalizeHexColor(
|
|
1380
1388
|
segmentStyle.color || element.textStyle?.color,
|
|
1381
1389
|
run.hyperlink ? HYPERLINK_COLOR : fallbackColor
|
|
1382
1390
|
);
|
|
@@ -1384,35 +1392,36 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1384
1392
|
const baselineFraction = rawBaseline === 0 ? 0 : Math.abs(rawBaseline) >= 1e3 ? rawBaseline / 1e5 : rawBaseline / 100;
|
|
1385
1393
|
const baselineFontScale = baselineFraction !== 0 ? BASELINE_FONT_SCALE : 1;
|
|
1386
1394
|
const rawFontSize = segmentStyle.fontSize || element.textStyle?.fontSize || DEFAULT_TEXT_FONT_SIZE;
|
|
1387
|
-
const baseFontSize =
|
|
1395
|
+
const baseFontSize = chunkE5565MDK_js.scaleFontSizeForAutoFit(
|
|
1388
1396
|
rawFontSize,
|
|
1389
|
-
|
|
1397
|
+
chunkE5565MDK_js.resolveAutoFitFontScale(element.textStyle)
|
|
1390
1398
|
);
|
|
1391
1399
|
const baselineShift = baselineFraction !== 0 ? `${baselineFraction * baseFontSize}px` : void 0;
|
|
1392
|
-
const fontKerning =
|
|
1400
|
+
const fontKerning = chunkE5565MDK_js.resolveFontKerning(segmentStyle.kerning, baseFontSize);
|
|
1393
1401
|
const scriptFallbackWins = Boolean(
|
|
1394
1402
|
segmentStyle.scriptFallbackFont && segmentStyle.fontFamilyIsCascadeDefault
|
|
1395
1403
|
);
|
|
1396
1404
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
1397
|
-
const baseFontFamily = scriptFallbackWins ?
|
|
1405
|
+
const baseFontFamily = scriptFallbackWins ? chunkE5565MDK_js.getSubstituteFontFamily(segmentStyle.scriptFallbackFont) : rawFontFamily ? chunkE5565MDK_js.getSubstituteFontFamily(
|
|
1398
1406
|
rawFontFamily,
|
|
1399
|
-
|
|
1407
|
+
chunkE5565MDK_js.parsePanoseString(segmentStyle.latinFontPanose ?? element.textStyle?.latinFontPanose)
|
|
1400
1408
|
) : DEFAULT_FONT_FAMILY2;
|
|
1401
|
-
const scriptFonts =
|
|
1402
|
-
const needsScriptFonts =
|
|
1403
|
-
const authoredLetterSpacing =
|
|
1409
|
+
const scriptFonts = chunkE5565MDK_js.resolveScriptFontSet(segmentStyle, element.textStyle, baseFontFamily);
|
|
1410
|
+
const needsScriptFonts = chunkE5565MDK_js.hasDistinctScriptFonts(scriptFonts);
|
|
1411
|
+
const authoredLetterSpacing = chunkE5565MDK_js.authoredLetterSpacingPx(segmentStyle);
|
|
1404
1412
|
const metricFont = {
|
|
1405
1413
|
fontFamily: baseFontFamily,
|
|
1406
1414
|
fontSizePx: baseFontSize * baselineFontScale,
|
|
1407
1415
|
bold: Boolean(segmentStyle.bold),
|
|
1408
1416
|
italic: Boolean(segmentStyle.italic)
|
|
1409
1417
|
};
|
|
1410
|
-
const nestedStyle =
|
|
1418
|
+
const nestedStyle = chunkE5565MDK_js.nestedTextDecorationStyle(run.style);
|
|
1411
1419
|
const metricContext = {
|
|
1412
1420
|
font: metricFont,
|
|
1413
1421
|
authoredPx: authoredLetterSpacing,
|
|
1414
1422
|
nestedStyle,
|
|
1415
|
-
eastAsian: ctx.eastAsianBreaks
|
|
1423
|
+
eastAsian: ctx.eastAsianBreaks,
|
|
1424
|
+
following: ctx.eastAsianFollowing
|
|
1416
1425
|
};
|
|
1417
1426
|
const spanStyle = { ...run.style };
|
|
1418
1427
|
spanStyle.color = resolvedSegmentColor;
|
|
@@ -1420,11 +1429,11 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1420
1429
|
spanStyle.fontFamily = baseFontFamily;
|
|
1421
1430
|
spanStyle.verticalAlign = baselineShift;
|
|
1422
1431
|
spanStyle.fontKerning = fontKerning;
|
|
1423
|
-
spanStyle.letterSpacing =
|
|
1432
|
+
spanStyle.letterSpacing = chunkE5565MDK_js.pieceLetterSpacing(
|
|
1424
1433
|
authoredLetterSpacing,
|
|
1425
|
-
|
|
1434
|
+
chunkE5565MDK_js.resolveMetricTrackingPx(textValue, metricFont)
|
|
1426
1435
|
);
|
|
1427
|
-
const hollow =
|
|
1436
|
+
const hollow = chunkE5565MDK_js.hollowTextFillStyle(segmentStyle, {
|
|
1428
1437
|
color: resolvedSegmentColor,
|
|
1429
1438
|
textStroke: typeof spanStyle.WebkitTextStroke === "string" ? spanStyle.WebkitTextStroke : void 0
|
|
1430
1439
|
});
|
|
@@ -1436,10 +1445,10 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1436
1445
|
spanStyle.direction = runRtl ? "rtl" : "ltr";
|
|
1437
1446
|
spanStyle.unicodeBidi = runRtl !== ctx.paragraphRtl ? "bidi-override" : "embed";
|
|
1438
1447
|
}
|
|
1439
|
-
const isUnderlineWords =
|
|
1448
|
+
const isUnderlineWords = chunkE5565MDK_js.splitsUnderlineIntoWords(segmentStyle);
|
|
1440
1449
|
const wordDecoration = isUnderlineWords ? nestedStyle ?? run.underlineWordPieces?.find((piece) => piece.style)?.style : void 0;
|
|
1441
1450
|
if (isUnderlineWords) {
|
|
1442
|
-
const stripped =
|
|
1451
|
+
const stripped = chunkE5565MDK_js.stripUnderlineDecoration(spanStyle);
|
|
1443
1452
|
spanStyle.textDecoration = stripped.textDecoration;
|
|
1444
1453
|
delete spanStyle.textDecorationStyle;
|
|
1445
1454
|
delete spanStyle.textDecorationThickness;
|
|
@@ -1455,7 +1464,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1455
1464
|
scriptFonts,
|
|
1456
1465
|
baseFontFamily,
|
|
1457
1466
|
findHighlights,
|
|
1458
|
-
|
|
1467
|
+
chunkE5565MDK_js.buildTabContext(
|
|
1459
1468
|
element.textStyle?.tabStops,
|
|
1460
1469
|
element.textStyle?.defaultTabSize,
|
|
1461
1470
|
baseFontSize,
|
|
@@ -1488,14 +1497,14 @@ function renderSeededListRun(seed, runs, segments, context) {
|
|
|
1488
1497
|
const segment = sourceRun ? segments[seed.segmentIndex] : { text: seed.text, style: seed.style };
|
|
1489
1498
|
const resolvedSegment = {
|
|
1490
1499
|
...segment,
|
|
1491
|
-
style:
|
|
1500
|
+
style: chunkE5565MDK_js.withInlineListDecorationDefaults(segment.style, context.element.textStyle)
|
|
1492
1501
|
};
|
|
1493
|
-
const decorationCss =
|
|
1502
|
+
const decorationCss = chunkE5565MDK_js.segmentStyleToCss(
|
|
1494
1503
|
resolvedSegment,
|
|
1495
|
-
|
|
1504
|
+
chunkE5565MDK_js.resolveAutoFitFontScale(context.element.textStyle)
|
|
1496
1505
|
);
|
|
1497
|
-
|
|
1498
|
-
const run = sourceRun ? { ...sourceRun, style: { ...sourceRun.style, ...
|
|
1506
|
+
chunkE5565MDK_js.applyUnderlineVariant(decorationCss, resolvedSegment);
|
|
1507
|
+
const run = sourceRun ? { ...sourceRun, style: { ...sourceRun.style, ...chunkE5565MDK_js.nestedTextDecorationStyle(decorationCss) } } : {
|
|
1499
1508
|
text: seed.text,
|
|
1500
1509
|
style: decorationCss,
|
|
1501
1510
|
segmentIndex: seed.segmentIndex
|
|
@@ -1510,7 +1519,7 @@ function renderSeededListRun(seed, runs, segments, context) {
|
|
|
1510
1519
|
});
|
|
1511
1520
|
}
|
|
1512
1521
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick, placeholderPrompt, inlineListSeed) {
|
|
1513
|
-
if (!
|
|
1522
|
+
if (!chunkE5565MDK_js.hasTextProperties(element)) {
|
|
1514
1523
|
return emptyFallback || null;
|
|
1515
1524
|
}
|
|
1516
1525
|
const segments = segmentOverrides ?? element.textSegments;
|
|
@@ -1520,7 +1529,7 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
1520
1529
|
}
|
|
1521
1530
|
return element.text || emptyFallback || "";
|
|
1522
1531
|
}
|
|
1523
|
-
const paragraphs =
|
|
1532
|
+
const paragraphs = chunkE5565MDK_js.buildParagraphs(element, fieldContext, segmentOverrides, {
|
|
1524
1533
|
preserveTrailingEmpty: inlineListSeed ? true : void 0,
|
|
1525
1534
|
eastAsianRunPieces: false
|
|
1526
1535
|
});
|
|
@@ -1564,7 +1573,12 @@ function renderParagraph(para, paraIndex, paraCount, segments, ctx, subElementAn
|
|
|
1564
1573
|
};
|
|
1565
1574
|
const runs = joinRunsBySegment(para.runs);
|
|
1566
1575
|
const listParagraph = inlineListSeed?.paragraphs[paraIndex];
|
|
1567
|
-
const renderedRuns = listParagraph ? listParagraph.runs.map((run) => renderSeededListRun(run, runs, segments, runCtx)) : runs.map(
|
|
1576
|
+
const renderedRuns = listParagraph ? listParagraph.runs.map((run) => renderSeededListRun(run, runs, segments, runCtx)) : runs.map(
|
|
1577
|
+
(run, i) => renderParagraphRun(run, segments[run.segmentIndex ?? -1], {
|
|
1578
|
+
...runCtx,
|
|
1579
|
+
eastAsianFollowing: para.eastAsianBreaks ? chunkE5565MDK_js.followingText(runs, i) : void 0
|
|
1580
|
+
})
|
|
1581
|
+
);
|
|
1568
1582
|
const paraStyle = {
|
|
1569
1583
|
// `text-align`, BiDi `direction` / `unicode-bidi` and the kinsoku
|
|
1570
1584
|
// line-break rules, resolved by shared from this paragraph's own `a:pPr`.
|
|
@@ -1668,13 +1682,13 @@ function renderBulletMarker(para, paraIndex, elementId) {
|
|
|
1668
1682
|
);
|
|
1669
1683
|
}
|
|
1670
1684
|
function getDuotoneColors(element) {
|
|
1671
|
-
if (!
|
|
1685
|
+
if (!chunkE5565MDK_js.isImageLikeElement(element)) {
|
|
1672
1686
|
return void 0;
|
|
1673
1687
|
}
|
|
1674
1688
|
return element.imageEffects?.duotone;
|
|
1675
1689
|
}
|
|
1676
1690
|
function buildLineShadowCss(element) {
|
|
1677
|
-
if (!
|
|
1691
|
+
if (!chunkE5565MDK_js.hasShapeProperties(element)) {
|
|
1678
1692
|
return void 0;
|
|
1679
1693
|
}
|
|
1680
1694
|
const ss = element.shapeStyle;
|
|
@@ -1685,13 +1699,13 @@ function buildLineShadowCss(element) {
|
|
|
1685
1699
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
1686
1700
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
1687
1701
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
1688
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
1689
|
-
|
|
1702
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkE5565MDK_js.colorWithOpacity(
|
|
1703
|
+
chunkE5565MDK_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
1690
1704
|
opacity
|
|
1691
1705
|
)}`;
|
|
1692
1706
|
}
|
|
1693
1707
|
function buildLineGlowFilter(element) {
|
|
1694
|
-
if (!
|
|
1708
|
+
if (!chunkE5565MDK_js.hasShapeProperties(element)) {
|
|
1695
1709
|
return void 0;
|
|
1696
1710
|
}
|
|
1697
1711
|
const ss = element.shapeStyle;
|
|
@@ -1700,22 +1714,22 @@ function buildLineGlowFilter(element) {
|
|
|
1700
1714
|
}
|
|
1701
1715
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
1702
1716
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
1703
|
-
const glowCol =
|
|
1717
|
+
const glowCol = chunkE5565MDK_js.colorWithOpacity(chunkE5565MDK_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
1704
1718
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
1705
1719
|
}
|
|
1706
1720
|
function getDagDuotoneFilterId(elementId) {
|
|
1707
1721
|
return `dag-duotone-${elementId}`;
|
|
1708
1722
|
}
|
|
1709
1723
|
function hasDagDuotoneEffect(element) {
|
|
1710
|
-
if (!
|
|
1724
|
+
if (!chunkE5565MDK_js.hasShapeProperties(element)) {
|
|
1711
1725
|
return false;
|
|
1712
1726
|
}
|
|
1713
1727
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
1714
1728
|
}
|
|
1715
1729
|
function renderDagDuotoneSvgFilter(elementId, color1, color2) {
|
|
1716
1730
|
const filterId = getDagDuotoneFilterId(elementId);
|
|
1717
|
-
const c1 =
|
|
1718
|
-
const c2 =
|
|
1731
|
+
const c1 = chunkE5565MDK_js.hexToRgbUnit(color1);
|
|
1732
|
+
const c2 = chunkE5565MDK_js.hexToRgbUnit(color2);
|
|
1719
1733
|
const grayscaleMatrix = [
|
|
1720
1734
|
0.2126,
|
|
1721
1735
|
0.7152,
|
|
@@ -1759,7 +1773,7 @@ function renderDagDuotoneSvgFilter(elementId, color1, color2) {
|
|
|
1759
1773
|
|
|
1760
1774
|
// src/viewer/utils/shape-visual-3d.ts
|
|
1761
1775
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
1762
|
-
return
|
|
1776
|
+
return chunkE5565MDK_js.build3DExtrusionData(
|
|
1763
1777
|
shape3d,
|
|
1764
1778
|
scene3d,
|
|
1765
1779
|
fillColor,
|
|
@@ -1768,7 +1782,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
1768
1782
|
);
|
|
1769
1783
|
}
|
|
1770
1784
|
function apply3dEffects2(base, scene3d, shape3d, fillColorFallback, elementSize, elementId) {
|
|
1771
|
-
|
|
1785
|
+
chunkE5565MDK_js.apply3dEffects(
|
|
1772
1786
|
base,
|
|
1773
1787
|
scene3d,
|
|
1774
1788
|
shape3d,
|
|
@@ -1783,11 +1797,11 @@ function rendersCustomVectorPath(element) {
|
|
|
1783
1797
|
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;
|
|
1784
1798
|
}
|
|
1785
1799
|
function rendersWedgeCalloutVector(element) {
|
|
1786
|
-
return element.type === "shape" &&
|
|
1800
|
+
return element.type === "shape" && chunkE5565MDK_js.isWedgeCalloutPresetShape(element.shapeType);
|
|
1787
1801
|
}
|
|
1788
1802
|
function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _strokeColor, animatesFill, animatesStroke, parentGroupFill) {
|
|
1789
1803
|
if (element.type === "group") {
|
|
1790
|
-
const fx2 =
|
|
1804
|
+
const fx2 = chunkE5565MDK_js.getComputedEffectStyle(element);
|
|
1791
1805
|
const groupStyle = {};
|
|
1792
1806
|
if (fx2.filter) {
|
|
1793
1807
|
groupStyle.filter = fx2.filter;
|
|
@@ -1797,13 +1811,13 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1797
1811
|
}
|
|
1798
1812
|
return groupStyle;
|
|
1799
1813
|
}
|
|
1800
|
-
if (!
|
|
1814
|
+
if (!chunkE5565MDK_js.hasShapeProperties(element)) {
|
|
1801
1815
|
return {};
|
|
1802
1816
|
}
|
|
1803
1817
|
const ss = element.shapeStyle;
|
|
1804
|
-
const fill = animatesFill ? void 0 :
|
|
1805
|
-
const fx =
|
|
1806
|
-
const stroke =
|
|
1818
|
+
const fill = animatesFill ? void 0 : chunkE5565MDK_js.getComputedFillStyle(element, parentGroupFill);
|
|
1819
|
+
const fx = chunkE5565MDK_js.getComputedEffectStyle(element);
|
|
1820
|
+
const stroke = chunkE5565MDK_js.getComputedStrokeStyle(element);
|
|
1807
1821
|
const base = {
|
|
1808
1822
|
// A gradient fill REPLACES the solid fill, it does not sit on top of it;
|
|
1809
1823
|
// the whole precedence lives in shared's `getComputedFillStyle`.
|
|
@@ -1842,7 +1856,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1842
1856
|
};
|
|
1843
1857
|
Object.assign(
|
|
1844
1858
|
base,
|
|
1845
|
-
|
|
1859
|
+
chunkE5565MDK_js.getAnimationColorBaseStyle(element, {
|
|
1846
1860
|
animatesFill,
|
|
1847
1861
|
animatesStroke,
|
|
1848
1862
|
parentGroupFill
|
|
@@ -1864,7 +1878,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1864
1878
|
},
|
|
1865
1879
|
element.id
|
|
1866
1880
|
);
|
|
1867
|
-
if (rendersCustomVectorPath(element) || rendersWedgeCalloutVector(element) ||
|
|
1881
|
+
if (rendersCustomVectorPath(element) || rendersWedgeCalloutVector(element) || chunkE5565MDK_js.isStrokeOnlyPresetElement(element)) {
|
|
1868
1882
|
base.backgroundColor = "transparent";
|
|
1869
1883
|
base.backgroundImage = void 0;
|
|
1870
1884
|
base.borderWidth = void 0;
|
|
@@ -1878,7 +1892,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1878
1892
|
if (rendersWedgeCalloutVector(element)) {
|
|
1879
1893
|
return base;
|
|
1880
1894
|
}
|
|
1881
|
-
const geometry =
|
|
1895
|
+
const geometry = chunkE5565MDK_js.resolveShapeGeometry(element);
|
|
1882
1896
|
switch (geometry.kind) {
|
|
1883
1897
|
case "bare":
|
|
1884
1898
|
return { backgroundColor: "transparent", borderWidth: 0, borderStyle: "none" };
|
|
@@ -1902,7 +1916,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1902
1916
|
}
|
|
1903
1917
|
}
|
|
1904
1918
|
function getConnectorPathGeometry2(element) {
|
|
1905
|
-
return
|
|
1919
|
+
return chunkE5565MDK_js.getConnectorPathGeometry(element);
|
|
1906
1920
|
}
|
|
1907
1921
|
var ARROW_SIZE_SCALE = {
|
|
1908
1922
|
sm: 0.6,
|
|
@@ -1971,11 +1985,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
|
|
|
1971
1985
|
strokePaint,
|
|
1972
1986
|
strokeWidth,
|
|
1973
1987
|
dashArray,
|
|
1974
|
-
lineCap:
|
|
1988
|
+
lineCap: chunkE5565MDK_js.svgLineCap(shapeStyle?.lineCap),
|
|
1975
1989
|
lineJoin,
|
|
1976
1990
|
miterLimit,
|
|
1977
|
-
offsets:
|
|
1978
|
-
widths:
|
|
1991
|
+
offsets: chunkE5565MDK_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
1992
|
+
widths: chunkE5565MDK_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
|
|
1979
1993
|
};
|
|
1980
1994
|
}
|
|
1981
1995
|
function strokeStrands(d, keyBase, ctx) {
|
|
@@ -1998,12 +2012,12 @@ function strokeStrands(d, keyBase, ctx) {
|
|
|
1998
2012
|
}
|
|
1999
2013
|
function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredPaths, shapeStyle, hasFill, fillColor, fillOpacity, strokePaint, strokeWidth, dashArray, animatesFill = false, gradient) {
|
|
2000
2014
|
const ctx = strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray);
|
|
2001
|
-
const subpaths = structuredPaths && structuredPaths.length > 0 ?
|
|
2015
|
+
const subpaths = structuredPaths && structuredPaths.length > 0 ? chunkE5565MDK_js.customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
2002
2016
|
const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
|
|
2003
|
-
const gradientPaint = gradient ?
|
|
2017
|
+
const gradientPaint = gradient ? chunkE5565MDK_js.svgGradientFillRef(gradient) : void 0;
|
|
2004
2018
|
const nodes = [];
|
|
2005
2019
|
if (subpaths && needsPerSubpath) {
|
|
2006
|
-
const paints =
|
|
2020
|
+
const paints = chunkE5565MDK_js.buildSubpathPaints(subpaths, hasFill, fillColor, fillOpacity);
|
|
2007
2021
|
paints.forEach((paint, idx) => {
|
|
2008
2022
|
if (paint.fill !== "none") {
|
|
2009
2023
|
const mode = subpaths[idx]?.fillMode;
|
|
@@ -2032,7 +2046,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2032
2046
|
"path",
|
|
2033
2047
|
{
|
|
2034
2048
|
d: pathData,
|
|
2035
|
-
fill: animatesFill ? "inherit" : gradientPaint ??
|
|
2049
|
+
fill: animatesFill ? "inherit" : gradientPaint ?? chunkE5565MDK_js.colorWithOpacity(fillColor, fillOpacity),
|
|
2036
2050
|
stroke: "none",
|
|
2037
2051
|
vectorEffect: "non-scaling-stroke"
|
|
2038
2052
|
},
|
|
@@ -2058,14 +2072,14 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2058
2072
|
);
|
|
2059
2073
|
}
|
|
2060
2074
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2061
|
-
if (!
|
|
2075
|
+
if (!chunkE5565MDK_js.hasShapeProperties(element)) {
|
|
2062
2076
|
return null;
|
|
2063
2077
|
}
|
|
2064
2078
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
2065
|
-
const fillPaint = animatesFill ? "inherit" :
|
|
2066
|
-
const strokePaint = animatesStroke ? "inherit" :
|
|
2067
|
-
const dashType =
|
|
2068
|
-
const dashArray =
|
|
2079
|
+
const fillPaint = animatesFill ? "inherit" : chunkE5565MDK_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
2080
|
+
const strokePaint = animatesStroke ? "inherit" : chunkE5565MDK_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
2081
|
+
const dashType = chunkE5565MDK_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2082
|
+
const dashArray = chunkE5565MDK_js.getSvgStrokeDasharray(
|
|
2069
2083
|
dashType,
|
|
2070
2084
|
Math.max(strokeWidth, 1),
|
|
2071
2085
|
element.shapeStyle?.customDashSegments
|
|
@@ -2146,13 +2160,13 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2146
2160
|
// container's `background-image` is suppressed for custom geometry, so
|
|
2147
2161
|
// without this the shape fell back to the parser's representative solid
|
|
2148
2162
|
// and lost every fade (issue #132).
|
|
2149
|
-
|
|
2163
|
+
chunkE5565MDK_js.buildSvgGradientDef(element.shapeStyle, element.id)
|
|
2150
2164
|
);
|
|
2151
2165
|
}
|
|
2152
|
-
if ((element.type === "image" || element.type === "picture") && strokeWidth > 0 && !
|
|
2166
|
+
if ((element.type === "image" || element.type === "picture") && strokeWidth > 0 && !chunkE5565MDK_js.buildStrokeOutline(element)) {
|
|
2153
2167
|
const width = Math.max(element.width, 1);
|
|
2154
2168
|
const height = Math.max(element.height, 1);
|
|
2155
|
-
const geometry =
|
|
2169
|
+
const geometry = chunkE5565MDK_js.getPresetShapeVectorGeometry(
|
|
2156
2170
|
element.shapeType || "rect",
|
|
2157
2171
|
width,
|
|
2158
2172
|
height,
|
|
@@ -2180,18 +2194,18 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2180
2194
|
);
|
|
2181
2195
|
}
|
|
2182
2196
|
}
|
|
2183
|
-
if (element.type === "shape" &&
|
|
2197
|
+
if (element.type === "shape" && chunkE5565MDK_js.isWedgeCalloutPresetShape(element.shapeType)) {
|
|
2184
2198
|
const width = Math.max(element.width, 1);
|
|
2185
2199
|
const height = Math.max(element.height, 1);
|
|
2186
|
-
const geometry =
|
|
2200
|
+
const geometry = chunkE5565MDK_js.getPresetShapeVectorGeometry(
|
|
2187
2201
|
element.shapeType,
|
|
2188
2202
|
width,
|
|
2189
2203
|
height,
|
|
2190
2204
|
element.shapeAdjustments
|
|
2191
2205
|
);
|
|
2192
2206
|
if (geometry) {
|
|
2193
|
-
const gradient =
|
|
2194
|
-
const gradientPaint = gradient ?
|
|
2207
|
+
const gradient = chunkE5565MDK_js.buildSvgGradientDef(element.shapeStyle, element.id);
|
|
2208
|
+
const gradientPaint = gradient ? chunkE5565MDK_js.svgGradientFillRef(gradient) : void 0;
|
|
2195
2209
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2196
2210
|
"svg",
|
|
2197
2211
|
{
|
|
@@ -2224,18 +2238,18 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2224
2238
|
);
|
|
2225
2239
|
}
|
|
2226
2240
|
}
|
|
2227
|
-
if (
|
|
2241
|
+
if (chunkE5565MDK_js.isCalloutShape(normalizedType)) {
|
|
2228
2242
|
const width = Math.max(element.width, 1);
|
|
2229
2243
|
const height = Math.max(element.height, 1);
|
|
2230
|
-
const geometry =
|
|
2244
|
+
const geometry = chunkE5565MDK_js.getCalloutLeaderLineGeometry(
|
|
2231
2245
|
normalizedType,
|
|
2232
2246
|
width,
|
|
2233
2247
|
height,
|
|
2234
2248
|
element.shapeAdjustments
|
|
2235
2249
|
);
|
|
2236
2250
|
if (geometry && geometry.points.length >= 2) {
|
|
2237
|
-
const leaderPath =
|
|
2238
|
-
const bounds =
|
|
2251
|
+
const leaderPath = chunkE5565MDK_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
2252
|
+
const bounds = chunkE5565MDK_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
2239
2253
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
2240
2254
|
const offsetLeft = bounds.minX;
|
|
2241
2255
|
const offsetTop = bounds.minY;
|
|
@@ -2298,10 +2312,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2298
2312
|
const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
|
|
2299
2313
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
2300
2314
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
2301
|
-
const connectorLineCap =
|
|
2315
|
+
const connectorLineCap = chunkE5565MDK_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
2302
2316
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
2303
|
-
const offsets =
|
|
2304
|
-
const widths =
|
|
2317
|
+
const offsets = chunkE5565MDK_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
2318
|
+
const widths = chunkE5565MDK_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
2305
2319
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2306
2320
|
"svg",
|
|
2307
2321
|
{
|
|
@@ -2368,15 +2382,15 @@ function parseGradientFillCss(gradFill) {
|
|
|
2368
2382
|
}
|
|
2369
2383
|
const rawStops = stops.map((gs) => {
|
|
2370
2384
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
2371
|
-
const color =
|
|
2372
|
-
const opacity =
|
|
2385
|
+
const color = chunkE5565MDK_js.parseDrawingColor(gs) ?? "#888888";
|
|
2386
|
+
const opacity = chunkE5565MDK_js.parseDrawingColorOpacity(gs);
|
|
2373
2387
|
return { position: pos, color, opacity };
|
|
2374
2388
|
}).sort((a, b) => a.position - b.position);
|
|
2375
|
-
const stopStrings = rawStops.map((s) => `${
|
|
2389
|
+
const stopStrings = rawStops.map((s) => `${chunkE5565MDK_js.colorWithOpacity(s.color, s.opacity)} ${s.position.toFixed(1)}%`).join(", ");
|
|
2376
2390
|
const lin = gradFill["a:lin"];
|
|
2377
2391
|
if (lin) {
|
|
2378
2392
|
const angRaw = Number.parseInt(String(lin["@_ang"] || "0"), 10);
|
|
2379
|
-
const angleDeg = Math.round(
|
|
2393
|
+
const angleDeg = Math.round(chunkE5565MDK_js.ooxmlGradientAngleToCssDegrees(angRaw / 6e4));
|
|
2380
2394
|
return `linear-gradient(${angleDeg}deg, ${stopStrings})`;
|
|
2381
2395
|
}
|
|
2382
2396
|
const path = gradFill["a:path"];
|
|
@@ -2390,7 +2404,7 @@ function parseGradientFillCss(gradFill) {
|
|
|
2390
2404
|
b: Number.parseInt(String(fillToRectXml["@_b"] || "0"), 10) / 1e5
|
|
2391
2405
|
} : void 0;
|
|
2392
2406
|
if (pathType === "rect") {
|
|
2393
|
-
return
|
|
2407
|
+
return chunkE5565MDK_js.buildRectPathGradient(rawStops, void 0, fillToRect);
|
|
2394
2408
|
}
|
|
2395
2409
|
let cx = 50;
|
|
2396
2410
|
let cy = 50;
|
|
@@ -2412,8 +2426,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
2412
2426
|
if (!pattFill) {
|
|
2413
2427
|
return void 0;
|
|
2414
2428
|
}
|
|
2415
|
-
const fgColor =
|
|
2416
|
-
const bgColor =
|
|
2429
|
+
const fgColor = chunkE5565MDK_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
2430
|
+
const bgColor = chunkE5565MDK_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
2417
2431
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
2418
2432
|
switch (preset) {
|
|
2419
2433
|
case "ltHorz":
|
|
@@ -2524,11 +2538,11 @@ function parseCellBorders(cellProperties) {
|
|
|
2524
2538
|
const prstDash = ln["a:prstDash"];
|
|
2525
2539
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
2526
2540
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
2527
|
-
const color =
|
|
2541
|
+
const color = chunkE5565MDK_js.parseDrawingColor(ln["a:solidFill"]);
|
|
2528
2542
|
if (color) {
|
|
2529
|
-
const opacity =
|
|
2543
|
+
const opacity = chunkE5565MDK_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
2530
2544
|
const key = `${edge.prefix}`;
|
|
2531
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
2545
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkE5565MDK_js.colorWithOpacity(color, opacity)}`;
|
|
2532
2546
|
}
|
|
2533
2547
|
}
|
|
2534
2548
|
return borderStyle;
|
|
@@ -2541,7 +2555,7 @@ function parseCellTextEffects(runProps) {
|
|
|
2541
2555
|
const textShadowParts = [];
|
|
2542
2556
|
const outerShdw = effectLst["a:outerShdw"];
|
|
2543
2557
|
if (outerShdw) {
|
|
2544
|
-
const shdwColor =
|
|
2558
|
+
const shdwColor = chunkE5565MDK_js.parseDrawingColor(outerShdw);
|
|
2545
2559
|
if (shdwColor) {
|
|
2546
2560
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
2547
2561
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -2559,7 +2573,7 @@ function parseCellTextEffects(runProps) {
|
|
|
2559
2573
|
}
|
|
2560
2574
|
const glow = effectLst["a:glow"];
|
|
2561
2575
|
if (glow) {
|
|
2562
|
-
const glowColor =
|
|
2576
|
+
const glowColor = chunkE5565MDK_js.parseDrawingColor(glow);
|
|
2563
2577
|
if (glowColor) {
|
|
2564
2578
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
2565
2579
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -2581,11 +2595,11 @@ function extractCellText(cellXml) {
|
|
|
2581
2595
|
const textParts = [];
|
|
2582
2596
|
const runs = ensureArrayValue(paragraph["a:r"]);
|
|
2583
2597
|
runs.forEach((run) => {
|
|
2584
|
-
textParts.push(
|
|
2598
|
+
textParts.push(chunkE5565MDK_js.xmlText(run["a:t"]) ?? "");
|
|
2585
2599
|
});
|
|
2586
2600
|
const fields = ensureArrayValue(paragraph["a:fld"]);
|
|
2587
2601
|
fields.forEach((field) => {
|
|
2588
|
-
textParts.push(
|
|
2602
|
+
textParts.push(chunkE5565MDK_js.xmlText(field["a:t"]) ?? "");
|
|
2589
2603
|
});
|
|
2590
2604
|
paragraphTexts.push(textParts.join(""));
|
|
2591
2605
|
});
|
|
@@ -2629,10 +2643,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2629
2643
|
if (runProps?.["@_u"] !== void 0) {
|
|
2630
2644
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
2631
2645
|
}
|
|
2632
|
-
const runColor =
|
|
2646
|
+
const runColor = chunkE5565MDK_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkE5565MDK_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
2633
2647
|
if (runColor) {
|
|
2634
|
-
const opacity =
|
|
2635
|
-
cellStyle.color =
|
|
2648
|
+
const opacity = chunkE5565MDK_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
2649
|
+
cellStyle.color = chunkE5565MDK_js.colorWithOpacity(runColor, opacity);
|
|
2636
2650
|
}
|
|
2637
2651
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
2638
2652
|
if (fontFamily) {
|
|
@@ -2642,15 +2656,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2642
2656
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
2643
2657
|
}
|
|
2644
2658
|
const cellProperties = cellXml["a:tcPr"];
|
|
2645
|
-
const cellFill =
|
|
2659
|
+
const cellFill = chunkE5565MDK_js.parseDrawingColor(
|
|
2646
2660
|
cellProperties?.["a:solidFill"],
|
|
2647
2661
|
schemeColorOverrides
|
|
2648
2662
|
);
|
|
2649
2663
|
if (cellFill) {
|
|
2650
|
-
const opacity =
|
|
2664
|
+
const opacity = chunkE5565MDK_js.parseDrawingColorOpacity(
|
|
2651
2665
|
cellProperties?.["a:solidFill"]
|
|
2652
2666
|
);
|
|
2653
|
-
cellStyle.backgroundColor =
|
|
2667
|
+
cellStyle.backgroundColor = chunkE5565MDK_js.colorWithOpacity(cellFill, opacity);
|
|
2654
2668
|
} else {
|
|
2655
2669
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
2656
2670
|
if (gradCss) {
|
|
@@ -2665,16 +2679,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2665
2679
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
2666
2680
|
Object.assign(cellStyle, edgeBorders);
|
|
2667
2681
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
2668
|
-
const borderColor =
|
|
2682
|
+
const borderColor = chunkE5565MDK_js.parseDrawingColor(
|
|
2669
2683
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
2670
2684
|
schemeColorOverrides
|
|
2671
|
-
) ||
|
|
2685
|
+
) || chunkE5565MDK_js.parseDrawingColor(
|
|
2672
2686
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
2673
2687
|
schemeColorOverrides
|
|
2674
|
-
) ||
|
|
2688
|
+
) || chunkE5565MDK_js.parseDrawingColor(
|
|
2675
2689
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
2676
2690
|
schemeColorOverrides
|
|
2677
|
-
) ||
|
|
2691
|
+
) || chunkE5565MDK_js.parseDrawingColor(
|
|
2678
2692
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
2679
2693
|
schemeColorOverrides
|
|
2680
2694
|
);
|
|
@@ -2746,7 +2760,7 @@ function getTableCellBandStyle2(element, rowIndex, cellIndex, rowCount, columnCo
|
|
|
2746
2760
|
if (element.type !== "table") {
|
|
2747
2761
|
return void 0;
|
|
2748
2762
|
}
|
|
2749
|
-
return
|
|
2763
|
+
return chunkE5565MDK_js.getTableCellBandStyle(element.tableData, rowIndex, cellIndex, rowCount, columnCount, {
|
|
2750
2764
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
2751
2765
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
2752
2766
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -2826,7 +2840,7 @@ function renderTableCellContent(cell, fallbackText) {
|
|
|
2826
2840
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2827
2841
|
"span",
|
|
2828
2842
|
{
|
|
2829
|
-
style: { position: "relative", ...
|
|
2843
|
+
style: { position: "relative", ...chunkE5565MDK_js.cellRunStyle(run) },
|
|
2830
2844
|
children: run.text
|
|
2831
2845
|
},
|
|
2832
2846
|
`r-${index}`
|
|
@@ -2834,7 +2848,7 @@ function renderTableCellContent(cell, fallbackText) {
|
|
|
2834
2848
|
});
|
|
2835
2849
|
}
|
|
2836
2850
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
2837
|
-
return
|
|
2851
|
+
return chunkE5565MDK_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
2838
2852
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
2839
2853
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
2840
2854
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -2967,7 +2981,7 @@ function TableResizeOverlay({
|
|
|
2967
2981
|
const containerRef = React8.useRef(null);
|
|
2968
2982
|
const [rowBounds, setRowBounds] = React8.useState([]);
|
|
2969
2983
|
const dragRef = React8.useRef(null);
|
|
2970
|
-
const colBoundaries = React8.useMemo(() =>
|
|
2984
|
+
const colBoundaries = React8.useMemo(() => chunkE5565MDK_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
2971
2985
|
const measureRows = React8.useCallback(() => {
|
|
2972
2986
|
const container = containerRef.current;
|
|
2973
2987
|
if (!container) {
|
|
@@ -3014,11 +3028,11 @@ function TableResizeOverlay({
|
|
|
3014
3028
|
const rect = containerRef.current.getBoundingClientRect();
|
|
3015
3029
|
if (e.clientX !== drag.startPos && drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
3016
3030
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
3017
|
-
onResizeColumns(
|
|
3031
|
+
onResizeColumns(chunkE5565MDK_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
3018
3032
|
} else if (e.clientY !== drag.startPos && drag.type === "row" && onResizeRow) {
|
|
3019
3033
|
const deltaY = e.clientY - drag.startPos;
|
|
3020
|
-
const newHeight =
|
|
3021
|
-
drag.initialRowHeight ??
|
|
3034
|
+
const newHeight = chunkE5565MDK_js.computeResizedRowHeight(
|
|
3035
|
+
drag.initialRowHeight ?? chunkE5565MDK_js.DEFAULT_ROW_HEIGHT,
|
|
3022
3036
|
deltaY
|
|
3023
3037
|
);
|
|
3024
3038
|
onResizeRow(drag.index, newHeight);
|
|
@@ -3056,7 +3070,7 @@ function TableResizeOverlay({
|
|
|
3056
3070
|
e.stopPropagation();
|
|
3057
3071
|
const table = containerRef.current?.querySelector("table");
|
|
3058
3072
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
3059
|
-
const actualHeight = tr?.offsetHeight ??
|
|
3073
|
+
const actualHeight = tr?.offsetHeight ?? chunkE5565MDK_js.DEFAULT_ROW_HEIGHT;
|
|
3060
3074
|
document.body.style.cursor = "row-resize";
|
|
3061
3075
|
document.body.style.userSelect = "none";
|
|
3062
3076
|
dragRef.current = {
|
|
@@ -3096,14 +3110,14 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3096
3110
|
const rowCount = tableData.rows.length;
|
|
3097
3111
|
const columnCount = tableData.columnWidths.length;
|
|
3098
3112
|
const selectedCell = options?.selectedCell || null;
|
|
3099
|
-
const isEditable = Boolean(options?.editable) &&
|
|
3113
|
+
const isEditable = Boolean(options?.editable) && chunkE5565MDK_js.canDrillDown(element);
|
|
3100
3114
|
const hasCellSelectionHandler = typeof options?.onSelectCell === "function";
|
|
3101
3115
|
const sharedCtx = {
|
|
3102
3116
|
tableStyleMap: options?.styleCtx?.tableStyleMap,
|
|
3103
3117
|
colorScheme: options?.styleCtx?.theme?.colorScheme,
|
|
3104
3118
|
fontScheme: options?.styleCtx?.theme?.fontScheme
|
|
3105
3119
|
};
|
|
3106
|
-
const cellCss = (cell, rowIndex, cellIndex) =>
|
|
3120
|
+
const cellCss = (cell, rowIndex, cellIndex) => chunkE5565MDK_js.tableCellCss(
|
|
3107
3121
|
tableData,
|
|
3108
3122
|
cell,
|
|
3109
3123
|
{ rowIndex, cellIndex, rowCount, columnCount },
|
|
@@ -3116,7 +3130,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3116
3130
|
}
|
|
3117
3131
|
const first = selectedCell.selectedCells[0];
|
|
3118
3132
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
3119
|
-
return
|
|
3133
|
+
return chunkE5565MDK_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
3120
3134
|
})();
|
|
3121
3135
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3122
3136
|
TableResizeOverlay,
|
|
@@ -3137,9 +3151,9 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3137
3151
|
{
|
|
3138
3152
|
className: "w-full h-full border-collapse table-fixed",
|
|
3139
3153
|
style: {
|
|
3140
|
-
fontFamily:
|
|
3154
|
+
fontFamily: chunkE5565MDK_js.DEFAULT_FONT_FAMILY,
|
|
3141
3155
|
// `a:tblPr@rtl` mirrors the column order for RTL decks.
|
|
3142
|
-
...
|
|
3156
|
+
...chunkE5565MDK_js.tableContainerCss(tableData)
|
|
3143
3157
|
},
|
|
3144
3158
|
children: [
|
|
3145
3159
|
tableData.columnWidths.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: tableData.columnWidths.map((w, ci) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3158,7 +3172,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3158
3172
|
return null;
|
|
3159
3173
|
}
|
|
3160
3174
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
3161
|
-
const isInMultiSelection =
|
|
3175
|
+
const isInMultiSelection = chunkE5565MDK_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
3162
3176
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
3163
3177
|
const diag = getCellDiagonalBorders2(
|
|
3164
3178
|
cell.style,
|
|
@@ -3187,7 +3201,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3187
3201
|
}
|
|
3188
3202
|
event.stopPropagation();
|
|
3189
3203
|
if (event.shiftKey && selectedCell) {
|
|
3190
|
-
const rect =
|
|
3204
|
+
const rect = chunkE5565MDK_js.computeSelectionRect(
|
|
3191
3205
|
selectedCell.rowIndex,
|
|
3192
3206
|
selectedCell.columnIndex,
|
|
3193
3207
|
rowIndex,
|
|
@@ -3197,7 +3211,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3197
3211
|
options?.onSelectCell?.({
|
|
3198
3212
|
rowIndex: selectedCell.rowIndex,
|
|
3199
3213
|
columnIndex: selectedCell.columnIndex,
|
|
3200
|
-
selectedCells:
|
|
3214
|
+
selectedCells: chunkE5565MDK_js.rectToCells(rect)
|
|
3201
3215
|
});
|
|
3202
3216
|
} else {
|
|
3203
3217
|
options?.onSelectCell?.({
|
|
@@ -3258,10 +3272,10 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3258
3272
|
if (tableEl2.tableData && tableEl2.tableData.rows.length > 0) {
|
|
3259
3273
|
return renderTableFromTableData(tableEl2, textStyle, options);
|
|
3260
3274
|
}
|
|
3261
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
3275
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkKPKO2ELT_js.translationsEn["pptx.table.title"] });
|
|
3262
3276
|
}
|
|
3263
3277
|
const selectedCell = options?.selectedCell || null;
|
|
3264
|
-
const isEditable = Boolean(options?.editable) &&
|
|
3278
|
+
const isEditable = Boolean(options?.editable) && chunkE5565MDK_js.canDrillDown(element);
|
|
3265
3279
|
const hasCellSelectionHandler = typeof options?.onSelectCell === "function";
|
|
3266
3280
|
const tableEl = element;
|
|
3267
3281
|
const xmlSelectionRect = (() => {
|
|
@@ -3273,7 +3287,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3273
3287
|
}
|
|
3274
3288
|
const first = selectedCell.selectedCells[0];
|
|
3275
3289
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
3276
|
-
return
|
|
3290
|
+
return chunkE5565MDK_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
3277
3291
|
})();
|
|
3278
3292
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
3279
3293
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3295,9 +3309,9 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3295
3309
|
{
|
|
3296
3310
|
className: "w-full h-full border-collapse table-fixed",
|
|
3297
3311
|
style: {
|
|
3298
|
-
fontFamily:
|
|
3312
|
+
fontFamily: chunkE5565MDK_js.DEFAULT_FONT_FAMILY,
|
|
3299
3313
|
// `a:tblPr@rtl` mirrors the column order for RTL decks.
|
|
3300
|
-
...
|
|
3314
|
+
...chunkE5565MDK_js.tableContainerCss(tableEl.tableData)
|
|
3301
3315
|
},
|
|
3302
3316
|
children: [
|
|
3303
3317
|
parsedTable.columnPercentages.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: parsedTable.columnPercentages.map((percentage, columnIndex) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3354,7 +3368,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3354
3368
|
color: textStyle.color,
|
|
3355
3369
|
...bandStyle,
|
|
3356
3370
|
...xmlCellStyle,
|
|
3357
|
-
...tdCellOverride ?
|
|
3371
|
+
...tdCellOverride ? chunkE5565MDK_js.cellStyleToCss(tdCellOverride) : void 0,
|
|
3358
3372
|
...diag ? { position: "relative" } : void 0
|
|
3359
3373
|
};
|
|
3360
3374
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3364,7 +3378,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3364
3378
|
"border px-1 py-0.5 align-top",
|
|
3365
3379
|
isEditable && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
3366
3380
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
3367
|
-
|
|
3381
|
+
chunkE5565MDK_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
3368
3382
|
),
|
|
3369
3383
|
colSpan,
|
|
3370
3384
|
rowSpan: rSpan,
|
|
@@ -3375,7 +3389,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3375
3389
|
}
|
|
3376
3390
|
event.stopPropagation();
|
|
3377
3391
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
3378
|
-
const rect =
|
|
3392
|
+
const rect = chunkE5565MDK_js.computeSelectionRect(
|
|
3379
3393
|
selectedCell.rowIndex,
|
|
3380
3394
|
selectedCell.columnIndex,
|
|
3381
3395
|
rowIndex,
|
|
@@ -3385,7 +3399,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3385
3399
|
options?.onSelectCell?.({
|
|
3386
3400
|
rowIndex: selectedCell.rowIndex,
|
|
3387
3401
|
columnIndex: selectedCell.columnIndex,
|
|
3388
|
-
selectedCells:
|
|
3402
|
+
selectedCells: chunkE5565MDK_js.rectToCells(rect)
|
|
3389
3403
|
});
|
|
3390
3404
|
} else {
|
|
3391
3405
|
options?.onSelectCell?.({
|
|
@@ -3447,23 +3461,23 @@ function renderGradientStops(stops) {
|
|
|
3447
3461
|
return stops.map((stop, i) => /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: stop.offset, stopColor: stop.color, stopOpacity: stop.opacity }, i));
|
|
3448
3462
|
}
|
|
3449
3463
|
function partAttrs(part) {
|
|
3450
|
-
return part ?
|
|
3464
|
+
return part ? chunkE5565MDK_js.chartPartToAttrs(part) : void 0;
|
|
3451
3465
|
}
|
|
3452
3466
|
function resolveReactPalette(chartData) {
|
|
3453
3467
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
3454
3468
|
return chartData.colorPalette;
|
|
3455
3469
|
}
|
|
3456
|
-
return [...
|
|
3470
|
+
return [...chunkE5565MDK_js.getChartStylePalette(chartData.style?.styleId)];
|
|
3457
3471
|
}
|
|
3458
3472
|
function buildReactChartViewModel(element) {
|
|
3459
3473
|
if (element.type !== "chart" || !element.chartData) {
|
|
3460
|
-
return
|
|
3474
|
+
return chunkE5565MDK_js.buildChartViewModel(element);
|
|
3461
3475
|
}
|
|
3462
3476
|
const palette = resolveReactPalette(element.chartData), themedElement = {
|
|
3463
3477
|
...element,
|
|
3464
3478
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
3465
3479
|
};
|
|
3466
|
-
return
|
|
3480
|
+
return chunkE5565MDK_js.buildChartViewModel(themedElement);
|
|
3467
3481
|
}
|
|
3468
3482
|
function renderPrimitive(prim, key) {
|
|
3469
3483
|
switch (prim.kind) {
|
|
@@ -3615,7 +3629,7 @@ function renderText(t, key) {
|
|
|
3615
3629
|
);
|
|
3616
3630
|
}
|
|
3617
3631
|
function renderChartViewModel(elementId, vm, preserveAspectRatio = "none") {
|
|
3618
|
-
const legendItems =
|
|
3632
|
+
const legendItems = chunkE5565MDK_js.computeChartLegendLayout(vm);
|
|
3619
3633
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3620
3634
|
"svg",
|
|
3621
3635
|
{
|
|
@@ -3778,17 +3792,17 @@ function renderChartViewModel(elementId, vm, preserveAspectRatio = "none") {
|
|
|
3778
3792
|
}
|
|
3779
3793
|
function renderChartElement(element) {
|
|
3780
3794
|
if (element.type !== "chart") {
|
|
3781
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
3795
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkKPKO2ELT_js.translationsEn["pptx.chart.heading"] });
|
|
3782
3796
|
}
|
|
3783
3797
|
const chartData = element.chartData;
|
|
3784
3798
|
if (!chartData || chartData.series.length === 0) {
|
|
3785
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
3799
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkKPKO2ELT_js.translationsEn["pptx.chart.heading"] });
|
|
3786
3800
|
}
|
|
3787
|
-
const kind =
|
|
3801
|
+
const kind = chunkE5565MDK_js.resolveChartKind(chartData.chartType ?? "bar");
|
|
3788
3802
|
return renderChartViewModel(
|
|
3789
3803
|
element.id,
|
|
3790
3804
|
buildReactChartViewModel(element),
|
|
3791
|
-
|
|
3805
|
+
chunkE5565MDK_js.chartPreserveAspectRatio(kind)
|
|
3792
3806
|
);
|
|
3793
3807
|
}
|
|
3794
3808
|
|
|
@@ -3808,14 +3822,14 @@ function buildNotesPdf(pages) {
|
|
|
3808
3822
|
notes: page.notes,
|
|
3809
3823
|
slideNumber: page.slideNumber
|
|
3810
3824
|
}));
|
|
3811
|
-
const bytes =
|
|
3825
|
+
const bytes = chunkE5565MDK_js.buildNotesPdfBytes(images, meta);
|
|
3812
3826
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
3813
3827
|
return URL.createObjectURL(blob);
|
|
3814
3828
|
}
|
|
3815
3829
|
|
|
3816
3830
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
3817
3831
|
function buildPdfFromTiledImageData(pages) {
|
|
3818
|
-
const bytes =
|
|
3832
|
+
const bytes = chunkE5565MDK_js.buildTiledSlidesPdfBytes(pages);
|
|
3819
3833
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
3820
3834
|
return URL.createObjectURL(blob);
|
|
3821
3835
|
}
|
|
@@ -3824,7 +3838,11 @@ function buildPdfFromTiledImageData(pages) {
|
|
|
3824
3838
|
var activePreview = null;
|
|
3825
3839
|
function startPreviewAnimation(elementId, preset, options) {
|
|
3826
3840
|
stopPreviewAnimation();
|
|
3827
|
-
const
|
|
3841
|
+
const domEl = document.querySelector(`[data-element-id="${elementId}"]`);
|
|
3842
|
+
const descriptor = chunkE5565MDK_js.buildPreviewAnimation(preset, {
|
|
3843
|
+
...options,
|
|
3844
|
+
geometry: domEl ? chunkE5565MDK_js.measurePreviewGeometry(domEl) : void 0
|
|
3845
|
+
});
|
|
3828
3846
|
if (!descriptor) {
|
|
3829
3847
|
return;
|
|
3830
3848
|
}
|
|
@@ -3837,7 +3855,7 @@ function startMotionPathPreview(elementId, path, options) {
|
|
|
3837
3855
|
return;
|
|
3838
3856
|
}
|
|
3839
3857
|
const stage = domEl.offsetParent;
|
|
3840
|
-
const descriptor =
|
|
3858
|
+
const descriptor = chunkE5565MDK_js.buildMotionPathPreview({
|
|
3841
3859
|
path,
|
|
3842
3860
|
slideWidth: stage?.offsetWidth || DEFAULT_PREVIEW_SLIDE_WIDTH,
|
|
3843
3861
|
slideHeight: stage?.offsetHeight || DEFAULT_PREVIEW_SLIDE_HEIGHT,
|