pptx-react-viewer 3.0.4 → 3.1.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 +13 -0
- package/dist/{AiChatPanel-GSTUOESI.mjs → AiChatPanel-5LCCN7FG.mjs} +4 -4
- package/dist/AiChatPanel-5LCCN7FG.mjs.br +0 -0
- package/dist/AiChatPanel-5LCCN7FG.mjs.gz +0 -0
- package/dist/{AiChatPanel-E4V3FYLR.js → AiChatPanel-WVORGKRT.js} +24 -24
- package/dist/AiChatPanel-WVORGKRT.js.br +0 -0
- package/dist/AiChatPanel-WVORGKRT.js.gz +0 -0
- package/dist/Area3DChartScene-DY5CSLE2.js +47 -0
- package/dist/Area3DChartScene-DY5CSLE2.js.br +0 -0
- package/dist/Area3DChartScene-DY5CSLE2.js.gz +0 -0
- package/dist/Area3DChartScene-W6UZTRDP.mjs +45 -0
- package/dist/Area3DChartScene-W6UZTRDP.mjs.br +0 -0
- package/dist/Area3DChartScene-W6UZTRDP.mjs.gz +0 -0
- package/dist/Bar3DChartScene-7HZSPYG4.js +47 -0
- package/dist/Bar3DChartScene-7HZSPYG4.js.br +0 -0
- package/dist/Bar3DChartScene-7HZSPYG4.js.gz +0 -0
- package/dist/Bar3DChartScene-FCWQEQLH.mjs +45 -0
- package/dist/Bar3DChartScene-FCWQEQLH.mjs.br +0 -0
- package/dist/Bar3DChartScene-FCWQEQLH.mjs.gz +0 -0
- package/dist/Line3DChartScene-BKO24WYO.js +47 -0
- package/dist/Line3DChartScene-BKO24WYO.js.br +0 -0
- package/dist/Line3DChartScene-BKO24WYO.js.gz +0 -0
- package/dist/Line3DChartScene-EPPWQOHS.mjs +45 -0
- package/dist/Line3DChartScene-EPPWQOHS.mjs.br +0 -0
- package/dist/Line3DChartScene-EPPWQOHS.mjs.gz +0 -0
- package/dist/{Model3DScene-634CXE46.mjs → Model3DScene-IAY33GO2.mjs} +1 -1
- package/dist/Model3DScene-IAY33GO2.mjs.br +0 -0
- package/dist/Model3DScene-IAY33GO2.mjs.gz +0 -0
- package/dist/{Model3DScene-45JR5NXN.js → Model3DScene-JFVRE5VL.js} +2 -2
- package/dist/Model3DScene-JFVRE5VL.js.br +0 -0
- package/dist/Model3DScene-JFVRE5VL.js.gz +0 -0
- package/dist/PieChart3DScene-IPH7GLKU.js +47 -0
- package/dist/PieChart3DScene-IPH7GLKU.js.br +0 -0
- package/dist/PieChart3DScene-IPH7GLKU.js.gz +0 -0
- package/dist/PieChart3DScene-ZP5TSL62.mjs +45 -0
- package/dist/PieChart3DScene-ZP5TSL62.mjs.br +0 -0
- package/dist/PieChart3DScene-ZP5TSL62.mjs.gz +0 -0
- package/dist/{PowerPointViewer-SkkxAGKa.d.ts → PowerPointViewer-Cl6jBPNw.d.ts} +2 -2
- package/dist/PowerPointViewer-Cl6jBPNw.d.ts.map +1 -0
- package/dist/{SurfaceChart3DScene-OBVXGXSD.mjs → SurfaceChart3DScene-DOMJGPAD.mjs} +1 -1
- package/dist/SurfaceChart3DScene-DOMJGPAD.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-DOMJGPAD.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-BBQFOGVR.js → SurfaceChart3DScene-TGDBVJSW.js} +2 -2
- package/dist/SurfaceChart3DScene-TGDBVJSW.js.br +0 -0
- package/dist/SurfaceChart3DScene-TGDBVJSW.js.gz +0 -0
- package/dist/{audience-content-store-Bx4Yj2pN.d.ts → audience-content-store-bR7Gs_1S.d.ts} +2 -2
- package/dist/{audience-content-store-Bx4Yj2pN.d.ts.map → audience-content-store-bR7Gs_1S.d.ts.map} +1 -1
- package/dist/{chunk-Z4F5BCQB.js → chunk-7JZLE56X.js} +170 -169
- package/dist/chunk-7JZLE56X.js.br +0 -0
- package/dist/chunk-7JZLE56X.js.gz +0 -0
- package/dist/{chunk-AX4JM6TW.js → chunk-A5EUD6UU.js} +2574 -1964
- package/dist/chunk-A5EUD6UU.js.br +0 -0
- package/dist/chunk-A5EUD6UU.js.gz +0 -0
- package/dist/{chunk-V7ZLEZ5W.mjs → chunk-BP2L2KOZ.mjs} +6167 -2447
- package/dist/chunk-BP2L2KOZ.mjs.br +0 -0
- package/dist/chunk-BP2L2KOZ.mjs.gz +0 -0
- package/dist/{chunk-L5MNLIQF.mjs → chunk-MKPSUHUH.mjs} +25 -0
- package/dist/chunk-MKPSUHUH.mjs.br +0 -0
- package/dist/chunk-MKPSUHUH.mjs.gz +0 -0
- package/dist/{chunk-U6A5FWWE.js → chunk-PIUB7R2K.js} +25 -0
- package/dist/chunk-PIUB7R2K.js.br +0 -0
- package/dist/chunk-PIUB7R2K.js.gz +0 -0
- package/dist/{chunk-XURJHY6K.js → chunk-POAZ53L5.js} +391 -391
- package/dist/chunk-POAZ53L5.js.br +0 -0
- package/dist/chunk-POAZ53L5.js.gz +0 -0
- package/dist/{chunk-J4KXCPQ3.mjs → chunk-PQNZCSB7.mjs} +1 -1
- package/dist/chunk-PQNZCSB7.mjs.br +0 -0
- package/dist/chunk-PQNZCSB7.mjs.gz +0 -0
- package/dist/{chunk-6ILXI752.mjs → chunk-SNWAM2XJ.mjs} +17 -16
- package/dist/chunk-SNWAM2XJ.mjs.br +0 -0
- package/dist/chunk-SNWAM2XJ.mjs.gz +0 -0
- package/dist/{chunk-7HPI5HBA.js → chunk-T7BAPZBY.js} +6196 -2447
- package/dist/chunk-T7BAPZBY.js.br +0 -0
- package/dist/chunk-T7BAPZBY.js.gz +0 -0
- package/dist/{chunk-NPA3EBET.mjs → chunk-TIEUZCYQ.mjs} +758 -148
- package/dist/chunk-TIEUZCYQ.mjs.br +0 -0
- package/dist/chunk-TIEUZCYQ.mjs.gz +0 -0
- package/dist/{chunk-ROWGR6GY.mjs → chunk-VMLKJDA5.mjs} +3 -3
- package/dist/chunk-VMLKJDA5.mjs.br +0 -0
- package/dist/chunk-VMLKJDA5.mjs.gz +0 -0
- package/dist/{chunk-5IYGA2HX.js → chunk-VQVC27WL.js} +3 -3
- package/dist/chunk-VQVC27WL.js.br +0 -0
- package/dist/chunk-VQVC27WL.js.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 +202 -9
- package/dist/index.js +47 -47
- 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 +159 -9
- package/dist/internals.js +79 -79
- package/dist/internals.js.br +7 -5
- 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/{types-kLpvSPxq.d.ts → types-Bzdkiakq.d.ts} +44 -1
- package/dist/{types-kLpvSPxq.d.ts.map → types-Bzdkiakq.d.ts.map} +1 -1
- package/dist/{useViewerBuildingBlocks-fh7rq4jc.d.ts → useViewerBuildingBlocks-DC1O_op4.d.ts} +2 -2
- package/dist/{useViewerBuildingBlocks-fh7rq4jc.d.ts.map → useViewerBuildingBlocks-DC1O_op4.d.ts.map} +1 -1
- package/dist/viewer/index.d.ts +196 -6
- 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 +2 -2
- package/dist/AiChatPanel-E4V3FYLR.js.br +0 -0
- package/dist/AiChatPanel-E4V3FYLR.js.gz +0 -0
- package/dist/AiChatPanel-GSTUOESI.mjs.br +0 -0
- package/dist/AiChatPanel-GSTUOESI.mjs.gz +0 -0
- package/dist/Model3DScene-45JR5NXN.js.br +0 -0
- package/dist/Model3DScene-45JR5NXN.js.gz +0 -0
- package/dist/Model3DScene-634CXE46.mjs.br +0 -0
- package/dist/Model3DScene-634CXE46.mjs.gz +0 -0
- package/dist/PowerPointViewer-SkkxAGKa.d.ts.map +0 -1
- package/dist/SurfaceChart3DScene-BBQFOGVR.js.br +0 -0
- package/dist/SurfaceChart3DScene-BBQFOGVR.js.gz +0 -0
- package/dist/SurfaceChart3DScene-OBVXGXSD.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-OBVXGXSD.mjs.gz +0 -0
- package/dist/chunk-5IYGA2HX.js.br +0 -0
- package/dist/chunk-5IYGA2HX.js.gz +0 -0
- package/dist/chunk-6ILXI752.mjs.br +0 -0
- package/dist/chunk-6ILXI752.mjs.gz +0 -0
- package/dist/chunk-7HPI5HBA.js.br +0 -0
- package/dist/chunk-7HPI5HBA.js.gz +0 -0
- package/dist/chunk-AX4JM6TW.js.br +0 -0
- package/dist/chunk-AX4JM6TW.js.gz +0 -0
- package/dist/chunk-J4KXCPQ3.mjs.br +0 -0
- package/dist/chunk-J4KXCPQ3.mjs.gz +0 -0
- package/dist/chunk-L5MNLIQF.mjs.br +0 -0
- package/dist/chunk-L5MNLIQF.mjs.gz +0 -0
- package/dist/chunk-NPA3EBET.mjs.br +0 -0
- package/dist/chunk-NPA3EBET.mjs.gz +0 -0
- package/dist/chunk-ROWGR6GY.mjs.br +0 -0
- package/dist/chunk-ROWGR6GY.mjs.gz +0 -0
- package/dist/chunk-U6A5FWWE.js.br +0 -0
- package/dist/chunk-U6A5FWWE.js.gz +0 -0
- package/dist/chunk-V7ZLEZ5W.mjs.br +0 -0
- package/dist/chunk-V7ZLEZ5W.mjs.gz +0 -0
- package/dist/chunk-XURJHY6K.js.br +0 -0
- package/dist/chunk-XURJHY6K.js.gz +0 -0
- package/dist/chunk-Z4F5BCQB.js.br +0 -0
- package/dist/chunk-Z4F5BCQB.js.gz +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkPIUB7R2K_js = require('./chunk-PIUB7R2K.js');
|
|
4
|
+
var chunkT7BAPZBY_js = require('./chunk-T7BAPZBY.js');
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var tailwindMerge = require('tailwind-merge');
|
|
7
7
|
var React6 = require('react');
|
|
@@ -15,7 +15,7 @@ var React6__default = /*#__PURE__*/_interopDefault(React6);
|
|
|
15
15
|
|
|
16
16
|
// src/viewer/utils/animation-effects.ts
|
|
17
17
|
function getAnimationInitialStyle2(preset, nativeAnimation) {
|
|
18
|
-
return
|
|
18
|
+
return chunkT7BAPZBY_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 chunkT7BAPZBY_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 = chunkT7BAPZBY_js.VIEWER_SHORTCUT_REFERENCE;
|
|
65
65
|
|
|
66
66
|
// src/viewer/constants/theme.ts
|
|
67
67
|
var THEME_COLOR_SWATCHES = [
|
|
@@ -105,7 +105,7 @@ var GLYPH_COMPONENTS = {
|
|
|
105
105
|
plus: lu.LuPlus,
|
|
106
106
|
triangle: lu.LuTriangle
|
|
107
107
|
};
|
|
108
|
-
var SHAPE_PRESETS =
|
|
108
|
+
var SHAPE_PRESETS = chunkT7BAPZBY_js.SHAPE_PRESET_DEFS.map(
|
|
109
109
|
(def) => ({
|
|
110
110
|
type: def.type,
|
|
111
111
|
label: def.label,
|
|
@@ -264,7 +264,7 @@ function isConnectorOrLineElement(element) {
|
|
|
264
264
|
if (element.type === "connector") {
|
|
265
265
|
return true;
|
|
266
266
|
}
|
|
267
|
-
if (!
|
|
267
|
+
if (!chunkT7BAPZBY_js.hasShapeProperties(element)) {
|
|
268
268
|
return false;
|
|
269
269
|
}
|
|
270
270
|
const st = getShapeType(element.shapeType);
|
|
@@ -273,7 +273,7 @@ function isConnectorOrLineElement(element) {
|
|
|
273
273
|
|
|
274
274
|
// src/viewer/utils/image-style.ts
|
|
275
275
|
function getImageMaskStyle(element) {
|
|
276
|
-
if (!
|
|
276
|
+
if (!chunkT7BAPZBY_js.hasShapeProperties(element)) {
|
|
277
277
|
return void 0;
|
|
278
278
|
}
|
|
279
279
|
const shapeType = element.shapeType;
|
|
@@ -282,7 +282,7 @@ function getImageMaskStyle(element) {
|
|
|
282
282
|
}
|
|
283
283
|
const normalized = shapeType.toLowerCase();
|
|
284
284
|
if (normalized === "roundrect" || normalized === "round1rect" || normalized === "round2samerect" || normalized === "round2diagrect" || normalized === "sniproundrect" || normalized === "snip1rect" || normalized === "snip2diagrect") {
|
|
285
|
-
const radiusPx =
|
|
285
|
+
const radiusPx = chunkT7BAPZBY_js.getRoundRectRadiusPx2(element);
|
|
286
286
|
if (radiusPx <= 0.01) {
|
|
287
287
|
return void 0;
|
|
288
288
|
}
|
|
@@ -294,7 +294,7 @@ function getImageMaskStyle(element) {
|
|
|
294
294
|
if (normalized === "can" || normalized === "cylinder") {
|
|
295
295
|
return { borderRadius: "48% / 12%" };
|
|
296
296
|
}
|
|
297
|
-
const clipPath =
|
|
297
|
+
const clipPath = chunkT7BAPZBY_js.getResolvedShapeClipPath(element);
|
|
298
298
|
if (!clipPath) {
|
|
299
299
|
return void 0;
|
|
300
300
|
}
|
|
@@ -303,7 +303,7 @@ function getImageMaskStyle(element) {
|
|
|
303
303
|
function getImageRenderStyle(element) {
|
|
304
304
|
return {
|
|
305
305
|
...getImageMaskStyle(element) || {},
|
|
306
|
-
...
|
|
306
|
+
...chunkT7BAPZBY_js.getImageFitStyle(element)
|
|
307
307
|
};
|
|
308
308
|
}
|
|
309
309
|
var CROP_SHAPE_CLIP_PATHS = {
|
|
@@ -316,7 +316,7 @@ var CROP_SHAPE_CLIP_PATHS = {
|
|
|
316
316
|
star: "polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)"
|
|
317
317
|
};
|
|
318
318
|
function getCropShapeClipPath(element) {
|
|
319
|
-
if (!
|
|
319
|
+
if (!chunkT7BAPZBY_js.isImageLikeElement(element)) {
|
|
320
320
|
return void 0;
|
|
321
321
|
}
|
|
322
322
|
const shape = element.cropShape;
|
|
@@ -326,7 +326,7 @@ function getCropShapeClipPath(element) {
|
|
|
326
326
|
return CROP_SHAPE_CLIP_PATHS[shape];
|
|
327
327
|
}
|
|
328
328
|
function getImageTilingStyle2(element) {
|
|
329
|
-
return
|
|
329
|
+
return chunkT7BAPZBY_js.getImageTilingStyle(element);
|
|
330
330
|
}
|
|
331
331
|
|
|
332
332
|
// src/viewer/utils/geometry-image.ts
|
|
@@ -526,9 +526,9 @@ function registerMediaElement(elementId, el) {
|
|
|
526
526
|
};
|
|
527
527
|
}
|
|
528
528
|
function executeMediaCommand(command, frameRoot) {
|
|
529
|
-
return
|
|
529
|
+
return chunkT7BAPZBY_js.runMediaCommand(
|
|
530
530
|
command,
|
|
531
|
-
(targetId) => registry.get(targetId) ??
|
|
531
|
+
(targetId) => registry.get(targetId) ?? chunkT7BAPZBY_js.findMediaElementByElementId(targetId, frameRoot?.())
|
|
532
532
|
);
|
|
533
533
|
}
|
|
534
534
|
function PresentationMediaController({
|
|
@@ -572,7 +572,7 @@ function PresentationMediaController({
|
|
|
572
572
|
loop: shouldLoop,
|
|
573
573
|
volume: playbackVolume,
|
|
574
574
|
playbackRate
|
|
575
|
-
} =
|
|
575
|
+
} = chunkT7BAPZBY_js.mediaPlaybackAttributes({
|
|
576
576
|
loop: element.loop,
|
|
577
577
|
volume: element.volume,
|
|
578
578
|
playbackSpeed: element.playbackSpeed
|
|
@@ -708,7 +708,7 @@ function PresentationMediaController({
|
|
|
708
708
|
if (element.playAcrossSlides && element.mediaType === "audio") {
|
|
709
709
|
const dataUrl = element.mediaData ?? resolvedDataUrl;
|
|
710
710
|
if (dataUrl) {
|
|
711
|
-
|
|
711
|
+
chunkT7BAPZBY_js.registerPersistentAudio(
|
|
712
712
|
element.id,
|
|
713
713
|
dataUrl,
|
|
714
714
|
element.mediaMimeType,
|
|
@@ -770,7 +770,7 @@ function PresentationMediaController({
|
|
|
770
770
|
] });
|
|
771
771
|
}
|
|
772
772
|
function label(key) {
|
|
773
|
-
return key === void 0 ? void 0 :
|
|
773
|
+
return key === void 0 ? void 0 : chunkPIUB7R2K_js.translationsEn[key];
|
|
774
774
|
}
|
|
775
775
|
function FallbackIcon({
|
|
776
776
|
paths,
|
|
@@ -806,17 +806,17 @@ function Badge({
|
|
|
806
806
|
"div",
|
|
807
807
|
{
|
|
808
808
|
className: `absolute inset-0 flex flex-col items-center justify-center ${isMissing ? "gap-1" : ""}`,
|
|
809
|
-
...{ [
|
|
809
|
+
...{ [chunkT7BAPZBY_js.MEDIA_CHROME_ATTRIBUTE]: visual.badge },
|
|
810
810
|
children: [
|
|
811
811
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
812
812
|
FallbackIcon,
|
|
813
813
|
{
|
|
814
|
-
paths:
|
|
814
|
+
paths: chunkT7BAPZBY_js.mediaFallbackIcon(visual, element.mediaType),
|
|
815
815
|
size: isMissing ? 32 : 48,
|
|
816
816
|
className: isMissing ? "text-white/60" : "text-white/80 drop-shadow-md"
|
|
817
817
|
}
|
|
818
818
|
),
|
|
819
|
-
isMissing && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: label(
|
|
819
|
+
isMissing && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: label(chunkT7BAPZBY_js.mediaFallbackLabelKey(visual, element.mediaType)) })
|
|
820
820
|
]
|
|
821
821
|
}
|
|
822
822
|
);
|
|
@@ -833,17 +833,17 @@ function Placeholder({
|
|
|
833
833
|
"div",
|
|
834
834
|
{
|
|
835
835
|
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"}`,
|
|
836
|
-
...{ [
|
|
836
|
+
...{ [chunkT7BAPZBY_js.MEDIA_CHROME_ATTRIBUTE]: visual.placeholder },
|
|
837
837
|
children: [
|
|
838
838
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
839
839
|
FallbackIcon,
|
|
840
840
|
{
|
|
841
|
-
paths:
|
|
841
|
+
paths: chunkT7BAPZBY_js.mediaFallbackIcon(visual, element.mediaType),
|
|
842
842
|
size: isMissing ? 36 : element.mediaType === "audio" ? 24 : 32,
|
|
843
843
|
className: isMissing ? "text-white/50" : "text-white/70"
|
|
844
844
|
}
|
|
845
845
|
),
|
|
846
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `text-[10px] ${isMissing ? "text-white/50" : "text-white/70"}`, children: label(
|
|
846
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `text-[10px] ${isMissing ? "text-white/50" : "text-white/70"}`, children: label(chunkT7BAPZBY_js.mediaFallbackLabelKey(visual, element.mediaType)) })
|
|
847
847
|
]
|
|
848
848
|
}
|
|
849
849
|
);
|
|
@@ -853,7 +853,7 @@ function renderMediaFallback({
|
|
|
853
853
|
posterUrl,
|
|
854
854
|
surface
|
|
855
855
|
}) {
|
|
856
|
-
const visual =
|
|
856
|
+
const visual = chunkT7BAPZBY_js.mediaFallbackVisual(surface, {
|
|
857
857
|
hasPoster: Boolean(posterUrl),
|
|
858
858
|
missing: element.mediaMissing === true
|
|
859
859
|
});
|
|
@@ -863,7 +863,7 @@ function renderMediaFallback({
|
|
|
863
863
|
"img",
|
|
864
864
|
{
|
|
865
865
|
src: posterUrl,
|
|
866
|
-
alt: visual.dimPoster ?
|
|
866
|
+
alt: visual.dimPoster ? chunkPIUB7R2K_js.translationsEn["pptx.media.posterAlt"] : chunkPIUB7R2K_js.translationsEn["pptx.media.videoPosterAlt"],
|
|
867
867
|
className: `w-full h-full object-contain${visual.dimPoster ? " opacity-50" : ""}`
|
|
868
868
|
}
|
|
869
869
|
),
|
|
@@ -874,7 +874,7 @@ function renderMediaFallback({
|
|
|
874
874
|
}
|
|
875
875
|
function renderMediaElement(element, mediaDataUrls, options) {
|
|
876
876
|
if (element.type !== "media") {
|
|
877
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
877
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkPIUB7R2K_js.translationsEn["pptx.media.title"] });
|
|
878
878
|
}
|
|
879
879
|
const mediaType = element.mediaType;
|
|
880
880
|
const mediaPath = element.mediaPath;
|
|
@@ -882,7 +882,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
882
882
|
const dataUrl = element.mediaData ?? (mediaPath ? mediaDataUrls.get(mediaPath) : void 0);
|
|
883
883
|
const trimFragment = buildTrimFragment(element);
|
|
884
884
|
const posterUrl = element.posterFrameData ?? void 0;
|
|
885
|
-
const shouldLoop =
|
|
885
|
+
const shouldLoop = chunkT7BAPZBY_js.mediaPlaybackAttributes(element).loop;
|
|
886
886
|
const shouldAutoPlay = options?.autoPlay === true || element.autoPlay === true;
|
|
887
887
|
const isFullScreen = options?.fullScreen === true;
|
|
888
888
|
const isPresentationMode = options?.isPresentationMode === true;
|
|
@@ -960,24 +960,24 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
960
960
|
if (surface.presenting || surface.preview) {
|
|
961
961
|
return null;
|
|
962
962
|
}
|
|
963
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
963
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkPIUB7R2K_js.translationsEn["pptx.media.title"] });
|
|
964
964
|
}
|
|
965
965
|
|
|
966
966
|
// src/viewer/utils/text-utils.tsx
|
|
967
967
|
function getTextStyleForElement(element, fallbackColor) {
|
|
968
|
-
return
|
|
968
|
+
return chunkT7BAPZBY_js.buildTextBlockStyle(element, { fallbackColor });
|
|
969
969
|
}
|
|
970
970
|
|
|
971
971
|
// src/viewer/utils/text-layout.tsx
|
|
972
972
|
function getTextLayoutStyle(element) {
|
|
973
|
-
if (!
|
|
973
|
+
if (!chunkT7BAPZBY_js.hasTextProperties(element)) {
|
|
974
974
|
return {};
|
|
975
975
|
}
|
|
976
|
-
const writingMode =
|
|
977
|
-
const textOrientation =
|
|
978
|
-
const verticalDirection =
|
|
976
|
+
const writingMode = chunkT7BAPZBY_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
977
|
+
const textOrientation = chunkT7BAPZBY_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
978
|
+
const verticalDirection = chunkT7BAPZBY_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
979
979
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
980
|
-
const hasParagraphIndents =
|
|
980
|
+
const hasParagraphIndents = chunkT7BAPZBY_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
981
981
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
982
982
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
983
983
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
@@ -986,7 +986,7 @@ function getTextLayoutStyle(element) {
|
|
|
986
986
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
987
987
|
return {
|
|
988
988
|
// Columns / flex anchoring / anchorCtr / tab-size / kinsoku, from shared.
|
|
989
|
-
...
|
|
989
|
+
...chunkT7BAPZBY_js.buildTextBodyLayoutStyle(element),
|
|
990
990
|
// Body inset only. Paragraph spacing (spcBef/spcAft) is applied
|
|
991
991
|
// per-paragraph by the paragraph renderer, not collapsed here.
|
|
992
992
|
paddingTop: bodyTop,
|
|
@@ -1005,7 +1005,7 @@ function getTextLayoutStyle(element) {
|
|
|
1005
1005
|
|
|
1006
1006
|
// src/viewer/utils/text-effects.tsx
|
|
1007
1007
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
1008
|
-
return
|
|
1008
|
+
return chunkT7BAPZBY_js.buildTextBody3DSceneStyle(textStyle);
|
|
1009
1009
|
}
|
|
1010
1010
|
|
|
1011
1011
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -1190,13 +1190,13 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1190
1190
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
1191
1191
|
return renderedSegments;
|
|
1192
1192
|
}
|
|
1193
|
-
const paraKey = `${elementId}${
|
|
1193
|
+
const paraKey = `${elementId}${chunkT7BAPZBY_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
1194
1194
|
const paraState = subElementAnimStates.get(paraKey);
|
|
1195
1195
|
if (paraState) {
|
|
1196
1196
|
const style = buildAnimStyle(paraState);
|
|
1197
1197
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
1198
1198
|
}
|
|
1199
|
-
const spec =
|
|
1199
|
+
const spec = chunkT7BAPZBY_js.buildTextBuildSpec(
|
|
1200
1200
|
elementId,
|
|
1201
1201
|
paraIndex,
|
|
1202
1202
|
paraRuns.map((run) => ({ text: run.text, style: run })),
|
|
@@ -1214,7 +1214,7 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1214
1214
|
"span",
|
|
1215
1215
|
{
|
|
1216
1216
|
"data-anim-id": span.animId,
|
|
1217
|
-
style:
|
|
1217
|
+
style: chunkT7BAPZBY_js.textBuildSpanStyle(span),
|
|
1218
1218
|
children: content
|
|
1219
1219
|
},
|
|
1220
1220
|
span.animId
|
|
@@ -1222,7 +1222,7 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1222
1222
|
});
|
|
1223
1223
|
}
|
|
1224
1224
|
function renderTabbedLine(line, ctx, keyPrefix, renderPiece, nestedStyle) {
|
|
1225
|
-
const [lineLayout] =
|
|
1225
|
+
const [lineLayout] = chunkT7BAPZBY_js.buildRunTabLines(line, ctx, nestedStyle);
|
|
1226
1226
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { display: "inline-block", whiteSpace: "nowrap" }, children: lineLayout.pieces.map((piece, i) => {
|
|
1227
1227
|
const key = `${keyPrefix}-tab-${i}`;
|
|
1228
1228
|
return /* @__PURE__ */ jsxRuntime.jsxs(React6__default.default.Fragment, { children: [
|
|
@@ -1235,7 +1235,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1235
1235
|
if (!needsScriptFonts || !text) {
|
|
1236
1236
|
return text;
|
|
1237
1237
|
}
|
|
1238
|
-
const pieces =
|
|
1238
|
+
const pieces = chunkT7BAPZBY_js.splitRunByScriptFont(
|
|
1239
1239
|
text,
|
|
1240
1240
|
scriptFonts,
|
|
1241
1241
|
baseFontFamily,
|
|
@@ -1252,7 +1252,7 @@ function renderMetricPieces(text, metric, keyPrefix, inner) {
|
|
|
1252
1252
|
if (!metric || !text) {
|
|
1253
1253
|
return inner(text, keyPrefix);
|
|
1254
1254
|
}
|
|
1255
|
-
const pieces =
|
|
1255
|
+
const pieces = chunkT7BAPZBY_js.splitRunForMetrics(text, metric.font);
|
|
1256
1256
|
if (pieces.length <= 1) {
|
|
1257
1257
|
return inner(text, keyPrefix);
|
|
1258
1258
|
}
|
|
@@ -1261,7 +1261,7 @@ function renderMetricPieces(text, metric, keyPrefix, inner) {
|
|
|
1261
1261
|
{
|
|
1262
1262
|
style: {
|
|
1263
1263
|
...metric.nestedStyle,
|
|
1264
|
-
letterSpacing:
|
|
1264
|
+
letterSpacing: chunkT7BAPZBY_js.pieceLetterSpacing(metric.authoredPx, piece.tracking)
|
|
1265
1265
|
},
|
|
1266
1266
|
children: inner(piece.text, `${keyPrefix}-w${i}`)
|
|
1267
1267
|
},
|
|
@@ -1348,8 +1348,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1348
1348
|
});
|
|
1349
1349
|
}
|
|
1350
1350
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
1351
|
-
const mathml =
|
|
1352
|
-
const safeMathml = mathml ?
|
|
1351
|
+
const mathml = chunkT7BAPZBY_js.convertOmmlToMathMl(equationXml);
|
|
1352
|
+
const safeMathml = mathml ? chunkT7BAPZBY_js.sanitizeMathMl(mathml) : "";
|
|
1353
1353
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1354
1354
|
"span",
|
|
1355
1355
|
{
|
|
@@ -1359,7 +1359,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1359
1359
|
},
|
|
1360
1360
|
dangerouslySetInnerHTML: { __html: safeMathml }
|
|
1361
1361
|
}
|
|
1362
|
-
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children:
|
|
1362
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children: chunkPIUB7R2K_js.translationsEn["pptx.textSegment.equationFallback"] });
|
|
1363
1363
|
if (equationNumber) {
|
|
1364
1364
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1365
1365
|
"span",
|
|
@@ -1477,7 +1477,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1477
1477
|
const segmentStyle = segment?.style ?? {};
|
|
1478
1478
|
const textValue = run.text;
|
|
1479
1479
|
const lines = textValue.split("\n");
|
|
1480
|
-
const resolvedSegmentColor =
|
|
1480
|
+
const resolvedSegmentColor = chunkT7BAPZBY_js.normalizeHexColor(
|
|
1481
1481
|
segmentStyle.color || element.textStyle?.color,
|
|
1482
1482
|
run.hyperlink ? HYPERLINK_COLOR : fallbackColor
|
|
1483
1483
|
);
|
|
@@ -1485,16 +1485,16 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1485
1485
|
const baselineFraction = rawBaseline === 0 ? 0 : Math.abs(rawBaseline) >= 1e3 ? rawBaseline / 1e5 : rawBaseline / 100;
|
|
1486
1486
|
const baselineFontScale = baselineFraction !== 0 ? BASELINE_FONT_SCALE : 1;
|
|
1487
1487
|
const rawFontSize = segmentStyle.fontSize || element.textStyle?.fontSize || DEFAULT_TEXT_FONT_SIZE;
|
|
1488
|
-
const baseFontSize = rawFontSize *
|
|
1488
|
+
const baseFontSize = rawFontSize * chunkT7BAPZBY_js.resolveAutoFitFontScale(element.textStyle);
|
|
1489
1489
|
const baselineShift = baselineFraction !== 0 ? `${baselineFraction * baseFontSize}px` : void 0;
|
|
1490
|
-
const fontKerning =
|
|
1490
|
+
const fontKerning = chunkT7BAPZBY_js.resolveFontKerning(segmentStyle.kerning, baseFontSize);
|
|
1491
1491
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
1492
|
-
const baseFontFamily = rawFontFamily ?
|
|
1492
|
+
const baseFontFamily = rawFontFamily ? chunkT7BAPZBY_js.getSubstituteFontFamily(
|
|
1493
1493
|
rawFontFamily,
|
|
1494
|
-
|
|
1494
|
+
chunkT7BAPZBY_js.parsePanoseString(segmentStyle.latinFontPanose ?? element.textStyle?.latinFontPanose)
|
|
1495
1495
|
) : DEFAULT_FONT_FAMILY2;
|
|
1496
|
-
const scriptFonts =
|
|
1497
|
-
const needsScriptFonts =
|
|
1496
|
+
const scriptFonts = chunkT7BAPZBY_js.resolveScriptFontSet(segmentStyle, element.textStyle, baseFontFamily);
|
|
1497
|
+
const needsScriptFonts = chunkT7BAPZBY_js.hasDistinctScriptFonts(scriptFonts);
|
|
1498
1498
|
const authoredLetterSpacing = typeof segmentStyle.characterSpacing === "number" && segmentStyle.characterSpacing !== 0 ? segmentStyle.characterSpacing / 100 * (96 / 72) : 0;
|
|
1499
1499
|
const metricFont = {
|
|
1500
1500
|
fontFamily: baseFontFamily,
|
|
@@ -1502,7 +1502,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1502
1502
|
bold: Boolean(segmentStyle.bold),
|
|
1503
1503
|
italic: Boolean(segmentStyle.italic)
|
|
1504
1504
|
};
|
|
1505
|
-
const nestedStyle =
|
|
1505
|
+
const nestedStyle = chunkT7BAPZBY_js.nestedTextDecorationStyle(run.style);
|
|
1506
1506
|
const metricContext = { font: metricFont, authoredPx: authoredLetterSpacing, nestedStyle };
|
|
1507
1507
|
const spanStyle = { ...run.style };
|
|
1508
1508
|
spanStyle.color = resolvedSegmentColor;
|
|
@@ -1510,11 +1510,11 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1510
1510
|
spanStyle.fontFamily = baseFontFamily;
|
|
1511
1511
|
spanStyle.verticalAlign = baselineShift;
|
|
1512
1512
|
spanStyle.fontKerning = fontKerning;
|
|
1513
|
-
spanStyle.letterSpacing =
|
|
1513
|
+
spanStyle.letterSpacing = chunkT7BAPZBY_js.pieceLetterSpacing(
|
|
1514
1514
|
authoredLetterSpacing,
|
|
1515
|
-
|
|
1515
|
+
chunkT7BAPZBY_js.resolveMetricTrackingPx(textValue, metricFont)
|
|
1516
1516
|
);
|
|
1517
|
-
const hollow =
|
|
1517
|
+
const hollow = chunkT7BAPZBY_js.hollowTextFillStyle(segmentStyle, {
|
|
1518
1518
|
color: resolvedSegmentColor,
|
|
1519
1519
|
textStroke: typeof spanStyle.WebkitTextStroke === "string" ? spanStyle.WebkitTextStroke : void 0
|
|
1520
1520
|
});
|
|
@@ -1535,7 +1535,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1535
1535
|
scriptFonts,
|
|
1536
1536
|
baseFontFamily,
|
|
1537
1537
|
findHighlights,
|
|
1538
|
-
|
|
1538
|
+
chunkT7BAPZBY_js.buildTabContext(
|
|
1539
1539
|
element.textStyle?.tabStops,
|
|
1540
1540
|
element.textStyle?.defaultTabSize,
|
|
1541
1541
|
baseFontSize,
|
|
@@ -1561,7 +1561,7 @@ function renderRubyOrText(run, baseContent) {
|
|
|
1561
1561
|
] });
|
|
1562
1562
|
}
|
|
1563
1563
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick) {
|
|
1564
|
-
if (!
|
|
1564
|
+
if (!chunkT7BAPZBY_js.hasTextProperties(element)) {
|
|
1565
1565
|
return emptyFallback || null;
|
|
1566
1566
|
}
|
|
1567
1567
|
const segments = segmentOverrides ?? element.textSegments;
|
|
@@ -1571,7 +1571,7 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
1571
1571
|
}
|
|
1572
1572
|
return element.text || emptyFallback || "";
|
|
1573
1573
|
}
|
|
1574
|
-
const paragraphs =
|
|
1574
|
+
const paragraphs = chunkT7BAPZBY_js.buildParagraphs(element, fieldContext, segmentOverrides);
|
|
1575
1575
|
const ctx = {
|
|
1576
1576
|
element,
|
|
1577
1577
|
fallbackColor,
|
|
@@ -1704,13 +1704,13 @@ function hexToRgbUnit(hex) {
|
|
|
1704
1704
|
};
|
|
1705
1705
|
}
|
|
1706
1706
|
function getDuotoneColors(element) {
|
|
1707
|
-
if (!
|
|
1707
|
+
if (!chunkT7BAPZBY_js.isImageLikeElement(element)) {
|
|
1708
1708
|
return void 0;
|
|
1709
1709
|
}
|
|
1710
1710
|
return element.imageEffects?.duotone;
|
|
1711
1711
|
}
|
|
1712
1712
|
function buildLineShadowCss(element) {
|
|
1713
|
-
if (!
|
|
1713
|
+
if (!chunkT7BAPZBY_js.hasShapeProperties(element)) {
|
|
1714
1714
|
return void 0;
|
|
1715
1715
|
}
|
|
1716
1716
|
const ss = element.shapeStyle;
|
|
@@ -1721,13 +1721,13 @@ function buildLineShadowCss(element) {
|
|
|
1721
1721
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
1722
1722
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
1723
1723
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
1724
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
1725
|
-
|
|
1724
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkT7BAPZBY_js.colorWithOpacity(
|
|
1725
|
+
chunkT7BAPZBY_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
1726
1726
|
opacity
|
|
1727
1727
|
)}`;
|
|
1728
1728
|
}
|
|
1729
1729
|
function buildLineGlowFilter(element) {
|
|
1730
|
-
if (!
|
|
1730
|
+
if (!chunkT7BAPZBY_js.hasShapeProperties(element)) {
|
|
1731
1731
|
return void 0;
|
|
1732
1732
|
}
|
|
1733
1733
|
const ss = element.shapeStyle;
|
|
@@ -1736,14 +1736,14 @@ function buildLineGlowFilter(element) {
|
|
|
1736
1736
|
}
|
|
1737
1737
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
1738
1738
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
1739
|
-
const glowCol =
|
|
1739
|
+
const glowCol = chunkT7BAPZBY_js.colorWithOpacity(chunkT7BAPZBY_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
1740
1740
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
1741
1741
|
}
|
|
1742
1742
|
function getDagDuotoneFilterId(elementId) {
|
|
1743
1743
|
return `dag-duotone-${elementId}`;
|
|
1744
1744
|
}
|
|
1745
1745
|
function hasDagDuotoneEffect(element) {
|
|
1746
|
-
if (!
|
|
1746
|
+
if (!chunkT7BAPZBY_js.hasShapeProperties(element)) {
|
|
1747
1747
|
return false;
|
|
1748
1748
|
}
|
|
1749
1749
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
@@ -1795,7 +1795,7 @@ function renderDagDuotoneSvgFilter(elementId, color1, color2) {
|
|
|
1795
1795
|
|
|
1796
1796
|
// src/viewer/utils/shape-visual-3d.ts
|
|
1797
1797
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
1798
|
-
return
|
|
1798
|
+
return chunkT7BAPZBY_js.build3DExtrusionData(
|
|
1799
1799
|
shape3d,
|
|
1800
1800
|
scene3d,
|
|
1801
1801
|
fillColor,
|
|
@@ -1804,7 +1804,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
1804
1804
|
);
|
|
1805
1805
|
}
|
|
1806
1806
|
function apply3dEffects2(base, scene3d, shape3d, fillColorFallback) {
|
|
1807
|
-
|
|
1807
|
+
chunkT7BAPZBY_js.apply3dEffects(base, scene3d, shape3d, fillColorFallback);
|
|
1808
1808
|
}
|
|
1809
1809
|
|
|
1810
1810
|
// src/viewer/utils/shape-visual-style.ts
|
|
@@ -1812,13 +1812,13 @@ function rendersCustomVectorPath(element) {
|
|
|
1812
1812
|
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;
|
|
1813
1813
|
}
|
|
1814
1814
|
function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _strokeColor, animatesFill, animatesStroke, parentGroupFill) {
|
|
1815
|
-
if (!
|
|
1815
|
+
if (!chunkT7BAPZBY_js.hasShapeProperties(element)) {
|
|
1816
1816
|
return {};
|
|
1817
1817
|
}
|
|
1818
1818
|
const ss = element.shapeStyle;
|
|
1819
|
-
const fill = animatesFill ? void 0 :
|
|
1820
|
-
const fx =
|
|
1821
|
-
const stroke =
|
|
1819
|
+
const fill = animatesFill ? void 0 : chunkT7BAPZBY_js.getComputedFillStyle(element, parentGroupFill);
|
|
1820
|
+
const fx = chunkT7BAPZBY_js.getComputedEffectStyle(element);
|
|
1821
|
+
const stroke = chunkT7BAPZBY_js.getComputedStrokeStyle(element);
|
|
1822
1822
|
const base = {
|
|
1823
1823
|
// A gradient fill REPLACES the solid fill, it does not sit on top of it;
|
|
1824
1824
|
// the whole precedence lives in shared's `getComputedFillStyle`.
|
|
@@ -1856,7 +1856,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1856
1856
|
strokeLinecap: stroke.strokeLinecap
|
|
1857
1857
|
};
|
|
1858
1858
|
apply3dEffects2(base, ss?.scene3d, ss?.shape3d, ss?.fillColor ?? fillColor);
|
|
1859
|
-
if (rendersCustomVectorPath(element) ||
|
|
1859
|
+
if (rendersCustomVectorPath(element) || chunkT7BAPZBY_js.isStrokeOnlyPresetElement(element)) {
|
|
1860
1860
|
base.backgroundColor = "transparent";
|
|
1861
1861
|
base.backgroundImage = void 0;
|
|
1862
1862
|
base.borderWidth = void 0;
|
|
@@ -1867,7 +1867,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1867
1867
|
base.backgroundColor = void 0;
|
|
1868
1868
|
base.backgroundImage = void 0;
|
|
1869
1869
|
}
|
|
1870
|
-
const geometry =
|
|
1870
|
+
const geometry = chunkT7BAPZBY_js.resolveShapeGeometry(element);
|
|
1871
1871
|
switch (geometry.kind) {
|
|
1872
1872
|
case "bare":
|
|
1873
1873
|
return { backgroundColor: "transparent", borderWidth: 0, borderStyle: "none" };
|
|
@@ -1893,13 +1893,13 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1893
1893
|
function getConnectorAdjustment(element, key, fallback) {
|
|
1894
1894
|
const direct = element.shapeAdjustments?.[key];
|
|
1895
1895
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
1896
|
-
return
|
|
1896
|
+
return chunkT7BAPZBY_js.clampUnitInterval(direct / 1e5);
|
|
1897
1897
|
}
|
|
1898
1898
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
1899
1899
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
1900
|
-
return
|
|
1900
|
+
return chunkT7BAPZBY_js.clampUnitInterval(fallbackKey / 1e5);
|
|
1901
1901
|
}
|
|
1902
|
-
return
|
|
1902
|
+
return chunkT7BAPZBY_js.clampUnitInterval(fallback);
|
|
1903
1903
|
}
|
|
1904
1904
|
function getConnectorPathGeometry(element) {
|
|
1905
1905
|
const width = Math.max(element.width, 0);
|
|
@@ -2036,11 +2036,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
|
|
|
2036
2036
|
strokePaint,
|
|
2037
2037
|
strokeWidth,
|
|
2038
2038
|
dashArray,
|
|
2039
|
-
lineCap:
|
|
2039
|
+
lineCap: chunkT7BAPZBY_js.svgLineCap(shapeStyle?.lineCap),
|
|
2040
2040
|
lineJoin,
|
|
2041
2041
|
miterLimit,
|
|
2042
|
-
offsets:
|
|
2043
|
-
widths:
|
|
2042
|
+
offsets: chunkT7BAPZBY_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
2043
|
+
widths: chunkT7BAPZBY_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
|
|
2044
2044
|
};
|
|
2045
2045
|
}
|
|
2046
2046
|
function strokeStrands(d, keyBase, ctx) {
|
|
@@ -2088,12 +2088,12 @@ function gradientDefs(gradient) {
|
|
|
2088
2088
|
}
|
|
2089
2089
|
function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredPaths, shapeStyle, hasFill, fillColor, fillOpacity, strokePaint, strokeWidth, dashArray, animatesFill = false, gradient) {
|
|
2090
2090
|
const ctx = strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray);
|
|
2091
|
-
const subpaths = structuredPaths && structuredPaths.length > 0 ?
|
|
2091
|
+
const subpaths = structuredPaths && structuredPaths.length > 0 ? chunkT7BAPZBY_js.customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
2092
2092
|
const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
|
|
2093
|
-
const gradientPaint = gradient ?
|
|
2093
|
+
const gradientPaint = gradient ? chunkT7BAPZBY_js.svgGradientFillRef(gradient) : void 0;
|
|
2094
2094
|
const nodes = [];
|
|
2095
2095
|
if (subpaths && needsPerSubpath) {
|
|
2096
|
-
const paints =
|
|
2096
|
+
const paints = chunkT7BAPZBY_js.buildSubpathPaints(subpaths, hasFill, fillColor, fillOpacity);
|
|
2097
2097
|
paints.forEach((paint, idx) => {
|
|
2098
2098
|
if (paint.fill !== "none") {
|
|
2099
2099
|
const mode = subpaths[idx]?.fillMode;
|
|
@@ -2122,7 +2122,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2122
2122
|
"path",
|
|
2123
2123
|
{
|
|
2124
2124
|
d: pathData,
|
|
2125
|
-
fill: animatesFill ? "inherit" : gradientPaint ??
|
|
2125
|
+
fill: animatesFill ? "inherit" : gradientPaint ?? chunkT7BAPZBY_js.colorWithOpacity(fillColor, fillOpacity),
|
|
2126
2126
|
stroke: "none",
|
|
2127
2127
|
vectorEffect: "non-scaling-stroke"
|
|
2128
2128
|
},
|
|
@@ -2148,14 +2148,14 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2148
2148
|
);
|
|
2149
2149
|
}
|
|
2150
2150
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2151
|
-
if (!
|
|
2151
|
+
if (!chunkT7BAPZBY_js.hasShapeProperties(element)) {
|
|
2152
2152
|
return null;
|
|
2153
2153
|
}
|
|
2154
2154
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
2155
|
-
const fillPaint = animatesFill ? "inherit" :
|
|
2156
|
-
const strokePaint = animatesStroke ? "inherit" :
|
|
2157
|
-
const dashType =
|
|
2158
|
-
const dashArray =
|
|
2155
|
+
const fillPaint = animatesFill ? "inherit" : chunkT7BAPZBY_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
2156
|
+
const strokePaint = animatesStroke ? "inherit" : chunkT7BAPZBY_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
2157
|
+
const dashType = chunkT7BAPZBY_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2158
|
+
const dashArray = chunkT7BAPZBY_js.getSvgStrokeDasharray(
|
|
2159
2159
|
dashType,
|
|
2160
2160
|
Math.max(strokeWidth, 1),
|
|
2161
2161
|
element.shapeStyle?.customDashSegments
|
|
@@ -2236,21 +2236,21 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2236
2236
|
// container's `background-image` is suppressed for custom geometry, so
|
|
2237
2237
|
// without this the shape fell back to the parser's representative solid
|
|
2238
2238
|
// and lost every fade (issue #132).
|
|
2239
|
-
|
|
2239
|
+
chunkT7BAPZBY_js.buildSvgGradientDef(element.shapeStyle, element.id)
|
|
2240
2240
|
);
|
|
2241
2241
|
}
|
|
2242
|
-
if (
|
|
2242
|
+
if (chunkT7BAPZBY_js.isCalloutShape(normalizedType)) {
|
|
2243
2243
|
const width = Math.max(element.width, 1);
|
|
2244
2244
|
const height = Math.max(element.height, 1);
|
|
2245
|
-
const geometry =
|
|
2245
|
+
const geometry = chunkT7BAPZBY_js.getCalloutLeaderLineGeometry(
|
|
2246
2246
|
normalizedType,
|
|
2247
2247
|
width,
|
|
2248
2248
|
height,
|
|
2249
2249
|
element.shapeAdjustments
|
|
2250
2250
|
);
|
|
2251
2251
|
if (geometry && geometry.points.length >= 2) {
|
|
2252
|
-
const leaderPath =
|
|
2253
|
-
const bounds =
|
|
2252
|
+
const leaderPath = chunkT7BAPZBY_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
2253
|
+
const bounds = chunkT7BAPZBY_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
2254
2254
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
2255
2255
|
const offsetLeft = bounds.minX;
|
|
2256
2256
|
const offsetTop = bounds.minY;
|
|
@@ -2313,10 +2313,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2313
2313
|
const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
|
|
2314
2314
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
2315
2315
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
2316
|
-
const connectorLineCap =
|
|
2316
|
+
const connectorLineCap = chunkT7BAPZBY_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
2317
2317
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
2318
|
-
const offsets =
|
|
2319
|
-
const widths =
|
|
2318
|
+
const offsets = chunkT7BAPZBY_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
2319
|
+
const widths = chunkT7BAPZBY_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
2320
2320
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2321
2321
|
"svg",
|
|
2322
2322
|
{
|
|
@@ -2381,40 +2381,41 @@ function parseGradientFillCss(gradFill) {
|
|
|
2381
2381
|
if (stops.length === 0) {
|
|
2382
2382
|
return void 0;
|
|
2383
2383
|
}
|
|
2384
|
-
const
|
|
2384
|
+
const rawStops = stops.map((gs) => {
|
|
2385
2385
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
2386
|
-
const color =
|
|
2387
|
-
const opacity =
|
|
2388
|
-
return { pos, color
|
|
2389
|
-
}).sort((a, b) => a.
|
|
2390
|
-
const stopStrings =
|
|
2386
|
+
const color = chunkT7BAPZBY_js.parseDrawingColor(gs) ?? "#888888";
|
|
2387
|
+
const opacity = chunkT7BAPZBY_js.parseDrawingColorOpacity(gs);
|
|
2388
|
+
return { position: pos, color, opacity };
|
|
2389
|
+
}).sort((a, b) => a.position - b.position);
|
|
2390
|
+
const stopStrings = rawStops.map((s) => `${chunkT7BAPZBY_js.colorWithOpacity(s.color, s.opacity)} ${s.position.toFixed(1)}%`).join(", ");
|
|
2391
2391
|
const lin = gradFill["a:lin"];
|
|
2392
2392
|
if (lin) {
|
|
2393
2393
|
const angRaw = Number.parseInt(String(lin["@_ang"] || "0"), 10);
|
|
2394
|
-
const angleDeg = Math.round(
|
|
2394
|
+
const angleDeg = Math.round(chunkT7BAPZBY_js.ooxmlGradientAngleToCssDegrees(angRaw / 6e4));
|
|
2395
2395
|
return `linear-gradient(${angleDeg}deg, ${stopStrings})`;
|
|
2396
2396
|
}
|
|
2397
2397
|
const path = gradFill["a:path"];
|
|
2398
2398
|
if (path) {
|
|
2399
2399
|
const pathType = String(path["@_path"] || "circle");
|
|
2400
|
-
const
|
|
2400
|
+
const fillToRectXml = path["a:fillToRect"];
|
|
2401
|
+
const fillToRect = fillToRectXml ? {
|
|
2402
|
+
l: Number.parseInt(String(fillToRectXml["@_l"] || "0"), 10) / 1e5,
|
|
2403
|
+
t: Number.parseInt(String(fillToRectXml["@_t"] || "0"), 10) / 1e5,
|
|
2404
|
+
r: Number.parseInt(String(fillToRectXml["@_r"] || "0"), 10) / 1e5,
|
|
2405
|
+
b: Number.parseInt(String(fillToRectXml["@_b"] || "0"), 10) / 1e5
|
|
2406
|
+
} : void 0;
|
|
2407
|
+
if (pathType === "rect") {
|
|
2408
|
+
return chunkT7BAPZBY_js.buildRectPathGradient(rawStops, void 0, fillToRect);
|
|
2409
|
+
}
|
|
2401
2410
|
let cx = 50;
|
|
2402
2411
|
let cy = 50;
|
|
2403
2412
|
if (fillToRect) {
|
|
2404
|
-
const l
|
|
2405
|
-
const t = Number.parseInt(String(fillToRect["@_t"] || "0"), 10) / 1e5;
|
|
2406
|
-
const r = Number.parseInt(String(fillToRect["@_r"] || "0"), 10) / 1e5;
|
|
2407
|
-
const b = Number.parseInt(String(fillToRect["@_b"] || "0"), 10) / 1e5;
|
|
2413
|
+
const { l, t, r, b } = fillToRect;
|
|
2408
2414
|
cx = (l + (1 - r)) / 2 * 100;
|
|
2409
2415
|
cy = (t + (1 - b)) / 2 * 100;
|
|
2410
2416
|
}
|
|
2411
2417
|
const posX = `${Math.round(cx)}%`;
|
|
2412
2418
|
const posY = `${Math.round(cy)}%`;
|
|
2413
|
-
if (pathType === "rect") {
|
|
2414
|
-
const semiX = Math.max(cx, 100 - cx);
|
|
2415
|
-
const semiY = Math.max(cy, 100 - cy);
|
|
2416
|
-
return `radial-gradient(${Math.round(semiX)}% ${Math.round(semiY)}% at ${posX} ${posY}, ${stopStrings})`;
|
|
2417
|
-
}
|
|
2418
2419
|
if (pathType === "shape") {
|
|
2419
2420
|
return `radial-gradient(farthest-side at ${posX} ${posY}, ${stopStrings})`;
|
|
2420
2421
|
}
|
|
@@ -2426,8 +2427,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
2426
2427
|
if (!pattFill) {
|
|
2427
2428
|
return void 0;
|
|
2428
2429
|
}
|
|
2429
|
-
const fgColor =
|
|
2430
|
-
const bgColor =
|
|
2430
|
+
const fgColor = chunkT7BAPZBY_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
2431
|
+
const bgColor = chunkT7BAPZBY_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
2431
2432
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
2432
2433
|
switch (preset) {
|
|
2433
2434
|
case "ltHorz":
|
|
@@ -2538,11 +2539,11 @@ function parseCellBorders(cellProperties) {
|
|
|
2538
2539
|
const prstDash = ln["a:prstDash"];
|
|
2539
2540
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
2540
2541
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
2541
|
-
const color =
|
|
2542
|
+
const color = chunkT7BAPZBY_js.parseDrawingColor(ln["a:solidFill"]);
|
|
2542
2543
|
if (color) {
|
|
2543
|
-
const opacity =
|
|
2544
|
+
const opacity = chunkT7BAPZBY_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
2544
2545
|
const key = `${edge.prefix}`;
|
|
2545
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
2546
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkT7BAPZBY_js.colorWithOpacity(color, opacity)}`;
|
|
2546
2547
|
}
|
|
2547
2548
|
}
|
|
2548
2549
|
return borderStyle;
|
|
@@ -2555,7 +2556,7 @@ function parseCellTextEffects(runProps) {
|
|
|
2555
2556
|
const textShadowParts = [];
|
|
2556
2557
|
const outerShdw = effectLst["a:outerShdw"];
|
|
2557
2558
|
if (outerShdw) {
|
|
2558
|
-
const shdwColor =
|
|
2559
|
+
const shdwColor = chunkT7BAPZBY_js.parseDrawingColor(outerShdw);
|
|
2559
2560
|
if (shdwColor) {
|
|
2560
2561
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
2561
2562
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -2573,7 +2574,7 @@ function parseCellTextEffects(runProps) {
|
|
|
2573
2574
|
}
|
|
2574
2575
|
const glow = effectLst["a:glow"];
|
|
2575
2576
|
if (glow) {
|
|
2576
|
-
const glowColor =
|
|
2577
|
+
const glowColor = chunkT7BAPZBY_js.parseDrawingColor(glow);
|
|
2577
2578
|
if (glowColor) {
|
|
2578
2579
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
2579
2580
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -2653,10 +2654,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2653
2654
|
if (runProps?.["@_u"] !== void 0) {
|
|
2654
2655
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
2655
2656
|
}
|
|
2656
|
-
const runColor =
|
|
2657
|
+
const runColor = chunkT7BAPZBY_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkT7BAPZBY_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
2657
2658
|
if (runColor) {
|
|
2658
|
-
const opacity =
|
|
2659
|
-
cellStyle.color =
|
|
2659
|
+
const opacity = chunkT7BAPZBY_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
2660
|
+
cellStyle.color = chunkT7BAPZBY_js.colorWithOpacity(runColor, opacity);
|
|
2660
2661
|
}
|
|
2661
2662
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
2662
2663
|
if (fontFamily) {
|
|
@@ -2666,15 +2667,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2666
2667
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
2667
2668
|
}
|
|
2668
2669
|
const cellProperties = cellXml["a:tcPr"];
|
|
2669
|
-
const cellFill =
|
|
2670
|
+
const cellFill = chunkT7BAPZBY_js.parseDrawingColor(
|
|
2670
2671
|
cellProperties?.["a:solidFill"],
|
|
2671
2672
|
schemeColorOverrides
|
|
2672
2673
|
);
|
|
2673
2674
|
if (cellFill) {
|
|
2674
|
-
const opacity =
|
|
2675
|
+
const opacity = chunkT7BAPZBY_js.parseDrawingColorOpacity(
|
|
2675
2676
|
cellProperties?.["a:solidFill"]
|
|
2676
2677
|
);
|
|
2677
|
-
cellStyle.backgroundColor =
|
|
2678
|
+
cellStyle.backgroundColor = chunkT7BAPZBY_js.colorWithOpacity(cellFill, opacity);
|
|
2678
2679
|
} else {
|
|
2679
2680
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
2680
2681
|
if (gradCss) {
|
|
@@ -2689,16 +2690,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2689
2690
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
2690
2691
|
Object.assign(cellStyle, edgeBorders);
|
|
2691
2692
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
2692
|
-
const borderColor =
|
|
2693
|
+
const borderColor = chunkT7BAPZBY_js.parseDrawingColor(
|
|
2693
2694
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
2694
2695
|
schemeColorOverrides
|
|
2695
|
-
) ||
|
|
2696
|
+
) || chunkT7BAPZBY_js.parseDrawingColor(
|
|
2696
2697
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
2697
2698
|
schemeColorOverrides
|
|
2698
|
-
) ||
|
|
2699
|
+
) || chunkT7BAPZBY_js.parseDrawingColor(
|
|
2699
2700
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
2700
2701
|
schemeColorOverrides
|
|
2701
|
-
) ||
|
|
2702
|
+
) || chunkT7BAPZBY_js.parseDrawingColor(
|
|
2702
2703
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
2703
2704
|
schemeColorOverrides
|
|
2704
2705
|
);
|
|
@@ -2770,7 +2771,7 @@ function getTableCellBandStyle2(element, rowIndex, cellIndex, rowCount, columnCo
|
|
|
2770
2771
|
if (element.type !== "table") {
|
|
2771
2772
|
return void 0;
|
|
2772
2773
|
}
|
|
2773
|
-
return
|
|
2774
|
+
return chunkT7BAPZBY_js.getTableCellBandStyle(element.tableData, rowIndex, cellIndex, rowCount, columnCount, {
|
|
2774
2775
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
2775
2776
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
2776
2777
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -2846,7 +2847,7 @@ function renderTableCellContent(cell, fallbackText) {
|
|
|
2846
2847
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2847
2848
|
"span",
|
|
2848
2849
|
{
|
|
2849
|
-
style: { position: "relative", ...
|
|
2850
|
+
style: { position: "relative", ...chunkT7BAPZBY_js.cellRunStyle(run) },
|
|
2850
2851
|
children: run.text
|
|
2851
2852
|
},
|
|
2852
2853
|
`r-${index}`
|
|
@@ -2854,7 +2855,7 @@ function renderTableCellContent(cell, fallbackText) {
|
|
|
2854
2855
|
});
|
|
2855
2856
|
}
|
|
2856
2857
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
2857
|
-
return
|
|
2858
|
+
return chunkT7BAPZBY_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
2858
2859
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
2859
2860
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
2860
2861
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -2987,7 +2988,7 @@ function TableResizeOverlay({
|
|
|
2987
2988
|
const containerRef = React6.useRef(null);
|
|
2988
2989
|
const [rowBounds, setRowBounds] = React6.useState([]);
|
|
2989
2990
|
const dragRef = React6.useRef(null);
|
|
2990
|
-
const colBoundaries = React6.useMemo(() =>
|
|
2991
|
+
const colBoundaries = React6.useMemo(() => chunkT7BAPZBY_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
2991
2992
|
const measureRows = React6.useCallback(() => {
|
|
2992
2993
|
const container = containerRef.current;
|
|
2993
2994
|
if (!container) {
|
|
@@ -3034,11 +3035,11 @@ function TableResizeOverlay({
|
|
|
3034
3035
|
const rect = containerRef.current.getBoundingClientRect();
|
|
3035
3036
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
3036
3037
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
3037
|
-
onResizeColumns(
|
|
3038
|
+
onResizeColumns(chunkT7BAPZBY_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
3038
3039
|
} else if (drag.type === "row" && onResizeRow) {
|
|
3039
3040
|
const deltaY = e.clientY - drag.startPos;
|
|
3040
|
-
const newHeight =
|
|
3041
|
-
drag.initialRowHeight ??
|
|
3041
|
+
const newHeight = chunkT7BAPZBY_js.computeResizedRowHeight(
|
|
3042
|
+
drag.initialRowHeight ?? chunkT7BAPZBY_js.DEFAULT_ROW_HEIGHT,
|
|
3042
3043
|
deltaY
|
|
3043
3044
|
);
|
|
3044
3045
|
onResizeRow(drag.index, newHeight);
|
|
@@ -3076,7 +3077,7 @@ function TableResizeOverlay({
|
|
|
3076
3077
|
e.stopPropagation();
|
|
3077
3078
|
const table = containerRef.current?.querySelector("table");
|
|
3078
3079
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
3079
|
-
const actualHeight = tr?.offsetHeight ??
|
|
3080
|
+
const actualHeight = tr?.offsetHeight ?? chunkT7BAPZBY_js.DEFAULT_ROW_HEIGHT;
|
|
3080
3081
|
document.body.style.cursor = "row-resize";
|
|
3081
3082
|
document.body.style.userSelect = "none";
|
|
3082
3083
|
dragRef.current = {
|
|
@@ -3123,7 +3124,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3123
3124
|
colorScheme: options?.styleCtx?.theme?.colorScheme,
|
|
3124
3125
|
fontScheme: options?.styleCtx?.theme?.fontScheme
|
|
3125
3126
|
};
|
|
3126
|
-
const cellCss = (cell, rowIndex, cellIndex) =>
|
|
3127
|
+
const cellCss = (cell, rowIndex, cellIndex) => chunkT7BAPZBY_js.tableCellCss(
|
|
3127
3128
|
tableData,
|
|
3128
3129
|
cell,
|
|
3129
3130
|
{ rowIndex, cellIndex, rowCount, columnCount },
|
|
@@ -3136,7 +3137,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3136
3137
|
}
|
|
3137
3138
|
const first = selectedCell.selectedCells[0];
|
|
3138
3139
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
3139
|
-
return
|
|
3140
|
+
return chunkT7BAPZBY_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
3140
3141
|
})();
|
|
3141
3142
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3142
3143
|
TableResizeOverlay,
|
|
@@ -3157,9 +3158,9 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3157
3158
|
{
|
|
3158
3159
|
className: "w-full h-full border-collapse table-fixed",
|
|
3159
3160
|
style: {
|
|
3160
|
-
fontFamily:
|
|
3161
|
+
fontFamily: chunkT7BAPZBY_js.DEFAULT_FONT_FAMILY,
|
|
3161
3162
|
// `a:tblPr@rtl` mirrors the column order for RTL decks.
|
|
3162
|
-
...
|
|
3163
|
+
...chunkT7BAPZBY_js.tableContainerCss(tableData)
|
|
3163
3164
|
},
|
|
3164
3165
|
children: [
|
|
3165
3166
|
tableData.columnWidths.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: tableData.columnWidths.map((w, ci) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3178,7 +3179,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3178
3179
|
return null;
|
|
3179
3180
|
}
|
|
3180
3181
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
3181
|
-
const isInMultiSelection =
|
|
3182
|
+
const isInMultiSelection = chunkT7BAPZBY_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
3182
3183
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
3183
3184
|
const diag = getCellDiagonalBorders2(
|
|
3184
3185
|
cell.style,
|
|
@@ -3207,7 +3208,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3207
3208
|
}
|
|
3208
3209
|
event.stopPropagation();
|
|
3209
3210
|
if (event.shiftKey && selectedCell) {
|
|
3210
|
-
const rect =
|
|
3211
|
+
const rect = chunkT7BAPZBY_js.computeSelectionRect(
|
|
3211
3212
|
selectedCell.rowIndex,
|
|
3212
3213
|
selectedCell.columnIndex,
|
|
3213
3214
|
rowIndex,
|
|
@@ -3217,7 +3218,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3217
3218
|
options?.onSelectCell?.({
|
|
3218
3219
|
rowIndex: selectedCell.rowIndex,
|
|
3219
3220
|
columnIndex: selectedCell.columnIndex,
|
|
3220
|
-
selectedCells:
|
|
3221
|
+
selectedCells: chunkT7BAPZBY_js.rectToCells(rect)
|
|
3221
3222
|
});
|
|
3222
3223
|
} else {
|
|
3223
3224
|
options?.onSelectCell?.({
|
|
@@ -3278,7 +3279,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3278
3279
|
if (tableEl2.tableData && tableEl2.tableData.rows.length > 0) {
|
|
3279
3280
|
return renderTableFromTableData(tableEl2, textStyle, options);
|
|
3280
3281
|
}
|
|
3281
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
3282
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkPIUB7R2K_js.translationsEn["pptx.table.title"] });
|
|
3282
3283
|
}
|
|
3283
3284
|
const selectedCell = options?.selectedCell || null;
|
|
3284
3285
|
const isEditable = Boolean(options?.editable);
|
|
@@ -3293,7 +3294,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3293
3294
|
}
|
|
3294
3295
|
const first = selectedCell.selectedCells[0];
|
|
3295
3296
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
3296
|
-
return
|
|
3297
|
+
return chunkT7BAPZBY_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
3297
3298
|
})();
|
|
3298
3299
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
3299
3300
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3315,9 +3316,9 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3315
3316
|
{
|
|
3316
3317
|
className: "w-full h-full border-collapse table-fixed",
|
|
3317
3318
|
style: {
|
|
3318
|
-
fontFamily:
|
|
3319
|
+
fontFamily: chunkT7BAPZBY_js.DEFAULT_FONT_FAMILY,
|
|
3319
3320
|
// `a:tblPr@rtl` mirrors the column order for RTL decks.
|
|
3320
|
-
...
|
|
3321
|
+
...chunkT7BAPZBY_js.tableContainerCss(tableEl.tableData)
|
|
3321
3322
|
},
|
|
3322
3323
|
children: [
|
|
3323
3324
|
parsedTable.columnPercentages.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: parsedTable.columnPercentages.map((percentage, columnIndex) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3374,7 +3375,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3374
3375
|
color: textStyle.color,
|
|
3375
3376
|
...bandStyle,
|
|
3376
3377
|
...xmlCellStyle,
|
|
3377
|
-
...tdCellOverride ?
|
|
3378
|
+
...tdCellOverride ? chunkT7BAPZBY_js.cellStyleToCss(tdCellOverride) : void 0,
|
|
3378
3379
|
...diag ? { position: "relative" } : void 0
|
|
3379
3380
|
};
|
|
3380
3381
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3384,7 +3385,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3384
3385
|
"border px-1 py-0.5 align-top",
|
|
3385
3386
|
isEditable && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
3386
3387
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
3387
|
-
|
|
3388
|
+
chunkT7BAPZBY_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
3388
3389
|
),
|
|
3389
3390
|
colSpan,
|
|
3390
3391
|
rowSpan: rSpan,
|
|
@@ -3395,7 +3396,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3395
3396
|
}
|
|
3396
3397
|
event.stopPropagation();
|
|
3397
3398
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
3398
|
-
const rect =
|
|
3399
|
+
const rect = chunkT7BAPZBY_js.computeSelectionRect(
|
|
3399
3400
|
selectedCell.rowIndex,
|
|
3400
3401
|
selectedCell.columnIndex,
|
|
3401
3402
|
rowIndex,
|
|
@@ -3405,7 +3406,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3405
3406
|
options?.onSelectCell?.({
|
|
3406
3407
|
rowIndex: selectedCell.rowIndex,
|
|
3407
3408
|
columnIndex: selectedCell.columnIndex,
|
|
3408
|
-
selectedCells:
|
|
3409
|
+
selectedCells: chunkT7BAPZBY_js.rectToCells(rect)
|
|
3409
3410
|
});
|
|
3410
3411
|
} else {
|
|
3411
3412
|
options?.onSelectCell?.({
|
|
@@ -3464,23 +3465,23 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3464
3465
|
);
|
|
3465
3466
|
}
|
|
3466
3467
|
function partAttrs(part) {
|
|
3467
|
-
return part ?
|
|
3468
|
+
return part ? chunkT7BAPZBY_js.chartPartToAttrs(part) : void 0;
|
|
3468
3469
|
}
|
|
3469
3470
|
function resolveReactPalette(chartData) {
|
|
3470
3471
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
3471
3472
|
return chartData.colorPalette;
|
|
3472
3473
|
}
|
|
3473
|
-
return [...
|
|
3474
|
+
return [...chunkT7BAPZBY_js.getChartStylePalette(chartData.style?.styleId)];
|
|
3474
3475
|
}
|
|
3475
3476
|
function buildReactChartViewModel(element) {
|
|
3476
3477
|
if (element.type !== "chart" || !element.chartData) {
|
|
3477
|
-
return
|
|
3478
|
+
return chunkT7BAPZBY_js.buildChartViewModel(element);
|
|
3478
3479
|
}
|
|
3479
3480
|
const palette = resolveReactPalette(element.chartData), themedElement = {
|
|
3480
3481
|
...element,
|
|
3481
3482
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
3482
3483
|
};
|
|
3483
|
-
return
|
|
3484
|
+
return chunkT7BAPZBY_js.buildChartViewModel(themedElement);
|
|
3484
3485
|
}
|
|
3485
3486
|
function renderPrimitive(prim, key) {
|
|
3486
3487
|
switch (prim.kind) {
|
|
@@ -3629,7 +3630,7 @@ function renderText(t, key) {
|
|
|
3629
3630
|
);
|
|
3630
3631
|
}
|
|
3631
3632
|
function renderChartViewModel(elementId, vm, preserveAspectRatio = "none") {
|
|
3632
|
-
const legendItems =
|
|
3633
|
+
const legendItems = chunkT7BAPZBY_js.computeChartLegendLayout(vm);
|
|
3633
3634
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3634
3635
|
"svg",
|
|
3635
3636
|
{
|
|
@@ -3722,17 +3723,17 @@ function renderChartViewModel(elementId, vm, preserveAspectRatio = "none") {
|
|
|
3722
3723
|
}
|
|
3723
3724
|
function renderChartElement(element) {
|
|
3724
3725
|
if (element.type !== "chart") {
|
|
3725
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
3726
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkPIUB7R2K_js.translationsEn["pptx.chart.heading"] });
|
|
3726
3727
|
}
|
|
3727
3728
|
const chartData = element.chartData;
|
|
3728
3729
|
if (!chartData || chartData.series.length === 0) {
|
|
3729
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
3730
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkPIUB7R2K_js.translationsEn["pptx.chart.heading"] });
|
|
3730
3731
|
}
|
|
3731
|
-
const kind =
|
|
3732
|
+
const kind = chunkT7BAPZBY_js.resolveChartKind(chartData.chartType ?? "bar");
|
|
3732
3733
|
return renderChartViewModel(
|
|
3733
3734
|
element.id,
|
|
3734
3735
|
buildReactChartViewModel(element),
|
|
3735
|
-
|
|
3736
|
+
chunkT7BAPZBY_js.chartPreserveAspectRatio(kind)
|
|
3736
3737
|
);
|
|
3737
3738
|
}
|
|
3738
3739
|
|
|
@@ -3752,14 +3753,14 @@ function buildNotesPdf(pages) {
|
|
|
3752
3753
|
notes: page.notes,
|
|
3753
3754
|
slideNumber: page.slideNumber
|
|
3754
3755
|
}));
|
|
3755
|
-
const bytes =
|
|
3756
|
+
const bytes = chunkT7BAPZBY_js.buildNotesPdfBytes(images, meta);
|
|
3756
3757
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
3757
3758
|
return URL.createObjectURL(blob);
|
|
3758
3759
|
}
|
|
3759
3760
|
|
|
3760
3761
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
3761
3762
|
function buildPdfFromImageData(images) {
|
|
3762
|
-
const bytes =
|
|
3763
|
+
const bytes = chunkT7BAPZBY_js.buildSlidesPdfBytes(images);
|
|
3763
3764
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
3764
3765
|
return URL.createObjectURL(blob);
|
|
3765
3766
|
}
|
|
@@ -3768,7 +3769,7 @@ function buildPdfFromImageData(images) {
|
|
|
3768
3769
|
var activePreview = null;
|
|
3769
3770
|
function startPreviewAnimation(elementId, preset, options) {
|
|
3770
3771
|
stopPreviewAnimation();
|
|
3771
|
-
const descriptor =
|
|
3772
|
+
const descriptor = chunkT7BAPZBY_js.buildPreviewAnimation(preset, options);
|
|
3772
3773
|
if (!descriptor) {
|
|
3773
3774
|
return;
|
|
3774
3775
|
}
|
|
@@ -3781,7 +3782,7 @@ function startMotionPathPreview(elementId, path, options) {
|
|
|
3781
3782
|
return;
|
|
3782
3783
|
}
|
|
3783
3784
|
const stage = domEl.offsetParent;
|
|
3784
|
-
const descriptor =
|
|
3785
|
+
const descriptor = chunkT7BAPZBY_js.buildMotionPathPreview({
|
|
3785
3786
|
path,
|
|
3786
3787
|
slideWidth: stage?.offsetWidth || DEFAULT_PREVIEW_SLIDE_WIDTH,
|
|
3787
3788
|
slideHeight: stage?.offsetHeight || DEFAULT_PREVIEW_SLIDE_HEIGHT,
|