pptx-react-viewer 3.5.4 → 3.7.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 +25 -0
- package/dist/{AiChatPanel-CCJNQGER.mjs → AiChatPanel-L5QGWVZK.mjs} +4 -4
- package/dist/AiChatPanel-L5QGWVZK.mjs.br +0 -0
- package/dist/AiChatPanel-L5QGWVZK.mjs.gz +0 -0
- package/dist/{AiChatPanel-LPZWDNVU.js → AiChatPanel-M3AHKYPS.js} +25 -25
- package/dist/AiChatPanel-M3AHKYPS.js.br +0 -0
- package/dist/AiChatPanel-M3AHKYPS.js.gz +0 -0
- package/dist/{Area3DChartScene-P6YM6ZL7.mjs → Area3DChartScene-AE2XYKDW.mjs} +1 -1
- package/dist/Area3DChartScene-AE2XYKDW.mjs.br +1 -0
- package/dist/Area3DChartScene-AE2XYKDW.mjs.gz +0 -0
- package/dist/{Area3DChartScene-LJCWBNQ3.js → Area3DChartScene-ZQLQK6L4.js} +2 -2
- package/dist/Area3DChartScene-ZQLQK6L4.js.br +0 -0
- package/dist/Area3DChartScene-ZQLQK6L4.js.gz +0 -0
- package/dist/{Bar3DChartScene-DIVOJURZ.mjs → Bar3DChartScene-FQV62XOI.mjs} +1 -1
- package/dist/Bar3DChartScene-FQV62XOI.mjs.br +2 -0
- package/dist/Bar3DChartScene-FQV62XOI.mjs.gz +0 -0
- package/dist/{Bar3DChartScene-7DNQ4X5T.js → Bar3DChartScene-TZ6ADFBS.js} +2 -2
- package/dist/Bar3DChartScene-TZ6ADFBS.js.br +0 -0
- package/dist/Bar3DChartScene-TZ6ADFBS.js.gz +0 -0
- package/dist/{Line3DChartScene-UF6DHP36.js → Line3DChartScene-5CKPAX63.js} +2 -2
- package/dist/Line3DChartScene-5CKPAX63.js.br +0 -0
- package/dist/Line3DChartScene-5CKPAX63.js.gz +0 -0
- package/dist/{Line3DChartScene-ZZVNUKIJ.mjs → Line3DChartScene-FEUY3PCE.mjs} +1 -1
- package/dist/Line3DChartScene-FEUY3PCE.mjs.br +1 -0
- package/dist/Line3DChartScene-FEUY3PCE.mjs.gz +0 -0
- package/dist/{Model3DScene-C7MZ22DH.js → Model3DScene-BLXEALM6.js} +2 -2
- package/dist/Model3DScene-BLXEALM6.js.br +0 -0
- package/dist/Model3DScene-BLXEALM6.js.gz +0 -0
- package/dist/{Model3DScene-XXMAAKBR.mjs → Model3DScene-V3DHIISV.mjs} +1 -1
- package/dist/Model3DScene-V3DHIISV.mjs.br +0 -0
- package/dist/Model3DScene-V3DHIISV.mjs.gz +0 -0
- package/dist/{PieChart3DScene-N2Y25VG5.js → PieChart3DScene-GHHT3PDV.js} +2 -2
- package/dist/PieChart3DScene-GHHT3PDV.js.br +0 -0
- package/dist/PieChart3DScene-GHHT3PDV.js.gz +0 -0
- package/dist/{PieChart3DScene-7LX3IL2Q.mjs → PieChart3DScene-VZI2VARG.mjs} +1 -1
- package/dist/{PieChart3DScene-7LX3IL2Q.mjs.br → PieChart3DScene-VZI2VARG.mjs.br} +0 -0
- package/dist/PieChart3DScene-VZI2VARG.mjs.gz +0 -0
- package/dist/PowerPointViewer-Cl6jBPNw.d.ts.map +1 -1
- package/dist/{SurfaceChart3DScene-ADA7NUIW.mjs → SurfaceChart3DScene-T36E2HBA.mjs} +1 -1
- package/dist/SurfaceChart3DScene-T36E2HBA.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-T36E2HBA.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-WXJHYOGJ.js → SurfaceChart3DScene-WWIMQ65D.js} +2 -2
- package/dist/SurfaceChart3DScene-WWIMQ65D.js.br +0 -0
- package/dist/SurfaceChart3DScene-WWIMQ65D.js.gz +0 -0
- package/dist/{chunk-UOMFINNJ.js → chunk-3EJFZ7TE.js} +33 -5
- package/dist/chunk-3EJFZ7TE.js.br +0 -0
- package/dist/chunk-3EJFZ7TE.js.gz +0 -0
- package/dist/{chunk-YQOK4E2A.js → chunk-DCNHUEWQ.js} +35917 -23497
- package/dist/chunk-DCNHUEWQ.js.br +0 -0
- package/dist/chunk-DCNHUEWQ.js.gz +0 -0
- package/dist/{chunk-JCJ3EPG6.mjs → chunk-FGTMS7LR.mjs} +14 -23
- package/dist/chunk-FGTMS7LR.mjs.br +0 -0
- package/dist/chunk-FGTMS7LR.mjs.gz +0 -0
- package/dist/{chunk-U52MKWVA.mjs → chunk-JANUSAEK.mjs} +189 -225
- package/dist/chunk-JANUSAEK.mjs.br +0 -0
- package/dist/chunk-JANUSAEK.mjs.gz +0 -0
- package/dist/{chunk-NM652EZS.mjs → chunk-NV55GU5V.mjs} +35881 -23494
- package/dist/chunk-NV55GU5V.mjs.br +0 -0
- package/dist/chunk-NV55GU5V.mjs.gz +0 -0
- package/dist/{chunk-2FMQ7M3L.js → chunk-OBE4TB76.js} +494 -575
- package/dist/chunk-OBE4TB76.js.br +0 -0
- package/dist/chunk-OBE4TB76.js.gz +0 -0
- package/dist/{chunk-EVVWCF2M.mjs → chunk-PC62KGU3.mjs} +67 -148
- package/dist/chunk-PC62KGU3.mjs.br +0 -0
- package/dist/chunk-PC62KGU3.mjs.gz +0 -0
- package/dist/{chunk-HHJZK26I.js → chunk-TUSALM3A.js} +1603 -1310
- package/dist/chunk-TUSALM3A.js.br +0 -0
- package/dist/chunk-TUSALM3A.js.gz +0 -0
- package/dist/{chunk-IWQSAKPM.mjs → chunk-TXY2E7VQ.mjs} +445 -152
- package/dist/chunk-TXY2E7VQ.mjs.br +0 -0
- package/dist/chunk-TXY2E7VQ.mjs.gz +0 -0
- package/dist/{chunk-UTMTXJGM.js → chunk-VIFDZIVX.js} +375 -412
- package/dist/chunk-VIFDZIVX.js.br +0 -0
- package/dist/chunk-VIFDZIVX.js.gz +0 -0
- package/dist/{chunk-UTIMT5CZ.js → chunk-W24OJ7H5.js} +14 -23
- package/dist/chunk-W24OJ7H5.js.br +0 -0
- package/dist/chunk-W24OJ7H5.js.gz +0 -0
- package/dist/{chunk-IVPT3U5C.mjs → chunk-WKODF5ZU.mjs} +29 -1
- package/dist/chunk-WKODF5ZU.mjs.br +0 -0
- package/dist/chunk-WKODF5ZU.mjs.gz +0 -0
- package/dist/i18n.js +4 -4
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.d.ts +1012 -45
- 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 +1023 -45
- 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 +933 -45
- package/dist/viewer/index.js +27 -27
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +6 -6
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +2 -2
- package/dist/AiChatPanel-CCJNQGER.mjs.br +0 -0
- package/dist/AiChatPanel-CCJNQGER.mjs.gz +0 -0
- package/dist/AiChatPanel-LPZWDNVU.js.br +0 -0
- package/dist/AiChatPanel-LPZWDNVU.js.gz +0 -0
- package/dist/Area3DChartScene-LJCWBNQ3.js.br +0 -0
- package/dist/Area3DChartScene-LJCWBNQ3.js.gz +0 -0
- package/dist/Area3DChartScene-P6YM6ZL7.mjs.br +0 -0
- package/dist/Area3DChartScene-P6YM6ZL7.mjs.gz +0 -0
- package/dist/Bar3DChartScene-7DNQ4X5T.js.br +0 -1
- package/dist/Bar3DChartScene-7DNQ4X5T.js.gz +0 -0
- package/dist/Bar3DChartScene-DIVOJURZ.mjs.br +0 -0
- package/dist/Bar3DChartScene-DIVOJURZ.mjs.gz +0 -0
- package/dist/Line3DChartScene-UF6DHP36.js.br +0 -0
- package/dist/Line3DChartScene-UF6DHP36.js.gz +0 -0
- package/dist/Line3DChartScene-ZZVNUKIJ.mjs.br +0 -0
- package/dist/Line3DChartScene-ZZVNUKIJ.mjs.gz +0 -0
- package/dist/Model3DScene-C7MZ22DH.js.br +0 -0
- package/dist/Model3DScene-C7MZ22DH.js.gz +0 -0
- package/dist/Model3DScene-XXMAAKBR.mjs.br +0 -0
- package/dist/Model3DScene-XXMAAKBR.mjs.gz +0 -0
- package/dist/PieChart3DScene-7LX3IL2Q.mjs.gz +0 -0
- package/dist/PieChart3DScene-N2Y25VG5.js.br +0 -0
- package/dist/PieChart3DScene-N2Y25VG5.js.gz +0 -0
- package/dist/SurfaceChart3DScene-ADA7NUIW.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-ADA7NUIW.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-WXJHYOGJ.js.br +0 -0
- package/dist/SurfaceChart3DScene-WXJHYOGJ.js.gz +0 -0
- package/dist/chunk-2FMQ7M3L.js.br +0 -0
- package/dist/chunk-2FMQ7M3L.js.gz +0 -0
- package/dist/chunk-EVVWCF2M.mjs.br +0 -0
- package/dist/chunk-EVVWCF2M.mjs.gz +0 -0
- package/dist/chunk-HHJZK26I.js.br +0 -0
- package/dist/chunk-HHJZK26I.js.gz +0 -0
- package/dist/chunk-IVPT3U5C.mjs.br +0 -0
- package/dist/chunk-IVPT3U5C.mjs.gz +0 -0
- package/dist/chunk-IWQSAKPM.mjs.br +0 -0
- package/dist/chunk-IWQSAKPM.mjs.gz +0 -0
- package/dist/chunk-JCJ3EPG6.mjs.br +0 -0
- package/dist/chunk-JCJ3EPG6.mjs.gz +0 -0
- package/dist/chunk-NM652EZS.mjs.br +0 -0
- package/dist/chunk-NM652EZS.mjs.gz +0 -0
- package/dist/chunk-U52MKWVA.mjs.br +0 -0
- package/dist/chunk-U52MKWVA.mjs.gz +0 -0
- package/dist/chunk-UOMFINNJ.js.br +0 -0
- package/dist/chunk-UOMFINNJ.js.gz +0 -0
- package/dist/chunk-UTIMT5CZ.js.br +0 -0
- package/dist/chunk-UTIMT5CZ.js.gz +0 -0
- package/dist/chunk-UTMTXJGM.js.br +0 -0
- package/dist/chunk-UTMTXJGM.js.gz +0 -0
- package/dist/chunk-YQOK4E2A.js.br +0 -0
- package/dist/chunk-YQOK4E2A.js.gz +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 chunkDCNHUEWQ_js = require('./chunk-DCNHUEWQ.js');
|
|
4
|
+
var chunkW24OJ7H5_js = require('./chunk-W24OJ7H5.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 chunkDCNHUEWQ_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 chunkDCNHUEWQ_js.cloneHistorySnapshot(snapshot);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
// src/viewer/constants/scalar.ts
|
|
@@ -61,23 +61,7 @@ var TOOLBAR_SECTIONS = [
|
|
|
61
61
|
{ id: "view", labelKey: "pptx.ribbon.tab.view" },
|
|
62
62
|
{ id: "help", labelKey: "pptx.ribbon.tab.help" }
|
|
63
63
|
];
|
|
64
|
-
var SHORTCUT_REFERENCE_ITEMS =
|
|
65
|
-
|
|
66
|
-
// src/viewer/constants/theme.ts
|
|
67
|
-
var THEME_COLOR_SWATCHES = [
|
|
68
|
-
"#000000",
|
|
69
|
-
"#FFFFFF",
|
|
70
|
-
"#1F497D",
|
|
71
|
-
"#EEECE1",
|
|
72
|
-
"#4472C4",
|
|
73
|
-
"#ED7D31",
|
|
74
|
-
"#A5A5A5",
|
|
75
|
-
"#FFC000",
|
|
76
|
-
"#5B9BD5",
|
|
77
|
-
"#70AD47",
|
|
78
|
-
"#0563C1",
|
|
79
|
-
"#954F72"
|
|
80
|
-
];
|
|
64
|
+
var SHORTCUT_REFERENCE_ITEMS = chunkDCNHUEWQ_js.VIEWER_SHORTCUT_REFERENCE;
|
|
81
65
|
|
|
82
66
|
// src/viewer/constants/transitions-animations.ts
|
|
83
67
|
var ANIMATION_PRESET_OPTIONS = [
|
|
@@ -105,12 +89,12 @@ var GLYPH_COMPONENTS = {
|
|
|
105
89
|
plus: lu.LuPlus,
|
|
106
90
|
triangle: lu.LuTriangle
|
|
107
91
|
};
|
|
108
|
-
var SHAPE_PRESETS =
|
|
92
|
+
var SHAPE_PRESETS = chunkDCNHUEWQ_js.SHAPE_PRESET_DEFS.map(
|
|
109
93
|
(def) => ({
|
|
110
94
|
type: def.type,
|
|
111
95
|
label: def.label,
|
|
112
96
|
i18nKey: def.i18nKey,
|
|
113
|
-
icon:
|
|
97
|
+
icon: React7__default.default.createElement(GLYPH_COMPONENTS[def.glyph], {
|
|
114
98
|
className: def.glyphClass ? `w-3.5 h-3.5 ${def.glyphClass}` : "w-3.5 h-3.5"
|
|
115
99
|
})
|
|
116
100
|
})
|
|
@@ -130,7 +114,7 @@ var ARROW_SIZE_OPTIONS = [
|
|
|
130
114
|
{ value: "med", label: "Medium", i18nKey: "pptx.connectorOptions.sizeMedium" },
|
|
131
115
|
{ value: "lg", label: "Large", i18nKey: "pptx.connectorOptions.sizeLarge" }
|
|
132
116
|
];
|
|
133
|
-
var STROKE_DASH_OPTIONS2 =
|
|
117
|
+
var STROKE_DASH_OPTIONS2 = chunkDCNHUEWQ_js.STROKE_DASH_OPTIONS;
|
|
134
118
|
|
|
135
119
|
// src/viewer/utils/shape-types.tsx
|
|
136
120
|
function getShapeType(shapeType) {
|
|
@@ -239,7 +223,7 @@ function isConnectorOrLineElement(element) {
|
|
|
239
223
|
if (element.type === "connector") {
|
|
240
224
|
return true;
|
|
241
225
|
}
|
|
242
|
-
if (!
|
|
226
|
+
if (!chunkDCNHUEWQ_js.hasShapeProperties(element)) {
|
|
243
227
|
return false;
|
|
244
228
|
}
|
|
245
229
|
const st = getShapeType(element.shapeType);
|
|
@@ -248,17 +232,17 @@ function isConnectorOrLineElement(element) {
|
|
|
248
232
|
|
|
249
233
|
// src/viewer/utils/image-style.ts
|
|
250
234
|
function getImageMaskStyle(element) {
|
|
251
|
-
if (!
|
|
235
|
+
if (!chunkDCNHUEWQ_js.hasShapeProperties(element)) {
|
|
252
236
|
return void 0;
|
|
253
237
|
}
|
|
254
|
-
const geometry =
|
|
238
|
+
const geometry = chunkDCNHUEWQ_js.resolveShapeGeometry(element);
|
|
255
239
|
if (geometry.kind === "borderRadius") {
|
|
256
240
|
return { borderRadius: geometry.radius };
|
|
257
241
|
}
|
|
258
242
|
return geometry.kind === "clipPath" ? { clipPath: geometry.clipPath } : void 0;
|
|
259
243
|
}
|
|
260
244
|
function getImageRenderStyle(element) {
|
|
261
|
-
const fit =
|
|
245
|
+
const fit = chunkDCNHUEWQ_js.getImageFitStyle(element);
|
|
262
246
|
return {
|
|
263
247
|
// A translated/scaled crop must be masked by its stationary wrapper, not
|
|
264
248
|
// by the moving bitmap itself.
|
|
@@ -275,7 +259,7 @@ function getImageSurfaceMaskStyle(element) {
|
|
|
275
259
|
};
|
|
276
260
|
}
|
|
277
261
|
function getImageSurfaceStyle(element) {
|
|
278
|
-
const fill =
|
|
262
|
+
const fill = chunkDCNHUEWQ_js.hasShapeProperties(element) ? chunkDCNHUEWQ_js.getComputedFillStyle(element) : void 0;
|
|
279
263
|
return {
|
|
280
264
|
position: "absolute",
|
|
281
265
|
inset: 0,
|
|
@@ -288,13 +272,13 @@ function getImageSurfaceStyle(element) {
|
|
|
288
272
|
};
|
|
289
273
|
}
|
|
290
274
|
function getCropShapeClipPath2(element) {
|
|
291
|
-
if (!
|
|
275
|
+
if (!chunkDCNHUEWQ_js.isImageLikeElement(element)) {
|
|
292
276
|
return void 0;
|
|
293
277
|
}
|
|
294
|
-
return
|
|
278
|
+
return chunkDCNHUEWQ_js.getCropShapeClipPath(element.cropShape, element.width, element.height);
|
|
295
279
|
}
|
|
296
280
|
function getImageTilingStyle2(element) {
|
|
297
|
-
return
|
|
281
|
+
return chunkDCNHUEWQ_js.getImageTilingStyle(element);
|
|
298
282
|
}
|
|
299
283
|
|
|
300
284
|
// src/viewer/utils/geometry-image.ts
|
|
@@ -336,24 +320,14 @@ function ensureArrayValue(value) {
|
|
|
336
320
|
// src/viewer/utils/media-persistent-audio.tsx
|
|
337
321
|
function buildTrimFragment(element) {
|
|
338
322
|
const start = element.trimStartMs;
|
|
339
|
-
|
|
340
|
-
if (start === void 0 && end === void 0) {
|
|
323
|
+
if (start === void 0 || start <= 0) {
|
|
341
324
|
return "";
|
|
342
325
|
}
|
|
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(",")}` : "";
|
|
326
|
+
return `#t=${(start / 1e3).toFixed(3)}`;
|
|
353
327
|
}
|
|
354
328
|
function useMediaMetadataExtraction(mediaRef, element) {
|
|
355
|
-
const [metadata, setMetadata] =
|
|
356
|
-
|
|
329
|
+
const [metadata, setMetadata] = React7.useState(element.metadata);
|
|
330
|
+
React7.useEffect(() => {
|
|
357
331
|
const el = mediaRef.current;
|
|
358
332
|
if (!el) {
|
|
359
333
|
return;
|
|
@@ -436,7 +410,7 @@ function VideoWithMetadata({
|
|
|
436
410
|
{
|
|
437
411
|
ref: mediaRef,
|
|
438
412
|
className: "w-full h-full pointer-events-auto",
|
|
439
|
-
style: isFullScreen ? { objectFit: "cover" } :
|
|
413
|
+
style: isFullScreen ? { objectFit: "cover" } : chunkDCNHUEWQ_js.getImageFitStyle(element),
|
|
440
414
|
controls: showTransport,
|
|
441
415
|
preload: "metadata",
|
|
442
416
|
playsInline: true,
|
|
@@ -489,49 +463,33 @@ function PresentationMediaController({
|
|
|
489
463
|
children
|
|
490
464
|
}) {
|
|
491
465
|
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;
|
|
466
|
+
const mediaRef = React7.useRef(null);
|
|
467
|
+
const [isMediaPlaying, setIsMediaPlaying] = React7.useState(false);
|
|
499
468
|
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
469
|
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 } = chunkYQOK4E2A_js.mediaPlaybackAttributes({
|
|
470
|
+
const { volume: playbackVolume, playbackRate } = chunkDCNHUEWQ_js.mediaPlaybackAttributes({
|
|
513
471
|
loop: element.loop,
|
|
514
472
|
volume: element.volume,
|
|
515
473
|
playbackSpeed: element.playbackSpeed
|
|
516
474
|
});
|
|
517
|
-
|
|
475
|
+
React7.useEffect(() => {
|
|
518
476
|
const el = mediaRef.current;
|
|
519
477
|
if (el) {
|
|
520
478
|
el.volume = playbackVolume;
|
|
521
479
|
}
|
|
522
480
|
}, [playbackVolume]);
|
|
523
|
-
|
|
481
|
+
React7.useEffect(() => {
|
|
524
482
|
const el = mediaRef.current;
|
|
525
483
|
if (el) {
|
|
526
484
|
el.playbackRate = playbackRate;
|
|
527
485
|
}
|
|
528
486
|
}, [playbackRate]);
|
|
529
|
-
|
|
487
|
+
React7.useEffect(() => {
|
|
530
488
|
const el = mediaRef.current;
|
|
531
489
|
if (!el) {
|
|
532
490
|
return;
|
|
533
491
|
}
|
|
534
|
-
const
|
|
492
|
+
const handlePlay = () => {
|
|
535
493
|
setIsMediaPlaying(true);
|
|
536
494
|
onPlayStateChange?.(true);
|
|
537
495
|
};
|
|
@@ -543,108 +501,42 @@ function PresentationMediaController({
|
|
|
543
501
|
setIsMediaPlaying(false);
|
|
544
502
|
onPlayStateChange?.(false);
|
|
545
503
|
};
|
|
546
|
-
el.addEventListener("play",
|
|
504
|
+
el.addEventListener("play", handlePlay);
|
|
547
505
|
el.addEventListener("pause", handlePause);
|
|
548
506
|
el.addEventListener("ended", handleEnded);
|
|
549
507
|
return () => {
|
|
550
|
-
el.removeEventListener("play",
|
|
508
|
+
el.removeEventListener("play", handlePlay);
|
|
551
509
|
el.removeEventListener("pause", handlePause);
|
|
552
510
|
el.removeEventListener("ended", handleEnded);
|
|
553
511
|
};
|
|
554
512
|
}, [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(() => {
|
|
513
|
+
React7.useEffect(() => {
|
|
574
514
|
const el = mediaRef.current;
|
|
575
515
|
if (!el || !isPresentationMode) {
|
|
576
516
|
return;
|
|
577
517
|
}
|
|
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(() => {
|
|
518
|
+
return chunkDCNHUEWQ_js.scheduleMediaTrimAndFade(el, {
|
|
519
|
+
trimStartMs: element.trimStartMs,
|
|
520
|
+
trimEndMs: element.trimEndMs,
|
|
521
|
+
fadeInDuration: element.fadeInDuration,
|
|
522
|
+
fadeOutDuration: element.fadeOutDuration,
|
|
523
|
+
volume: playbackVolume
|
|
524
|
+
});
|
|
525
|
+
}, [
|
|
526
|
+
isPresentationMode,
|
|
527
|
+
element.trimStartMs,
|
|
528
|
+
element.trimEndMs,
|
|
529
|
+
element.fadeInDuration,
|
|
530
|
+
element.fadeOutDuration,
|
|
531
|
+
playbackVolume
|
|
532
|
+
]);
|
|
533
|
+
React7.useEffect(() => {
|
|
642
534
|
if (!isPresentationMode || !shouldAutoPlay) {
|
|
643
535
|
return;
|
|
644
536
|
}
|
|
645
537
|
if (element.playAcrossSlides && element.mediaType === "audio") {
|
|
646
538
|
const dataUrl = element.mediaData ?? resolvedDataUrl;
|
|
647
|
-
if (
|
|
539
|
+
if (chunkDCNHUEWQ_js.registerCrossSlideAudio(element, dataUrl)) {
|
|
648
540
|
return;
|
|
649
541
|
}
|
|
650
542
|
}
|
|
@@ -666,14 +558,16 @@ function PresentationMediaController({
|
|
|
666
558
|
transition: "opacity 0.3s ease",
|
|
667
559
|
pointerEvents: isMediaPlaying ? "auto" : "none"
|
|
668
560
|
} : {};
|
|
669
|
-
const handleStopFullScreen =
|
|
561
|
+
const handleStopFullScreen = React7.useCallback(() => {
|
|
670
562
|
const el = mediaRef.current;
|
|
671
563
|
if (el && !el.paused) {
|
|
672
564
|
el.pause();
|
|
673
565
|
}
|
|
674
566
|
}, []);
|
|
567
|
+
const noopOnPlay = React7.useCallback(() => {
|
|
568
|
+
}, []);
|
|
675
569
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full h-full", style: wrapperStyle, children: [
|
|
676
|
-
children({ mediaRef, onPlay:
|
|
570
|
+
children({ mediaRef, onPlay: noopOnPlay, isMediaPlaying }),
|
|
677
571
|
isFullScreen && isPresentationMode && isMediaPlaying && /* @__PURE__ */ jsxRuntime.jsx(
|
|
678
572
|
"button",
|
|
679
573
|
{
|
|
@@ -687,7 +581,7 @@ function PresentationMediaController({
|
|
|
687
581
|
] });
|
|
688
582
|
}
|
|
689
583
|
function label(key) {
|
|
690
|
-
return key === void 0 ? void 0 :
|
|
584
|
+
return key === void 0 ? void 0 : chunkW24OJ7H5_js.translationsEn[key];
|
|
691
585
|
}
|
|
692
586
|
function FallbackIcon({
|
|
693
587
|
paths,
|
|
@@ -723,17 +617,17 @@ function Badge({
|
|
|
723
617
|
"div",
|
|
724
618
|
{
|
|
725
619
|
className: `absolute inset-0 flex flex-col items-center justify-center ${isMissing ? "gap-1" : ""}`,
|
|
726
|
-
...{ [
|
|
620
|
+
...{ [chunkDCNHUEWQ_js.MEDIA_CHROME_ATTRIBUTE]: visual.badge },
|
|
727
621
|
children: [
|
|
728
622
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
729
623
|
FallbackIcon,
|
|
730
624
|
{
|
|
731
|
-
paths:
|
|
625
|
+
paths: chunkDCNHUEWQ_js.mediaFallbackIcon(visual, element.mediaType),
|
|
732
626
|
size: isMissing ? 32 : 48,
|
|
733
627
|
className: isMissing ? "text-white/60" : "text-white/80 drop-shadow-md"
|
|
734
628
|
}
|
|
735
629
|
),
|
|
736
|
-
isMissing && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: label(
|
|
630
|
+
isMissing && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-white/60", children: label(chunkDCNHUEWQ_js.mediaFallbackLabelKey(visual, element.mediaType)) })
|
|
737
631
|
]
|
|
738
632
|
}
|
|
739
633
|
);
|
|
@@ -750,17 +644,17 @@ function Placeholder({
|
|
|
750
644
|
"div",
|
|
751
645
|
{
|
|
752
646
|
className: `w-full h-full flex flex-col items-center justify-center gap-1 pointer-events-none rounded ${isMissing ? "bg-black/30 border border-dashed border-white/20" : element.mediaType === "audio" ? "bg-black/10" : "bg-black/20"}`,
|
|
753
|
-
...{ [
|
|
647
|
+
...{ [chunkDCNHUEWQ_js.MEDIA_CHROME_ATTRIBUTE]: visual.placeholder },
|
|
754
648
|
children: [
|
|
755
649
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
756
650
|
FallbackIcon,
|
|
757
651
|
{
|
|
758
|
-
paths:
|
|
652
|
+
paths: chunkDCNHUEWQ_js.mediaFallbackIcon(visual, element.mediaType),
|
|
759
653
|
size: isMissing ? 36 : element.mediaType === "audio" ? 24 : 32,
|
|
760
654
|
className: isMissing ? "text-white/50" : "text-white/70"
|
|
761
655
|
}
|
|
762
656
|
),
|
|
763
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `text-[10px] ${isMissing ? "text-white/50" : "text-white/70"}`, children: label(
|
|
657
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `text-[10px] ${isMissing ? "text-white/50" : "text-white/70"}`, children: label(chunkDCNHUEWQ_js.mediaFallbackLabelKey(visual, element.mediaType)) })
|
|
764
658
|
]
|
|
765
659
|
}
|
|
766
660
|
);
|
|
@@ -770,7 +664,7 @@ function renderMediaFallback({
|
|
|
770
664
|
posterUrl,
|
|
771
665
|
surface
|
|
772
666
|
}) {
|
|
773
|
-
const visual =
|
|
667
|
+
const visual = chunkDCNHUEWQ_js.mediaFallbackVisual(surface, {
|
|
774
668
|
hasPoster: Boolean(posterUrl),
|
|
775
669
|
missing: element.mediaMissing === true
|
|
776
670
|
});
|
|
@@ -780,9 +674,9 @@ function renderMediaFallback({
|
|
|
780
674
|
"img",
|
|
781
675
|
{
|
|
782
676
|
src: posterUrl,
|
|
783
|
-
alt: visual.dimPoster ?
|
|
677
|
+
alt: visual.dimPoster ? chunkW24OJ7H5_js.translationsEn["pptx.media.posterAlt"] : chunkW24OJ7H5_js.translationsEn["pptx.media.videoPosterAlt"],
|
|
784
678
|
className: `w-full h-full${visual.dimPoster ? " opacity-50" : ""}`,
|
|
785
|
-
style:
|
|
679
|
+
style: chunkDCNHUEWQ_js.getImageFitStyle(element)
|
|
786
680
|
}
|
|
787
681
|
),
|
|
788
682
|
/* @__PURE__ */ jsxRuntime.jsx(Badge, { visual, element })
|
|
@@ -792,7 +686,7 @@ function renderMediaFallback({
|
|
|
792
686
|
}
|
|
793
687
|
function renderMediaElement(element, mediaDataUrls, options) {
|
|
794
688
|
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:
|
|
689
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkW24OJ7H5_js.translationsEn["pptx.media.title"] });
|
|
796
690
|
}
|
|
797
691
|
const mediaType = element.mediaType;
|
|
798
692
|
const mediaPath = element.mediaPath;
|
|
@@ -800,7 +694,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
800
694
|
const dataUrl = element.mediaData ?? (mediaPath ? mediaDataUrls.get(mediaPath) : void 0);
|
|
801
695
|
const trimFragment = buildTrimFragment(element);
|
|
802
696
|
const posterUrl = element.posterFrameData ?? void 0;
|
|
803
|
-
const shouldLoop =
|
|
697
|
+
const shouldLoop = chunkDCNHUEWQ_js.mediaPlaybackAttributes(element).loop;
|
|
804
698
|
const shouldAutoPlay = options?.autoPlay === true || element.autoPlay === true;
|
|
805
699
|
const isFullScreen = options?.fullScreen === true;
|
|
806
700
|
const isPresentationMode = options?.isPresentationMode === true;
|
|
@@ -878,25 +772,25 @@ function renderMediaElement(element, mediaDataUrls, options) {
|
|
|
878
772
|
if (surface.presenting || surface.preview) {
|
|
879
773
|
return null;
|
|
880
774
|
}
|
|
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:
|
|
775
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkW24OJ7H5_js.translationsEn["pptx.media.title"] });
|
|
882
776
|
}
|
|
883
777
|
|
|
884
778
|
// src/viewer/utils/text-utils.tsx
|
|
885
779
|
function getTextStyleForElement(element, fallbackColor) {
|
|
886
|
-
return
|
|
780
|
+
return chunkDCNHUEWQ_js.buildTextBlockStyle(element, { fallbackColor });
|
|
887
781
|
}
|
|
888
782
|
|
|
889
783
|
// src/viewer/utils/text-layout.tsx
|
|
890
784
|
function getTextLayoutStyle(element) {
|
|
891
|
-
if (!
|
|
785
|
+
if (!chunkDCNHUEWQ_js.hasTextProperties(element)) {
|
|
892
786
|
return {};
|
|
893
787
|
}
|
|
894
|
-
const writingMode =
|
|
895
|
-
const textOrientation =
|
|
896
|
-
const verticalDirection =
|
|
788
|
+
const writingMode = chunkDCNHUEWQ_js.toCssWritingMode(element.textStyle?.textDirection);
|
|
789
|
+
const textOrientation = chunkDCNHUEWQ_js.toCssTextOrientation(element.textStyle?.textDirection);
|
|
790
|
+
const verticalDirection = chunkDCNHUEWQ_js.toCssVerticalDirection(element.textStyle?.textDirection);
|
|
897
791
|
const textWrapNone = element.textStyle?.textWrap === "none";
|
|
898
792
|
const shapeAutoFitTextBox = element.textStyle?.autoFitMode === "shrink" && (element.type === "text" || element.locks?.txBox === true);
|
|
899
|
-
const hasParagraphIndents =
|
|
793
|
+
const hasParagraphIndents = chunkDCNHUEWQ_js.hasTextProperties(element) && element.paragraphIndents && element.paragraphIndents.length > 0;
|
|
900
794
|
const paragraphMarginLeft = element.textStyle?.paragraphMarginLeft;
|
|
901
795
|
const paragraphIndent = element.textStyle?.paragraphIndent;
|
|
902
796
|
const marginLeft = !hasParagraphIndents && typeof paragraphMarginLeft === "number" && paragraphMarginLeft !== 0 ? paragraphMarginLeft : void 0;
|
|
@@ -905,7 +799,7 @@ function getTextLayoutStyle(element) {
|
|
|
905
799
|
const bodyBottom = element.textStyle?.bodyInsetBottom ?? DEFAULT_BODY_INSET_TB_PX;
|
|
906
800
|
return {
|
|
907
801
|
// Columns / flex anchoring / anchorCtr / tab-size / kinsoku, from shared.
|
|
908
|
-
...
|
|
802
|
+
...chunkDCNHUEWQ_js.buildTextBodyLayoutStyle(element),
|
|
909
803
|
// Body inset only. Paragraph spacing (spcBef/spcAft) is applied
|
|
910
804
|
// per-paragraph by the paragraph renderer, not collapsed here.
|
|
911
805
|
paddingTop: bodyTop,
|
|
@@ -933,7 +827,7 @@ function getTextLayoutStyle(element) {
|
|
|
933
827
|
|
|
934
828
|
// src/viewer/utils/text-effects.tsx
|
|
935
829
|
function buildTextBody3DSceneStyle2(textStyle) {
|
|
936
|
-
return
|
|
830
|
+
return chunkDCNHUEWQ_js.buildTextBody3DSceneStyle(textStyle);
|
|
937
831
|
}
|
|
938
832
|
|
|
939
833
|
// src/viewer/utils/text-warp-css.tsx
|
|
@@ -1118,13 +1012,13 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1118
1012
|
if (!subElementAnimStates || subElementAnimStates.size === 0) {
|
|
1119
1013
|
return renderedSegments;
|
|
1120
1014
|
}
|
|
1121
|
-
const paraKey = `${elementId}${
|
|
1015
|
+
const paraKey = `${elementId}${chunkDCNHUEWQ_js.TEXT_BUILD_ID_SEP}p${paraIndex}`;
|
|
1122
1016
|
const paraState = subElementAnimStates.get(paraKey);
|
|
1123
1017
|
if (paraState) {
|
|
1124
1018
|
const style = buildAnimStyle(paraState);
|
|
1125
1019
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
|
|
1126
1020
|
}
|
|
1127
|
-
const spec =
|
|
1021
|
+
const spec = chunkDCNHUEWQ_js.buildTextBuildSpec(
|
|
1128
1022
|
elementId,
|
|
1129
1023
|
paraIndex,
|
|
1130
1024
|
paraRuns.map((run) => ({ text: run.text, style: run })),
|
|
@@ -1136,26 +1030,74 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
|
|
|
1136
1030
|
return spec.spans.map((span, index) => {
|
|
1137
1031
|
const content = span.style && renderPiece ? renderPiece(span.style, span.text, String(index)) : span.text;
|
|
1138
1032
|
if (!span.animId) {
|
|
1139
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1033
|
+
return /* @__PURE__ */ jsxRuntime.jsx(React7__default.default.Fragment, { children: content }, `ws-${index}`);
|
|
1140
1034
|
}
|
|
1141
1035
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1142
1036
|
"span",
|
|
1143
1037
|
{
|
|
1144
1038
|
"data-anim-id": span.animId,
|
|
1145
|
-
style:
|
|
1039
|
+
style: chunkDCNHUEWQ_js.textBuildSpanStyle(span),
|
|
1146
1040
|
children: content
|
|
1147
1041
|
},
|
|
1148
1042
|
span.animId
|
|
1149
1043
|
);
|
|
1150
1044
|
});
|
|
1151
1045
|
}
|
|
1152
|
-
function
|
|
1153
|
-
|
|
1046
|
+
function renderUnderlineWords(text, isUnderlineWords, wordDecoration, metric, keyPrefix, inner) {
|
|
1047
|
+
if (!isUnderlineWords || !text) {
|
|
1048
|
+
return inner(text, keyPrefix, metric);
|
|
1049
|
+
}
|
|
1050
|
+
const pieces = chunkDCNHUEWQ_js.splitWordsForUnderline(text);
|
|
1051
|
+
if (pieces.length === 0) {
|
|
1052
|
+
return inner(text, keyPrefix, metric);
|
|
1053
|
+
}
|
|
1054
|
+
const gapMetric = metric ? {
|
|
1055
|
+
...metric,
|
|
1056
|
+
nestedStyle: metric.nestedStyle ? chunkDCNHUEWQ_js.stripUnderlineDecoration(metric.nestedStyle) : void 0
|
|
1057
|
+
} : void 0;
|
|
1058
|
+
return pieces.map((piece, i) => {
|
|
1059
|
+
const key = `${keyPrefix}-u${i}`;
|
|
1060
|
+
if (!piece.underline) {
|
|
1061
|
+
return /* @__PURE__ */ jsxRuntime.jsx(React7__default.default.Fragment, { children: inner(piece.text, key, gapMetric) }, key);
|
|
1062
|
+
}
|
|
1063
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: wordDecoration, children: inner(piece.text, key, metric) }, key);
|
|
1064
|
+
});
|
|
1065
|
+
}
|
|
1066
|
+
function makeSegmentPieceRenderer(needsScriptFonts, scriptFonts, baseFontFamily, isUnderlineWords, wordDecoration, metric) {
|
|
1067
|
+
return (text, key) => renderUnderlineWords(
|
|
1068
|
+
text,
|
|
1069
|
+
isUnderlineWords,
|
|
1070
|
+
wordDecoration,
|
|
1071
|
+
metric,
|
|
1072
|
+
key,
|
|
1073
|
+
(subText, subKey, subMetric) => renderMetricPieces(
|
|
1074
|
+
subText,
|
|
1075
|
+
subMetric,
|
|
1076
|
+
subKey,
|
|
1077
|
+
(pieceText, pieceKey) => renderScriptAwareText(
|
|
1078
|
+
pieceText,
|
|
1079
|
+
needsScriptFonts,
|
|
1080
|
+
scriptFonts,
|
|
1081
|
+
baseFontFamily,
|
|
1082
|
+
pieceKey,
|
|
1083
|
+
subMetric?.nestedStyle
|
|
1084
|
+
)
|
|
1085
|
+
)
|
|
1086
|
+
);
|
|
1087
|
+
}
|
|
1088
|
+
function renderTabbedLine(line, ctx, keyPrefix, renderPiece, nestedStyle, underlineWords = false) {
|
|
1089
|
+
const [lineLayout] = chunkDCNHUEWQ_js.buildRunTabLines(
|
|
1090
|
+
line,
|
|
1091
|
+
ctx,
|
|
1092
|
+
nestedStyle,
|
|
1093
|
+
void 0,
|
|
1094
|
+
underlineWords
|
|
1095
|
+
);
|
|
1154
1096
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { display: "inline-block", whiteSpace: "nowrap" }, children: lineLayout.pieces.map((piece, i) => {
|
|
1155
1097
|
const key = `${keyPrefix}-tab-${i}`;
|
|
1156
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1098
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React7__default.default.Fragment, { children: [
|
|
1157
1099
|
piece.leaderStyle ? /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", style: piece.leaderStyle, children: piece.leaderText }) : null,
|
|
1158
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { style: piece.style, children: renderPiece(piece.text, key) })
|
|
1100
|
+
piece.words ? piece.words.map((word, w) => /* @__PURE__ */ jsxRuntime.jsx("span", { style: word.style, children: renderPiece(word.text, `${key}-w${w}`) }, `${key}-w${w}`)) : /* @__PURE__ */ jsxRuntime.jsx("span", { style: piece.style, children: renderPiece(piece.text, key) })
|
|
1159
1101
|
] }, key);
|
|
1160
1102
|
}) });
|
|
1161
1103
|
}
|
|
@@ -1163,7 +1105,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1163
1105
|
if (!needsScriptFonts || !text) {
|
|
1164
1106
|
return text;
|
|
1165
1107
|
}
|
|
1166
|
-
const pieces =
|
|
1108
|
+
const pieces = chunkDCNHUEWQ_js.splitRunByScriptFont(
|
|
1167
1109
|
text,
|
|
1168
1110
|
scriptFonts,
|
|
1169
1111
|
baseFontFamily,
|
|
@@ -1173,14 +1115,14 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
|
|
|
1173
1115
|
return text;
|
|
1174
1116
|
}
|
|
1175
1117
|
return pieces.map(
|
|
1176
|
-
(piece, i) => piece.style ? /* @__PURE__ */ jsxRuntime.jsx("span", { style: piece.style, children: piece.text }, `${keyPrefix}-r${i}`) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1118
|
+
(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
1119
|
);
|
|
1178
1120
|
}
|
|
1179
1121
|
function renderMetricPieces(text, metric, keyPrefix, inner) {
|
|
1180
1122
|
if (!metric || !text) {
|
|
1181
1123
|
return inner(text, keyPrefix);
|
|
1182
1124
|
}
|
|
1183
|
-
const pieces =
|
|
1125
|
+
const pieces = chunkDCNHUEWQ_js.splitRunForMetrics(text, metric.font);
|
|
1184
1126
|
if (pieces.length <= 1) {
|
|
1185
1127
|
return inner(text, keyPrefix);
|
|
1186
1128
|
}
|
|
@@ -1189,33 +1131,35 @@ function renderMetricPieces(text, metric, keyPrefix, inner) {
|
|
|
1189
1131
|
{
|
|
1190
1132
|
style: {
|
|
1191
1133
|
...metric.nestedStyle,
|
|
1192
|
-
letterSpacing:
|
|
1134
|
+
letterSpacing: chunkDCNHUEWQ_js.pieceLetterSpacing(metric.authoredPx, piece.tracking)
|
|
1193
1135
|
},
|
|
1194
1136
|
children: inner(piece.text, `${keyPrefix}-w${i}`)
|
|
1195
1137
|
},
|
|
1196
1138
|
`${keyPrefix}-w${i}`
|
|
1197
1139
|
));
|
|
1198
1140
|
}
|
|
1199
|
-
function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsScriptFonts, scriptFonts, baseFontFamily, findHighlights, tabContext, metric) {
|
|
1141
|
+
function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsScriptFonts, scriptFonts, baseFontFamily, findHighlights, tabContext, metric, isUnderlineWords = false, wordDecoration) {
|
|
1200
1142
|
const segHl = findHighlights?.get(segmentIndex);
|
|
1143
|
+
const renderLeaf = makeSegmentPieceRenderer(
|
|
1144
|
+
needsScriptFonts,
|
|
1145
|
+
scriptFonts,
|
|
1146
|
+
baseFontFamily,
|
|
1147
|
+
isUnderlineWords,
|
|
1148
|
+
wordDecoration,
|
|
1149
|
+
metric
|
|
1150
|
+
);
|
|
1201
1151
|
if (!segHl || segHl.length === 0) {
|
|
1202
1152
|
return lines.map((line, lineIndex) => {
|
|
1203
1153
|
const lineKey = `${elementId}-seg-${segmentIndex}-line-${lineIndex}`;
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
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),
|
|
1154
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React7__default.default.Fragment, { children: [
|
|
1155
|
+
tabContext && line.includes(" ") ? renderTabbedLine(
|
|
1156
|
+
line,
|
|
1157
|
+
tabContext,
|
|
1158
|
+
lineKey,
|
|
1159
|
+
renderLeaf,
|
|
1160
|
+
metric?.nestedStyle,
|
|
1161
|
+
isUnderlineWords
|
|
1162
|
+
) : renderLeaf(line, lineKey),
|
|
1219
1163
|
lineIndex < lines.length - 1 ? /* @__PURE__ */ jsxRuntime.jsx("br", {}) : null
|
|
1220
1164
|
] }, lineKey);
|
|
1221
1165
|
});
|
|
@@ -1245,19 +1189,6 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1245
1189
|
isCurrent: false
|
|
1246
1190
|
});
|
|
1247
1191
|
}
|
|
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
1192
|
return chunks.map((chunk, ci) => {
|
|
1262
1193
|
const chunkKey = `${elementId}-seg-${segmentIndex}-hl-${ci}`;
|
|
1263
1194
|
return chunk.highlighted ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1269,15 +1200,15 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
|
|
|
1269
1200
|
color: "inherit",
|
|
1270
1201
|
borderRadius: 2
|
|
1271
1202
|
},
|
|
1272
|
-
children:
|
|
1203
|
+
children: renderLeaf(chunk.text, chunkKey)
|
|
1273
1204
|
},
|
|
1274
1205
|
chunkKey
|
|
1275
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1206
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(React7__default.default.Fragment, { children: renderLeaf(chunk.text, chunkKey) }, chunkKey);
|
|
1276
1207
|
});
|
|
1277
1208
|
}
|
|
1278
1209
|
function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
|
|
1279
|
-
const mathml =
|
|
1280
|
-
const safeMathml = mathml ?
|
|
1210
|
+
const mathml = chunkDCNHUEWQ_js.convertOmmlToMathMl(equationXml);
|
|
1211
|
+
const safeMathml = mathml ? chunkDCNHUEWQ_js.sanitizeMathMl(mathml) : "";
|
|
1281
1212
|
const equationContent = safeMathml ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1282
1213
|
"span",
|
|
1283
1214
|
{
|
|
@@ -1287,7 +1218,7 @@ function renderEquationSegment(elementId, segmentIndex, equationXml, equationNum
|
|
|
1287
1218
|
},
|
|
1288
1219
|
dangerouslySetInnerHTML: { __html: safeMathml }
|
|
1289
1220
|
}
|
|
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:
|
|
1221
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-block px-1 py-0.5 rounded text-xs bg-gray-200/20 text-gray-400 italic", children: chunkW24OJ7H5_js.translationsEn["pptx.textSegment.equationFallback"] });
|
|
1291
1222
|
if (equationNumber) {
|
|
1292
1223
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1293
1224
|
"span",
|
|
@@ -1334,11 +1265,12 @@ function renderHyperlink(run, spanNode, key, ctx) {
|
|
|
1334
1265
|
}
|
|
1335
1266
|
const requireCtrlClick = ctx.requireCtrlClick;
|
|
1336
1267
|
const displayUrl = url.startsWith("ppaction://") ? url.replace(/^ppaction:\/\//u, "").split("?")[0] : url;
|
|
1268
|
+
const targetFrame = run.hyperlink?.target;
|
|
1337
1269
|
const follow = (modified) => {
|
|
1338
1270
|
if (requireCtrlClick && !modified) {
|
|
1339
1271
|
return false;
|
|
1340
1272
|
}
|
|
1341
|
-
onHyperlinkClick(url);
|
|
1273
|
+
onHyperlinkClick(url, targetFrame);
|
|
1342
1274
|
return true;
|
|
1343
1275
|
};
|
|
1344
1276
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1405,7 +1337,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1405
1337
|
const segmentStyle = segment?.style ?? {};
|
|
1406
1338
|
const textValue = run.text;
|
|
1407
1339
|
const lines = textValue.split("\n");
|
|
1408
|
-
const resolvedSegmentColor =
|
|
1340
|
+
const resolvedSegmentColor = chunkDCNHUEWQ_js.normalizeHexColor(
|
|
1409
1341
|
segmentStyle.color || element.textStyle?.color,
|
|
1410
1342
|
run.hyperlink ? HYPERLINK_COLOR : fallbackColor
|
|
1411
1343
|
);
|
|
@@ -1413,16 +1345,16 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1413
1345
|
const baselineFraction = rawBaseline === 0 ? 0 : Math.abs(rawBaseline) >= 1e3 ? rawBaseline / 1e5 : rawBaseline / 100;
|
|
1414
1346
|
const baselineFontScale = baselineFraction !== 0 ? BASELINE_FONT_SCALE : 1;
|
|
1415
1347
|
const rawFontSize = segmentStyle.fontSize || element.textStyle?.fontSize || DEFAULT_TEXT_FONT_SIZE;
|
|
1416
|
-
const baseFontSize = rawFontSize *
|
|
1348
|
+
const baseFontSize = rawFontSize * chunkDCNHUEWQ_js.resolveAutoFitFontScale(element.textStyle);
|
|
1417
1349
|
const baselineShift = baselineFraction !== 0 ? `${baselineFraction * baseFontSize}px` : void 0;
|
|
1418
|
-
const fontKerning =
|
|
1350
|
+
const fontKerning = chunkDCNHUEWQ_js.resolveFontKerning(segmentStyle.kerning, baseFontSize);
|
|
1419
1351
|
const rawFontFamily = segmentStyle.fontFamily || element.textStyle?.fontFamily;
|
|
1420
|
-
const baseFontFamily = rawFontFamily ?
|
|
1352
|
+
const baseFontFamily = rawFontFamily ? chunkDCNHUEWQ_js.getSubstituteFontFamily(
|
|
1421
1353
|
rawFontFamily,
|
|
1422
|
-
|
|
1354
|
+
chunkDCNHUEWQ_js.parsePanoseString(segmentStyle.latinFontPanose ?? element.textStyle?.latinFontPanose)
|
|
1423
1355
|
) : DEFAULT_FONT_FAMILY2;
|
|
1424
|
-
const scriptFonts =
|
|
1425
|
-
const needsScriptFonts =
|
|
1356
|
+
const scriptFonts = chunkDCNHUEWQ_js.resolveScriptFontSet(segmentStyle, element.textStyle, baseFontFamily);
|
|
1357
|
+
const needsScriptFonts = chunkDCNHUEWQ_js.hasDistinctScriptFonts(scriptFonts);
|
|
1426
1358
|
const authoredLetterSpacing = typeof segmentStyle.characterSpacing === "number" && segmentStyle.characterSpacing !== 0 ? segmentStyle.characterSpacing / 100 * (96 / 72) : 0;
|
|
1427
1359
|
const metricFont = {
|
|
1428
1360
|
fontFamily: baseFontFamily,
|
|
@@ -1430,7 +1362,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1430
1362
|
bold: Boolean(segmentStyle.bold),
|
|
1431
1363
|
italic: Boolean(segmentStyle.italic)
|
|
1432
1364
|
};
|
|
1433
|
-
const nestedStyle =
|
|
1365
|
+
const nestedStyle = chunkDCNHUEWQ_js.nestedTextDecorationStyle(run.style);
|
|
1434
1366
|
const metricContext = { font: metricFont, authoredPx: authoredLetterSpacing, nestedStyle };
|
|
1435
1367
|
const spanStyle = { ...run.style };
|
|
1436
1368
|
spanStyle.color = resolvedSegmentColor;
|
|
@@ -1438,11 +1370,11 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1438
1370
|
spanStyle.fontFamily = baseFontFamily;
|
|
1439
1371
|
spanStyle.verticalAlign = baselineShift;
|
|
1440
1372
|
spanStyle.fontKerning = fontKerning;
|
|
1441
|
-
spanStyle.letterSpacing =
|
|
1373
|
+
spanStyle.letterSpacing = chunkDCNHUEWQ_js.pieceLetterSpacing(
|
|
1442
1374
|
authoredLetterSpacing,
|
|
1443
|
-
|
|
1375
|
+
chunkDCNHUEWQ_js.resolveMetricTrackingPx(textValue, metricFont)
|
|
1444
1376
|
);
|
|
1445
|
-
const hollow =
|
|
1377
|
+
const hollow = chunkDCNHUEWQ_js.hollowTextFillStyle(segmentStyle, {
|
|
1446
1378
|
color: resolvedSegmentColor,
|
|
1447
1379
|
textStroke: typeof spanStyle.WebkitTextStroke === "string" ? spanStyle.WebkitTextStroke : void 0
|
|
1448
1380
|
});
|
|
@@ -1454,6 +1386,16 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1454
1386
|
spanStyle.direction = runRtl ? "rtl" : "ltr";
|
|
1455
1387
|
spanStyle.unicodeBidi = runRtl !== ctx.paragraphRtl ? "bidi-override" : "embed";
|
|
1456
1388
|
}
|
|
1389
|
+
const isUnderlineWords = Boolean(segmentStyle.underline) && segmentStyle.underlineStyle === "words";
|
|
1390
|
+
const wordDecoration = isUnderlineWords ? nestedStyle ?? run.underlineWordPieces?.find((piece) => piece.style)?.style : void 0;
|
|
1391
|
+
if (isUnderlineWords) {
|
|
1392
|
+
const stripped = chunkDCNHUEWQ_js.stripUnderlineDecoration(spanStyle);
|
|
1393
|
+
spanStyle.textDecoration = stripped.textDecoration;
|
|
1394
|
+
delete spanStyle.textDecorationStyle;
|
|
1395
|
+
delete spanStyle.textDecorationThickness;
|
|
1396
|
+
delete spanStyle.textUnderlineOffset;
|
|
1397
|
+
delete spanStyle.textDecorationColor;
|
|
1398
|
+
}
|
|
1457
1399
|
const baseContent = renderSegmentContent(
|
|
1458
1400
|
element.id,
|
|
1459
1401
|
segmentIndex,
|
|
@@ -1463,7 +1405,7 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1463
1405
|
scriptFonts,
|
|
1464
1406
|
baseFontFamily,
|
|
1465
1407
|
findHighlights,
|
|
1466
|
-
|
|
1408
|
+
chunkDCNHUEWQ_js.buildTabContext(
|
|
1467
1409
|
element.textStyle?.tabStops,
|
|
1468
1410
|
element.textStyle?.defaultTabSize,
|
|
1469
1411
|
baseFontSize,
|
|
@@ -1471,7 +1413,9 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
|
|
|
1471
1413
|
Boolean(segmentStyle.bold),
|
|
1472
1414
|
Boolean(segmentStyle.italic)
|
|
1473
1415
|
),
|
|
1474
|
-
metricContext
|
|
1416
|
+
metricContext,
|
|
1417
|
+
isUnderlineWords,
|
|
1418
|
+
wordDecoration
|
|
1475
1419
|
);
|
|
1476
1420
|
const spanNode = /* @__PURE__ */ jsxRuntime.jsx("span", { "data-seg-idx": segmentIndex, style: spanStyle, children: renderRubyOrText(run, baseContent) }, key);
|
|
1477
1421
|
const reflectedNode = wrapWithTextReflection(run, key, spanNode, spanStyle, baseContent);
|
|
@@ -1489,7 +1433,7 @@ function renderRubyOrText(run, baseContent) {
|
|
|
1489
1433
|
] });
|
|
1490
1434
|
}
|
|
1491
1435
|
function renderTextSegments(element, fallbackColor, emptyFallback, findHighlights, onHyperlinkClick, fieldContext, subElementAnimStates, segmentOverrides, requireCtrlClick, placeholderPrompt) {
|
|
1492
|
-
if (!
|
|
1436
|
+
if (!chunkDCNHUEWQ_js.hasTextProperties(element)) {
|
|
1493
1437
|
return emptyFallback || null;
|
|
1494
1438
|
}
|
|
1495
1439
|
const segments = segmentOverrides ?? element.textSegments;
|
|
@@ -1499,7 +1443,7 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
|
|
|
1499
1443
|
}
|
|
1500
1444
|
return element.text || emptyFallback || "";
|
|
1501
1445
|
}
|
|
1502
|
-
const paragraphs =
|
|
1446
|
+
const paragraphs = chunkDCNHUEWQ_js.buildParagraphs(element, fieldContext, segmentOverrides);
|
|
1503
1447
|
const ctx = {
|
|
1504
1448
|
element,
|
|
1505
1449
|
fallbackColor,
|
|
@@ -1576,7 +1520,7 @@ function renderParagraph(para, paraIndex, paraCount, segments, ctx, subElementAn
|
|
|
1576
1520
|
);
|
|
1577
1521
|
const needsWrapper = Object.keys(paraStyle).length > 0 || marker !== null;
|
|
1578
1522
|
if (!needsWrapper) {
|
|
1579
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1523
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React7__default.default.Fragment, { children: [
|
|
1580
1524
|
wrappedContent,
|
|
1581
1525
|
paraIndex < paraCount - 1 ? /* @__PURE__ */ jsxRuntime.jsx("br", {}) : null
|
|
1582
1526
|
] }, `${element.id}-para-${paraIndex}`);
|
|
@@ -1625,13 +1569,13 @@ function renderBulletMarker(para, paraIndex, elementId) {
|
|
|
1625
1569
|
);
|
|
1626
1570
|
}
|
|
1627
1571
|
function getDuotoneColors(element) {
|
|
1628
|
-
if (!
|
|
1572
|
+
if (!chunkDCNHUEWQ_js.isImageLikeElement(element)) {
|
|
1629
1573
|
return void 0;
|
|
1630
1574
|
}
|
|
1631
1575
|
return element.imageEffects?.duotone;
|
|
1632
1576
|
}
|
|
1633
1577
|
function buildLineShadowCss(element) {
|
|
1634
|
-
if (!
|
|
1578
|
+
if (!chunkDCNHUEWQ_js.hasShapeProperties(element)) {
|
|
1635
1579
|
return void 0;
|
|
1636
1580
|
}
|
|
1637
1581
|
const ss = element.shapeStyle;
|
|
@@ -1642,13 +1586,13 @@ function buildLineShadowCss(element) {
|
|
|
1642
1586
|
const offsetY = typeof ss.lineShadowOffsetY === "number" ? ss.lineShadowOffsetY : 2;
|
|
1643
1587
|
const blur = typeof ss.lineShadowBlur === "number" ? Math.max(0, ss.lineShadowBlur) : 4;
|
|
1644
1588
|
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
|
-
|
|
1589
|
+
return `${Math.round(offsetX)}px ${Math.round(offsetY)}px ${Math.round(blur)}px ${chunkDCNHUEWQ_js.colorWithOpacity(
|
|
1590
|
+
chunkDCNHUEWQ_js.normalizeHexColor(ss.lineShadowColor, "#000000"),
|
|
1647
1591
|
opacity
|
|
1648
1592
|
)}`;
|
|
1649
1593
|
}
|
|
1650
1594
|
function buildLineGlowFilter(element) {
|
|
1651
|
-
if (!
|
|
1595
|
+
if (!chunkDCNHUEWQ_js.hasShapeProperties(element)) {
|
|
1652
1596
|
return void 0;
|
|
1653
1597
|
}
|
|
1654
1598
|
const ss = element.shapeStyle;
|
|
@@ -1657,22 +1601,22 @@ function buildLineGlowFilter(element) {
|
|
|
1657
1601
|
}
|
|
1658
1602
|
const glowOpacity = typeof ss.lineGlowOpacity === "number" ? ss.lineGlowOpacity : 0.75;
|
|
1659
1603
|
const glowRad = Math.round(Math.max(0, ss.lineGlowRadius));
|
|
1660
|
-
const glowCol =
|
|
1604
|
+
const glowCol = chunkDCNHUEWQ_js.colorWithOpacity(chunkDCNHUEWQ_js.normalizeHexColor(ss.lineGlowColor, "#ffff00"), glowOpacity);
|
|
1661
1605
|
return `drop-shadow(0 0 ${glowRad}px ${glowCol})`;
|
|
1662
1606
|
}
|
|
1663
1607
|
function getDagDuotoneFilterId(elementId) {
|
|
1664
1608
|
return `dag-duotone-${elementId}`;
|
|
1665
1609
|
}
|
|
1666
1610
|
function hasDagDuotoneEffect(element) {
|
|
1667
|
-
if (!
|
|
1611
|
+
if (!chunkDCNHUEWQ_js.hasShapeProperties(element)) {
|
|
1668
1612
|
return false;
|
|
1669
1613
|
}
|
|
1670
1614
|
return Boolean(element.shapeStyle?.dagDuotone);
|
|
1671
1615
|
}
|
|
1672
1616
|
function renderDagDuotoneSvgFilter(elementId, color1, color2) {
|
|
1673
1617
|
const filterId = getDagDuotoneFilterId(elementId);
|
|
1674
|
-
const c1 =
|
|
1675
|
-
const c2 =
|
|
1618
|
+
const c1 = chunkDCNHUEWQ_js.hexToRgbUnit(color1);
|
|
1619
|
+
const c2 = chunkDCNHUEWQ_js.hexToRgbUnit(color2);
|
|
1676
1620
|
const grayscaleMatrix = [
|
|
1677
1621
|
0.2126,
|
|
1678
1622
|
0.7152,
|
|
@@ -1716,7 +1660,7 @@ function renderDagDuotoneSvgFilter(elementId, color1, color2) {
|
|
|
1716
1660
|
|
|
1717
1661
|
// src/viewer/utils/shape-visual-3d.ts
|
|
1718
1662
|
function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elementHeight) {
|
|
1719
|
-
return
|
|
1663
|
+
return chunkDCNHUEWQ_js.build3DExtrusionData(
|
|
1720
1664
|
shape3d,
|
|
1721
1665
|
scene3d,
|
|
1722
1666
|
fillColor,
|
|
@@ -1725,7 +1669,7 @@ function build3DExtrusionData2(shape3d, scene3d, fillColor, elementWidth, elemen
|
|
|
1725
1669
|
);
|
|
1726
1670
|
}
|
|
1727
1671
|
function apply3dEffects2(base, scene3d, shape3d, fillColorFallback) {
|
|
1728
|
-
|
|
1672
|
+
chunkDCNHUEWQ_js.apply3dEffects(base, scene3d, shape3d, fillColorFallback);
|
|
1729
1673
|
}
|
|
1730
1674
|
|
|
1731
1675
|
// src/viewer/utils/shape-visual-style.ts
|
|
@@ -1733,16 +1677,16 @@ function rendersCustomVectorPath(element) {
|
|
|
1733
1677
|
return (element.type === "shape" || element.type === "image" || element.type === "picture") && Boolean(element.pathData) && typeof element.pathWidth === "number" && element.pathWidth > 0 && typeof element.pathHeight === "number" && element.pathHeight > 0;
|
|
1734
1678
|
}
|
|
1735
1679
|
function rendersWedgeCalloutVector(element) {
|
|
1736
|
-
return element.type === "shape" &&
|
|
1680
|
+
return element.type === "shape" && chunkDCNHUEWQ_js.isWedgeCalloutPresetShape(element.shapeType);
|
|
1737
1681
|
}
|
|
1738
1682
|
function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _strokeColor, animatesFill, animatesStroke, parentGroupFill) {
|
|
1739
|
-
if (!
|
|
1683
|
+
if (!chunkDCNHUEWQ_js.hasShapeProperties(element)) {
|
|
1740
1684
|
return {};
|
|
1741
1685
|
}
|
|
1742
1686
|
const ss = element.shapeStyle;
|
|
1743
|
-
const fill = animatesFill ? void 0 :
|
|
1744
|
-
const fx =
|
|
1745
|
-
const stroke =
|
|
1687
|
+
const fill = animatesFill ? void 0 : chunkDCNHUEWQ_js.getComputedFillStyle(element, parentGroupFill);
|
|
1688
|
+
const fx = chunkDCNHUEWQ_js.getComputedEffectStyle(element);
|
|
1689
|
+
const stroke = chunkDCNHUEWQ_js.getComputedStrokeStyle(element);
|
|
1746
1690
|
const base = {
|
|
1747
1691
|
// A gradient fill REPLACES the solid fill, it does not sit on top of it;
|
|
1748
1692
|
// the whole precedence lives in shared's `getComputedFillStyle`.
|
|
@@ -1781,7 +1725,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1781
1725
|
};
|
|
1782
1726
|
Object.assign(
|
|
1783
1727
|
base,
|
|
1784
|
-
|
|
1728
|
+
chunkDCNHUEWQ_js.getAnimationColorBaseStyle(element, {
|
|
1785
1729
|
animatesFill,
|
|
1786
1730
|
animatesStroke,
|
|
1787
1731
|
parentGroupFill
|
|
@@ -1793,7 +1737,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1793
1737
|
base.borderStyle = void 0;
|
|
1794
1738
|
}
|
|
1795
1739
|
apply3dEffects2(base, ss?.scene3d, ss?.shape3d, ss?.fillColor ?? fillColor);
|
|
1796
|
-
if (rendersCustomVectorPath(element) || rendersWedgeCalloutVector(element) ||
|
|
1740
|
+
if (rendersCustomVectorPath(element) || rendersWedgeCalloutVector(element) || chunkDCNHUEWQ_js.isStrokeOnlyPresetElement(element)) {
|
|
1797
1741
|
base.backgroundColor = "transparent";
|
|
1798
1742
|
base.backgroundImage = void 0;
|
|
1799
1743
|
base.borderWidth = void 0;
|
|
@@ -1807,7 +1751,7 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1807
1751
|
if (rendersWedgeCalloutVector(element)) {
|
|
1808
1752
|
return base;
|
|
1809
1753
|
}
|
|
1810
|
-
const geometry =
|
|
1754
|
+
const geometry = chunkDCNHUEWQ_js.resolveShapeGeometry(element);
|
|
1811
1755
|
switch (geometry.kind) {
|
|
1812
1756
|
case "bare":
|
|
1813
1757
|
return { backgroundColor: "transparent", borderWidth: 0, borderStyle: "none" };
|
|
@@ -1833,13 +1777,13 @@ function getShapeVisualStyle(element, _hasFill, fillColor, _strokeWidth, _stroke
|
|
|
1833
1777
|
function getConnectorAdjustment(element, key, fallback) {
|
|
1834
1778
|
const direct = element.shapeAdjustments?.[key];
|
|
1835
1779
|
if (typeof direct === "number" && Number.isFinite(direct)) {
|
|
1836
|
-
return
|
|
1780
|
+
return chunkDCNHUEWQ_js.clampUnitInterval(direct / 1e5);
|
|
1837
1781
|
}
|
|
1838
1782
|
const fallbackKey = element.shapeAdjustments?.adj;
|
|
1839
1783
|
if (typeof fallbackKey === "number" && Number.isFinite(fallbackKey)) {
|
|
1840
|
-
return
|
|
1784
|
+
return chunkDCNHUEWQ_js.clampUnitInterval(fallbackKey / 1e5);
|
|
1841
1785
|
}
|
|
1842
|
-
return
|
|
1786
|
+
return chunkDCNHUEWQ_js.clampUnitInterval(fallback);
|
|
1843
1787
|
}
|
|
1844
1788
|
function getConnectorPathGeometry(element) {
|
|
1845
1789
|
const width = Math.max(element.width, 0);
|
|
@@ -1965,6 +1909,34 @@ function renderConnectorMarker(markerId, arrowType, color, arrowWidth, arrowLeng
|
|
|
1965
1909
|
}
|
|
1966
1910
|
);
|
|
1967
1911
|
}
|
|
1912
|
+
function renderSvgGradientDefs(gradient) {
|
|
1913
|
+
if (!gradient) {
|
|
1914
|
+
return null;
|
|
1915
|
+
}
|
|
1916
|
+
if (gradient.kind === "rectPath") {
|
|
1917
|
+
return /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("pattern", { id: gradient.id, patternUnits: "objectBoundingBox", width: 1, height: 1, children: /* @__PURE__ */ jsxRuntime.jsx("image", { href: gradient.href, x: 0, y: 0, width: 1, height: 1, preserveAspectRatio: "none" }) }) });
|
|
1918
|
+
}
|
|
1919
|
+
const stops = gradient.stops.map((stop, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1920
|
+
"stop",
|
|
1921
|
+
{
|
|
1922
|
+
offset: stop.offset,
|
|
1923
|
+
stopColor: stop.color,
|
|
1924
|
+
stopOpacity: typeof stop.opacity === "number" ? stop.opacity : void 0
|
|
1925
|
+
},
|
|
1926
|
+
index
|
|
1927
|
+
));
|
|
1928
|
+
return /* @__PURE__ */ jsxRuntime.jsx("defs", { children: gradient.kind === "radial" ? /* @__PURE__ */ jsxRuntime.jsx("radialGradient", { id: gradient.id, cx: gradient.cx, cy: gradient.cy, r: gradient.r, children: stops }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1929
|
+
"linearGradient",
|
|
1930
|
+
{
|
|
1931
|
+
id: gradient.id,
|
|
1932
|
+
x1: gradient.x1,
|
|
1933
|
+
y1: gradient.y1,
|
|
1934
|
+
x2: gradient.x2,
|
|
1935
|
+
y2: gradient.y2,
|
|
1936
|
+
children: stops
|
|
1937
|
+
}
|
|
1938
|
+
) });
|
|
1939
|
+
}
|
|
1968
1940
|
function joinStyle(shapeStyle) {
|
|
1969
1941
|
const lineJoin = shapeStyle?.lineJoin === "bevel" ? "bevel" : shapeStyle?.lineJoin === "miter" ? "miter" : "round";
|
|
1970
1942
|
const miterLimit = lineJoin === "miter" && typeof shapeStyle?.miterLimit === "number" ? Math.max(shapeStyle.miterLimit / 1e5, 1) : void 0;
|
|
@@ -1976,11 +1948,11 @@ function strokeContext(shapeStyle, strokePaint, strokeWidth, dashArray) {
|
|
|
1976
1948
|
strokePaint,
|
|
1977
1949
|
strokeWidth,
|
|
1978
1950
|
dashArray,
|
|
1979
|
-
lineCap:
|
|
1951
|
+
lineCap: chunkDCNHUEWQ_js.svgLineCap(shapeStyle?.lineCap),
|
|
1980
1952
|
lineJoin,
|
|
1981
1953
|
miterLimit,
|
|
1982
|
-
offsets:
|
|
1983
|
-
widths:
|
|
1954
|
+
offsets: chunkDCNHUEWQ_js.getCompoundLineOffsets(shapeStyle?.compoundLine, strokeWidth),
|
|
1955
|
+
widths: chunkDCNHUEWQ_js.getCompoundLineWidths(shapeStyle?.compoundLine, strokeWidth)
|
|
1984
1956
|
};
|
|
1985
1957
|
}
|
|
1986
1958
|
function strokeStrands(d, keyBase, ctx) {
|
|
@@ -2001,39 +1973,14 @@ function strokeStrands(d, keyBase, ctx) {
|
|
|
2001
1973
|
`${keyBase}-s${idx}`
|
|
2002
1974
|
));
|
|
2003
1975
|
}
|
|
2004
|
-
function gradientDefs(gradient) {
|
|
2005
|
-
if (!gradient) {
|
|
2006
|
-
return null;
|
|
2007
|
-
}
|
|
2008
|
-
const stops = gradient.stops.map((stop, idx) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2009
|
-
"stop",
|
|
2010
|
-
{
|
|
2011
|
-
offset: stop.offset,
|
|
2012
|
-
stopColor: stop.color,
|
|
2013
|
-
stopOpacity: typeof stop.opacity === "number" ? stop.opacity : void 0
|
|
2014
|
-
},
|
|
2015
|
-
idx
|
|
2016
|
-
));
|
|
2017
|
-
return /* @__PURE__ */ jsxRuntime.jsx("defs", { children: gradient.kind === "radial" ? /* @__PURE__ */ jsxRuntime.jsx("radialGradient", { id: gradient.id, cx: gradient.cx, cy: gradient.cy, r: gradient.r, children: stops }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2018
|
-
"linearGradient",
|
|
2019
|
-
{
|
|
2020
|
-
id: gradient.id,
|
|
2021
|
-
x1: gradient.x1,
|
|
2022
|
-
y1: gradient.y1,
|
|
2023
|
-
x2: gradient.x2,
|
|
2024
|
-
y2: gradient.y2,
|
|
2025
|
-
children: stops
|
|
2026
|
-
}
|
|
2027
|
-
) });
|
|
2028
|
-
}
|
|
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 ? chunkDCNHUEWQ_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 ? chunkDCNHUEWQ_js.svgGradientFillRef(gradient) : void 0;
|
|
2034
1981
|
const nodes = [];
|
|
2035
1982
|
if (subpaths && needsPerSubpath) {
|
|
2036
|
-
const paints =
|
|
1983
|
+
const paints = chunkDCNHUEWQ_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 ?? chunkDCNHUEWQ_js.colorWithOpacity(fillColor, fillOpacity),
|
|
2066
2013
|
stroke: "none",
|
|
2067
2014
|
vectorEffect: "non-scaling-stroke"
|
|
2068
2015
|
},
|
|
@@ -2081,38 +2028,21 @@ function renderCustomGeometryVector(pathData, pathWidth, pathHeight, structuredP
|
|
|
2081
2028
|
className: "w-full h-full pointer-events-none",
|
|
2082
2029
|
preserveAspectRatio: "none",
|
|
2083
2030
|
children: [
|
|
2084
|
-
animatesFill ? null :
|
|
2031
|
+
animatesFill ? null : renderSvgGradientDefs(gradient),
|
|
2085
2032
|
nodes
|
|
2086
2033
|
]
|
|
2087
2034
|
}
|
|
2088
2035
|
);
|
|
2089
2036
|
}
|
|
2090
|
-
function renderGradientDefs(gradient) {
|
|
2091
|
-
if (!gradient) {
|
|
2092
|
-
return null;
|
|
2093
|
-
}
|
|
2094
|
-
const stops = gradient.stops.map((stop, index) => /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: stop.offset, stopColor: stop.color, stopOpacity: stop.opacity }, index));
|
|
2095
|
-
return /* @__PURE__ */ jsxRuntime.jsx("defs", { children: gradient.kind === "radial" ? /* @__PURE__ */ jsxRuntime.jsx("radialGradient", { id: gradient.id, cx: gradient.cx, cy: gradient.cy, r: gradient.r, children: stops }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2096
|
-
"linearGradient",
|
|
2097
|
-
{
|
|
2098
|
-
id: gradient.id,
|
|
2099
|
-
x1: gradient.x1,
|
|
2100
|
-
y1: gradient.y1,
|
|
2101
|
-
x2: gradient.x2,
|
|
2102
|
-
y2: gradient.y2,
|
|
2103
|
-
children: stops
|
|
2104
|
-
}
|
|
2105
|
-
) });
|
|
2106
|
-
}
|
|
2107
2037
|
function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor, animatesFill, animatesStroke) {
|
|
2108
|
-
if (!
|
|
2038
|
+
if (!chunkDCNHUEWQ_js.hasShapeProperties(element)) {
|
|
2109
2039
|
return null;
|
|
2110
2040
|
}
|
|
2111
2041
|
const normalizedType = (element.shapeType || "").toLowerCase();
|
|
2112
|
-
const fillPaint = animatesFill ? "inherit" :
|
|
2113
|
-
const strokePaint = animatesStroke ? "inherit" :
|
|
2114
|
-
const dashType =
|
|
2115
|
-
const dashArray =
|
|
2042
|
+
const fillPaint = animatesFill ? "inherit" : chunkDCNHUEWQ_js.colorWithOpacity(fillColor, element.shapeStyle?.fillOpacity);
|
|
2043
|
+
const strokePaint = animatesStroke ? "inherit" : chunkDCNHUEWQ_js.colorWithOpacity(strokeColor, element.shapeStyle?.strokeOpacity);
|
|
2044
|
+
const dashType = chunkDCNHUEWQ_js.normalizeStrokeDashType(element.shapeStyle?.strokeDash);
|
|
2045
|
+
const dashArray = chunkDCNHUEWQ_js.getSvgStrokeDasharray(
|
|
2116
2046
|
dashType,
|
|
2117
2047
|
Math.max(strokeWidth, 1),
|
|
2118
2048
|
element.shapeStyle?.customDashSegments
|
|
@@ -2193,13 +2123,13 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2193
2123
|
// container's `background-image` is suppressed for custom geometry, so
|
|
2194
2124
|
// without this the shape fell back to the parser's representative solid
|
|
2195
2125
|
// and lost every fade (issue #132).
|
|
2196
|
-
|
|
2126
|
+
chunkDCNHUEWQ_js.buildSvgGradientDef(element.shapeStyle, element.id)
|
|
2197
2127
|
);
|
|
2198
2128
|
}
|
|
2199
|
-
if ((element.type === "image" || element.type === "picture") && strokeWidth > 0 && !
|
|
2129
|
+
if ((element.type === "image" || element.type === "picture") && strokeWidth > 0 && !chunkDCNHUEWQ_js.buildStrokeOutline(element)) {
|
|
2200
2130
|
const width = Math.max(element.width, 1);
|
|
2201
2131
|
const height = Math.max(element.height, 1);
|
|
2202
|
-
const geometry =
|
|
2132
|
+
const geometry = chunkDCNHUEWQ_js.getPresetShapeVectorGeometry(
|
|
2203
2133
|
element.shapeType || "rect",
|
|
2204
2134
|
width,
|
|
2205
2135
|
height,
|
|
@@ -2227,18 +2157,18 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2227
2157
|
);
|
|
2228
2158
|
}
|
|
2229
2159
|
}
|
|
2230
|
-
if (element.type === "shape" &&
|
|
2160
|
+
if (element.type === "shape" && chunkDCNHUEWQ_js.isWedgeCalloutPresetShape(element.shapeType)) {
|
|
2231
2161
|
const width = Math.max(element.width, 1);
|
|
2232
2162
|
const height = Math.max(element.height, 1);
|
|
2233
|
-
const geometry =
|
|
2163
|
+
const geometry = chunkDCNHUEWQ_js.getPresetShapeVectorGeometry(
|
|
2234
2164
|
element.shapeType,
|
|
2235
2165
|
width,
|
|
2236
2166
|
height,
|
|
2237
2167
|
element.shapeAdjustments
|
|
2238
2168
|
);
|
|
2239
2169
|
if (geometry) {
|
|
2240
|
-
const gradient =
|
|
2241
|
-
const gradientPaint = gradient ?
|
|
2170
|
+
const gradient = chunkDCNHUEWQ_js.buildSvgGradientDef(element.shapeStyle, element.id);
|
|
2171
|
+
const gradientPaint = gradient ? chunkDCNHUEWQ_js.svgGradientFillRef(gradient) : void 0;
|
|
2242
2172
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2243
2173
|
"svg",
|
|
2244
2174
|
{
|
|
@@ -2254,7 +2184,7 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2254
2184
|
overflow: "visible"
|
|
2255
2185
|
},
|
|
2256
2186
|
children: [
|
|
2257
|
-
animatesFill ? null :
|
|
2187
|
+
animatesFill ? null : renderSvgGradientDefs(gradient),
|
|
2258
2188
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2259
2189
|
"path",
|
|
2260
2190
|
{
|
|
@@ -2271,18 +2201,18 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2271
2201
|
);
|
|
2272
2202
|
}
|
|
2273
2203
|
}
|
|
2274
|
-
if (
|
|
2204
|
+
if (chunkDCNHUEWQ_js.isCalloutShape(normalizedType)) {
|
|
2275
2205
|
const width = Math.max(element.width, 1);
|
|
2276
2206
|
const height = Math.max(element.height, 1);
|
|
2277
|
-
const geometry =
|
|
2207
|
+
const geometry = chunkDCNHUEWQ_js.getCalloutLeaderLineGeometry(
|
|
2278
2208
|
normalizedType,
|
|
2279
2209
|
width,
|
|
2280
2210
|
height,
|
|
2281
2211
|
element.shapeAdjustments
|
|
2282
2212
|
);
|
|
2283
2213
|
if (geometry && geometry.points.length >= 2) {
|
|
2284
|
-
const leaderPath =
|
|
2285
|
-
const bounds =
|
|
2214
|
+
const leaderPath = chunkDCNHUEWQ_js.buildCalloutLeaderLineSvgPath(geometry);
|
|
2215
|
+
const bounds = chunkDCNHUEWQ_js.getCalloutViewBoxBounds(width, height, geometry);
|
|
2286
2216
|
const lineStroke = Math.max(strokeWidth, 1);
|
|
2287
2217
|
const offsetLeft = bounds.minX;
|
|
2288
2218
|
const offsetTop = bounds.minY;
|
|
@@ -2345,10 +2275,10 @@ function renderVectorShape(element, hasFill, fillColor, strokeWidth, strokeColor
|
|
|
2345
2275
|
const endArrowW = element.shapeStyle?.connectorEndArrowWidth;
|
|
2346
2276
|
const endArrowL = element.shapeStyle?.connectorEndArrowLength;
|
|
2347
2277
|
const compoundLine = element.shapeStyle?.compoundLine;
|
|
2348
|
-
const connectorLineCap =
|
|
2278
|
+
const connectorLineCap = chunkDCNHUEWQ_js.svgLineCap(element.shapeStyle?.lineCap);
|
|
2349
2279
|
const hitTargetWidth = Math.max(strokeWidth * 3, 12);
|
|
2350
|
-
const offsets =
|
|
2351
|
-
const widths =
|
|
2280
|
+
const offsets = chunkDCNHUEWQ_js.getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
2281
|
+
const widths = chunkDCNHUEWQ_js.getCompoundLineWidths(compoundLine, strokeWidth);
|
|
2352
2282
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2353
2283
|
"svg",
|
|
2354
2284
|
{
|
|
@@ -2415,15 +2345,15 @@ function parseGradientFillCss(gradFill) {
|
|
|
2415
2345
|
}
|
|
2416
2346
|
const rawStops = stops.map((gs) => {
|
|
2417
2347
|
const pos = Number.parseInt(String(gs["@_pos"] || "0"), 10) / 1e3;
|
|
2418
|
-
const color =
|
|
2419
|
-
const opacity =
|
|
2348
|
+
const color = chunkDCNHUEWQ_js.parseDrawingColor(gs) ?? "#888888";
|
|
2349
|
+
const opacity = chunkDCNHUEWQ_js.parseDrawingColorOpacity(gs);
|
|
2420
2350
|
return { position: pos, color, opacity };
|
|
2421
2351
|
}).sort((a, b) => a.position - b.position);
|
|
2422
|
-
const stopStrings = rawStops.map((s) => `${
|
|
2352
|
+
const stopStrings = rawStops.map((s) => `${chunkDCNHUEWQ_js.colorWithOpacity(s.color, s.opacity)} ${s.position.toFixed(1)}%`).join(", ");
|
|
2423
2353
|
const lin = gradFill["a:lin"];
|
|
2424
2354
|
if (lin) {
|
|
2425
2355
|
const angRaw = Number.parseInt(String(lin["@_ang"] || "0"), 10);
|
|
2426
|
-
const angleDeg = Math.round(
|
|
2356
|
+
const angleDeg = Math.round(chunkDCNHUEWQ_js.ooxmlGradientAngleToCssDegrees(angRaw / 6e4));
|
|
2427
2357
|
return `linear-gradient(${angleDeg}deg, ${stopStrings})`;
|
|
2428
2358
|
}
|
|
2429
2359
|
const path = gradFill["a:path"];
|
|
@@ -2437,7 +2367,7 @@ function parseGradientFillCss(gradFill) {
|
|
|
2437
2367
|
b: Number.parseInt(String(fillToRectXml["@_b"] || "0"), 10) / 1e5
|
|
2438
2368
|
} : void 0;
|
|
2439
2369
|
if (pathType === "rect") {
|
|
2440
|
-
return
|
|
2370
|
+
return chunkDCNHUEWQ_js.buildRectPathGradient(rawStops, void 0, fillToRect);
|
|
2441
2371
|
}
|
|
2442
2372
|
let cx = 50;
|
|
2443
2373
|
let cy = 50;
|
|
@@ -2459,8 +2389,8 @@ function parsePatternFillCss(pattFill) {
|
|
|
2459
2389
|
if (!pattFill) {
|
|
2460
2390
|
return void 0;
|
|
2461
2391
|
}
|
|
2462
|
-
const fgColor =
|
|
2463
|
-
const bgColor =
|
|
2392
|
+
const fgColor = chunkDCNHUEWQ_js.parseDrawingColor(pattFill["a:fgClr"]) ?? "#000000";
|
|
2393
|
+
const bgColor = chunkDCNHUEWQ_js.parseDrawingColor(pattFill["a:bgClr"]) ?? "#ffffff";
|
|
2464
2394
|
const preset = String(pattFill["@_prst"] || "ltDnDiag");
|
|
2465
2395
|
switch (preset) {
|
|
2466
2396
|
case "ltHorz":
|
|
@@ -2571,11 +2501,11 @@ function parseCellBorders(cellProperties) {
|
|
|
2571
2501
|
const prstDash = ln["a:prstDash"];
|
|
2572
2502
|
const dashVal = prstDash ? String(prstDash["@_val"] || "") : void 0;
|
|
2573
2503
|
const cssBorderStyle = ooxmlDashToCss(dashVal);
|
|
2574
|
-
const color =
|
|
2504
|
+
const color = chunkDCNHUEWQ_js.parseDrawingColor(ln["a:solidFill"]);
|
|
2575
2505
|
if (color) {
|
|
2576
|
-
const opacity =
|
|
2506
|
+
const opacity = chunkDCNHUEWQ_js.parseDrawingColorOpacity(ln["a:solidFill"]);
|
|
2577
2507
|
const key = `${edge.prefix}`;
|
|
2578
|
-
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${
|
|
2508
|
+
borderStyle[key] = `${widthPx}px ${cssBorderStyle} ${chunkDCNHUEWQ_js.colorWithOpacity(color, opacity)}`;
|
|
2579
2509
|
}
|
|
2580
2510
|
}
|
|
2581
2511
|
return borderStyle;
|
|
@@ -2588,7 +2518,7 @@ function parseCellTextEffects(runProps) {
|
|
|
2588
2518
|
const textShadowParts = [];
|
|
2589
2519
|
const outerShdw = effectLst["a:outerShdw"];
|
|
2590
2520
|
if (outerShdw) {
|
|
2591
|
-
const shdwColor =
|
|
2521
|
+
const shdwColor = chunkDCNHUEWQ_js.parseDrawingColor(outerShdw);
|
|
2592
2522
|
if (shdwColor) {
|
|
2593
2523
|
const blurRad = Number.parseInt(String(outerShdw["@_blurRad"] || "0"), 10);
|
|
2594
2524
|
const blurPx = blurRad > 0 ? Math.round(blurRad / 12700) : 0;
|
|
@@ -2606,7 +2536,7 @@ function parseCellTextEffects(runProps) {
|
|
|
2606
2536
|
}
|
|
2607
2537
|
const glow = effectLst["a:glow"];
|
|
2608
2538
|
if (glow) {
|
|
2609
|
-
const glowColor =
|
|
2539
|
+
const glowColor = chunkDCNHUEWQ_js.parseDrawingColor(glow);
|
|
2610
2540
|
if (glowColor) {
|
|
2611
2541
|
const glowRad = Number.parseInt(String(glow["@_rad"] || "0"), 10);
|
|
2612
2542
|
const glowPx = glowRad > 0 ? Math.round(glowRad / 12700) : 2;
|
|
@@ -2686,10 +2616,10 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2686
2616
|
if (runProps?.["@_u"] !== void 0) {
|
|
2687
2617
|
cellStyle.textDecorationLine = runProps["@_u"] === "sng" ? "underline" : "none";
|
|
2688
2618
|
}
|
|
2689
|
-
const runColor =
|
|
2619
|
+
const runColor = chunkDCNHUEWQ_js.parseDrawingColor(runProps?.["a:solidFill"], schemeColorOverrides) || chunkDCNHUEWQ_js.parseDrawingColor(runProps?.["a:highlight"], schemeColorOverrides);
|
|
2690
2620
|
if (runColor) {
|
|
2691
|
-
const opacity =
|
|
2692
|
-
cellStyle.color =
|
|
2621
|
+
const opacity = chunkDCNHUEWQ_js.parseDrawingColorOpacity(runProps?.["a:solidFill"]);
|
|
2622
|
+
cellStyle.color = chunkDCNHUEWQ_js.colorWithOpacity(runColor, opacity);
|
|
2693
2623
|
}
|
|
2694
2624
|
const fontFamily = runProps?.["a:latin"]?.["@_typeface"] || runProps?.["a:ea"]?.["@_typeface"] || runProps?.["a:cs"]?.["@_typeface"];
|
|
2695
2625
|
if (fontFamily) {
|
|
@@ -2699,15 +2629,15 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2699
2629
|
cellStyle.textAlign = parseParagraphAlignment(paragraphProperties["@_algn"]);
|
|
2700
2630
|
}
|
|
2701
2631
|
const cellProperties = cellXml["a:tcPr"];
|
|
2702
|
-
const cellFill =
|
|
2632
|
+
const cellFill = chunkDCNHUEWQ_js.parseDrawingColor(
|
|
2703
2633
|
cellProperties?.["a:solidFill"],
|
|
2704
2634
|
schemeColorOverrides
|
|
2705
2635
|
);
|
|
2706
2636
|
if (cellFill) {
|
|
2707
|
-
const opacity =
|
|
2637
|
+
const opacity = chunkDCNHUEWQ_js.parseDrawingColorOpacity(
|
|
2708
2638
|
cellProperties?.["a:solidFill"]
|
|
2709
2639
|
);
|
|
2710
|
-
cellStyle.backgroundColor =
|
|
2640
|
+
cellStyle.backgroundColor = chunkDCNHUEWQ_js.colorWithOpacity(cellFill, opacity);
|
|
2711
2641
|
} else {
|
|
2712
2642
|
const gradCss = parseGradientFillCss(cellProperties?.["a:gradFill"]);
|
|
2713
2643
|
if (gradCss) {
|
|
@@ -2722,16 +2652,16 @@ function extractTableCellStyle(cellXml, fallbackStyle, schemeColorOverrides) {
|
|
|
2722
2652
|
const edgeBorders = parseCellBorders(cellProperties);
|
|
2723
2653
|
Object.assign(cellStyle, edgeBorders);
|
|
2724
2654
|
if (!cellStyle.borderLeftColor && !cellStyle.borderRightColor && !cellStyle.borderTopColor && !cellStyle.borderBottomColor) {
|
|
2725
|
-
const borderColor =
|
|
2655
|
+
const borderColor = chunkDCNHUEWQ_js.parseDrawingColor(
|
|
2726
2656
|
cellProperties?.["a:lnL"]?.["a:solidFill"],
|
|
2727
2657
|
schemeColorOverrides
|
|
2728
|
-
) ||
|
|
2658
|
+
) || chunkDCNHUEWQ_js.parseDrawingColor(
|
|
2729
2659
|
cellProperties?.["a:lnR"]?.["a:solidFill"],
|
|
2730
2660
|
schemeColorOverrides
|
|
2731
|
-
) ||
|
|
2661
|
+
) || chunkDCNHUEWQ_js.parseDrawingColor(
|
|
2732
2662
|
cellProperties?.["a:lnT"]?.["a:solidFill"],
|
|
2733
2663
|
schemeColorOverrides
|
|
2734
|
-
) ||
|
|
2664
|
+
) || chunkDCNHUEWQ_js.parseDrawingColor(
|
|
2735
2665
|
cellProperties?.["a:lnB"]?.["a:solidFill"],
|
|
2736
2666
|
schemeColorOverrides
|
|
2737
2667
|
);
|
|
@@ -2803,7 +2733,7 @@ function getTableCellBandStyle2(element, rowIndex, cellIndex, rowCount, columnCo
|
|
|
2803
2733
|
if (element.type !== "table") {
|
|
2804
2734
|
return void 0;
|
|
2805
2735
|
}
|
|
2806
|
-
return
|
|
2736
|
+
return chunkDCNHUEWQ_js.getTableCellBandStyle(element.tableData, rowIndex, cellIndex, rowCount, columnCount, {
|
|
2807
2737
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
2808
2738
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
2809
2739
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -2879,7 +2809,7 @@ function renderTableCellContent(cell, fallbackText) {
|
|
|
2879
2809
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2880
2810
|
"span",
|
|
2881
2811
|
{
|
|
2882
|
-
style: { position: "relative", ...
|
|
2812
|
+
style: { position: "relative", ...chunkDCNHUEWQ_js.cellRunStyle(run) },
|
|
2883
2813
|
children: run.text
|
|
2884
2814
|
},
|
|
2885
2815
|
`r-${index}`
|
|
@@ -2887,7 +2817,7 @@ function renderTableCellContent(cell, fallbackText) {
|
|
|
2887
2817
|
});
|
|
2888
2818
|
}
|
|
2889
2819
|
function getCellDiagonalBorders2(style, tableData, pos, styleCtx) {
|
|
2890
|
-
return
|
|
2820
|
+
return chunkDCNHUEWQ_js.getCellDiagonalBorders(style, tableData, pos, {
|
|
2891
2821
|
tableStyleMap: styleCtx?.tableStyleMap,
|
|
2892
2822
|
colorScheme: styleCtx?.theme?.colorScheme,
|
|
2893
2823
|
fontScheme: styleCtx?.theme?.fontScheme
|
|
@@ -2946,18 +2876,18 @@ function TableCellInput({
|
|
|
2946
2876
|
onCommit,
|
|
2947
2877
|
onCancel
|
|
2948
2878
|
}) {
|
|
2949
|
-
const inputRef =
|
|
2950
|
-
const committedRef =
|
|
2951
|
-
const onCommitRef =
|
|
2879
|
+
const inputRef = React7.useRef(null);
|
|
2880
|
+
const committedRef = React7.useRef(false);
|
|
2881
|
+
const onCommitRef = React7.useRef(onCommit);
|
|
2952
2882
|
onCommitRef.current = onCommit;
|
|
2953
|
-
|
|
2883
|
+
React7.useEffect(() => {
|
|
2954
2884
|
const el = inputRef.current;
|
|
2955
2885
|
if (el) {
|
|
2956
2886
|
el.focus();
|
|
2957
2887
|
el.select();
|
|
2958
2888
|
}
|
|
2959
2889
|
}, []);
|
|
2960
|
-
|
|
2890
|
+
React7.useEffect(() => {
|
|
2961
2891
|
const input = inputRef.current;
|
|
2962
2892
|
return () => {
|
|
2963
2893
|
if (!committedRef.current && input) {
|
|
@@ -3017,11 +2947,11 @@ function TableResizeOverlay({
|
|
|
3017
2947
|
onResizeColumns,
|
|
3018
2948
|
onResizeRow
|
|
3019
2949
|
}) {
|
|
3020
|
-
const containerRef =
|
|
3021
|
-
const [rowBounds, setRowBounds] =
|
|
3022
|
-
const dragRef =
|
|
3023
|
-
const colBoundaries =
|
|
3024
|
-
const measureRows =
|
|
2950
|
+
const containerRef = React7.useRef(null);
|
|
2951
|
+
const [rowBounds, setRowBounds] = React7.useState([]);
|
|
2952
|
+
const dragRef = React7.useRef(null);
|
|
2953
|
+
const colBoundaries = React7.useMemo(() => chunkDCNHUEWQ_js.computeColumnBoundaries(columnWidths), [columnWidths]);
|
|
2954
|
+
const measureRows = React7.useCallback(() => {
|
|
3025
2955
|
const container = containerRef.current;
|
|
3026
2956
|
if (!container) {
|
|
3027
2957
|
return;
|
|
@@ -3046,10 +2976,10 @@ function TableResizeOverlay({
|
|
|
3046
2976
|
return bounds;
|
|
3047
2977
|
});
|
|
3048
2978
|
}, []);
|
|
3049
|
-
|
|
2979
|
+
React7.useLayoutEffect(() => {
|
|
3050
2980
|
measureRows();
|
|
3051
2981
|
});
|
|
3052
|
-
|
|
2982
|
+
React7.useEffect(() => {
|
|
3053
2983
|
const handleMouseMove = (e) => {
|
|
3054
2984
|
const drag = dragRef.current;
|
|
3055
2985
|
if (!drag) {
|
|
@@ -3067,11 +2997,11 @@ function TableResizeOverlay({
|
|
|
3067
2997
|
const rect = containerRef.current.getBoundingClientRect();
|
|
3068
2998
|
if (drag.type === "col" && drag.initialWidths && onResizeColumns) {
|
|
3069
2999
|
const deltaProp = (e.clientX - drag.startPos) / rect.width;
|
|
3070
|
-
onResizeColumns(
|
|
3000
|
+
onResizeColumns(chunkDCNHUEWQ_js.computeResizedColumnWidths(drag.initialWidths, drag.index, deltaProp));
|
|
3071
3001
|
} else if (drag.type === "row" && onResizeRow) {
|
|
3072
3002
|
const deltaY = e.clientY - drag.startPos;
|
|
3073
|
-
const newHeight =
|
|
3074
|
-
drag.initialRowHeight ??
|
|
3003
|
+
const newHeight = chunkDCNHUEWQ_js.computeResizedRowHeight(
|
|
3004
|
+
drag.initialRowHeight ?? chunkDCNHUEWQ_js.DEFAULT_ROW_HEIGHT,
|
|
3075
3005
|
deltaY
|
|
3076
3006
|
);
|
|
3077
3007
|
onResizeRow(drag.index, newHeight);
|
|
@@ -3109,7 +3039,7 @@ function TableResizeOverlay({
|
|
|
3109
3039
|
e.stopPropagation();
|
|
3110
3040
|
const table = containerRef.current?.querySelector("table");
|
|
3111
3041
|
const tr = table?.querySelectorAll("tbody > tr")[index];
|
|
3112
|
-
const actualHeight = tr?.offsetHeight ??
|
|
3042
|
+
const actualHeight = tr?.offsetHeight ?? chunkDCNHUEWQ_js.DEFAULT_ROW_HEIGHT;
|
|
3113
3043
|
document.body.style.cursor = "row-resize";
|
|
3114
3044
|
document.body.style.userSelect = "none";
|
|
3115
3045
|
dragRef.current = {
|
|
@@ -3149,14 +3079,14 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3149
3079
|
const rowCount = tableData.rows.length;
|
|
3150
3080
|
const columnCount = tableData.columnWidths.length;
|
|
3151
3081
|
const selectedCell = options?.selectedCell || null;
|
|
3152
|
-
const isEditable = Boolean(options?.editable);
|
|
3082
|
+
const isEditable = Boolean(options?.editable) && chunkDCNHUEWQ_js.canDrillDown(element);
|
|
3153
3083
|
const hasCellSelectionHandler = typeof options?.onSelectCell === "function";
|
|
3154
3084
|
const sharedCtx = {
|
|
3155
3085
|
tableStyleMap: options?.styleCtx?.tableStyleMap,
|
|
3156
3086
|
colorScheme: options?.styleCtx?.theme?.colorScheme,
|
|
3157
3087
|
fontScheme: options?.styleCtx?.theme?.fontScheme
|
|
3158
3088
|
};
|
|
3159
|
-
const cellCss = (cell, rowIndex, cellIndex) =>
|
|
3089
|
+
const cellCss = (cell, rowIndex, cellIndex) => chunkDCNHUEWQ_js.tableCellCss(
|
|
3160
3090
|
tableData,
|
|
3161
3091
|
cell,
|
|
3162
3092
|
{ rowIndex, cellIndex, rowCount, columnCount },
|
|
@@ -3169,7 +3099,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3169
3099
|
}
|
|
3170
3100
|
const first = selectedCell.selectedCells[0];
|
|
3171
3101
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
3172
|
-
return
|
|
3102
|
+
return chunkDCNHUEWQ_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableData);
|
|
3173
3103
|
})();
|
|
3174
3104
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3175
3105
|
TableResizeOverlay,
|
|
@@ -3190,9 +3120,9 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3190
3120
|
{
|
|
3191
3121
|
className: "w-full h-full border-collapse table-fixed",
|
|
3192
3122
|
style: {
|
|
3193
|
-
fontFamily:
|
|
3123
|
+
fontFamily: chunkDCNHUEWQ_js.DEFAULT_FONT_FAMILY,
|
|
3194
3124
|
// `a:tblPr@rtl` mirrors the column order for RTL decks.
|
|
3195
|
-
...
|
|
3125
|
+
...chunkDCNHUEWQ_js.tableContainerCss(tableData)
|
|
3196
3126
|
},
|
|
3197
3127
|
children: [
|
|
3198
3128
|
tableData.columnWidths.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: tableData.columnWidths.map((w, ci) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3211,7 +3141,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3211
3141
|
return null;
|
|
3212
3142
|
}
|
|
3213
3143
|
const isCellSelected = selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex;
|
|
3214
|
-
const isInMultiSelection =
|
|
3144
|
+
const isInMultiSelection = chunkDCNHUEWQ_js.isCellInRect(rowIndex, cellIndex, selectionRect);
|
|
3215
3145
|
const isCellEditing = isCellSelected && selectedCell?.isEditing;
|
|
3216
3146
|
const diag = getCellDiagonalBorders2(
|
|
3217
3147
|
cell.style,
|
|
@@ -3240,7 +3170,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3240
3170
|
}
|
|
3241
3171
|
event.stopPropagation();
|
|
3242
3172
|
if (event.shiftKey && selectedCell) {
|
|
3243
|
-
const rect =
|
|
3173
|
+
const rect = chunkDCNHUEWQ_js.computeSelectionRect(
|
|
3244
3174
|
selectedCell.rowIndex,
|
|
3245
3175
|
selectedCell.columnIndex,
|
|
3246
3176
|
rowIndex,
|
|
@@ -3250,7 +3180,7 @@ function renderTableFromTableData(element, textStyle, options) {
|
|
|
3250
3180
|
options?.onSelectCell?.({
|
|
3251
3181
|
rowIndex: selectedCell.rowIndex,
|
|
3252
3182
|
columnIndex: selectedCell.columnIndex,
|
|
3253
|
-
selectedCells:
|
|
3183
|
+
selectedCells: chunkDCNHUEWQ_js.rectToCells(rect)
|
|
3254
3184
|
});
|
|
3255
3185
|
} else {
|
|
3256
3186
|
options?.onSelectCell?.({
|
|
@@ -3311,10 +3241,10 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3311
3241
|
if (tableEl2.tableData && tableEl2.tableData.rows.length > 0) {
|
|
3312
3242
|
return renderTableFromTableData(tableEl2, textStyle, options);
|
|
3313
3243
|
}
|
|
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:
|
|
3244
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkW24OJ7H5_js.translationsEn["pptx.table.title"] });
|
|
3315
3245
|
}
|
|
3316
3246
|
const selectedCell = options?.selectedCell || null;
|
|
3317
|
-
const isEditable = Boolean(options?.editable);
|
|
3247
|
+
const isEditable = Boolean(options?.editable) && chunkDCNHUEWQ_js.canDrillDown(element);
|
|
3318
3248
|
const hasCellSelectionHandler = typeof options?.onSelectCell === "function";
|
|
3319
3249
|
const tableEl = element;
|
|
3320
3250
|
const xmlSelectionRect = (() => {
|
|
@@ -3326,7 +3256,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3326
3256
|
}
|
|
3327
3257
|
const first = selectedCell.selectedCells[0];
|
|
3328
3258
|
const last = selectedCell.selectedCells[selectedCell.selectedCells.length - 1];
|
|
3329
|
-
return
|
|
3259
|
+
return chunkDCNHUEWQ_js.computeSelectionRect(first.row, first.col, last.row, last.col, tableEl.tableData);
|
|
3330
3260
|
})();
|
|
3331
3261
|
const schemeOverrides = options?.styleCtx?.theme?.colorScheme ? options.styleCtx.theme.colorScheme : void 0;
|
|
3332
3262
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3348,9 +3278,9 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3348
3278
|
{
|
|
3349
3279
|
className: "w-full h-full border-collapse table-fixed",
|
|
3350
3280
|
style: {
|
|
3351
|
-
fontFamily:
|
|
3281
|
+
fontFamily: chunkDCNHUEWQ_js.DEFAULT_FONT_FAMILY,
|
|
3352
3282
|
// `a:tblPr@rtl` mirrors the column order for RTL decks.
|
|
3353
|
-
...
|
|
3283
|
+
...chunkDCNHUEWQ_js.tableContainerCss(tableEl.tableData)
|
|
3354
3284
|
},
|
|
3355
3285
|
children: [
|
|
3356
3286
|
parsedTable.columnPercentages.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("colgroup", { children: parsedTable.columnPercentages.map((percentage, columnIndex) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3407,7 +3337,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3407
3337
|
color: textStyle.color,
|
|
3408
3338
|
...bandStyle,
|
|
3409
3339
|
...xmlCellStyle,
|
|
3410
|
-
...tdCellOverride ?
|
|
3340
|
+
...tdCellOverride ? chunkDCNHUEWQ_js.cellStyleToCss(tdCellOverride) : void 0,
|
|
3411
3341
|
...diag ? { position: "relative" } : void 0
|
|
3412
3342
|
};
|
|
3413
3343
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3417,7 +3347,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3417
3347
|
"border px-1 py-0.5 align-top",
|
|
3418
3348
|
isEditable && hasCellSelectionHandler ? "border-blue-200/70 cursor-cell" : "border-white/30",
|
|
3419
3349
|
selectedCell?.rowIndex === rowIndex && selectedCell?.columnIndex === cellIndex ? "ring-1 ring-inset ring-blue-500" : null,
|
|
3420
|
-
|
|
3350
|
+
chunkDCNHUEWQ_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
3351
|
),
|
|
3422
3352
|
colSpan,
|
|
3423
3353
|
rowSpan: rSpan,
|
|
@@ -3428,7 +3358,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3428
3358
|
}
|
|
3429
3359
|
event.stopPropagation();
|
|
3430
3360
|
if (event.shiftKey && selectedCell && tableEl.tableData) {
|
|
3431
|
-
const rect =
|
|
3361
|
+
const rect = chunkDCNHUEWQ_js.computeSelectionRect(
|
|
3432
3362
|
selectedCell.rowIndex,
|
|
3433
3363
|
selectedCell.columnIndex,
|
|
3434
3364
|
rowIndex,
|
|
@@ -3438,7 +3368,7 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3438
3368
|
options?.onSelectCell?.({
|
|
3439
3369
|
rowIndex: selectedCell.rowIndex,
|
|
3440
3370
|
columnIndex: selectedCell.columnIndex,
|
|
3441
|
-
selectedCells:
|
|
3371
|
+
selectedCells: chunkDCNHUEWQ_js.rectToCells(rect)
|
|
3442
3372
|
});
|
|
3443
3373
|
} else {
|
|
3444
3374
|
options?.onSelectCell?.({
|
|
@@ -3497,23 +3427,23 @@ function renderTableElement(element, textStyle, options) {
|
|
|
3497
3427
|
);
|
|
3498
3428
|
}
|
|
3499
3429
|
function partAttrs(part) {
|
|
3500
|
-
return part ?
|
|
3430
|
+
return part ? chunkDCNHUEWQ_js.chartPartToAttrs(part) : void 0;
|
|
3501
3431
|
}
|
|
3502
3432
|
function resolveReactPalette(chartData) {
|
|
3503
3433
|
if (chartData.colorPalette && chartData.colorPalette.length > 0) {
|
|
3504
3434
|
return chartData.colorPalette;
|
|
3505
3435
|
}
|
|
3506
|
-
return [...
|
|
3436
|
+
return [...chunkDCNHUEWQ_js.getChartStylePalette(chartData.style?.styleId)];
|
|
3507
3437
|
}
|
|
3508
3438
|
function buildReactChartViewModel(element) {
|
|
3509
3439
|
if (element.type !== "chart" || !element.chartData) {
|
|
3510
|
-
return
|
|
3440
|
+
return chunkDCNHUEWQ_js.buildChartViewModel(element);
|
|
3511
3441
|
}
|
|
3512
3442
|
const palette = resolveReactPalette(element.chartData), themedElement = {
|
|
3513
3443
|
...element,
|
|
3514
3444
|
chartData: { ...element.chartData, colorPalette: palette }
|
|
3515
3445
|
};
|
|
3516
|
-
return
|
|
3446
|
+
return chunkDCNHUEWQ_js.buildChartViewModel(themedElement);
|
|
3517
3447
|
}
|
|
3518
3448
|
function renderPrimitive(prim, key) {
|
|
3519
3449
|
switch (prim.kind) {
|
|
@@ -3662,7 +3592,7 @@ function renderText(t, key) {
|
|
|
3662
3592
|
);
|
|
3663
3593
|
}
|
|
3664
3594
|
function renderChartViewModel(elementId, vm, preserveAspectRatio = "none") {
|
|
3665
|
-
const legendItems =
|
|
3595
|
+
const legendItems = chunkDCNHUEWQ_js.computeChartLegendLayout(vm);
|
|
3666
3596
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3667
3597
|
"svg",
|
|
3668
3598
|
{
|
|
@@ -3670,16 +3600,50 @@ function renderChartViewModel(elementId, vm, preserveAspectRatio = "none") {
|
|
|
3670
3600
|
viewBox: `0 0 ${vm.svgWidth} ${vm.svgHeight}`,
|
|
3671
3601
|
preserveAspectRatio,
|
|
3672
3602
|
children: [
|
|
3673
|
-
vm.
|
|
3603
|
+
vm.defs && vm.defs.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("defs", { children: vm.defs.map((def, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3604
|
+
"pattern",
|
|
3605
|
+
{
|
|
3606
|
+
id: def.id,
|
|
3607
|
+
patternUnits: def.patternUnits,
|
|
3608
|
+
x: def.x,
|
|
3609
|
+
y: def.y,
|
|
3610
|
+
width: def.width,
|
|
3611
|
+
height: def.height,
|
|
3612
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3613
|
+
"image",
|
|
3614
|
+
{
|
|
3615
|
+
href: def.href,
|
|
3616
|
+
x: 0,
|
|
3617
|
+
y: 0,
|
|
3618
|
+
width: def.width,
|
|
3619
|
+
height: def.height,
|
|
3620
|
+
preserveAspectRatio: def.preserveAspectRatio
|
|
3621
|
+
}
|
|
3622
|
+
)
|
|
3623
|
+
},
|
|
3624
|
+
`${elementId}-def-${i}`
|
|
3625
|
+
)) }),
|
|
3626
|
+
vm.areaFill && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3627
|
+
"rect",
|
|
3628
|
+
{
|
|
3629
|
+
x: 0,
|
|
3630
|
+
y: 0,
|
|
3631
|
+
width: vm.svgWidth,
|
|
3632
|
+
height: vm.svgHeight,
|
|
3633
|
+
rx: vm.areaRadius,
|
|
3634
|
+
fill: vm.areaFill
|
|
3635
|
+
}
|
|
3636
|
+
),
|
|
3674
3637
|
vm.title && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3675
3638
|
"text",
|
|
3676
3639
|
{
|
|
3677
3640
|
x: vm.titleX,
|
|
3678
3641
|
y: vm.titleY,
|
|
3679
3642
|
textAnchor: "middle",
|
|
3680
|
-
fontSize: 12,
|
|
3681
|
-
fontWeight: 600,
|
|
3682
|
-
|
|
3643
|
+
fontSize: vm.titleStyle?.fontSize ?? 12,
|
|
3644
|
+
fontWeight: vm.titleStyle?.fontWeight ?? 600,
|
|
3645
|
+
fontFamily: vm.titleStyle?.fontFamily,
|
|
3646
|
+
fill: vm.titleStyle?.fill ?? "#1e293b",
|
|
3683
3647
|
"data-chart-part": "title",
|
|
3684
3648
|
children: vm.title
|
|
3685
3649
|
}
|
|
@@ -3755,17 +3719,17 @@ function renderChartViewModel(elementId, vm, preserveAspectRatio = "none") {
|
|
|
3755
3719
|
}
|
|
3756
3720
|
function renderChartElement(element) {
|
|
3757
3721
|
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:
|
|
3722
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkW24OJ7H5_js.translationsEn["pptx.chart.heading"] });
|
|
3759
3723
|
}
|
|
3760
3724
|
const chartData = element.chartData;
|
|
3761
3725
|
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:
|
|
3726
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: chunkW24OJ7H5_js.translationsEn["pptx.chart.heading"] });
|
|
3763
3727
|
}
|
|
3764
|
-
const kind =
|
|
3728
|
+
const kind = chunkDCNHUEWQ_js.resolveChartKind(chartData.chartType ?? "bar");
|
|
3765
3729
|
return renderChartViewModel(
|
|
3766
3730
|
element.id,
|
|
3767
3731
|
buildReactChartViewModel(element),
|
|
3768
|
-
|
|
3732
|
+
chunkDCNHUEWQ_js.chartPreserveAspectRatio(kind)
|
|
3769
3733
|
);
|
|
3770
3734
|
}
|
|
3771
3735
|
|
|
@@ -3785,14 +3749,14 @@ function buildNotesPdf(pages) {
|
|
|
3785
3749
|
notes: page.notes,
|
|
3786
3750
|
slideNumber: page.slideNumber
|
|
3787
3751
|
}));
|
|
3788
|
-
const bytes =
|
|
3752
|
+
const bytes = chunkDCNHUEWQ_js.buildNotesPdfBytes(images, meta);
|
|
3789
3753
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
3790
3754
|
return URL.createObjectURL(blob);
|
|
3791
3755
|
}
|
|
3792
3756
|
|
|
3793
3757
|
// src/viewer/utils/pdf-builder-slides.ts
|
|
3794
3758
|
function buildPdfFromImageData(images) {
|
|
3795
|
-
const bytes =
|
|
3759
|
+
const bytes = chunkDCNHUEWQ_js.buildSlidesPdfBytes(images);
|
|
3796
3760
|
const blob = new Blob([bytes], { type: "application/pdf" });
|
|
3797
3761
|
return URL.createObjectURL(blob);
|
|
3798
3762
|
}
|
|
@@ -3801,7 +3765,7 @@ function buildPdfFromImageData(images) {
|
|
|
3801
3765
|
var activePreview = null;
|
|
3802
3766
|
function startPreviewAnimation(elementId, preset, options) {
|
|
3803
3767
|
stopPreviewAnimation();
|
|
3804
|
-
const descriptor =
|
|
3768
|
+
const descriptor = chunkDCNHUEWQ_js.buildPreviewAnimation(preset, options);
|
|
3805
3769
|
if (!descriptor) {
|
|
3806
3770
|
return;
|
|
3807
3771
|
}
|
|
@@ -3814,7 +3778,7 @@ function startMotionPathPreview(elementId, path, options) {
|
|
|
3814
3778
|
return;
|
|
3815
3779
|
}
|
|
3816
3780
|
const stage = domEl.offsetParent;
|
|
3817
|
-
const descriptor =
|
|
3781
|
+
const descriptor = chunkDCNHUEWQ_js.buildMotionPathPreview({
|
|
3818
3782
|
path,
|
|
3819
3783
|
slideWidth: stage?.offsetWidth || DEFAULT_PREVIEW_SLIDE_WIDTH,
|
|
3820
3784
|
slideHeight: stage?.offsetHeight || DEFAULT_PREVIEW_SLIDE_HEIGHT,
|
|
@@ -3893,7 +3857,6 @@ exports.SHAPE_PRESETS = SHAPE_PRESETS;
|
|
|
3893
3857
|
exports.SHORTCUT_REFERENCE_ITEMS = SHORTCUT_REFERENCE_ITEMS;
|
|
3894
3858
|
exports.SLIDE_NAV_THUMBNAIL_WIDTH = SLIDE_NAV_THUMBNAIL_WIDTH;
|
|
3895
3859
|
exports.STROKE_DASH_OPTIONS = STROKE_DASH_OPTIONS2;
|
|
3896
|
-
exports.THEME_COLOR_SWATCHES = THEME_COLOR_SWATCHES;
|
|
3897
3860
|
exports.TOOLBAR_SECTIONS = TOOLBAR_SECTIONS;
|
|
3898
3861
|
exports.UNGROUPED_SECTION_ID = UNGROUPED_SECTION_ID;
|
|
3899
3862
|
exports.ZOOM_TO_SELECTION_PADDING = ZOOM_TO_SELECTION_PADDING;
|