pptx-react-viewer 3.1.0 → 3.1.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 +50 -0
- package/dist/{AiChatPanel-WVORGKRT.js → AiChatPanel-6PERJN7M.js} +23 -23
- package/dist/AiChatPanel-6PERJN7M.js.br +0 -0
- package/dist/AiChatPanel-6PERJN7M.js.gz +0 -0
- package/dist/{AiChatPanel-5LCCN7FG.mjs → AiChatPanel-EIENGCKW.mjs} +3 -3
- package/dist/AiChatPanel-EIENGCKW.mjs.br +0 -0
- package/dist/AiChatPanel-EIENGCKW.mjs.gz +0 -0
- package/dist/{Area3DChartScene-DY5CSLE2.js → Area3DChartScene-TXCLQLBQ.js} +2 -2
- package/dist/Area3DChartScene-TXCLQLBQ.js.br +0 -0
- package/dist/Area3DChartScene-TXCLQLBQ.js.gz +0 -0
- package/dist/{Area3DChartScene-W6UZTRDP.mjs → Area3DChartScene-W6SVC235.mjs} +1 -1
- package/dist/{Area3DChartScene-W6UZTRDP.mjs.br → Area3DChartScene-W6SVC235.mjs.br} +0 -0
- package/dist/Area3DChartScene-W6SVC235.mjs.gz +0 -0
- package/dist/{Bar3DChartScene-7HZSPYG4.js → Bar3DChartScene-6RHPFLZT.js} +2 -2
- package/dist/Bar3DChartScene-6RHPFLZT.js.br +0 -0
- package/dist/Bar3DChartScene-6RHPFLZT.js.gz +0 -0
- package/dist/{Bar3DChartScene-FCWQEQLH.mjs → Bar3DChartScene-FCVUZIJ3.mjs} +1 -1
- package/dist/{Bar3DChartScene-FCWQEQLH.mjs.br → Bar3DChartScene-FCVUZIJ3.mjs.br} +0 -0
- package/dist/Bar3DChartScene-FCVUZIJ3.mjs.gz +0 -0
- package/dist/{Line3DChartScene-BKO24WYO.js → Line3DChartScene-2ZFE53KO.js} +2 -2
- package/dist/Line3DChartScene-2ZFE53KO.js.br +0 -0
- package/dist/Line3DChartScene-2ZFE53KO.js.gz +0 -0
- package/dist/{Line3DChartScene-EPPWQOHS.mjs → Line3DChartScene-MJXFXSPW.mjs} +1 -1
- package/dist/{Line3DChartScene-EPPWQOHS.mjs.br → Line3DChartScene-MJXFXSPW.mjs.br} +0 -0
- package/dist/Line3DChartScene-MJXFXSPW.mjs.gz +0 -0
- package/dist/{Model3DScene-JFVRE5VL.js → Model3DScene-7VQNRY5B.js} +2 -2
- package/dist/Model3DScene-7VQNRY5B.js.br +0 -0
- package/dist/Model3DScene-7VQNRY5B.js.gz +0 -0
- package/dist/{Model3DScene-IAY33GO2.mjs → Model3DScene-A5RV3KNJ.mjs} +1 -1
- package/dist/{Model3DScene-IAY33GO2.mjs.br → Model3DScene-A5RV3KNJ.mjs.br} +0 -0
- package/dist/Model3DScene-A5RV3KNJ.mjs.gz +0 -0
- package/dist/{PieChart3DScene-IPH7GLKU.js → PieChart3DScene-JTHZESS3.js} +2 -2
- package/dist/PieChart3DScene-JTHZESS3.js.br +0 -0
- package/dist/PieChart3DScene-JTHZESS3.js.gz +0 -0
- package/dist/{PieChart3DScene-ZP5TSL62.mjs → PieChart3DScene-UEVFZZVW.mjs} +1 -1
- package/dist/PieChart3DScene-UEVFZZVW.mjs.br +0 -0
- package/dist/PieChart3DScene-UEVFZZVW.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-TGDBVJSW.js → SurfaceChart3DScene-FXUNT5OK.js} +2 -2
- package/dist/SurfaceChart3DScene-FXUNT5OK.js.br +0 -0
- package/dist/SurfaceChart3DScene-FXUNT5OK.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-DOMJGPAD.mjs → SurfaceChart3DScene-WD65PAG4.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-DOMJGPAD.mjs.br → SurfaceChart3DScene-WD65PAG4.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-WD65PAG4.mjs.gz +0 -0
- package/dist/{chunk-PQNZCSB7.mjs → chunk-5ERW2B25.mjs} +1 -1
- package/dist/chunk-5ERW2B25.mjs.br +0 -0
- package/dist/chunk-5ERW2B25.mjs.gz +0 -0
- package/dist/{chunk-7JZLE56X.js → chunk-GCE2TYHF.js} +148 -148
- package/dist/chunk-GCE2TYHF.js.br +0 -0
- package/dist/chunk-GCE2TYHF.js.gz +0 -0
- package/dist/{chunk-A5EUD6UU.js → chunk-GIFQWIW5.js} +1159 -1193
- package/dist/chunk-GIFQWIW5.js.br +0 -0
- package/dist/chunk-GIFQWIW5.js.gz +0 -0
- package/dist/{chunk-TIEUZCYQ.mjs → chunk-ICAYXQVJ.mjs} +79 -113
- package/dist/chunk-ICAYXQVJ.mjs.br +0 -0
- package/dist/chunk-ICAYXQVJ.mjs.gz +0 -0
- package/dist/{chunk-T7BAPZBY.js → chunk-IDTNKL4S.js} +5 -0
- package/dist/chunk-IDTNKL4S.js.br +0 -0
- package/dist/{chunk-T7BAPZBY.js.gz → chunk-IDTNKL4S.js.gz} +0 -0
- package/dist/{chunk-BP2L2KOZ.mjs → chunk-ISDTM2V3.mjs} +5 -0
- package/dist/chunk-ISDTM2V3.mjs.br +0 -0
- package/dist/{chunk-BP2L2KOZ.mjs.gz → chunk-ISDTM2V3.mjs.gz} +0 -0
- package/dist/{chunk-VMLKJDA5.mjs → chunk-MAOUVROK.mjs} +2 -2
- package/dist/chunk-MAOUVROK.mjs.br +0 -0
- package/dist/chunk-MAOUVROK.mjs.gz +0 -0
- package/dist/{chunk-POAZ53L5.js → chunk-OTBQBTTQ.js} +385 -385
- package/dist/chunk-OTBQBTTQ.js.br +0 -0
- package/dist/chunk-OTBQBTTQ.js.gz +0 -0
- package/dist/{chunk-SNWAM2XJ.mjs → chunk-OUX4O5XK.mjs} +1 -1
- package/dist/chunk-OUX4O5XK.mjs.br +0 -0
- package/dist/chunk-OUX4O5XK.mjs.gz +0 -0
- package/dist/{chunk-VQVC27WL.js → chunk-OZGFMZEX.js} +3 -3
- package/dist/chunk-OZGFMZEX.js.br +0 -0
- package/dist/chunk-OZGFMZEX.js.gz +0 -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.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.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 +1 -1
- package/dist/AiChatPanel-5LCCN7FG.mjs.br +0 -0
- package/dist/AiChatPanel-5LCCN7FG.mjs.gz +0 -0
- package/dist/AiChatPanel-WVORGKRT.js.br +0 -0
- package/dist/AiChatPanel-WVORGKRT.js.gz +0 -0
- package/dist/Area3DChartScene-DY5CSLE2.js.br +0 -0
- package/dist/Area3DChartScene-DY5CSLE2.js.gz +0 -0
- package/dist/Area3DChartScene-W6UZTRDP.mjs.gz +0 -0
- package/dist/Bar3DChartScene-7HZSPYG4.js.br +0 -0
- package/dist/Bar3DChartScene-7HZSPYG4.js.gz +0 -0
- package/dist/Bar3DChartScene-FCWQEQLH.mjs.gz +0 -0
- package/dist/Line3DChartScene-BKO24WYO.js.br +0 -0
- package/dist/Line3DChartScene-BKO24WYO.js.gz +0 -0
- package/dist/Line3DChartScene-EPPWQOHS.mjs.gz +0 -0
- package/dist/Model3DScene-IAY33GO2.mjs.gz +0 -0
- package/dist/Model3DScene-JFVRE5VL.js.br +0 -0
- package/dist/Model3DScene-JFVRE5VL.js.gz +0 -0
- package/dist/PieChart3DScene-IPH7GLKU.js.br +0 -0
- package/dist/PieChart3DScene-IPH7GLKU.js.gz +0 -0
- package/dist/PieChart3DScene-ZP5TSL62.mjs.br +0 -0
- package/dist/PieChart3DScene-ZP5TSL62.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-DOMJGPAD.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-TGDBVJSW.js.br +0 -0
- package/dist/SurfaceChart3DScene-TGDBVJSW.js.gz +0 -0
- package/dist/chunk-7JZLE56X.js.br +0 -0
- package/dist/chunk-7JZLE56X.js.gz +0 -0
- package/dist/chunk-A5EUD6UU.js.br +0 -0
- package/dist/chunk-A5EUD6UU.js.gz +0 -0
- package/dist/chunk-BP2L2KOZ.mjs.br +0 -0
- package/dist/chunk-POAZ53L5.js.br +0 -0
- package/dist/chunk-POAZ53L5.js.gz +0 -0
- package/dist/chunk-PQNZCSB7.mjs.br +0 -0
- package/dist/chunk-PQNZCSB7.mjs.gz +0 -0
- package/dist/chunk-SNWAM2XJ.mjs.br +0 -0
- package/dist/chunk-SNWAM2XJ.mjs.gz +0 -0
- package/dist/chunk-T7BAPZBY.js.br +0 -0
- package/dist/chunk-TIEUZCYQ.mjs.br +0 -0
- package/dist/chunk-TIEUZCYQ.mjs.gz +0 -0
- package/dist/chunk-VMLKJDA5.mjs.br +0 -0
- package/dist/chunk-VMLKJDA5.mjs.gz +0 -0
- package/dist/chunk-VQVC27WL.js.br +0 -0
- package/dist/chunk-VQVC27WL.js.gz +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkPIUB7R2K_js = require('./chunk-PIUB7R2K.js');
|
|
4
|
-
var
|
|
4
|
+
var chunkIDTNKL4S_js = require('./chunk-IDTNKL4S.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 chunkIDTNKL4S_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 chunkIDTNKL4S_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 = chunkIDTNKL4S_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 = chunkIDTNKL4S_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 (!chunkIDTNKL4S_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 (!chunkIDTNKL4S_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 = chunkIDTNKL4S_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 = chunkIDTNKL4S_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
|
+
...chunkIDTNKL4S_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 (!chunkIDTNKL4S_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 chunkIDTNKL4S_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 chunkIDTNKL4S_js.runMediaCommand(
|
|
530
530
|
command,
|
|
531
|
-
(targetId) => registry.get(targetId) ??
|
|
531
|
+
(targetId) => registry.get(targetId) ?? chunkIDTNKL4S_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
|
+
} = chunkIDTNKL4S_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
|
+
chunkIDTNKL4S_js.registerPersistentAudio(
|
|
712
712
|
element.id,
|
|
713
713
|
dataUrl,
|
|
714
714
|
element.mediaMimeType,
|
|
@@ -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
|
+
...{ [chunkIDTNKL4S_js.MEDIA_CHROME_ATTRIBUTE]: visual.badge },
|
|
810
810
|
children: [
|
|
811
811
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
812
812
|
FallbackIcon,
|
|
813
813
|
{
|
|
814
|
-
paths:
|
|
814
|
+
paths: chunkIDTNKL4S_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(chunkIDTNKL4S_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
|
+
...{ [chunkIDTNKL4S_js.MEDIA_CHROME_ATTRIBUTE]: visual.placeholder },
|
|
837
837
|
children: [
|
|
838
838
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
839
839
|
FallbackIcon,
|
|
840
840
|
{
|
|
841
|
-
paths:
|
|
841
|
+
paths: chunkIDTNKL4S_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(chunkIDTNKL4S_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 = chunkIDTNKL4S_js.mediaFallbackVisual(surface, {
|
|
857
857
|
hasPoster: Boolean(posterUrl),
|
|
858
858
|
missing: element.mediaMissing === true
|
|
859
859
|
});
|
|
@@ -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 = chunkIDTNKL4S_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;
|
|
@@ -965,19 +965,19 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
965
965
|
|
|
966
966
|
// src/viewer/utils/text-utils.tsx
|
|
967
967
|
function getTextStyleForElement(element, fallbackColor) {
|
|
968
|
-
return
|
|
968
|
+
return chunkIDTNKL4S_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 (!chunkIDTNKL4S_js.hasTextProperties(element)) {
|
|
974
974
|
return {};
|
|
975
975
|
}
|
|
976
|
-
const writingMode =
|
|
977
|
-
const textOrientation =
|
|
978
|
-
const verticalDirection =
|
|
976
|
+
const writingMode = chunkIDTNKL4S_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
977
|
+
const textOrientation = chunkIDTNKL4S_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
978
|
+
const verticalDirection = chunkIDTNKL4S_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
979
979
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
980
|
-
const hasParagraphIndents =
|
|
980
|
+
const hasParagraphIndents = chunkIDTNKL4S_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
|
+
...chunkIDTNKL4S_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 chunkIDTNKL4S_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}${chunkIDTNKL4S_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 = chunkIDTNKL4S_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: chunkIDTNKL4S_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] = chunkIDTNKL4S_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 = chunkIDTNKL4S_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 = chunkIDTNKL4S_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: chunkIDTNKL4S_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 = chunkIDTNKL4S_js.convertOmmlToMathMl(equationXml);
|
|
1352
|
+
const safeMathml = mathml ? chunkIDTNKL4S_js.sanitizeMathMl(mathml) : "";
|
|
1353
1353
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1354
1354
|
"span",
|
|
1355
1355
|
{
|
|
@@ -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 = chunkIDTNKL4S_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 * chunkIDTNKL4S_js.resolveAutoFitFontScale(element.textStyle);
|
|
1489
1489
|
const baselineShift = baselineFraction !== 0 ? `${baselineFraction * baseFontSize}px` : void 0;
|
|
1490
|
-
const fontKerning =
|
|
1490
|
+
const fontKerning = chunkIDTNKL4S_js.resolveFontKerning(segmentStyle.kerning, baseFontSize);
|
|
1491
1491
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
1492
|
-
const baseFontFamily = rawFontFamily ?
|
|
1492
|
+
const baseFontFamily = rawFontFamily ? chunkIDTNKL4S_js.getSubstituteFontFamily(
|
|
1493
1493
|
rawFontFamily,
|
|
1494
|
-
|
|
1494
|
+
chunkIDTNKL4S_js.parsePanoseString(segmentStyle.latinFontPanose ?? element.textStyle?.latinFontPanose)
|
|
1495
1495
|
) : DEFAULT_FONT_FAMILY2;
|
|
1496
|
-
const scriptFonts =
|
|
1497
|
-
const needsScriptFonts =
|
|
1496
|
+
const scriptFonts = chunkIDTNKL4S_js.resolveScriptFontSet(segmentStyle, element.textStyle, baseFontFamily);
|
|
1497
|
+
const needsScriptFonts = chunkIDTNKL4S_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 = chunkIDTNKL4S_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 = chunkIDTNKL4S_js.pieceLetterSpacing(
|
|
1514
1514
|
authoredLetterSpacing,
|
|
1515
|
-
|
|
1515
|
+
chunkIDTNKL4S_js.resolveMetricTrackingPx(textValue, metricFont)
|
|
1516
1516
|
);
|
|
1517
|
-
const hollow =
|
|
1517
|
+
const hollow = chunkIDTNKL4S_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
|
+
chunkIDTNKL4S_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 (!chunkIDTNKL4S_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 = chunkIDTNKL4S_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 (!chunkIDTNKL4S_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 (!chunkIDTNKL4S_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 ${chunkIDTNKL4S_js.colorWithOpacity(
|
|
1725
|
+
chunkIDTNKL4S_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
1726
1726
|
opacity
|
|
1727
1727
|
)}`;
|
|
1728
1728
|
}
|
|
1729
1729
|
function buildLineGlowFilter(element) {
|
|
1730
|
-
if (!
|
|
1730
|
+
if (!chunkIDTNKL4S_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 = chunkIDTNKL4S_js.colorWithOpacity(chunkIDTNKL4S_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 (!chunkIDTNKL4S_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 chunkIDTNKL4S_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
|
+
chunkIDTNKL4S_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 (!chunkIDTNKL4S_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 : chunkIDTNKL4S_js.getComputedFillStyle(element, parentGroupFill);
|
|
1820
|
+
const fx = chunkIDTNKL4S_js.getComputedEffectStyle(element);
|
|
1821
|
+
const stroke = chunkIDTNKL4S_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) || chunkIDTNKL4S_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 = chunkIDTNKL4S_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 chunkIDTNKL4S_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 chunkIDTNKL4S_js.clampUnitInterval(fallbackKey / 1e5);
|
|
1901
1901
|
}
|
|
1902
|
-
return
|
|
1902
|
+
return chunkIDTNKL4S_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: chunkIDTNKL4S_js.svgLineCap(shapeStyle?.lineCap),
|
|
2040
2040
|
lineJoin,
|
|
2041
2041
|
miterLimit,
|
|
2042
|
-
offsets:
|
|
2043
|
-
widths:
|
|
2042
|
+
offsets: chunkIDTNKL4S_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
2043
|
+
widths: chunkIDTNKL4S_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 ? chunkIDTNKL4S_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 ? chunkIDTNKL4S_js.svgGradientFillRef(gradient) : void 0;
|
|
2094
2094
|
const nodes = [];
|
|
2095
2095
|
if (subpaths && needsPerSubpath) {
|
|
2096
|
-
const paints =
|
|
2096
|
+
const paints = chunkIDTNKL4S_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 ?? chunkIDTNKL4S_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 (!chunkIDTNKL4S_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" : chunkIDTNKL4S_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
2156
|
+
const strokePaint = animatesStroke ? "inherit" : chunkIDTNKL4S_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
2157
|
+
const dashType = chunkIDTNKL4S_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2158
|
+
const dashArray = chunkIDTNKL4S_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
|
+
chunkIDTNKL4S_js.buildSvgGradientDef(element.shapeStyle, element.id)
|
|
2240
2240
|
);
|
|
2241
2241
|
}
|
|
2242
|
-
if (
|
|
2242
|
+
if (chunkIDTNKL4S_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 = chunkIDTNKL4S_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 = chunkIDTNKL4S_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
2253
|
+
const bounds = chunkIDTNKL4S_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 = chunkIDTNKL4S_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
2317
2317
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
2318
|
-
const offsets =
|
|
2319
|
-
const widths =
|
|
2318
|
+
const offsets = chunkIDTNKL4S_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
2319
|
+
const widths = chunkIDTNKL4S_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
2320
2320
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2321
2321
|
"svg",
|
|
2322
2322
|
{
|
|
@@ -2383,15 +2383,15 @@ function parseGradientFillCss(gradFill) {
|
|
|
2383
2383
|
}
|
|
2384
2384
|
const rawStops = stops.map((gs) => {
|
|
2385
2385
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
2386
|
-
const color =
|
|
2387
|
-
const opacity =
|
|
2386
|
+
const color = chunkIDTNKL4S_js.parseDrawingColor(gs) ?? "#888888";
|
|
2387
|
+
const opacity = chunkIDTNKL4S_js.parseDrawingColorOpacity(gs);
|
|
2388
2388
|
return { position: pos, color, opacity };
|
|
2389
2389
|
}).sort((a, b) => a.position - b.position);
|
|
2390
|
-
const stopStrings = rawStops.map((s) => `${
|
|
2390
|
+
const stopStrings = rawStops.map((s) => `${chunkIDTNKL4S_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(chunkIDTNKL4S_js.ooxmlGradientAngleToCssDegrees(angRaw / 6e4));
|
|
2395
2395
|
return `linear-gradient(${angleDeg}deg, ${stopStrings})`;
|
|
2396
2396
|
}
|
|
2397
2397
|
const path = gradFill["a:path"];
|
|
@@ -2405,7 +2405,7 @@ function parseGradientFillCss(gradFill) {
|
|
|
2405
2405
|
b: Number.parseInt(String(fillToRectXml["@_b"] || "0"), 10) / 1e5
|
|
2406
2406
|
} : void 0;
|
|
2407
2407
|
if (pathType === "rect") {
|
|
2408
|
-
return
|
|
2408
|
+
return chunkIDTNKL4S_js.buildRectPathGradient(rawStops, void 0, fillToRect);
|
|
2409
2409
|
}
|
|
2410
2410
|
let cx = 50;
|
|
2411
2411
|
let cy = 50;
|
|
@@ -2427,8 +2427,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
2427
2427
|
if (!pattFill) {
|
|
2428
2428
|
return void 0;
|
|
2429
2429
|
}
|
|
2430
|
-
const fgColor =
|
|
2431
|
-
const bgColor =
|
|
2430
|
+
const fgColor = chunkIDTNKL4S_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
2431
|
+
const bgColor = chunkIDTNKL4S_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
2432
2432
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
2433
2433
|
switch (preset) {
|
|
2434
2434
|
case "ltHorz":
|
|
@@ -2539,11 +2539,11 @@ function parseCellBorders(cellProperties) {
|
|
|
2539
2539
|
const prstDash = ln["a:prstDash"];
|
|
2540
2540
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
2541
2541
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
2542
|
-
const color =
|
|
2542
|
+
const color = chunkIDTNKL4S_js.parseDrawingColor(ln["a:solidFill"]);
|
|
2543
2543
|
if (color) {
|
|
2544
|
-
const opacity =
|
|
2544
|
+
const opacity = chunkIDTNKL4S_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
2545
2545
|
const key = `${edge.prefix}`;
|
|
2546
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
2546
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkIDTNKL4S_js.colorWithOpacity(color, opacity)}`;
|
|
2547
2547
|
}
|
|
2548
2548
|
}
|
|
2549
2549
|
return borderStyle;
|
|
@@ -2556,7 +2556,7 @@ function parseCellTextEffects(runProps) {
|
|
|
2556
2556
|
const textShadowParts = [];
|
|
2557
2557
|
const outerShdw = effectLst["a:outerShdw"];
|
|
2558
2558
|
if (outerShdw) {
|
|
2559
|
-
const shdwColor =
|
|
2559
|
+
const shdwColor = chunkIDTNKL4S_js.parseDrawingColor(outerShdw);
|
|
2560
2560
|
if (shdwColor) {
|
|
2561
2561
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
2562
2562
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -2574,7 +2574,7 @@ function parseCellTextEffects(runProps) {
|
|
|
2574
2574
|
}
|
|
2575
2575
|
const glow = effectLst["a:glow"];
|
|
2576
2576
|
if (glow) {
|
|
2577
|
-
const glowColor =
|
|
2577
|
+
const glowColor = chunkIDTNKL4S_js.parseDrawingColor(glow);
|
|
2578
2578
|
if (glowColor) {
|
|
2579
2579
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
2580
2580
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -2654,10 +2654,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2654
2654
|
if (runProps?.["@_u"] !== void 0) {
|
|
2655
2655
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
2656
2656
|
}
|
|
2657
|
-
const runColor =
|
|
2657
|
+
const runColor = chunkIDTNKL4S_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkIDTNKL4S_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
2658
2658
|
if (runColor) {
|
|
2659
|
-
const opacity =
|
|
2660
|
-
cellStyle.color =
|
|
2659
|
+
const opacity = chunkIDTNKL4S_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
2660
|
+
cellStyle.color = chunkIDTNKL4S_js.colorWithOpacity(runColor, opacity);
|
|
2661
2661
|
}
|
|
2662
2662
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
2663
2663
|
if (fontFamily) {
|
|
@@ -2667,15 +2667,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2667
2667
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
2668
2668
|
}
|
|
2669
2669
|
const cellProperties = cellXml["a:tcPr"];
|
|
2670
|
-
const cellFill =
|
|
2670
|
+
const cellFill = chunkIDTNKL4S_js.parseDrawingColor(
|
|
2671
2671
|
cellProperties?.["a:solidFill"],
|
|
2672
2672
|
schemeColorOverrides
|
|
2673
2673
|
);
|
|
2674
2674
|
if (cellFill) {
|
|
2675
|
-
const opacity =
|
|
2675
|
+
const opacity = chunkIDTNKL4S_js.parseDrawingColorOpacity(
|
|
2676
2676
|
cellProperties?.["a:solidFill"]
|
|
2677
2677
|
);
|
|
2678
|
-
cellStyle.backgroundColor =
|
|
2678
|
+
cellStyle.backgroundColor = chunkIDTNKL4S_js.colorWithOpacity(cellFill, opacity);
|
|
2679
2679
|
} else {
|
|
2680
2680
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
2681
2681
|
if (gradCss) {
|
|
@@ -2690,16 +2690,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2690
2690
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
2691
2691
|
Object.assign(cellStyle, edgeBorders);
|
|
2692
2692
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
2693
|
-
const borderColor =
|
|
2693
|
+
const borderColor = chunkIDTNKL4S_js.parseDrawingColor(
|
|
2694
2694
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
2695
2695
|
schemeColorOverrides
|
|
2696
|
-
) ||
|
|
2696
|
+
) || chunkIDTNKL4S_js.parseDrawingColor(
|
|
2697
2697
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
2698
2698
|
schemeColorOverrides
|
|
2699
|
-
) ||
|
|
2699
|
+
) || chunkIDTNKL4S_js.parseDrawingColor(
|
|
2700
2700
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
2701
2701
|
schemeColorOverrides
|
|
2702
|
-
) ||
|
|
2702
|
+
) || chunkIDTNKL4S_js.parseDrawingColor(
|
|
2703
2703
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
2704
2704
|
schemeColorOverrides
|
|
2705
2705
|
);
|
|
@@ -2771,7 +2771,7 @@ function getTableCellBandStyle2(element, rowIndex, cellIndex, rowCount, columnCo
|
|
|
2771
2771
|
if (element.type !== "table") {
|
|
2772
2772
|
return void 0;
|
|
2773
2773
|
}
|
|
2774
|
-
return
|
|
2774
|
+
return chunkIDTNKL4S_js.getTableCellBandStyle(element.tableData, rowIndex, cellIndex, rowCount, columnCount, {
|
|
2775
2775
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
2776
2776
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
2777
2777
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -2847,7 +2847,7 @@ function renderTableCellContent(cell, fallbackText) {
|
|
|
2847
2847
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2848
2848
|
"span",
|
|
2849
2849
|
{
|
|
2850
|
-
style: { position: "relative", ...
|
|
2850
|
+
style: { position: "relative", ...chunkIDTNKL4S_js.cellRunStyle(run) },
|
|
2851
2851
|
children: run.text
|
|
2852
2852
|
},
|
|
2853
2853
|
`r-${index}`
|
|
@@ -2855,7 +2855,7 @@ function renderTableCellContent(cell, fallbackText) {
|
|
|
2855
2855
|
});
|
|
2856
2856
|
}
|
|
2857
2857
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
2858
|
-
return
|
|
2858
|
+
return chunkIDTNKL4S_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
2859
2859
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
2860
2860
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
2861
2861
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -2988,7 +2988,7 @@ function TableResizeOverlay({
|
|
|
2988
2988
|
const containerRef = React6.useRef(null);
|
|
2989
2989
|
const [rowBounds, setRowBounds] = React6.useState([]);
|
|
2990
2990
|
const dragRef = React6.useRef(null);
|
|
2991
|
-
const colBoundaries = React6.useMemo(() =>
|
|
2991
|
+
const colBoundaries = React6.useMemo(() => chunkIDTNKL4S_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
2992
2992
|
const measureRows = React6.useCallback(() => {
|
|
2993
2993
|
const container = containerRef.current;
|
|
2994
2994
|
if (!container) {
|
|
@@ -3035,11 +3035,11 @@ function TableResizeOverlay({
|
|
|
3035
3035
|
const rect = containerRef.current.getBoundingClientRect();
|
|
3036
3036
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
3037
3037
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
3038
|
-
onResizeColumns(
|
|
3038
|
+
onResizeColumns(chunkIDTNKL4S_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
3039
3039
|
} else if (drag.type === "row" && onResizeRow) {
|
|
3040
3040
|
const deltaY = e.clientY - drag.startPos;
|
|
3041
|
-
const newHeight =
|
|
3042
|
-
drag.initialRowHeight ??
|
|
3041
|
+
const newHeight = chunkIDTNKL4S_js.computeResizedRowHeight(
|
|
3042
|
+
drag.initialRowHeight ?? chunkIDTNKL4S_js.DEFAULT_ROW_HEIGHT,
|
|
3043
3043
|
deltaY
|
|
3044
3044
|
);
|
|
3045
3045
|
onResizeRow(drag.index, newHeight);
|
|
@@ -3077,7 +3077,7 @@ function TableResizeOverlay({
|
|
|
3077
3077
|
e.stopPropagation();
|
|
3078
3078
|
const table = containerRef.current?.querySelector("table");
|
|
3079
3079
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
3080
|
-
const actualHeight = tr?.offsetHeight ??
|
|
3080
|
+
const actualHeight = tr?.offsetHeight ?? chunkIDTNKL4S_js.DEFAULT_ROW_HEIGHT;
|
|
3081
3081
|
document.body.style.cursor = "row-resize";
|
|
3082
3082
|
document.body.style.userSelect = "none";
|
|
3083
3083
|
dragRef.current = {
|
|
@@ -3124,7 +3124,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3124
3124
|
colorScheme: options?.styleCtx?.theme?.colorScheme,
|
|
3125
3125
|
fontScheme: options?.styleCtx?.theme?.fontScheme
|
|
3126
3126
|
};
|
|
3127
|
-
const cellCss = (cell, rowIndex, cellIndex) =>
|
|
3127
|
+
const cellCss = (cell, rowIndex, cellIndex) => chunkIDTNKL4S_js.tableCellCss(
|
|
3128
3128
|
tableData,
|
|
3129
3129
|
cell,
|
|
3130
3130
|
{ rowIndex, cellIndex, rowCount, columnCount },
|
|
@@ -3137,7 +3137,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3137
3137
|
}
|
|
3138
3138
|
const first = selectedCell.selectedCells[0];
|
|
3139
3139
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
3140
|
-
return
|
|
3140
|
+
return chunkIDTNKL4S_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
3141
3141
|
})();
|
|
3142
3142
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3143
3143
|
TableResizeOverlay,
|
|
@@ -3158,9 +3158,9 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3158
3158
|
{
|
|
3159
3159
|
className: "w-full h-full border-collapse table-fixed",
|
|
3160
3160
|
style: {
|
|
3161
|
-
fontFamily:
|
|
3161
|
+
fontFamily: chunkIDTNKL4S_js.DEFAULT_FONT_FAMILY,
|
|
3162
3162
|
// `a:tblPr@rtl` mirrors the column order for RTL decks.
|
|
3163
|
-
...
|
|
3163
|
+
...chunkIDTNKL4S_js.tableContainerCss(tableData)
|
|
3164
3164
|
},
|
|
3165
3165
|
children: [
|
|
3166
3166
|
tableData.columnWidths.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: tableData.columnWidths.map((w, ci) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3179,7 +3179,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3179
3179
|
return null;
|
|
3180
3180
|
}
|
|
3181
3181
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
3182
|
-
const isInMultiSelection =
|
|
3182
|
+
const isInMultiSelection = chunkIDTNKL4S_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
3183
3183
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
3184
3184
|
const diag = getCellDiagonalBorders2(
|
|
3185
3185
|
cell.style,
|
|
@@ -3208,7 +3208,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3208
3208
|
}
|
|
3209
3209
|
event.stopPropagation();
|
|
3210
3210
|
if (event.shiftKey && selectedCell) {
|
|
3211
|
-
const rect =
|
|
3211
|
+
const rect = chunkIDTNKL4S_js.computeSelectionRect(
|
|
3212
3212
|
selectedCell.rowIndex,
|
|
3213
3213
|
selectedCell.columnIndex,
|
|
3214
3214
|
rowIndex,
|
|
@@ -3218,7 +3218,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3218
3218
|
options?.onSelectCell?.({
|
|
3219
3219
|
rowIndex: selectedCell.rowIndex,
|
|
3220
3220
|
columnIndex: selectedCell.columnIndex,
|
|
3221
|
-
selectedCells:
|
|
3221
|
+
selectedCells: chunkIDTNKL4S_js.rectToCells(rect)
|
|
3222
3222
|
});
|
|
3223
3223
|
} else {
|
|
3224
3224
|
options?.onSelectCell?.({
|
|
@@ -3294,7 +3294,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3294
3294
|
}
|
|
3295
3295
|
const first = selectedCell.selectedCells[0];
|
|
3296
3296
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
3297
|
-
return
|
|
3297
|
+
return chunkIDTNKL4S_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
3298
3298
|
})();
|
|
3299
3299
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
3300
3300
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3316,9 +3316,9 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3316
3316
|
{
|
|
3317
3317
|
className: "w-full h-full border-collapse table-fixed",
|
|
3318
3318
|
style: {
|
|
3319
|
-
fontFamily:
|
|
3319
|
+
fontFamily: chunkIDTNKL4S_js.DEFAULT_FONT_FAMILY,
|
|
3320
3320
|
// `a:tblPr@rtl` mirrors the column order for RTL decks.
|
|
3321
|
-
...
|
|
3321
|
+
...chunkIDTNKL4S_js.tableContainerCss(tableEl.tableData)
|
|
3322
3322
|
},
|
|
3323
3323
|
children: [
|
|
3324
3324
|
parsedTable.columnPercentages.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: parsedTable.columnPercentages.map((percentage, columnIndex) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3375,7 +3375,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3375
3375
|
color: textStyle.color,
|
|
3376
3376
|
...bandStyle,
|
|
3377
3377
|
...xmlCellStyle,
|
|
3378
|
-
...tdCellOverride ?
|
|
3378
|
+
...tdCellOverride ? chunkIDTNKL4S_js.cellStyleToCss(tdCellOverride) : void 0,
|
|
3379
3379
|
...diag ? { position: "relative" } : void 0
|
|
3380
3380
|
};
|
|
3381
3381
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3385,7 +3385,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3385
3385
|
"border px-1 py-0.5 align-top",
|
|
3386
3386
|
isEditable && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
3387
3387
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
3388
|
-
|
|
3388
|
+
chunkIDTNKL4S_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
3389
3389
|
),
|
|
3390
3390
|
colSpan,
|
|
3391
3391
|
rowSpan: rSpan,
|
|
@@ -3396,7 +3396,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3396
3396
|
}
|
|
3397
3397
|
event.stopPropagation();
|
|
3398
3398
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
3399
|
-
const rect =
|
|
3399
|
+
const rect = chunkIDTNKL4S_js.computeSelectionRect(
|
|
3400
3400
|
selectedCell.rowIndex,
|
|
3401
3401
|
selectedCell.columnIndex,
|
|
3402
3402
|
rowIndex,
|
|
@@ -3406,7 +3406,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3406
3406
|
options?.onSelectCell?.({
|
|
3407
3407
|
rowIndex: selectedCell.rowIndex,
|
|
3408
3408
|
columnIndex: selectedCell.columnIndex,
|
|
3409
|
-
selectedCells:
|
|
3409
|
+
selectedCells: chunkIDTNKL4S_js.rectToCells(rect)
|
|
3410
3410
|
});
|
|
3411
3411
|
} else {
|
|
3412
3412
|
options?.onSelectCell?.({
|
|
@@ -3465,23 +3465,23 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3465
3465
|
);
|
|
3466
3466
|
}
|
|
3467
3467
|
function partAttrs(part) {
|
|
3468
|
-
return part ?
|
|
3468
|
+
return part ? chunkIDTNKL4S_js.chartPartToAttrs(part) : void 0;
|
|
3469
3469
|
}
|
|
3470
3470
|
function resolveReactPalette(chartData) {
|
|
3471
3471
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
3472
3472
|
return chartData.colorPalette;
|
|
3473
3473
|
}
|
|
3474
|
-
return [...
|
|
3474
|
+
return [...chunkIDTNKL4S_js.getChartStylePalette(chartData.style?.styleId)];
|
|
3475
3475
|
}
|
|
3476
3476
|
function buildReactChartViewModel(element) {
|
|
3477
3477
|
if (element.type !== "chart" || !element.chartData) {
|
|
3478
|
-
return
|
|
3478
|
+
return chunkIDTNKL4S_js.buildChartViewModel(element);
|
|
3479
3479
|
}
|
|
3480
3480
|
const palette = resolveReactPalette(element.chartData), themedElement = {
|
|
3481
3481
|
...element,
|
|
3482
3482
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
3483
3483
|
};
|
|
3484
|
-
return
|
|
3484
|
+
return chunkIDTNKL4S_js.buildChartViewModel(themedElement);
|
|
3485
3485
|
}
|
|
3486
3486
|
function renderPrimitive(prim, key) {
|
|
3487
3487
|
switch (prim.kind) {
|
|
@@ -3630,7 +3630,7 @@ function renderText(t, key) {
|
|
|
3630
3630
|
);
|
|
3631
3631
|
}
|
|
3632
3632
|
function renderChartViewModel(elementId, vm, preserveAspectRatio = "none") {
|
|
3633
|
-
const legendItems =
|
|
3633
|
+
const legendItems = chunkIDTNKL4S_js.computeChartLegendLayout(vm);
|
|
3634
3634
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3635
3635
|
"svg",
|
|
3636
3636
|
{
|
|
@@ -3729,11 +3729,11 @@ function renderChartElement(element) {
|
|
|
3729
3729
|
if (!chartData || chartData.series.length === 0) {
|
|
3730
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"] });
|
|
3731
3731
|
}
|
|
3732
|
-
const kind =
|
|
3732
|
+
const kind = chunkIDTNKL4S_js.resolveChartKind(chartData.chartType ?? "bar");
|
|
3733
3733
|
return renderChartViewModel(
|
|
3734
3734
|
element.id,
|
|
3735
3735
|
buildReactChartViewModel(element),
|
|
3736
|
-
|
|
3736
|
+
chunkIDTNKL4S_js.chartPreserveAspectRatio(kind)
|
|
3737
3737
|
);
|
|
3738
3738
|
}
|
|
3739
3739
|
|
|
@@ -3753,14 +3753,14 @@ function buildNotesPdf(pages) {
|
|
|
3753
3753
|
notes: page.notes,
|
|
3754
3754
|
slideNumber: page.slideNumber
|
|
3755
3755
|
}));
|
|
3756
|
-
const bytes =
|
|
3756
|
+
const bytes = chunkIDTNKL4S_js.buildNotesPdfBytes(images, meta);
|
|
3757
3757
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
3758
3758
|
return URL.createObjectURL(blob);
|
|
3759
3759
|
}
|
|
3760
3760
|
|
|
3761
3761
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
3762
3762
|
function buildPdfFromImageData(images) {
|
|
3763
|
-
const bytes =
|
|
3763
|
+
const bytes = chunkIDTNKL4S_js.buildSlidesPdfBytes(images);
|
|
3764
3764
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
3765
3765
|
return URL.createObjectURL(blob);
|
|
3766
3766
|
}
|
|
@@ -3769,7 +3769,7 @@ function buildPdfFromImageData(images) {
|
|
|
3769
3769
|
var activePreview = null;
|
|
3770
3770
|
function startPreviewAnimation(elementId, preset, options) {
|
|
3771
3771
|
stopPreviewAnimation();
|
|
3772
|
-
const descriptor =
|
|
3772
|
+
const descriptor = chunkIDTNKL4S_js.buildPreviewAnimation(preset, options);
|
|
3773
3773
|
if (!descriptor) {
|
|
3774
3774
|
return;
|
|
3775
3775
|
}
|
|
@@ -3782,7 +3782,7 @@ function startMotionPathPreview(elementId, path, options) {
|
|
|
3782
3782
|
return;
|
|
3783
3783
|
}
|
|
3784
3784
|
const stage = domEl.offsetParent;
|
|
3785
|
-
const descriptor =
|
|
3785
|
+
const descriptor = chunkIDTNKL4S_js.buildMotionPathPreview({
|
|
3786
3786
|
path,
|
|
3787
3787
|
slideWidth: stage?.offsetWidth || DEFAULT_PREVIEW_SLIDE_WIDTH,
|
|
3788
3788
|
slideHeight: stage?.offsetHeight || DEFAULT_PREVIEW_SLIDE_HEIGHT,
|