pptx-react-viewer 3.6.0 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/dist/{AiChatPanel-WRQGJJVD.mjs → AiChatPanel-A5DCEHTO.mjs} +4 -4
- package/dist/AiChatPanel-A5DCEHTO.mjs.br +0 -0
- package/dist/AiChatPanel-A5DCEHTO.mjs.gz +0 -0
- package/dist/{AiChatPanel-LEOEDIW2.js → AiChatPanel-XLQM4BQJ.js} +25 -25
- package/dist/AiChatPanel-XLQM4BQJ.js.br +0 -0
- package/dist/AiChatPanel-XLQM4BQJ.js.gz +0 -0
- package/dist/{Area3DChartScene-SJC2ZB6R.mjs → Area3DChartScene-5CMEMIBI.mjs} +1 -1
- package/dist/Area3DChartScene-5CMEMIBI.mjs.br +0 -0
- package/dist/Area3DChartScene-5CMEMIBI.mjs.gz +0 -0
- package/dist/{Area3DChartScene-3TJ2GTGI.js → Area3DChartScene-RZ3V3WOR.js} +2 -2
- package/dist/Area3DChartScene-RZ3V3WOR.js.br +0 -0
- package/dist/Area3DChartScene-RZ3V3WOR.js.gz +0 -0
- package/dist/{Bar3DChartScene-SPER4LQA.mjs → Bar3DChartScene-H3MYUJKV.mjs} +1 -1
- package/dist/Bar3DChartScene-H3MYUJKV.mjs.br +0 -0
- package/dist/Bar3DChartScene-H3MYUJKV.mjs.gz +0 -0
- package/dist/{Bar3DChartScene-2ZGOMOZO.js → Bar3DChartScene-KHCQ6TEC.js} +2 -2
- package/dist/Bar3DChartScene-KHCQ6TEC.js.br +0 -0
- package/dist/Bar3DChartScene-KHCQ6TEC.js.gz +0 -0
- package/dist/{Line3DChartScene-42FYFGLU.js → Line3DChartScene-QEACF3U3.js} +2 -2
- package/dist/Line3DChartScene-QEACF3U3.js.br +0 -0
- package/dist/Line3DChartScene-QEACF3U3.js.gz +0 -0
- package/dist/{Line3DChartScene-FH3YHPXE.mjs → Line3DChartScene-YFRPJHDX.mjs} +1 -1
- package/dist/Line3DChartScene-YFRPJHDX.mjs.br +0 -0
- package/dist/Line3DChartScene-YFRPJHDX.mjs.gz +0 -0
- package/dist/{Model3DScene-2BCR2YYD.mjs → Model3DScene-O24KP723.mjs} +1 -1
- package/dist/Model3DScene-O24KP723.mjs.br +0 -0
- package/dist/Model3DScene-O24KP723.mjs.gz +0 -0
- package/dist/{Model3DScene-EIU2GVUZ.js → Model3DScene-QQWKGJ3T.js} +2 -2
- package/dist/Model3DScene-QQWKGJ3T.js.br +0 -0
- package/dist/Model3DScene-QQWKGJ3T.js.gz +0 -0
- package/dist/{PieChart3DScene-QFQUJFDP.mjs → PieChart3DScene-CI6CW22C.mjs} +1 -1
- package/dist/PieChart3DScene-CI6CW22C.mjs.br +0 -0
- package/dist/PieChart3DScene-CI6CW22C.mjs.gz +0 -0
- package/dist/{PieChart3DScene-VQOHZPHI.js → PieChart3DScene-L3MHKQHW.js} +2 -2
- package/dist/PieChart3DScene-L3MHKQHW.js.br +0 -0
- package/dist/PieChart3DScene-L3MHKQHW.js.gz +0 -0
- package/dist/PowerPointViewer-Cl6jBPNw.d.ts.map +1 -1
- package/dist/{SurfaceChart3DScene-FTVXZN6O.js → SurfaceChart3DScene-5IER6VFW.js} +2 -2
- package/dist/SurfaceChart3DScene-5IER6VFW.js.br +0 -0
- package/dist/SurfaceChart3DScene-5IER6VFW.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-CGXMRBCL.mjs → SurfaceChart3DScene-JUXRC3K2.mjs} +1 -1
- package/dist/SurfaceChart3DScene-JUXRC3K2.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-JUXRC3K2.mjs.gz +0 -0
- package/dist/{audience-content-store-bR7Gs_1S.d.ts → audience-content-store-CB2WVM1K.d.ts} +12 -3
- package/dist/{audience-content-store-bR7Gs_1S.d.ts.map → audience-content-store-CB2WVM1K.d.ts.map} +1 -1
- package/dist/{chunk-NFOOONND.js → chunk-4222CHFH.js} +1944 -1299
- package/dist/chunk-4222CHFH.js.br +0 -0
- package/dist/chunk-4222CHFH.js.gz +0 -0
- package/dist/{chunk-ZUSYUWOV.mjs → chunk-6IMB5DNJ.mjs} +8927 -4870
- package/dist/chunk-6IMB5DNJ.mjs.br +0 -0
- package/dist/chunk-6IMB5DNJ.mjs.gz +0 -0
- package/dist/{chunk-ZHSBMG37.js → chunk-DE3S3UHX.js} +557 -682
- package/dist/chunk-DE3S3UHX.js.br +0 -0
- package/dist/chunk-DE3S3UHX.js.gz +0 -0
- package/dist/{chunk-ZWPHUPL4.js → chunk-F5NPGNMA.js} +9 -5
- package/dist/chunk-F5NPGNMA.js.br +0 -0
- package/dist/chunk-F5NPGNMA.js.gz +0 -0
- package/dist/{chunk-TGCSZXOG.mjs → chunk-FRZIBZTE.mjs} +57 -27
- package/dist/chunk-FRZIBZTE.mjs.br +0 -0
- package/dist/chunk-FRZIBZTE.mjs.gz +0 -0
- package/dist/{chunk-MZI4DG3S.js → chunk-L3ZIBQEB.js} +57 -27
- package/dist/chunk-L3ZIBQEB.js.br +0 -0
- package/dist/chunk-L3ZIBQEB.js.gz +0 -0
- package/dist/{chunk-FG5VQFWP.mjs → chunk-PFPKBNNZ.mjs} +761 -116
- package/dist/chunk-PFPKBNNZ.mjs.br +0 -0
- package/dist/chunk-PFPKBNNZ.mjs.gz +0 -0
- package/dist/{chunk-7VPDHSWF.js → chunk-QWA5YEIZ.js} +234 -241
- package/dist/chunk-QWA5YEIZ.js.br +0 -0
- package/dist/chunk-QWA5YEIZ.js.gz +0 -0
- package/dist/{chunk-WX7AFFBZ.mjs → chunk-RHWQKZLB.mjs} +63 -69
- package/dist/chunk-RHWQKZLB.mjs.br +0 -0
- package/dist/chunk-RHWQKZLB.mjs.gz +0 -0
- package/dist/{chunk-T3V5FBXJ.mjs → chunk-RNP5HP4L.mjs} +5 -2
- package/dist/chunk-RNP5HP4L.mjs.br +0 -0
- package/dist/chunk-RNP5HP4L.mjs.gz +0 -0
- package/dist/{chunk-AL2KLPOJ.js → chunk-SN5EUDIT.js} +8959 -4873
- package/dist/chunk-SN5EUDIT.js.br +0 -0
- package/dist/chunk-SN5EUDIT.js.gz +0 -0
- package/dist/{chunk-VYNICQ4O.mjs → chunk-UPJW34YG.mjs} +133 -258
- package/dist/chunk-UPJW34YG.mjs.br +0 -0
- package/dist/chunk-UPJW34YG.mjs.gz +0 -0
- package/dist/i18n.js +4 -4
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.d.ts +595 -38
- package/dist/index.js +47 -47
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +768 -186
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +79 -79
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +4 -4
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/types-Bzdkiakq.d.ts.map +1 -1
- package/dist/viewer/index.d.ts +534 -38
- package/dist/viewer/index.js +27 -27
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +6 -6
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +2 -2
- package/dist/AiChatPanel-LEOEDIW2.js.br +0 -0
- package/dist/AiChatPanel-LEOEDIW2.js.gz +0 -0
- package/dist/AiChatPanel-WRQGJJVD.mjs.br +0 -0
- package/dist/AiChatPanel-WRQGJJVD.mjs.gz +0 -0
- package/dist/Area3DChartScene-3TJ2GTGI.js.br +0 -0
- package/dist/Area3DChartScene-3TJ2GTGI.js.gz +0 -0
- package/dist/Area3DChartScene-SJC2ZB6R.mjs.br +0 -2
- package/dist/Area3DChartScene-SJC2ZB6R.mjs.gz +0 -0
- package/dist/Bar3DChartScene-2ZGOMOZO.js.br +0 -0
- package/dist/Bar3DChartScene-2ZGOMOZO.js.gz +0 -0
- package/dist/Bar3DChartScene-SPER4LQA.mjs.br +0 -0
- package/dist/Bar3DChartScene-SPER4LQA.mjs.gz +0 -0
- package/dist/Line3DChartScene-42FYFGLU.js.br +0 -0
- package/dist/Line3DChartScene-42FYFGLU.js.gz +0 -0
- package/dist/Line3DChartScene-FH3YHPXE.mjs.br +0 -2
- package/dist/Line3DChartScene-FH3YHPXE.mjs.gz +0 -0
- package/dist/Model3DScene-2BCR2YYD.mjs.br +0 -0
- package/dist/Model3DScene-2BCR2YYD.mjs.gz +0 -0
- package/dist/Model3DScene-EIU2GVUZ.js.br +0 -0
- package/dist/Model3DScene-EIU2GVUZ.js.gz +0 -0
- package/dist/PieChart3DScene-QFQUJFDP.mjs.br +0 -0
- package/dist/PieChart3DScene-QFQUJFDP.mjs.gz +0 -0
- package/dist/PieChart3DScene-VQOHZPHI.js.br +0 -0
- package/dist/PieChart3DScene-VQOHZPHI.js.gz +0 -0
- package/dist/SurfaceChart3DScene-CGXMRBCL.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-CGXMRBCL.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-FTVXZN6O.js.br +0 -0
- package/dist/SurfaceChart3DScene-FTVXZN6O.js.gz +0 -0
- package/dist/chunk-7VPDHSWF.js.br +0 -0
- package/dist/chunk-7VPDHSWF.js.gz +0 -0
- package/dist/chunk-AL2KLPOJ.js.br +0 -0
- package/dist/chunk-AL2KLPOJ.js.gz +0 -0
- package/dist/chunk-FG5VQFWP.mjs.br +0 -0
- package/dist/chunk-FG5VQFWP.mjs.gz +0 -0
- package/dist/chunk-MZI4DG3S.js.br +0 -0
- package/dist/chunk-MZI4DG3S.js.gz +0 -0
- package/dist/chunk-NFOOONND.js.br +0 -0
- package/dist/chunk-NFOOONND.js.gz +0 -0
- package/dist/chunk-T3V5FBXJ.mjs.br +0 -0
- package/dist/chunk-T3V5FBXJ.mjs.gz +0 -0
- package/dist/chunk-TGCSZXOG.mjs.br +0 -0
- package/dist/chunk-TGCSZXOG.mjs.gz +0 -0
- package/dist/chunk-VYNICQ4O.mjs.br +0 -0
- package/dist/chunk-VYNICQ4O.mjs.gz +0 -0
- package/dist/chunk-WX7AFFBZ.mjs.br +0 -0
- package/dist/chunk-WX7AFFBZ.mjs.gz +0 -0
- package/dist/chunk-ZHSBMG37.js.br +0 -0
- package/dist/chunk-ZHSBMG37.js.gz +0 -0
- package/dist/chunk-ZUSYUWOV.mjs.br +0 -0
- package/dist/chunk-ZUSYUWOV.mjs.gz +0 -0
- package/dist/chunk-ZWPHUPL4.js.br +0 -0
- package/dist/chunk-ZWPHUPL4.js.gz +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkSN5EUDIT_js = require('./chunk-SN5EUDIT.js');
|
|
4
|
+
var chunkL3ZIBQEB_js = require('./chunk-L3ZIBQEB.js');
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var tailwindMerge = require('tailwind-merge');
|
|
7
7
|
var React7 = require('react');
|
|
@@ -15,7 +15,7 @@ var React7__default = /*#__PURE__*/_interopDefault(React7);
|
|
|
15
15
|
|
|
16
16
|
// src/viewer/utils/animation-effects.ts
|
|
17
17
|
function getAnimationInitialStyle2(preset, nativeAnimation) {
|
|
18
|
-
return
|
|
18
|
+
return chunkSN5EUDIT_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 chunkSN5EUDIT_js.cloneHistorySnapshot(snapshot);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
// src/viewer/constants/scalar.ts
|
|
@@ -61,23 +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 =
|
|
65
|
-
|
|
66
|
-
// src/viewer/constants/theme.ts
|
|
67
|
-
var THEME_COLOR_SWATCHES = [
|
|
68
|
-
"#000000",
|
|
69
|
-
"#FFFFFF",
|
|
70
|
-
"#1F497D",
|
|
71
|
-
"#EEECE1",
|
|
72
|
-
"#4472C4",
|
|
73
|
-
"#ED7D31",
|
|
74
|
-
"#A5A5A5",
|
|
75
|
-
"#FFC000",
|
|
76
|
-
"#5B9BD5",
|
|
77
|
-
"#70AD47",
|
|
78
|
-
"#0563C1",
|
|
79
|
-
"#954F72"
|
|
80
|
-
];
|
|
64
|
+
var SHORTCUT_REFERENCE_ITEMS = chunkSN5EUDIT_js.VIEWER_SHORTCUT_REFERENCE;
|
|
81
65
|
|
|
82
66
|
// src/viewer/constants/transitions-animations.ts
|
|
83
67
|
var ANIMATION_PRESET_OPTIONS = [
|
|
@@ -105,7 +89,7 @@ var GLYPH_COMPONENTS = {
|
|
|
105
89
|
plus: lu.LuPlus,
|
|
106
90
|
triangle: lu.LuTriangle
|
|
107
91
|
};
|
|
108
|
-
var SHAPE_PRESETS =
|
|
92
|
+
var SHAPE_PRESETS = chunkSN5EUDIT_js.SHAPE_PRESET_DEFS.map(
|
|
109
93
|
(def) => ({
|
|
110
94
|
type: def.type,
|
|
111
95
|
label: def.label,
|
|
@@ -130,7 +114,7 @@ var ARROW_SIZE_OPTIONS = [
|
|
|
130
114
|
{ value: "med", label: "Medium", i18nKey: "pptx.connectorOptions.sizeMedium" },
|
|
131
115
|
{ value: "lg", label: "Large", i18nKey: "pptx.connectorOptions.sizeLarge" }
|
|
132
116
|
];
|
|
133
|
-
var STROKE_DASH_OPTIONS2 =
|
|
117
|
+
var STROKE_DASH_OPTIONS2 = chunkSN5EUDIT_js.STROKE_DASH_OPTIONS;
|
|
134
118
|
|
|
135
119
|
// src/viewer/utils/shape-types.tsx
|
|
136
120
|
function getShapeType(shapeType) {
|
|
@@ -239,7 +223,7 @@ function isConnectorOrLineElement(element) {
|
|
|
239
223
|
if (element.type === "connector") {
|
|
240
224
|
return true;
|
|
241
225
|
}
|
|
242
|
-
if (!
|
|
226
|
+
if (!chunkSN5EUDIT_js.hasShapeProperties(element)) {
|
|
243
227
|
return false;
|
|
244
228
|
}
|
|
245
229
|
const st = getShapeType(element.shapeType);
|
|
@@ -248,17 +232,17 @@ function isConnectorOrLineElement(element) {
|
|
|
248
232
|
|
|
249
233
|
// src/viewer/utils/image-style.ts
|
|
250
234
|
function getImageMaskStyle(element) {
|
|
251
|
-
if (!
|
|
235
|
+
if (!chunkSN5EUDIT_js.hasShapeProperties(element)) {
|
|
252
236
|
return void 0;
|
|
253
237
|
}
|
|
254
|
-
const geometry =
|
|
238
|
+
const geometry = chunkSN5EUDIT_js.resolveShapeGeometry(element);
|
|
255
239
|
if (geometry.kind === "borderRadius") {
|
|
256
240
|
return { borderRadius: geometry.radius };
|
|
257
241
|
}
|
|
258
242
|
return geometry.kind === "clipPath" ? { clipPath: geometry.clipPath } : void 0;
|
|
259
243
|
}
|
|
260
244
|
function getImageRenderStyle(element) {
|
|
261
|
-
const fit =
|
|
245
|
+
const fit = chunkSN5EUDIT_js.getImageFitStyle(element);
|
|
262
246
|
return {
|
|
263
247
|
// A translated/scaled crop must be masked by its stationary wrapper, not
|
|
264
248
|
// by the moving bitmap itself.
|
|
@@ -275,7 +259,7 @@ function getImageSurfaceMaskStyle(element) {
|
|
|
275
259
|
};
|
|
276
260
|
}
|
|
277
261
|
function getImageSurfaceStyle(element) {
|
|
278
|
-
const fill =
|
|
262
|
+
const fill = chunkSN5EUDIT_js.hasShapeProperties(element) ? chunkSN5EUDIT_js.getComputedFillStyle(element) : void 0;
|
|
279
263
|
return {
|
|
280
264
|
position: "absolute",
|
|
281
265
|
inset: 0,
|
|
@@ -288,13 +272,13 @@ function getImageSurfaceStyle(element) {
|
|
|
288
272
|
};
|
|
289
273
|
}
|
|
290
274
|
function getCropShapeClipPath2(element) {
|
|
291
|
-
if (!
|
|
275
|
+
if (!chunkSN5EUDIT_js.isImageLikeElement(element)) {
|
|
292
276
|
return void 0;
|
|
293
277
|
}
|
|
294
|
-
return
|
|
278
|
+
return chunkSN5EUDIT_js.getCropShapeClipPath(element.cropShape, element.width, element.height);
|
|
295
279
|
}
|
|
296
280
|
function getImageTilingStyle2(element) {
|
|
297
|
-
return
|
|
281
|
+
return chunkSN5EUDIT_js.getImageTilingStyle(element);
|
|
298
282
|
}
|
|
299
283
|
|
|
300
284
|
// src/viewer/utils/geometry-image.ts
|
|
@@ -426,7 +410,7 @@ function VideoWithMetadata({
|
|
|
426
410
|
{
|
|
427
411
|
ref: mediaRef,
|
|
428
412
|
className: "w-full h-full pointer-events-auto",
|
|
429
|
-
style: isFullScreen ? { objectFit: "cover" } :
|
|
413
|
+
style: isFullScreen ? { objectFit: "cover" } : chunkSN5EUDIT_js.getImageFitStyle(element),
|
|
430
414
|
controls: showTransport,
|
|
431
415
|
preload: "metadata",
|
|
432
416
|
playsInline: true,
|
|
@@ -483,7 +467,7 @@ function PresentationMediaController({
|
|
|
483
467
|
const [isMediaPlaying, setIsMediaPlaying] = React7.useState(false);
|
|
484
468
|
const trimStartSec = element.trimStartMs !== void 0 ? element.trimStartMs / 1e3 : 0;
|
|
485
469
|
const hideWhenNotPlaying = isPresentationMode && element.hideWhenNotPlaying === true;
|
|
486
|
-
const { volume: playbackVolume, playbackRate } =
|
|
470
|
+
const { volume: playbackVolume, playbackRate } = chunkSN5EUDIT_js.mediaPlaybackAttributes({
|
|
487
471
|
loop: element.loop,
|
|
488
472
|
volume: element.volume,
|
|
489
473
|
playbackSpeed: element.playbackSpeed
|
|
@@ -531,7 +515,7 @@ function PresentationMediaController({
|
|
|
531
515
|
if (!el || !isPresentationMode) {
|
|
532
516
|
return;
|
|
533
517
|
}
|
|
534
|
-
return
|
|
518
|
+
return chunkSN5EUDIT_js.scheduleMediaTrimAndFade(el, {
|
|
535
519
|
trimStartMs: element.trimStartMs,
|
|
536
520
|
trimEndMs: element.trimEndMs,
|
|
537
521
|
fadeInDuration: element.fadeInDuration,
|
|
@@ -552,7 +536,7 @@ function PresentationMediaController({
|
|
|
552
536
|
}
|
|
553
537
|
if (element.playAcrossSlides && element.mediaType === "audio") {
|
|
554
538
|
const dataUrl = element.mediaData ?? resolvedDataUrl;
|
|
555
|
-
if (
|
|
539
|
+
if (chunkSN5EUDIT_js.registerCrossSlideAudio(element, dataUrl)) {
|
|
556
540
|
return;
|
|
557
541
|
}
|
|
558
542
|
}
|
|
@@ -597,7 +581,7 @@ function PresentationMediaController({
|
|
|
597
581
|
] });
|
|
598
582
|
}
|
|
599
583
|
function label(key) {
|
|
600
|
-
return key === void 0 ? void 0 :
|
|
584
|
+
return key === void 0 ? void 0 : chunkL3ZIBQEB_js.translationsEn[key];
|
|
601
585
|
}
|
|
602
586
|
function FallbackIcon({
|
|
603
587
|
paths,
|
|
@@ -633,17 +617,17 @@ function Badge({
|
|
|
633
617
|
"div",
|
|
634
618
|
{
|
|
635
619
|
className: `absolute inset-0 flex flex-col items-center justify-center ${isMissing ? "gap-1" : ""}`,
|
|
636
|
-
...{ [
|
|
620
|
+
...{ [chunkSN5EUDIT_js.MEDIA_CHROME_ATTRIBUTE]: visual.badge },
|
|
637
621
|
children: [
|
|
638
622
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
639
623
|
FallbackIcon,
|
|
640
624
|
{
|
|
641
|
-
paths:
|
|
625
|
+
paths: chunkSN5EUDIT_js.mediaFallbackIcon(visual, element.mediaType),
|
|
642
626
|
size: isMissing ? 32 : 48,
|
|
643
627
|
className: isMissing ? "text-white/60" : "text-white/80 drop-shadow-md"
|
|
644
628
|
}
|
|
645
629
|
),
|
|
646
|
-
isMissing && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: label(
|
|
630
|
+
isMissing && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: label(chunkSN5EUDIT_js.mediaFallbackLabelKey(visual, element.mediaType)) })
|
|
647
631
|
]
|
|
648
632
|
}
|
|
649
633
|
);
|
|
@@ -660,17 +644,17 @@ function Placeholder({
|
|
|
660
644
|
"div",
|
|
661
645
|
{
|
|
662
646
|
className: `w-full h-full flex flex-col items-center justify-center gap-1 pointer-events-none rounded ${isMissing ? "bg-black/30 border border-dashed border-white/20" : element.mediaType === "audio" ? "bg-black/10" : "bg-black/20"}`,
|
|
663
|
-
...{ [
|
|
647
|
+
...{ [chunkSN5EUDIT_js.MEDIA_CHROME_ATTRIBUTE]: visual.placeholder },
|
|
664
648
|
children: [
|
|
665
649
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
666
650
|
FallbackIcon,
|
|
667
651
|
{
|
|
668
|
-
paths:
|
|
652
|
+
paths: chunkSN5EUDIT_js.mediaFallbackIcon(visual, element.mediaType),
|
|
669
653
|
size: isMissing ? 36 : element.mediaType === "audio" ? 24 : 32,
|
|
670
654
|
className: isMissing ? "text-white/50" : "text-white/70"
|
|
671
655
|
}
|
|
672
656
|
),
|
|
673
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `text-[10px] ${isMissing ? "text-white/50" : "text-white/70"}`, children: label(
|
|
657
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `text-[10px] ${isMissing ? "text-white/50" : "text-white/70"}`, children: label(chunkSN5EUDIT_js.mediaFallbackLabelKey(visual, element.mediaType)) })
|
|
674
658
|
]
|
|
675
659
|
}
|
|
676
660
|
);
|
|
@@ -680,7 +664,7 @@ function renderMediaFallback({
|
|
|
680
664
|
posterUrl,
|
|
681
665
|
surface
|
|
682
666
|
}) {
|
|
683
|
-
const visual =
|
|
667
|
+
const visual = chunkSN5EUDIT_js.mediaFallbackVisual(surface, {
|
|
684
668
|
hasPoster: Boolean(posterUrl),
|
|
685
669
|
missing: element.mediaMissing === true
|
|
686
670
|
});
|
|
@@ -690,9 +674,9 @@ function renderMediaFallback({
|
|
|
690
674
|
"img",
|
|
691
675
|
{
|
|
692
676
|
src: posterUrl,
|
|
693
|
-
alt: visual.dimPoster ?
|
|
677
|
+
alt: visual.dimPoster ? chunkL3ZIBQEB_js.translationsEn["pptx.media.posterAlt"] : chunkL3ZIBQEB_js.translationsEn["pptx.media.videoPosterAlt"],
|
|
694
678
|
className: `w-full h-full${visual.dimPoster ? " opacity-50" : ""}`,
|
|
695
|
-
style:
|
|
679
|
+
style: chunkSN5EUDIT_js.getImageFitStyle(element)
|
|
696
680
|
}
|
|
697
681
|
),
|
|
698
682
|
/* @__PURE__ */ jsxRuntime.jsx(Badge, { visual, element })
|
|
@@ -702,7 +686,7 @@ function renderMediaFallback({
|
|
|
702
686
|
}
|
|
703
687
|
function renderMediaElement(element, mediaDataUrls, options) {
|
|
704
688
|
if (element.type !== "media") {
|
|
705
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
689
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkL3ZIBQEB_js.translationsEn["pptx.media.title"] });
|
|
706
690
|
}
|
|
707
691
|
const mediaType = element.mediaType;
|
|
708
692
|
const mediaPath = element.mediaPath;
|
|
@@ -710,7 +694,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
710
694
|
const dataUrl = element.mediaData ?? (mediaPath ? mediaDataUrls.get(mediaPath) : void 0);
|
|
711
695
|
const trimFragment = buildTrimFragment(element);
|
|
712
696
|
const posterUrl = element.posterFrameData ?? void 0;
|
|
713
|
-
const shouldLoop =
|
|
697
|
+
const shouldLoop = chunkSN5EUDIT_js.mediaPlaybackAttributes(element).loop;
|
|
714
698
|
const shouldAutoPlay = options?.autoPlay === true || element.autoPlay === true;
|
|
715
699
|
const isFullScreen = options?.fullScreen === true;
|
|
716
700
|
const isPresentationMode = options?.isPresentationMode === true;
|
|
@@ -788,25 +772,25 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
788
772
|
if (surface.presenting || surface.preview) {
|
|
789
773
|
return null;
|
|
790
774
|
}
|
|
791
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
775
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkL3ZIBQEB_js.translationsEn["pptx.media.title"] });
|
|
792
776
|
}
|
|
793
777
|
|
|
794
778
|
// src/viewer/utils/text-utils.tsx
|
|
795
779
|
function getTextStyleForElement(element, fallbackColor) {
|
|
796
|
-
return
|
|
780
|
+
return chunkSN5EUDIT_js.buildTextBlockStyle(element, { fallbackColor });
|
|
797
781
|
}
|
|
798
782
|
|
|
799
783
|
// src/viewer/utils/text-layout.tsx
|
|
800
784
|
function getTextLayoutStyle(element) {
|
|
801
|
-
if (!
|
|
785
|
+
if (!chunkSN5EUDIT_js.hasTextProperties(element)) {
|
|
802
786
|
return {};
|
|
803
787
|
}
|
|
804
|
-
const writingMode =
|
|
805
|
-
const textOrientation =
|
|
806
|
-
const verticalDirection =
|
|
788
|
+
const writingMode = chunkSN5EUDIT_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
789
|
+
const textOrientation = chunkSN5EUDIT_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
790
|
+
const verticalDirection = chunkSN5EUDIT_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
807
791
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
808
792
|
const shapeAutoFitTextBox = element.textStyle?.autoFitMode === "shrink" && (element.type === "text" || element.locks?.txBox === true);
|
|
809
|
-
const hasParagraphIndents =
|
|
793
|
+
const hasParagraphIndents = chunkSN5EUDIT_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
810
794
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
811
795
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
812
796
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
@@ -815,7 +799,7 @@ function getTextLayoutStyle(element) {
|
|
|
815
799
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
816
800
|
return {
|
|
817
801
|
// Columns / flex anchoring / anchorCtr / tab-size / kinsoku, from shared.
|
|
818
|
-
...
|
|
802
|
+
...chunkSN5EUDIT_js.buildTextBodyLayoutStyle(element),
|
|
819
803
|
// Body inset only. Paragraph spacing (spcBef/spcAft) is applied
|
|
820
804
|
// per-paragraph by the paragraph renderer, not collapsed here.
|
|
821
805
|
paddingTop: bodyTop,
|
|
@@ -843,7 +827,7 @@ function getTextLayoutStyle(element) {
|
|
|
843
827
|
|
|
844
828
|
// src/viewer/utils/text-effects.tsx
|
|
845
829
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
846
|
-
return
|
|
830
|
+
return chunkSN5EUDIT_js.buildTextBody3DSceneStyle(textStyle);
|
|
847
831
|
}
|
|
848
832
|
|
|
849
833
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -1028,13 +1012,13 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1028
1012
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
1029
1013
|
return renderedSegments;
|
|
1030
1014
|
}
|
|
1031
|
-
const paraKey = `${elementId}${
|
|
1015
|
+
const paraKey = `${elementId}${chunkSN5EUDIT_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
1032
1016
|
const paraState = subElementAnimStates.get(paraKey);
|
|
1033
1017
|
if (paraState) {
|
|
1034
1018
|
const style = buildAnimStyle(paraState);
|
|
1035
1019
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
1036
1020
|
}
|
|
1037
|
-
const spec =
|
|
1021
|
+
const spec = chunkSN5EUDIT_js.buildTextBuildSpec(
|
|
1038
1022
|
elementId,
|
|
1039
1023
|
paraIndex,
|
|
1040
1024
|
paraRuns.map((run) => ({ text: run.text, style: run })),
|
|
@@ -1052,7 +1036,7 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1052
1036
|
"span",
|
|
1053
1037
|
{
|
|
1054
1038
|
"data-anim-id": span.animId,
|
|
1055
|
-
style:
|
|
1039
|
+
style: chunkSN5EUDIT_js.textBuildSpanStyle(span),
|
|
1056
1040
|
children: content
|
|
1057
1041
|
},
|
|
1058
1042
|
span.animId
|
|
@@ -1063,13 +1047,13 @@ function renderUnderlineWords(text, isUnderlineWords, wordDecoration, metric, ke
|
|
|
1063
1047
|
if (!isUnderlineWords || !text) {
|
|
1064
1048
|
return inner(text, keyPrefix, metric);
|
|
1065
1049
|
}
|
|
1066
|
-
const pieces =
|
|
1050
|
+
const pieces = chunkSN5EUDIT_js.splitWordsForUnderline(text);
|
|
1067
1051
|
if (pieces.length === 0) {
|
|
1068
1052
|
return inner(text, keyPrefix, metric);
|
|
1069
1053
|
}
|
|
1070
1054
|
const gapMetric = metric ? {
|
|
1071
1055
|
...metric,
|
|
1072
|
-
nestedStyle: metric.nestedStyle ?
|
|
1056
|
+
nestedStyle: metric.nestedStyle ? chunkSN5EUDIT_js.stripUnderlineDecoration(metric.nestedStyle) : void 0
|
|
1073
1057
|
} : void 0;
|
|
1074
1058
|
return pieces.map((piece, i) => {
|
|
1075
1059
|
const key = `${keyPrefix}-u${i}`;
|
|
@@ -1101,13 +1085,19 @@ function makeSegmentPieceRenderer(needsScriptFonts, scriptFonts, baseFontFamily,
|
|
|
1101
1085
|
)
|
|
1102
1086
|
);
|
|
1103
1087
|
}
|
|
1104
|
-
function renderTabbedLine(line, ctx, keyPrefix, renderPiece, nestedStyle) {
|
|
1105
|
-
const [lineLayout] =
|
|
1088
|
+
function renderTabbedLine(line, ctx, keyPrefix, renderPiece, nestedStyle, underlineWords = false) {
|
|
1089
|
+
const [lineLayout] = chunkSN5EUDIT_js.buildRunTabLines(
|
|
1090
|
+
line,
|
|
1091
|
+
ctx,
|
|
1092
|
+
nestedStyle,
|
|
1093
|
+
void 0,
|
|
1094
|
+
underlineWords
|
|
1095
|
+
);
|
|
1106
1096
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { display: "inline-block", whiteSpace: "nowrap" }, children: lineLayout.pieces.map((piece, i) => {
|
|
1107
1097
|
const key = `${keyPrefix}-tab-${i}`;
|
|
1108
1098
|
return /* @__PURE__ */ jsxRuntime.jsxs(React7__default.default.Fragment, { children: [
|
|
1109
1099
|
piece.leaderStyle ? /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", style: piece.leaderStyle, children: piece.leaderText }) : null,
|
|
1110
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { style: piece.style, children: renderPiece(piece.text, key) })
|
|
1100
|
+
piece.words ? piece.words.map((word, w) => /* @__PURE__ */ jsxRuntime.jsx("span", { style: word.style, children: renderPiece(word.text, `${key}-w${w}`) }, `${key}-w${w}`)) : /* @__PURE__ */ jsxRuntime.jsx("span", { style: piece.style, children: renderPiece(piece.text, key) })
|
|
1111
1101
|
] }, key);
|
|
1112
1102
|
}) });
|
|
1113
1103
|
}
|
|
@@ -1115,7 +1105,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1115
1105
|
if (!needsScriptFonts || !text) {
|
|
1116
1106
|
return text;
|
|
1117
1107
|
}
|
|
1118
|
-
const pieces =
|
|
1108
|
+
const pieces = chunkSN5EUDIT_js.splitRunByScriptFont(
|
|
1119
1109
|
text,
|
|
1120
1110
|
scriptFonts,
|
|
1121
1111
|
baseFontFamily,
|
|
@@ -1132,7 +1122,7 @@ function renderMetricPieces(text, metric, keyPrefix, inner) {
|
|
|
1132
1122
|
if (!metric || !text) {
|
|
1133
1123
|
return inner(text, keyPrefix);
|
|
1134
1124
|
}
|
|
1135
|
-
const pieces =
|
|
1125
|
+
const pieces = chunkSN5EUDIT_js.splitRunForMetrics(text, metric.font);
|
|
1136
1126
|
if (pieces.length <= 1) {
|
|
1137
1127
|
return inner(text, keyPrefix);
|
|
1138
1128
|
}
|
|
@@ -1141,7 +1131,7 @@ function renderMetricPieces(text, metric, keyPrefix, inner) {
|
|
|
1141
1131
|
{
|
|
1142
1132
|
style: {
|
|
1143
1133
|
...metric.nestedStyle,
|
|
1144
|
-
letterSpacing:
|
|
1134
|
+
letterSpacing: chunkSN5EUDIT_js.pieceLetterSpacing(metric.authoredPx, piece.tracking)
|
|
1145
1135
|
},
|
|
1146
1136
|
children: inner(piece.text, `${keyPrefix}-w${i}`)
|
|
1147
1137
|
},
|
|
@@ -1162,7 +1152,14 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1162
1152
|
return lines.map((line, lineIndex) => {
|
|
1163
1153
|
const lineKey = `${elementId}-seg-${segmentIndex}-line-${lineIndex}`;
|
|
1164
1154
|
return /* @__PURE__ */ jsxRuntime.jsxs(React7__default.default.Fragment, { children: [
|
|
1165
|
-
tabContext && line.includes(" ") ? renderTabbedLine(
|
|
1155
|
+
tabContext && line.includes(" ") ? renderTabbedLine(
|
|
1156
|
+
line,
|
|
1157
|
+
tabContext,
|
|
1158
|
+
lineKey,
|
|
1159
|
+
renderLeaf,
|
|
1160
|
+
metric?.nestedStyle,
|
|
1161
|
+
isUnderlineWords
|
|
1162
|
+
) : renderLeaf(line, lineKey),
|
|
1166
1163
|
lineIndex < lines.length - 1 ? /* @__PURE__ */ jsxRuntime.jsx("br", {}) : null
|
|
1167
1164
|
] }, lineKey);
|
|
1168
1165
|
});
|
|
@@ -1210,8 +1207,8 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1210
1207
|
});
|
|
1211
1208
|
}
|
|
1212
1209
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
1213
|
-
const mathml =
|
|
1214
|
-
const safeMathml = mathml ?
|
|
1210
|
+
const mathml = chunkSN5EUDIT_js.convertOmmlToMathMl(equationXml);
|
|
1211
|
+
const safeMathml = mathml ? chunkSN5EUDIT_js.sanitizeMathMl(mathml) : "";
|
|
1215
1212
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1216
1213
|
"span",
|
|
1217
1214
|
{
|
|
@@ -1221,7 +1218,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1221
1218
|
},
|
|
1222
1219
|
dangerouslySetInnerHTML: { __html: safeMathml }
|
|
1223
1220
|
}
|
|
1224
|
-
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children:
|
|
1221
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children: chunkL3ZIBQEB_js.translationsEn["pptx.textSegment.equationFallback"] });
|
|
1225
1222
|
if (equationNumber) {
|
|
1226
1223
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1227
1224
|
"span",
|
|
@@ -1340,7 +1337,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1340
1337
|
const segmentStyle = segment?.style ?? {};
|
|
1341
1338
|
const textValue = run.text;
|
|
1342
1339
|
const lines = textValue.split("\n");
|
|
1343
|
-
const resolvedSegmentColor =
|
|
1340
|
+
const resolvedSegmentColor = chunkSN5EUDIT_js.normalizeHexColor(
|
|
1344
1341
|
segmentStyle.color || element.textStyle?.color,
|
|
1345
1342
|
run.hyperlink ? HYPERLINK_COLOR : fallbackColor
|
|
1346
1343
|
);
|
|
@@ -1348,16 +1345,16 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1348
1345
|
const baselineFraction = rawBaseline === 0 ? 0 : Math.abs(rawBaseline) >= 1e3 ? rawBaseline / 1e5 : rawBaseline / 100;
|
|
1349
1346
|
const baselineFontScale = baselineFraction !== 0 ? BASELINE_FONT_SCALE : 1;
|
|
1350
1347
|
const rawFontSize = segmentStyle.fontSize || element.textStyle?.fontSize || DEFAULT_TEXT_FONT_SIZE;
|
|
1351
|
-
const baseFontSize = rawFontSize *
|
|
1348
|
+
const baseFontSize = rawFontSize * chunkSN5EUDIT_js.resolveAutoFitFontScale(element.textStyle);
|
|
1352
1349
|
const baselineShift = baselineFraction !== 0 ? `${baselineFraction * baseFontSize}px` : void 0;
|
|
1353
|
-
const fontKerning =
|
|
1350
|
+
const fontKerning = chunkSN5EUDIT_js.resolveFontKerning(segmentStyle.kerning, baseFontSize);
|
|
1354
1351
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
1355
|
-
const baseFontFamily = rawFontFamily ?
|
|
1352
|
+
const baseFontFamily = rawFontFamily ? chunkSN5EUDIT_js.getSubstituteFontFamily(
|
|
1356
1353
|
rawFontFamily,
|
|
1357
|
-
|
|
1354
|
+
chunkSN5EUDIT_js.parsePanoseString(segmentStyle.latinFontPanose ?? element.textStyle?.latinFontPanose)
|
|
1358
1355
|
) : DEFAULT_FONT_FAMILY2;
|
|
1359
|
-
const scriptFonts =
|
|
1360
|
-
const needsScriptFonts =
|
|
1356
|
+
const scriptFonts = chunkSN5EUDIT_js.resolveScriptFontSet(segmentStyle, element.textStyle, baseFontFamily);
|
|
1357
|
+
const needsScriptFonts = chunkSN5EUDIT_js.hasDistinctScriptFonts(scriptFonts);
|
|
1361
1358
|
const authoredLetterSpacing = typeof segmentStyle.characterSpacing === "number" && segmentStyle.characterSpacing !== 0 ? segmentStyle.characterSpacing / 100 * (96 / 72) : 0;
|
|
1362
1359
|
const metricFont = {
|
|
1363
1360
|
fontFamily: baseFontFamily,
|
|
@@ -1365,7 +1362,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1365
1362
|
bold: Boolean(segmentStyle.bold),
|
|
1366
1363
|
italic: Boolean(segmentStyle.italic)
|
|
1367
1364
|
};
|
|
1368
|
-
const nestedStyle =
|
|
1365
|
+
const nestedStyle = chunkSN5EUDIT_js.nestedTextDecorationStyle(run.style);
|
|
1369
1366
|
const metricContext = { font: metricFont, authoredPx: authoredLetterSpacing, nestedStyle };
|
|
1370
1367
|
const spanStyle = { ...run.style };
|
|
1371
1368
|
spanStyle.color = resolvedSegmentColor;
|
|
@@ -1373,11 +1370,11 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1373
1370
|
spanStyle.fontFamily = baseFontFamily;
|
|
1374
1371
|
spanStyle.verticalAlign = baselineShift;
|
|
1375
1372
|
spanStyle.fontKerning = fontKerning;
|
|
1376
|
-
spanStyle.letterSpacing =
|
|
1373
|
+
spanStyle.letterSpacing = chunkSN5EUDIT_js.pieceLetterSpacing(
|
|
1377
1374
|
authoredLetterSpacing,
|
|
1378
|
-
|
|
1375
|
+
chunkSN5EUDIT_js.resolveMetricTrackingPx(textValue, metricFont)
|
|
1379
1376
|
);
|
|
1380
|
-
const hollow =
|
|
1377
|
+
const hollow = chunkSN5EUDIT_js.hollowTextFillStyle(segmentStyle, {
|
|
1381
1378
|
color: resolvedSegmentColor,
|
|
1382
1379
|
textStroke: typeof spanStyle.WebkitTextStroke === "string" ? spanStyle.WebkitTextStroke : void 0
|
|
1383
1380
|
});
|
|
@@ -1390,9 +1387,9 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1390
1387
|
spanStyle.unicodeBidi = runRtl !== ctx.paragraphRtl ? "bidi-override" : "embed";
|
|
1391
1388
|
}
|
|
1392
1389
|
const isUnderlineWords = Boolean(segmentStyle.underline) && segmentStyle.underlineStyle === "words";
|
|
1393
|
-
const wordDecoration = isUnderlineWords ? nestedStyle : void 0;
|
|
1390
|
+
const wordDecoration = isUnderlineWords ? nestedStyle ?? run.underlineWordPieces?.find((piece) => piece.style)?.style : void 0;
|
|
1394
1391
|
if (isUnderlineWords) {
|
|
1395
|
-
const stripped =
|
|
1392
|
+
const stripped = chunkSN5EUDIT_js.stripUnderlineDecoration(spanStyle);
|
|
1396
1393
|
spanStyle.textDecoration = stripped.textDecoration;
|
|
1397
1394
|
delete spanStyle.textDecorationStyle;
|
|
1398
1395
|
delete spanStyle.textDecorationThickness;
|
|
@@ -1408,7 +1405,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1408
1405
|
scriptFonts,
|
|
1409
1406
|
baseFontFamily,
|
|
1410
1407
|
findHighlights,
|
|
1411
|
-
|
|
1408
|
+
chunkSN5EUDIT_js.buildTabContext(
|
|
1412
1409
|
element.textStyle?.tabStops,
|
|
1413
1410
|
element.textStyle?.defaultTabSize,
|
|
1414
1411
|
baseFontSize,
|
|
@@ -1436,7 +1433,7 @@ function renderRubyOrText(run, baseContent) {
|
|
|
1436
1433
|
] });
|
|
1437
1434
|
}
|
|
1438
1435
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick, placeholderPrompt) {
|
|
1439
|
-
if (!
|
|
1436
|
+
if (!chunkSN5EUDIT_js.hasTextProperties(element)) {
|
|
1440
1437
|
return emptyFallback || null;
|
|
1441
1438
|
}
|
|
1442
1439
|
const segments = segmentOverrides ?? element.textSegments;
|
|
@@ -1446,7 +1443,7 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
1446
1443
|
}
|
|
1447
1444
|
return element.text || emptyFallback || "";
|
|
1448
1445
|
}
|
|
1449
|
-
const paragraphs =
|
|
1446
|
+
const paragraphs = chunkSN5EUDIT_js.buildParagraphs(element, fieldContext, segmentOverrides);
|
|
1450
1447
|
const ctx = {
|
|
1451
1448
|
element,
|
|
1452
1449
|
fallbackColor,
|
|
@@ -1572,13 +1569,13 @@ function renderBulletMarker(para, paraIndex, elementId) {
|
|
|
1572
1569
|
);
|
|
1573
1570
|
}
|
|
1574
1571
|
function getDuotoneColors(element) {
|
|
1575
|
-
if (!
|
|
1572
|
+
if (!chunkSN5EUDIT_js.isImageLikeElement(element)) {
|
|
1576
1573
|
return void 0;
|
|
1577
1574
|
}
|
|
1578
1575
|
return element.imageEffects?.duotone;
|
|
1579
1576
|
}
|
|
1580
1577
|
function buildLineShadowCss(element) {
|
|
1581
|
-
if (!
|
|
1578
|
+
if (!chunkSN5EUDIT_js.hasShapeProperties(element)) {
|
|
1582
1579
|
return void 0;
|
|
1583
1580
|
}
|
|
1584
1581
|
const ss = element.shapeStyle;
|
|
@@ -1589,13 +1586,13 @@ function buildLineShadowCss(element) {
|
|
|
1589
1586
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
1590
1587
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
1591
1588
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
1592
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
1593
|
-
|
|
1589
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkSN5EUDIT_js.colorWithOpacity(
|
|
1590
|
+
chunkSN5EUDIT_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
1594
1591
|
opacity
|
|
1595
1592
|
)}`;
|
|
1596
1593
|
}
|
|
1597
1594
|
function buildLineGlowFilter(element) {
|
|
1598
|
-
if (!
|
|
1595
|
+
if (!chunkSN5EUDIT_js.hasShapeProperties(element)) {
|
|
1599
1596
|
return void 0;
|
|
1600
1597
|
}
|
|
1601
1598
|
const ss = element.shapeStyle;
|
|
@@ -1604,22 +1601,22 @@ function buildLineGlowFilter(element) {
|
|
|
1604
1601
|
}
|
|
1605
1602
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
1606
1603
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
1607
|
-
const glowCol =
|
|
1604
|
+
const glowCol = chunkSN5EUDIT_js.colorWithOpacity(chunkSN5EUDIT_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
1608
1605
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
1609
1606
|
}
|
|
1610
1607
|
function getDagDuotoneFilterId(elementId) {
|
|
1611
1608
|
return `dag-duotone-${elementId}`;
|
|
1612
1609
|
}
|
|
1613
1610
|
function hasDagDuotoneEffect(element) {
|
|
1614
|
-
if (!
|
|
1611
|
+
if (!chunkSN5EUDIT_js.hasShapeProperties(element)) {
|
|
1615
1612
|
return false;
|
|
1616
1613
|
}
|
|
1617
1614
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
1618
1615
|
}
|
|
1619
1616
|
function renderDagDuotoneSvgFilter(elementId, color1, color2) {
|
|
1620
1617
|
const filterId = getDagDuotoneFilterId(elementId);
|
|
1621
|
-
const c1 =
|
|
1622
|
-
const c2 =
|
|
1618
|
+
const c1 = chunkSN5EUDIT_js.hexToRgbUnit(color1);
|
|
1619
|
+
const c2 = chunkSN5EUDIT_js.hexToRgbUnit(color2);
|
|
1623
1620
|
const grayscaleMatrix = [
|
|
1624
1621
|
0.2126,
|
|
1625
1622
|
0.7152,
|
|
@@ -1663,7 +1660,7 @@ function renderDagDuotoneSvgFilter(elementId, color1, color2) {
|
|
|
1663
1660
|
|
|
1664
1661
|
// src/viewer/utils/shape-visual-3d.ts
|
|
1665
1662
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
1666
|
-
return
|
|
1663
|
+
return chunkSN5EUDIT_js.build3DExtrusionData(
|
|
1667
1664
|
shape3d,
|
|
1668
1665
|
scene3d,
|
|
1669
1666
|
fillColor,
|
|
@@ -1672,7 +1669,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
1672
1669
|
);
|
|
1673
1670
|
}
|
|
1674
1671
|
function apply3dEffects2(base, scene3d, shape3d, fillColorFallback) {
|
|
1675
|
-
|
|
1672
|
+
chunkSN5EUDIT_js.apply3dEffects(base, scene3d, shape3d, fillColorFallback);
|
|
1676
1673
|
}
|
|
1677
1674
|
|
|
1678
1675
|
// src/viewer/utils/shape-visual-style.ts
|
|
@@ -1680,16 +1677,16 @@ function rendersCustomVectorPath(element) {
|
|
|
1680
1677
|
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;
|
|
1681
1678
|
}
|
|
1682
1679
|
function rendersWedgeCalloutVector(element) {
|
|
1683
|
-
return element.type === "shape" &&
|
|
1680
|
+
return element.type === "shape" && chunkSN5EUDIT_js.isWedgeCalloutPresetShape(element.shapeType);
|
|
1684
1681
|
}
|
|
1685
1682
|
function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _strokeColor, animatesFill, animatesStroke, parentGroupFill) {
|
|
1686
|
-
if (!
|
|
1683
|
+
if (!chunkSN5EUDIT_js.hasShapeProperties(element)) {
|
|
1687
1684
|
return {};
|
|
1688
1685
|
}
|
|
1689
1686
|
const ss = element.shapeStyle;
|
|
1690
|
-
const fill = animatesFill ? void 0 :
|
|
1691
|
-
const fx =
|
|
1692
|
-
const stroke =
|
|
1687
|
+
const fill = animatesFill ? void 0 : chunkSN5EUDIT_js.getComputedFillStyle(element, parentGroupFill);
|
|
1688
|
+
const fx = chunkSN5EUDIT_js.getComputedEffectStyle(element);
|
|
1689
|
+
const stroke = chunkSN5EUDIT_js.getComputedStrokeStyle(element);
|
|
1693
1690
|
const base = {
|
|
1694
1691
|
// A gradient fill REPLACES the solid fill, it does not sit on top of it;
|
|
1695
1692
|
// the whole precedence lives in shared's `getComputedFillStyle`.
|
|
@@ -1728,7 +1725,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1728
1725
|
};
|
|
1729
1726
|
Object.assign(
|
|
1730
1727
|
base,
|
|
1731
|
-
|
|
1728
|
+
chunkSN5EUDIT_js.getAnimationColorBaseStyle(element, {
|
|
1732
1729
|
animatesFill,
|
|
1733
1730
|
animatesStroke,
|
|
1734
1731
|
parentGroupFill
|
|
@@ -1740,7 +1737,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1740
1737
|
base.borderStyle = void 0;
|
|
1741
1738
|
}
|
|
1742
1739
|
apply3dEffects2(base, ss?.scene3d, ss?.shape3d, ss?.fillColor ?? fillColor);
|
|
1743
|
-
if (rendersCustomVectorPath(element) || rendersWedgeCalloutVector(element) ||
|
|
1740
|
+
if (rendersCustomVectorPath(element) || rendersWedgeCalloutVector(element) || chunkSN5EUDIT_js.isStrokeOnlyPresetElement(element)) {
|
|
1744
1741
|
base.backgroundColor = "transparent";
|
|
1745
1742
|
base.backgroundImage = void 0;
|
|
1746
1743
|
base.borderWidth = void 0;
|
|
@@ -1754,7 +1751,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1754
1751
|
if (rendersWedgeCalloutVector(element)) {
|
|
1755
1752
|
return base;
|
|
1756
1753
|
}
|
|
1757
|
-
const geometry =
|
|
1754
|
+
const geometry = chunkSN5EUDIT_js.resolveShapeGeometry(element);
|
|
1758
1755
|
switch (geometry.kind) {
|
|
1759
1756
|
case "bare":
|
|
1760
1757
|
return { backgroundColor: "transparent", borderWidth: 0, borderStyle: "none" };
|
|
@@ -1780,13 +1777,13 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1780
1777
|
function getConnectorAdjustment(element, key, fallback) {
|
|
1781
1778
|
const direct = element.shapeAdjustments?.[key];
|
|
1782
1779
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
1783
|
-
return
|
|
1780
|
+
return chunkSN5EUDIT_js.clampUnitInterval(direct / 1e5);
|
|
1784
1781
|
}
|
|
1785
1782
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
1786
1783
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
1787
|
-
return
|
|
1784
|
+
return chunkSN5EUDIT_js.clampUnitInterval(fallbackKey / 1e5);
|
|
1788
1785
|
}
|
|
1789
|
-
return
|
|
1786
|
+
return chunkSN5EUDIT_js.clampUnitInterval(fallback);
|
|
1790
1787
|
}
|
|
1791
1788
|
function getConnectorPathGeometry(element) {
|
|
1792
1789
|
const width = Math.max(element.width, 0);
|
|
@@ -1912,6 +1909,34 @@ function renderConnectorMarker(markerId, arrowType, color, arrowWidth, arrowLeng
|
|
|
1912
1909
|
}
|
|
1913
1910
|
);
|
|
1914
1911
|
}
|
|
1912
|
+
function renderSvgGradientDefs(gradient) {
|
|
1913
|
+
if (!gradient) {
|
|
1914
|
+
return null;
|
|
1915
|
+
}
|
|
1916
|
+
if (gradient.kind === "rectPath") {
|
|
1917
|
+
return /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("pattern", { id: gradient.id, patternUnits: "objectBoundingBox", width: 1, height: 1, children: /* @__PURE__ */ jsxRuntime.jsx("image", { href: gradient.href, x: 0, y: 0, width: 1, height: 1, preserveAspectRatio: "none" }) }) });
|
|
1918
|
+
}
|
|
1919
|
+
const stops = gradient.stops.map((stop, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1920
|
+
"stop",
|
|
1921
|
+
{
|
|
1922
|
+
offset: stop.offset,
|
|
1923
|
+
stopColor: stop.color,
|
|
1924
|
+
stopOpacity: typeof stop.opacity === "number" ? stop.opacity : void 0
|
|
1925
|
+
},
|
|
1926
|
+
index
|
|
1927
|
+
));
|
|
1928
|
+
return /* @__PURE__ */ jsxRuntime.jsx("defs", { children: gradient.kind === "radial" ? /* @__PURE__ */ jsxRuntime.jsx("radialGradient", { id: gradient.id, cx: gradient.cx, cy: gradient.cy, r: gradient.r, children: stops }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1929
|
+
"linearGradient",
|
|
1930
|
+
{
|
|
1931
|
+
id: gradient.id,
|
|
1932
|
+
x1: gradient.x1,
|
|
1933
|
+
y1: gradient.y1,
|
|
1934
|
+
x2: gradient.x2,
|
|
1935
|
+
y2: gradient.y2,
|
|
1936
|
+
children: stops
|
|
1937
|
+
}
|
|
1938
|
+
) });
|
|
1939
|
+
}
|
|
1915
1940
|
function joinStyle(shapeStyle) {
|
|
1916
1941
|
const lineJoin = shapeStyle?.lineJoin === "bevel" ? "bevel" : shapeStyle?.lineJoin === "miter" ? "miter" : "round";
|
|
1917
1942
|
const miterLimit = lineJoin === "miter" && typeof shapeStyle?.miterLimit === "number" ? Math.max(shapeStyle.miterLimit / 1e5, 1) : void 0;
|
|
@@ -1923,11 +1948,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
|
|
|
1923
1948
|
strokePaint,
|
|
1924
1949
|
strokeWidth,
|
|
1925
1950
|
dashArray,
|
|
1926
|
-
lineCap:
|
|
1951
|
+
lineCap: chunkSN5EUDIT_js.svgLineCap(shapeStyle?.lineCap),
|
|
1927
1952
|
lineJoin,
|
|
1928
1953
|
miterLimit,
|
|
1929
|
-
offsets:
|
|
1930
|
-
widths:
|
|
1954
|
+
offsets: chunkSN5EUDIT_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
1955
|
+
widths: chunkSN5EUDIT_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
|
|
1931
1956
|
};
|
|
1932
1957
|
}
|
|
1933
1958
|
function strokeStrands(d, keyBase, ctx) {
|
|
@@ -1948,39 +1973,14 @@ function strokeStrands(d, keyBase, ctx) {
|
|
|
1948
1973
|
`${keyBase}-s${idx}`
|
|
1949
1974
|
));
|
|
1950
1975
|
}
|
|
1951
|
-
function gradientDefs(gradient) {
|
|
1952
|
-
if (!gradient) {
|
|
1953
|
-
return null;
|
|
1954
|
-
}
|
|
1955
|
-
const stops = gradient.stops.map((stop, idx) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1956
|
-
"stop",
|
|
1957
|
-
{
|
|
1958
|
-
offset: stop.offset,
|
|
1959
|
-
stopColor: stop.color,
|
|
1960
|
-
stopOpacity: typeof stop.opacity === "number" ? stop.opacity : void 0
|
|
1961
|
-
},
|
|
1962
|
-
idx
|
|
1963
|
-
));
|
|
1964
|
-
return /* @__PURE__ */ jsxRuntime.jsx("defs", { children: gradient.kind === "radial" ? /* @__PURE__ */ jsxRuntime.jsx("radialGradient", { id: gradient.id, cx: gradient.cx, cy: gradient.cy, r: gradient.r, children: stops }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1965
|
-
"linearGradient",
|
|
1966
|
-
{
|
|
1967
|
-
id: gradient.id,
|
|
1968
|
-
x1: gradient.x1,
|
|
1969
|
-
y1: gradient.y1,
|
|
1970
|
-
x2: gradient.x2,
|
|
1971
|
-
y2: gradient.y2,
|
|
1972
|
-
children: stops
|
|
1973
|
-
}
|
|
1974
|
-
) });
|
|
1975
|
-
}
|
|
1976
1976
|
function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredPaths, shapeStyle, hasFill, fillColor, fillOpacity, strokePaint, strokeWidth, dashArray, animatesFill = false, gradient) {
|
|
1977
1977
|
const ctx = strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray);
|
|
1978
|
-
const subpaths = structuredPaths && structuredPaths.length > 0 ?
|
|
1978
|
+
const subpaths = structuredPaths && structuredPaths.length > 0 ? chunkSN5EUDIT_js.customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
1979
1979
|
const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
|
|
1980
|
-
const gradientPaint = gradient ?
|
|
1980
|
+
const gradientPaint = gradient ? chunkSN5EUDIT_js.svgGradientFillRef(gradient) : void 0;
|
|
1981
1981
|
const nodes = [];
|
|
1982
1982
|
if (subpaths && needsPerSubpath) {
|
|
1983
|
-
const paints =
|
|
1983
|
+
const paints = chunkSN5EUDIT_js.buildSubpathPaints(subpaths, hasFill, fillColor, fillOpacity);
|
|
1984
1984
|
paints.forEach((paint, idx) => {
|
|
1985
1985
|
if (paint.fill !== "none") {
|
|
1986
1986
|
const mode = subpaths[idx]?.fillMode;
|
|
@@ -2009,7 +2009,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2009
2009
|
"path",
|
|
2010
2010
|
{
|
|
2011
2011
|
d: pathData,
|
|
2012
|
-
fill: animatesFill ? "inherit" : gradientPaint ??
|
|
2012
|
+
fill: animatesFill ? "inherit" : gradientPaint ?? chunkSN5EUDIT_js.colorWithOpacity(fillColor, fillOpacity),
|
|
2013
2013
|
stroke: "none",
|
|
2014
2014
|
vectorEffect: "non-scaling-stroke"
|
|
2015
2015
|
},
|
|
@@ -2028,38 +2028,21 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2028
2028
|
className: "w-full h-full pointer-events-none",
|
|
2029
2029
|
preserveAspectRatio: "none",
|
|
2030
2030
|
children: [
|
|
2031
|
-
animatesFill ? null :
|
|
2031
|
+
animatesFill ? null : renderSvgGradientDefs(gradient),
|
|
2032
2032
|
nodes
|
|
2033
2033
|
]
|
|
2034
2034
|
}
|
|
2035
2035
|
);
|
|
2036
2036
|
}
|
|
2037
|
-
function renderGradientDefs(gradient) {
|
|
2038
|
-
if (!gradient) {
|
|
2039
|
-
return null;
|
|
2040
|
-
}
|
|
2041
|
-
const stops = gradient.stops.map((stop, index) => /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: stop.offset, stopColor: stop.color, stopOpacity: stop.opacity }, index));
|
|
2042
|
-
return /* @__PURE__ */ jsxRuntime.jsx("defs", { children: gradient.kind === "radial" ? /* @__PURE__ */ jsxRuntime.jsx("radialGradient", { id: gradient.id, cx: gradient.cx, cy: gradient.cy, r: gradient.r, children: stops }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2043
|
-
"linearGradient",
|
|
2044
|
-
{
|
|
2045
|
-
id: gradient.id,
|
|
2046
|
-
x1: gradient.x1,
|
|
2047
|
-
y1: gradient.y1,
|
|
2048
|
-
x2: gradient.x2,
|
|
2049
|
-
y2: gradient.y2,
|
|
2050
|
-
children: stops
|
|
2051
|
-
}
|
|
2052
|
-
) });
|
|
2053
|
-
}
|
|
2054
2037
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2055
|
-
if (!
|
|
2038
|
+
if (!chunkSN5EUDIT_js.hasShapeProperties(element)) {
|
|
2056
2039
|
return null;
|
|
2057
2040
|
}
|
|
2058
2041
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
2059
|
-
const fillPaint = animatesFill ? "inherit" :
|
|
2060
|
-
const strokePaint = animatesStroke ? "inherit" :
|
|
2061
|
-
const dashType =
|
|
2062
|
-
const dashArray =
|
|
2042
|
+
const fillPaint = animatesFill ? "inherit" : chunkSN5EUDIT_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
2043
|
+
const strokePaint = animatesStroke ? "inherit" : chunkSN5EUDIT_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
2044
|
+
const dashType = chunkSN5EUDIT_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2045
|
+
const dashArray = chunkSN5EUDIT_js.getSvgStrokeDasharray(
|
|
2063
2046
|
dashType,
|
|
2064
2047
|
Math.max(strokeWidth, 1),
|
|
2065
2048
|
element.shapeStyle?.customDashSegments
|
|
@@ -2140,13 +2123,13 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2140
2123
|
// container's `background-image` is suppressed for custom geometry, so
|
|
2141
2124
|
// without this the shape fell back to the parser's representative solid
|
|
2142
2125
|
// and lost every fade (issue #132).
|
|
2143
|
-
|
|
2126
|
+
chunkSN5EUDIT_js.buildSvgGradientDef(element.shapeStyle, element.id)
|
|
2144
2127
|
);
|
|
2145
2128
|
}
|
|
2146
|
-
if ((element.type === "image" || element.type === "picture") && strokeWidth > 0 && !
|
|
2129
|
+
if ((element.type === "image" || element.type === "picture") && strokeWidth > 0 && !chunkSN5EUDIT_js.buildStrokeOutline(element)) {
|
|
2147
2130
|
const width = Math.max(element.width, 1);
|
|
2148
2131
|
const height = Math.max(element.height, 1);
|
|
2149
|
-
const geometry =
|
|
2132
|
+
const geometry = chunkSN5EUDIT_js.getPresetShapeVectorGeometry(
|
|
2150
2133
|
element.shapeType || "rect",
|
|
2151
2134
|
width,
|
|
2152
2135
|
height,
|
|
@@ -2174,18 +2157,18 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2174
2157
|
);
|
|
2175
2158
|
}
|
|
2176
2159
|
}
|
|
2177
|
-
if (element.type === "shape" &&
|
|
2160
|
+
if (element.type === "shape" && chunkSN5EUDIT_js.isWedgeCalloutPresetShape(element.shapeType)) {
|
|
2178
2161
|
const width = Math.max(element.width, 1);
|
|
2179
2162
|
const height = Math.max(element.height, 1);
|
|
2180
|
-
const geometry =
|
|
2163
|
+
const geometry = chunkSN5EUDIT_js.getPresetShapeVectorGeometry(
|
|
2181
2164
|
element.shapeType,
|
|
2182
2165
|
width,
|
|
2183
2166
|
height,
|
|
2184
2167
|
element.shapeAdjustments
|
|
2185
2168
|
);
|
|
2186
2169
|
if (geometry) {
|
|
2187
|
-
const gradient =
|
|
2188
|
-
const gradientPaint = gradient ?
|
|
2170
|
+
const gradient = chunkSN5EUDIT_js.buildSvgGradientDef(element.shapeStyle, element.id);
|
|
2171
|
+
const gradientPaint = gradient ? chunkSN5EUDIT_js.svgGradientFillRef(gradient) : void 0;
|
|
2189
2172
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2190
2173
|
"svg",
|
|
2191
2174
|
{
|
|
@@ -2201,7 +2184,7 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2201
2184
|
overflow: "visible"
|
|
2202
2185
|
},
|
|
2203
2186
|
children: [
|
|
2204
|
-
animatesFill ? null :
|
|
2187
|
+
animatesFill ? null : renderSvgGradientDefs(gradient),
|
|
2205
2188
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2206
2189
|
"path",
|
|
2207
2190
|
{
|
|
@@ -2218,18 +2201,18 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2218
2201
|
);
|
|
2219
2202
|
}
|
|
2220
2203
|
}
|
|
2221
|
-
if (
|
|
2204
|
+
if (chunkSN5EUDIT_js.isCalloutShape(normalizedType)) {
|
|
2222
2205
|
const width = Math.max(element.width, 1);
|
|
2223
2206
|
const height = Math.max(element.height, 1);
|
|
2224
|
-
const geometry =
|
|
2207
|
+
const geometry = chunkSN5EUDIT_js.getCalloutLeaderLineGeometry(
|
|
2225
2208
|
normalizedType,
|
|
2226
2209
|
width,
|
|
2227
2210
|
height,
|
|
2228
2211
|
element.shapeAdjustments
|
|
2229
2212
|
);
|
|
2230
2213
|
if (geometry && geometry.points.length >= 2) {
|
|
2231
|
-
const leaderPath =
|
|
2232
|
-
const bounds =
|
|
2214
|
+
const leaderPath = chunkSN5EUDIT_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
2215
|
+
const bounds = chunkSN5EUDIT_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
2233
2216
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
2234
2217
|
const offsetLeft = bounds.minX;
|
|
2235
2218
|
const offsetTop = bounds.minY;
|
|
@@ -2292,10 +2275,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2292
2275
|
const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
|
|
2293
2276
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
2294
2277
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
2295
|
-
const connectorLineCap =
|
|
2278
|
+
const connectorLineCap = chunkSN5EUDIT_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
2296
2279
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
2297
|
-
const offsets =
|
|
2298
|
-
const widths =
|
|
2280
|
+
const offsets = chunkSN5EUDIT_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
2281
|
+
const widths = chunkSN5EUDIT_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
2299
2282
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2300
2283
|
"svg",
|
|
2301
2284
|
{
|
|
@@ -2362,15 +2345,15 @@ function parseGradientFillCss(gradFill) {
|
|
|
2362
2345
|
}
|
|
2363
2346
|
const rawStops = stops.map((gs) => {
|
|
2364
2347
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
2365
|
-
const color =
|
|
2366
|
-
const opacity =
|
|
2348
|
+
const color = chunkSN5EUDIT_js.parseDrawingColor(gs) ?? "#888888";
|
|
2349
|
+
const opacity = chunkSN5EUDIT_js.parseDrawingColorOpacity(gs);
|
|
2367
2350
|
return { position: pos, color, opacity };
|
|
2368
2351
|
}).sort((a, b) => a.position - b.position);
|
|
2369
|
-
const stopStrings = rawStops.map((s) => `${
|
|
2352
|
+
const stopStrings = rawStops.map((s) => `${chunkSN5EUDIT_js.colorWithOpacity(s.color, s.opacity)} ${s.position.toFixed(1)}%`).join(", ");
|
|
2370
2353
|
const lin = gradFill["a:lin"];
|
|
2371
2354
|
if (lin) {
|
|
2372
2355
|
const angRaw = Number.parseInt(String(lin["@_ang"] || "0"), 10);
|
|
2373
|
-
const angleDeg = Math.round(
|
|
2356
|
+
const angleDeg = Math.round(chunkSN5EUDIT_js.ooxmlGradientAngleToCssDegrees(angRaw / 6e4));
|
|
2374
2357
|
return `linear-gradient(${angleDeg}deg, ${stopStrings})`;
|
|
2375
2358
|
}
|
|
2376
2359
|
const path = gradFill["a:path"];
|
|
@@ -2384,7 +2367,7 @@ function parseGradientFillCss(gradFill) {
|
|
|
2384
2367
|
b: Number.parseInt(String(fillToRectXml["@_b"] || "0"), 10) / 1e5
|
|
2385
2368
|
} : void 0;
|
|
2386
2369
|
if (pathType === "rect") {
|
|
2387
|
-
return
|
|
2370
|
+
return chunkSN5EUDIT_js.buildRectPathGradient(rawStops, void 0, fillToRect);
|
|
2388
2371
|
}
|
|
2389
2372
|
let cx = 50;
|
|
2390
2373
|
let cy = 50;
|
|
@@ -2406,8 +2389,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
2406
2389
|
if (!pattFill) {
|
|
2407
2390
|
return void 0;
|
|
2408
2391
|
}
|
|
2409
|
-
const fgColor =
|
|
2410
|
-
const bgColor =
|
|
2392
|
+
const fgColor = chunkSN5EUDIT_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
2393
|
+
const bgColor = chunkSN5EUDIT_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
2411
2394
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
2412
2395
|
switch (preset) {
|
|
2413
2396
|
case "ltHorz":
|
|
@@ -2518,11 +2501,11 @@ function parseCellBorders(cellProperties) {
|
|
|
2518
2501
|
const prstDash = ln["a:prstDash"];
|
|
2519
2502
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
2520
2503
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
2521
|
-
const color =
|
|
2504
|
+
const color = chunkSN5EUDIT_js.parseDrawingColor(ln["a:solidFill"]);
|
|
2522
2505
|
if (color) {
|
|
2523
|
-
const opacity =
|
|
2506
|
+
const opacity = chunkSN5EUDIT_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
2524
2507
|
const key = `${edge.prefix}`;
|
|
2525
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
2508
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkSN5EUDIT_js.colorWithOpacity(color, opacity)}`;
|
|
2526
2509
|
}
|
|
2527
2510
|
}
|
|
2528
2511
|
return borderStyle;
|
|
@@ -2535,7 +2518,7 @@ function parseCellTextEffects(runProps) {
|
|
|
2535
2518
|
const textShadowParts = [];
|
|
2536
2519
|
const outerShdw = effectLst["a:outerShdw"];
|
|
2537
2520
|
if (outerShdw) {
|
|
2538
|
-
const shdwColor =
|
|
2521
|
+
const shdwColor = chunkSN5EUDIT_js.parseDrawingColor(outerShdw);
|
|
2539
2522
|
if (shdwColor) {
|
|
2540
2523
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
2541
2524
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -2553,7 +2536,7 @@ function parseCellTextEffects(runProps) {
|
|
|
2553
2536
|
}
|
|
2554
2537
|
const glow = effectLst["a:glow"];
|
|
2555
2538
|
if (glow) {
|
|
2556
|
-
const glowColor =
|
|
2539
|
+
const glowColor = chunkSN5EUDIT_js.parseDrawingColor(glow);
|
|
2557
2540
|
if (glowColor) {
|
|
2558
2541
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
2559
2542
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -2633,10 +2616,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2633
2616
|
if (runProps?.["@_u"] !== void 0) {
|
|
2634
2617
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
2635
2618
|
}
|
|
2636
|
-
const runColor =
|
|
2619
|
+
const runColor = chunkSN5EUDIT_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkSN5EUDIT_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
2637
2620
|
if (runColor) {
|
|
2638
|
-
const opacity =
|
|
2639
|
-
cellStyle.color =
|
|
2621
|
+
const opacity = chunkSN5EUDIT_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
2622
|
+
cellStyle.color = chunkSN5EUDIT_js.colorWithOpacity(runColor, opacity);
|
|
2640
2623
|
}
|
|
2641
2624
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
2642
2625
|
if (fontFamily) {
|
|
@@ -2646,15 +2629,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2646
2629
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
2647
2630
|
}
|
|
2648
2631
|
const cellProperties = cellXml["a:tcPr"];
|
|
2649
|
-
const cellFill =
|
|
2632
|
+
const cellFill = chunkSN5EUDIT_js.parseDrawingColor(
|
|
2650
2633
|
cellProperties?.["a:solidFill"],
|
|
2651
2634
|
schemeColorOverrides
|
|
2652
2635
|
);
|
|
2653
2636
|
if (cellFill) {
|
|
2654
|
-
const opacity =
|
|
2637
|
+
const opacity = chunkSN5EUDIT_js.parseDrawingColorOpacity(
|
|
2655
2638
|
cellProperties?.["a:solidFill"]
|
|
2656
2639
|
);
|
|
2657
|
-
cellStyle.backgroundColor =
|
|
2640
|
+
cellStyle.backgroundColor = chunkSN5EUDIT_js.colorWithOpacity(cellFill, opacity);
|
|
2658
2641
|
} else {
|
|
2659
2642
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
2660
2643
|
if (gradCss) {
|
|
@@ -2669,16 +2652,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2669
2652
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
2670
2653
|
Object.assign(cellStyle, edgeBorders);
|
|
2671
2654
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
2672
|
-
const borderColor =
|
|
2655
|
+
const borderColor = chunkSN5EUDIT_js.parseDrawingColor(
|
|
2673
2656
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
2674
2657
|
schemeColorOverrides
|
|
2675
|
-
) ||
|
|
2658
|
+
) || chunkSN5EUDIT_js.parseDrawingColor(
|
|
2676
2659
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
2677
2660
|
schemeColorOverrides
|
|
2678
|
-
) ||
|
|
2661
|
+
) || chunkSN5EUDIT_js.parseDrawingColor(
|
|
2679
2662
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
2680
2663
|
schemeColorOverrides
|
|
2681
|
-
) ||
|
|
2664
|
+
) || chunkSN5EUDIT_js.parseDrawingColor(
|
|
2682
2665
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
2683
2666
|
schemeColorOverrides
|
|
2684
2667
|
);
|
|
@@ -2750,7 +2733,7 @@ function getTableCellBandStyle2(element, rowIndex, cellIndex, rowCount, columnCo
|
|
|
2750
2733
|
if (element.type !== "table") {
|
|
2751
2734
|
return void 0;
|
|
2752
2735
|
}
|
|
2753
|
-
return
|
|
2736
|
+
return chunkSN5EUDIT_js.getTableCellBandStyle(element.tableData, rowIndex, cellIndex, rowCount, columnCount, {
|
|
2754
2737
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
2755
2738
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
2756
2739
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -2826,7 +2809,7 @@ function renderTableCellContent(cell, fallbackText) {
|
|
|
2826
2809
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2827
2810
|
"span",
|
|
2828
2811
|
{
|
|
2829
|
-
style: { position: "relative", ...
|
|
2812
|
+
style: { position: "relative", ...chunkSN5EUDIT_js.cellRunStyle(run) },
|
|
2830
2813
|
children: run.text
|
|
2831
2814
|
},
|
|
2832
2815
|
`r-${index}`
|
|
@@ -2834,7 +2817,7 @@ function renderTableCellContent(cell, fallbackText) {
|
|
|
2834
2817
|
});
|
|
2835
2818
|
}
|
|
2836
2819
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
2837
|
-
return
|
|
2820
|
+
return chunkSN5EUDIT_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
2838
2821
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
2839
2822
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
2840
2823
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -2967,7 +2950,7 @@ function TableResizeOverlay({
|
|
|
2967
2950
|
const containerRef = React7.useRef(null);
|
|
2968
2951
|
const [rowBounds, setRowBounds] = React7.useState([]);
|
|
2969
2952
|
const dragRef = React7.useRef(null);
|
|
2970
|
-
const colBoundaries = React7.useMemo(() =>
|
|
2953
|
+
const colBoundaries = React7.useMemo(() => chunkSN5EUDIT_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
2971
2954
|
const measureRows = React7.useCallback(() => {
|
|
2972
2955
|
const container = containerRef.current;
|
|
2973
2956
|
if (!container) {
|
|
@@ -3014,11 +2997,11 @@ function TableResizeOverlay({
|
|
|
3014
2997
|
const rect = containerRef.current.getBoundingClientRect();
|
|
3015
2998
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
3016
2999
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
3017
|
-
onResizeColumns(
|
|
3000
|
+
onResizeColumns(chunkSN5EUDIT_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
3018
3001
|
} else if (drag.type === "row" && onResizeRow) {
|
|
3019
3002
|
const deltaY = e.clientY - drag.startPos;
|
|
3020
|
-
const newHeight =
|
|
3021
|
-
drag.initialRowHeight ??
|
|
3003
|
+
const newHeight = chunkSN5EUDIT_js.computeResizedRowHeight(
|
|
3004
|
+
drag.initialRowHeight ?? chunkSN5EUDIT_js.DEFAULT_ROW_HEIGHT,
|
|
3022
3005
|
deltaY
|
|
3023
3006
|
);
|
|
3024
3007
|
onResizeRow(drag.index, newHeight);
|
|
@@ -3056,7 +3039,7 @@ function TableResizeOverlay({
|
|
|
3056
3039
|
e.stopPropagation();
|
|
3057
3040
|
const table = containerRef.current?.querySelector("table");
|
|
3058
3041
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
3059
|
-
const actualHeight = tr?.offsetHeight ??
|
|
3042
|
+
const actualHeight = tr?.offsetHeight ?? chunkSN5EUDIT_js.DEFAULT_ROW_HEIGHT;
|
|
3060
3043
|
document.body.style.cursor = "row-resize";
|
|
3061
3044
|
document.body.style.userSelect = "none";
|
|
3062
3045
|
dragRef.current = {
|
|
@@ -3096,14 +3079,14 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3096
3079
|
const rowCount = tableData.rows.length;
|
|
3097
3080
|
const columnCount = tableData.columnWidths.length;
|
|
3098
3081
|
const selectedCell = options?.selectedCell || null;
|
|
3099
|
-
const isEditable = Boolean(options?.editable) &&
|
|
3082
|
+
const isEditable = Boolean(options?.editable) && chunkSN5EUDIT_js.canDrillDown(element);
|
|
3100
3083
|
const hasCellSelectionHandler = typeof options?.onSelectCell === "function";
|
|
3101
3084
|
const sharedCtx = {
|
|
3102
3085
|
tableStyleMap: options?.styleCtx?.tableStyleMap,
|
|
3103
3086
|
colorScheme: options?.styleCtx?.theme?.colorScheme,
|
|
3104
3087
|
fontScheme: options?.styleCtx?.theme?.fontScheme
|
|
3105
3088
|
};
|
|
3106
|
-
const cellCss = (cell, rowIndex, cellIndex) =>
|
|
3089
|
+
const cellCss = (cell, rowIndex, cellIndex) => chunkSN5EUDIT_js.tableCellCss(
|
|
3107
3090
|
tableData,
|
|
3108
3091
|
cell,
|
|
3109
3092
|
{ rowIndex, cellIndex, rowCount, columnCount },
|
|
@@ -3116,7 +3099,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3116
3099
|
}
|
|
3117
3100
|
const first = selectedCell.selectedCells[0];
|
|
3118
3101
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
3119
|
-
return
|
|
3102
|
+
return chunkSN5EUDIT_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
3120
3103
|
})();
|
|
3121
3104
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3122
3105
|
TableResizeOverlay,
|
|
@@ -3137,9 +3120,9 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3137
3120
|
{
|
|
3138
3121
|
className: "w-full h-full border-collapse table-fixed",
|
|
3139
3122
|
style: {
|
|
3140
|
-
fontFamily:
|
|
3123
|
+
fontFamily: chunkSN5EUDIT_js.DEFAULT_FONT_FAMILY,
|
|
3141
3124
|
// `a:tblPr@rtl` mirrors the column order for RTL decks.
|
|
3142
|
-
...
|
|
3125
|
+
...chunkSN5EUDIT_js.tableContainerCss(tableData)
|
|
3143
3126
|
},
|
|
3144
3127
|
children: [
|
|
3145
3128
|
tableData.columnWidths.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: tableData.columnWidths.map((w, ci) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3158,7 +3141,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3158
3141
|
return null;
|
|
3159
3142
|
}
|
|
3160
3143
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
3161
|
-
const isInMultiSelection =
|
|
3144
|
+
const isInMultiSelection = chunkSN5EUDIT_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
3162
3145
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
3163
3146
|
const diag = getCellDiagonalBorders2(
|
|
3164
3147
|
cell.style,
|
|
@@ -3187,7 +3170,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3187
3170
|
}
|
|
3188
3171
|
event.stopPropagation();
|
|
3189
3172
|
if (event.shiftKey && selectedCell) {
|
|
3190
|
-
const rect =
|
|
3173
|
+
const rect = chunkSN5EUDIT_js.computeSelectionRect(
|
|
3191
3174
|
selectedCell.rowIndex,
|
|
3192
3175
|
selectedCell.columnIndex,
|
|
3193
3176
|
rowIndex,
|
|
@@ -3197,7 +3180,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3197
3180
|
options?.onSelectCell?.({
|
|
3198
3181
|
rowIndex: selectedCell.rowIndex,
|
|
3199
3182
|
columnIndex: selectedCell.columnIndex,
|
|
3200
|
-
selectedCells:
|
|
3183
|
+
selectedCells: chunkSN5EUDIT_js.rectToCells(rect)
|
|
3201
3184
|
});
|
|
3202
3185
|
} else {
|
|
3203
3186
|
options?.onSelectCell?.({
|
|
@@ -3258,10 +3241,10 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3258
3241
|
if (tableEl2.tableData && tableEl2.tableData.rows.length > 0) {
|
|
3259
3242
|
return renderTableFromTableData(tableEl2, textStyle, options);
|
|
3260
3243
|
}
|
|
3261
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
3244
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkL3ZIBQEB_js.translationsEn["pptx.table.title"] });
|
|
3262
3245
|
}
|
|
3263
3246
|
const selectedCell = options?.selectedCell || null;
|
|
3264
|
-
const isEditable = Boolean(options?.editable) &&
|
|
3247
|
+
const isEditable = Boolean(options?.editable) && chunkSN5EUDIT_js.canDrillDown(element);
|
|
3265
3248
|
const hasCellSelectionHandler = typeof options?.onSelectCell === "function";
|
|
3266
3249
|
const tableEl = element;
|
|
3267
3250
|
const xmlSelectionRect = (() => {
|
|
@@ -3273,7 +3256,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3273
3256
|
}
|
|
3274
3257
|
const first = selectedCell.selectedCells[0];
|
|
3275
3258
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
3276
|
-
return
|
|
3259
|
+
return chunkSN5EUDIT_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
3277
3260
|
})();
|
|
3278
3261
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
3279
3262
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3295,9 +3278,9 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3295
3278
|
{
|
|
3296
3279
|
className: "w-full h-full border-collapse table-fixed",
|
|
3297
3280
|
style: {
|
|
3298
|
-
fontFamily:
|
|
3281
|
+
fontFamily: chunkSN5EUDIT_js.DEFAULT_FONT_FAMILY,
|
|
3299
3282
|
// `a:tblPr@rtl` mirrors the column order for RTL decks.
|
|
3300
|
-
...
|
|
3283
|
+
...chunkSN5EUDIT_js.tableContainerCss(tableEl.tableData)
|
|
3301
3284
|
},
|
|
3302
3285
|
children: [
|
|
3303
3286
|
parsedTable.columnPercentages.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: parsedTable.columnPercentages.map((percentage, columnIndex) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3354,7 +3337,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3354
3337
|
color: textStyle.color,
|
|
3355
3338
|
...bandStyle,
|
|
3356
3339
|
...xmlCellStyle,
|
|
3357
|
-
...tdCellOverride ?
|
|
3340
|
+
...tdCellOverride ? chunkSN5EUDIT_js.cellStyleToCss(tdCellOverride) : void 0,
|
|
3358
3341
|
...diag ? { position: "relative" } : void 0
|
|
3359
3342
|
};
|
|
3360
3343
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3364,7 +3347,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3364
3347
|
"border px-1 py-0.5 align-top",
|
|
3365
3348
|
isEditable && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
3366
3349
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
3367
|
-
|
|
3350
|
+
chunkSN5EUDIT_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
3368
3351
|
),
|
|
3369
3352
|
colSpan,
|
|
3370
3353
|
rowSpan: rSpan,
|
|
@@ -3375,7 +3358,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3375
3358
|
}
|
|
3376
3359
|
event.stopPropagation();
|
|
3377
3360
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
3378
|
-
const rect =
|
|
3361
|
+
const rect = chunkSN5EUDIT_js.computeSelectionRect(
|
|
3379
3362
|
selectedCell.rowIndex,
|
|
3380
3363
|
selectedCell.columnIndex,
|
|
3381
3364
|
rowIndex,
|
|
@@ -3385,7 +3368,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3385
3368
|
options?.onSelectCell?.({
|
|
3386
3369
|
rowIndex: selectedCell.rowIndex,
|
|
3387
3370
|
columnIndex: selectedCell.columnIndex,
|
|
3388
|
-
selectedCells:
|
|
3371
|
+
selectedCells: chunkSN5EUDIT_js.rectToCells(rect)
|
|
3389
3372
|
});
|
|
3390
3373
|
} else {
|
|
3391
3374
|
options?.onSelectCell?.({
|
|
@@ -3444,23 +3427,23 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3444
3427
|
);
|
|
3445
3428
|
}
|
|
3446
3429
|
function partAttrs(part) {
|
|
3447
|
-
return part ?
|
|
3430
|
+
return part ? chunkSN5EUDIT_js.chartPartToAttrs(part) : void 0;
|
|
3448
3431
|
}
|
|
3449
3432
|
function resolveReactPalette(chartData) {
|
|
3450
3433
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
3451
3434
|
return chartData.colorPalette;
|
|
3452
3435
|
}
|
|
3453
|
-
return [...
|
|
3436
|
+
return [...chunkSN5EUDIT_js.getChartStylePalette(chartData.style?.styleId)];
|
|
3454
3437
|
}
|
|
3455
3438
|
function buildReactChartViewModel(element) {
|
|
3456
3439
|
if (element.type !== "chart" || !element.chartData) {
|
|
3457
|
-
return
|
|
3440
|
+
return chunkSN5EUDIT_js.buildChartViewModel(element);
|
|
3458
3441
|
}
|
|
3459
3442
|
const palette = resolveReactPalette(element.chartData), themedElement = {
|
|
3460
3443
|
...element,
|
|
3461
3444
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
3462
3445
|
};
|
|
3463
|
-
return
|
|
3446
|
+
return chunkSN5EUDIT_js.buildChartViewModel(themedElement);
|
|
3464
3447
|
}
|
|
3465
3448
|
function renderPrimitive(prim, key) {
|
|
3466
3449
|
switch (prim.kind) {
|
|
@@ -3609,7 +3592,7 @@ function renderText(t, key) {
|
|
|
3609
3592
|
);
|
|
3610
3593
|
}
|
|
3611
3594
|
function renderChartViewModel(elementId, vm, preserveAspectRatio = "none") {
|
|
3612
|
-
const legendItems =
|
|
3595
|
+
const legendItems = chunkSN5EUDIT_js.computeChartLegendLayout(vm);
|
|
3613
3596
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3614
3597
|
"svg",
|
|
3615
3598
|
{
|
|
@@ -3662,7 +3645,18 @@ function renderChartViewModel(elementId, vm, preserveAspectRatio = "none") {
|
|
|
3662
3645
|
fontFamily: vm.titleStyle?.fontFamily,
|
|
3663
3646
|
fill: vm.titleStyle?.fill ?? "#1e293b",
|
|
3664
3647
|
"data-chart-part": "title",
|
|
3665
|
-
children: vm.
|
|
3648
|
+
children: vm.titleRunSpans && vm.titleRunSpans.length > 0 ? vm.titleRunSpans.map((run, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3649
|
+
"tspan",
|
|
3650
|
+
{
|
|
3651
|
+
fontSize: run.fontSize,
|
|
3652
|
+
fontWeight: run.fontWeight,
|
|
3653
|
+
fontStyle: run.fontStyle,
|
|
3654
|
+
fontFamily: run.fontFamily,
|
|
3655
|
+
fill: run.fill,
|
|
3656
|
+
children: run.text
|
|
3657
|
+
},
|
|
3658
|
+
`${elementId}-title-run-${i}`
|
|
3659
|
+
)) : vm.title
|
|
3666
3660
|
}
|
|
3667
3661
|
),
|
|
3668
3662
|
vm.gridlines.map((gl, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3736,17 +3730,17 @@ function renderChartViewModel(elementId, vm, preserveAspectRatio = "none") {
|
|
|
3736
3730
|
}
|
|
3737
3731
|
function renderChartElement(element) {
|
|
3738
3732
|
if (element.type !== "chart") {
|
|
3739
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
3733
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkL3ZIBQEB_js.translationsEn["pptx.chart.heading"] });
|
|
3740
3734
|
}
|
|
3741
3735
|
const chartData = element.chartData;
|
|
3742
3736
|
if (!chartData || chartData.series.length === 0) {
|
|
3743
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
3737
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkL3ZIBQEB_js.translationsEn["pptx.chart.heading"] });
|
|
3744
3738
|
}
|
|
3745
|
-
const kind =
|
|
3739
|
+
const kind = chunkSN5EUDIT_js.resolveChartKind(chartData.chartType ?? "bar");
|
|
3746
3740
|
return renderChartViewModel(
|
|
3747
3741
|
element.id,
|
|
3748
3742
|
buildReactChartViewModel(element),
|
|
3749
|
-
|
|
3743
|
+
chunkSN5EUDIT_js.chartPreserveAspectRatio(kind)
|
|
3750
3744
|
);
|
|
3751
3745
|
}
|
|
3752
3746
|
|
|
@@ -3766,14 +3760,14 @@ function buildNotesPdf(pages) {
|
|
|
3766
3760
|
notes: page.notes,
|
|
3767
3761
|
slideNumber: page.slideNumber
|
|
3768
3762
|
}));
|
|
3769
|
-
const bytes =
|
|
3763
|
+
const bytes = chunkSN5EUDIT_js.buildNotesPdfBytes(images, meta);
|
|
3770
3764
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
3771
3765
|
return URL.createObjectURL(blob);
|
|
3772
3766
|
}
|
|
3773
3767
|
|
|
3774
3768
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
3775
3769
|
function buildPdfFromImageData(images) {
|
|
3776
|
-
const bytes =
|
|
3770
|
+
const bytes = chunkSN5EUDIT_js.buildSlidesPdfBytes(images);
|
|
3777
3771
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
3778
3772
|
return URL.createObjectURL(blob);
|
|
3779
3773
|
}
|
|
@@ -3782,7 +3776,7 @@ function buildPdfFromImageData(images) {
|
|
|
3782
3776
|
var activePreview = null;
|
|
3783
3777
|
function startPreviewAnimation(elementId, preset, options) {
|
|
3784
3778
|
stopPreviewAnimation();
|
|
3785
|
-
const descriptor =
|
|
3779
|
+
const descriptor = chunkSN5EUDIT_js.buildPreviewAnimation(preset, options);
|
|
3786
3780
|
if (!descriptor) {
|
|
3787
3781
|
return;
|
|
3788
3782
|
}
|
|
@@ -3795,7 +3789,7 @@ function startMotionPathPreview(elementId, path, options) {
|
|
|
3795
3789
|
return;
|
|
3796
3790
|
}
|
|
3797
3791
|
const stage = domEl.offsetParent;
|
|
3798
|
-
const descriptor =
|
|
3792
|
+
const descriptor = chunkSN5EUDIT_js.buildMotionPathPreview({
|
|
3799
3793
|
path,
|
|
3800
3794
|
slideWidth: stage?.offsetWidth || DEFAULT_PREVIEW_SLIDE_WIDTH,
|
|
3801
3795
|
slideHeight: stage?.offsetHeight || DEFAULT_PREVIEW_SLIDE_HEIGHT,
|
|
@@ -3874,7 +3868,6 @@ exports.SHAPE_PRESETS = SHAPE_PRESETS;
|
|
|
3874
3868
|
exports.SHORTCUT_REFERENCE_ITEMS = SHORTCUT_REFERENCE_ITEMS;
|
|
3875
3869
|
exports.SLIDE_NAV_THUMBNAIL_WIDTH = SLIDE_NAV_THUMBNAIL_WIDTH;
|
|
3876
3870
|
exports.STROKE_DASH_OPTIONS = STROKE_DASH_OPTIONS2;
|
|
3877
|
-
exports.THEME_COLOR_SWATCHES = THEME_COLOR_SWATCHES;
|
|
3878
3871
|
exports.TOOLBAR_SECTIONS = TOOLBAR_SECTIONS;
|
|
3879
3872
|
exports.UNGROUPED_SECTION_ID = UNGROUPED_SECTION_ID;
|
|
3880
3873
|
exports.ZOOM_TO_SELECTION_PADDING = ZOOM_TO_SELECTION_PADDING;
|