pptx-react-viewer 3.15.0 → 3.16.1
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 +44 -0
- package/dist/{AiChatPanel-7CWOJ3PS.js → AiChatPanel-BUKJCMUY.js} +24 -24
- package/dist/AiChatPanel-BUKJCMUY.js.br +0 -0
- package/dist/AiChatPanel-BUKJCMUY.js.gz +0 -0
- package/dist/{AiChatPanel-TBIAQSZ7.mjs → AiChatPanel-US56QZBD.mjs} +3 -3
- package/dist/AiChatPanel-US56QZBD.mjs.br +0 -0
- package/dist/AiChatPanel-US56QZBD.mjs.gz +0 -0
- package/dist/{Area3DChartScene-6FFBYPHF.mjs → Area3DChartScene-6E4QEVTU.mjs} +1 -1
- package/dist/Area3DChartScene-6E4QEVTU.mjs.br +0 -0
- package/dist/Area3DChartScene-6E4QEVTU.mjs.gz +0 -0
- package/dist/{Area3DChartScene-ZJYR6K66.js → Area3DChartScene-APGQOK5A.js} +2 -2
- package/dist/{Area3DChartScene-ZJYR6K66.js.br → Area3DChartScene-APGQOK5A.js.br} +0 -0
- package/dist/Area3DChartScene-APGQOK5A.js.gz +0 -0
- package/dist/{Bar3DChartScene-42MWINQX.mjs → Bar3DChartScene-5GRGZFE4.mjs} +1 -1
- package/dist/Bar3DChartScene-5GRGZFE4.mjs.br +0 -0
- package/dist/Bar3DChartScene-5GRGZFE4.mjs.gz +0 -0
- package/dist/{Bar3DChartScene-JP3BXEZW.js → Bar3DChartScene-F4B5TNJR.js} +2 -2
- package/dist/{Bar3DChartScene-JP3BXEZW.js.br → Bar3DChartScene-F4B5TNJR.js.br} +0 -0
- package/dist/Bar3DChartScene-F4B5TNJR.js.gz +0 -0
- package/dist/{Line3DChartScene-YVCSJMWK.mjs → Line3DChartScene-2VRLE5RI.mjs} +1 -1
- package/dist/Line3DChartScene-2VRLE5RI.mjs.br +0 -0
- package/dist/Line3DChartScene-2VRLE5RI.mjs.gz +0 -0
- package/dist/{Line3DChartScene-JK3AELXZ.js → Line3DChartScene-6FUMMX2T.js} +2 -2
- package/dist/{Line3DChartScene-JK3AELXZ.js.br → Line3DChartScene-6FUMMX2T.js.br} +0 -0
- package/dist/Line3DChartScene-6FUMMX2T.js.gz +0 -0
- package/dist/{Model3DScene-N6UIMN7T.js → Model3DScene-2MGI3CB6.js} +2 -2
- package/dist/Model3DScene-2MGI3CB6.js.br +0 -0
- package/dist/Model3DScene-2MGI3CB6.js.gz +0 -0
- package/dist/{Model3DScene-OXWSYHHK.mjs → Model3DScene-TCIKWJ7R.mjs} +1 -1
- package/dist/{Model3DScene-OXWSYHHK.mjs.br → Model3DScene-TCIKWJ7R.mjs.br} +0 -0
- package/dist/Model3DScene-TCIKWJ7R.mjs.gz +0 -0
- package/dist/{PieChart3DScene-XK4ETZJC.mjs → PieChart3DScene-O5NZKI4T.mjs} +1 -1
- package/dist/{PieChart3DScene-XK4ETZJC.mjs.br → PieChart3DScene-O5NZKI4T.mjs.br} +0 -0
- package/dist/PieChart3DScene-O5NZKI4T.mjs.gz +0 -0
- package/dist/{PieChart3DScene-Q2Z3ECL4.js → PieChart3DScene-OFZEEZRO.js} +2 -2
- package/dist/{PieChart3DScene-Q2Z3ECL4.js.br → PieChart3DScene-OFZEEZRO.js.br} +0 -0
- package/dist/PieChart3DScene-OFZEEZRO.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-ULBUIF7T.js → SurfaceChart3DScene-EK7KFNUQ.js} +2 -2
- package/dist/{SurfaceChart3DScene-ULBUIF7T.js.br → SurfaceChart3DScene-EK7KFNUQ.js.br} +0 -0
- package/dist/SurfaceChart3DScene-EK7KFNUQ.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-KNWMKMOL.mjs → SurfaceChart3DScene-WXPQGMT3.mjs} +1 -1
- package/dist/SurfaceChart3DScene-WXPQGMT3.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-WXPQGMT3.mjs.gz +0 -0
- package/dist/{chunk-YNTZCMRI.mjs → chunk-2DZJJ3VO.mjs} +1145 -435
- package/dist/chunk-2DZJJ3VO.mjs.br +0 -0
- package/dist/chunk-2DZJJ3VO.mjs.gz +0 -0
- package/dist/{chunk-GLY4OPMY.js → chunk-2J64KPXY.js} +167 -167
- package/dist/chunk-2J64KPXY.js.br +0 -0
- package/dist/chunk-2J64KPXY.js.gz +0 -0
- package/dist/{chunk-C4Q4WYAJ.mjs → chunk-BDQBJ3AM.mjs} +12 -34
- package/dist/chunk-BDQBJ3AM.mjs.br +0 -0
- package/dist/chunk-BDQBJ3AM.mjs.gz +0 -0
- package/dist/{chunk-VVJTEFGP.js → chunk-C553GQRH.js} +5 -5
- package/dist/chunk-C553GQRH.js.br +0 -0
- package/dist/chunk-C553GQRH.js.gz +0 -0
- package/dist/{chunk-Q6CSZ7VM.js → chunk-CPWFKDGB.js} +1292 -1292
- package/dist/chunk-CPWFKDGB.js.br +0 -0
- package/dist/chunk-CPWFKDGB.js.gz +0 -0
- package/dist/{chunk-6547ZWC7.mjs → chunk-GQVOQPNT.mjs} +15 -15
- package/dist/chunk-GQVOQPNT.mjs.br +0 -0
- package/dist/chunk-GQVOQPNT.mjs.gz +0 -0
- package/dist/{chunk-5KAMDV37.js → chunk-LDFWF2KT.js} +1147 -439
- package/dist/chunk-LDFWF2KT.js.br +0 -0
- package/dist/chunk-LDFWF2KT.js.gz +0 -0
- package/dist/{chunk-LAB7WX2N.js → chunk-Q2EGTNCU.js} +456 -478
- package/dist/chunk-Q2EGTNCU.js.br +0 -0
- package/dist/chunk-Q2EGTNCU.js.gz +0 -0
- package/dist/{chunk-AT4BJKON.mjs → chunk-UISMOSNU.mjs} +1 -1
- package/dist/chunk-UISMOSNU.mjs.br +0 -0
- package/dist/chunk-UISMOSNU.mjs.gz +0 -0
- package/dist/{chunk-J7Q7AGN7.mjs → chunk-VK3ASDDP.mjs} +1 -1
- package/dist/chunk-VK3ASDDP.mjs.br +0 -0
- package/dist/chunk-VK3ASDDP.mjs.gz +0 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +45 -45
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +2 -0
- package/dist/internals.js +78 -78
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +3 -3
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/viewer/index.d.ts +2 -0
- package/dist/viewer/index.js +26 -26
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +5 -5
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +2 -2
- package/dist/AiChatPanel-7CWOJ3PS.js.br +0 -0
- package/dist/AiChatPanel-7CWOJ3PS.js.gz +0 -0
- package/dist/AiChatPanel-TBIAQSZ7.mjs.br +0 -0
- package/dist/AiChatPanel-TBIAQSZ7.mjs.gz +0 -0
- package/dist/Area3DChartScene-6FFBYPHF.mjs.br +0 -0
- package/dist/Area3DChartScene-6FFBYPHF.mjs.gz +0 -0
- package/dist/Area3DChartScene-ZJYR6K66.js.gz +0 -0
- package/dist/Bar3DChartScene-42MWINQX.mjs.br +0 -0
- package/dist/Bar3DChartScene-42MWINQX.mjs.gz +0 -0
- package/dist/Bar3DChartScene-JP3BXEZW.js.gz +0 -0
- package/dist/Line3DChartScene-JK3AELXZ.js.gz +0 -0
- package/dist/Line3DChartScene-YVCSJMWK.mjs.br +0 -0
- package/dist/Line3DChartScene-YVCSJMWK.mjs.gz +0 -0
- package/dist/Model3DScene-N6UIMN7T.js.br +0 -0
- package/dist/Model3DScene-N6UIMN7T.js.gz +0 -0
- package/dist/Model3DScene-OXWSYHHK.mjs.gz +0 -0
- package/dist/PieChart3DScene-Q2Z3ECL4.js.gz +0 -0
- package/dist/PieChart3DScene-XK4ETZJC.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-KNWMKMOL.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-KNWMKMOL.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-ULBUIF7T.js.gz +0 -0
- package/dist/chunk-5KAMDV37.js.br +0 -0
- package/dist/chunk-5KAMDV37.js.gz +0 -0
- package/dist/chunk-6547ZWC7.mjs.br +0 -0
- package/dist/chunk-6547ZWC7.mjs.gz +0 -0
- package/dist/chunk-AT4BJKON.mjs.br +0 -0
- package/dist/chunk-AT4BJKON.mjs.gz +0 -0
- package/dist/chunk-C4Q4WYAJ.mjs.br +0 -0
- package/dist/chunk-C4Q4WYAJ.mjs.gz +0 -0
- package/dist/chunk-GLY4OPMY.js.br +0 -0
- package/dist/chunk-GLY4OPMY.js.gz +0 -0
- package/dist/chunk-J7Q7AGN7.mjs.br +0 -0
- package/dist/chunk-J7Q7AGN7.mjs.gz +0 -0
- package/dist/chunk-LAB7WX2N.js.br +0 -0
- package/dist/chunk-LAB7WX2N.js.gz +0 -0
- package/dist/chunk-Q6CSZ7VM.js.br +0 -0
- package/dist/chunk-Q6CSZ7VM.js.gz +0 -0
- package/dist/chunk-VVJTEFGP.js.br +0 -0
- package/dist/chunk-VVJTEFGP.js.gz +0 -0
- package/dist/chunk-YNTZCMRI.mjs.br +0 -0
- package/dist/chunk-YNTZCMRI.mjs.gz +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkLDFWF2KT_js = require('./chunk-LDFWF2KT.js');
|
|
4
4
|
var chunk3AJ54EAB_js = require('./chunk-3AJ54EAB.js');
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var tailwindMerge = require('tailwind-merge');
|
|
@@ -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 chunkLDFWF2KT_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 chunkLDFWF2KT_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 = chunkLDFWF2KT_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 = chunkLDFWF2KT_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 = chunkLDFWF2KT_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 (!chunkLDFWF2KT_js.hasShapeProperties(element)) {
|
|
227
227
|
return false;
|
|
228
228
|
}
|
|
229
229
|
const st = getShapeType(element.shapeType);
|
|
@@ -232,17 +232,17 @@ function isConnectorOrLineElement(element) {
|
|
|
232
232
|
|
|
233
233
|
// src/viewer/utils/image-style.ts
|
|
234
234
|
function getImageMaskStyle(element) {
|
|
235
|
-
if (!
|
|
235
|
+
if (!chunkLDFWF2KT_js.hasShapeProperties(element)) {
|
|
236
236
|
return void 0;
|
|
237
237
|
}
|
|
238
|
-
const geometry =
|
|
238
|
+
const geometry = chunkLDFWF2KT_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 =
|
|
245
|
+
const fit = chunkLDFWF2KT_js.getImageFitStyle(element);
|
|
246
246
|
return {
|
|
247
247
|
// A translated/scaled crop must be masked by its stationary wrapper, not
|
|
248
248
|
// by the moving bitmap itself.
|
|
@@ -259,7 +259,7 @@ function getImageSurfaceMaskStyle(element) {
|
|
|
259
259
|
};
|
|
260
260
|
}
|
|
261
261
|
function getImageSurfaceStyle(element) {
|
|
262
|
-
const fill =
|
|
262
|
+
const fill = chunkLDFWF2KT_js.hasShapeProperties(element) ? chunkLDFWF2KT_js.getComputedFillStyle(element) : void 0;
|
|
263
263
|
return {
|
|
264
264
|
position: "absolute",
|
|
265
265
|
inset: 0,
|
|
@@ -272,13 +272,13 @@ function getImageSurfaceStyle(element) {
|
|
|
272
272
|
};
|
|
273
273
|
}
|
|
274
274
|
function getCropShapeClipPath2(element) {
|
|
275
|
-
if (!
|
|
275
|
+
if (!chunkLDFWF2KT_js.isImageLikeElement(element)) {
|
|
276
276
|
return void 0;
|
|
277
277
|
}
|
|
278
|
-
return
|
|
278
|
+
return chunkLDFWF2KT_js.getCropShapeClipPath(element.cropShape, element.width, element.height);
|
|
279
279
|
}
|
|
280
280
|
function getImageTilingStyle2(element) {
|
|
281
|
-
return
|
|
281
|
+
return chunkLDFWF2KT_js.getImageTilingStyle(element);
|
|
282
282
|
}
|
|
283
283
|
|
|
284
284
|
// src/viewer/utils/geometry-image.ts
|
|
@@ -410,7 +410,7 @@ function VideoWithMetadata({
|
|
|
410
410
|
{
|
|
411
411
|
ref: mediaRef,
|
|
412
412
|
className: "w-full h-full pointer-events-auto",
|
|
413
|
-
style: isFullScreen ? { objectFit: "cover" } :
|
|
413
|
+
style: isFullScreen ? { objectFit: "cover" } : chunkLDFWF2KT_js.getImageFitStyle(element),
|
|
414
414
|
controls: showTransport,
|
|
415
415
|
preload: "metadata",
|
|
416
416
|
playsInline: true,
|
|
@@ -467,7 +467,7 @@ function PresentationMediaController({
|
|
|
467
467
|
const [isMediaPlaying, setIsMediaPlaying] = React7.useState(false);
|
|
468
468
|
const trimStartSec = element.trimStartMs !== void 0 ? element.trimStartMs / 1e3 : 0;
|
|
469
469
|
const hideWhenNotPlaying = isPresentationMode && element.hideWhenNotPlaying === true;
|
|
470
|
-
const { volume: playbackVolume, playbackRate } =
|
|
470
|
+
const { volume: playbackVolume, playbackRate } = chunkLDFWF2KT_js.mediaPlaybackAttributes({
|
|
471
471
|
loop: element.loop,
|
|
472
472
|
volume: element.volume,
|
|
473
473
|
playbackSpeed: element.playbackSpeed
|
|
@@ -515,7 +515,7 @@ function PresentationMediaController({
|
|
|
515
515
|
if (!el || !isPresentationMode) {
|
|
516
516
|
return;
|
|
517
517
|
}
|
|
518
|
-
return
|
|
518
|
+
return chunkLDFWF2KT_js.scheduleMediaTrimAndFade(el, {
|
|
519
519
|
trimStartMs: element.trimStartMs,
|
|
520
520
|
trimEndMs: element.trimEndMs,
|
|
521
521
|
fadeInDuration: element.fadeInDuration,
|
|
@@ -536,7 +536,7 @@ function PresentationMediaController({
|
|
|
536
536
|
}
|
|
537
537
|
if (element.playAcrossSlides && element.mediaType === "audio") {
|
|
538
538
|
const dataUrl = element.mediaData ?? resolvedDataUrl;
|
|
539
|
-
if (
|
|
539
|
+
if (chunkLDFWF2KT_js.registerCrossSlideAudio(element, dataUrl)) {
|
|
540
540
|
return;
|
|
541
541
|
}
|
|
542
542
|
}
|
|
@@ -617,17 +617,17 @@ function Badge({
|
|
|
617
617
|
"div",
|
|
618
618
|
{
|
|
619
619
|
className: `absolute inset-0 flex flex-col items-center justify-center ${isMissing ? "gap-1" : ""}`,
|
|
620
|
-
...{ [
|
|
620
|
+
...{ [chunkLDFWF2KT_js.MEDIA_CHROME_ATTRIBUTE]: visual.badge },
|
|
621
621
|
children: [
|
|
622
622
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
623
623
|
FallbackIcon,
|
|
624
624
|
{
|
|
625
|
-
paths:
|
|
625
|
+
paths: chunkLDFWF2KT_js.mediaFallbackIcon(visual, element.mediaType),
|
|
626
626
|
size: isMissing ? 32 : 48,
|
|
627
627
|
className: isMissing ? "text-white/60" : "text-white/80 drop-shadow-md"
|
|
628
628
|
}
|
|
629
629
|
),
|
|
630
|
-
isMissing && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: label(
|
|
630
|
+
isMissing && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: label(chunkLDFWF2KT_js.mediaFallbackLabelKey(visual, element.mediaType)) })
|
|
631
631
|
]
|
|
632
632
|
}
|
|
633
633
|
);
|
|
@@ -644,17 +644,17 @@ function Placeholder({
|
|
|
644
644
|
"div",
|
|
645
645
|
{
|
|
646
646
|
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"}`,
|
|
647
|
-
...{ [
|
|
647
|
+
...{ [chunkLDFWF2KT_js.MEDIA_CHROME_ATTRIBUTE]: visual.placeholder },
|
|
648
648
|
children: [
|
|
649
649
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
650
650
|
FallbackIcon,
|
|
651
651
|
{
|
|
652
|
-
paths:
|
|
652
|
+
paths: chunkLDFWF2KT_js.mediaFallbackIcon(visual, element.mediaType),
|
|
653
653
|
size: isMissing ? 36 : element.mediaType === "audio" ? 24 : 32,
|
|
654
654
|
className: isMissing ? "text-white/50" : "text-white/70"
|
|
655
655
|
}
|
|
656
656
|
),
|
|
657
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `text-[10px] ${isMissing ? "text-white/50" : "text-white/70"}`, children: label(
|
|
657
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `text-[10px] ${isMissing ? "text-white/50" : "text-white/70"}`, children: label(chunkLDFWF2KT_js.mediaFallbackLabelKey(visual, element.mediaType)) })
|
|
658
658
|
]
|
|
659
659
|
}
|
|
660
660
|
);
|
|
@@ -664,7 +664,7 @@ function renderMediaFallback({
|
|
|
664
664
|
posterUrl,
|
|
665
665
|
surface
|
|
666
666
|
}) {
|
|
667
|
-
const visual =
|
|
667
|
+
const visual = chunkLDFWF2KT_js.mediaFallbackVisual(surface, {
|
|
668
668
|
hasPoster: Boolean(posterUrl),
|
|
669
669
|
missing: element.mediaMissing === true
|
|
670
670
|
});
|
|
@@ -676,7 +676,7 @@ function renderMediaFallback({
|
|
|
676
676
|
src: posterUrl,
|
|
677
677
|
alt: visual.dimPoster ? chunk3AJ54EAB_js.translationsEn["pptx.media.posterAlt"] : chunk3AJ54EAB_js.translationsEn["pptx.media.videoPosterAlt"],
|
|
678
678
|
className: `w-full h-full${visual.dimPoster ? " opacity-50" : ""}`,
|
|
679
|
-
style:
|
|
679
|
+
style: chunkLDFWF2KT_js.getImageFitStyle(element)
|
|
680
680
|
}
|
|
681
681
|
),
|
|
682
682
|
/* @__PURE__ */ jsxRuntime.jsx(Badge, { visual, element })
|
|
@@ -694,7 +694,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
694
694
|
const dataUrl = element.mediaData ?? (mediaPath ? mediaDataUrls.get(mediaPath) : void 0);
|
|
695
695
|
const trimFragment = buildTrimFragment(element);
|
|
696
696
|
const posterUrl = element.posterFrameData ?? void 0;
|
|
697
|
-
const shouldLoop =
|
|
697
|
+
const shouldLoop = chunkLDFWF2KT_js.mediaPlaybackAttributes(element).loop;
|
|
698
698
|
const shouldAutoPlay = options?.autoPlay === true || element.autoPlay === true;
|
|
699
699
|
const isFullScreen = options?.fullScreen === true;
|
|
700
700
|
const isPresentationMode = options?.isPresentationMode === true;
|
|
@@ -777,20 +777,20 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
777
777
|
|
|
778
778
|
// src/viewer/utils/text-utils.tsx
|
|
779
779
|
function getTextStyleForElement(element, fallbackColor) {
|
|
780
|
-
return
|
|
780
|
+
return chunkLDFWF2KT_js.buildTextBlockStyle(element, { fallbackColor });
|
|
781
781
|
}
|
|
782
782
|
|
|
783
783
|
// src/viewer/utils/text-layout.tsx
|
|
784
784
|
function getTextLayoutStyle(element) {
|
|
785
|
-
if (!
|
|
785
|
+
if (!chunkLDFWF2KT_js.hasTextProperties(element)) {
|
|
786
786
|
return {};
|
|
787
787
|
}
|
|
788
|
-
const writingMode =
|
|
789
|
-
const textOrientation =
|
|
790
|
-
const verticalDirection =
|
|
788
|
+
const writingMode = chunkLDFWF2KT_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
789
|
+
const textOrientation = chunkLDFWF2KT_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
790
|
+
const verticalDirection = chunkLDFWF2KT_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
791
791
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
792
792
|
const shapeAutoFitTextBox = element.textStyle?.autoFitMode === "shrink" && (element.type === "text" || element.locks?.txBox === true);
|
|
793
|
-
const hasParagraphIndents =
|
|
793
|
+
const hasParagraphIndents = chunkLDFWF2KT_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
794
794
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
795
795
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
796
796
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
@@ -799,7 +799,7 @@ function getTextLayoutStyle(element) {
|
|
|
799
799
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
800
800
|
return {
|
|
801
801
|
// Columns / flex anchoring / anchorCtr / tab-size / kinsoku, from shared.
|
|
802
|
-
...
|
|
802
|
+
...chunkLDFWF2KT_js.buildTextBodyLayoutStyle(element),
|
|
803
803
|
// Body inset only. Paragraph spacing (spcBef/spcAft) is applied
|
|
804
804
|
// per-paragraph by the paragraph renderer, not collapsed here.
|
|
805
805
|
paddingTop: bodyTop,
|
|
@@ -827,7 +827,7 @@ function getTextLayoutStyle(element) {
|
|
|
827
827
|
|
|
828
828
|
// src/viewer/utils/text-effects.tsx
|
|
829
829
|
function buildTextBody3DSceneStyle2(textStyle, elementSize) {
|
|
830
|
-
return
|
|
830
|
+
return chunkLDFWF2KT_js.buildTextBody3DSceneStyle(textStyle, elementSize);
|
|
831
831
|
}
|
|
832
832
|
|
|
833
833
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -1012,13 +1012,13 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1012
1012
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
1013
1013
|
return renderedSegments;
|
|
1014
1014
|
}
|
|
1015
|
-
const paraKey = `${elementId}${
|
|
1015
|
+
const paraKey = `${elementId}${chunkLDFWF2KT_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
1016
1016
|
const paraState = subElementAnimStates.get(paraKey);
|
|
1017
1017
|
if (paraState) {
|
|
1018
1018
|
const style = buildAnimStyle(paraState);
|
|
1019
1019
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
1020
1020
|
}
|
|
1021
|
-
const spec =
|
|
1021
|
+
const spec = chunkLDFWF2KT_js.buildTextBuildSpec(
|
|
1022
1022
|
elementId,
|
|
1023
1023
|
paraIndex,
|
|
1024
1024
|
paraRuns.map((run) => ({ text: run.text, style: run })),
|
|
@@ -1036,7 +1036,7 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1036
1036
|
"span",
|
|
1037
1037
|
{
|
|
1038
1038
|
"data-anim-id": span.animId,
|
|
1039
|
-
style:
|
|
1039
|
+
style: chunkLDFWF2KT_js.textBuildSpanStyle(span),
|
|
1040
1040
|
children: content
|
|
1041
1041
|
},
|
|
1042
1042
|
span.animId
|
|
@@ -1047,13 +1047,13 @@ function renderUnderlineWords(text, isUnderlineWords, wordDecoration, metric, ke
|
|
|
1047
1047
|
if (!isUnderlineWords || !text) {
|
|
1048
1048
|
return inner(text, keyPrefix, metric);
|
|
1049
1049
|
}
|
|
1050
|
-
const pieces =
|
|
1050
|
+
const pieces = chunkLDFWF2KT_js.splitWordsForUnderline(text);
|
|
1051
1051
|
if (pieces.length === 0) {
|
|
1052
1052
|
return inner(text, keyPrefix, metric);
|
|
1053
1053
|
}
|
|
1054
1054
|
const gapMetric = metric ? {
|
|
1055
1055
|
...metric,
|
|
1056
|
-
nestedStyle: metric.nestedStyle ?
|
|
1056
|
+
nestedStyle: metric.nestedStyle ? chunkLDFWF2KT_js.stripUnderlineDecoration(metric.nestedStyle) : void 0
|
|
1057
1057
|
} : void 0;
|
|
1058
1058
|
return pieces.map((piece, i) => {
|
|
1059
1059
|
const key = `${keyPrefix}-u${i}`;
|
|
@@ -1086,7 +1086,7 @@ function makeSegmentPieceRenderer(needsScriptFonts, scriptFonts, baseFontFamily,
|
|
|
1086
1086
|
);
|
|
1087
1087
|
}
|
|
1088
1088
|
function renderTabbedLine(line, ctx, keyPrefix, renderPiece, nestedStyle, underlineWords = false) {
|
|
1089
|
-
const [lineLayout] =
|
|
1089
|
+
const [lineLayout] = chunkLDFWF2KT_js.buildRunTabLines(
|
|
1090
1090
|
line,
|
|
1091
1091
|
ctx,
|
|
1092
1092
|
nestedStyle,
|
|
@@ -1105,7 +1105,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1105
1105
|
if (!needsScriptFonts || !text) {
|
|
1106
1106
|
return text;
|
|
1107
1107
|
}
|
|
1108
|
-
const pieces =
|
|
1108
|
+
const pieces = chunkLDFWF2KT_js.splitRunByScriptFont(
|
|
1109
1109
|
text,
|
|
1110
1110
|
scriptFonts,
|
|
1111
1111
|
baseFontFamily,
|
|
@@ -1122,7 +1122,7 @@ function renderMetricPieces(text, metric, keyPrefix, inner) {
|
|
|
1122
1122
|
if (!metric || !text) {
|
|
1123
1123
|
return inner(text, keyPrefix);
|
|
1124
1124
|
}
|
|
1125
|
-
const pieces =
|
|
1125
|
+
const pieces = chunkLDFWF2KT_js.splitRunForMetrics(text, metric.font);
|
|
1126
1126
|
if (pieces.length <= 1) {
|
|
1127
1127
|
return inner(text, keyPrefix);
|
|
1128
1128
|
}
|
|
@@ -1131,7 +1131,7 @@ function renderMetricPieces(text, metric, keyPrefix, inner) {
|
|
|
1131
1131
|
{
|
|
1132
1132
|
style: {
|
|
1133
1133
|
...metric.nestedStyle,
|
|
1134
|
-
letterSpacing:
|
|
1134
|
+
letterSpacing: chunkLDFWF2KT_js.pieceLetterSpacing(metric.authoredPx, piece.tracking)
|
|
1135
1135
|
},
|
|
1136
1136
|
children: inner(piece.text, `${keyPrefix}-w${i}`)
|
|
1137
1137
|
},
|
|
@@ -1207,8 +1207,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1207
1207
|
});
|
|
1208
1208
|
}
|
|
1209
1209
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
1210
|
-
const mathml =
|
|
1211
|
-
const safeMathml = mathml ?
|
|
1210
|
+
const mathml = chunkLDFWF2KT_js.convertOmmlToMathMl(equationXml);
|
|
1211
|
+
const safeMathml = mathml ? chunkLDFWF2KT_js.sanitizeMathMl(mathml) : "";
|
|
1212
1212
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1213
1213
|
"span",
|
|
1214
1214
|
{
|
|
@@ -1337,7 +1337,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1337
1337
|
const segmentStyle = segment?.style ?? {};
|
|
1338
1338
|
const textValue = run.text;
|
|
1339
1339
|
const lines = textValue.split("\n");
|
|
1340
|
-
const resolvedSegmentColor =
|
|
1340
|
+
const resolvedSegmentColor = chunkLDFWF2KT_js.normalizeHexColor(
|
|
1341
1341
|
segmentStyle.color || element.textStyle?.color,
|
|
1342
1342
|
run.hyperlink ? HYPERLINK_COLOR : fallbackColor
|
|
1343
1343
|
);
|
|
@@ -1345,16 +1345,16 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1345
1345
|
const baselineFraction = rawBaseline === 0 ? 0 : Math.abs(rawBaseline) >= 1e3 ? rawBaseline / 1e5 : rawBaseline / 100;
|
|
1346
1346
|
const baselineFontScale = baselineFraction !== 0 ? BASELINE_FONT_SCALE : 1;
|
|
1347
1347
|
const rawFontSize = segmentStyle.fontSize || element.textStyle?.fontSize || DEFAULT_TEXT_FONT_SIZE;
|
|
1348
|
-
const baseFontSize = rawFontSize *
|
|
1348
|
+
const baseFontSize = rawFontSize * chunkLDFWF2KT_js.resolveAutoFitFontScale(element.textStyle);
|
|
1349
1349
|
const baselineShift = baselineFraction !== 0 ? `${baselineFraction * baseFontSize}px` : void 0;
|
|
1350
|
-
const fontKerning =
|
|
1350
|
+
const fontKerning = chunkLDFWF2KT_js.resolveFontKerning(segmentStyle.kerning, baseFontSize);
|
|
1351
1351
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
1352
|
-
const baseFontFamily = rawFontFamily ?
|
|
1352
|
+
const baseFontFamily = rawFontFamily ? chunkLDFWF2KT_js.getSubstituteFontFamily(
|
|
1353
1353
|
rawFontFamily,
|
|
1354
|
-
|
|
1354
|
+
chunkLDFWF2KT_js.parsePanoseString(segmentStyle.latinFontPanose ?? element.textStyle?.latinFontPanose)
|
|
1355
1355
|
) : DEFAULT_FONT_FAMILY2;
|
|
1356
|
-
const scriptFonts =
|
|
1357
|
-
const needsScriptFonts =
|
|
1356
|
+
const scriptFonts = chunkLDFWF2KT_js.resolveScriptFontSet(segmentStyle, element.textStyle, baseFontFamily);
|
|
1357
|
+
const needsScriptFonts = chunkLDFWF2KT_js.hasDistinctScriptFonts(scriptFonts);
|
|
1358
1358
|
const authoredLetterSpacing = typeof segmentStyle.characterSpacing === "number" && segmentStyle.characterSpacing !== 0 ? segmentStyle.characterSpacing / 100 * (96 / 72) : 0;
|
|
1359
1359
|
const metricFont = {
|
|
1360
1360
|
fontFamily: baseFontFamily,
|
|
@@ -1362,7 +1362,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1362
1362
|
bold: Boolean(segmentStyle.bold),
|
|
1363
1363
|
italic: Boolean(segmentStyle.italic)
|
|
1364
1364
|
};
|
|
1365
|
-
const nestedStyle =
|
|
1365
|
+
const nestedStyle = chunkLDFWF2KT_js.nestedTextDecorationStyle(run.style);
|
|
1366
1366
|
const metricContext = { font: metricFont, authoredPx: authoredLetterSpacing, nestedStyle };
|
|
1367
1367
|
const spanStyle = { ...run.style };
|
|
1368
1368
|
spanStyle.color = resolvedSegmentColor;
|
|
@@ -1370,11 +1370,11 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1370
1370
|
spanStyle.fontFamily = baseFontFamily;
|
|
1371
1371
|
spanStyle.verticalAlign = baselineShift;
|
|
1372
1372
|
spanStyle.fontKerning = fontKerning;
|
|
1373
|
-
spanStyle.letterSpacing =
|
|
1373
|
+
spanStyle.letterSpacing = chunkLDFWF2KT_js.pieceLetterSpacing(
|
|
1374
1374
|
authoredLetterSpacing,
|
|
1375
|
-
|
|
1375
|
+
chunkLDFWF2KT_js.resolveMetricTrackingPx(textValue, metricFont)
|
|
1376
1376
|
);
|
|
1377
|
-
const hollow =
|
|
1377
|
+
const hollow = chunkLDFWF2KT_js.hollowTextFillStyle(segmentStyle, {
|
|
1378
1378
|
color: resolvedSegmentColor,
|
|
1379
1379
|
textStroke: typeof spanStyle.WebkitTextStroke === "string" ? spanStyle.WebkitTextStroke : void 0
|
|
1380
1380
|
});
|
|
@@ -1389,7 +1389,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1389
1389
|
const isUnderlineWords = Boolean(segmentStyle.underline) && segmentStyle.underlineStyle === "words";
|
|
1390
1390
|
const wordDecoration = isUnderlineWords ? nestedStyle ?? run.underlineWordPieces?.find((piece) => piece.style)?.style : void 0;
|
|
1391
1391
|
if (isUnderlineWords) {
|
|
1392
|
-
const stripped =
|
|
1392
|
+
const stripped = chunkLDFWF2KT_js.stripUnderlineDecoration(spanStyle);
|
|
1393
1393
|
spanStyle.textDecoration = stripped.textDecoration;
|
|
1394
1394
|
delete spanStyle.textDecorationStyle;
|
|
1395
1395
|
delete spanStyle.textDecorationThickness;
|
|
@@ -1405,7 +1405,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1405
1405
|
scriptFonts,
|
|
1406
1406
|
baseFontFamily,
|
|
1407
1407
|
findHighlights,
|
|
1408
|
-
|
|
1408
|
+
chunkLDFWF2KT_js.buildTabContext(
|
|
1409
1409
|
element.textStyle?.tabStops,
|
|
1410
1410
|
element.textStyle?.defaultTabSize,
|
|
1411
1411
|
baseFontSize,
|
|
@@ -1433,7 +1433,7 @@ function renderRubyOrText(run, baseContent) {
|
|
|
1433
1433
|
] });
|
|
1434
1434
|
}
|
|
1435
1435
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick, placeholderPrompt) {
|
|
1436
|
-
if (!
|
|
1436
|
+
if (!chunkLDFWF2KT_js.hasTextProperties(element)) {
|
|
1437
1437
|
return emptyFallback || null;
|
|
1438
1438
|
}
|
|
1439
1439
|
const segments = segmentOverrides ?? element.textSegments;
|
|
@@ -1443,7 +1443,7 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
1443
1443
|
}
|
|
1444
1444
|
return element.text || emptyFallback || "";
|
|
1445
1445
|
}
|
|
1446
|
-
const paragraphs =
|
|
1446
|
+
const paragraphs = chunkLDFWF2KT_js.buildParagraphs(element, fieldContext, segmentOverrides);
|
|
1447
1447
|
const ctx = {
|
|
1448
1448
|
element,
|
|
1449
1449
|
fallbackColor,
|
|
@@ -1569,13 +1569,13 @@ function renderBulletMarker(para, paraIndex, elementId) {
|
|
|
1569
1569
|
);
|
|
1570
1570
|
}
|
|
1571
1571
|
function getDuotoneColors(element) {
|
|
1572
|
-
if (!
|
|
1572
|
+
if (!chunkLDFWF2KT_js.isImageLikeElement(element)) {
|
|
1573
1573
|
return void 0;
|
|
1574
1574
|
}
|
|
1575
1575
|
return element.imageEffects?.duotone;
|
|
1576
1576
|
}
|
|
1577
1577
|
function buildLineShadowCss(element) {
|
|
1578
|
-
if (!
|
|
1578
|
+
if (!chunkLDFWF2KT_js.hasShapeProperties(element)) {
|
|
1579
1579
|
return void 0;
|
|
1580
1580
|
}
|
|
1581
1581
|
const ss = element.shapeStyle;
|
|
@@ -1586,13 +1586,13 @@ function buildLineShadowCss(element) {
|
|
|
1586
1586
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
1587
1587
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
1588
1588
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
1589
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
1590
|
-
|
|
1589
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkLDFWF2KT_js.colorWithOpacity(
|
|
1590
|
+
chunkLDFWF2KT_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
1591
1591
|
opacity
|
|
1592
1592
|
)}`;
|
|
1593
1593
|
}
|
|
1594
1594
|
function buildLineGlowFilter(element) {
|
|
1595
|
-
if (!
|
|
1595
|
+
if (!chunkLDFWF2KT_js.hasShapeProperties(element)) {
|
|
1596
1596
|
return void 0;
|
|
1597
1597
|
}
|
|
1598
1598
|
const ss = element.shapeStyle;
|
|
@@ -1601,22 +1601,22 @@ function buildLineGlowFilter(element) {
|
|
|
1601
1601
|
}
|
|
1602
1602
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
1603
1603
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
1604
|
-
const glowCol =
|
|
1604
|
+
const glowCol = chunkLDFWF2KT_js.colorWithOpacity(chunkLDFWF2KT_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
1605
1605
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
1606
1606
|
}
|
|
1607
1607
|
function getDagDuotoneFilterId(elementId) {
|
|
1608
1608
|
return `dag-duotone-${elementId}`;
|
|
1609
1609
|
}
|
|
1610
1610
|
function hasDagDuotoneEffect(element) {
|
|
1611
|
-
if (!
|
|
1611
|
+
if (!chunkLDFWF2KT_js.hasShapeProperties(element)) {
|
|
1612
1612
|
return false;
|
|
1613
1613
|
}
|
|
1614
1614
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
1615
1615
|
}
|
|
1616
1616
|
function renderDagDuotoneSvgFilter(elementId, color1, color2) {
|
|
1617
1617
|
const filterId = getDagDuotoneFilterId(elementId);
|
|
1618
|
-
const c1 =
|
|
1619
|
-
const c2 =
|
|
1618
|
+
const c1 = chunkLDFWF2KT_js.hexToRgbUnit(color1);
|
|
1619
|
+
const c2 = chunkLDFWF2KT_js.hexToRgbUnit(color2);
|
|
1620
1620
|
const grayscaleMatrix = [
|
|
1621
1621
|
0.2126,
|
|
1622
1622
|
0.7152,
|
|
@@ -1660,7 +1660,7 @@ function renderDagDuotoneSvgFilter(elementId, color1, color2) {
|
|
|
1660
1660
|
|
|
1661
1661
|
// src/viewer/utils/shape-visual-3d.ts
|
|
1662
1662
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
1663
|
-
return
|
|
1663
|
+
return chunkLDFWF2KT_js.build3DExtrusionData(
|
|
1664
1664
|
shape3d,
|
|
1665
1665
|
scene3d,
|
|
1666
1666
|
fillColor,
|
|
@@ -1669,7 +1669,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
1669
1669
|
);
|
|
1670
1670
|
}
|
|
1671
1671
|
function apply3dEffects2(base, scene3d, shape3d, fillColorFallback, elementSize, elementId) {
|
|
1672
|
-
|
|
1672
|
+
chunkLDFWF2KT_js.apply3dEffects(
|
|
1673
1673
|
base,
|
|
1674
1674
|
scene3d,
|
|
1675
1675
|
shape3d,
|
|
@@ -1684,11 +1684,11 @@ function rendersCustomVectorPath(element) {
|
|
|
1684
1684
|
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;
|
|
1685
1685
|
}
|
|
1686
1686
|
function rendersWedgeCalloutVector(element) {
|
|
1687
|
-
return element.type === "shape" &&
|
|
1687
|
+
return element.type === "shape" && chunkLDFWF2KT_js.isWedgeCalloutPresetShape(element.shapeType);
|
|
1688
1688
|
}
|
|
1689
1689
|
function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _strokeColor, animatesFill, animatesStroke, parentGroupFill) {
|
|
1690
1690
|
if (element.type === "group") {
|
|
1691
|
-
const fx2 =
|
|
1691
|
+
const fx2 = chunkLDFWF2KT_js.getComputedEffectStyle(element);
|
|
1692
1692
|
const groupStyle = {};
|
|
1693
1693
|
if (fx2.filter) {
|
|
1694
1694
|
groupStyle.filter = fx2.filter;
|
|
@@ -1698,13 +1698,13 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1698
1698
|
}
|
|
1699
1699
|
return groupStyle;
|
|
1700
1700
|
}
|
|
1701
|
-
if (!
|
|
1701
|
+
if (!chunkLDFWF2KT_js.hasShapeProperties(element)) {
|
|
1702
1702
|
return {};
|
|
1703
1703
|
}
|
|
1704
1704
|
const ss = element.shapeStyle;
|
|
1705
|
-
const fill = animatesFill ? void 0 :
|
|
1706
|
-
const fx =
|
|
1707
|
-
const stroke =
|
|
1705
|
+
const fill = animatesFill ? void 0 : chunkLDFWF2KT_js.getComputedFillStyle(element, parentGroupFill);
|
|
1706
|
+
const fx = chunkLDFWF2KT_js.getComputedEffectStyle(element);
|
|
1707
|
+
const stroke = chunkLDFWF2KT_js.getComputedStrokeStyle(element);
|
|
1708
1708
|
const base = {
|
|
1709
1709
|
// A gradient fill REPLACES the solid fill, it does not sit on top of it;
|
|
1710
1710
|
// the whole precedence lives in shared's `getComputedFillStyle`.
|
|
@@ -1743,7 +1743,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1743
1743
|
};
|
|
1744
1744
|
Object.assign(
|
|
1745
1745
|
base,
|
|
1746
|
-
|
|
1746
|
+
chunkLDFWF2KT_js.getAnimationColorBaseStyle(element, {
|
|
1747
1747
|
animatesFill,
|
|
1748
1748
|
animatesStroke,
|
|
1749
1749
|
parentGroupFill
|
|
@@ -1765,7 +1765,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1765
1765
|
},
|
|
1766
1766
|
element.id
|
|
1767
1767
|
);
|
|
1768
|
-
if (rendersCustomVectorPath(element) || rendersWedgeCalloutVector(element) ||
|
|
1768
|
+
if (rendersCustomVectorPath(element) || rendersWedgeCalloutVector(element) || chunkLDFWF2KT_js.isStrokeOnlyPresetElement(element)) {
|
|
1769
1769
|
base.backgroundColor = "transparent";
|
|
1770
1770
|
base.backgroundImage = void 0;
|
|
1771
1771
|
base.borderWidth = void 0;
|
|
@@ -1779,7 +1779,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1779
1779
|
if (rendersWedgeCalloutVector(element)) {
|
|
1780
1780
|
return base;
|
|
1781
1781
|
}
|
|
1782
|
-
const geometry =
|
|
1782
|
+
const geometry = chunkLDFWF2KT_js.resolveShapeGeometry(element);
|
|
1783
1783
|
switch (geometry.kind) {
|
|
1784
1784
|
case "bare":
|
|
1785
1785
|
return { backgroundColor: "transparent", borderWidth: 0, borderStyle: "none" };
|
|
@@ -1805,13 +1805,13 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1805
1805
|
function getConnectorAdjustment(element, key, fallback) {
|
|
1806
1806
|
const direct = element.shapeAdjustments?.[key];
|
|
1807
1807
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
1808
|
-
return
|
|
1808
|
+
return chunkLDFWF2KT_js.clampUnitInterval(direct / 1e5);
|
|
1809
1809
|
}
|
|
1810
1810
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
1811
1811
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
1812
|
-
return
|
|
1812
|
+
return chunkLDFWF2KT_js.clampUnitInterval(fallbackKey / 1e5);
|
|
1813
1813
|
}
|
|
1814
|
-
return
|
|
1814
|
+
return chunkLDFWF2KT_js.clampUnitInterval(fallback);
|
|
1815
1815
|
}
|
|
1816
1816
|
function getConnectorPathGeometry(element) {
|
|
1817
1817
|
const width = Math.max(element.width, 0);
|
|
@@ -1976,11 +1976,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
|
|
|
1976
1976
|
strokePaint,
|
|
1977
1977
|
strokeWidth,
|
|
1978
1978
|
dashArray,
|
|
1979
|
-
lineCap:
|
|
1979
|
+
lineCap: chunkLDFWF2KT_js.svgLineCap(shapeStyle?.lineCap),
|
|
1980
1980
|
lineJoin,
|
|
1981
1981
|
miterLimit,
|
|
1982
|
-
offsets:
|
|
1983
|
-
widths:
|
|
1982
|
+
offsets: chunkLDFWF2KT_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
1983
|
+
widths: chunkLDFWF2KT_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
|
|
1984
1984
|
};
|
|
1985
1985
|
}
|
|
1986
1986
|
function strokeStrands(d, keyBase, ctx) {
|
|
@@ -2003,12 +2003,12 @@ function strokeStrands(d, keyBase, ctx) {
|
|
|
2003
2003
|
}
|
|
2004
2004
|
function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredPaths, shapeStyle, hasFill, fillColor, fillOpacity, strokePaint, strokeWidth, dashArray, animatesFill = false, gradient) {
|
|
2005
2005
|
const ctx = strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray);
|
|
2006
|
-
const subpaths = structuredPaths && structuredPaths.length > 0 ?
|
|
2006
|
+
const subpaths = structuredPaths && structuredPaths.length > 0 ? chunkLDFWF2KT_js.customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
2007
2007
|
const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
|
|
2008
|
-
const gradientPaint = gradient ?
|
|
2008
|
+
const gradientPaint = gradient ? chunkLDFWF2KT_js.svgGradientFillRef(gradient) : void 0;
|
|
2009
2009
|
const nodes = [];
|
|
2010
2010
|
if (subpaths && needsPerSubpath) {
|
|
2011
|
-
const paints =
|
|
2011
|
+
const paints = chunkLDFWF2KT_js.buildSubpathPaints(subpaths, hasFill, fillColor, fillOpacity);
|
|
2012
2012
|
paints.forEach((paint, idx) => {
|
|
2013
2013
|
if (paint.fill !== "none") {
|
|
2014
2014
|
const mode = subpaths[idx]?.fillMode;
|
|
@@ -2037,7 +2037,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2037
2037
|
"path",
|
|
2038
2038
|
{
|
|
2039
2039
|
d: pathData,
|
|
2040
|
-
fill: animatesFill ? "inherit" : gradientPaint ??
|
|
2040
|
+
fill: animatesFill ? "inherit" : gradientPaint ?? chunkLDFWF2KT_js.colorWithOpacity(fillColor, fillOpacity),
|
|
2041
2041
|
stroke: "none",
|
|
2042
2042
|
vectorEffect: "non-scaling-stroke"
|
|
2043
2043
|
},
|
|
@@ -2063,14 +2063,14 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2063
2063
|
);
|
|
2064
2064
|
}
|
|
2065
2065
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2066
|
-
if (!
|
|
2066
|
+
if (!chunkLDFWF2KT_js.hasShapeProperties(element)) {
|
|
2067
2067
|
return null;
|
|
2068
2068
|
}
|
|
2069
2069
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
2070
|
-
const fillPaint = animatesFill ? "inherit" :
|
|
2071
|
-
const strokePaint = animatesStroke ? "inherit" :
|
|
2072
|
-
const dashType =
|
|
2073
|
-
const dashArray =
|
|
2070
|
+
const fillPaint = animatesFill ? "inherit" : chunkLDFWF2KT_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
2071
|
+
const strokePaint = animatesStroke ? "inherit" : chunkLDFWF2KT_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
2072
|
+
const dashType = chunkLDFWF2KT_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2073
|
+
const dashArray = chunkLDFWF2KT_js.getSvgStrokeDasharray(
|
|
2074
2074
|
dashType,
|
|
2075
2075
|
Math.max(strokeWidth, 1),
|
|
2076
2076
|
element.shapeStyle?.customDashSegments
|
|
@@ -2151,13 +2151,13 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2151
2151
|
// container's `background-image` is suppressed for custom geometry, so
|
|
2152
2152
|
// without this the shape fell back to the parser's representative solid
|
|
2153
2153
|
// and lost every fade (issue #132).
|
|
2154
|
-
|
|
2154
|
+
chunkLDFWF2KT_js.buildSvgGradientDef(element.shapeStyle, element.id)
|
|
2155
2155
|
);
|
|
2156
2156
|
}
|
|
2157
|
-
if ((element.type === "image" || element.type === "picture") && strokeWidth > 0 && !
|
|
2157
|
+
if ((element.type === "image" || element.type === "picture") && strokeWidth > 0 && !chunkLDFWF2KT_js.buildStrokeOutline(element)) {
|
|
2158
2158
|
const width = Math.max(element.width, 1);
|
|
2159
2159
|
const height = Math.max(element.height, 1);
|
|
2160
|
-
const geometry =
|
|
2160
|
+
const geometry = chunkLDFWF2KT_js.getPresetShapeVectorGeometry(
|
|
2161
2161
|
element.shapeType || "rect",
|
|
2162
2162
|
width,
|
|
2163
2163
|
height,
|
|
@@ -2185,18 +2185,18 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2185
2185
|
);
|
|
2186
2186
|
}
|
|
2187
2187
|
}
|
|
2188
|
-
if (element.type === "shape" &&
|
|
2188
|
+
if (element.type === "shape" && chunkLDFWF2KT_js.isWedgeCalloutPresetShape(element.shapeType)) {
|
|
2189
2189
|
const width = Math.max(element.width, 1);
|
|
2190
2190
|
const height = Math.max(element.height, 1);
|
|
2191
|
-
const geometry =
|
|
2191
|
+
const geometry = chunkLDFWF2KT_js.getPresetShapeVectorGeometry(
|
|
2192
2192
|
element.shapeType,
|
|
2193
2193
|
width,
|
|
2194
2194
|
height,
|
|
2195
2195
|
element.shapeAdjustments
|
|
2196
2196
|
);
|
|
2197
2197
|
if (geometry) {
|
|
2198
|
-
const gradient =
|
|
2199
|
-
const gradientPaint = gradient ?
|
|
2198
|
+
const gradient = chunkLDFWF2KT_js.buildSvgGradientDef(element.shapeStyle, element.id);
|
|
2199
|
+
const gradientPaint = gradient ? chunkLDFWF2KT_js.svgGradientFillRef(gradient) : void 0;
|
|
2200
2200
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2201
2201
|
"svg",
|
|
2202
2202
|
{
|
|
@@ -2229,18 +2229,18 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2229
2229
|
);
|
|
2230
2230
|
}
|
|
2231
2231
|
}
|
|
2232
|
-
if (
|
|
2232
|
+
if (chunkLDFWF2KT_js.isCalloutShape(normalizedType)) {
|
|
2233
2233
|
const width = Math.max(element.width, 1);
|
|
2234
2234
|
const height = Math.max(element.height, 1);
|
|
2235
|
-
const geometry =
|
|
2235
|
+
const geometry = chunkLDFWF2KT_js.getCalloutLeaderLineGeometry(
|
|
2236
2236
|
normalizedType,
|
|
2237
2237
|
width,
|
|
2238
2238
|
height,
|
|
2239
2239
|
element.shapeAdjustments
|
|
2240
2240
|
);
|
|
2241
2241
|
if (geometry && geometry.points.length >= 2) {
|
|
2242
|
-
const leaderPath =
|
|
2243
|
-
const bounds =
|
|
2242
|
+
const leaderPath = chunkLDFWF2KT_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
2243
|
+
const bounds = chunkLDFWF2KT_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
2244
2244
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
2245
2245
|
const offsetLeft = bounds.minX;
|
|
2246
2246
|
const offsetTop = bounds.minY;
|
|
@@ -2303,10 +2303,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2303
2303
|
const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
|
|
2304
2304
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
2305
2305
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
2306
|
-
const connectorLineCap =
|
|
2306
|
+
const connectorLineCap = chunkLDFWF2KT_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
2307
2307
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
2308
|
-
const offsets =
|
|
2309
|
-
const widths =
|
|
2308
|
+
const offsets = chunkLDFWF2KT_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
2309
|
+
const widths = chunkLDFWF2KT_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
2310
2310
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2311
2311
|
"svg",
|
|
2312
2312
|
{
|
|
@@ -2373,15 +2373,15 @@ function parseGradientFillCss(gradFill) {
|
|
|
2373
2373
|
}
|
|
2374
2374
|
const rawStops = stops.map((gs) => {
|
|
2375
2375
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
2376
|
-
const color =
|
|
2377
|
-
const opacity =
|
|
2376
|
+
const color = chunkLDFWF2KT_js.parseDrawingColor(gs) ?? "#888888";
|
|
2377
|
+
const opacity = chunkLDFWF2KT_js.parseDrawingColorOpacity(gs);
|
|
2378
2378
|
return { position: pos, color, opacity };
|
|
2379
2379
|
}).sort((a, b) => a.position - b.position);
|
|
2380
|
-
const stopStrings = rawStops.map((s) => `${
|
|
2380
|
+
const stopStrings = rawStops.map((s) => `${chunkLDFWF2KT_js.colorWithOpacity(s.color, s.opacity)} ${s.position.toFixed(1)}%`).join(", ");
|
|
2381
2381
|
const lin = gradFill["a:lin"];
|
|
2382
2382
|
if (lin) {
|
|
2383
2383
|
const angRaw = Number.parseInt(String(lin["@_ang"] || "0"), 10);
|
|
2384
|
-
const angleDeg = Math.round(
|
|
2384
|
+
const angleDeg = Math.round(chunkLDFWF2KT_js.ooxmlGradientAngleToCssDegrees(angRaw / 6e4));
|
|
2385
2385
|
return `linear-gradient(${angleDeg}deg, ${stopStrings})`;
|
|
2386
2386
|
}
|
|
2387
2387
|
const path = gradFill["a:path"];
|
|
@@ -2395,7 +2395,7 @@ function parseGradientFillCss(gradFill) {
|
|
|
2395
2395
|
b: Number.parseInt(String(fillToRectXml["@_b"] || "0"), 10) / 1e5
|
|
2396
2396
|
} : void 0;
|
|
2397
2397
|
if (pathType === "rect") {
|
|
2398
|
-
return
|
|
2398
|
+
return chunkLDFWF2KT_js.buildRectPathGradient(rawStops, void 0, fillToRect);
|
|
2399
2399
|
}
|
|
2400
2400
|
let cx = 50;
|
|
2401
2401
|
let cy = 50;
|
|
@@ -2417,8 +2417,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
2417
2417
|
if (!pattFill) {
|
|
2418
2418
|
return void 0;
|
|
2419
2419
|
}
|
|
2420
|
-
const fgColor =
|
|
2421
|
-
const bgColor =
|
|
2420
|
+
const fgColor = chunkLDFWF2KT_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
2421
|
+
const bgColor = chunkLDFWF2KT_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
2422
2422
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
2423
2423
|
switch (preset) {
|
|
2424
2424
|
case "ltHorz":
|
|
@@ -2529,11 +2529,11 @@ function parseCellBorders(cellProperties) {
|
|
|
2529
2529
|
const prstDash = ln["a:prstDash"];
|
|
2530
2530
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
2531
2531
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
2532
|
-
const color =
|
|
2532
|
+
const color = chunkLDFWF2KT_js.parseDrawingColor(ln["a:solidFill"]);
|
|
2533
2533
|
if (color) {
|
|
2534
|
-
const opacity =
|
|
2534
|
+
const opacity = chunkLDFWF2KT_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
2535
2535
|
const key = `${edge.prefix}`;
|
|
2536
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
2536
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkLDFWF2KT_js.colorWithOpacity(color, opacity)}`;
|
|
2537
2537
|
}
|
|
2538
2538
|
}
|
|
2539
2539
|
return borderStyle;
|
|
@@ -2546,7 +2546,7 @@ function parseCellTextEffects(runProps) {
|
|
|
2546
2546
|
const textShadowParts = [];
|
|
2547
2547
|
const outerShdw = effectLst["a:outerShdw"];
|
|
2548
2548
|
if (outerShdw) {
|
|
2549
|
-
const shdwColor =
|
|
2549
|
+
const shdwColor = chunkLDFWF2KT_js.parseDrawingColor(outerShdw);
|
|
2550
2550
|
if (shdwColor) {
|
|
2551
2551
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
2552
2552
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -2564,7 +2564,7 @@ function parseCellTextEffects(runProps) {
|
|
|
2564
2564
|
}
|
|
2565
2565
|
const glow = effectLst["a:glow"];
|
|
2566
2566
|
if (glow) {
|
|
2567
|
-
const glowColor =
|
|
2567
|
+
const glowColor = chunkLDFWF2KT_js.parseDrawingColor(glow);
|
|
2568
2568
|
if (glowColor) {
|
|
2569
2569
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
2570
2570
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -2644,10 +2644,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2644
2644
|
if (runProps?.["@_u"] !== void 0) {
|
|
2645
2645
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
2646
2646
|
}
|
|
2647
|
-
const runColor =
|
|
2647
|
+
const runColor = chunkLDFWF2KT_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkLDFWF2KT_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
2648
2648
|
if (runColor) {
|
|
2649
|
-
const opacity =
|
|
2650
|
-
cellStyle.color =
|
|
2649
|
+
const opacity = chunkLDFWF2KT_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
2650
|
+
cellStyle.color = chunkLDFWF2KT_js.colorWithOpacity(runColor, opacity);
|
|
2651
2651
|
}
|
|
2652
2652
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
2653
2653
|
if (fontFamily) {
|
|
@@ -2657,15 +2657,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2657
2657
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
2658
2658
|
}
|
|
2659
2659
|
const cellProperties = cellXml["a:tcPr"];
|
|
2660
|
-
const cellFill =
|
|
2660
|
+
const cellFill = chunkLDFWF2KT_js.parseDrawingColor(
|
|
2661
2661
|
cellProperties?.["a:solidFill"],
|
|
2662
2662
|
schemeColorOverrides
|
|
2663
2663
|
);
|
|
2664
2664
|
if (cellFill) {
|
|
2665
|
-
const opacity =
|
|
2665
|
+
const opacity = chunkLDFWF2KT_js.parseDrawingColorOpacity(
|
|
2666
2666
|
cellProperties?.["a:solidFill"]
|
|
2667
2667
|
);
|
|
2668
|
-
cellStyle.backgroundColor =
|
|
2668
|
+
cellStyle.backgroundColor = chunkLDFWF2KT_js.colorWithOpacity(cellFill, opacity);
|
|
2669
2669
|
} else {
|
|
2670
2670
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
2671
2671
|
if (gradCss) {
|
|
@@ -2680,16 +2680,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2680
2680
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
2681
2681
|
Object.assign(cellStyle, edgeBorders);
|
|
2682
2682
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
2683
|
-
const borderColor =
|
|
2683
|
+
const borderColor = chunkLDFWF2KT_js.parseDrawingColor(
|
|
2684
2684
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
2685
2685
|
schemeColorOverrides
|
|
2686
|
-
) ||
|
|
2686
|
+
) || chunkLDFWF2KT_js.parseDrawingColor(
|
|
2687
2687
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
2688
2688
|
schemeColorOverrides
|
|
2689
|
-
) ||
|
|
2689
|
+
) || chunkLDFWF2KT_js.parseDrawingColor(
|
|
2690
2690
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
2691
2691
|
schemeColorOverrides
|
|
2692
|
-
) ||
|
|
2692
|
+
) || chunkLDFWF2KT_js.parseDrawingColor(
|
|
2693
2693
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
2694
2694
|
schemeColorOverrides
|
|
2695
2695
|
);
|
|
@@ -2761,7 +2761,7 @@ function getTableCellBandStyle2(element, rowIndex, cellIndex, rowCount, columnCo
|
|
|
2761
2761
|
if (element.type !== "table") {
|
|
2762
2762
|
return void 0;
|
|
2763
2763
|
}
|
|
2764
|
-
return
|
|
2764
|
+
return chunkLDFWF2KT_js.getTableCellBandStyle(element.tableData, rowIndex, cellIndex, rowCount, columnCount, {
|
|
2765
2765
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
2766
2766
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
2767
2767
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -2837,7 +2837,7 @@ function renderTableCellContent(cell, fallbackText) {
|
|
|
2837
2837
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2838
2838
|
"span",
|
|
2839
2839
|
{
|
|
2840
|
-
style: { position: "relative", ...
|
|
2840
|
+
style: { position: "relative", ...chunkLDFWF2KT_js.cellRunStyle(run) },
|
|
2841
2841
|
children: run.text
|
|
2842
2842
|
},
|
|
2843
2843
|
`r-${index}`
|
|
@@ -2845,7 +2845,7 @@ function renderTableCellContent(cell, fallbackText) {
|
|
|
2845
2845
|
});
|
|
2846
2846
|
}
|
|
2847
2847
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
2848
|
-
return
|
|
2848
|
+
return chunkLDFWF2KT_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
2849
2849
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
2850
2850
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
2851
2851
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -2978,7 +2978,7 @@ function TableResizeOverlay({
|
|
|
2978
2978
|
const containerRef = React7.useRef(null);
|
|
2979
2979
|
const [rowBounds, setRowBounds] = React7.useState([]);
|
|
2980
2980
|
const dragRef = React7.useRef(null);
|
|
2981
|
-
const colBoundaries = React7.useMemo(() =>
|
|
2981
|
+
const colBoundaries = React7.useMemo(() => chunkLDFWF2KT_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
2982
2982
|
const measureRows = React7.useCallback(() => {
|
|
2983
2983
|
const container = containerRef.current;
|
|
2984
2984
|
if (!container) {
|
|
@@ -3025,11 +3025,11 @@ function TableResizeOverlay({
|
|
|
3025
3025
|
const rect = containerRef.current.getBoundingClientRect();
|
|
3026
3026
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
3027
3027
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
3028
|
-
onResizeColumns(
|
|
3028
|
+
onResizeColumns(chunkLDFWF2KT_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
3029
3029
|
} else if (drag.type === "row" && onResizeRow) {
|
|
3030
3030
|
const deltaY = e.clientY - drag.startPos;
|
|
3031
|
-
const newHeight =
|
|
3032
|
-
drag.initialRowHeight ??
|
|
3031
|
+
const newHeight = chunkLDFWF2KT_js.computeResizedRowHeight(
|
|
3032
|
+
drag.initialRowHeight ?? chunkLDFWF2KT_js.DEFAULT_ROW_HEIGHT,
|
|
3033
3033
|
deltaY
|
|
3034
3034
|
);
|
|
3035
3035
|
onResizeRow(drag.index, newHeight);
|
|
@@ -3067,7 +3067,7 @@ function TableResizeOverlay({
|
|
|
3067
3067
|
e.stopPropagation();
|
|
3068
3068
|
const table = containerRef.current?.querySelector("table");
|
|
3069
3069
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
3070
|
-
const actualHeight = tr?.offsetHeight ??
|
|
3070
|
+
const actualHeight = tr?.offsetHeight ?? chunkLDFWF2KT_js.DEFAULT_ROW_HEIGHT;
|
|
3071
3071
|
document.body.style.cursor = "row-resize";
|
|
3072
3072
|
document.body.style.userSelect = "none";
|
|
3073
3073
|
dragRef.current = {
|
|
@@ -3107,14 +3107,14 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3107
3107
|
const rowCount = tableData.rows.length;
|
|
3108
3108
|
const columnCount = tableData.columnWidths.length;
|
|
3109
3109
|
const selectedCell = options?.selectedCell || null;
|
|
3110
|
-
const isEditable = Boolean(options?.editable) &&
|
|
3110
|
+
const isEditable = Boolean(options?.editable) && chunkLDFWF2KT_js.canDrillDown(element);
|
|
3111
3111
|
const hasCellSelectionHandler = typeof options?.onSelectCell === "function";
|
|
3112
3112
|
const sharedCtx = {
|
|
3113
3113
|
tableStyleMap: options?.styleCtx?.tableStyleMap,
|
|
3114
3114
|
colorScheme: options?.styleCtx?.theme?.colorScheme,
|
|
3115
3115
|
fontScheme: options?.styleCtx?.theme?.fontScheme
|
|
3116
3116
|
};
|
|
3117
|
-
const cellCss = (cell, rowIndex, cellIndex) =>
|
|
3117
|
+
const cellCss = (cell, rowIndex, cellIndex) => chunkLDFWF2KT_js.tableCellCss(
|
|
3118
3118
|
tableData,
|
|
3119
3119
|
cell,
|
|
3120
3120
|
{ rowIndex, cellIndex, rowCount, columnCount },
|
|
@@ -3127,7 +3127,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3127
3127
|
}
|
|
3128
3128
|
const first = selectedCell.selectedCells[0];
|
|
3129
3129
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
3130
|
-
return
|
|
3130
|
+
return chunkLDFWF2KT_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
3131
3131
|
})();
|
|
3132
3132
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3133
3133
|
TableResizeOverlay,
|
|
@@ -3148,9 +3148,9 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3148
3148
|
{
|
|
3149
3149
|
className: "w-full h-full border-collapse table-fixed",
|
|
3150
3150
|
style: {
|
|
3151
|
-
fontFamily:
|
|
3151
|
+
fontFamily: chunkLDFWF2KT_js.DEFAULT_FONT_FAMILY,
|
|
3152
3152
|
// `a:tblPr@rtl` mirrors the column order for RTL decks.
|
|
3153
|
-
...
|
|
3153
|
+
...chunkLDFWF2KT_js.tableContainerCss(tableData)
|
|
3154
3154
|
},
|
|
3155
3155
|
children: [
|
|
3156
3156
|
tableData.columnWidths.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: tableData.columnWidths.map((w, ci) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3169,7 +3169,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3169
3169
|
return null;
|
|
3170
3170
|
}
|
|
3171
3171
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
3172
|
-
const isInMultiSelection =
|
|
3172
|
+
const isInMultiSelection = chunkLDFWF2KT_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
3173
3173
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
3174
3174
|
const diag = getCellDiagonalBorders2(
|
|
3175
3175
|
cell.style,
|
|
@@ -3198,7 +3198,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3198
3198
|
}
|
|
3199
3199
|
event.stopPropagation();
|
|
3200
3200
|
if (event.shiftKey && selectedCell) {
|
|
3201
|
-
const rect =
|
|
3201
|
+
const rect = chunkLDFWF2KT_js.computeSelectionRect(
|
|
3202
3202
|
selectedCell.rowIndex,
|
|
3203
3203
|
selectedCell.columnIndex,
|
|
3204
3204
|
rowIndex,
|
|
@@ -3208,7 +3208,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3208
3208
|
options?.onSelectCell?.({
|
|
3209
3209
|
rowIndex: selectedCell.rowIndex,
|
|
3210
3210
|
columnIndex: selectedCell.columnIndex,
|
|
3211
|
-
selectedCells:
|
|
3211
|
+
selectedCells: chunkLDFWF2KT_js.rectToCells(rect)
|
|
3212
3212
|
});
|
|
3213
3213
|
} else {
|
|
3214
3214
|
options?.onSelectCell?.({
|
|
@@ -3272,7 +3272,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3272
3272
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunk3AJ54EAB_js.translationsEn["pptx.table.title"] });
|
|
3273
3273
|
}
|
|
3274
3274
|
const selectedCell = options?.selectedCell || null;
|
|
3275
|
-
const isEditable = Boolean(options?.editable) &&
|
|
3275
|
+
const isEditable = Boolean(options?.editable) && chunkLDFWF2KT_js.canDrillDown(element);
|
|
3276
3276
|
const hasCellSelectionHandler = typeof options?.onSelectCell === "function";
|
|
3277
3277
|
const tableEl = element;
|
|
3278
3278
|
const xmlSelectionRect = (() => {
|
|
@@ -3284,7 +3284,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3284
3284
|
}
|
|
3285
3285
|
const first = selectedCell.selectedCells[0];
|
|
3286
3286
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
3287
|
-
return
|
|
3287
|
+
return chunkLDFWF2KT_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
3288
3288
|
})();
|
|
3289
3289
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
3290
3290
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3306,9 +3306,9 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3306
3306
|
{
|
|
3307
3307
|
className: "w-full h-full border-collapse table-fixed",
|
|
3308
3308
|
style: {
|
|
3309
|
-
fontFamily:
|
|
3309
|
+
fontFamily: chunkLDFWF2KT_js.DEFAULT_FONT_FAMILY,
|
|
3310
3310
|
// `a:tblPr@rtl` mirrors the column order for RTL decks.
|
|
3311
|
-
...
|
|
3311
|
+
...chunkLDFWF2KT_js.tableContainerCss(tableEl.tableData)
|
|
3312
3312
|
},
|
|
3313
3313
|
children: [
|
|
3314
3314
|
parsedTable.columnPercentages.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: parsedTable.columnPercentages.map((percentage, columnIndex) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3365,7 +3365,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3365
3365
|
color: textStyle.color,
|
|
3366
3366
|
...bandStyle,
|
|
3367
3367
|
...xmlCellStyle,
|
|
3368
|
-
...tdCellOverride ?
|
|
3368
|
+
...tdCellOverride ? chunkLDFWF2KT_js.cellStyleToCss(tdCellOverride) : void 0,
|
|
3369
3369
|
...diag ? { position: "relative" } : void 0
|
|
3370
3370
|
};
|
|
3371
3371
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3375,7 +3375,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3375
3375
|
"border px-1 py-0.5 align-top",
|
|
3376
3376
|
isEditable && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
3377
3377
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
3378
|
-
|
|
3378
|
+
chunkLDFWF2KT_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
3379
3379
|
),
|
|
3380
3380
|
colSpan,
|
|
3381
3381
|
rowSpan: rSpan,
|
|
@@ -3386,7 +3386,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3386
3386
|
}
|
|
3387
3387
|
event.stopPropagation();
|
|
3388
3388
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
3389
|
-
const rect =
|
|
3389
|
+
const rect = chunkLDFWF2KT_js.computeSelectionRect(
|
|
3390
3390
|
selectedCell.rowIndex,
|
|
3391
3391
|
selectedCell.columnIndex,
|
|
3392
3392
|
rowIndex,
|
|
@@ -3396,7 +3396,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3396
3396
|
options?.onSelectCell?.({
|
|
3397
3397
|
rowIndex: selectedCell.rowIndex,
|
|
3398
3398
|
columnIndex: selectedCell.columnIndex,
|
|
3399
|
-
selectedCells:
|
|
3399
|
+
selectedCells: chunkLDFWF2KT_js.rectToCells(rect)
|
|
3400
3400
|
});
|
|
3401
3401
|
} else {
|
|
3402
3402
|
options?.onSelectCell?.({
|
|
@@ -3455,23 +3455,23 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3455
3455
|
);
|
|
3456
3456
|
}
|
|
3457
3457
|
function partAttrs(part) {
|
|
3458
|
-
return part ?
|
|
3458
|
+
return part ? chunkLDFWF2KT_js.chartPartToAttrs(part) : void 0;
|
|
3459
3459
|
}
|
|
3460
3460
|
function resolveReactPalette(chartData) {
|
|
3461
3461
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
3462
3462
|
return chartData.colorPalette;
|
|
3463
3463
|
}
|
|
3464
|
-
return [...
|
|
3464
|
+
return [...chunkLDFWF2KT_js.getChartStylePalette(chartData.style?.styleId)];
|
|
3465
3465
|
}
|
|
3466
3466
|
function buildReactChartViewModel(element) {
|
|
3467
3467
|
if (element.type !== "chart" || !element.chartData) {
|
|
3468
|
-
return
|
|
3468
|
+
return chunkLDFWF2KT_js.buildChartViewModel(element);
|
|
3469
3469
|
}
|
|
3470
3470
|
const palette = resolveReactPalette(element.chartData), themedElement = {
|
|
3471
3471
|
...element,
|
|
3472
3472
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
3473
3473
|
};
|
|
3474
|
-
return
|
|
3474
|
+
return chunkLDFWF2KT_js.buildChartViewModel(themedElement);
|
|
3475
3475
|
}
|
|
3476
3476
|
function renderPrimitive(prim, key) {
|
|
3477
3477
|
switch (prim.kind) {
|
|
@@ -3622,7 +3622,7 @@ function renderText(t, key) {
|
|
|
3622
3622
|
);
|
|
3623
3623
|
}
|
|
3624
3624
|
function renderChartViewModel(elementId, vm, preserveAspectRatio = "none") {
|
|
3625
|
-
const legendItems =
|
|
3625
|
+
const legendItems = chunkLDFWF2KT_js.computeChartLegendLayout(vm);
|
|
3626
3626
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3627
3627
|
"svg",
|
|
3628
3628
|
{
|
|
@@ -3766,11 +3766,11 @@ function renderChartElement(element) {
|
|
|
3766
3766
|
if (!chartData || chartData.series.length === 0) {
|
|
3767
3767
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunk3AJ54EAB_js.translationsEn["pptx.chart.heading"] });
|
|
3768
3768
|
}
|
|
3769
|
-
const kind =
|
|
3769
|
+
const kind = chunkLDFWF2KT_js.resolveChartKind(chartData.chartType ?? "bar");
|
|
3770
3770
|
return renderChartViewModel(
|
|
3771
3771
|
element.id,
|
|
3772
3772
|
buildReactChartViewModel(element),
|
|
3773
|
-
|
|
3773
|
+
chunkLDFWF2KT_js.chartPreserveAspectRatio(kind)
|
|
3774
3774
|
);
|
|
3775
3775
|
}
|
|
3776
3776
|
|
|
@@ -3790,14 +3790,14 @@ function buildNotesPdf(pages) {
|
|
|
3790
3790
|
notes: page.notes,
|
|
3791
3791
|
slideNumber: page.slideNumber
|
|
3792
3792
|
}));
|
|
3793
|
-
const bytes =
|
|
3793
|
+
const bytes = chunkLDFWF2KT_js.buildNotesPdfBytes(images, meta);
|
|
3794
3794
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
3795
3795
|
return URL.createObjectURL(blob);
|
|
3796
3796
|
}
|
|
3797
3797
|
|
|
3798
3798
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
3799
3799
|
function buildPdfFromTiledImageData(pages) {
|
|
3800
|
-
const bytes =
|
|
3800
|
+
const bytes = chunkLDFWF2KT_js.buildTiledSlidesPdfBytes(pages);
|
|
3801
3801
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
3802
3802
|
return URL.createObjectURL(blob);
|
|
3803
3803
|
}
|
|
@@ -3806,7 +3806,7 @@ function buildPdfFromTiledImageData(pages) {
|
|
|
3806
3806
|
var activePreview = null;
|
|
3807
3807
|
function startPreviewAnimation(elementId, preset, options) {
|
|
3808
3808
|
stopPreviewAnimation();
|
|
3809
|
-
const descriptor =
|
|
3809
|
+
const descriptor = chunkLDFWF2KT_js.buildPreviewAnimation(preset, options);
|
|
3810
3810
|
if (!descriptor) {
|
|
3811
3811
|
return;
|
|
3812
3812
|
}
|
|
@@ -3819,7 +3819,7 @@ function startMotionPathPreview(elementId, path, options) {
|
|
|
3819
3819
|
return;
|
|
3820
3820
|
}
|
|
3821
3821
|
const stage = domEl.offsetParent;
|
|
3822
|
-
const descriptor =
|
|
3822
|
+
const descriptor = chunkLDFWF2KT_js.buildMotionPathPreview({
|
|
3823
3823
|
path,
|
|
3824
3824
|
slideWidth: stage?.offsetWidth || DEFAULT_PREVIEW_SLIDE_WIDTH,
|
|
3825
3825
|
slideHeight: stage?.offsetHeight || DEFAULT_PREVIEW_SLIDE_HEIGHT,
|