pptx-react-viewer 2.19.0 → 2.19.2
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 +17 -0
- package/dist/{AiChatPanel-2GBJETOY.js → AiChatPanel-AXR77RD4.js} +23 -23
- package/dist/AiChatPanel-AXR77RD4.js.br +0 -0
- package/dist/AiChatPanel-AXR77RD4.js.gz +0 -0
- package/dist/{AiChatPanel-FZUKTQPQ.mjs → AiChatPanel-YSU5335E.mjs} +3 -3
- package/dist/AiChatPanel-YSU5335E.mjs.br +0 -0
- package/dist/AiChatPanel-YSU5335E.mjs.gz +0 -0
- package/dist/{Model3DScene-WRRQSYAZ.mjs → Model3DScene-6CTGUN5U.mjs} +1 -1
- package/dist/Model3DScene-6CTGUN5U.mjs.br +0 -0
- package/dist/Model3DScene-6CTGUN5U.mjs.gz +0 -0
- package/dist/{Model3DScene-JHTI2AQ6.js → Model3DScene-NM45GVMN.js} +2 -2
- package/dist/Model3DScene-NM45GVMN.js.br +0 -0
- package/dist/Model3DScene-NM45GVMN.js.gz +0 -0
- package/dist/{chunk-OVPJT4EQ.js → chunk-AYQYOPPU.js} +179 -153
- package/dist/chunk-AYQYOPPU.js.br +0 -0
- package/dist/chunk-AYQYOPPU.js.gz +0 -0
- package/dist/{chunk-7ARD2J6Y.js → chunk-C7XKYQEW.js} +130 -36
- package/dist/chunk-C7XKYQEW.js.br +0 -0
- package/dist/{chunk-7ARD2J6Y.js.gz → chunk-C7XKYQEW.js.gz} +0 -0
- package/dist/{chunk-ZMEYXAC6.mjs → chunk-EQ3W73I7.mjs} +1 -1
- package/dist/chunk-EQ3W73I7.mjs.br +0 -0
- package/dist/chunk-EQ3W73I7.mjs.gz +0 -0
- package/dist/{chunk-MWEBCWVD.mjs → chunk-ERDUPMYL.mjs} +37 -11
- package/dist/chunk-ERDUPMYL.mjs.br +0 -0
- package/dist/chunk-ERDUPMYL.mjs.gz +0 -0
- package/dist/{chunk-RPJ2BIQ7.js → chunk-HWMWR7D6.js} +3 -3
- package/dist/chunk-HWMWR7D6.js.br +0 -0
- package/dist/chunk-HWMWR7D6.js.gz +0 -0
- package/dist/{chunk-YWJBD7KV.mjs → chunk-IJSPE6Z6.mjs} +55 -7
- package/dist/chunk-IJSPE6Z6.mjs.br +0 -0
- package/dist/chunk-IJSPE6Z6.mjs.gz +0 -0
- package/dist/{chunk-XF3EOHY2.mjs → chunk-J4KGFXAM.mjs} +126 -37
- package/dist/chunk-J4KGFXAM.mjs.br +0 -0
- package/dist/{chunk-XF3EOHY2.mjs.gz → chunk-J4KGFXAM.mjs.gz} +0 -0
- package/dist/{chunk-IRLOXBO7.js → chunk-OE4DTBMB.js} +372 -381
- package/dist/chunk-OE4DTBMB.js.br +0 -0
- package/dist/chunk-OE4DTBMB.js.gz +0 -0
- package/dist/{chunk-NFFV3RDS.js → chunk-PHEJ2UKP.js} +1066 -1018
- package/dist/chunk-PHEJ2UKP.js.br +0 -0
- package/dist/chunk-PHEJ2UKP.js.gz +0 -0
- package/dist/{chunk-BO373PYH.mjs → chunk-PU3OPA6D.mjs} +3 -12
- package/dist/chunk-PU3OPA6D.mjs.br +0 -0
- package/dist/chunk-PU3OPA6D.mjs.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.d.ts +30 -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/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/viewer/index.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-2GBJETOY.js.br +0 -0
- package/dist/AiChatPanel-2GBJETOY.js.gz +0 -0
- package/dist/AiChatPanel-FZUKTQPQ.mjs.br +0 -0
- package/dist/AiChatPanel-FZUKTQPQ.mjs.gz +0 -0
- package/dist/Model3DScene-JHTI2AQ6.js.br +0 -0
- package/dist/Model3DScene-JHTI2AQ6.js.gz +0 -0
- package/dist/Model3DScene-WRRQSYAZ.mjs.br +0 -0
- package/dist/Model3DScene-WRRQSYAZ.mjs.gz +0 -0
- package/dist/chunk-7ARD2J6Y.js.br +0 -0
- package/dist/chunk-BO373PYH.mjs.br +0 -0
- package/dist/chunk-BO373PYH.mjs.gz +0 -0
- package/dist/chunk-IRLOXBO7.js.br +0 -0
- package/dist/chunk-IRLOXBO7.js.gz +0 -0
- package/dist/chunk-MWEBCWVD.mjs.br +0 -0
- package/dist/chunk-MWEBCWVD.mjs.gz +0 -0
- package/dist/chunk-NFFV3RDS.js.br +0 -0
- package/dist/chunk-NFFV3RDS.js.gz +0 -0
- package/dist/chunk-OVPJT4EQ.js.br +0 -0
- package/dist/chunk-OVPJT4EQ.js.gz +0 -0
- package/dist/chunk-RPJ2BIQ7.js.br +0 -0
- package/dist/chunk-RPJ2BIQ7.js.gz +0 -0
- package/dist/chunk-XF3EOHY2.mjs.br +0 -0
- package/dist/chunk-YWJBD7KV.mjs.br +0 -0
- package/dist/chunk-YWJBD7KV.mjs.gz +0 -0
- package/dist/chunk-ZMEYXAC6.mjs.br +0 -0
- package/dist/chunk-ZMEYXAC6.mjs.gz +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkMVKRI3CZ_js = require('./chunk-MVKRI3CZ.js');
|
|
4
|
-
var
|
|
4
|
+
var chunkC7XKYQEW_js = require('./chunk-C7XKYQEW.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 chunkC7XKYQEW_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 chunkC7XKYQEW_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 = chunkC7XKYQEW_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 = chunkC7XKYQEW_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 (!chunkC7XKYQEW_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 (!chunkC7XKYQEW_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 = chunkC7XKYQEW_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 = chunkC7XKYQEW_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
|
+
...chunkC7XKYQEW_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 (!chunkC7XKYQEW_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 chunkC7XKYQEW_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 chunkC7XKYQEW_js.runMediaCommand(
|
|
530
530
|
command,
|
|
531
|
-
(targetId) => registry.get(targetId) ??
|
|
531
|
+
(targetId) => registry.get(targetId) ?? chunkC7XKYQEW_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
|
+
} = chunkC7XKYQEW_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
|
+
chunkC7XKYQEW_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
|
+
...{ [chunkC7XKYQEW_js.MEDIA_CHROME_ATTRIBUTE]: visual.badge },
|
|
810
810
|
children: [
|
|
811
811
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
812
812
|
FallbackIcon,
|
|
813
813
|
{
|
|
814
|
-
paths:
|
|
814
|
+
paths: chunkC7XKYQEW_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(chunkC7XKYQEW_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
|
+
...{ [chunkC7XKYQEW_js.MEDIA_CHROME_ATTRIBUTE]: visual.placeholder },
|
|
837
837
|
children: [
|
|
838
838
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
839
839
|
FallbackIcon,
|
|
840
840
|
{
|
|
841
|
-
paths:
|
|
841
|
+
paths: chunkC7XKYQEW_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(chunkC7XKYQEW_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 = chunkC7XKYQEW_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 = chunkC7XKYQEW_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 chunkC7XKYQEW_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 (!chunkC7XKYQEW_js.hasTextProperties(element)) {
|
|
974
974
|
return {};
|
|
975
975
|
}
|
|
976
|
-
const writingMode =
|
|
977
|
-
const textOrientation =
|
|
978
|
-
const verticalDirection =
|
|
976
|
+
const writingMode = chunkC7XKYQEW_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
977
|
+
const textOrientation = chunkC7XKYQEW_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
978
|
+
const verticalDirection = chunkC7XKYQEW_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
979
979
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
980
|
-
const hasParagraphIndents =
|
|
980
|
+
const hasParagraphIndents = chunkC7XKYQEW_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
|
+
...chunkC7XKYQEW_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 chunkC7XKYQEW_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}${chunkC7XKYQEW_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 = chunkC7XKYQEW_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: chunkC7XKYQEW_js.textBuildSpanStyle(span),
|
|
1218
1218
|
children: content
|
|
1219
1219
|
},
|
|
1220
1220
|
span.animId
|
|
@@ -1324,7 +1324,7 @@ function fillLeader(glyph, width, font) {
|
|
|
1324
1324
|
const count = Math.ceil(width / glyphWidth) + 1;
|
|
1325
1325
|
return glyph.repeat(count);
|
|
1326
1326
|
}
|
|
1327
|
-
function renderTabbedLine(line, ctx, keyPrefix, renderPiece) {
|
|
1327
|
+
function renderTabbedLine(line, ctx, keyPrefix, renderPiece, nestedStyle) {
|
|
1328
1328
|
const segments = line.split(" ");
|
|
1329
1329
|
const pieces = computeTabbedLayout(
|
|
1330
1330
|
segments,
|
|
@@ -1350,44 +1350,47 @@ function renderTabbedLine(line, ctx, keyPrefix, renderPiece) {
|
|
|
1350
1350
|
children: piece.leaderChar ? fillLeader(piece.leaderChar, piece.leaderWidth, ctx.font) : ""
|
|
1351
1351
|
}
|
|
1352
1352
|
) : null,
|
|
1353
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { display: "inline-block", whiteSpace: "pre" }, children: renderPiece(piece.text, key) })
|
|
1353
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { ...nestedStyle, display: "inline-block", whiteSpace: "pre" }, children: renderPiece(piece.text, key) })
|
|
1354
1354
|
] }, key);
|
|
1355
1355
|
}) });
|
|
1356
1356
|
}
|
|
1357
|
-
function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFamily, keyPrefix) {
|
|
1357
|
+
function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFamily, keyPrefix, nestedStyle) {
|
|
1358
1358
|
if (!needsScriptFonts || !text) {
|
|
1359
1359
|
return text;
|
|
1360
1360
|
}
|
|
1361
|
-
const runs =
|
|
1361
|
+
const runs = chunkC7XKYQEW_js.segmentByScript(text);
|
|
1362
1362
|
if (runs.length <= 1) {
|
|
1363
1363
|
if (runs.length === 1) {
|
|
1364
|
-
const font =
|
|
1364
|
+
const font = chunkC7XKYQEW_js.resolveFontForScript(runs[0].script, scriptFonts);
|
|
1365
1365
|
if (font && font !== baseFontFamily) {
|
|
1366
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: text });
|
|
1366
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { ...nestedStyle, fontFamily: font }, children: text });
|
|
1367
1367
|
}
|
|
1368
1368
|
}
|
|
1369
1369
|
return text;
|
|
1370
1370
|
}
|
|
1371
1371
|
return runs.map((run, i) => {
|
|
1372
|
-
const font =
|
|
1372
|
+
const font = chunkC7XKYQEW_js.resolveFontForScript(run.script, scriptFonts);
|
|
1373
1373
|
if (!font || font === baseFontFamily) {
|
|
1374
1374
|
return /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Fragment, { children: run.text }, `${keyPrefix}-r${i}`);
|
|
1375
1375
|
}
|
|
1376
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: font }, children: run.text }, `${keyPrefix}-r${i}`);
|
|
1376
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { ...nestedStyle, fontFamily: font }, children: run.text }, `${keyPrefix}-r${i}`);
|
|
1377
1377
|
});
|
|
1378
1378
|
}
|
|
1379
1379
|
function renderMetricPieces(text, metric, keyPrefix, inner) {
|
|
1380
1380
|
if (!metric || !text) {
|
|
1381
1381
|
return inner(text, keyPrefix);
|
|
1382
1382
|
}
|
|
1383
|
-
const pieces =
|
|
1383
|
+
const pieces = chunkC7XKYQEW_js.splitRunForMetrics(text, metric.font);
|
|
1384
1384
|
if (pieces.length <= 1) {
|
|
1385
1385
|
return inner(text, keyPrefix);
|
|
1386
1386
|
}
|
|
1387
1387
|
return pieces.map((piece, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1388
1388
|
"span",
|
|
1389
1389
|
{
|
|
1390
|
-
style: {
|
|
1390
|
+
style: {
|
|
1391
|
+
...metric.nestedStyle,
|
|
1392
|
+
letterSpacing: chunkC7XKYQEW_js.pieceLetterSpacing(metric.authoredPx, piece.tracking)
|
|
1393
|
+
},
|
|
1391
1394
|
children: inner(piece.text, `${keyPrefix}-w${i}`)
|
|
1392
1395
|
},
|
|
1393
1396
|
`${keyPrefix}-w${i}`
|
|
@@ -1402,10 +1405,17 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1402
1405
|
text,
|
|
1403
1406
|
metric,
|
|
1404
1407
|
key,
|
|
1405
|
-
(pieceText, pieceKey) => renderScriptAwareText(
|
|
1408
|
+
(pieceText, pieceKey) => renderScriptAwareText(
|
|
1409
|
+
pieceText,
|
|
1410
|
+
needsScriptFonts,
|
|
1411
|
+
scriptFonts,
|
|
1412
|
+
baseFontFamily,
|
|
1413
|
+
pieceKey,
|
|
1414
|
+
metric?.nestedStyle
|
|
1415
|
+
)
|
|
1406
1416
|
);
|
|
1407
1417
|
return /* @__PURE__ */ jsxRuntime.jsxs(React6__default.default.Fragment, { children: [
|
|
1408
|
-
tabContext && line.includes(" ") ? renderTabbedLine(line, tabContext, lineKey, renderPiece) : renderPiece(line, lineKey),
|
|
1418
|
+
tabContext && line.includes(" ") ? renderTabbedLine(line, tabContext, lineKey, renderPiece, metric?.nestedStyle) : renderPiece(line, lineKey),
|
|
1409
1419
|
lineIndex < lines.length - 1 ? /* @__PURE__ */ jsxRuntime.jsx("br", {}) : null
|
|
1410
1420
|
] }, lineKey);
|
|
1411
1421
|
});
|
|
@@ -1439,7 +1449,14 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1439
1449
|
text,
|
|
1440
1450
|
metric,
|
|
1441
1451
|
key,
|
|
1442
|
-
(pieceText, pieceKey) => renderScriptAwareText(
|
|
1452
|
+
(pieceText, pieceKey) => renderScriptAwareText(
|
|
1453
|
+
pieceText,
|
|
1454
|
+
needsScriptFonts,
|
|
1455
|
+
scriptFonts,
|
|
1456
|
+
baseFontFamily,
|
|
1457
|
+
pieceKey,
|
|
1458
|
+
metric?.nestedStyle
|
|
1459
|
+
)
|
|
1443
1460
|
);
|
|
1444
1461
|
return chunks.map((chunk, ci) => {
|
|
1445
1462
|
const chunkKey = `${elementId}-seg-${segmentIndex}-hl-${ci}`;
|
|
@@ -1447,6 +1464,7 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1447
1464
|
"mark",
|
|
1448
1465
|
{
|
|
1449
1466
|
style: {
|
|
1467
|
+
...metric?.nestedStyle,
|
|
1450
1468
|
backgroundColor: chunk.isCurrent ? "#f97316" : "#facc15",
|
|
1451
1469
|
color: "inherit",
|
|
1452
1470
|
borderRadius: 2
|
|
@@ -1458,8 +1476,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1458
1476
|
});
|
|
1459
1477
|
}
|
|
1460
1478
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
1461
|
-
const mathml =
|
|
1462
|
-
const safeMathml = mathml ?
|
|
1479
|
+
const mathml = chunkC7XKYQEW_js.convertOmmlToMathMl(equationXml);
|
|
1480
|
+
const safeMathml = mathml ? chunkC7XKYQEW_js.sanitizeMathMl(mathml) : "";
|
|
1463
1481
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1464
1482
|
"span",
|
|
1465
1483
|
{
|
|
@@ -1519,7 +1537,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1519
1537
|
const segmentStyle = segment?.style ?? {};
|
|
1520
1538
|
const textValue = run.text;
|
|
1521
1539
|
const lines = textValue.split("\n");
|
|
1522
|
-
const resolvedSegmentColor =
|
|
1540
|
+
const resolvedSegmentColor = chunkC7XKYQEW_js.normalizeHexColor(
|
|
1523
1541
|
segmentStyle.color || element.textStyle?.color,
|
|
1524
1542
|
run.hyperlink ? HYPERLINK_COLOR : fallbackColor
|
|
1525
1543
|
);
|
|
@@ -1527,16 +1545,16 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1527
1545
|
const baselineFraction = rawBaseline === 0 ? 0 : Math.abs(rawBaseline) >= 1e3 ? rawBaseline / 1e5 : rawBaseline / 100;
|
|
1528
1546
|
const baselineFontScale = baselineFraction !== 0 ? BASELINE_FONT_SCALE : 1;
|
|
1529
1547
|
const rawFontSize = segmentStyle.fontSize || element.textStyle?.fontSize || DEFAULT_TEXT_FONT_SIZE;
|
|
1530
|
-
const baseFontSize = rawFontSize *
|
|
1548
|
+
const baseFontSize = rawFontSize * chunkC7XKYQEW_js.resolveAutoFitFontScale(element.textStyle);
|
|
1531
1549
|
const baselineShift = baselineFraction !== 0 ? `${baselineFraction * baseFontSize}px` : void 0;
|
|
1532
1550
|
const baseFontSizePt = baseFontSize * (72 / 96);
|
|
1533
1551
|
const fontKerning = typeof segmentStyle.kerning === "number" ? segmentStyle.kerning === 0 ? "none" : baseFontSizePt >= segmentStyle.kerning / 100 ? "normal" : "none" : void 0;
|
|
1534
1552
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
1535
|
-
const baseFontFamily = rawFontFamily ?
|
|
1553
|
+
const baseFontFamily = rawFontFamily ? chunkC7XKYQEW_js.getSubstituteFontFamily(
|
|
1536
1554
|
rawFontFamily,
|
|
1537
|
-
|
|
1555
|
+
chunkC7XKYQEW_js.parsePanoseString(segmentStyle.latinFontPanose ?? element.textStyle?.latinFontPanose)
|
|
1538
1556
|
) : DEFAULT_FONT_FAMILY2;
|
|
1539
|
-
const scriptFont = (name, panose) => name ?
|
|
1557
|
+
const scriptFont = (name, panose) => name ? chunkC7XKYQEW_js.getSubstituteFontFamily(name, chunkC7XKYQEW_js.parsePanoseString(panose)) : baseFontFamily;
|
|
1540
1558
|
const scriptFonts = {
|
|
1541
1559
|
latin: baseFontFamily,
|
|
1542
1560
|
eastAsia: scriptFont(
|
|
@@ -1552,7 +1570,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1552
1570
|
segmentStyle.symbolFontPanose ?? element.textStyle?.symbolFontPanose
|
|
1553
1571
|
)
|
|
1554
1572
|
};
|
|
1555
|
-
const needsScriptFonts =
|
|
1573
|
+
const needsScriptFonts = chunkC7XKYQEW_js.hasDistinctScriptFonts(scriptFonts);
|
|
1556
1574
|
const authoredLetterSpacing = typeof segmentStyle.characterSpacing === "number" && segmentStyle.characterSpacing !== 0 ? segmentStyle.characterSpacing / 100 * (96 / 72) : 0;
|
|
1557
1575
|
const metricFont = {
|
|
1558
1576
|
fontFamily: baseFontFamily,
|
|
@@ -1560,17 +1578,25 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1560
1578
|
bold: Boolean(segmentStyle.bold),
|
|
1561
1579
|
italic: Boolean(segmentStyle.italic)
|
|
1562
1580
|
};
|
|
1563
|
-
const
|
|
1581
|
+
const nestedStyle = chunkC7XKYQEW_js.nestedTextDecorationStyle(run.style);
|
|
1582
|
+
const metricContext = { font: metricFont, authoredPx: authoredLetterSpacing, nestedStyle };
|
|
1564
1583
|
const spanStyle = { ...run.style };
|
|
1565
1584
|
spanStyle.color = resolvedSegmentColor;
|
|
1566
1585
|
spanStyle.fontSize = baseFontSize * baselineFontScale;
|
|
1567
1586
|
spanStyle.fontFamily = baseFontFamily;
|
|
1568
1587
|
spanStyle.verticalAlign = baselineShift;
|
|
1569
1588
|
spanStyle.fontKerning = fontKerning;
|
|
1570
|
-
spanStyle.letterSpacing =
|
|
1589
|
+
spanStyle.letterSpacing = chunkC7XKYQEW_js.pieceLetterSpacing(
|
|
1571
1590
|
authoredLetterSpacing,
|
|
1572
|
-
|
|
1591
|
+
chunkC7XKYQEW_js.resolveMetricTrackingPx(textValue, metricFont)
|
|
1573
1592
|
);
|
|
1593
|
+
const hollow = chunkC7XKYQEW_js.hollowTextFillStyle(segmentStyle, {
|
|
1594
|
+
color: resolvedSegmentColor,
|
|
1595
|
+
textStroke: typeof spanStyle.WebkitTextStroke === "string" ? spanStyle.WebkitTextStroke : void 0
|
|
1596
|
+
});
|
|
1597
|
+
if (hollow) {
|
|
1598
|
+
Object.assign(spanStyle, hollow);
|
|
1599
|
+
}
|
|
1574
1600
|
const runRtl = segmentStyle.rtl;
|
|
1575
1601
|
if (runRtl !== void 0) {
|
|
1576
1602
|
spanStyle.direction = runRtl ? "rtl" : "ltr";
|
|
@@ -1661,7 +1687,7 @@ function renderHyperlink(run, spanNode, key, ctx) {
|
|
|
1661
1687
|
);
|
|
1662
1688
|
}
|
|
1663
1689
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick) {
|
|
1664
|
-
if (!
|
|
1690
|
+
if (!chunkC7XKYQEW_js.hasTextProperties(element)) {
|
|
1665
1691
|
return emptyFallback || null;
|
|
1666
1692
|
}
|
|
1667
1693
|
const segments = segmentOverrides ?? element.textSegments;
|
|
@@ -1671,7 +1697,7 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
1671
1697
|
}
|
|
1672
1698
|
return element.text || emptyFallback || "";
|
|
1673
1699
|
}
|
|
1674
|
-
const paragraphs =
|
|
1700
|
+
const paragraphs = chunkC7XKYQEW_js.buildParagraphs(element, fieldContext, segmentOverrides);
|
|
1675
1701
|
const ctx = {
|
|
1676
1702
|
element,
|
|
1677
1703
|
fallbackColor,
|
|
@@ -1804,13 +1830,13 @@ function hexToRgbUnit(hex) {
|
|
|
1804
1830
|
};
|
|
1805
1831
|
}
|
|
1806
1832
|
function getDuotoneColors(element) {
|
|
1807
|
-
if (!
|
|
1833
|
+
if (!chunkC7XKYQEW_js.isImageLikeElement(element)) {
|
|
1808
1834
|
return void 0;
|
|
1809
1835
|
}
|
|
1810
1836
|
return element.imageEffects?.duotone;
|
|
1811
1837
|
}
|
|
1812
1838
|
function buildLineShadowCss(element) {
|
|
1813
|
-
if (!
|
|
1839
|
+
if (!chunkC7XKYQEW_js.hasShapeProperties(element)) {
|
|
1814
1840
|
return void 0;
|
|
1815
1841
|
}
|
|
1816
1842
|
const ss = element.shapeStyle;
|
|
@@ -1821,13 +1847,13 @@ function buildLineShadowCss(element) {
|
|
|
1821
1847
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
1822
1848
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
1823
1849
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
1824
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
1825
|
-
|
|
1850
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkC7XKYQEW_js.colorWithOpacity(
|
|
1851
|
+
chunkC7XKYQEW_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
1826
1852
|
opacity
|
|
1827
1853
|
)}`;
|
|
1828
1854
|
}
|
|
1829
1855
|
function buildLineGlowFilter(element) {
|
|
1830
|
-
if (!
|
|
1856
|
+
if (!chunkC7XKYQEW_js.hasShapeProperties(element)) {
|
|
1831
1857
|
return void 0;
|
|
1832
1858
|
}
|
|
1833
1859
|
const ss = element.shapeStyle;
|
|
@@ -1836,14 +1862,14 @@ function buildLineGlowFilter(element) {
|
|
|
1836
1862
|
}
|
|
1837
1863
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
1838
1864
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
1839
|
-
const glowCol =
|
|
1865
|
+
const glowCol = chunkC7XKYQEW_js.colorWithOpacity(chunkC7XKYQEW_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
1840
1866
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
1841
1867
|
}
|
|
1842
1868
|
function getDagDuotoneFilterId(elementId) {
|
|
1843
1869
|
return `dag-duotone-${elementId}`;
|
|
1844
1870
|
}
|
|
1845
1871
|
function hasDagDuotoneEffect(element) {
|
|
1846
|
-
if (!
|
|
1872
|
+
if (!chunkC7XKYQEW_js.hasShapeProperties(element)) {
|
|
1847
1873
|
return false;
|
|
1848
1874
|
}
|
|
1849
1875
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
@@ -1895,7 +1921,7 @@ function renderDagDuotoneSvgFilter(elementId, color1, color2) {
|
|
|
1895
1921
|
|
|
1896
1922
|
// src/viewer/utils/shape-visual-3d.ts
|
|
1897
1923
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
1898
|
-
return
|
|
1924
|
+
return chunkC7XKYQEW_js.build3DExtrusionData(
|
|
1899
1925
|
shape3d,
|
|
1900
1926
|
scene3d,
|
|
1901
1927
|
fillColor,
|
|
@@ -1904,7 +1930,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
1904
1930
|
);
|
|
1905
1931
|
}
|
|
1906
1932
|
function apply3dEffects2(base, scene3d, shape3d, fillColorFallback) {
|
|
1907
|
-
|
|
1933
|
+
chunkC7XKYQEW_js.apply3dEffects(base, scene3d, shape3d, fillColorFallback);
|
|
1908
1934
|
}
|
|
1909
1935
|
|
|
1910
1936
|
// src/viewer/utils/shape-visual-style.ts
|
|
@@ -1912,13 +1938,13 @@ function rendersCustomVectorPath(element) {
|
|
|
1912
1938
|
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;
|
|
1913
1939
|
}
|
|
1914
1940
|
function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _strokeColor, animatesFill, animatesStroke, parentGroupFill) {
|
|
1915
|
-
if (!
|
|
1941
|
+
if (!chunkC7XKYQEW_js.hasShapeProperties(element)) {
|
|
1916
1942
|
return {};
|
|
1917
1943
|
}
|
|
1918
1944
|
const ss = element.shapeStyle;
|
|
1919
|
-
const fill = animatesFill ? void 0 :
|
|
1920
|
-
const fx =
|
|
1921
|
-
const stroke =
|
|
1945
|
+
const fill = animatesFill ? void 0 : chunkC7XKYQEW_js.getComputedFillStyle(element, parentGroupFill);
|
|
1946
|
+
const fx = chunkC7XKYQEW_js.getComputedEffectStyle(element);
|
|
1947
|
+
const stroke = chunkC7XKYQEW_js.getComputedStrokeStyle(element);
|
|
1922
1948
|
const base = {
|
|
1923
1949
|
// A gradient fill REPLACES the solid fill, it does not sit on top of it;
|
|
1924
1950
|
// the whole precedence lives in shared's `getComputedFillStyle`.
|
|
@@ -1953,7 +1979,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1953
1979
|
strokeLinecap: stroke.strokeLinecap
|
|
1954
1980
|
};
|
|
1955
1981
|
apply3dEffects2(base, ss?.scene3d, ss?.shape3d, ss?.fillColor ?? fillColor);
|
|
1956
|
-
if (rendersCustomVectorPath(element) ||
|
|
1982
|
+
if (rendersCustomVectorPath(element) || chunkC7XKYQEW_js.isStrokeOnlyPresetElement(element)) {
|
|
1957
1983
|
base.backgroundColor = "transparent";
|
|
1958
1984
|
base.backgroundImage = void 0;
|
|
1959
1985
|
base.borderWidth = void 0;
|
|
@@ -1964,7 +1990,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1964
1990
|
base.backgroundColor = void 0;
|
|
1965
1991
|
base.backgroundImage = void 0;
|
|
1966
1992
|
}
|
|
1967
|
-
const geometry =
|
|
1993
|
+
const geometry = chunkC7XKYQEW_js.resolveShapeGeometry(element);
|
|
1968
1994
|
switch (geometry.kind) {
|
|
1969
1995
|
case "bare":
|
|
1970
1996
|
return { backgroundColor: "transparent", borderWidth: 0, borderStyle: "none" };
|
|
@@ -1990,13 +2016,13 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1990
2016
|
function getConnectorAdjustment(element, key, fallback) {
|
|
1991
2017
|
const direct = element.shapeAdjustments?.[key];
|
|
1992
2018
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
1993
|
-
return
|
|
2019
|
+
return chunkC7XKYQEW_js.clampUnitInterval(direct / 1e5);
|
|
1994
2020
|
}
|
|
1995
2021
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
1996
2022
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
1997
|
-
return
|
|
2023
|
+
return chunkC7XKYQEW_js.clampUnitInterval(fallbackKey / 1e5);
|
|
1998
2024
|
}
|
|
1999
|
-
return
|
|
2025
|
+
return chunkC7XKYQEW_js.clampUnitInterval(fallback);
|
|
2000
2026
|
}
|
|
2001
2027
|
function getConnectorPathGeometry(element) {
|
|
2002
2028
|
const width = Math.max(element.width, 0);
|
|
@@ -2129,7 +2155,7 @@ function toHexByte(value) {
|
|
|
2129
2155
|
return clamped.toString(16).padStart(2, "0");
|
|
2130
2156
|
}
|
|
2131
2157
|
function shiftHex(hex, factor, towardsWhite) {
|
|
2132
|
-
const channels =
|
|
2158
|
+
const channels = chunkC7XKYQEW_js.hexToRgbChannels(hex);
|
|
2133
2159
|
if (!channels) {
|
|
2134
2160
|
return hex;
|
|
2135
2161
|
}
|
|
@@ -2155,7 +2181,7 @@ function buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity) {
|
|
|
2155
2181
|
const fillOff = subpath.fillMode === "none" || !hasFill;
|
|
2156
2182
|
return {
|
|
2157
2183
|
d: subpath.d,
|
|
2158
|
-
fill: fillOff ? "none" :
|
|
2184
|
+
fill: fillOff ? "none" : chunkC7XKYQEW_js.colorWithOpacity(adjustFillForMode(fillColor, subpath.fillMode), fillOpacity),
|
|
2159
2185
|
stroked: subpath.stroke !== false
|
|
2160
2186
|
};
|
|
2161
2187
|
});
|
|
@@ -2171,11 +2197,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
|
|
|
2171
2197
|
strokePaint,
|
|
2172
2198
|
strokeWidth,
|
|
2173
2199
|
dashArray,
|
|
2174
|
-
lineCap:
|
|
2200
|
+
lineCap: chunkC7XKYQEW_js.svgLineCap(shapeStyle?.lineCap),
|
|
2175
2201
|
lineJoin,
|
|
2176
2202
|
miterLimit,
|
|
2177
|
-
offsets:
|
|
2178
|
-
widths:
|
|
2203
|
+
offsets: chunkC7XKYQEW_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
2204
|
+
widths: chunkC7XKYQEW_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
|
|
2179
2205
|
};
|
|
2180
2206
|
}
|
|
2181
2207
|
function strokeStrands(d, keyBase, ctx) {
|
|
@@ -2223,9 +2249,9 @@ function gradientDefs(gradient) {
|
|
|
2223
2249
|
}
|
|
2224
2250
|
function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredPaths, shapeStyle, hasFill, fillColor, fillOpacity, strokePaint, strokeWidth, dashArray, animatesFill = false, gradient) {
|
|
2225
2251
|
const ctx = strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray);
|
|
2226
|
-
const subpaths = structuredPaths && structuredPaths.length > 0 ?
|
|
2252
|
+
const subpaths = structuredPaths && structuredPaths.length > 0 ? chunkC7XKYQEW_js.customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
2227
2253
|
const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
|
|
2228
|
-
const gradientPaint = gradient ?
|
|
2254
|
+
const gradientPaint = gradient ? chunkC7XKYQEW_js.svgGradientFillRef(gradient) : void 0;
|
|
2229
2255
|
const nodes = [];
|
|
2230
2256
|
if (subpaths && needsPerSubpath) {
|
|
2231
2257
|
const paints = buildCustomSubpathPaints(subpaths, hasFill, fillColor, fillOpacity);
|
|
@@ -2257,7 +2283,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2257
2283
|
"path",
|
|
2258
2284
|
{
|
|
2259
2285
|
d: pathData,
|
|
2260
|
-
fill: animatesFill ? "inherit" : gradientPaint ??
|
|
2286
|
+
fill: animatesFill ? "inherit" : gradientPaint ?? chunkC7XKYQEW_js.colorWithOpacity(fillColor, fillOpacity),
|
|
2261
2287
|
stroke: "none",
|
|
2262
2288
|
vectorEffect: "non-scaling-stroke"
|
|
2263
2289
|
},
|
|
@@ -2283,14 +2309,14 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2283
2309
|
);
|
|
2284
2310
|
}
|
|
2285
2311
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2286
|
-
if (!
|
|
2312
|
+
if (!chunkC7XKYQEW_js.hasShapeProperties(element)) {
|
|
2287
2313
|
return null;
|
|
2288
2314
|
}
|
|
2289
2315
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
2290
|
-
const fillPaint = animatesFill ? "inherit" :
|
|
2291
|
-
const strokePaint = animatesStroke ? "inherit" :
|
|
2292
|
-
const dashType =
|
|
2293
|
-
const dashArray =
|
|
2316
|
+
const fillPaint = animatesFill ? "inherit" : chunkC7XKYQEW_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
2317
|
+
const strokePaint = animatesStroke ? "inherit" : chunkC7XKYQEW_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
2318
|
+
const dashType = chunkC7XKYQEW_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2319
|
+
const dashArray = chunkC7XKYQEW_js.getSvgStrokeDasharray(
|
|
2294
2320
|
dashType,
|
|
2295
2321
|
Math.max(strokeWidth, 1),
|
|
2296
2322
|
element.shapeStyle?.customDashSegments
|
|
@@ -2371,21 +2397,21 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2371
2397
|
// container's `background-image` is suppressed for custom geometry, so
|
|
2372
2398
|
// without this the shape fell back to the parser's representative solid
|
|
2373
2399
|
// and lost every fade (issue #132).
|
|
2374
|
-
|
|
2400
|
+
chunkC7XKYQEW_js.buildSvgGradientDef(element.shapeStyle, element.id)
|
|
2375
2401
|
);
|
|
2376
2402
|
}
|
|
2377
|
-
if (
|
|
2403
|
+
if (chunkC7XKYQEW_js.isCalloutShape(normalizedType)) {
|
|
2378
2404
|
const width = Math.max(element.width, 1);
|
|
2379
2405
|
const height = Math.max(element.height, 1);
|
|
2380
|
-
const geometry =
|
|
2406
|
+
const geometry = chunkC7XKYQEW_js.getCalloutLeaderLineGeometry(
|
|
2381
2407
|
normalizedType,
|
|
2382
2408
|
width,
|
|
2383
2409
|
height,
|
|
2384
2410
|
element.shapeAdjustments
|
|
2385
2411
|
);
|
|
2386
2412
|
if (geometry && geometry.points.length >= 2) {
|
|
2387
|
-
const leaderPath =
|
|
2388
|
-
const bounds =
|
|
2413
|
+
const leaderPath = chunkC7XKYQEW_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
2414
|
+
const bounds = chunkC7XKYQEW_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
2389
2415
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
2390
2416
|
const offsetLeft = bounds.minX;
|
|
2391
2417
|
const offsetTop = bounds.minY;
|
|
@@ -2448,10 +2474,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2448
2474
|
const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
|
|
2449
2475
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
2450
2476
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
2451
|
-
const connectorLineCap =
|
|
2477
|
+
const connectorLineCap = chunkC7XKYQEW_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
2452
2478
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
2453
|
-
const offsets =
|
|
2454
|
-
const widths =
|
|
2479
|
+
const offsets = chunkC7XKYQEW_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
2480
|
+
const widths = chunkC7XKYQEW_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
2455
2481
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2456
2482
|
"svg",
|
|
2457
2483
|
{
|
|
@@ -2518,15 +2544,15 @@ function parseGradientFillCss(gradFill) {
|
|
|
2518
2544
|
}
|
|
2519
2545
|
const parsed = stops.map((gs) => {
|
|
2520
2546
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
2521
|
-
const color =
|
|
2522
|
-
const opacity =
|
|
2523
|
-
return { pos, color:
|
|
2547
|
+
const color = chunkC7XKYQEW_js.parseDrawingColor(gs) ?? "#888888";
|
|
2548
|
+
const opacity = chunkC7XKYQEW_js.parseDrawingColorOpacity(gs);
|
|
2549
|
+
return { pos, color: chunkC7XKYQEW_js.colorWithOpacity(color, opacity) };
|
|
2524
2550
|
}).sort((a, b) => a.pos - b.pos);
|
|
2525
2551
|
const stopStrings = parsed.map((s) => `${s.color} ${s.pos.toFixed(1)}%`).join(", ");
|
|
2526
2552
|
const lin = gradFill["a:lin"];
|
|
2527
2553
|
if (lin) {
|
|
2528
2554
|
const angRaw = Number.parseInt(String(lin["@_ang"] || "0"), 10);
|
|
2529
|
-
const angleDeg = Math.round(
|
|
2555
|
+
const angleDeg = Math.round(chunkC7XKYQEW_js.ooxmlGradientAngleToCssDegrees(angRaw / 6e4));
|
|
2530
2556
|
return `linear-gradient(${angleDeg}deg, ${stopStrings})`;
|
|
2531
2557
|
}
|
|
2532
2558
|
const path = gradFill["a:path"];
|
|
@@ -2561,8 +2587,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
2561
2587
|
if (!pattFill) {
|
|
2562
2588
|
return void 0;
|
|
2563
2589
|
}
|
|
2564
|
-
const fgColor =
|
|
2565
|
-
const bgColor =
|
|
2590
|
+
const fgColor = chunkC7XKYQEW_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
2591
|
+
const bgColor = chunkC7XKYQEW_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
2566
2592
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
2567
2593
|
switch (preset) {
|
|
2568
2594
|
case "ltHorz":
|
|
@@ -2673,11 +2699,11 @@ function parseCellBorders(cellProperties) {
|
|
|
2673
2699
|
const prstDash = ln["a:prstDash"];
|
|
2674
2700
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
2675
2701
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
2676
|
-
const color =
|
|
2702
|
+
const color = chunkC7XKYQEW_js.parseDrawingColor(ln["a:solidFill"]);
|
|
2677
2703
|
if (color) {
|
|
2678
|
-
const opacity =
|
|
2704
|
+
const opacity = chunkC7XKYQEW_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
2679
2705
|
const key = `${edge.prefix}`;
|
|
2680
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
2706
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkC7XKYQEW_js.colorWithOpacity(color, opacity)}`;
|
|
2681
2707
|
}
|
|
2682
2708
|
}
|
|
2683
2709
|
return borderStyle;
|
|
@@ -2690,7 +2716,7 @@ function parseCellTextEffects(runProps) {
|
|
|
2690
2716
|
const textShadowParts = [];
|
|
2691
2717
|
const outerShdw = effectLst["a:outerShdw"];
|
|
2692
2718
|
if (outerShdw) {
|
|
2693
|
-
const shdwColor =
|
|
2719
|
+
const shdwColor = chunkC7XKYQEW_js.parseDrawingColor(outerShdw);
|
|
2694
2720
|
if (shdwColor) {
|
|
2695
2721
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
2696
2722
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -2708,7 +2734,7 @@ function parseCellTextEffects(runProps) {
|
|
|
2708
2734
|
}
|
|
2709
2735
|
const glow = effectLst["a:glow"];
|
|
2710
2736
|
if (glow) {
|
|
2711
|
-
const glowColor =
|
|
2737
|
+
const glowColor = chunkC7XKYQEW_js.parseDrawingColor(glow);
|
|
2712
2738
|
if (glowColor) {
|
|
2713
2739
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
2714
2740
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -2787,10 +2813,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2787
2813
|
if (runProps?.["@_u"] !== void 0) {
|
|
2788
2814
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
2789
2815
|
}
|
|
2790
|
-
const runColor =
|
|
2816
|
+
const runColor = chunkC7XKYQEW_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkC7XKYQEW_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
2791
2817
|
if (runColor) {
|
|
2792
|
-
const opacity =
|
|
2793
|
-
cellStyle.color =
|
|
2818
|
+
const opacity = chunkC7XKYQEW_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
2819
|
+
cellStyle.color = chunkC7XKYQEW_js.colorWithOpacity(runColor, opacity);
|
|
2794
2820
|
}
|
|
2795
2821
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
2796
2822
|
if (fontFamily) {
|
|
@@ -2800,15 +2826,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2800
2826
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
2801
2827
|
}
|
|
2802
2828
|
const cellProperties = cellXml["a:tcPr"];
|
|
2803
|
-
const cellFill =
|
|
2829
|
+
const cellFill = chunkC7XKYQEW_js.parseDrawingColor(
|
|
2804
2830
|
cellProperties?.["a:solidFill"],
|
|
2805
2831
|
schemeColorOverrides
|
|
2806
2832
|
);
|
|
2807
2833
|
if (cellFill) {
|
|
2808
|
-
const opacity =
|
|
2834
|
+
const opacity = chunkC7XKYQEW_js.parseDrawingColorOpacity(
|
|
2809
2835
|
cellProperties?.["a:solidFill"]
|
|
2810
2836
|
);
|
|
2811
|
-
cellStyle.backgroundColor =
|
|
2837
|
+
cellStyle.backgroundColor = chunkC7XKYQEW_js.colorWithOpacity(cellFill, opacity);
|
|
2812
2838
|
} else {
|
|
2813
2839
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
2814
2840
|
if (gradCss) {
|
|
@@ -2823,16 +2849,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2823
2849
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
2824
2850
|
Object.assign(cellStyle, edgeBorders);
|
|
2825
2851
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
2826
|
-
const borderColor =
|
|
2852
|
+
const borderColor = chunkC7XKYQEW_js.parseDrawingColor(
|
|
2827
2853
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
2828
2854
|
schemeColorOverrides
|
|
2829
|
-
) ||
|
|
2855
|
+
) || chunkC7XKYQEW_js.parseDrawingColor(
|
|
2830
2856
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
2831
2857
|
schemeColorOverrides
|
|
2832
|
-
) ||
|
|
2858
|
+
) || chunkC7XKYQEW_js.parseDrawingColor(
|
|
2833
2859
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
2834
2860
|
schemeColorOverrides
|
|
2835
|
-
) ||
|
|
2861
|
+
) || chunkC7XKYQEW_js.parseDrawingColor(
|
|
2836
2862
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
2837
2863
|
schemeColorOverrides
|
|
2838
2864
|
);
|
|
@@ -2904,7 +2930,7 @@ function getTableCellBandStyle2(element, rowIndex, cellIndex, rowCount, columnCo
|
|
|
2904
2930
|
if (element.type !== "table") {
|
|
2905
2931
|
return void 0;
|
|
2906
2932
|
}
|
|
2907
|
-
return
|
|
2933
|
+
return chunkC7XKYQEW_js.getTableCellBandStyle(element.tableData, rowIndex, cellIndex, rowCount, columnCount, {
|
|
2908
2934
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
2909
2935
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
2910
2936
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -2980,7 +3006,7 @@ function renderTableCellContent(cell, fallbackText) {
|
|
|
2980
3006
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2981
3007
|
"span",
|
|
2982
3008
|
{
|
|
2983
|
-
style: { position: "relative", ...
|
|
3009
|
+
style: { position: "relative", ...chunkC7XKYQEW_js.cellRunStyle(run) },
|
|
2984
3010
|
children: run.text
|
|
2985
3011
|
},
|
|
2986
3012
|
`r-${index}`
|
|
@@ -2988,7 +3014,7 @@ function renderTableCellContent(cell, fallbackText) {
|
|
|
2988
3014
|
});
|
|
2989
3015
|
}
|
|
2990
3016
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
2991
|
-
return
|
|
3017
|
+
return chunkC7XKYQEW_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
2992
3018
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
2993
3019
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
2994
3020
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -3121,7 +3147,7 @@ function TableResizeOverlay({
|
|
|
3121
3147
|
const containerRef = React6.useRef(null);
|
|
3122
3148
|
const [rowBounds, setRowBounds] = React6.useState([]);
|
|
3123
3149
|
const dragRef = React6.useRef(null);
|
|
3124
|
-
const colBoundaries = React6.useMemo(() =>
|
|
3150
|
+
const colBoundaries = React6.useMemo(() => chunkC7XKYQEW_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
3125
3151
|
const measureRows = React6.useCallback(() => {
|
|
3126
3152
|
const container = containerRef.current;
|
|
3127
3153
|
if (!container) {
|
|
@@ -3168,11 +3194,11 @@ function TableResizeOverlay({
|
|
|
3168
3194
|
const rect = containerRef.current.getBoundingClientRect();
|
|
3169
3195
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
3170
3196
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
3171
|
-
onResizeColumns(
|
|
3197
|
+
onResizeColumns(chunkC7XKYQEW_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
3172
3198
|
} else if (drag.type === "row" && onResizeRow) {
|
|
3173
3199
|
const deltaY = e.clientY - drag.startPos;
|
|
3174
|
-
const newHeight =
|
|
3175
|
-
drag.initialRowHeight ??
|
|
3200
|
+
const newHeight = chunkC7XKYQEW_js.computeResizedRowHeight(
|
|
3201
|
+
drag.initialRowHeight ?? chunkC7XKYQEW_js.DEFAULT_ROW_HEIGHT,
|
|
3176
3202
|
deltaY
|
|
3177
3203
|
);
|
|
3178
3204
|
onResizeRow(drag.index, newHeight);
|
|
@@ -3210,7 +3236,7 @@ function TableResizeOverlay({
|
|
|
3210
3236
|
e.stopPropagation();
|
|
3211
3237
|
const table = containerRef.current?.querySelector("table");
|
|
3212
3238
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
3213
|
-
const actualHeight = tr?.offsetHeight ??
|
|
3239
|
+
const actualHeight = tr?.offsetHeight ?? chunkC7XKYQEW_js.DEFAULT_ROW_HEIGHT;
|
|
3214
3240
|
document.body.style.cursor = "row-resize";
|
|
3215
3241
|
document.body.style.userSelect = "none";
|
|
3216
3242
|
dragRef.current = {
|
|
@@ -3257,7 +3283,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3257
3283
|
colorScheme: options?.styleCtx?.theme?.colorScheme,
|
|
3258
3284
|
fontScheme: options?.styleCtx?.theme?.fontScheme
|
|
3259
3285
|
};
|
|
3260
|
-
const cellCss = (cell, rowIndex, cellIndex) =>
|
|
3286
|
+
const cellCss = (cell, rowIndex, cellIndex) => chunkC7XKYQEW_js.tableCellCss(
|
|
3261
3287
|
tableData,
|
|
3262
3288
|
cell,
|
|
3263
3289
|
{ rowIndex, cellIndex, rowCount, columnCount },
|
|
@@ -3270,7 +3296,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3270
3296
|
}
|
|
3271
3297
|
const first = selectedCell.selectedCells[0];
|
|
3272
3298
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
3273
|
-
return
|
|
3299
|
+
return chunkC7XKYQEW_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
3274
3300
|
})();
|
|
3275
3301
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3276
3302
|
TableResizeOverlay,
|
|
@@ -3291,9 +3317,9 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3291
3317
|
{
|
|
3292
3318
|
className: "w-full h-full border-collapse table-fixed",
|
|
3293
3319
|
style: {
|
|
3294
|
-
fontFamily:
|
|
3320
|
+
fontFamily: chunkC7XKYQEW_js.DEFAULT_FONT_FAMILY,
|
|
3295
3321
|
// `a:tblPr@rtl` mirrors the column order for RTL decks.
|
|
3296
|
-
...
|
|
3322
|
+
...chunkC7XKYQEW_js.tableContainerCss(tableData)
|
|
3297
3323
|
},
|
|
3298
3324
|
children: [
|
|
3299
3325
|
tableData.columnWidths.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: tableData.columnWidths.map((w, ci) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3312,7 +3338,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3312
3338
|
return null;
|
|
3313
3339
|
}
|
|
3314
3340
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
3315
|
-
const isInMultiSelection =
|
|
3341
|
+
const isInMultiSelection = chunkC7XKYQEW_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
3316
3342
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
3317
3343
|
const diag = getCellDiagonalBorders2(
|
|
3318
3344
|
cell.style,
|
|
@@ -3341,7 +3367,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3341
3367
|
}
|
|
3342
3368
|
event.stopPropagation();
|
|
3343
3369
|
if (event.shiftKey && selectedCell) {
|
|
3344
|
-
const rect =
|
|
3370
|
+
const rect = chunkC7XKYQEW_js.computeSelectionRect(
|
|
3345
3371
|
selectedCell.rowIndex,
|
|
3346
3372
|
selectedCell.columnIndex,
|
|
3347
3373
|
rowIndex,
|
|
@@ -3351,7 +3377,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3351
3377
|
options?.onSelectCell?.({
|
|
3352
3378
|
rowIndex: selectedCell.rowIndex,
|
|
3353
3379
|
columnIndex: selectedCell.columnIndex,
|
|
3354
|
-
selectedCells:
|
|
3380
|
+
selectedCells: chunkC7XKYQEW_js.rectToCells(rect)
|
|
3355
3381
|
});
|
|
3356
3382
|
} else {
|
|
3357
3383
|
options?.onSelectCell?.({
|
|
@@ -3427,7 +3453,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3427
3453
|
}
|
|
3428
3454
|
const first = selectedCell.selectedCells[0];
|
|
3429
3455
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
3430
|
-
return
|
|
3456
|
+
return chunkC7XKYQEW_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
3431
3457
|
})();
|
|
3432
3458
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
3433
3459
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3449,9 +3475,9 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3449
3475
|
{
|
|
3450
3476
|
className: "w-full h-full border-collapse table-fixed",
|
|
3451
3477
|
style: {
|
|
3452
|
-
fontFamily:
|
|
3478
|
+
fontFamily: chunkC7XKYQEW_js.DEFAULT_FONT_FAMILY,
|
|
3453
3479
|
// `a:tblPr@rtl` mirrors the column order for RTL decks.
|
|
3454
|
-
...
|
|
3480
|
+
...chunkC7XKYQEW_js.tableContainerCss(tableEl.tableData)
|
|
3455
3481
|
},
|
|
3456
3482
|
children: [
|
|
3457
3483
|
parsedTable.columnPercentages.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: parsedTable.columnPercentages.map((percentage, columnIndex) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3503,7 +3529,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3503
3529
|
const mergedStyle = {
|
|
3504
3530
|
...bandStyle,
|
|
3505
3531
|
...xmlCellStyle,
|
|
3506
|
-
...tdCellOverride ?
|
|
3532
|
+
...tdCellOverride ? chunkC7XKYQEW_js.cellStyleToCss(tdCellOverride) : void 0,
|
|
3507
3533
|
...diag ? { position: "relative" } : void 0
|
|
3508
3534
|
};
|
|
3509
3535
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3513,7 +3539,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3513
3539
|
"border px-1 py-0.5 align-top",
|
|
3514
3540
|
isEditable && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
3515
3541
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
3516
|
-
|
|
3542
|
+
chunkC7XKYQEW_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
3517
3543
|
),
|
|
3518
3544
|
colSpan,
|
|
3519
3545
|
rowSpan: rSpan,
|
|
@@ -3524,7 +3550,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3524
3550
|
}
|
|
3525
3551
|
event.stopPropagation();
|
|
3526
3552
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
3527
|
-
const rect =
|
|
3553
|
+
const rect = chunkC7XKYQEW_js.computeSelectionRect(
|
|
3528
3554
|
selectedCell.rowIndex,
|
|
3529
3555
|
selectedCell.columnIndex,
|
|
3530
3556
|
rowIndex,
|
|
@@ -3534,7 +3560,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3534
3560
|
options?.onSelectCell?.({
|
|
3535
3561
|
rowIndex: selectedCell.rowIndex,
|
|
3536
3562
|
columnIndex: selectedCell.columnIndex,
|
|
3537
|
-
selectedCells:
|
|
3563
|
+
selectedCells: chunkC7XKYQEW_js.rectToCells(rect)
|
|
3538
3564
|
});
|
|
3539
3565
|
} else {
|
|
3540
3566
|
options?.onSelectCell?.({
|
|
@@ -3594,24 +3620,24 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3594
3620
|
}
|
|
3595
3621
|
var LEGEND_ITEM_WIDTH = 80;
|
|
3596
3622
|
function partAttrs(part) {
|
|
3597
|
-
return part ?
|
|
3623
|
+
return part ? chunkC7XKYQEW_js.chartPartToAttrs(part) : void 0;
|
|
3598
3624
|
}
|
|
3599
3625
|
function resolveReactPalette(chartData) {
|
|
3600
3626
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
3601
3627
|
return chartData.colorPalette;
|
|
3602
3628
|
}
|
|
3603
|
-
return [...
|
|
3629
|
+
return [...chunkC7XKYQEW_js.getChartStylePalette(chartData.style?.styleId)];
|
|
3604
3630
|
}
|
|
3605
3631
|
function buildReactChartViewModel(element) {
|
|
3606
3632
|
if (element.type !== "chart" || !element.chartData) {
|
|
3607
|
-
return
|
|
3633
|
+
return chunkC7XKYQEW_js.buildChartViewModel(element);
|
|
3608
3634
|
}
|
|
3609
3635
|
const palette = resolveReactPalette(element.chartData);
|
|
3610
3636
|
const themedElement = {
|
|
3611
3637
|
...element,
|
|
3612
3638
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
3613
3639
|
};
|
|
3614
|
-
return
|
|
3640
|
+
return chunkC7XKYQEW_js.buildChartViewModel(themedElement);
|
|
3615
3641
|
}
|
|
3616
3642
|
function renderPrimitive(prim, key) {
|
|
3617
3643
|
switch (prim.kind) {
|
|
@@ -3837,11 +3863,11 @@ function renderChartElement(element) {
|
|
|
3837
3863
|
if (!chartData || chartData.series.length === 0) {
|
|
3838
3864
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkMVKRI3CZ_js.translationsEn["pptx.chart.heading"] });
|
|
3839
3865
|
}
|
|
3840
|
-
const kind =
|
|
3866
|
+
const kind = chunkC7XKYQEW_js.resolveChartKind(chartData.chartType ?? "bar");
|
|
3841
3867
|
return renderChartViewModel(
|
|
3842
3868
|
element.id,
|
|
3843
3869
|
buildReactChartViewModel(element),
|
|
3844
|
-
|
|
3870
|
+
chunkC7XKYQEW_js.chartPreserveAspectRatio(kind)
|
|
3845
3871
|
);
|
|
3846
3872
|
}
|
|
3847
3873
|
|
|
@@ -3861,14 +3887,14 @@ function buildNotesPdf(pages) {
|
|
|
3861
3887
|
notes: page.notes,
|
|
3862
3888
|
slideNumber: page.slideNumber
|
|
3863
3889
|
}));
|
|
3864
|
-
const bytes =
|
|
3890
|
+
const bytes = chunkC7XKYQEW_js.buildNotesPdfBytes(images, meta);
|
|
3865
3891
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
3866
3892
|
return URL.createObjectURL(blob);
|
|
3867
3893
|
}
|
|
3868
3894
|
|
|
3869
3895
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
3870
3896
|
function buildPdfFromImageData(images) {
|
|
3871
|
-
const bytes =
|
|
3897
|
+
const bytes = chunkC7XKYQEW_js.buildSlidesPdfBytes(images);
|
|
3872
3898
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
3873
3899
|
return URL.createObjectURL(blob);
|
|
3874
3900
|
}
|
|
@@ -3877,7 +3903,7 @@ function buildPdfFromImageData(images) {
|
|
|
3877
3903
|
var activePreview = null;
|
|
3878
3904
|
function startPreviewAnimation(elementId, preset, options) {
|
|
3879
3905
|
stopPreviewAnimation();
|
|
3880
|
-
const descriptor =
|
|
3906
|
+
const descriptor = chunkC7XKYQEW_js.buildPreviewAnimation(preset, options);
|
|
3881
3907
|
if (!descriptor) {
|
|
3882
3908
|
return;
|
|
3883
3909
|
}
|
|
@@ -3890,7 +3916,7 @@ function startMotionPathPreview(elementId, path, options) {
|
|
|
3890
3916
|
return;
|
|
3891
3917
|
}
|
|
3892
3918
|
const stage = domEl.offsetParent;
|
|
3893
|
-
const descriptor =
|
|
3919
|
+
const descriptor = chunkC7XKYQEW_js.buildMotionPathPreview({
|
|
3894
3920
|
path,
|
|
3895
3921
|
slideWidth: stage?.offsetWidth || DEFAULT_PREVIEW_SLIDE_WIDTH,
|
|
3896
3922
|
slideHeight: stage?.offsetHeight || DEFAULT_PREVIEW_SLIDE_HEIGHT,
|