pptx-react-viewer 3.5.3 → 3.6.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 +12 -0
- package/dist/{AiChatPanel-ZEM3ZVA6.js → AiChatPanel-LEOEDIW2.js} +25 -25
- package/dist/AiChatPanel-LEOEDIW2.js.br +0 -0
- package/dist/AiChatPanel-LEOEDIW2.js.gz +0 -0
- package/dist/{AiChatPanel-L2HGGEND.mjs → AiChatPanel-WRQGJJVD.mjs} +4 -4
- package/dist/AiChatPanel-WRQGJJVD.mjs.br +0 -0
- package/dist/AiChatPanel-WRQGJJVD.mjs.gz +0 -0
- package/dist/{Area3DChartScene-I7LMTNK5.js → Area3DChartScene-3TJ2GTGI.js} +2 -2
- package/dist/Area3DChartScene-3TJ2GTGI.js.br +0 -0
- package/dist/Area3DChartScene-3TJ2GTGI.js.gz +0 -0
- package/dist/{Area3DChartScene-EYNCHRB3.mjs → Area3DChartScene-SJC2ZB6R.mjs} +1 -1
- package/dist/{Line3DChartScene-QYBKXNOD.mjs.br → Area3DChartScene-SJC2ZB6R.mjs.br} +1 -1
- package/dist/Area3DChartScene-SJC2ZB6R.mjs.gz +0 -0
- package/dist/{Bar3DChartScene-VPKQDPIO.js → Bar3DChartScene-2ZGOMOZO.js} +2 -2
- package/dist/Bar3DChartScene-2ZGOMOZO.js.br +0 -0
- package/dist/Bar3DChartScene-2ZGOMOZO.js.gz +0 -0
- package/dist/{Bar3DChartScene-6HQ6QWNB.mjs → Bar3DChartScene-SPER4LQA.mjs} +1 -1
- package/dist/{Bar3DChartScene-6HQ6QWNB.mjs.br → Bar3DChartScene-SPER4LQA.mjs.br} +0 -0
- package/dist/Bar3DChartScene-SPER4LQA.mjs.gz +0 -0
- package/dist/{Line3DChartScene-VV362RMX.js → Line3DChartScene-42FYFGLU.js} +2 -2
- package/dist/Line3DChartScene-42FYFGLU.js.br +0 -0
- package/dist/Line3DChartScene-42FYFGLU.js.gz +0 -0
- package/dist/{Line3DChartScene-QYBKXNOD.mjs → Line3DChartScene-FH3YHPXE.mjs} +1 -1
- package/dist/{Area3DChartScene-EYNCHRB3.mjs.br → Line3DChartScene-FH3YHPXE.mjs.br} +1 -1
- package/dist/Line3DChartScene-FH3YHPXE.mjs.gz +0 -0
- package/dist/{Model3DScene-YTLWTG52.mjs → Model3DScene-2BCR2YYD.mjs} +1 -1
- package/dist/{Model3DScene-YTLWTG52.mjs.br → Model3DScene-2BCR2YYD.mjs.br} +0 -0
- package/dist/Model3DScene-2BCR2YYD.mjs.gz +0 -0
- package/dist/{Model3DScene-XA57KXA5.js → Model3DScene-EIU2GVUZ.js} +2 -2
- package/dist/Model3DScene-EIU2GVUZ.js.br +0 -0
- package/dist/Model3DScene-EIU2GVUZ.js.gz +0 -0
- package/dist/{PieChart3DScene-INBL4F5Z.mjs → PieChart3DScene-QFQUJFDP.mjs} +1 -1
- package/dist/{PieChart3DScene-INBL4F5Z.mjs.br → PieChart3DScene-QFQUJFDP.mjs.br} +0 -0
- package/dist/PieChart3DScene-QFQUJFDP.mjs.gz +0 -0
- package/dist/{PieChart3DScene-IFZMTN5H.js → PieChart3DScene-VQOHZPHI.js} +2 -2
- package/dist/PieChart3DScene-VQOHZPHI.js.br +0 -0
- package/dist/PieChart3DScene-VQOHZPHI.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-EV6DBPJS.mjs → SurfaceChart3DScene-CGXMRBCL.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-EV6DBPJS.mjs.br → SurfaceChart3DScene-CGXMRBCL.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-CGXMRBCL.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-FRSZVIVB.js → SurfaceChart3DScene-FTVXZN6O.js} +2 -2
- package/dist/SurfaceChart3DScene-FTVXZN6O.js.br +0 -0
- package/dist/SurfaceChart3DScene-FTVXZN6O.js.gz +0 -0
- package/dist/{chunk-QA573RUB.js → chunk-7VPDHSWF.js} +330 -349
- package/dist/chunk-7VPDHSWF.js.br +0 -0
- package/dist/chunk-7VPDHSWF.js.gz +0 -0
- package/dist/{chunk-HHDPQJF3.js → chunk-AL2KLPOJ.js} +32437 -22179
- package/dist/chunk-AL2KLPOJ.js.br +0 -0
- package/dist/chunk-AL2KLPOJ.js.gz +0 -0
- package/dist/{chunk-7AL6KAFX.mjs → chunk-FG5VQFWP.mjs} +193 -71
- package/dist/chunk-FG5VQFWP.mjs.br +0 -0
- package/dist/chunk-FG5VQFWP.mjs.gz +0 -0
- package/dist/{chunk-UTIMT5CZ.js → chunk-MZI4DG3S.js} +12 -0
- package/dist/chunk-MZI4DG3S.js.br +0 -0
- package/dist/{chunk-UTIMT5CZ.js.gz → chunk-MZI4DG3S.js.gz} +0 -0
- package/dist/{chunk-PPL3WBC7.js → chunk-NFOOONND.js} +1359 -1237
- package/dist/chunk-NFOOONND.js.br +0 -0
- package/dist/chunk-NFOOONND.js.gz +0 -0
- package/dist/{chunk-MSRRBA7G.mjs → chunk-T3V5FBXJ.mjs} +29 -1
- package/dist/chunk-T3V5FBXJ.mjs.br +0 -0
- package/dist/chunk-T3V5FBXJ.mjs.gz +0 -0
- package/dist/{chunk-JCJ3EPG6.mjs → chunk-TGCSZXOG.mjs} +12 -0
- package/dist/chunk-TGCSZXOG.mjs.br +0 -0
- package/dist/{chunk-JCJ3EPG6.mjs.gz → chunk-TGCSZXOG.mjs.gz} +0 -0
- package/dist/{chunk-3WM5TUY7.mjs → chunk-VYNICQ4O.mjs} +58 -37
- package/dist/chunk-VYNICQ4O.mjs.br +0 -0
- package/dist/chunk-VYNICQ4O.mjs.gz +0 -0
- package/dist/{chunk-KOLCCOTS.mjs → chunk-WX7AFFBZ.mjs} +142 -161
- package/dist/chunk-WX7AFFBZ.mjs.br +0 -0
- package/dist/chunk-WX7AFFBZ.mjs.gz +0 -0
- package/dist/{chunk-SIM2LXO2.js → chunk-ZHSBMG37.js} +490 -469
- package/dist/chunk-ZHSBMG37.js.br +0 -0
- package/dist/chunk-ZHSBMG37.js.gz +0 -0
- package/dist/{chunk-QPHGHUUJ.mjs → chunk-ZUSYUWOV.mjs} +32414 -22179
- package/dist/chunk-ZUSYUWOV.mjs.br +0 -0
- package/dist/chunk-ZUSYUWOV.mjs.gz +0 -0
- package/dist/{chunk-BBSFZLYI.js → chunk-ZWPHUPL4.js} +33 -5
- package/dist/chunk-ZWPHUPL4.js.br +0 -0
- package/dist/chunk-ZWPHUPL4.js.gz +0 -0
- package/dist/i18n.js +4 -4
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.d.ts +599 -33
- 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 +610 -33
- 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/{useViewerBuildingBlocks-f6oNGKMX.d.ts → useViewerBuildingBlocks-C8F_4Pzb.d.ts} +3 -1
- package/dist/useViewerBuildingBlocks-C8F_4Pzb.d.ts.map +1 -0
- package/dist/viewer/index.d.ts +552 -33
- 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 +1 -1
- package/dist/AiChatPanel-L2HGGEND.mjs.br +0 -0
- package/dist/AiChatPanel-L2HGGEND.mjs.gz +0 -0
- package/dist/AiChatPanel-ZEM3ZVA6.js.br +0 -0
- package/dist/AiChatPanel-ZEM3ZVA6.js.gz +0 -0
- package/dist/Area3DChartScene-EYNCHRB3.mjs.gz +0 -0
- package/dist/Area3DChartScene-I7LMTNK5.js.br +0 -0
- package/dist/Area3DChartScene-I7LMTNK5.js.gz +0 -0
- package/dist/Bar3DChartScene-6HQ6QWNB.mjs.gz +0 -0
- package/dist/Bar3DChartScene-VPKQDPIO.js.br +0 -0
- package/dist/Bar3DChartScene-VPKQDPIO.js.gz +0 -0
- package/dist/Line3DChartScene-QYBKXNOD.mjs.gz +0 -0
- package/dist/Line3DChartScene-VV362RMX.js.br +0 -0
- package/dist/Line3DChartScene-VV362RMX.js.gz +0 -0
- package/dist/Model3DScene-XA57KXA5.js.br +0 -0
- package/dist/Model3DScene-XA57KXA5.js.gz +0 -0
- package/dist/Model3DScene-YTLWTG52.mjs.gz +0 -0
- package/dist/PieChart3DScene-IFZMTN5H.js.br +0 -0
- package/dist/PieChart3DScene-IFZMTN5H.js.gz +0 -0
- package/dist/PieChart3DScene-INBL4F5Z.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-EV6DBPJS.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-FRSZVIVB.js.br +0 -0
- package/dist/SurfaceChart3DScene-FRSZVIVB.js.gz +0 -0
- package/dist/chunk-3WM5TUY7.mjs.br +0 -0
- package/dist/chunk-3WM5TUY7.mjs.gz +0 -0
- package/dist/chunk-7AL6KAFX.mjs.br +0 -0
- package/dist/chunk-7AL6KAFX.mjs.gz +0 -0
- package/dist/chunk-BBSFZLYI.js.br +0 -0
- package/dist/chunk-BBSFZLYI.js.gz +0 -0
- package/dist/chunk-HHDPQJF3.js.br +0 -0
- package/dist/chunk-HHDPQJF3.js.gz +0 -0
- package/dist/chunk-JCJ3EPG6.mjs.br +0 -0
- package/dist/chunk-KOLCCOTS.mjs.br +0 -0
- package/dist/chunk-KOLCCOTS.mjs.gz +0 -0
- package/dist/chunk-MSRRBA7G.mjs.br +0 -0
- package/dist/chunk-MSRRBA7G.mjs.gz +0 -0
- package/dist/chunk-PPL3WBC7.js.br +0 -0
- package/dist/chunk-PPL3WBC7.js.gz +0 -0
- package/dist/chunk-QA573RUB.js.br +0 -0
- package/dist/chunk-QA573RUB.js.gz +0 -0
- package/dist/chunk-QPHGHUUJ.mjs.br +0 -0
- package/dist/chunk-QPHGHUUJ.mjs.gz +0 -0
- package/dist/chunk-SIM2LXO2.js.br +0 -0
- package/dist/chunk-SIM2LXO2.js.gz +0 -0
- package/dist/chunk-UTIMT5CZ.js.br +0 -0
- package/dist/useViewerBuildingBlocks-f6oNGKMX.d.ts.map +0 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkAL2KLPOJ_js = require('./chunk-AL2KLPOJ.js');
|
|
4
|
+
var chunkMZI4DG3S_js = require('./chunk-MZI4DG3S.js');
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var tailwindMerge = require('tailwind-merge');
|
|
7
|
-
var
|
|
7
|
+
var React7 = require('react');
|
|
8
8
|
var lu = require('react-icons/lu');
|
|
9
9
|
var jsxRuntime = require('react/jsx-runtime');
|
|
10
10
|
var reactI18next = require('react-i18next');
|
|
11
11
|
|
|
12
12
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
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 chunkAL2KLPOJ_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 chunkAL2KLPOJ_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 = chunkAL2KLPOJ_js.VIEWER_SHORTCUT_REFERENCE;
|
|
65
65
|
|
|
66
66
|
// src/viewer/constants/theme.ts
|
|
67
67
|
var THEME_COLOR_SWATCHES = [
|
|
@@ -105,12 +105,12 @@ var GLYPH_COMPONENTS = {
|
|
|
105
105
|
plus: lu.LuPlus,
|
|
106
106
|
triangle: lu.LuTriangle
|
|
107
107
|
};
|
|
108
|
-
var SHAPE_PRESETS =
|
|
108
|
+
var SHAPE_PRESETS = chunkAL2KLPOJ_js.SHAPE_PRESET_DEFS.map(
|
|
109
109
|
(def) => ({
|
|
110
110
|
type: def.type,
|
|
111
111
|
label: def.label,
|
|
112
112
|
i18nKey: def.i18nKey,
|
|
113
|
-
icon:
|
|
113
|
+
icon: React7__default.default.createElement(GLYPH_COMPONENTS[def.glyph], {
|
|
114
114
|
className: def.glyphClass ? `w-3.5 h-3.5 ${def.glyphClass}` : "w-3.5 h-3.5"
|
|
115
115
|
})
|
|
116
116
|
})
|
|
@@ -130,7 +130,7 @@ var ARROW_SIZE_OPTIONS = [
|
|
|
130
130
|
{ value: "med", label: "Medium", i18nKey: "pptx.connectorOptions.sizeMedium" },
|
|
131
131
|
{ value: "lg", label: "Large", i18nKey: "pptx.connectorOptions.sizeLarge" }
|
|
132
132
|
];
|
|
133
|
-
var STROKE_DASH_OPTIONS2 =
|
|
133
|
+
var STROKE_DASH_OPTIONS2 = chunkAL2KLPOJ_js.STROKE_DASH_OPTIONS;
|
|
134
134
|
|
|
135
135
|
// src/viewer/utils/shape-types.tsx
|
|
136
136
|
function getShapeType(shapeType) {
|
|
@@ -239,7 +239,7 @@ function isConnectorOrLineElement(element) {
|
|
|
239
239
|
if (element.type === "connector") {
|
|
240
240
|
return true;
|
|
241
241
|
}
|
|
242
|
-
if (!
|
|
242
|
+
if (!chunkAL2KLPOJ_js.hasShapeProperties(element)) {
|
|
243
243
|
return false;
|
|
244
244
|
}
|
|
245
245
|
const st = getShapeType(element.shapeType);
|
|
@@ -248,17 +248,17 @@ function isConnectorOrLineElement(element) {
|
|
|
248
248
|
|
|
249
249
|
// src/viewer/utils/image-style.ts
|
|
250
250
|
function getImageMaskStyle(element) {
|
|
251
|
-
if (!
|
|
251
|
+
if (!chunkAL2KLPOJ_js.hasShapeProperties(element)) {
|
|
252
252
|
return void 0;
|
|
253
253
|
}
|
|
254
|
-
const geometry =
|
|
254
|
+
const geometry = chunkAL2KLPOJ_js.resolveShapeGeometry(element);
|
|
255
255
|
if (geometry.kind === "borderRadius") {
|
|
256
256
|
return { borderRadius: geometry.radius };
|
|
257
257
|
}
|
|
258
258
|
return geometry.kind === "clipPath" ? { clipPath: geometry.clipPath } : void 0;
|
|
259
259
|
}
|
|
260
260
|
function getImageRenderStyle(element) {
|
|
261
|
-
const fit =
|
|
261
|
+
const fit = chunkAL2KLPOJ_js.getImageFitStyle(element);
|
|
262
262
|
return {
|
|
263
263
|
// A translated/scaled crop must be masked by its stationary wrapper, not
|
|
264
264
|
// by the moving bitmap itself.
|
|
@@ -275,7 +275,7 @@ function getImageSurfaceMaskStyle(element) {
|
|
|
275
275
|
};
|
|
276
276
|
}
|
|
277
277
|
function getImageSurfaceStyle(element) {
|
|
278
|
-
const fill =
|
|
278
|
+
const fill = chunkAL2KLPOJ_js.hasShapeProperties(element) ? chunkAL2KLPOJ_js.getComputedFillStyle(element) : void 0;
|
|
279
279
|
return {
|
|
280
280
|
position: "absolute",
|
|
281
281
|
inset: 0,
|
|
@@ -288,13 +288,13 @@ function getImageSurfaceStyle(element) {
|
|
|
288
288
|
};
|
|
289
289
|
}
|
|
290
290
|
function getCropShapeClipPath2(element) {
|
|
291
|
-
if (!
|
|
291
|
+
if (!chunkAL2KLPOJ_js.isImageLikeElement(element)) {
|
|
292
292
|
return void 0;
|
|
293
293
|
}
|
|
294
|
-
return
|
|
294
|
+
return chunkAL2KLPOJ_js.getCropShapeClipPath(element.cropShape, element.width, element.height);
|
|
295
295
|
}
|
|
296
296
|
function getImageTilingStyle2(element) {
|
|
297
|
-
return
|
|
297
|
+
return chunkAL2KLPOJ_js.getImageTilingStyle(element);
|
|
298
298
|
}
|
|
299
299
|
|
|
300
300
|
// src/viewer/utils/geometry-image.ts
|
|
@@ -336,24 +336,14 @@ function ensureArrayValue(value) {
|
|
|
336
336
|
// src/viewer/utils/media-persistent-audio.tsx
|
|
337
337
|
function buildTrimFragment(element) {
|
|
338
338
|
const start = element.trimStartMs;
|
|
339
|
-
|
|
340
|
-
if (start === void 0 && end === void 0) {
|
|
339
|
+
if (start === void 0 || start <= 0) {
|
|
341
340
|
return "";
|
|
342
341
|
}
|
|
343
|
-
|
|
344
|
-
if (start !== void 0 && start > 0) {
|
|
345
|
-
parts.push((start / 1e3).toFixed(3));
|
|
346
|
-
} else {
|
|
347
|
-
parts.push("");
|
|
348
|
-
}
|
|
349
|
-
if (end !== void 0 && end > 0) {
|
|
350
|
-
parts.push((end / 1e3).toFixed(3));
|
|
351
|
-
}
|
|
352
|
-
return parts.length > 0 ? `#t=${parts.join(",")}` : "";
|
|
342
|
+
return `#t=${(start / 1e3).toFixed(3)}`;
|
|
353
343
|
}
|
|
354
344
|
function useMediaMetadataExtraction(mediaRef, element) {
|
|
355
|
-
const [metadata, setMetadata] =
|
|
356
|
-
|
|
345
|
+
const [metadata, setMetadata] = React7.useState(element.metadata);
|
|
346
|
+
React7.useEffect(() => {
|
|
357
347
|
const el = mediaRef.current;
|
|
358
348
|
if (!el) {
|
|
359
349
|
return;
|
|
@@ -436,7 +426,7 @@ function VideoWithMetadata({
|
|
|
436
426
|
{
|
|
437
427
|
ref: mediaRef,
|
|
438
428
|
className: "w-full h-full pointer-events-auto",
|
|
439
|
-
style: isFullScreen ? { objectFit: "cover" } :
|
|
429
|
+
style: isFullScreen ? { objectFit: "cover" } : chunkAL2KLPOJ_js.getImageFitStyle(element),
|
|
440
430
|
controls: showTransport,
|
|
441
431
|
preload: "metadata",
|
|
442
432
|
playsInline: true,
|
|
@@ -489,49 +479,33 @@ function PresentationMediaController({
|
|
|
489
479
|
children
|
|
490
480
|
}) {
|
|
491
481
|
const { t } = reactI18next.useTranslation();
|
|
492
|
-
const mediaRef =
|
|
493
|
-
const
|
|
494
|
-
const trimTimerRef = React6.useRef(null);
|
|
495
|
-
const [isMediaPlaying, setIsMediaPlaying] = React6.useState(false);
|
|
496
|
-
const volume = element.volume ?? 1;
|
|
497
|
-
const fadeIn = element.fadeInDuration ?? 0;
|
|
498
|
-
const fadeOut = element.fadeOutDuration ?? 0;
|
|
482
|
+
const mediaRef = React7.useRef(null);
|
|
483
|
+
const [isMediaPlaying, setIsMediaPlaying] = React7.useState(false);
|
|
499
484
|
const trimStartSec = element.trimStartMs !== void 0 ? element.trimStartMs / 1e3 : 0;
|
|
500
|
-
const trimEndSec = element.trimEndMs !== void 0 && element.trimEndMs > 0 ? element.trimEndMs / 1e3 : 0;
|
|
501
485
|
const hideWhenNotPlaying = isPresentationMode && element.hideWhenNotPlaying === true;
|
|
502
|
-
|
|
503
|
-
return () => {
|
|
504
|
-
if (fadeTimerRef.current !== null) {
|
|
505
|
-
cancelAnimationFrame(fadeTimerRef.current);
|
|
506
|
-
}
|
|
507
|
-
if (trimTimerRef.current !== null) {
|
|
508
|
-
window.clearTimeout(trimTimerRef.current);
|
|
509
|
-
}
|
|
510
|
-
};
|
|
511
|
-
}, []);
|
|
512
|
-
const { volume: playbackVolume, playbackRate } = chunkHHDPQJF3_js.mediaPlaybackAttributes({
|
|
486
|
+
const { volume: playbackVolume, playbackRate } = chunkAL2KLPOJ_js.mediaPlaybackAttributes({
|
|
513
487
|
loop: element.loop,
|
|
514
488
|
volume: element.volume,
|
|
515
489
|
playbackSpeed: element.playbackSpeed
|
|
516
490
|
});
|
|
517
|
-
|
|
491
|
+
React7.useEffect(() => {
|
|
518
492
|
const el = mediaRef.current;
|
|
519
493
|
if (el) {
|
|
520
494
|
el.volume = playbackVolume;
|
|
521
495
|
}
|
|
522
496
|
}, [playbackVolume]);
|
|
523
|
-
|
|
497
|
+
React7.useEffect(() => {
|
|
524
498
|
const el = mediaRef.current;
|
|
525
499
|
if (el) {
|
|
526
500
|
el.playbackRate = playbackRate;
|
|
527
501
|
}
|
|
528
502
|
}, [playbackRate]);
|
|
529
|
-
|
|
503
|
+
React7.useEffect(() => {
|
|
530
504
|
const el = mediaRef.current;
|
|
531
505
|
if (!el) {
|
|
532
506
|
return;
|
|
533
507
|
}
|
|
534
|
-
const
|
|
508
|
+
const handlePlay = () => {
|
|
535
509
|
setIsMediaPlaying(true);
|
|
536
510
|
onPlayStateChange?.(true);
|
|
537
511
|
};
|
|
@@ -543,108 +517,42 @@ function PresentationMediaController({
|
|
|
543
517
|
setIsMediaPlaying(false);
|
|
544
518
|
onPlayStateChange?.(false);
|
|
545
519
|
};
|
|
546
|
-
el.addEventListener("play",
|
|
520
|
+
el.addEventListener("play", handlePlay);
|
|
547
521
|
el.addEventListener("pause", handlePause);
|
|
548
522
|
el.addEventListener("ended", handleEnded);
|
|
549
523
|
return () => {
|
|
550
|
-
el.removeEventListener("play",
|
|
524
|
+
el.removeEventListener("play", handlePlay);
|
|
551
525
|
el.removeEventListener("pause", handlePause);
|
|
552
526
|
el.removeEventListener("ended", handleEnded);
|
|
553
527
|
};
|
|
554
528
|
}, [onPlayStateChange]);
|
|
555
|
-
|
|
556
|
-
const el = mediaRef.current;
|
|
557
|
-
if (!el || fadeIn <= 0) {
|
|
558
|
-
return;
|
|
559
|
-
}
|
|
560
|
-
const startTime = performance.now();
|
|
561
|
-
const durationMs = fadeIn * 1e3;
|
|
562
|
-
el.volume = 0;
|
|
563
|
-
const tick = () => {
|
|
564
|
-
const elapsed = performance.now() - startTime;
|
|
565
|
-
const progress = Math.min(1, elapsed / durationMs);
|
|
566
|
-
el.volume = progress * volume;
|
|
567
|
-
if (progress < 1) {
|
|
568
|
-
fadeTimerRef.current = requestAnimationFrame(tick);
|
|
569
|
-
}
|
|
570
|
-
};
|
|
571
|
-
fadeTimerRef.current = requestAnimationFrame(tick);
|
|
572
|
-
}, [fadeIn, volume]);
|
|
573
|
-
const handlePlay = React6.useCallback(() => {
|
|
529
|
+
React7.useEffect(() => {
|
|
574
530
|
const el = mediaRef.current;
|
|
575
531
|
if (!el || !isPresentationMode) {
|
|
576
532
|
return;
|
|
577
533
|
}
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
const elapsed = performance.now() - fadeStartTime;
|
|
595
|
-
const progress = Math.min(1, elapsed / fadeMs);
|
|
596
|
-
el.volume = startVol * (1 - progress);
|
|
597
|
-
if (progress < 1 && !el.paused) {
|
|
598
|
-
fadeTimerRef.current = requestAnimationFrame(fadeOutTick);
|
|
599
|
-
}
|
|
600
|
-
};
|
|
601
|
-
fadeTimerRef.current = requestAnimationFrame(fadeOutTick);
|
|
602
|
-
}, fadeOutStart);
|
|
603
|
-
}
|
|
604
|
-
const stopTimer = window.setTimeout(() => {
|
|
605
|
-
if (!el.paused) {
|
|
606
|
-
el.pause();
|
|
607
|
-
el.currentTime = trimEndSec;
|
|
608
|
-
}
|
|
609
|
-
}, remaining * 1e3);
|
|
610
|
-
const prevTimer = trimTimerRef.current;
|
|
611
|
-
trimTimerRef.current = stopTimer;
|
|
612
|
-
if (prevTimer !== null) {
|
|
613
|
-
window.clearTimeout(prevTimer);
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
} else if (fadeOut > 0) {
|
|
617
|
-
const handleTimeUpdate = () => {
|
|
618
|
-
if (!Number.isFinite(el.duration)) {
|
|
619
|
-
return;
|
|
620
|
-
}
|
|
621
|
-
const timeLeft = el.duration - el.currentTime;
|
|
622
|
-
if (timeLeft <= fadeOut && timeLeft > 0) {
|
|
623
|
-
el.removeEventListener("timeupdate", handleTimeUpdate);
|
|
624
|
-
const fadeStartTime = performance.now();
|
|
625
|
-
const fadeMs = timeLeft * 1e3;
|
|
626
|
-
const startVol = el.volume;
|
|
627
|
-
const fadeOutTick = () => {
|
|
628
|
-
const elapsed = performance.now() - fadeStartTime;
|
|
629
|
-
const progress = Math.min(1, elapsed / fadeMs);
|
|
630
|
-
el.volume = startVol * (1 - progress);
|
|
631
|
-
if (progress < 1 && !el.paused) {
|
|
632
|
-
fadeTimerRef.current = requestAnimationFrame(fadeOutTick);
|
|
633
|
-
}
|
|
634
|
-
};
|
|
635
|
-
fadeTimerRef.current = requestAnimationFrame(fadeOutTick);
|
|
636
|
-
}
|
|
637
|
-
};
|
|
638
|
-
el.addEventListener("timeupdate", handleTimeUpdate);
|
|
639
|
-
}
|
|
640
|
-
}, [applyFadeIn, fadeIn, fadeOut, isPresentationMode, trimEndSec, trimStartSec]);
|
|
641
|
-
React6.useEffect(() => {
|
|
534
|
+
return chunkAL2KLPOJ_js.scheduleMediaTrimAndFade(el, {
|
|
535
|
+
trimStartMs: element.trimStartMs,
|
|
536
|
+
trimEndMs: element.trimEndMs,
|
|
537
|
+
fadeInDuration: element.fadeInDuration,
|
|
538
|
+
fadeOutDuration: element.fadeOutDuration,
|
|
539
|
+
volume: playbackVolume
|
|
540
|
+
});
|
|
541
|
+
}, [
|
|
542
|
+
isPresentationMode,
|
|
543
|
+
element.trimStartMs,
|
|
544
|
+
element.trimEndMs,
|
|
545
|
+
element.fadeInDuration,
|
|
546
|
+
element.fadeOutDuration,
|
|
547
|
+
playbackVolume
|
|
548
|
+
]);
|
|
549
|
+
React7.useEffect(() => {
|
|
642
550
|
if (!isPresentationMode || !shouldAutoPlay) {
|
|
643
551
|
return;
|
|
644
552
|
}
|
|
645
553
|
if (element.playAcrossSlides && element.mediaType === "audio") {
|
|
646
554
|
const dataUrl = element.mediaData ?? resolvedDataUrl;
|
|
647
|
-
if (
|
|
555
|
+
if (chunkAL2KLPOJ_js.registerCrossSlideAudio(element, dataUrl)) {
|
|
648
556
|
return;
|
|
649
557
|
}
|
|
650
558
|
}
|
|
@@ -666,14 +574,16 @@ function PresentationMediaController({
|
|
|
666
574
|
transition: "opacity 0.3s ease",
|
|
667
575
|
pointerEvents: isMediaPlaying ? "auto" : "none"
|
|
668
576
|
} : {};
|
|
669
|
-
const handleStopFullScreen =
|
|
577
|
+
const handleStopFullScreen = React7.useCallback(() => {
|
|
670
578
|
const el = mediaRef.current;
|
|
671
579
|
if (el && !el.paused) {
|
|
672
580
|
el.pause();
|
|
673
581
|
}
|
|
674
582
|
}, []);
|
|
583
|
+
const noopOnPlay = React7.useCallback(() => {
|
|
584
|
+
}, []);
|
|
675
585
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full h-full", style: wrapperStyle, children: [
|
|
676
|
-
children({ mediaRef, onPlay:
|
|
586
|
+
children({ mediaRef, onPlay: noopOnPlay, isMediaPlaying }),
|
|
677
587
|
isFullScreen && isPresentationMode && isMediaPlaying && /* @__PURE__ */ jsxRuntime.jsx(
|
|
678
588
|
"button",
|
|
679
589
|
{
|
|
@@ -687,7 +597,7 @@ function PresentationMediaController({
|
|
|
687
597
|
] });
|
|
688
598
|
}
|
|
689
599
|
function label(key) {
|
|
690
|
-
return key === void 0 ? void 0 :
|
|
600
|
+
return key === void 0 ? void 0 : chunkMZI4DG3S_js.translationsEn[key];
|
|
691
601
|
}
|
|
692
602
|
function FallbackIcon({
|
|
693
603
|
paths,
|
|
@@ -723,17 +633,17 @@ function Badge({
|
|
|
723
633
|
"div",
|
|
724
634
|
{
|
|
725
635
|
className: `absolute inset-0 flex flex-col items-center justify-center ${isMissing ? "gap-1" : ""}`,
|
|
726
|
-
...{ [
|
|
636
|
+
...{ [chunkAL2KLPOJ_js.MEDIA_CHROME_ATTRIBUTE]: visual.badge },
|
|
727
637
|
children: [
|
|
728
638
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
729
639
|
FallbackIcon,
|
|
730
640
|
{
|
|
731
|
-
paths:
|
|
641
|
+
paths: chunkAL2KLPOJ_js.mediaFallbackIcon(visual, element.mediaType),
|
|
732
642
|
size: isMissing ? 32 : 48,
|
|
733
643
|
className: isMissing ? "text-white/60" : "text-white/80 drop-shadow-md"
|
|
734
644
|
}
|
|
735
645
|
),
|
|
736
|
-
isMissing && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: label(
|
|
646
|
+
isMissing && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: label(chunkAL2KLPOJ_js.mediaFallbackLabelKey(visual, element.mediaType)) })
|
|
737
647
|
]
|
|
738
648
|
}
|
|
739
649
|
);
|
|
@@ -750,17 +660,17 @@ function Placeholder({
|
|
|
750
660
|
"div",
|
|
751
661
|
{
|
|
752
662
|
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"}`,
|
|
753
|
-
...{ [
|
|
663
|
+
...{ [chunkAL2KLPOJ_js.MEDIA_CHROME_ATTRIBUTE]: visual.placeholder },
|
|
754
664
|
children: [
|
|
755
665
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
756
666
|
FallbackIcon,
|
|
757
667
|
{
|
|
758
|
-
paths:
|
|
668
|
+
paths: chunkAL2KLPOJ_js.mediaFallbackIcon(visual, element.mediaType),
|
|
759
669
|
size: isMissing ? 36 : element.mediaType === "audio" ? 24 : 32,
|
|
760
670
|
className: isMissing ? "text-white/50" : "text-white/70"
|
|
761
671
|
}
|
|
762
672
|
),
|
|
763
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `text-[10px] ${isMissing ? "text-white/50" : "text-white/70"}`, children: label(
|
|
673
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `text-[10px] ${isMissing ? "text-white/50" : "text-white/70"}`, children: label(chunkAL2KLPOJ_js.mediaFallbackLabelKey(visual, element.mediaType)) })
|
|
764
674
|
]
|
|
765
675
|
}
|
|
766
676
|
);
|
|
@@ -770,7 +680,7 @@ function renderMediaFallback({
|
|
|
770
680
|
posterUrl,
|
|
771
681
|
surface
|
|
772
682
|
}) {
|
|
773
|
-
const visual =
|
|
683
|
+
const visual = chunkAL2KLPOJ_js.mediaFallbackVisual(surface, {
|
|
774
684
|
hasPoster: Boolean(posterUrl),
|
|
775
685
|
missing: element.mediaMissing === true
|
|
776
686
|
});
|
|
@@ -780,9 +690,9 @@ function renderMediaFallback({
|
|
|
780
690
|
"img",
|
|
781
691
|
{
|
|
782
692
|
src: posterUrl,
|
|
783
|
-
alt: visual.dimPoster ?
|
|
693
|
+
alt: visual.dimPoster ? chunkMZI4DG3S_js.translationsEn["pptx.media.posterAlt"] : chunkMZI4DG3S_js.translationsEn["pptx.media.videoPosterAlt"],
|
|
784
694
|
className: `w-full h-full${visual.dimPoster ? " opacity-50" : ""}`,
|
|
785
|
-
style:
|
|
695
|
+
style: chunkAL2KLPOJ_js.getImageFitStyle(element)
|
|
786
696
|
}
|
|
787
697
|
),
|
|
788
698
|
/* @__PURE__ */ jsxRuntime.jsx(Badge, { visual, element })
|
|
@@ -792,7 +702,7 @@ function renderMediaFallback({
|
|
|
792
702
|
}
|
|
793
703
|
function renderMediaElement(element, mediaDataUrls, options) {
|
|
794
704
|
if (element.type !== "media") {
|
|
795
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
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: chunkMZI4DG3S_js.translationsEn["pptx.media.title"] });
|
|
796
706
|
}
|
|
797
707
|
const mediaType = element.mediaType;
|
|
798
708
|
const mediaPath = element.mediaPath;
|
|
@@ -800,7 +710,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
800
710
|
const dataUrl = element.mediaData ?? (mediaPath ? mediaDataUrls.get(mediaPath) : void 0);
|
|
801
711
|
const trimFragment = buildTrimFragment(element);
|
|
802
712
|
const posterUrl = element.posterFrameData ?? void 0;
|
|
803
|
-
const shouldLoop =
|
|
713
|
+
const shouldLoop = chunkAL2KLPOJ_js.mediaPlaybackAttributes(element).loop;
|
|
804
714
|
const shouldAutoPlay = options?.autoPlay === true || element.autoPlay === true;
|
|
805
715
|
const isFullScreen = options?.fullScreen === true;
|
|
806
716
|
const isPresentationMode = options?.isPresentationMode === true;
|
|
@@ -878,25 +788,25 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
878
788
|
if (surface.presenting || surface.preview) {
|
|
879
789
|
return null;
|
|
880
790
|
}
|
|
881
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
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: chunkMZI4DG3S_js.translationsEn["pptx.media.title"] });
|
|
882
792
|
}
|
|
883
793
|
|
|
884
794
|
// src/viewer/utils/text-utils.tsx
|
|
885
795
|
function getTextStyleForElement(element, fallbackColor) {
|
|
886
|
-
return
|
|
796
|
+
return chunkAL2KLPOJ_js.buildTextBlockStyle(element, { fallbackColor });
|
|
887
797
|
}
|
|
888
798
|
|
|
889
799
|
// src/viewer/utils/text-layout.tsx
|
|
890
800
|
function getTextLayoutStyle(element) {
|
|
891
|
-
if (!
|
|
801
|
+
if (!chunkAL2KLPOJ_js.hasTextProperties(element)) {
|
|
892
802
|
return {};
|
|
893
803
|
}
|
|
894
|
-
const writingMode =
|
|
895
|
-
const textOrientation =
|
|
896
|
-
const verticalDirection =
|
|
804
|
+
const writingMode = chunkAL2KLPOJ_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
805
|
+
const textOrientation = chunkAL2KLPOJ_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
806
|
+
const verticalDirection = chunkAL2KLPOJ_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
897
807
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
898
808
|
const shapeAutoFitTextBox = element.textStyle?.autoFitMode === "shrink" && (element.type === "text" || element.locks?.txBox === true);
|
|
899
|
-
const hasParagraphIndents =
|
|
809
|
+
const hasParagraphIndents = chunkAL2KLPOJ_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
900
810
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
901
811
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
902
812
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
@@ -905,7 +815,7 @@ function getTextLayoutStyle(element) {
|
|
|
905
815
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
906
816
|
return {
|
|
907
817
|
// Columns / flex anchoring / anchorCtr / tab-size / kinsoku, from shared.
|
|
908
|
-
...
|
|
818
|
+
...chunkAL2KLPOJ_js.buildTextBodyLayoutStyle(element),
|
|
909
819
|
// Body inset only. Paragraph spacing (spcBef/spcAft) is applied
|
|
910
820
|
// per-paragraph by the paragraph renderer, not collapsed here.
|
|
911
821
|
paddingTop: bodyTop,
|
|
@@ -933,7 +843,7 @@ function getTextLayoutStyle(element) {
|
|
|
933
843
|
|
|
934
844
|
// src/viewer/utils/text-effects.tsx
|
|
935
845
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
936
|
-
return
|
|
846
|
+
return chunkAL2KLPOJ_js.buildTextBody3DSceneStyle(textStyle);
|
|
937
847
|
}
|
|
938
848
|
|
|
939
849
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -1118,13 +1028,13 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1118
1028
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
1119
1029
|
return renderedSegments;
|
|
1120
1030
|
}
|
|
1121
|
-
const paraKey = `${elementId}${
|
|
1031
|
+
const paraKey = `${elementId}${chunkAL2KLPOJ_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
1122
1032
|
const paraState = subElementAnimStates.get(paraKey);
|
|
1123
1033
|
if (paraState) {
|
|
1124
1034
|
const style = buildAnimStyle(paraState);
|
|
1125
1035
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
1126
1036
|
}
|
|
1127
|
-
const spec =
|
|
1037
|
+
const spec = chunkAL2KLPOJ_js.buildTextBuildSpec(
|
|
1128
1038
|
elementId,
|
|
1129
1039
|
paraIndex,
|
|
1130
1040
|
paraRuns.map((run) => ({ text: run.text, style: run })),
|
|
@@ -1136,24 +1046,66 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1136
1046
|
return spec.spans.map((span, index) => {
|
|
1137
1047
|
const content = span.style && renderPiece ? renderPiece(span.style, span.text, String(index)) : span.text;
|
|
1138
1048
|
if (!span.animId) {
|
|
1139
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1049
|
+
return /* @__PURE__ */ jsxRuntime.jsx(React7__default.default.Fragment, { children: content }, `ws-${index}`);
|
|
1140
1050
|
}
|
|
1141
1051
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1142
1052
|
"span",
|
|
1143
1053
|
{
|
|
1144
1054
|
"data-anim-id": span.animId,
|
|
1145
|
-
style:
|
|
1055
|
+
style: chunkAL2KLPOJ_js.textBuildSpanStyle(span),
|
|
1146
1056
|
children: content
|
|
1147
1057
|
},
|
|
1148
1058
|
span.animId
|
|
1149
1059
|
);
|
|
1150
1060
|
});
|
|
1151
1061
|
}
|
|
1062
|
+
function renderUnderlineWords(text, isUnderlineWords, wordDecoration, metric, keyPrefix, inner) {
|
|
1063
|
+
if (!isUnderlineWords || !text) {
|
|
1064
|
+
return inner(text, keyPrefix, metric);
|
|
1065
|
+
}
|
|
1066
|
+
const pieces = chunkAL2KLPOJ_js.splitWordsForUnderline(text);
|
|
1067
|
+
if (pieces.length === 0) {
|
|
1068
|
+
return inner(text, keyPrefix, metric);
|
|
1069
|
+
}
|
|
1070
|
+
const gapMetric = metric ? {
|
|
1071
|
+
...metric,
|
|
1072
|
+
nestedStyle: metric.nestedStyle ? chunkAL2KLPOJ_js.stripUnderlineDecoration(metric.nestedStyle) : void 0
|
|
1073
|
+
} : void 0;
|
|
1074
|
+
return pieces.map((piece, i) => {
|
|
1075
|
+
const key = `${keyPrefix}-u${i}`;
|
|
1076
|
+
if (!piece.underline) {
|
|
1077
|
+
return /* @__PURE__ */ jsxRuntime.jsx(React7__default.default.Fragment, { children: inner(piece.text, key, gapMetric) }, key);
|
|
1078
|
+
}
|
|
1079
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: wordDecoration, children: inner(piece.text, key, metric) }, key);
|
|
1080
|
+
});
|
|
1081
|
+
}
|
|
1082
|
+
function makeSegmentPieceRenderer(needsScriptFonts, scriptFonts, baseFontFamily, isUnderlineWords, wordDecoration, metric) {
|
|
1083
|
+
return (text, key) => renderUnderlineWords(
|
|
1084
|
+
text,
|
|
1085
|
+
isUnderlineWords,
|
|
1086
|
+
wordDecoration,
|
|
1087
|
+
metric,
|
|
1088
|
+
key,
|
|
1089
|
+
(subText, subKey, subMetric) => renderMetricPieces(
|
|
1090
|
+
subText,
|
|
1091
|
+
subMetric,
|
|
1092
|
+
subKey,
|
|
1093
|
+
(pieceText, pieceKey) => renderScriptAwareText(
|
|
1094
|
+
pieceText,
|
|
1095
|
+
needsScriptFonts,
|
|
1096
|
+
scriptFonts,
|
|
1097
|
+
baseFontFamily,
|
|
1098
|
+
pieceKey,
|
|
1099
|
+
subMetric?.nestedStyle
|
|
1100
|
+
)
|
|
1101
|
+
)
|
|
1102
|
+
);
|
|
1103
|
+
}
|
|
1152
1104
|
function renderTabbedLine(line, ctx, keyPrefix, renderPiece, nestedStyle) {
|
|
1153
|
-
const [lineLayout] =
|
|
1105
|
+
const [lineLayout] = chunkAL2KLPOJ_js.buildRunTabLines(line, ctx, nestedStyle);
|
|
1154
1106
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { display: "inline-block", whiteSpace: "nowrap" }, children: lineLayout.pieces.map((piece, i) => {
|
|
1155
1107
|
const key = `${keyPrefix}-tab-${i}`;
|
|
1156
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1108
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React7__default.default.Fragment, { children: [
|
|
1157
1109
|
piece.leaderStyle ? /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", style: piece.leaderStyle, children: piece.leaderText }) : null,
|
|
1158
1110
|
/* @__PURE__ */ jsxRuntime.jsx("span", { style: piece.style, children: renderPiece(piece.text, key) })
|
|
1159
1111
|
] }, key);
|
|
@@ -1163,7 +1115,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1163
1115
|
if (!needsScriptFonts || !text) {
|
|
1164
1116
|
return text;
|
|
1165
1117
|
}
|
|
1166
|
-
const pieces =
|
|
1118
|
+
const pieces = chunkAL2KLPOJ_js.splitRunByScriptFont(
|
|
1167
1119
|
text,
|
|
1168
1120
|
scriptFonts,
|
|
1169
1121
|
baseFontFamily,
|
|
@@ -1173,14 +1125,14 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1173
1125
|
return text;
|
|
1174
1126
|
}
|
|
1175
1127
|
return pieces.map(
|
|
1176
|
-
(piece, i) => piece.style ? /* @__PURE__ */ jsxRuntime.jsx("span", { style: piece.style, children: piece.text }, `${keyPrefix}-r${i}`) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1128
|
+
(piece, i) => piece.style ? /* @__PURE__ */ jsxRuntime.jsx("span", { style: piece.style, children: piece.text }, `${keyPrefix}-r${i}`) : /* @__PURE__ */ jsxRuntime.jsx(React7__default.default.Fragment, { children: piece.text }, `${keyPrefix}-r${i}`)
|
|
1177
1129
|
);
|
|
1178
1130
|
}
|
|
1179
1131
|
function renderMetricPieces(text, metric, keyPrefix, inner) {
|
|
1180
1132
|
if (!metric || !text) {
|
|
1181
1133
|
return inner(text, keyPrefix);
|
|
1182
1134
|
}
|
|
1183
|
-
const pieces =
|
|
1135
|
+
const pieces = chunkAL2KLPOJ_js.splitRunForMetrics(text, metric.font);
|
|
1184
1136
|
if (pieces.length <= 1) {
|
|
1185
1137
|
return inner(text, keyPrefix);
|
|
1186
1138
|
}
|
|
@@ -1189,33 +1141,28 @@ function renderMetricPieces(text, metric, keyPrefix, inner) {
|
|
|
1189
1141
|
{
|
|
1190
1142
|
style: {
|
|
1191
1143
|
...metric.nestedStyle,
|
|
1192
|
-
letterSpacing:
|
|
1144
|
+
letterSpacing: chunkAL2KLPOJ_js.pieceLetterSpacing(metric.authoredPx, piece.tracking)
|
|
1193
1145
|
},
|
|
1194
1146
|
children: inner(piece.text, `${keyPrefix}-w${i}`)
|
|
1195
1147
|
},
|
|
1196
1148
|
`${keyPrefix}-w${i}`
|
|
1197
1149
|
));
|
|
1198
1150
|
}
|
|
1199
|
-
function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsScriptFonts, scriptFonts, baseFontFamily, findHighlights, tabContext, metric) {
|
|
1151
|
+
function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsScriptFonts, scriptFonts, baseFontFamily, findHighlights, tabContext, metric, isUnderlineWords = false, wordDecoration) {
|
|
1200
1152
|
const segHl = findHighlights?.get(segmentIndex);
|
|
1153
|
+
const renderLeaf = makeSegmentPieceRenderer(
|
|
1154
|
+
needsScriptFonts,
|
|
1155
|
+
scriptFonts,
|
|
1156
|
+
baseFontFamily,
|
|
1157
|
+
isUnderlineWords,
|
|
1158
|
+
wordDecoration,
|
|
1159
|
+
metric
|
|
1160
|
+
);
|
|
1201
1161
|
if (!segHl || segHl.length === 0) {
|
|
1202
1162
|
return lines.map((line, lineIndex) => {
|
|
1203
1163
|
const lineKey = `${elementId}-seg-${segmentIndex}-line-${lineIndex}`;
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
metric,
|
|
1207
|
-
key,
|
|
1208
|
-
(pieceText, pieceKey) => renderScriptAwareText(
|
|
1209
|
-
pieceText,
|
|
1210
|
-
needsScriptFonts,
|
|
1211
|
-
scriptFonts,
|
|
1212
|
-
baseFontFamily,
|
|
1213
|
-
pieceKey,
|
|
1214
|
-
metric?.nestedStyle
|
|
1215
|
-
)
|
|
1216
|
-
);
|
|
1217
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(React6__default.default.Fragment, { children: [
|
|
1218
|
-
tabContext && line.includes(" ") ? renderTabbedLine(line, tabContext, lineKey, renderPiece, metric?.nestedStyle) : renderPiece(line, lineKey),
|
|
1164
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React7__default.default.Fragment, { children: [
|
|
1165
|
+
tabContext && line.includes(" ") ? renderTabbedLine(line, tabContext, lineKey, renderLeaf, metric?.nestedStyle) : renderLeaf(line, lineKey),
|
|
1219
1166
|
lineIndex < lines.length - 1 ? /* @__PURE__ */ jsxRuntime.jsx("br", {}) : null
|
|
1220
1167
|
] }, lineKey);
|
|
1221
1168
|
});
|
|
@@ -1245,19 +1192,6 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1245
1192
|
isCurrent: false
|
|
1246
1193
|
});
|
|
1247
1194
|
}
|
|
1248
|
-
const renderChunk = (text, key) => renderMetricPieces(
|
|
1249
|
-
text,
|
|
1250
|
-
metric,
|
|
1251
|
-
key,
|
|
1252
|
-
(pieceText, pieceKey) => renderScriptAwareText(
|
|
1253
|
-
pieceText,
|
|
1254
|
-
needsScriptFonts,
|
|
1255
|
-
scriptFonts,
|
|
1256
|
-
baseFontFamily,
|
|
1257
|
-
pieceKey,
|
|
1258
|
-
metric?.nestedStyle
|
|
1259
|
-
)
|
|
1260
|
-
);
|
|
1261
1195
|
return chunks.map((chunk, ci) => {
|
|
1262
1196
|
const chunkKey = `${elementId}-seg-${segmentIndex}-hl-${ci}`;
|
|
1263
1197
|
return chunk.highlighted ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1269,15 +1203,15 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1269
1203
|
color: "inherit",
|
|
1270
1204
|
borderRadius: 2
|
|
1271
1205
|
},
|
|
1272
|
-
children:
|
|
1206
|
+
children: renderLeaf(chunk.text, chunkKey)
|
|
1273
1207
|
},
|
|
1274
1208
|
chunkKey
|
|
1275
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1209
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(React7__default.default.Fragment, { children: renderLeaf(chunk.text, chunkKey) }, chunkKey);
|
|
1276
1210
|
});
|
|
1277
1211
|
}
|
|
1278
1212
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
1279
|
-
const mathml =
|
|
1280
|
-
const safeMathml = mathml ?
|
|
1213
|
+
const mathml = chunkAL2KLPOJ_js.convertOmmlToMathMl(equationXml);
|
|
1214
|
+
const safeMathml = mathml ? chunkAL2KLPOJ_js.sanitizeMathMl(mathml) : "";
|
|
1281
1215
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1282
1216
|
"span",
|
|
1283
1217
|
{
|
|
@@ -1287,7 +1221,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1287
1221
|
},
|
|
1288
1222
|
dangerouslySetInnerHTML: { __html: safeMathml }
|
|
1289
1223
|
}
|
|
1290
|
-
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children:
|
|
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: chunkMZI4DG3S_js.translationsEn["pptx.textSegment.equationFallback"] });
|
|
1291
1225
|
if (equationNumber) {
|
|
1292
1226
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1293
1227
|
"span",
|
|
@@ -1334,11 +1268,12 @@ function renderHyperlink(run, spanNode, key, ctx) {
|
|
|
1334
1268
|
}
|
|
1335
1269
|
const requireCtrlClick = ctx.requireCtrlClick;
|
|
1336
1270
|
const displayUrl = url.startsWith("ppaction://") ? url.replace(/^ppaction:\/\//u, "").split("?")[0] : url;
|
|
1271
|
+
const targetFrame = run.hyperlink?.target;
|
|
1337
1272
|
const follow = (modified) => {
|
|
1338
1273
|
if (requireCtrlClick && !modified) {
|
|
1339
1274
|
return false;
|
|
1340
1275
|
}
|
|
1341
|
-
onHyperlinkClick(url);
|
|
1276
|
+
onHyperlinkClick(url, targetFrame);
|
|
1342
1277
|
return true;
|
|
1343
1278
|
};
|
|
1344
1279
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1405,7 +1340,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1405
1340
|
const segmentStyle = segment?.style ?? {};
|
|
1406
1341
|
const textValue = run.text;
|
|
1407
1342
|
const lines = textValue.split("\n");
|
|
1408
|
-
const resolvedSegmentColor =
|
|
1343
|
+
const resolvedSegmentColor = chunkAL2KLPOJ_js.normalizeHexColor(
|
|
1409
1344
|
segmentStyle.color || element.textStyle?.color,
|
|
1410
1345
|
run.hyperlink ? HYPERLINK_COLOR : fallbackColor
|
|
1411
1346
|
);
|
|
@@ -1413,16 +1348,16 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1413
1348
|
const baselineFraction = rawBaseline === 0 ? 0 : Math.abs(rawBaseline) >= 1e3 ? rawBaseline / 1e5 : rawBaseline / 100;
|
|
1414
1349
|
const baselineFontScale = baselineFraction !== 0 ? BASELINE_FONT_SCALE : 1;
|
|
1415
1350
|
const rawFontSize = segmentStyle.fontSize || element.textStyle?.fontSize || DEFAULT_TEXT_FONT_SIZE;
|
|
1416
|
-
const baseFontSize = rawFontSize *
|
|
1351
|
+
const baseFontSize = rawFontSize * chunkAL2KLPOJ_js.resolveAutoFitFontScale(element.textStyle);
|
|
1417
1352
|
const baselineShift = baselineFraction !== 0 ? `${baselineFraction * baseFontSize}px` : void 0;
|
|
1418
|
-
const fontKerning =
|
|
1353
|
+
const fontKerning = chunkAL2KLPOJ_js.resolveFontKerning(segmentStyle.kerning, baseFontSize);
|
|
1419
1354
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
1420
|
-
const baseFontFamily = rawFontFamily ?
|
|
1355
|
+
const baseFontFamily = rawFontFamily ? chunkAL2KLPOJ_js.getSubstituteFontFamily(
|
|
1421
1356
|
rawFontFamily,
|
|
1422
|
-
|
|
1357
|
+
chunkAL2KLPOJ_js.parsePanoseString(segmentStyle.latinFontPanose ?? element.textStyle?.latinFontPanose)
|
|
1423
1358
|
) : DEFAULT_FONT_FAMILY2;
|
|
1424
|
-
const scriptFonts =
|
|
1425
|
-
const needsScriptFonts =
|
|
1359
|
+
const scriptFonts = chunkAL2KLPOJ_js.resolveScriptFontSet(segmentStyle, element.textStyle, baseFontFamily);
|
|
1360
|
+
const needsScriptFonts = chunkAL2KLPOJ_js.hasDistinctScriptFonts(scriptFonts);
|
|
1426
1361
|
const authoredLetterSpacing = typeof segmentStyle.characterSpacing === "number" && segmentStyle.characterSpacing !== 0 ? segmentStyle.characterSpacing / 100 * (96 / 72) : 0;
|
|
1427
1362
|
const metricFont = {
|
|
1428
1363
|
fontFamily: baseFontFamily,
|
|
@@ -1430,7 +1365,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1430
1365
|
bold: Boolean(segmentStyle.bold),
|
|
1431
1366
|
italic: Boolean(segmentStyle.italic)
|
|
1432
1367
|
};
|
|
1433
|
-
const nestedStyle =
|
|
1368
|
+
const nestedStyle = chunkAL2KLPOJ_js.nestedTextDecorationStyle(run.style);
|
|
1434
1369
|
const metricContext = { font: metricFont, authoredPx: authoredLetterSpacing, nestedStyle };
|
|
1435
1370
|
const spanStyle = { ...run.style };
|
|
1436
1371
|
spanStyle.color = resolvedSegmentColor;
|
|
@@ -1438,11 +1373,11 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1438
1373
|
spanStyle.fontFamily = baseFontFamily;
|
|
1439
1374
|
spanStyle.verticalAlign = baselineShift;
|
|
1440
1375
|
spanStyle.fontKerning = fontKerning;
|
|
1441
|
-
spanStyle.letterSpacing =
|
|
1376
|
+
spanStyle.letterSpacing = chunkAL2KLPOJ_js.pieceLetterSpacing(
|
|
1442
1377
|
authoredLetterSpacing,
|
|
1443
|
-
|
|
1378
|
+
chunkAL2KLPOJ_js.resolveMetricTrackingPx(textValue, metricFont)
|
|
1444
1379
|
);
|
|
1445
|
-
const hollow =
|
|
1380
|
+
const hollow = chunkAL2KLPOJ_js.hollowTextFillStyle(segmentStyle, {
|
|
1446
1381
|
color: resolvedSegmentColor,
|
|
1447
1382
|
textStroke: typeof spanStyle.WebkitTextStroke === "string" ? spanStyle.WebkitTextStroke : void 0
|
|
1448
1383
|
});
|
|
@@ -1454,6 +1389,16 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1454
1389
|
spanStyle.direction = runRtl ? "rtl" : "ltr";
|
|
1455
1390
|
spanStyle.unicodeBidi = runRtl !== ctx.paragraphRtl ? "bidi-override" : "embed";
|
|
1456
1391
|
}
|
|
1392
|
+
const isUnderlineWords = Boolean(segmentStyle.underline) && segmentStyle.underlineStyle === "words";
|
|
1393
|
+
const wordDecoration = isUnderlineWords ? nestedStyle : void 0;
|
|
1394
|
+
if (isUnderlineWords) {
|
|
1395
|
+
const stripped = chunkAL2KLPOJ_js.stripUnderlineDecoration(spanStyle);
|
|
1396
|
+
spanStyle.textDecoration = stripped.textDecoration;
|
|
1397
|
+
delete spanStyle.textDecorationStyle;
|
|
1398
|
+
delete spanStyle.textDecorationThickness;
|
|
1399
|
+
delete spanStyle.textUnderlineOffset;
|
|
1400
|
+
delete spanStyle.textDecorationColor;
|
|
1401
|
+
}
|
|
1457
1402
|
const baseContent = renderSegmentContent(
|
|
1458
1403
|
element.id,
|
|
1459
1404
|
segmentIndex,
|
|
@@ -1463,7 +1408,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1463
1408
|
scriptFonts,
|
|
1464
1409
|
baseFontFamily,
|
|
1465
1410
|
findHighlights,
|
|
1466
|
-
|
|
1411
|
+
chunkAL2KLPOJ_js.buildTabContext(
|
|
1467
1412
|
element.textStyle?.tabStops,
|
|
1468
1413
|
element.textStyle?.defaultTabSize,
|
|
1469
1414
|
baseFontSize,
|
|
@@ -1471,7 +1416,9 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1471
1416
|
Boolean(segmentStyle.bold),
|
|
1472
1417
|
Boolean(segmentStyle.italic)
|
|
1473
1418
|
),
|
|
1474
|
-
metricContext
|
|
1419
|
+
metricContext,
|
|
1420
|
+
isUnderlineWords,
|
|
1421
|
+
wordDecoration
|
|
1475
1422
|
);
|
|
1476
1423
|
const spanNode = /* @__PURE__ */ jsxRuntime.jsx("span", { "data-seg-idx": segmentIndex, style: spanStyle, children: renderRubyOrText(run, baseContent) }, key);
|
|
1477
1424
|
const reflectedNode = wrapWithTextReflection(run, key, spanNode, spanStyle, baseContent);
|
|
@@ -1489,7 +1436,7 @@ function renderRubyOrText(run, baseContent) {
|
|
|
1489
1436
|
] });
|
|
1490
1437
|
}
|
|
1491
1438
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick, placeholderPrompt) {
|
|
1492
|
-
if (!
|
|
1439
|
+
if (!chunkAL2KLPOJ_js.hasTextProperties(element)) {
|
|
1493
1440
|
return emptyFallback || null;
|
|
1494
1441
|
}
|
|
1495
1442
|
const segments = segmentOverrides ?? element.textSegments;
|
|
@@ -1499,7 +1446,7 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
1499
1446
|
}
|
|
1500
1447
|
return element.text || emptyFallback || "";
|
|
1501
1448
|
}
|
|
1502
|
-
const paragraphs =
|
|
1449
|
+
const paragraphs = chunkAL2KLPOJ_js.buildParagraphs(element, fieldContext, segmentOverrides);
|
|
1503
1450
|
const ctx = {
|
|
1504
1451
|
element,
|
|
1505
1452
|
fallbackColor,
|
|
@@ -1576,7 +1523,7 @@ function renderParagraph(para, paraIndex, paraCount, segments, ctx, subElementAn
|
|
|
1576
1523
|
);
|
|
1577
1524
|
const needsWrapper = Object.keys(paraStyle).length > 0 || marker !== null;
|
|
1578
1525
|
if (!needsWrapper) {
|
|
1579
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1526
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React7__default.default.Fragment, { children: [
|
|
1580
1527
|
wrappedContent,
|
|
1581
1528
|
paraIndex < paraCount - 1 ? /* @__PURE__ */ jsxRuntime.jsx("br", {}) : null
|
|
1582
1529
|
] }, `${element.id}-para-${paraIndex}`);
|
|
@@ -1625,13 +1572,13 @@ function renderBulletMarker(para, paraIndex, elementId) {
|
|
|
1625
1572
|
);
|
|
1626
1573
|
}
|
|
1627
1574
|
function getDuotoneColors(element) {
|
|
1628
|
-
if (!
|
|
1575
|
+
if (!chunkAL2KLPOJ_js.isImageLikeElement(element)) {
|
|
1629
1576
|
return void 0;
|
|
1630
1577
|
}
|
|
1631
1578
|
return element.imageEffects?.duotone;
|
|
1632
1579
|
}
|
|
1633
1580
|
function buildLineShadowCss(element) {
|
|
1634
|
-
if (!
|
|
1581
|
+
if (!chunkAL2KLPOJ_js.hasShapeProperties(element)) {
|
|
1635
1582
|
return void 0;
|
|
1636
1583
|
}
|
|
1637
1584
|
const ss = element.shapeStyle;
|
|
@@ -1642,13 +1589,13 @@ function buildLineShadowCss(element) {
|
|
|
1642
1589
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
1643
1590
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
1644
1591
|
const opacity = typeof ss.lineShadowOpacity === "number" ? Math.max(0, Math.min(1, ss.lineShadowOpacity)) : 0.35;
|
|
1645
|
-
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${
|
|
1646
|
-
|
|
1592
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkAL2KLPOJ_js.colorWithOpacity(
|
|
1593
|
+
chunkAL2KLPOJ_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
1647
1594
|
opacity
|
|
1648
1595
|
)}`;
|
|
1649
1596
|
}
|
|
1650
1597
|
function buildLineGlowFilter(element) {
|
|
1651
|
-
if (!
|
|
1598
|
+
if (!chunkAL2KLPOJ_js.hasShapeProperties(element)) {
|
|
1652
1599
|
return void 0;
|
|
1653
1600
|
}
|
|
1654
1601
|
const ss = element.shapeStyle;
|
|
@@ -1657,22 +1604,22 @@ function buildLineGlowFilter(element) {
|
|
|
1657
1604
|
}
|
|
1658
1605
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
1659
1606
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
1660
|
-
const glowCol =
|
|
1607
|
+
const glowCol = chunkAL2KLPOJ_js.colorWithOpacity(chunkAL2KLPOJ_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
1661
1608
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
1662
1609
|
}
|
|
1663
1610
|
function getDagDuotoneFilterId(elementId) {
|
|
1664
1611
|
return `dag-duotone-${elementId}`;
|
|
1665
1612
|
}
|
|
1666
1613
|
function hasDagDuotoneEffect(element) {
|
|
1667
|
-
if (!
|
|
1614
|
+
if (!chunkAL2KLPOJ_js.hasShapeProperties(element)) {
|
|
1668
1615
|
return false;
|
|
1669
1616
|
}
|
|
1670
1617
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
1671
1618
|
}
|
|
1672
1619
|
function renderDagDuotoneSvgFilter(elementId, color1, color2) {
|
|
1673
1620
|
const filterId = getDagDuotoneFilterId(elementId);
|
|
1674
|
-
const c1 =
|
|
1675
|
-
const c2 =
|
|
1621
|
+
const c1 = chunkAL2KLPOJ_js.hexToRgbUnit(color1);
|
|
1622
|
+
const c2 = chunkAL2KLPOJ_js.hexToRgbUnit(color2);
|
|
1676
1623
|
const grayscaleMatrix = [
|
|
1677
1624
|
0.2126,
|
|
1678
1625
|
0.7152,
|
|
@@ -1716,7 +1663,7 @@ function renderDagDuotoneSvgFilter(elementId, color1, color2) {
|
|
|
1716
1663
|
|
|
1717
1664
|
// src/viewer/utils/shape-visual-3d.ts
|
|
1718
1665
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
1719
|
-
return
|
|
1666
|
+
return chunkAL2KLPOJ_js.build3DExtrusionData(
|
|
1720
1667
|
shape3d,
|
|
1721
1668
|
scene3d,
|
|
1722
1669
|
fillColor,
|
|
@@ -1725,7 +1672,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
1725
1672
|
);
|
|
1726
1673
|
}
|
|
1727
1674
|
function apply3dEffects2(base, scene3d, shape3d, fillColorFallback) {
|
|
1728
|
-
|
|
1675
|
+
chunkAL2KLPOJ_js.apply3dEffects(base, scene3d, shape3d, fillColorFallback);
|
|
1729
1676
|
}
|
|
1730
1677
|
|
|
1731
1678
|
// src/viewer/utils/shape-visual-style.ts
|
|
@@ -1733,16 +1680,16 @@ function rendersCustomVectorPath(element) {
|
|
|
1733
1680
|
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;
|
|
1734
1681
|
}
|
|
1735
1682
|
function rendersWedgeCalloutVector(element) {
|
|
1736
|
-
return element.type === "shape" &&
|
|
1683
|
+
return element.type === "shape" && chunkAL2KLPOJ_js.isWedgeCalloutPresetShape(element.shapeType);
|
|
1737
1684
|
}
|
|
1738
1685
|
function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _strokeColor, animatesFill, animatesStroke, parentGroupFill) {
|
|
1739
|
-
if (!
|
|
1686
|
+
if (!chunkAL2KLPOJ_js.hasShapeProperties(element)) {
|
|
1740
1687
|
return {};
|
|
1741
1688
|
}
|
|
1742
1689
|
const ss = element.shapeStyle;
|
|
1743
|
-
const fill = animatesFill ? void 0 :
|
|
1744
|
-
const fx =
|
|
1745
|
-
const stroke =
|
|
1690
|
+
const fill = animatesFill ? void 0 : chunkAL2KLPOJ_js.getComputedFillStyle(element, parentGroupFill);
|
|
1691
|
+
const fx = chunkAL2KLPOJ_js.getComputedEffectStyle(element);
|
|
1692
|
+
const stroke = chunkAL2KLPOJ_js.getComputedStrokeStyle(element);
|
|
1746
1693
|
const base = {
|
|
1747
1694
|
// A gradient fill REPLACES the solid fill, it does not sit on top of it;
|
|
1748
1695
|
// the whole precedence lives in shared's `getComputedFillStyle`.
|
|
@@ -1781,7 +1728,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1781
1728
|
};
|
|
1782
1729
|
Object.assign(
|
|
1783
1730
|
base,
|
|
1784
|
-
|
|
1731
|
+
chunkAL2KLPOJ_js.getAnimationColorBaseStyle(element, {
|
|
1785
1732
|
animatesFill,
|
|
1786
1733
|
animatesStroke,
|
|
1787
1734
|
parentGroupFill
|
|
@@ -1793,7 +1740,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1793
1740
|
base.borderStyle = void 0;
|
|
1794
1741
|
}
|
|
1795
1742
|
apply3dEffects2(base, ss?.scene3d, ss?.shape3d, ss?.fillColor ?? fillColor);
|
|
1796
|
-
if (rendersCustomVectorPath(element) || rendersWedgeCalloutVector(element) ||
|
|
1743
|
+
if (rendersCustomVectorPath(element) || rendersWedgeCalloutVector(element) || chunkAL2KLPOJ_js.isStrokeOnlyPresetElement(element)) {
|
|
1797
1744
|
base.backgroundColor = "transparent";
|
|
1798
1745
|
base.backgroundImage = void 0;
|
|
1799
1746
|
base.borderWidth = void 0;
|
|
@@ -1807,7 +1754,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1807
1754
|
if (rendersWedgeCalloutVector(element)) {
|
|
1808
1755
|
return base;
|
|
1809
1756
|
}
|
|
1810
|
-
const geometry =
|
|
1757
|
+
const geometry = chunkAL2KLPOJ_js.resolveShapeGeometry(element);
|
|
1811
1758
|
switch (geometry.kind) {
|
|
1812
1759
|
case "bare":
|
|
1813
1760
|
return { backgroundColor: "transparent", borderWidth: 0, borderStyle: "none" };
|
|
@@ -1833,13 +1780,13 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1833
1780
|
function getConnectorAdjustment(element, key, fallback) {
|
|
1834
1781
|
const direct = element.shapeAdjustments?.[key];
|
|
1835
1782
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
1836
|
-
return
|
|
1783
|
+
return chunkAL2KLPOJ_js.clampUnitInterval(direct / 1e5);
|
|
1837
1784
|
}
|
|
1838
1785
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
1839
1786
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
1840
|
-
return
|
|
1787
|
+
return chunkAL2KLPOJ_js.clampUnitInterval(fallbackKey / 1e5);
|
|
1841
1788
|
}
|
|
1842
|
-
return
|
|
1789
|
+
return chunkAL2KLPOJ_js.clampUnitInterval(fallback);
|
|
1843
1790
|
}
|
|
1844
1791
|
function getConnectorPathGeometry(element) {
|
|
1845
1792
|
const width = Math.max(element.width, 0);
|
|
@@ -1976,11 +1923,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
|
|
|
1976
1923
|
strokePaint,
|
|
1977
1924
|
strokeWidth,
|
|
1978
1925
|
dashArray,
|
|
1979
|
-
lineCap:
|
|
1926
|
+
lineCap: chunkAL2KLPOJ_js.svgLineCap(shapeStyle?.lineCap),
|
|
1980
1927
|
lineJoin,
|
|
1981
1928
|
miterLimit,
|
|
1982
|
-
offsets:
|
|
1983
|
-
widths:
|
|
1929
|
+
offsets: chunkAL2KLPOJ_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
1930
|
+
widths: chunkAL2KLPOJ_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
|
|
1984
1931
|
};
|
|
1985
1932
|
}
|
|
1986
1933
|
function strokeStrands(d, keyBase, ctx) {
|
|
@@ -2028,12 +1975,12 @@ function gradientDefs(gradient) {
|
|
|
2028
1975
|
}
|
|
2029
1976
|
function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredPaths, shapeStyle, hasFill, fillColor, fillOpacity, strokePaint, strokeWidth, dashArray, animatesFill = false, gradient) {
|
|
2030
1977
|
const ctx = strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray);
|
|
2031
|
-
const subpaths = structuredPaths && structuredPaths.length > 0 ?
|
|
1978
|
+
const subpaths = structuredPaths && structuredPaths.length > 0 ? chunkAL2KLPOJ_js.customGeometryPathsToSvgSubpaths(structuredPaths, pathWidth, pathHeight) : void 0;
|
|
2032
1979
|
const needsPerSubpath = subpaths !== void 0 && subpaths.some((sp) => sp.fillMode && sp.fillMode !== "norm" || sp.stroke === false);
|
|
2033
|
-
const gradientPaint = gradient ?
|
|
1980
|
+
const gradientPaint = gradient ? chunkAL2KLPOJ_js.svgGradientFillRef(gradient) : void 0;
|
|
2034
1981
|
const nodes = [];
|
|
2035
1982
|
if (subpaths && needsPerSubpath) {
|
|
2036
|
-
const paints =
|
|
1983
|
+
const paints = chunkAL2KLPOJ_js.buildSubpathPaints(subpaths, hasFill, fillColor, fillOpacity);
|
|
2037
1984
|
paints.forEach((paint, idx) => {
|
|
2038
1985
|
if (paint.fill !== "none") {
|
|
2039
1986
|
const mode = subpaths[idx]?.fillMode;
|
|
@@ -2062,7 +2009,7 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2062
2009
|
"path",
|
|
2063
2010
|
{
|
|
2064
2011
|
d: pathData,
|
|
2065
|
-
fill: animatesFill ? "inherit" : gradientPaint ??
|
|
2012
|
+
fill: animatesFill ? "inherit" : gradientPaint ?? chunkAL2KLPOJ_js.colorWithOpacity(fillColor, fillOpacity),
|
|
2066
2013
|
stroke: "none",
|
|
2067
2014
|
vectorEffect: "non-scaling-stroke"
|
|
2068
2015
|
},
|
|
@@ -2105,14 +2052,14 @@ function renderGradientDefs(gradient) {
|
|
|
2105
2052
|
) });
|
|
2106
2053
|
}
|
|
2107
2054
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2108
|
-
if (!
|
|
2055
|
+
if (!chunkAL2KLPOJ_js.hasShapeProperties(element)) {
|
|
2109
2056
|
return null;
|
|
2110
2057
|
}
|
|
2111
2058
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
2112
|
-
const fillPaint = animatesFill ? "inherit" :
|
|
2113
|
-
const strokePaint = animatesStroke ? "inherit" :
|
|
2114
|
-
const dashType =
|
|
2115
|
-
const dashArray =
|
|
2059
|
+
const fillPaint = animatesFill ? "inherit" : chunkAL2KLPOJ_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
2060
|
+
const strokePaint = animatesStroke ? "inherit" : chunkAL2KLPOJ_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
2061
|
+
const dashType = chunkAL2KLPOJ_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2062
|
+
const dashArray = chunkAL2KLPOJ_js.getSvgStrokeDasharray(
|
|
2116
2063
|
dashType,
|
|
2117
2064
|
Math.max(strokeWidth, 1),
|
|
2118
2065
|
element.shapeStyle?.customDashSegments
|
|
@@ -2193,13 +2140,13 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2193
2140
|
// container's `background-image` is suppressed for custom geometry, so
|
|
2194
2141
|
// without this the shape fell back to the parser's representative solid
|
|
2195
2142
|
// and lost every fade (issue #132).
|
|
2196
|
-
|
|
2143
|
+
chunkAL2KLPOJ_js.buildSvgGradientDef(element.shapeStyle, element.id)
|
|
2197
2144
|
);
|
|
2198
2145
|
}
|
|
2199
|
-
if ((element.type === "image" || element.type === "picture") && strokeWidth > 0 && !
|
|
2146
|
+
if ((element.type === "image" || element.type === "picture") && strokeWidth > 0 && !chunkAL2KLPOJ_js.buildStrokeOutline(element)) {
|
|
2200
2147
|
const width = Math.max(element.width, 1);
|
|
2201
2148
|
const height = Math.max(element.height, 1);
|
|
2202
|
-
const geometry =
|
|
2149
|
+
const geometry = chunkAL2KLPOJ_js.getPresetShapeVectorGeometry(
|
|
2203
2150
|
element.shapeType || "rect",
|
|
2204
2151
|
width,
|
|
2205
2152
|
height,
|
|
@@ -2227,18 +2174,18 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2227
2174
|
);
|
|
2228
2175
|
}
|
|
2229
2176
|
}
|
|
2230
|
-
if (element.type === "shape" &&
|
|
2177
|
+
if (element.type === "shape" && chunkAL2KLPOJ_js.isWedgeCalloutPresetShape(element.shapeType)) {
|
|
2231
2178
|
const width = Math.max(element.width, 1);
|
|
2232
2179
|
const height = Math.max(element.height, 1);
|
|
2233
|
-
const geometry =
|
|
2180
|
+
const geometry = chunkAL2KLPOJ_js.getPresetShapeVectorGeometry(
|
|
2234
2181
|
element.shapeType,
|
|
2235
2182
|
width,
|
|
2236
2183
|
height,
|
|
2237
2184
|
element.shapeAdjustments
|
|
2238
2185
|
);
|
|
2239
2186
|
if (geometry) {
|
|
2240
|
-
const gradient =
|
|
2241
|
-
const gradientPaint = gradient ?
|
|
2187
|
+
const gradient = chunkAL2KLPOJ_js.buildSvgGradientDef(element.shapeStyle, element.id);
|
|
2188
|
+
const gradientPaint = gradient ? chunkAL2KLPOJ_js.svgGradientFillRef(gradient) : void 0;
|
|
2242
2189
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2243
2190
|
"svg",
|
|
2244
2191
|
{
|
|
@@ -2271,18 +2218,18 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2271
2218
|
);
|
|
2272
2219
|
}
|
|
2273
2220
|
}
|
|
2274
|
-
if (
|
|
2221
|
+
if (chunkAL2KLPOJ_js.isCalloutShape(normalizedType)) {
|
|
2275
2222
|
const width = Math.max(element.width, 1);
|
|
2276
2223
|
const height = Math.max(element.height, 1);
|
|
2277
|
-
const geometry =
|
|
2224
|
+
const geometry = chunkAL2KLPOJ_js.getCalloutLeaderLineGeometry(
|
|
2278
2225
|
normalizedType,
|
|
2279
2226
|
width,
|
|
2280
2227
|
height,
|
|
2281
2228
|
element.shapeAdjustments
|
|
2282
2229
|
);
|
|
2283
2230
|
if (geometry && geometry.points.length >= 2) {
|
|
2284
|
-
const leaderPath =
|
|
2285
|
-
const bounds =
|
|
2231
|
+
const leaderPath = chunkAL2KLPOJ_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
2232
|
+
const bounds = chunkAL2KLPOJ_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
2286
2233
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
2287
2234
|
const offsetLeft = bounds.minX;
|
|
2288
2235
|
const offsetTop = bounds.minY;
|
|
@@ -2345,10 +2292,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2345
2292
|
const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
|
|
2346
2293
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
2347
2294
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
2348
|
-
const connectorLineCap =
|
|
2295
|
+
const connectorLineCap = chunkAL2KLPOJ_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
2349
2296
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
2350
|
-
const offsets =
|
|
2351
|
-
const widths =
|
|
2297
|
+
const offsets = chunkAL2KLPOJ_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
2298
|
+
const widths = chunkAL2KLPOJ_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
2352
2299
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2353
2300
|
"svg",
|
|
2354
2301
|
{
|
|
@@ -2415,15 +2362,15 @@ function parseGradientFillCss(gradFill) {
|
|
|
2415
2362
|
}
|
|
2416
2363
|
const rawStops = stops.map((gs) => {
|
|
2417
2364
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
2418
|
-
const color =
|
|
2419
|
-
const opacity =
|
|
2365
|
+
const color = chunkAL2KLPOJ_js.parseDrawingColor(gs) ?? "#888888";
|
|
2366
|
+
const opacity = chunkAL2KLPOJ_js.parseDrawingColorOpacity(gs);
|
|
2420
2367
|
return { position: pos, color, opacity };
|
|
2421
2368
|
}).sort((a, b) => a.position - b.position);
|
|
2422
|
-
const stopStrings = rawStops.map((s) => `${
|
|
2369
|
+
const stopStrings = rawStops.map((s) => `${chunkAL2KLPOJ_js.colorWithOpacity(s.color, s.opacity)} ${s.position.toFixed(1)}%`).join(", ");
|
|
2423
2370
|
const lin = gradFill["a:lin"];
|
|
2424
2371
|
if (lin) {
|
|
2425
2372
|
const angRaw = Number.parseInt(String(lin["@_ang"] || "0"), 10);
|
|
2426
|
-
const angleDeg = Math.round(
|
|
2373
|
+
const angleDeg = Math.round(chunkAL2KLPOJ_js.ooxmlGradientAngleToCssDegrees(angRaw / 6e4));
|
|
2427
2374
|
return `linear-gradient(${angleDeg}deg, ${stopStrings})`;
|
|
2428
2375
|
}
|
|
2429
2376
|
const path = gradFill["a:path"];
|
|
@@ -2437,7 +2384,7 @@ function parseGradientFillCss(gradFill) {
|
|
|
2437
2384
|
b: Number.parseInt(String(fillToRectXml["@_b"] || "0"), 10) / 1e5
|
|
2438
2385
|
} : void 0;
|
|
2439
2386
|
if (pathType === "rect") {
|
|
2440
|
-
return
|
|
2387
|
+
return chunkAL2KLPOJ_js.buildRectPathGradient(rawStops, void 0, fillToRect);
|
|
2441
2388
|
}
|
|
2442
2389
|
let cx = 50;
|
|
2443
2390
|
let cy = 50;
|
|
@@ -2459,8 +2406,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
2459
2406
|
if (!pattFill) {
|
|
2460
2407
|
return void 0;
|
|
2461
2408
|
}
|
|
2462
|
-
const fgColor =
|
|
2463
|
-
const bgColor =
|
|
2409
|
+
const fgColor = chunkAL2KLPOJ_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
2410
|
+
const bgColor = chunkAL2KLPOJ_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
2464
2411
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
2465
2412
|
switch (preset) {
|
|
2466
2413
|
case "ltHorz":
|
|
@@ -2571,11 +2518,11 @@ function parseCellBorders(cellProperties) {
|
|
|
2571
2518
|
const prstDash = ln["a:prstDash"];
|
|
2572
2519
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
2573
2520
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
2574
|
-
const color =
|
|
2521
|
+
const color = chunkAL2KLPOJ_js.parseDrawingColor(ln["a:solidFill"]);
|
|
2575
2522
|
if (color) {
|
|
2576
|
-
const opacity =
|
|
2523
|
+
const opacity = chunkAL2KLPOJ_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
2577
2524
|
const key = `${edge.prefix}`;
|
|
2578
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
2525
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkAL2KLPOJ_js.colorWithOpacity(color, opacity)}`;
|
|
2579
2526
|
}
|
|
2580
2527
|
}
|
|
2581
2528
|
return borderStyle;
|
|
@@ -2588,7 +2535,7 @@ function parseCellTextEffects(runProps) {
|
|
|
2588
2535
|
const textShadowParts = [];
|
|
2589
2536
|
const outerShdw = effectLst["a:outerShdw"];
|
|
2590
2537
|
if (outerShdw) {
|
|
2591
|
-
const shdwColor =
|
|
2538
|
+
const shdwColor = chunkAL2KLPOJ_js.parseDrawingColor(outerShdw);
|
|
2592
2539
|
if (shdwColor) {
|
|
2593
2540
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
2594
2541
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -2606,7 +2553,7 @@ function parseCellTextEffects(runProps) {
|
|
|
2606
2553
|
}
|
|
2607
2554
|
const glow = effectLst["a:glow"];
|
|
2608
2555
|
if (glow) {
|
|
2609
|
-
const glowColor =
|
|
2556
|
+
const glowColor = chunkAL2KLPOJ_js.parseDrawingColor(glow);
|
|
2610
2557
|
if (glowColor) {
|
|
2611
2558
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
2612
2559
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -2686,10 +2633,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2686
2633
|
if (runProps?.["@_u"] !== void 0) {
|
|
2687
2634
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
2688
2635
|
}
|
|
2689
|
-
const runColor =
|
|
2636
|
+
const runColor = chunkAL2KLPOJ_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkAL2KLPOJ_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
2690
2637
|
if (runColor) {
|
|
2691
|
-
const opacity =
|
|
2692
|
-
cellStyle.color =
|
|
2638
|
+
const opacity = chunkAL2KLPOJ_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
2639
|
+
cellStyle.color = chunkAL2KLPOJ_js.colorWithOpacity(runColor, opacity);
|
|
2693
2640
|
}
|
|
2694
2641
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
2695
2642
|
if (fontFamily) {
|
|
@@ -2699,15 +2646,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2699
2646
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
2700
2647
|
}
|
|
2701
2648
|
const cellProperties = cellXml["a:tcPr"];
|
|
2702
|
-
const cellFill =
|
|
2649
|
+
const cellFill = chunkAL2KLPOJ_js.parseDrawingColor(
|
|
2703
2650
|
cellProperties?.["a:solidFill"],
|
|
2704
2651
|
schemeColorOverrides
|
|
2705
2652
|
);
|
|
2706
2653
|
if (cellFill) {
|
|
2707
|
-
const opacity =
|
|
2654
|
+
const opacity = chunkAL2KLPOJ_js.parseDrawingColorOpacity(
|
|
2708
2655
|
cellProperties?.["a:solidFill"]
|
|
2709
2656
|
);
|
|
2710
|
-
cellStyle.backgroundColor =
|
|
2657
|
+
cellStyle.backgroundColor = chunkAL2KLPOJ_js.colorWithOpacity(cellFill, opacity);
|
|
2711
2658
|
} else {
|
|
2712
2659
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
2713
2660
|
if (gradCss) {
|
|
@@ -2722,16 +2669,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2722
2669
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
2723
2670
|
Object.assign(cellStyle, edgeBorders);
|
|
2724
2671
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
2725
|
-
const borderColor =
|
|
2672
|
+
const borderColor = chunkAL2KLPOJ_js.parseDrawingColor(
|
|
2726
2673
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
2727
2674
|
schemeColorOverrides
|
|
2728
|
-
) ||
|
|
2675
|
+
) || chunkAL2KLPOJ_js.parseDrawingColor(
|
|
2729
2676
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
2730
2677
|
schemeColorOverrides
|
|
2731
|
-
) ||
|
|
2678
|
+
) || chunkAL2KLPOJ_js.parseDrawingColor(
|
|
2732
2679
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
2733
2680
|
schemeColorOverrides
|
|
2734
|
-
) ||
|
|
2681
|
+
) || chunkAL2KLPOJ_js.parseDrawingColor(
|
|
2735
2682
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
2736
2683
|
schemeColorOverrides
|
|
2737
2684
|
);
|
|
@@ -2803,7 +2750,7 @@ function getTableCellBandStyle2(element, rowIndex, cellIndex, rowCount, columnCo
|
|
|
2803
2750
|
if (element.type !== "table") {
|
|
2804
2751
|
return void 0;
|
|
2805
2752
|
}
|
|
2806
|
-
return
|
|
2753
|
+
return chunkAL2KLPOJ_js.getTableCellBandStyle(element.tableData, rowIndex, cellIndex, rowCount, columnCount, {
|
|
2807
2754
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
2808
2755
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
2809
2756
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -2879,7 +2826,7 @@ function renderTableCellContent(cell, fallbackText) {
|
|
|
2879
2826
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2880
2827
|
"span",
|
|
2881
2828
|
{
|
|
2882
|
-
style: { position: "relative", ...
|
|
2829
|
+
style: { position: "relative", ...chunkAL2KLPOJ_js.cellRunStyle(run) },
|
|
2883
2830
|
children: run.text
|
|
2884
2831
|
},
|
|
2885
2832
|
`r-${index}`
|
|
@@ -2887,7 +2834,7 @@ function renderTableCellContent(cell, fallbackText) {
|
|
|
2887
2834
|
});
|
|
2888
2835
|
}
|
|
2889
2836
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
2890
|
-
return
|
|
2837
|
+
return chunkAL2KLPOJ_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
2891
2838
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
2892
2839
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
2893
2840
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -2946,18 +2893,18 @@ function TableCellInput({
|
|
|
2946
2893
|
onCommit,
|
|
2947
2894
|
onCancel
|
|
2948
2895
|
}) {
|
|
2949
|
-
const inputRef =
|
|
2950
|
-
const committedRef =
|
|
2951
|
-
const onCommitRef =
|
|
2896
|
+
const inputRef = React7.useRef(null);
|
|
2897
|
+
const committedRef = React7.useRef(false);
|
|
2898
|
+
const onCommitRef = React7.useRef(onCommit);
|
|
2952
2899
|
onCommitRef.current = onCommit;
|
|
2953
|
-
|
|
2900
|
+
React7.useEffect(() => {
|
|
2954
2901
|
const el = inputRef.current;
|
|
2955
2902
|
if (el) {
|
|
2956
2903
|
el.focus();
|
|
2957
2904
|
el.select();
|
|
2958
2905
|
}
|
|
2959
2906
|
}, []);
|
|
2960
|
-
|
|
2907
|
+
React7.useEffect(() => {
|
|
2961
2908
|
const input = inputRef.current;
|
|
2962
2909
|
return () => {
|
|
2963
2910
|
if (!committedRef.current && input) {
|
|
@@ -3017,11 +2964,11 @@ function TableResizeOverlay({
|
|
|
3017
2964
|
onResizeColumns,
|
|
3018
2965
|
onResizeRow
|
|
3019
2966
|
}) {
|
|
3020
|
-
const containerRef =
|
|
3021
|
-
const [rowBounds, setRowBounds] =
|
|
3022
|
-
const dragRef =
|
|
3023
|
-
const colBoundaries =
|
|
3024
|
-
const measureRows =
|
|
2967
|
+
const containerRef = React7.useRef(null);
|
|
2968
|
+
const [rowBounds, setRowBounds] = React7.useState([]);
|
|
2969
|
+
const dragRef = React7.useRef(null);
|
|
2970
|
+
const colBoundaries = React7.useMemo(() => chunkAL2KLPOJ_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
2971
|
+
const measureRows = React7.useCallback(() => {
|
|
3025
2972
|
const container = containerRef.current;
|
|
3026
2973
|
if (!container) {
|
|
3027
2974
|
return;
|
|
@@ -3046,10 +2993,10 @@ function TableResizeOverlay({
|
|
|
3046
2993
|
return bounds;
|
|
3047
2994
|
});
|
|
3048
2995
|
}, []);
|
|
3049
|
-
|
|
2996
|
+
React7.useLayoutEffect(() => {
|
|
3050
2997
|
measureRows();
|
|
3051
2998
|
});
|
|
3052
|
-
|
|
2999
|
+
React7.useEffect(() => {
|
|
3053
3000
|
const handleMouseMove = (e) => {
|
|
3054
3001
|
const drag = dragRef.current;
|
|
3055
3002
|
if (!drag) {
|
|
@@ -3067,11 +3014,11 @@ function TableResizeOverlay({
|
|
|
3067
3014
|
const rect = containerRef.current.getBoundingClientRect();
|
|
3068
3015
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
3069
3016
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
3070
|
-
onResizeColumns(
|
|
3017
|
+
onResizeColumns(chunkAL2KLPOJ_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
3071
3018
|
} else if (drag.type === "row" && onResizeRow) {
|
|
3072
3019
|
const deltaY = e.clientY - drag.startPos;
|
|
3073
|
-
const newHeight =
|
|
3074
|
-
drag.initialRowHeight ??
|
|
3020
|
+
const newHeight = chunkAL2KLPOJ_js.computeResizedRowHeight(
|
|
3021
|
+
drag.initialRowHeight ?? chunkAL2KLPOJ_js.DEFAULT_ROW_HEIGHT,
|
|
3075
3022
|
deltaY
|
|
3076
3023
|
);
|
|
3077
3024
|
onResizeRow(drag.index, newHeight);
|
|
@@ -3109,7 +3056,7 @@ function TableResizeOverlay({
|
|
|
3109
3056
|
e.stopPropagation();
|
|
3110
3057
|
const table = containerRef.current?.querySelector("table");
|
|
3111
3058
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
3112
|
-
const actualHeight = tr?.offsetHeight ??
|
|
3059
|
+
const actualHeight = tr?.offsetHeight ?? chunkAL2KLPOJ_js.DEFAULT_ROW_HEIGHT;
|
|
3113
3060
|
document.body.style.cursor = "row-resize";
|
|
3114
3061
|
document.body.style.userSelect = "none";
|
|
3115
3062
|
dragRef.current = {
|
|
@@ -3149,14 +3096,14 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3149
3096
|
const rowCount = tableData.rows.length;
|
|
3150
3097
|
const columnCount = tableData.columnWidths.length;
|
|
3151
3098
|
const selectedCell = options?.selectedCell || null;
|
|
3152
|
-
const isEditable = Boolean(options?.editable);
|
|
3099
|
+
const isEditable = Boolean(options?.editable) && chunkAL2KLPOJ_js.canDrillDown(element);
|
|
3153
3100
|
const hasCellSelectionHandler = typeof options?.onSelectCell === "function";
|
|
3154
3101
|
const sharedCtx = {
|
|
3155
3102
|
tableStyleMap: options?.styleCtx?.tableStyleMap,
|
|
3156
3103
|
colorScheme: options?.styleCtx?.theme?.colorScheme,
|
|
3157
3104
|
fontScheme: options?.styleCtx?.theme?.fontScheme
|
|
3158
3105
|
};
|
|
3159
|
-
const cellCss = (cell, rowIndex, cellIndex) =>
|
|
3106
|
+
const cellCss = (cell, rowIndex, cellIndex) => chunkAL2KLPOJ_js.tableCellCss(
|
|
3160
3107
|
tableData,
|
|
3161
3108
|
cell,
|
|
3162
3109
|
{ rowIndex, cellIndex, rowCount, columnCount },
|
|
@@ -3169,7 +3116,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3169
3116
|
}
|
|
3170
3117
|
const first = selectedCell.selectedCells[0];
|
|
3171
3118
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
3172
|
-
return
|
|
3119
|
+
return chunkAL2KLPOJ_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
3173
3120
|
})();
|
|
3174
3121
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3175
3122
|
TableResizeOverlay,
|
|
@@ -3190,9 +3137,9 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3190
3137
|
{
|
|
3191
3138
|
className: "w-full h-full border-collapse table-fixed",
|
|
3192
3139
|
style: {
|
|
3193
|
-
fontFamily:
|
|
3140
|
+
fontFamily: chunkAL2KLPOJ_js.DEFAULT_FONT_FAMILY,
|
|
3194
3141
|
// `a:tblPr@rtl` mirrors the column order for RTL decks.
|
|
3195
|
-
...
|
|
3142
|
+
...chunkAL2KLPOJ_js.tableContainerCss(tableData)
|
|
3196
3143
|
},
|
|
3197
3144
|
children: [
|
|
3198
3145
|
tableData.columnWidths.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: tableData.columnWidths.map((w, ci) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3211,7 +3158,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3211
3158
|
return null;
|
|
3212
3159
|
}
|
|
3213
3160
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
3214
|
-
const isInMultiSelection =
|
|
3161
|
+
const isInMultiSelection = chunkAL2KLPOJ_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
3215
3162
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
3216
3163
|
const diag = getCellDiagonalBorders2(
|
|
3217
3164
|
cell.style,
|
|
@@ -3240,7 +3187,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3240
3187
|
}
|
|
3241
3188
|
event.stopPropagation();
|
|
3242
3189
|
if (event.shiftKey && selectedCell) {
|
|
3243
|
-
const rect =
|
|
3190
|
+
const rect = chunkAL2KLPOJ_js.computeSelectionRect(
|
|
3244
3191
|
selectedCell.rowIndex,
|
|
3245
3192
|
selectedCell.columnIndex,
|
|
3246
3193
|
rowIndex,
|
|
@@ -3250,7 +3197,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3250
3197
|
options?.onSelectCell?.({
|
|
3251
3198
|
rowIndex: selectedCell.rowIndex,
|
|
3252
3199
|
columnIndex: selectedCell.columnIndex,
|
|
3253
|
-
selectedCells:
|
|
3200
|
+
selectedCells: chunkAL2KLPOJ_js.rectToCells(rect)
|
|
3254
3201
|
});
|
|
3255
3202
|
} else {
|
|
3256
3203
|
options?.onSelectCell?.({
|
|
@@ -3311,10 +3258,10 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3311
3258
|
if (tableEl2.tableData && tableEl2.tableData.rows.length > 0) {
|
|
3312
3259
|
return renderTableFromTableData(tableEl2, textStyle, options);
|
|
3313
3260
|
}
|
|
3314
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
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: chunkMZI4DG3S_js.translationsEn["pptx.table.title"] });
|
|
3315
3262
|
}
|
|
3316
3263
|
const selectedCell = options?.selectedCell || null;
|
|
3317
|
-
const isEditable = Boolean(options?.editable);
|
|
3264
|
+
const isEditable = Boolean(options?.editable) && chunkAL2KLPOJ_js.canDrillDown(element);
|
|
3318
3265
|
const hasCellSelectionHandler = typeof options?.onSelectCell === "function";
|
|
3319
3266
|
const tableEl = element;
|
|
3320
3267
|
const xmlSelectionRect = (() => {
|
|
@@ -3326,7 +3273,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3326
3273
|
}
|
|
3327
3274
|
const first = selectedCell.selectedCells[0];
|
|
3328
3275
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
3329
|
-
return
|
|
3276
|
+
return chunkAL2KLPOJ_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
3330
3277
|
})();
|
|
3331
3278
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
3332
3279
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3348,9 +3295,9 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3348
3295
|
{
|
|
3349
3296
|
className: "w-full h-full border-collapse table-fixed",
|
|
3350
3297
|
style: {
|
|
3351
|
-
fontFamily:
|
|
3298
|
+
fontFamily: chunkAL2KLPOJ_js.DEFAULT_FONT_FAMILY,
|
|
3352
3299
|
// `a:tblPr@rtl` mirrors the column order for RTL decks.
|
|
3353
|
-
...
|
|
3300
|
+
...chunkAL2KLPOJ_js.tableContainerCss(tableEl.tableData)
|
|
3354
3301
|
},
|
|
3355
3302
|
children: [
|
|
3356
3303
|
parsedTable.columnPercentages.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: parsedTable.columnPercentages.map((percentage, columnIndex) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3407,7 +3354,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3407
3354
|
color: textStyle.color,
|
|
3408
3355
|
...bandStyle,
|
|
3409
3356
|
...xmlCellStyle,
|
|
3410
|
-
...tdCellOverride ?
|
|
3357
|
+
...tdCellOverride ? chunkAL2KLPOJ_js.cellStyleToCss(tdCellOverride) : void 0,
|
|
3411
3358
|
...diag ? { position: "relative" } : void 0
|
|
3412
3359
|
};
|
|
3413
3360
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3417,7 +3364,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3417
3364
|
"border px-1 py-0.5 align-top",
|
|
3418
3365
|
isEditable && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
3419
3366
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
3420
|
-
|
|
3367
|
+
chunkAL2KLPOJ_js.isCellInRect(rowIndex, cellIndex, xmlSelectionRect) && !(selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex) ? "bg-blue-500/15 ring-1 ring-inset ring-blue-400/50" : null
|
|
3421
3368
|
),
|
|
3422
3369
|
colSpan,
|
|
3423
3370
|
rowSpan: rSpan,
|
|
@@ -3428,7 +3375,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3428
3375
|
}
|
|
3429
3376
|
event.stopPropagation();
|
|
3430
3377
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
3431
|
-
const rect =
|
|
3378
|
+
const rect = chunkAL2KLPOJ_js.computeSelectionRect(
|
|
3432
3379
|
selectedCell.rowIndex,
|
|
3433
3380
|
selectedCell.columnIndex,
|
|
3434
3381
|
rowIndex,
|
|
@@ -3438,7 +3385,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3438
3385
|
options?.onSelectCell?.({
|
|
3439
3386
|
rowIndex: selectedCell.rowIndex,
|
|
3440
3387
|
columnIndex: selectedCell.columnIndex,
|
|
3441
|
-
selectedCells:
|
|
3388
|
+
selectedCells: chunkAL2KLPOJ_js.rectToCells(rect)
|
|
3442
3389
|
});
|
|
3443
3390
|
} else {
|
|
3444
3391
|
options?.onSelectCell?.({
|
|
@@ -3497,23 +3444,23 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3497
3444
|
);
|
|
3498
3445
|
}
|
|
3499
3446
|
function partAttrs(part) {
|
|
3500
|
-
return part ?
|
|
3447
|
+
return part ? chunkAL2KLPOJ_js.chartPartToAttrs(part) : void 0;
|
|
3501
3448
|
}
|
|
3502
3449
|
function resolveReactPalette(chartData) {
|
|
3503
3450
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
3504
3451
|
return chartData.colorPalette;
|
|
3505
3452
|
}
|
|
3506
|
-
return [...
|
|
3453
|
+
return [...chunkAL2KLPOJ_js.getChartStylePalette(chartData.style?.styleId)];
|
|
3507
3454
|
}
|
|
3508
3455
|
function buildReactChartViewModel(element) {
|
|
3509
3456
|
if (element.type !== "chart" || !element.chartData) {
|
|
3510
|
-
return
|
|
3457
|
+
return chunkAL2KLPOJ_js.buildChartViewModel(element);
|
|
3511
3458
|
}
|
|
3512
3459
|
const palette = resolveReactPalette(element.chartData), themedElement = {
|
|
3513
3460
|
...element,
|
|
3514
3461
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
3515
3462
|
};
|
|
3516
|
-
return
|
|
3463
|
+
return chunkAL2KLPOJ_js.buildChartViewModel(themedElement);
|
|
3517
3464
|
}
|
|
3518
3465
|
function renderPrimitive(prim, key) {
|
|
3519
3466
|
switch (prim.kind) {
|
|
@@ -3662,7 +3609,7 @@ function renderText(t, key) {
|
|
|
3662
3609
|
);
|
|
3663
3610
|
}
|
|
3664
3611
|
function renderChartViewModel(elementId, vm, preserveAspectRatio = "none") {
|
|
3665
|
-
const legendItems =
|
|
3612
|
+
const legendItems = chunkAL2KLPOJ_js.computeChartLegendLayout(vm);
|
|
3666
3613
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3667
3614
|
"svg",
|
|
3668
3615
|
{
|
|
@@ -3670,16 +3617,50 @@ function renderChartViewModel(elementId, vm, preserveAspectRatio = "none") {
|
|
|
3670
3617
|
viewBox: `0 0 ${vm.svgWidth} ${vm.svgHeight}`,
|
|
3671
3618
|
preserveAspectRatio,
|
|
3672
3619
|
children: [
|
|
3673
|
-
vm.
|
|
3620
|
+
vm.defs && vm.defs.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("defs", { children: vm.defs.map((def, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3621
|
+
"pattern",
|
|
3622
|
+
{
|
|
3623
|
+
id: def.id,
|
|
3624
|
+
patternUnits: def.patternUnits,
|
|
3625
|
+
x: def.x,
|
|
3626
|
+
y: def.y,
|
|
3627
|
+
width: def.width,
|
|
3628
|
+
height: def.height,
|
|
3629
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3630
|
+
"image",
|
|
3631
|
+
{
|
|
3632
|
+
href: def.href,
|
|
3633
|
+
x: 0,
|
|
3634
|
+
y: 0,
|
|
3635
|
+
width: def.width,
|
|
3636
|
+
height: def.height,
|
|
3637
|
+
preserveAspectRatio: def.preserveAspectRatio
|
|
3638
|
+
}
|
|
3639
|
+
)
|
|
3640
|
+
},
|
|
3641
|
+
`${elementId}-def-${i}`
|
|
3642
|
+
)) }),
|
|
3643
|
+
vm.areaFill && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3644
|
+
"rect",
|
|
3645
|
+
{
|
|
3646
|
+
x: 0,
|
|
3647
|
+
y: 0,
|
|
3648
|
+
width: vm.svgWidth,
|
|
3649
|
+
height: vm.svgHeight,
|
|
3650
|
+
rx: vm.areaRadius,
|
|
3651
|
+
fill: vm.areaFill
|
|
3652
|
+
}
|
|
3653
|
+
),
|
|
3674
3654
|
vm.title && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3675
3655
|
"text",
|
|
3676
3656
|
{
|
|
3677
3657
|
x: vm.titleX,
|
|
3678
3658
|
y: vm.titleY,
|
|
3679
3659
|
textAnchor: "middle",
|
|
3680
|
-
fontSize: 12,
|
|
3681
|
-
fontWeight: 600,
|
|
3682
|
-
|
|
3660
|
+
fontSize: vm.titleStyle?.fontSize ?? 12,
|
|
3661
|
+
fontWeight: vm.titleStyle?.fontWeight ?? 600,
|
|
3662
|
+
fontFamily: vm.titleStyle?.fontFamily,
|
|
3663
|
+
fill: vm.titleStyle?.fill ?? "#1e293b",
|
|
3683
3664
|
"data-chart-part": "title",
|
|
3684
3665
|
children: vm.title
|
|
3685
3666
|
}
|
|
@@ -3755,17 +3736,17 @@ function renderChartViewModel(elementId, vm, preserveAspectRatio = "none") {
|
|
|
3755
3736
|
}
|
|
3756
3737
|
function renderChartElement(element) {
|
|
3757
3738
|
if (element.type !== "chart") {
|
|
3758
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
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: chunkMZI4DG3S_js.translationsEn["pptx.chart.heading"] });
|
|
3759
3740
|
}
|
|
3760
3741
|
const chartData = element.chartData;
|
|
3761
3742
|
if (!chartData || chartData.series.length === 0) {
|
|
3762
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children:
|
|
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: chunkMZI4DG3S_js.translationsEn["pptx.chart.heading"] });
|
|
3763
3744
|
}
|
|
3764
|
-
const kind =
|
|
3745
|
+
const kind = chunkAL2KLPOJ_js.resolveChartKind(chartData.chartType ?? "bar");
|
|
3765
3746
|
return renderChartViewModel(
|
|
3766
3747
|
element.id,
|
|
3767
3748
|
buildReactChartViewModel(element),
|
|
3768
|
-
|
|
3749
|
+
chunkAL2KLPOJ_js.chartPreserveAspectRatio(kind)
|
|
3769
3750
|
);
|
|
3770
3751
|
}
|
|
3771
3752
|
|
|
@@ -3785,14 +3766,14 @@ function buildNotesPdf(pages) {
|
|
|
3785
3766
|
notes: page.notes,
|
|
3786
3767
|
slideNumber: page.slideNumber
|
|
3787
3768
|
}));
|
|
3788
|
-
const bytes =
|
|
3769
|
+
const bytes = chunkAL2KLPOJ_js.buildNotesPdfBytes(images, meta);
|
|
3789
3770
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
3790
3771
|
return URL.createObjectURL(blob);
|
|
3791
3772
|
}
|
|
3792
3773
|
|
|
3793
3774
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
3794
3775
|
function buildPdfFromImageData(images) {
|
|
3795
|
-
const bytes =
|
|
3776
|
+
const bytes = chunkAL2KLPOJ_js.buildSlidesPdfBytes(images);
|
|
3796
3777
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
3797
3778
|
return URL.createObjectURL(blob);
|
|
3798
3779
|
}
|
|
@@ -3801,7 +3782,7 @@ function buildPdfFromImageData(images) {
|
|
|
3801
3782
|
var activePreview = null;
|
|
3802
3783
|
function startPreviewAnimation(elementId, preset, options) {
|
|
3803
3784
|
stopPreviewAnimation();
|
|
3804
|
-
const descriptor =
|
|
3785
|
+
const descriptor = chunkAL2KLPOJ_js.buildPreviewAnimation(preset, options);
|
|
3805
3786
|
if (!descriptor) {
|
|
3806
3787
|
return;
|
|
3807
3788
|
}
|
|
@@ -3814,7 +3795,7 @@ function startMotionPathPreview(elementId, path, options) {
|
|
|
3814
3795
|
return;
|
|
3815
3796
|
}
|
|
3816
3797
|
const stage = domEl.offsetParent;
|
|
3817
|
-
const descriptor =
|
|
3798
|
+
const descriptor = chunkAL2KLPOJ_js.buildMotionPathPreview({
|
|
3818
3799
|
path,
|
|
3819
3800
|
slideWidth: stage?.offsetWidth || DEFAULT_PREVIEW_SLIDE_WIDTH,
|
|
3820
3801
|
slideHeight: stage?.offsetHeight || DEFAULT_PREVIEW_SLIDE_HEIGHT,
|