pptx-react-viewer 3.14.0 → 3.16.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 +46 -0
- package/dist/{AiChatPanel-NJBUCO4X.mjs → AiChatPanel-FAAO6JYZ.mjs} +3 -3
- package/dist/AiChatPanel-FAAO6JYZ.mjs.br +0 -0
- package/dist/AiChatPanel-FAAO6JYZ.mjs.gz +0 -0
- package/dist/{AiChatPanel-42X7I5I2.js → AiChatPanel-WSH2K7T4.js} +24 -24
- package/dist/AiChatPanel-WSH2K7T4.js.br +0 -0
- package/dist/AiChatPanel-WSH2K7T4.js.gz +0 -0
- package/dist/{Area3DChartScene-TFZPHEZ6.mjs → Area3DChartScene-LGLVVQEB.mjs} +1 -1
- package/dist/Area3DChartScene-LGLVVQEB.mjs.br +0 -0
- package/dist/Area3DChartScene-LGLVVQEB.mjs.gz +0 -0
- package/dist/{Area3DChartScene-IDS5APPJ.js → Area3DChartScene-PTKML4PN.js} +2 -2
- package/dist/Area3DChartScene-PTKML4PN.js.br +0 -0
- package/dist/Area3DChartScene-PTKML4PN.js.gz +0 -0
- package/dist/{Bar3DChartScene-L3VXO7BS.mjs → Bar3DChartScene-HCP7MA3A.mjs} +1 -1
- package/dist/Bar3DChartScene-HCP7MA3A.mjs.br +0 -0
- package/dist/Bar3DChartScene-HCP7MA3A.mjs.gz +0 -0
- package/dist/{Bar3DChartScene-C3CQCKB6.js → Bar3DChartScene-UXC4LE44.js} +2 -2
- package/dist/Bar3DChartScene-UXC4LE44.js.br +0 -0
- package/dist/Bar3DChartScene-UXC4LE44.js.gz +0 -0
- package/dist/{Line3DChartScene-UM4ZJJSY.mjs → Line3DChartScene-JF54KXMH.mjs} +1 -1
- package/dist/Line3DChartScene-JF54KXMH.mjs.br +0 -0
- package/dist/Line3DChartScene-JF54KXMH.mjs.gz +0 -0
- package/dist/{Line3DChartScene-YU4M3VMW.js → Line3DChartScene-Z2EVGX4C.js} +2 -2
- package/dist/Line3DChartScene-Z2EVGX4C.js.br +0 -0
- package/dist/Line3DChartScene-Z2EVGX4C.js.gz +0 -0
- package/dist/{Model3DScene-YEWZQAN5.mjs → Model3DScene-YWQBX477.mjs} +1 -1
- package/dist/{Model3DScene-YEWZQAN5.mjs.br → Model3DScene-YWQBX477.mjs.br} +0 -0
- package/dist/Model3DScene-YWQBX477.mjs.gz +0 -0
- package/dist/{Model3DScene-YRRNSOYK.js → Model3DScene-ZBOF56VV.js} +2 -2
- package/dist/Model3DScene-ZBOF56VV.js.br +0 -0
- package/dist/Model3DScene-ZBOF56VV.js.gz +0 -0
- package/dist/{PieChart3DScene-2OBYYK55.mjs → PieChart3DScene-4TRQ4V3M.mjs} +1 -1
- package/dist/PieChart3DScene-4TRQ4V3M.mjs.br +0 -0
- package/dist/PieChart3DScene-4TRQ4V3M.mjs.gz +0 -0
- package/dist/{PieChart3DScene-GH4X3W3E.js → PieChart3DScene-JPQTAS34.js} +2 -2
- package/dist/PieChart3DScene-JPQTAS34.js.br +0 -0
- package/dist/PieChart3DScene-JPQTAS34.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-DYG5I5UP.mjs → SurfaceChart3DScene-N76RNCUY.mjs} +1 -1
- package/dist/SurfaceChart3DScene-N76RNCUY.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-N76RNCUY.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-J5CAPHVA.js → SurfaceChart3DScene-P3LX35OP.js} +2 -2
- package/dist/SurfaceChart3DScene-P3LX35OP.js.br +0 -0
- package/dist/SurfaceChart3DScene-P3LX35OP.js.gz +0 -0
- package/dist/{chunk-EZ3EI2VM.mjs → chunk-6B7A5JNM.mjs} +12 -12
- package/dist/chunk-6B7A5JNM.mjs.br +0 -0
- package/dist/{chunk-EZ3EI2VM.mjs.gz → chunk-6B7A5JNM.mjs.gz} +0 -0
- package/dist/{chunk-YFYSY7ZL.mjs → chunk-A6UVUZUX.mjs} +1 -1
- package/dist/chunk-A6UVUZUX.mjs.br +0 -0
- package/dist/chunk-A6UVUZUX.mjs.gz +0 -0
- package/dist/{chunk-GQMVEUHM.mjs → chunk-BNR6YPW5.mjs} +24 -39
- package/dist/chunk-BNR6YPW5.mjs.br +0 -0
- package/dist/chunk-BNR6YPW5.mjs.gz +0 -0
- package/dist/{chunk-OVOXRK7D.mjs → chunk-ERCY52HH.mjs} +1 -1
- package/dist/chunk-ERCY52HH.mjs.br +0 -0
- package/dist/chunk-ERCY52HH.mjs.gz +0 -0
- package/dist/{chunk-MH4VFSDL.js → chunk-L2MOKP3E.js} +5132 -3587
- package/dist/chunk-L2MOKP3E.js.br +0 -0
- package/dist/chunk-L2MOKP3E.js.gz +0 -0
- package/dist/{chunk-HADPGII2.mjs → chunk-QVEPXTUB.mjs} +5131 -3583
- package/dist/chunk-QVEPXTUB.mjs.br +0 -0
- package/dist/chunk-QVEPXTUB.mjs.gz +0 -0
- package/dist/{chunk-7Z7AY4MH.js → chunk-TJ4L42RA.js} +468 -483
- package/dist/chunk-TJ4L42RA.js.br +0 -0
- package/dist/chunk-TJ4L42RA.js.gz +0 -0
- package/dist/{chunk-H4LMXJ2Z.js → chunk-W5W75MFP.js} +167 -167
- package/dist/chunk-W5W75MFP.js.br +0 -0
- package/dist/chunk-W5W75MFP.js.gz +0 -0
- package/dist/{chunk-7OMXJNYI.js → chunk-WYGPSCMS.js} +1289 -1289
- package/dist/chunk-WYGPSCMS.js.br +0 -0
- package/dist/chunk-WYGPSCMS.js.gz +0 -0
- package/dist/{chunk-INKQT4SQ.js → chunk-Y2UFUL7P.js} +5 -5
- package/dist/chunk-Y2UFUL7P.js.br +0 -0
- package/dist/chunk-Y2UFUL7P.js.gz +0 -0
- package/dist/index.d.ts +56 -1
- package/dist/index.js +45 -45
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +57 -1
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +78 -78
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +3 -3
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/viewer/index.d.ts +56 -1
- package/dist/viewer/index.js +26 -26
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +5 -5
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-42X7I5I2.js.br +0 -0
- package/dist/AiChatPanel-42X7I5I2.js.gz +0 -0
- package/dist/AiChatPanel-NJBUCO4X.mjs.br +0 -0
- package/dist/AiChatPanel-NJBUCO4X.mjs.gz +0 -0
- package/dist/Area3DChartScene-IDS5APPJ.js.br +0 -0
- package/dist/Area3DChartScene-IDS5APPJ.js.gz +0 -0
- package/dist/Area3DChartScene-TFZPHEZ6.mjs.br +0 -0
- package/dist/Area3DChartScene-TFZPHEZ6.mjs.gz +0 -0
- package/dist/Bar3DChartScene-C3CQCKB6.js.br +0 -0
- package/dist/Bar3DChartScene-C3CQCKB6.js.gz +0 -0
- package/dist/Bar3DChartScene-L3VXO7BS.mjs.br +0 -0
- package/dist/Bar3DChartScene-L3VXO7BS.mjs.gz +0 -0
- package/dist/Line3DChartScene-UM4ZJJSY.mjs.br +0 -0
- package/dist/Line3DChartScene-UM4ZJJSY.mjs.gz +0 -0
- package/dist/Line3DChartScene-YU4M3VMW.js.br +0 -0
- package/dist/Line3DChartScene-YU4M3VMW.js.gz +0 -0
- package/dist/Model3DScene-YEWZQAN5.mjs.gz +0 -0
- package/dist/Model3DScene-YRRNSOYK.js.br +0 -0
- package/dist/Model3DScene-YRRNSOYK.js.gz +0 -0
- package/dist/PieChart3DScene-2OBYYK55.mjs.br +0 -0
- package/dist/PieChart3DScene-2OBYYK55.mjs.gz +0 -0
- package/dist/PieChart3DScene-GH4X3W3E.js.br +0 -0
- package/dist/PieChart3DScene-GH4X3W3E.js.gz +0 -0
- package/dist/SurfaceChart3DScene-DYG5I5UP.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-DYG5I5UP.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-J5CAPHVA.js.br +0 -0
- package/dist/SurfaceChart3DScene-J5CAPHVA.js.gz +0 -0
- package/dist/chunk-7OMXJNYI.js.br +0 -0
- package/dist/chunk-7OMXJNYI.js.gz +0 -0
- package/dist/chunk-7Z7AY4MH.js.br +0 -0
- package/dist/chunk-7Z7AY4MH.js.gz +0 -0
- package/dist/chunk-EZ3EI2VM.mjs.br +0 -0
- package/dist/chunk-GQMVEUHM.mjs.br +0 -0
- package/dist/chunk-GQMVEUHM.mjs.gz +0 -0
- package/dist/chunk-H4LMXJ2Z.js.br +0 -0
- package/dist/chunk-H4LMXJ2Z.js.gz +0 -0
- package/dist/chunk-HADPGII2.mjs.br +0 -0
- package/dist/chunk-HADPGII2.mjs.gz +0 -0
- package/dist/chunk-INKQT4SQ.js.br +0 -0
- package/dist/chunk-INKQT4SQ.js.gz +0 -0
- package/dist/chunk-MH4VFSDL.js.br +0 -0
- package/dist/chunk-MH4VFSDL.js.gz +0 -0
- package/dist/chunk-OVOXRK7D.mjs.br +0 -0
- package/dist/chunk-OVOXRK7D.mjs.gz +0 -0
- package/dist/chunk-YFYSY7ZL.mjs.br +0 -0
- package/dist/chunk-YFYSY7ZL.mjs.gz +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkW5W75MFP_js = require('./chunk-W5W75MFP.js');
|
|
4
|
+
var chunkL2MOKP3E_js = require('./chunk-L2MOKP3E.js');
|
|
5
5
|
var chunk3AJ54EAB_js = require('./chunk-3AJ54EAB.js');
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var reactI18next = require('react-i18next');
|
|
@@ -9,7 +9,7 @@ var reactI18next = require('react-i18next');
|
|
|
9
9
|
function useVirtualizedSlides({
|
|
10
10
|
totalItems,
|
|
11
11
|
itemHeight,
|
|
12
|
-
overscan =
|
|
12
|
+
overscan = chunkL2MOKP3E_js.DEFAULT_VIRTUAL_OVERSCAN
|
|
13
13
|
}) {
|
|
14
14
|
const scrollContainerRef = react.useRef(null);
|
|
15
15
|
const [scrollTop, setScrollTop] = react.useState(0);
|
|
@@ -39,7 +39,7 @@ function useVirtualizedSlides({
|
|
|
39
39
|
resizeObserver?.disconnect();
|
|
40
40
|
};
|
|
41
41
|
}, []);
|
|
42
|
-
const range =
|
|
42
|
+
const range = chunkL2MOKP3E_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
|
|
43
43
|
const safeItemHeight = Math.max(itemHeight, 1);
|
|
44
44
|
const scrollToIndex = react.useCallback(
|
|
45
45
|
(index, behavior = "smooth") => {
|
|
@@ -80,7 +80,7 @@ function usePresenceTracking({
|
|
|
80
80
|
}) {
|
|
81
81
|
const [remoteUsers, setRemoteUsers] = react.useState([]);
|
|
82
82
|
const projectorRef = react.useRef(null);
|
|
83
|
-
projectorRef.current ??=
|
|
83
|
+
projectorRef.current ??= chunkL2MOKP3E_js.createPresenceProjector();
|
|
84
84
|
const projector = projectorRef.current;
|
|
85
85
|
const lastBroadcastRef = react.useRef(0);
|
|
86
86
|
const pendingBroadcastRef = react.useRef(null);
|
|
@@ -105,7 +105,7 @@ function usePresenceTracking({
|
|
|
105
105
|
awareness.setLocalStateField("presence", state);
|
|
106
106
|
lastBroadcastRef.current = Date.now();
|
|
107
107
|
};
|
|
108
|
-
if (elapsed >=
|
|
108
|
+
if (elapsed >= chunkL2MOKP3E_js.BROADCAST_THROTTLE_MS) {
|
|
109
109
|
if (pendingBroadcastRef.current) {
|
|
110
110
|
clearTimeout(pendingBroadcastRef.current);
|
|
111
111
|
pendingBroadcastRef.current = null;
|
|
@@ -115,7 +115,7 @@ function usePresenceTracking({
|
|
|
115
115
|
pendingBroadcastRef.current = setTimeout(() => {
|
|
116
116
|
pendingBroadcastRef.current = null;
|
|
117
117
|
flush();
|
|
118
|
-
},
|
|
118
|
+
}, chunkL2MOKP3E_js.BROADCAST_THROTTLE_MS - elapsed);
|
|
119
119
|
}
|
|
120
120
|
},
|
|
121
121
|
[awareness, userName, userColor, userAvatar, role]
|
|
@@ -195,7 +195,7 @@ function useYjsProvider({ config }) {
|
|
|
195
195
|
const departureRef = react.useRef(null);
|
|
196
196
|
const gateRef = react.useRef(null);
|
|
197
197
|
if (!gateRef.current) {
|
|
198
|
-
gateRef.current =
|
|
198
|
+
gateRef.current = chunkL2MOKP3E_js.createSyncGate(() => setSynced(true));
|
|
199
199
|
}
|
|
200
200
|
const teardown = react.useCallback(() => {
|
|
201
201
|
if (timeoutRef.current) {
|
|
@@ -215,7 +215,7 @@ function useYjsProvider({ config }) {
|
|
|
215
215
|
const buildCleanup = react.useCallback(
|
|
216
216
|
(provider, yDoc) => () => {
|
|
217
217
|
announceDeparture();
|
|
218
|
-
|
|
218
|
+
chunkL2MOKP3E_js.clearLocalAwareness(provider.awareness);
|
|
219
219
|
provider.destroy();
|
|
220
220
|
yDoc.destroy();
|
|
221
221
|
setDoc(null);
|
|
@@ -240,9 +240,9 @@ function useYjsProvider({ config }) {
|
|
|
240
240
|
if (config.authToken) {
|
|
241
241
|
opts.password = config.authToken;
|
|
242
242
|
}
|
|
243
|
-
const roomId =
|
|
243
|
+
const roomId = chunkL2MOKP3E_js.validateRoomId(config.roomId);
|
|
244
244
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
245
|
-
departureRef.current =
|
|
245
|
+
departureRef.current = chunkL2MOKP3E_js.createDepartureChannel(roomId, provider.awareness);
|
|
246
246
|
setDoc(yDoc);
|
|
247
247
|
setAwareness(provider.awareness);
|
|
248
248
|
setClientId(provider.awareness.clientID);
|
|
@@ -284,13 +284,13 @@ function useYjsProvider({ config }) {
|
|
|
284
284
|
if (!config) {
|
|
285
285
|
return;
|
|
286
286
|
}
|
|
287
|
-
const roomId =
|
|
288
|
-
const transport = config.transport ??
|
|
287
|
+
const roomId = chunkL2MOKP3E_js.validateRoomId(config.roomId);
|
|
288
|
+
const transport = config.transport ?? chunkL2MOKP3E_js.resolveTransportForServerUrl(config.serverUrl);
|
|
289
289
|
if (transport === "webrtc") {
|
|
290
290
|
await initWebrtc();
|
|
291
291
|
return;
|
|
292
292
|
}
|
|
293
|
-
if (
|
|
293
|
+
if (chunkL2MOKP3E_js.isMixedContentBlocked(config.serverUrl)) {
|
|
294
294
|
console.warn(
|
|
295
295
|
`[pptx-viewer] Refusing to connect: insecure ws:// server "${config.serverUrl}" is blocked from a secure (https) page. Use a wss:// URL.`
|
|
296
296
|
);
|
|
@@ -304,7 +304,7 @@ function useYjsProvider({ config }) {
|
|
|
304
304
|
const provider = new WebsocketProvider(config.serverUrl, roomId, yDoc, {
|
|
305
305
|
params: config.authToken ? { token: config.authToken } : void 0
|
|
306
306
|
});
|
|
307
|
-
departureRef.current =
|
|
307
|
+
departureRef.current = chunkL2MOKP3E_js.createDepartureChannel(roomId, provider.awareness);
|
|
308
308
|
let connected = false;
|
|
309
309
|
const handleStatus = (event) => {
|
|
310
310
|
if (event.status === "connected") {
|
|
@@ -344,7 +344,7 @@ function useYjsProvider({ config }) {
|
|
|
344
344
|
provider.off("status", handleStatus);
|
|
345
345
|
provider.off("sync", handleSynced);
|
|
346
346
|
announceDeparture();
|
|
347
|
-
|
|
347
|
+
chunkL2MOKP3E_js.clearLocalAwareness(provider.awareness);
|
|
348
348
|
provider.destroy();
|
|
349
349
|
yDoc.destroy();
|
|
350
350
|
setDoc(null);
|
|
@@ -353,7 +353,7 @@ function useYjsProvider({ config }) {
|
|
|
353
353
|
cleanupRef.current = null;
|
|
354
354
|
setStatus("error");
|
|
355
355
|
}
|
|
356
|
-
},
|
|
356
|
+
}, chunkL2MOKP3E_js.CONNECTION_TIMEOUT_MS);
|
|
357
357
|
}
|
|
358
358
|
setDoc(yDoc);
|
|
359
359
|
setAwareness(provider.awareness);
|
|
@@ -362,7 +362,7 @@ function useYjsProvider({ config }) {
|
|
|
362
362
|
provider.off("status", handleStatus);
|
|
363
363
|
provider.off("sync", handleSynced);
|
|
364
364
|
announceDeparture();
|
|
365
|
-
|
|
365
|
+
chunkL2MOKP3E_js.clearLocalAwareness(provider.awareness);
|
|
366
366
|
provider.destroy();
|
|
367
367
|
yDoc.destroy();
|
|
368
368
|
setDoc(null);
|
|
@@ -388,7 +388,7 @@ function useYjsProvider({ config }) {
|
|
|
388
388
|
]);
|
|
389
389
|
react.useEffect(() => {
|
|
390
390
|
init();
|
|
391
|
-
const disposeTeardown =
|
|
391
|
+
const disposeTeardown = chunkL2MOKP3E_js.registerCollaborationTeardown({
|
|
392
392
|
leave: teardown,
|
|
393
393
|
rejoin: init
|
|
394
394
|
});
|
|
@@ -409,7 +409,7 @@ function useCollaborativeState({
|
|
|
409
409
|
canvasWidth,
|
|
410
410
|
canvasHeight
|
|
411
411
|
}) {
|
|
412
|
-
const userColor =
|
|
412
|
+
const userColor = chunkL2MOKP3E_js.sanitizeColor(config?.userColor, "#6366f1");
|
|
413
413
|
const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
|
|
414
414
|
const { remoteUsers, broadcastPresence } = usePresenceTracking({
|
|
415
415
|
awareness,
|
|
@@ -527,8 +527,8 @@ function useEditorHistory(input) {
|
|
|
527
527
|
width: canvasSize.width,
|
|
528
528
|
height: canvasSize.height,
|
|
529
529
|
activeSlideIndex,
|
|
530
|
-
slides: slides.map(
|
|
531
|
-
templateElementsBySlideId:
|
|
530
|
+
slides: slides.map(chunkL2MOKP3E_js.cloneSlide),
|
|
531
|
+
templateElementsBySlideId: chunkL2MOKP3E_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
532
532
|
...actionLabel ? { actionLabel } : {}
|
|
533
533
|
};
|
|
534
534
|
},
|
|
@@ -541,9 +541,9 @@ function useEditorHistory(input) {
|
|
|
541
541
|
width: snapshot.width,
|
|
542
542
|
height: snapshot.height
|
|
543
543
|
});
|
|
544
|
-
setSlides(snapshot.slides.map(
|
|
544
|
+
setSlides(snapshot.slides.map(chunkL2MOKP3E_js.cloneSlide));
|
|
545
545
|
setTemplateElementsBySlideId(
|
|
546
|
-
|
|
546
|
+
chunkL2MOKP3E_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
547
547
|
);
|
|
548
548
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
549
549
|
setSelectedElementIds([]);
|
|
@@ -582,8 +582,8 @@ function useEditorHistory(input) {
|
|
|
582
582
|
const currentSnapshot = buildHistorySnapshot();
|
|
583
583
|
historyFutureRef.current.push(currentSnapshot);
|
|
584
584
|
isApplyingHistoryRef.current = true;
|
|
585
|
-
const nextSnapshot =
|
|
586
|
-
lastHistorySnapshotRef.current =
|
|
585
|
+
const nextSnapshot = chunkW5W75MFP_js.cloneHistorySnapshot(previousSnapshot);
|
|
586
|
+
lastHistorySnapshotRef.current = chunkW5W75MFP_js.cloneHistorySnapshot(nextSnapshot);
|
|
587
587
|
lastHistorySerializedRef.current = serializeDocument(nextSnapshot);
|
|
588
588
|
applyHistorySnapshot(nextSnapshot);
|
|
589
589
|
updateHistoryAvailability();
|
|
@@ -604,8 +604,8 @@ function useEditorHistory(input) {
|
|
|
604
604
|
const currentSnapshot = buildHistorySnapshot();
|
|
605
605
|
historyPastRef.current.push(currentSnapshot);
|
|
606
606
|
isApplyingHistoryRef.current = true;
|
|
607
|
-
const targetSnapshot =
|
|
608
|
-
lastHistorySnapshotRef.current =
|
|
607
|
+
const targetSnapshot = chunkW5W75MFP_js.cloneHistorySnapshot(nextSnapshot);
|
|
608
|
+
lastHistorySnapshotRef.current = chunkW5W75MFP_js.cloneHistorySnapshot(targetSnapshot);
|
|
609
609
|
lastHistorySerializedRef.current = serializeDocument(targetSnapshot);
|
|
610
610
|
applyHistorySnapshot(targetSnapshot);
|
|
611
611
|
updateHistoryAvailability();
|
|
@@ -623,7 +623,7 @@ function useEditorHistory(input) {
|
|
|
623
623
|
historyPastRef.current = [];
|
|
624
624
|
historyFutureRef.current = [];
|
|
625
625
|
if (initialSnapshot) {
|
|
626
|
-
const clonedInitial =
|
|
626
|
+
const clonedInitial = chunkW5W75MFP_js.cloneHistorySnapshot(initialSnapshot);
|
|
627
627
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
628
628
|
lastHistorySerializedRef.current = serializeDocument(clonedInitial);
|
|
629
629
|
} else {
|
|
@@ -671,19 +671,19 @@ function useEditorHistory(input) {
|
|
|
671
671
|
}
|
|
672
672
|
const previousSnapshot = lastHistorySnapshotRef.current;
|
|
673
673
|
if (!previousSnapshot) {
|
|
674
|
-
lastHistorySnapshotRef.current =
|
|
674
|
+
lastHistorySnapshotRef.current = chunkW5W75MFP_js.cloneHistorySnapshot(snapshot);
|
|
675
675
|
lastHistorySerializedRef.current = serialized;
|
|
676
676
|
lastCheapHashRef.current = cheapHash;
|
|
677
677
|
updateHistoryAvailability();
|
|
678
678
|
return;
|
|
679
679
|
}
|
|
680
680
|
onDirtyRef.current?.();
|
|
681
|
-
historyPastRef.current.push(
|
|
681
|
+
historyPastRef.current.push(chunkW5W75MFP_js.cloneHistorySnapshot(previousSnapshot));
|
|
682
682
|
while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
|
|
683
683
|
historyPastRef.current.shift();
|
|
684
684
|
}
|
|
685
685
|
historyFutureRef.current = [];
|
|
686
|
-
lastHistorySnapshotRef.current =
|
|
686
|
+
lastHistorySnapshotRef.current = chunkW5W75MFP_js.cloneHistorySnapshot(snapshot);
|
|
687
687
|
lastHistorySerializedRef.current = serialized;
|
|
688
688
|
lastCheapHashRef.current = cheapHash;
|
|
689
689
|
updateHistoryAvailability();
|
|
@@ -743,9 +743,9 @@ function useZoomViewport({
|
|
|
743
743
|
const canvasStageRef = react.useRef(null);
|
|
744
744
|
const canvasViewportRef = react.useRef(null);
|
|
745
745
|
const renderScaleRef = react.useRef(1);
|
|
746
|
-
const wheelBufferRef = react.useRef(
|
|
746
|
+
const wheelBufferRef = react.useRef(chunkL2MOKP3E_js.createWheelStepBuffer());
|
|
747
747
|
const storeRef = react.useRef(null);
|
|
748
|
-
storeRef.current ??=
|
|
748
|
+
storeRef.current ??= chunkL2MOKP3E_js.createViewerZoomStore();
|
|
749
749
|
const store = storeRef.current;
|
|
750
750
|
const scale = useViewerStore(store, selectZoom);
|
|
751
751
|
const setScale = react.useCallback(
|
|
@@ -806,7 +806,7 @@ function useZoomViewport({
|
|
|
806
806
|
if (!wrapper || !canvasViewport) {
|
|
807
807
|
return;
|
|
808
808
|
}
|
|
809
|
-
const boundedScale =
|
|
809
|
+
const boundedScale = chunkL2MOKP3E_js.clampZoomScale(nextScale);
|
|
810
810
|
const nextEditorScale = fitScale * boundedScale;
|
|
811
811
|
const centerX = (bounds.minX + bounds.maxX) / 2;
|
|
812
812
|
const centerY = (bounds.minY + bounds.maxY) / 2;
|
|
@@ -843,29 +843,29 @@ function useZoomViewport({
|
|
|
843
843
|
selectedElements.forEach((element) => {
|
|
844
844
|
minX = Math.min(minX, element.x);
|
|
845
845
|
minY = Math.min(minY, element.y);
|
|
846
|
-
maxX = Math.max(maxX, element.x + Math.max(element.width,
|
|
847
|
-
maxY = Math.max(maxY, element.y + Math.max(element.height,
|
|
846
|
+
maxX = Math.max(maxX, element.x + Math.max(element.width, chunkW5W75MFP_js.MIN_ELEMENT_SIZE));
|
|
847
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkW5W75MFP_js.MIN_ELEMENT_SIZE));
|
|
848
848
|
});
|
|
849
849
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
850
850
|
return;
|
|
851
851
|
}
|
|
852
852
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
853
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
854
|
-
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY,
|
|
853
|
+
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkW5W75MFP_js.MIN_ELEMENT_SIZE);
|
|
854
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkW5W75MFP_js.MIN_ELEMENT_SIZE);
|
|
855
855
|
const availableWidth = Math.max(
|
|
856
|
-
effectiveEditorDimensions.width -
|
|
857
|
-
|
|
856
|
+
effectiveEditorDimensions.width - chunkW5W75MFP_js.ZOOM_TO_SELECTION_PADDING,
|
|
857
|
+
chunkW5W75MFP_js.MIN_ELEMENT_SIZE
|
|
858
858
|
);
|
|
859
859
|
const availableHeight = Math.max(
|
|
860
|
-
effectiveEditorDimensions.height -
|
|
861
|
-
|
|
860
|
+
effectiveEditorDimensions.height - chunkW5W75MFP_js.ZOOM_TO_SELECTION_PADDING,
|
|
861
|
+
chunkW5W75MFP_js.MIN_ELEMENT_SIZE
|
|
862
862
|
);
|
|
863
863
|
const targetEditorScale = Math.min(
|
|
864
864
|
availableWidth / boundsWidth,
|
|
865
865
|
availableHeight / boundsHeight
|
|
866
866
|
);
|
|
867
867
|
const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
|
|
868
|
-
const nextScale =
|
|
868
|
+
const nextScale = chunkL2MOKP3E_js.clampZoomScale(targetEditorScale / safeFitScale);
|
|
869
869
|
setScale(nextScale);
|
|
870
870
|
window.requestAnimationFrame(() => {
|
|
871
871
|
window.requestAnimationFrame(() => {
|
|
@@ -882,14 +882,14 @@ function useZoomViewport({
|
|
|
882
882
|
]);
|
|
883
883
|
const handleWheel = react.useCallback(
|
|
884
884
|
(event) => {
|
|
885
|
-
const mapped =
|
|
885
|
+
const mapped = chunkL2MOKP3E_js.mapEditingWheel(event, wheelBufferRef.current, true);
|
|
886
886
|
if (mapped.intent !== "zoom") {
|
|
887
887
|
return;
|
|
888
888
|
}
|
|
889
889
|
event.preventDefault();
|
|
890
890
|
store.dispatch({
|
|
891
891
|
type: "set-zoom",
|
|
892
|
-
zoom:
|
|
892
|
+
zoom: chunkL2MOKP3E_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
|
|
893
893
|
});
|
|
894
894
|
},
|
|
895
895
|
[store]
|
|
@@ -984,8 +984,8 @@ function scheduleOpeningAutoPlayGroup(controller, ctx) {
|
|
|
984
984
|
if (!group) {
|
|
985
985
|
return;
|
|
986
986
|
}
|
|
987
|
-
|
|
988
|
-
|
|
987
|
+
chunkL2MOKP3E_js.playGroup(controller, group, ctx);
|
|
988
|
+
chunkL2MOKP3E_js.scheduleAutoAdvanceChain(controller, ctx);
|
|
989
989
|
}, firstGroup.autoAdvanceDelayMs ?? 0);
|
|
990
990
|
ctx.timers.push(timer);
|
|
991
991
|
}
|
|
@@ -1004,7 +1004,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
|
|
|
1004
1004
|
}))
|
|
1005
1005
|
);
|
|
1006
1006
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1007
|
-
const delay =
|
|
1007
|
+
const delay = chunkL2MOKP3E_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1008
1008
|
const timer = window.setTimeout(() => {
|
|
1009
1009
|
setPresentationAnimations(
|
|
1010
1010
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1037,7 +1037,7 @@ function useAnimationPlayback(input) {
|
|
|
1037
1037
|
const presentationTimersRef = react.useRef([]);
|
|
1038
1038
|
const controllerRef = react.useRef(null);
|
|
1039
1039
|
const buildRafRef = react.useRef(null);
|
|
1040
|
-
const activeAnimationGroupRef = react.useRef(
|
|
1040
|
+
const activeAnimationGroupRef = react.useRef(chunkL2MOKP3E_js.createActiveAnimationGroup());
|
|
1041
1041
|
const seededCompletedRef = react.useRef(false);
|
|
1042
1042
|
const mediaTimeNodeElementIdsRef = react.useRef(/* @__PURE__ */ new Map());
|
|
1043
1043
|
const lastSeedCompletedRef = react.useRef(false);
|
|
@@ -1054,15 +1054,15 @@ function useAnimationPlayback(input) {
|
|
|
1054
1054
|
}, [onPlayActionSound]);
|
|
1055
1055
|
react.useEffect(() => {
|
|
1056
1056
|
return () => {
|
|
1057
|
-
|
|
1057
|
+
chunkL2MOKP3E_js.cancelBuildReveal(buildRafRef);
|
|
1058
1058
|
};
|
|
1059
1059
|
}, []);
|
|
1060
1060
|
const clearPresentationTimers = react.useCallback(() => {
|
|
1061
|
-
|
|
1061
|
+
chunkL2MOKP3E_js.clearPlaybackTimers(buildPlaybackContext(), activeAnimationGroupRef.current);
|
|
1062
1062
|
}, [buildPlaybackContext]);
|
|
1063
1063
|
const resetSlideTimeline = react.useCallback(
|
|
1064
1064
|
(slideIndex) => {
|
|
1065
|
-
|
|
1065
|
+
chunkL2MOKP3E_js.cancelBuildReveal(buildRafRef);
|
|
1066
1066
|
const slide = slides[slideIndex];
|
|
1067
1067
|
if (!slide) {
|
|
1068
1068
|
controllerRef.current = null;
|
|
@@ -1073,14 +1073,14 @@ function useAnimationPlayback(input) {
|
|
|
1073
1073
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1074
1074
|
return;
|
|
1075
1075
|
}
|
|
1076
|
-
const controller =
|
|
1076
|
+
const controller = chunkL2MOKP3E_js.PresentationAnimationController.fromSlide(slide, {
|
|
1077
1077
|
slideHeightPx: canvasSize?.height,
|
|
1078
1078
|
slideWidthPx: canvasSize?.width,
|
|
1079
1079
|
themeColorMap,
|
|
1080
1080
|
pixelateMosaic: pixelateMosaicAnimation
|
|
1081
1081
|
});
|
|
1082
1082
|
controllerRef.current = controller;
|
|
1083
|
-
mediaTimeNodeElementIdsRef.current =
|
|
1083
|
+
mediaTimeNodeElementIdsRef.current = chunkL2MOKP3E_js.resolveMediaTimeNodeElementIds(
|
|
1084
1084
|
slide.nativeAnimations ?? []
|
|
1085
1085
|
);
|
|
1086
1086
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
@@ -1094,7 +1094,7 @@ function useAnimationPlayback(input) {
|
|
|
1094
1094
|
if (!animationsEnabled) {
|
|
1095
1095
|
return false;
|
|
1096
1096
|
}
|
|
1097
|
-
return
|
|
1097
|
+
return chunkL2MOKP3E_js.advanceMainSequence(
|
|
1098
1098
|
controllerRef.current,
|
|
1099
1099
|
buildPlaybackContext(),
|
|
1100
1100
|
activeAnimationGroupRef.current
|
|
@@ -1110,7 +1110,7 @@ function useAnimationPlayback(input) {
|
|
|
1110
1110
|
if (!group) {
|
|
1111
1111
|
return false;
|
|
1112
1112
|
}
|
|
1113
|
-
|
|
1113
|
+
chunkL2MOKP3E_js.playGroup(controller, group, buildPlaybackContext());
|
|
1114
1114
|
return true;
|
|
1115
1115
|
},
|
|
1116
1116
|
[buildPlaybackContext]
|
|
@@ -1129,7 +1129,7 @@ function useAnimationPlayback(input) {
|
|
|
1129
1129
|
if (!group) {
|
|
1130
1130
|
return false;
|
|
1131
1131
|
}
|
|
1132
|
-
|
|
1132
|
+
chunkL2MOKP3E_js.playGroup(controller, group, buildPlaybackContext());
|
|
1133
1133
|
return true;
|
|
1134
1134
|
},
|
|
1135
1135
|
[animationsEnabled, buildPlaybackContext]
|
|
@@ -1210,12 +1210,12 @@ function useAnimationPlayback(input) {
|
|
|
1210
1210
|
presentationTimersRef
|
|
1211
1211
|
};
|
|
1212
1212
|
}
|
|
1213
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1214
|
-
var AUDIENCE_HASH =
|
|
1215
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1216
|
-
var AUDIENCE_NONCE_KEY =
|
|
1213
|
+
var PRESENTER_CHANNEL_NAME = chunkL2MOKP3E_js.PRESENTATION_CHANNEL_NAME;
|
|
1214
|
+
var AUDIENCE_HASH = chunkL2MOKP3E_js.PRESENTATION_HASH;
|
|
1215
|
+
var PRESENTER_MSG_ORIGIN = chunkL2MOKP3E_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1216
|
+
var AUDIENCE_NONCE_KEY = chunkL2MOKP3E_js.PRESENTATION_NONCE_KEY;
|
|
1217
1217
|
function generateSessionId() {
|
|
1218
|
-
return
|
|
1218
|
+
return chunkL2MOKP3E_js.createPresentationSessionId();
|
|
1219
1219
|
}
|
|
1220
1220
|
function parseAudienceNonce() {
|
|
1221
1221
|
const hash = window.location.hash;
|
|
@@ -1251,7 +1251,7 @@ function usePresenterWindow(input) {
|
|
|
1251
1251
|
}, []);
|
|
1252
1252
|
const swapDisplays = react.useCallback(async () => {
|
|
1253
1253
|
const audience = audienceWindowRef.current;
|
|
1254
|
-
return audience && !audience.closed ?
|
|
1254
|
+
return audience && !audience.closed ? chunkL2MOKP3E_js.swapPresentationWindows(window, audience) : false;
|
|
1255
1255
|
}, []);
|
|
1256
1256
|
const syncSlideToAudience = react.useCallback(
|
|
1257
1257
|
(slideIndex) => {
|
|
@@ -1315,7 +1315,7 @@ function usePresenterWindow(input) {
|
|
|
1315
1315
|
pollTimerRef.current = null;
|
|
1316
1316
|
}
|
|
1317
1317
|
if (closingSessionId) {
|
|
1318
|
-
void
|
|
1318
|
+
void chunkL2MOKP3E_js.clearAudienceContent(closingSessionId);
|
|
1319
1319
|
}
|
|
1320
1320
|
}, [getChannel]);
|
|
1321
1321
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1333,10 +1333,10 @@ function usePresenterWindow(input) {
|
|
|
1333
1333
|
audienceWindowRef.current = blankWin;
|
|
1334
1334
|
const sessionId = generateSessionId();
|
|
1335
1335
|
sessionIdRef.current = sessionId;
|
|
1336
|
-
const audienceUrl =
|
|
1337
|
-
void
|
|
1336
|
+
const audienceUrl = chunkL2MOKP3E_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1337
|
+
void chunkL2MOKP3E_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1338
1338
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1339
|
-
|
|
1339
|
+
chunkL2MOKP3E_js.placeAudienceWindow(blankWin, placement);
|
|
1340
1340
|
}
|
|
1341
1341
|
return void 0;
|
|
1342
1342
|
});
|
|
@@ -1366,7 +1366,7 @@ function usePresenterWindow(input) {
|
|
|
1366
1366
|
}
|
|
1367
1367
|
};
|
|
1368
1368
|
if (content) {
|
|
1369
|
-
void
|
|
1369
|
+
void chunkL2MOKP3E_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1370
1370
|
} else {
|
|
1371
1371
|
navigateOrClose(true);
|
|
1372
1372
|
}
|
|
@@ -1392,7 +1392,7 @@ function usePresenterWindow(input) {
|
|
|
1392
1392
|
}
|
|
1393
1393
|
const handleMessage = (event) => {
|
|
1394
1394
|
const message = event.data;
|
|
1395
|
-
if (
|
|
1395
|
+
if (chunkL2MOKP3E_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1396
1396
|
syncStateToAudience(snapshotRef.current);
|
|
1397
1397
|
}
|
|
1398
1398
|
};
|
|
@@ -1421,7 +1421,7 @@ function usePresenterWindow(input) {
|
|
|
1421
1421
|
react.useEffect(() => {
|
|
1422
1422
|
const handleBeforeUnload = () => {
|
|
1423
1423
|
if (sessionIdRef.current) {
|
|
1424
|
-
void
|
|
1424
|
+
void chunkL2MOKP3E_js.clearAudienceContent(sessionIdRef.current);
|
|
1425
1425
|
}
|
|
1426
1426
|
};
|
|
1427
1427
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1483,7 +1483,7 @@ function useAudienceMode(input) {
|
|
|
1483
1483
|
}
|
|
1484
1484
|
channel.onmessage = (event) => {
|
|
1485
1485
|
const data = event.data;
|
|
1486
|
-
if (!
|
|
1486
|
+
if (!chunkL2MOKP3E_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1487
1487
|
return;
|
|
1488
1488
|
}
|
|
1489
1489
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1499,16 +1499,16 @@ function useAudienceMode(input) {
|
|
|
1499
1499
|
}
|
|
1500
1500
|
if (data.type === "presenter-exit") {
|
|
1501
1501
|
if (expectedSessionId) {
|
|
1502
|
-
void
|
|
1502
|
+
void chunkL2MOKP3E_js.clearAudienceContent(expectedSessionId);
|
|
1503
1503
|
}
|
|
1504
|
-
if (
|
|
1504
|
+
if (chunkL2MOKP3E_js.endAudienceDisplay(window)) {
|
|
1505
1505
|
handlers.onPresenterEnded?.();
|
|
1506
1506
|
}
|
|
1507
1507
|
}
|
|
1508
1508
|
};
|
|
1509
1509
|
if (expectedSessionId) {
|
|
1510
1510
|
channel.postMessage({
|
|
1511
|
-
origin:
|
|
1511
|
+
origin: chunkL2MOKP3E_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1512
1512
|
type: "audience-ready",
|
|
1513
1513
|
sessionId: expectedSessionId
|
|
1514
1514
|
});
|
|
@@ -1522,7 +1522,7 @@ function useAudienceMode(input) {
|
|
|
1522
1522
|
}, []);
|
|
1523
1523
|
}
|
|
1524
1524
|
function usePresentationKeyboard(input) {
|
|
1525
|
-
const wheelBufferRef = react.useRef(
|
|
1525
|
+
const wheelBufferRef = react.useRef(chunkL2MOKP3E_js.createWheelStepBuffer());
|
|
1526
1526
|
const {
|
|
1527
1527
|
mode,
|
|
1528
1528
|
movePresentationSlide,
|
|
@@ -1543,14 +1543,14 @@ function usePresentationKeyboard(input) {
|
|
|
1543
1543
|
presentationSlideIndex,
|
|
1544
1544
|
setShowRehearsalSummary
|
|
1545
1545
|
} = input;
|
|
1546
|
-
const keyBufferRef = react.useRef(
|
|
1546
|
+
const keyBufferRef = react.useRef(chunkL2MOKP3E_js.createPresentationKeyBuffer());
|
|
1547
1547
|
react.useEffect(() => {
|
|
1548
|
-
if (mode !== "present" || !
|
|
1549
|
-
keyBufferRef.current =
|
|
1548
|
+
if (mode !== "present" || !chunkL2MOKP3E_js.acceptsPresentationInput()) {
|
|
1549
|
+
keyBufferRef.current = chunkL2MOKP3E_js.createPresentationKeyBuffer();
|
|
1550
1550
|
return;
|
|
1551
1551
|
}
|
|
1552
1552
|
const handleKeyDown = (event) => {
|
|
1553
|
-
const mapped =
|
|
1553
|
+
const mapped = chunkL2MOKP3E_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1554
1554
|
if (mapped.action === "none") {
|
|
1555
1555
|
return;
|
|
1556
1556
|
}
|
|
@@ -1570,12 +1570,12 @@ function usePresentationKeyboard(input) {
|
|
|
1570
1570
|
movePresentationSlide(-1);
|
|
1571
1571
|
return;
|
|
1572
1572
|
case "first": {
|
|
1573
|
-
const first =
|
|
1573
|
+
const first = chunkL2MOKP3E_js.firstShowSlideIndex(showSlideIndexes);
|
|
1574
1574
|
navigateToSlide(first ?? 0);
|
|
1575
1575
|
return;
|
|
1576
1576
|
}
|
|
1577
1577
|
case "last": {
|
|
1578
|
-
const last =
|
|
1578
|
+
const last = chunkL2MOKP3E_js.lastShowSlideIndex(showSlideIndexes);
|
|
1579
1579
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1580
1580
|
return;
|
|
1581
1581
|
}
|
|
@@ -1613,10 +1613,10 @@ function usePresentationKeyboard(input) {
|
|
|
1613
1613
|
}
|
|
1614
1614
|
};
|
|
1615
1615
|
const handleWheel = (event) => {
|
|
1616
|
-
if (mode !== "present" || !
|
|
1616
|
+
if (mode !== "present" || !chunkL2MOKP3E_js.acceptsPresentationInput()) {
|
|
1617
1617
|
return;
|
|
1618
1618
|
}
|
|
1619
|
-
const mapped =
|
|
1619
|
+
const mapped = chunkL2MOKP3E_js.mapPresentationWheel(event, wheelBufferRef.current);
|
|
1620
1620
|
if (mapped.intent === "next-slide") {
|
|
1621
1621
|
event.preventDefault();
|
|
1622
1622
|
movePresentationSlide(1);
|
|
@@ -1749,7 +1749,7 @@ function useRehearsalTimings(input) {
|
|
|
1749
1749
|
|
|
1750
1750
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1751
1751
|
function handlePresentationActionImpl(action, deps) {
|
|
1752
|
-
|
|
1752
|
+
chunkL2MOKP3E_js.runPresentationAction(
|
|
1753
1753
|
action,
|
|
1754
1754
|
{ slideCount: deps.slidesLength, ...deps.elementId ? { elementId: deps.elementId } : {} },
|
|
1755
1755
|
{
|
|
@@ -1778,13 +1778,13 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1778
1778
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1779
1779
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1780
1780
|
const transition = deps.reverse ? deps.slides[deps.currentSlideIndex]?.transition : incomingSlide?.transition;
|
|
1781
|
-
const durationMs = deps.playTransition ?
|
|
1781
|
+
const durationMs = deps.playTransition ? chunkL2MOKP3E_js.resolveTransitionDurationMs(transition) : 0;
|
|
1782
1782
|
deps.clearPresentationTimers();
|
|
1783
1783
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1784
1784
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
1785
1785
|
deps.setPresentationSlideVisible(true);
|
|
1786
1786
|
deps.seedSlideAnimations(nextSlideIndex, { completed: deps.seedCompleted });
|
|
1787
|
-
const soundAction =
|
|
1787
|
+
const soundAction = chunkL2MOKP3E_js.resolveTransitionSoundAction(transition);
|
|
1788
1788
|
if (soundAction.kind === "play" && deps.onPlayActionSound) {
|
|
1789
1789
|
deps.onPlayActionSound(soundAction.soundPath, { loop: soundAction.loop });
|
|
1790
1790
|
} else if (soundAction.kind === "stop" && deps.onStopActionSound) {
|
|
@@ -1848,7 +1848,7 @@ function useSlideNavigation(input) {
|
|
|
1848
1848
|
});
|
|
1849
1849
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
1850
1850
|
(slideIndex) => {
|
|
1851
|
-
const delayMs =
|
|
1851
|
+
const delayMs = chunkL2MOKP3E_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
1852
1852
|
if (delayMs === void 0) {
|
|
1853
1853
|
return;
|
|
1854
1854
|
}
|
|
@@ -1871,7 +1871,7 @@ function useSlideNavigation(input) {
|
|
|
1871
1871
|
if (availableSlideIndexes.length === 0) {
|
|
1872
1872
|
return;
|
|
1873
1873
|
}
|
|
1874
|
-
const pastLastSlide = direction === 1 && !
|
|
1874
|
+
const pastLastSlide = direction === 1 && !chunkL2MOKP3E_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
1875
1875
|
if (rehearsing && pastLastSlide) {
|
|
1876
1876
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
1877
1877
|
try {
|
|
@@ -1889,9 +1889,9 @@ function useSlideNavigation(input) {
|
|
|
1889
1889
|
onAdvancePastLastSlide();
|
|
1890
1890
|
return;
|
|
1891
1891
|
}
|
|
1892
|
-
const nextSlideIndex = direction === 1 ?
|
|
1892
|
+
const nextSlideIndex = direction === 1 ? chunkL2MOKP3E_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
1893
1893
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
1894
|
-
}) :
|
|
1894
|
+
}) : chunkL2MOKP3E_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
1895
1895
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
1896
1896
|
return;
|
|
1897
1897
|
}
|
|
@@ -2072,7 +2072,7 @@ function createCustomShowRunner(deps) {
|
|
|
2072
2072
|
return;
|
|
2073
2073
|
}
|
|
2074
2074
|
origin = returnAfter ? { showId: deps.getActiveCustomShowId(), slideIndex: deps.getPresentationSlideIndex() } : null;
|
|
2075
|
-
const first =
|
|
2075
|
+
const first = chunkL2MOKP3E_js.firstShowSlideIndex(chunkL2MOKP3E_js.resolveShowSlideIndexes(deps.getSlides(), target));
|
|
2076
2076
|
deps.setActiveCustomShowId(customShowId);
|
|
2077
2077
|
if (first !== void 0) {
|
|
2078
2078
|
deps.navigateToSlide(first);
|
|
@@ -2150,33 +2150,33 @@ function usePresentationActionExtensions(input) {
|
|
|
2150
2150
|
}
|
|
2151
2151
|
}, [navigateToSlideViaRef]);
|
|
2152
2152
|
const onOpenFile = react.useCallback((target) => {
|
|
2153
|
-
|
|
2153
|
+
chunkL2MOKP3E_js.safeOpenUrl(target);
|
|
2154
2154
|
}, []);
|
|
2155
2155
|
const onOpenPresentation = react.useCallback((target) => {
|
|
2156
|
-
|
|
2156
|
+
chunkL2MOKP3E_js.safeOpenUrl(target);
|
|
2157
2157
|
}, []);
|
|
2158
2158
|
const onRunProgram = react.useCallback(
|
|
2159
2159
|
(target) => {
|
|
2160
|
-
onAddRunProgramNotice?.(
|
|
2160
|
+
onAddRunProgramNotice?.(chunkL2MOKP3E_js.buildRunProgramNotice(target));
|
|
2161
2161
|
},
|
|
2162
2162
|
[onAddRunProgramNotice]
|
|
2163
2163
|
);
|
|
2164
2164
|
const onPlayMedia = react.useCallback(
|
|
2165
2165
|
(elementId) => {
|
|
2166
|
-
|
|
2166
|
+
chunkL2MOKP3E_js.toggleStageElementMedia(containerRef.current, elementId);
|
|
2167
2167
|
},
|
|
2168
2168
|
[containerRef]
|
|
2169
2169
|
);
|
|
2170
2170
|
const onOleVerb = react.useCallback(
|
|
2171
2171
|
(verb, elementId) => {
|
|
2172
|
-
const target =
|
|
2172
|
+
const target = chunkL2MOKP3E_js.resolveOleVerbTarget(slides[presentationSlideIndex], elementId, verb);
|
|
2173
2173
|
if (!target) {
|
|
2174
2174
|
return;
|
|
2175
2175
|
}
|
|
2176
2176
|
if (target.action === "download") {
|
|
2177
|
-
|
|
2177
|
+
chunkL2MOKP3E_js.downloadDataUrl(target.url, target.fileName ?? "download");
|
|
2178
2178
|
} else {
|
|
2179
|
-
|
|
2179
|
+
chunkL2MOKP3E_js.openUrlInNewTab(target.url);
|
|
2180
2180
|
}
|
|
2181
2181
|
},
|
|
2182
2182
|
[slides, presentationSlideIndex]
|
|
@@ -2207,22 +2207,22 @@ function usePresentationActionExtensions(input) {
|
|
|
2207
2207
|
};
|
|
2208
2208
|
}
|
|
2209
2209
|
function usePresenterConsole(slideIndex, active) {
|
|
2210
|
-
const timerRef = react.useRef(
|
|
2211
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2210
|
+
const timerRef = react.useRef(chunkL2MOKP3E_js.createPresenterTimer());
|
|
2211
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkL2MOKP3E_js.createInitialPresentationSnapshot(slideIndex));
|
|
2212
2212
|
const patch = react.useCallback((value) => {
|
|
2213
|
-
setSnapshot((current) =>
|
|
2213
|
+
setSnapshot((current) => chunkL2MOKP3E_js.mergePresentationSnapshot(current, value));
|
|
2214
2214
|
}, []);
|
|
2215
2215
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2216
2216
|
react.useEffect(() => {
|
|
2217
2217
|
if (!active) {
|
|
2218
2218
|
return;
|
|
2219
2219
|
}
|
|
2220
|
-
timerRef.current =
|
|
2220
|
+
timerRef.current = chunkL2MOKP3E_js.resetPresenterTimer();
|
|
2221
2221
|
patch({ paused: false, elapsedMs: 0 });
|
|
2222
2222
|
const timer = window.setInterval(() => {
|
|
2223
2223
|
patch({
|
|
2224
2224
|
paused: timerRef.current.paused,
|
|
2225
|
-
elapsedMs:
|
|
2225
|
+
elapsedMs: chunkL2MOKP3E_js.presenterElapsed(timerRef.current)
|
|
2226
2226
|
});
|
|
2227
2227
|
}, 1e3);
|
|
2228
2228
|
return () => window.clearInterval(timer);
|
|
@@ -2232,19 +2232,19 @@ function usePresenterConsole(slideIndex, active) {
|
|
|
2232
2232
|
applyAudienceSnapshot: setSnapshot,
|
|
2233
2233
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2234
2234
|
toggleTimer: () => {
|
|
2235
|
-
timerRef.current =
|
|
2235
|
+
timerRef.current = chunkL2MOKP3E_js.togglePresenterTimer(timerRef.current);
|
|
2236
2236
|
patch({
|
|
2237
2237
|
paused: timerRef.current.paused,
|
|
2238
|
-
elapsedMs:
|
|
2238
|
+
elapsedMs: chunkL2MOKP3E_js.presenterElapsed(timerRef.current)
|
|
2239
2239
|
});
|
|
2240
2240
|
},
|
|
2241
2241
|
resetTimer: () => {
|
|
2242
|
-
timerRef.current =
|
|
2242
|
+
timerRef.current = chunkL2MOKP3E_js.resetPresenterTimer();
|
|
2243
2243
|
patch({ paused: false, elapsedMs: 0 });
|
|
2244
2244
|
},
|
|
2245
2245
|
stepZoom: (direction) => setSnapshot(
|
|
2246
|
-
(current) =>
|
|
2247
|
-
zoom:
|
|
2246
|
+
(current) => chunkL2MOKP3E_js.mergePresentationSnapshot(current, {
|
|
2247
|
+
zoom: chunkL2MOKP3E_js.stepPresenterZoom(
|
|
2248
2248
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2249
2249
|
direction
|
|
2250
2250
|
)
|
|
@@ -2299,7 +2299,7 @@ function usePresentationMode(input) {
|
|
|
2299
2299
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2300
2300
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2301
2301
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2302
|
-
const showGuard = react.useMemo(() =>
|
|
2302
|
+
const showGuard = react.useMemo(() => chunkL2MOKP3E_js.createPresenterShowGuard(), []);
|
|
2303
2303
|
const {
|
|
2304
2304
|
presentationAnimations,
|
|
2305
2305
|
presentationElementStates,
|
|
@@ -2399,7 +2399,7 @@ function usePresentationMode(input) {
|
|
|
2399
2399
|
actionExtensions.bindNavigateToSlide(navigateToSlide);
|
|
2400
2400
|
const movePresentationSlide = react.useCallback(
|
|
2401
2401
|
(direction, trigger = "explicit") => {
|
|
2402
|
-
if (!
|
|
2402
|
+
if (!chunkL2MOKP3E_js.acceptsPresentationInput()) {
|
|
2403
2403
|
return;
|
|
2404
2404
|
}
|
|
2405
2405
|
if (endOfShowVisible) {
|
|
@@ -2468,7 +2468,7 @@ function usePresentationMode(input) {
|
|
|
2468
2468
|
onSetMode("present");
|
|
2469
2469
|
}, [containerRef, onSetMode, setRehearsing]);
|
|
2470
2470
|
const enterPresentModeFromBeginning = react.useCallback(() => {
|
|
2471
|
-
const first =
|
|
2471
|
+
const first = chunkL2MOKP3E_js.firstShowSlideIndex(visibleSlideIndexes);
|
|
2472
2472
|
if (first !== void 0) {
|
|
2473
2473
|
onSetActiveSlideIndex(first);
|
|
2474
2474
|
}
|
|
@@ -2548,7 +2548,7 @@ function usePresentationMode(input) {
|
|
|
2548
2548
|
if (mode !== "present") {
|
|
2549
2549
|
return;
|
|
2550
2550
|
}
|
|
2551
|
-
return
|
|
2551
|
+
return chunkL2MOKP3E_js.attachPresentationVisibilityPause({
|
|
2552
2552
|
root: containerRef.current ?? void 0,
|
|
2553
2553
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2554
2554
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
@@ -2556,7 +2556,7 @@ function usePresentationMode(input) {
|
|
|
2556
2556
|
}, [mode, containerRef]);
|
|
2557
2557
|
react.useLayoutEffect(() => {
|
|
2558
2558
|
if (mode === "present") {
|
|
2559
|
-
const idx =
|
|
2559
|
+
const idx = chunkL2MOKP3E_js.presentationEntrySlideIndex(
|
|
2560
2560
|
activeSlideIndexRef.current,
|
|
2561
2561
|
visibleSlideIndexesRef.current
|
|
2562
2562
|
);
|
|
@@ -2635,11 +2635,11 @@ function usePresentationMode(input) {
|
|
|
2635
2635
|
return void 0;
|
|
2636
2636
|
}
|
|
2637
2637
|
const incoming = slides[transitionOverlay.incomingSlideIndex];
|
|
2638
|
-
return
|
|
2638
|
+
return chunkL2MOKP3E_js.buildMorphTransitionPlan(
|
|
2639
2639
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2640
2640
|
incoming,
|
|
2641
2641
|
transitionOverlay.durationMs,
|
|
2642
|
-
|
|
2642
|
+
chunkL2MOKP3E_js.morphOptionToMode(transitionOverlay.transition.morphOption),
|
|
2643
2643
|
// `PresentationStage` stacks the incoming slide's elements above its
|
|
2644
2644
|
// template shapes (`zIndex = templateElements.length + index`), so a
|
|
2645
2645
|
// z-index journey has to start counting where the stage does.
|
|
@@ -2664,7 +2664,7 @@ function usePresentationMode(input) {
|
|
|
2664
2664
|
if (!morphPlan) {
|
|
2665
2665
|
return presentationKeyframesCss;
|
|
2666
2666
|
}
|
|
2667
|
-
const imageRules =
|
|
2667
|
+
const imageRules = chunkL2MOKP3E_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
|
|
2668
2668
|
return `${presentationKeyframesCss ?? ""}
|
|
2669
2669
|
${morphPlan.keyframesCss}
|
|
2670
2670
|
${imageRules}`;
|
|
@@ -2961,7 +2961,7 @@ function useFindReplace({
|
|
|
2961
2961
|
const [findResults, setFindResults] = react.useState([]);
|
|
2962
2962
|
const [findResultIndex, setFindResultIndex] = react.useState(-1);
|
|
2963
2963
|
const performFind = react.useCallback(() => {
|
|
2964
|
-
const results =
|
|
2964
|
+
const results = chunkL2MOKP3E_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
|
|
2965
2965
|
if (!findQuery) {
|
|
2966
2966
|
setFindResults([]);
|
|
2967
2967
|
setFindResultIndex(-1);
|
|
@@ -2995,7 +2995,7 @@ function useFindReplace({
|
|
|
2995
2995
|
return;
|
|
2996
2996
|
}
|
|
2997
2997
|
onUpdateSlides(
|
|
2998
|
-
(prevSlides) =>
|
|
2998
|
+
(prevSlides) => chunkL2MOKP3E_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
|
|
2999
2999
|
);
|
|
3000
3000
|
onMarkDirty();
|
|
3001
3001
|
},
|
|
@@ -3017,9 +3017,9 @@ function useFindReplace({
|
|
|
3017
3017
|
}, [findResults, applyReplacements, performFind]);
|
|
3018
3018
|
react.useEffect(() => {
|
|
3019
3019
|
const handler = (event) => {
|
|
3020
|
-
const { action } =
|
|
3020
|
+
const { action } = chunkL2MOKP3E_js.mapEditorKey(event, {
|
|
3021
3021
|
canEdit: mode === "edit",
|
|
3022
|
-
isTextInputTarget:
|
|
3022
|
+
isTextInputTarget: chunkL2MOKP3E_js.isEditorTextInputTarget(event.target)
|
|
3023
3023
|
});
|
|
3024
3024
|
if (action !== "find") {
|
|
3025
3025
|
return;
|
|
@@ -3130,7 +3130,7 @@ function addCommentToSlide(slides, slideIndex, text, authorName, elementId, ment
|
|
|
3130
3130
|
if (!slide) {
|
|
3131
3131
|
return { slides, didAdd: false };
|
|
3132
3132
|
}
|
|
3133
|
-
const next =
|
|
3133
|
+
const next = chunkL2MOKP3E_js.addCommentToList(
|
|
3134
3134
|
slide.comments || [],
|
|
3135
3135
|
text,
|
|
3136
3136
|
authorName,
|
|
@@ -3151,7 +3151,7 @@ function removeCommentFromSlide(slides, slideIndex, commentId) {
|
|
|
3151
3151
|
if (!slide) {
|
|
3152
3152
|
return { slides, didDelete: false };
|
|
3153
3153
|
}
|
|
3154
|
-
const next =
|
|
3154
|
+
const next = chunkL2MOKP3E_js.removeCommentFromList(slide.comments || [], commentId);
|
|
3155
3155
|
if (!next) {
|
|
3156
3156
|
return { slides, didDelete: false };
|
|
3157
3157
|
}
|
|
@@ -3162,7 +3162,7 @@ function editCommentInSlide(slides, slideIndex, commentId, newText) {
|
|
|
3162
3162
|
if (!slide) {
|
|
3163
3163
|
return { slides, didUpdate: false };
|
|
3164
3164
|
}
|
|
3165
|
-
const next =
|
|
3165
|
+
const next = chunkL2MOKP3E_js.editCommentInList(slide.comments || [], commentId, newText);
|
|
3166
3166
|
if (!next) {
|
|
3167
3167
|
return { slides, didUpdate: false };
|
|
3168
3168
|
}
|
|
@@ -3173,7 +3173,7 @@ function toggleResolvedInSlide(slides, slideIndex, commentId) {
|
|
|
3173
3173
|
if (!slide) {
|
|
3174
3174
|
return { slides, didUpdate: false };
|
|
3175
3175
|
}
|
|
3176
|
-
const next =
|
|
3176
|
+
const next = chunkL2MOKP3E_js.toggleCommentResolvedInList(slide.comments || [], commentId);
|
|
3177
3177
|
if (!next) {
|
|
3178
3178
|
return { slides, didUpdate: false };
|
|
3179
3179
|
}
|
|
@@ -3184,7 +3184,7 @@ function addReplyToSlide(slides, slideIndex, parentId, text, authorName, mention
|
|
|
3184
3184
|
if (!slide) {
|
|
3185
3185
|
return { slides, didAdd: false };
|
|
3186
3186
|
}
|
|
3187
|
-
const next =
|
|
3187
|
+
const next = chunkL2MOKP3E_js.replyToCommentInList(slide.comments || [], parentId, text, authorName);
|
|
3188
3188
|
if (!next) {
|
|
3189
3189
|
return { slides, didAdd: false };
|
|
3190
3190
|
}
|
|
@@ -3571,7 +3571,7 @@ function useDerivedElementState(input) {
|
|
|
3571
3571
|
return [];
|
|
3572
3572
|
}
|
|
3573
3573
|
return [
|
|
3574
|
-
...
|
|
3574
|
+
...chunkL2MOKP3E_js.visibleTemplateElements(activeSlide, templateElementsBySlideId[activeSlide.id] ?? [])
|
|
3575
3575
|
];
|
|
3576
3576
|
}, [activeSlide, templateElementsBySlideId]);
|
|
3577
3577
|
const activeMaster = slideMasters[activeMasterIndex];
|
|
@@ -3638,7 +3638,7 @@ function useViewerCoreState(_input) {
|
|
|
3638
3638
|
const marqueeStateRef = react.useRef(null);
|
|
3639
3639
|
const isDrawingRef = react.useRef(false);
|
|
3640
3640
|
const justInteractedRef = react.useRef(false);
|
|
3641
|
-
const livePatcher = react.useMemo(() =>
|
|
3641
|
+
const livePatcher = react.useMemo(() => chunkL2MOKP3E_js.createCollaborationLivePatcher(), []);
|
|
3642
3642
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3643
3643
|
const slidesRef = react.useRef([]);
|
|
3644
3644
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3647,8 +3647,8 @@ function useViewerCoreState(_input) {
|
|
|
3647
3647
|
const [slides, setSlides] = react.useState([]);
|
|
3648
3648
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3649
3649
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3650
|
-
width:
|
|
3651
|
-
height:
|
|
3650
|
+
width: chunkW5W75MFP_js.DEFAULT_CANVAS_WIDTH,
|
|
3651
|
+
height: chunkW5W75MFP_js.DEFAULT_CANVAS_HEIGHT
|
|
3652
3652
|
});
|
|
3653
3653
|
const [slideSizeEmu, setSlideSizeEmu] = react.useState();
|
|
3654
3654
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
@@ -3669,7 +3669,7 @@ function useViewerCoreState(_input) {
|
|
|
3669
3669
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3670
3670
|
inlineEditingTextRef.current = resolved;
|
|
3671
3671
|
setInlineEditingTextBase(value);
|
|
3672
|
-
|
|
3672
|
+
chunkL2MOKP3E_js.publishLiveInlineText(
|
|
3673
3673
|
livePatcher,
|
|
3674
3674
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3675
3675
|
inlineEditingElementIdRef.current,
|
|
@@ -3964,8 +3964,8 @@ function useViewerState(input) {
|
|
|
3964
3964
|
}
|
|
3965
3965
|
|
|
3966
3966
|
// src/viewer/utils/glyph-outline-cache.ts
|
|
3967
|
-
var glyphOutlineFontCache = new
|
|
3968
|
-
var getGlyphOutline =
|
|
3967
|
+
var glyphOutlineFontCache = new chunkL2MOKP3E_js.GlyphOutlineFontCache();
|
|
3968
|
+
var getGlyphOutline = chunkL2MOKP3E_js.createGlyphOutlineLookup(glyphOutlineFontCache);
|
|
3969
3969
|
|
|
3970
3970
|
// src/viewer/hooks/useLoadContent.ts
|
|
3971
3971
|
function useLoadContent({
|
|
@@ -4038,7 +4038,7 @@ function useLoadContent({
|
|
|
4038
4038
|
);
|
|
4039
4039
|
}
|
|
4040
4040
|
const previousHandler = handlerRef.current;
|
|
4041
|
-
const handler = new
|
|
4041
|
+
const handler = new chunkL2MOKP3E_js.PptxHandler();
|
|
4042
4042
|
const parsed = await handler.load(buffer, { allowExternalImages });
|
|
4043
4043
|
if (cancelled || token !== renderTokenRef.current) {
|
|
4044
4044
|
handler.dispose();
|
|
@@ -4050,7 +4050,7 @@ function useLoadContent({
|
|
|
4050
4050
|
handlerRef.current = null;
|
|
4051
4051
|
const mediaElements = [];
|
|
4052
4052
|
for (const slide of parsed.slides) {
|
|
4053
|
-
|
|
4053
|
+
chunkL2MOKP3E_js.collectMediaElements(slide.elements, mediaElements);
|
|
4054
4054
|
}
|
|
4055
4055
|
for (const url of mediaDataUrls.values()) {
|
|
4056
4056
|
if (url.startsWith("blob:")) {
|
|
@@ -4060,7 +4060,7 @@ function useLoadContent({
|
|
|
4060
4060
|
mediaDataUrls.clear();
|
|
4061
4061
|
await Promise.all(
|
|
4062
4062
|
mediaElements.map(async (mediaElement) => {
|
|
4063
|
-
const resolved = await
|
|
4063
|
+
const resolved = await chunkL2MOKP3E_js.resolveMediaElementSource(mediaElement, handler);
|
|
4064
4064
|
if (resolved.missing || !resolved.mediaPath || !resolved.url) {
|
|
4065
4065
|
mediaElement.mediaMissing = true;
|
|
4066
4066
|
return;
|
|
@@ -4071,7 +4071,7 @@ function useLoadContent({
|
|
|
4071
4071
|
}
|
|
4072
4072
|
})
|
|
4073
4073
|
);
|
|
4074
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
4074
|
+
const { paths: imagePaths, refs: imageRefs } = chunkL2MOKP3E_js.collectImagePaths(parsed.slides);
|
|
4075
4075
|
let nextSlides = parsed.slides;
|
|
4076
4076
|
if (imagePaths.size > 0) {
|
|
4077
4077
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -4087,25 +4087,25 @@ function useLoadContent({
|
|
|
4087
4087
|
})
|
|
4088
4088
|
);
|
|
4089
4089
|
nextSlides = parsed.slides.map((s) => {
|
|
4090
|
-
const newElements =
|
|
4090
|
+
const newElements = chunkL2MOKP3E_js.applyImagePathPatches(s.elements, resolvedMap, imageRefs);
|
|
4091
4091
|
return newElements === s.elements ? s : { ...s, elements: newElements };
|
|
4092
4092
|
});
|
|
4093
4093
|
}
|
|
4094
|
-
nextSlides = await
|
|
4094
|
+
nextSlides = await chunkL2MOKP3E_js.resolveTableCellImageUrls(
|
|
4095
4095
|
nextSlides,
|
|
4096
4096
|
(path) => handler.getImageData(path)
|
|
4097
4097
|
);
|
|
4098
|
-
const nextTableStyleMap = await
|
|
4098
|
+
const nextTableStyleMap = await chunkL2MOKP3E_js.resolveTableStyleImageUrls(
|
|
4099
4099
|
parsed.tableStyleMap,
|
|
4100
4100
|
(path) => handler.getImageData(path)
|
|
4101
4101
|
);
|
|
4102
4102
|
handlerRef.current = handler;
|
|
4103
|
-
const partition =
|
|
4103
|
+
const partition = chunkL2MOKP3E_js.partitionTemplateElements(nextSlides);
|
|
4104
4104
|
setSlides(partition.slides);
|
|
4105
4105
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
4106
4106
|
setCanvasSize({
|
|
4107
|
-
width: parsed.width ??
|
|
4108
|
-
height: parsed.height ??
|
|
4107
|
+
width: parsed.width ?? chunkW5W75MFP_js.DEFAULT_CANVAS_WIDTH,
|
|
4108
|
+
height: parsed.height ?? chunkW5W75MFP_js.DEFAULT_CANVAS_HEIGHT
|
|
4109
4109
|
});
|
|
4110
4110
|
setSlideSizeEmu(
|
|
4111
4111
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -4118,7 +4118,7 @@ function useLoadContent({
|
|
|
4118
4118
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
4119
4119
|
setSlideMasters(parsed.slideMasters ?? []);
|
|
4120
4120
|
setModernCommentAuthors(parsed.modernCommentAuthors ?? []);
|
|
4121
|
-
setRecentColors(
|
|
4121
|
+
setRecentColors(chunkL2MOKP3E_js.seedRecentColors({ mruColors: parsed.mruColors }));
|
|
4122
4122
|
setTheme(parsed.theme);
|
|
4123
4123
|
setTableStyleMap(nextTableStyleMap);
|
|
4124
4124
|
setTableStylesDefaultId(parsed.tableStylesDefaultId);
|
|
@@ -4126,7 +4126,7 @@ function useLoadContent({
|
|
|
4126
4126
|
setThemeOptions(parsed.themeOptions ?? []);
|
|
4127
4127
|
setCustomShows(parsed.customShows ?? []);
|
|
4128
4128
|
setActiveCustomShowId(
|
|
4129
|
-
|
|
4129
|
+
chunkL2MOKP3E_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
|
|
4130
4130
|
);
|
|
4131
4131
|
setSections(parsed.sections ?? []);
|
|
4132
4132
|
setPresentationProperties(parsed.presentationProperties ?? {});
|
|
@@ -4150,11 +4150,11 @@ function useLoadContent({
|
|
|
4150
4150
|
setHasMacros(parsed.hasMacros === true);
|
|
4151
4151
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
4152
4152
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
4153
|
-
setGuides(
|
|
4154
|
-
setReadOnlyRecommendation(
|
|
4153
|
+
setGuides(chunkL2MOKP3E_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
4154
|
+
setReadOnlyRecommendation(chunkL2MOKP3E_js.readOnlyRecommendation(parsed));
|
|
4155
4155
|
setModifyVerifier(parsed.modifyVerifier ?? void 0);
|
|
4156
4156
|
setCompatToasts(
|
|
4157
|
-
|
|
4157
|
+
chunkL2MOKP3E_js.compatibilityWarningToasts([
|
|
4158
4158
|
...parsed.warnings ?? [],
|
|
4159
4159
|
...parsed.slides.flatMap((slide) => slide.warnings ?? [])
|
|
4160
4160
|
])
|
|
@@ -4166,7 +4166,7 @@ function useLoadContent({
|
|
|
4166
4166
|
onContentApplied?.();
|
|
4167
4167
|
} catch (err) {
|
|
4168
4168
|
if (!cancelled && token === renderTokenRef.current) {
|
|
4169
|
-
if (err instanceof
|
|
4169
|
+
if (err instanceof chunkL2MOKP3E_js.EncryptedFileError) {
|
|
4170
4170
|
setIsEncrypted(true);
|
|
4171
4171
|
} else {
|
|
4172
4172
|
console.error("[pptx] Failed to load presentation content:", err);
|
|
@@ -4194,7 +4194,7 @@ function useLoadContent({
|
|
|
4194
4194
|
}
|
|
4195
4195
|
function useAutosave(input) {
|
|
4196
4196
|
const { isDirty, filePath, serializeSlides, enabled = true, getChangeSources } = input;
|
|
4197
|
-
const intervalMs =
|
|
4197
|
+
const intervalMs = chunkL2MOKP3E_js.resolveAutosaveIntervalMs({
|
|
4198
4198
|
hostIntervalMs: input.intervalMs,
|
|
4199
4199
|
optionsIntervalSeconds: input.intervalSeconds
|
|
4200
4200
|
});
|
|
@@ -4225,7 +4225,7 @@ function useAutosave(input) {
|
|
|
4225
4225
|
return;
|
|
4226
4226
|
}
|
|
4227
4227
|
const sources = changeSourcesRef.current?.() ?? [];
|
|
4228
|
-
if (!
|
|
4228
|
+
if (!chunkL2MOKP3E_js.shouldWriteAutosaveSnapshot({
|
|
4229
4229
|
filePath: path,
|
|
4230
4230
|
isDirty: isDirtyRef.current,
|
|
4231
4231
|
saving: isSavingRef.current,
|
|
@@ -4243,8 +4243,8 @@ function useAutosave(input) {
|
|
|
4243
4243
|
isSavingRef.current = false;
|
|
4244
4244
|
return;
|
|
4245
4245
|
}
|
|
4246
|
-
await
|
|
4247
|
-
lastSnapshotRef.current =
|
|
4246
|
+
await chunkL2MOKP3E_js.saveAutosaveSnapshot(path, data);
|
|
4247
|
+
lastSnapshotRef.current = chunkL2MOKP3E_js.autosaveSnapshotMark(path, sources);
|
|
4248
4248
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4249
4249
|
} catch (err) {
|
|
4250
4250
|
setAutosaveStatus({
|
|
@@ -4298,13 +4298,13 @@ function useElementOperations(input) {
|
|
|
4298
4298
|
inlineEditingText
|
|
4299
4299
|
} = input;
|
|
4300
4300
|
const liveTextSegments = react.useCallback(() => {
|
|
4301
|
-
if (!selectedElement || !
|
|
4301
|
+
if (!selectedElement || !chunkL2MOKP3E_js.hasTextProperties(selectedElement)) {
|
|
4302
4302
|
return void 0;
|
|
4303
4303
|
}
|
|
4304
4304
|
if (selectedElement.id !== inlineEditingElementId) {
|
|
4305
4305
|
return selectedElement.textSegments;
|
|
4306
4306
|
}
|
|
4307
|
-
return
|
|
4307
|
+
return chunkL2MOKP3E_js.remapTextToSegments(
|
|
4308
4308
|
inlineEditingText,
|
|
4309
4309
|
selectedElement.textSegments,
|
|
4310
4310
|
selectedElement.textStyle
|
|
@@ -4345,11 +4345,11 @@ function useElementOperations(input) {
|
|
|
4345
4345
|
(elementId, updates) => {
|
|
4346
4346
|
if (masterView?.target) {
|
|
4347
4347
|
applyMasterViewWrite(
|
|
4348
|
-
|
|
4348
|
+
chunkL2MOKP3E_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
|
|
4349
4349
|
);
|
|
4350
4350
|
return;
|
|
4351
4351
|
}
|
|
4352
|
-
if (
|
|
4352
|
+
if (chunkL2MOKP3E_js.isTemplateElementId(elementId)) {
|
|
4353
4353
|
const slideId = activeSlide?.id;
|
|
4354
4354
|
if (slideId) {
|
|
4355
4355
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4360,7 +4360,7 @@ function useElementOperations(input) {
|
|
|
4360
4360
|
}));
|
|
4361
4361
|
}
|
|
4362
4362
|
} else {
|
|
4363
|
-
setSlides((prev) =>
|
|
4363
|
+
setSlides((prev) => chunkL2MOKP3E_js.updateElement(prev, activeSlideIndex, elementId, updates));
|
|
4364
4364
|
}
|
|
4365
4365
|
history.markDirty();
|
|
4366
4366
|
},
|
|
@@ -4385,7 +4385,7 @@ function useElementOperations(input) {
|
|
|
4385
4385
|
);
|
|
4386
4386
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4387
4387
|
(updates) => {
|
|
4388
|
-
if (!selectedElement || !
|
|
4388
|
+
if (!selectedElement || !chunkL2MOKP3E_js.hasShapeProperties(selectedElement)) {
|
|
4389
4389
|
return;
|
|
4390
4390
|
}
|
|
4391
4391
|
updateSelectedElement({
|
|
@@ -4396,19 +4396,19 @@ function useElementOperations(input) {
|
|
|
4396
4396
|
);
|
|
4397
4397
|
const updateSelectedTextStyle = react.useCallback(
|
|
4398
4398
|
(updates) => {
|
|
4399
|
-
if (!selectedElement || !
|
|
4399
|
+
if (!selectedElement || !chunkL2MOKP3E_js.hasTextProperties(selectedElement)) {
|
|
4400
4400
|
return;
|
|
4401
4401
|
}
|
|
4402
4402
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
4403
4403
|
const currentSegments = liveTextSegments();
|
|
4404
|
-
const inlineSel =
|
|
4404
|
+
const inlineSel = chunkL2MOKP3E_js.getInlineEditorSelection(currentSegments);
|
|
4405
4405
|
if (inlineSel && currentSegments) {
|
|
4406
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4406
|
+
const { newSegments: newSegments2, newSelection } = chunkL2MOKP3E_js.applyStyleToSelectedSegments(
|
|
4407
4407
|
currentSegments,
|
|
4408
4408
|
inlineSel,
|
|
4409
4409
|
updates
|
|
4410
4410
|
);
|
|
4411
|
-
|
|
4411
|
+
chunkL2MOKP3E_js.setPendingSelectionRestore(newSelection);
|
|
4412
4412
|
updateSelectedElement({
|
|
4413
4413
|
textSegments: newSegments2,
|
|
4414
4414
|
...isLiveEditing ? { text: inlineEditingText } : {}
|
|
@@ -4436,14 +4436,14 @@ function useElementOperations(input) {
|
|
|
4436
4436
|
);
|
|
4437
4437
|
const updateSelectedTextCase = react.useCallback(
|
|
4438
4438
|
(mode) => {
|
|
4439
|
-
if (!selectedElement || !
|
|
4439
|
+
if (!selectedElement || !chunkL2MOKP3E_js.hasTextProperties(selectedElement)) {
|
|
4440
4440
|
return;
|
|
4441
4441
|
}
|
|
4442
4442
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
4443
4443
|
const currentSegments = liveTextSegments();
|
|
4444
|
-
const inlineSel =
|
|
4444
|
+
const inlineSel = chunkL2MOKP3E_js.getInlineEditorSelection(currentSegments);
|
|
4445
4445
|
if (inlineSel && currentSegments) {
|
|
4446
|
-
const newSegments =
|
|
4446
|
+
const newSegments = chunkL2MOKP3E_js.applyCaseTransformToSegments(currentSegments, inlineSel, mode);
|
|
4447
4447
|
updateSelectedElement({
|
|
4448
4448
|
textSegments: newSegments,
|
|
4449
4449
|
...isLiveEditing ? { text: inlineEditingText } : {}
|
|
@@ -4452,7 +4452,7 @@ function useElementOperations(input) {
|
|
|
4452
4452
|
}
|
|
4453
4453
|
const updates = {};
|
|
4454
4454
|
if (currentSegments && currentSegments.length > 0) {
|
|
4455
|
-
updates.textSegments =
|
|
4455
|
+
updates.textSegments = chunkL2MOKP3E_js.applyCaseTransformToSegments(
|
|
4456
4456
|
currentSegments,
|
|
4457
4457
|
null,
|
|
4458
4458
|
mode
|
|
@@ -4460,7 +4460,7 @@ function useElementOperations(input) {
|
|
|
4460
4460
|
}
|
|
4461
4461
|
const baseText = isLiveEditing ? inlineEditingText : selectedElement.text;
|
|
4462
4462
|
if (typeof baseText === "string") {
|
|
4463
|
-
updates.text =
|
|
4463
|
+
updates.text = chunkL2MOKP3E_js.transformTextCase(baseText, mode);
|
|
4464
4464
|
}
|
|
4465
4465
|
updateSelectedElement(updates);
|
|
4466
4466
|
},
|
|
@@ -4479,15 +4479,15 @@ function useElementOperations(input) {
|
|
|
4479
4479
|
[setSlides]
|
|
4480
4480
|
);
|
|
4481
4481
|
const masterViewTarget = masterView?.target ?? null;
|
|
4482
|
-
const activeElements = masterViewTarget ?
|
|
4482
|
+
const activeElements = masterViewTarget ? chunkL2MOKP3E_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4483
4483
|
const updateActiveElements = react.useCallback(
|
|
4484
4484
|
(updater) => {
|
|
4485
4485
|
if (masterView?.target) {
|
|
4486
4486
|
applyMasterViewWrite(
|
|
4487
|
-
|
|
4487
|
+
chunkL2MOKP3E_js.replaceMasterViewElements(
|
|
4488
4488
|
masterView,
|
|
4489
4489
|
masterView.target,
|
|
4490
|
-
updater(
|
|
4490
|
+
updater(chunkL2MOKP3E_js.masterViewElements(masterView, masterView.target))
|
|
4491
4491
|
)
|
|
4492
4492
|
);
|
|
4493
4493
|
return;
|
|
@@ -4540,7 +4540,7 @@ function useSectionOperations(input) {
|
|
|
4540
4540
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4541
4541
|
const addSection2 = react.useCallback(
|
|
4542
4542
|
(name, afterSlideIndex) => {
|
|
4543
|
-
const result =
|
|
4543
|
+
const result = chunkL2MOKP3E_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4544
4544
|
setSlides(result.slides);
|
|
4545
4545
|
setSections(result.sections);
|
|
4546
4546
|
markDirty();
|
|
@@ -4549,7 +4549,7 @@ function useSectionOperations(input) {
|
|
|
4549
4549
|
);
|
|
4550
4550
|
const renameSection2 = react.useCallback(
|
|
4551
4551
|
(sectionId, newName) => {
|
|
4552
|
-
const result =
|
|
4552
|
+
const result = chunkL2MOKP3E_js.renameSection(sections, slides, sectionId, newName);
|
|
4553
4553
|
setSections(result.sections);
|
|
4554
4554
|
setSlides(result.slides);
|
|
4555
4555
|
markDirty();
|
|
@@ -4558,7 +4558,7 @@ function useSectionOperations(input) {
|
|
|
4558
4558
|
);
|
|
4559
4559
|
const deleteSection2 = react.useCallback(
|
|
4560
4560
|
(sectionId) => {
|
|
4561
|
-
const result =
|
|
4561
|
+
const result = chunkL2MOKP3E_js.deleteSection(sections, slides, sectionId);
|
|
4562
4562
|
setSections(result.sections);
|
|
4563
4563
|
setSlides(result.slides);
|
|
4564
4564
|
markDirty();
|
|
@@ -4567,21 +4567,21 @@ function useSectionOperations(input) {
|
|
|
4567
4567
|
);
|
|
4568
4568
|
const moveSectionUp2 = react.useCallback(
|
|
4569
4569
|
(sectionId) => {
|
|
4570
|
-
setSections(
|
|
4570
|
+
setSections(chunkL2MOKP3E_js.moveSectionUp(sections, sectionId));
|
|
4571
4571
|
markDirty();
|
|
4572
4572
|
},
|
|
4573
4573
|
[sections, setSections, markDirty]
|
|
4574
4574
|
);
|
|
4575
4575
|
const moveSectionDown2 = react.useCallback(
|
|
4576
4576
|
(sectionId) => {
|
|
4577
|
-
setSections(
|
|
4577
|
+
setSections(chunkL2MOKP3E_js.moveSectionDown(sections, sectionId));
|
|
4578
4578
|
markDirty();
|
|
4579
4579
|
},
|
|
4580
4580
|
[sections, setSections, markDirty]
|
|
4581
4581
|
);
|
|
4582
4582
|
const moveSlidesToSection2 = react.useCallback(
|
|
4583
4583
|
(slideIndexes, targetSectionId) => {
|
|
4584
|
-
const result =
|
|
4584
|
+
const result = chunkL2MOKP3E_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4585
4585
|
setSlides(result.slides);
|
|
4586
4586
|
setSections(result.sections);
|
|
4587
4587
|
markDirty();
|
|
@@ -4647,15 +4647,15 @@ function syncSelectionHandleOverlay(elementNode, elementId, geometry) {
|
|
|
4647
4647
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4648
4648
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx, lockAspect = false) {
|
|
4649
4649
|
const startBox = { x: startX, y: startY, width: startWidth, height: startHeight };
|
|
4650
|
-
let resized =
|
|
4650
|
+
let resized = chunkL2MOKP3E_js.applyResize(startBox, handle, dx, dy, 1, { minSize: chunkW5W75MFP_js.MIN_ELEMENT_SIZE });
|
|
4651
4651
|
if (lockAspect) {
|
|
4652
|
-
resized =
|
|
4652
|
+
resized = chunkL2MOKP3E_js.lockResizeAspect(resized, startBox, handle, chunkW5W75MFP_js.MIN_ELEMENT_SIZE);
|
|
4653
4653
|
}
|
|
4654
4654
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4655
4655
|
if (!snapToGrid) {
|
|
4656
4656
|
return box;
|
|
4657
4657
|
}
|
|
4658
|
-
return
|
|
4658
|
+
return chunkL2MOKP3E_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkW5W75MFP_js.MIN_ELEMENT_SIZE);
|
|
4659
4659
|
}
|
|
4660
4660
|
function resolveLiveTarget(input) {
|
|
4661
4661
|
const { livePatcher, editTemplateMode, activeSlide } = input;
|
|
@@ -4768,7 +4768,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4768
4768
|
width: el.width,
|
|
4769
4769
|
height: el.height
|
|
4770
4770
|
}));
|
|
4771
|
-
const snapResult =
|
|
4771
|
+
const snapResult = chunkL2MOKP3E_js.computeSnapToShape(
|
|
4772
4772
|
targetX,
|
|
4773
4773
|
targetY,
|
|
4774
4774
|
primaryEl.width,
|
|
@@ -4810,7 +4810,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4810
4810
|
if (live) {
|
|
4811
4811
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4812
4812
|
const start = drag.startPositionsById[id];
|
|
4813
|
-
|
|
4813
|
+
chunkL2MOKP3E_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4814
4814
|
x: start.x + appliedDx,
|
|
4815
4815
|
y: start.y + appliedDy
|
|
4816
4816
|
});
|
|
@@ -4842,8 +4842,8 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4842
4842
|
rs.lastY = geo.y;
|
|
4843
4843
|
rs.lastWidth = geo.width;
|
|
4844
4844
|
rs.lastHeight = geo.height;
|
|
4845
|
-
const width = Math.max(geo.width,
|
|
4846
|
-
const height = Math.max(geo.height,
|
|
4845
|
+
const width = Math.max(geo.width, chunkW5W75MFP_js.MIN_ELEMENT_SIZE);
|
|
4846
|
+
const height = Math.max(geo.height, chunkW5W75MFP_js.MIN_ELEMENT_SIZE);
|
|
4847
4847
|
if (rs.domEl) {
|
|
4848
4848
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4849
4849
|
rs.domEl.style.top = `${geo.y}px`;
|
|
@@ -4852,7 +4852,7 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4852
4852
|
syncSelectionHandleOverlay(rs.domEl, rs.elementId, { x: geo.x, y: geo.y, width, height });
|
|
4853
4853
|
}
|
|
4854
4854
|
if (live) {
|
|
4855
|
-
|
|
4855
|
+
chunkL2MOKP3E_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4856
4856
|
x: geo.x,
|
|
4857
4857
|
y: geo.y,
|
|
4858
4858
|
width,
|
|
@@ -4863,7 +4863,7 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4863
4863
|
function processAdjustmentMove(e, adj, editorScale, updateElementById) {
|
|
4864
4864
|
const dx = (e.clientX - adj.startClientX) / editorScale;
|
|
4865
4865
|
const dy = (e.clientY - adj.startClientY) / editorScale;
|
|
4866
|
-
const adjustments =
|
|
4866
|
+
const adjustments = chunkL2MOKP3E_js.getDraggedShapeAdjustments(adj, dx, dy);
|
|
4867
4867
|
if (!adj.moved && Math.hypot(dx, dy) > 2) {
|
|
4868
4868
|
adj.moved = true;
|
|
4869
4869
|
}
|
|
@@ -4938,13 +4938,13 @@ function processPointerUp(input) {
|
|
|
4938
4938
|
if (i !== activeSlideIndex) {
|
|
4939
4939
|
return s;
|
|
4940
4940
|
}
|
|
4941
|
-
const rerouted =
|
|
4941
|
+
const rerouted = chunkL2MOKP3E_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4942
4942
|
if (rerouted.length === 0) {
|
|
4943
4943
|
return s;
|
|
4944
4944
|
}
|
|
4945
4945
|
return {
|
|
4946
4946
|
...s,
|
|
4947
|
-
elements:
|
|
4947
|
+
elements: chunkL2MOKP3E_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4948
4948
|
};
|
|
4949
4949
|
})
|
|
4950
4950
|
);
|
|
@@ -4969,9 +4969,9 @@ function processPointerUp(input) {
|
|
|
4969
4969
|
}
|
|
4970
4970
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4971
4971
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4972
|
-
const hitIds =
|
|
4972
|
+
const hitIds = chunkL2MOKP3E_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4973
4973
|
if (marquee.additive) {
|
|
4974
|
-
const merged =
|
|
4974
|
+
const merged = chunkL2MOKP3E_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4975
4975
|
if (merged.length > 0) {
|
|
4976
4976
|
applySelection(merged[0], merged);
|
|
4977
4977
|
} else {
|
|
@@ -4994,8 +4994,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4994
4994
|
}
|
|
4995
4995
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4996
4996
|
});
|
|
4997
|
-
const rerouted =
|
|
4998
|
-
return
|
|
4997
|
+
const rerouted = chunkL2MOKP3E_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4998
|
+
return chunkL2MOKP3E_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4999
4999
|
};
|
|
5000
5000
|
if (editTemplateMode) {
|
|
5001
5001
|
const slideId = activeSlide?.id;
|
|
@@ -5151,17 +5151,17 @@ function useCanvasInteractions(input) {
|
|
|
5151
5151
|
return;
|
|
5152
5152
|
}
|
|
5153
5153
|
const el = elementLookup.get(editId);
|
|
5154
|
-
if (el &&
|
|
5154
|
+
if (el && chunkL2MOKP3E_js.hasTextProperties(el)) {
|
|
5155
5155
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
5156
|
-
const textPatch =
|
|
5156
|
+
const textPatch = chunkL2MOKP3E_js.buildInlineTextCommitPatch(el, committedText);
|
|
5157
5157
|
if (!textPatch) {
|
|
5158
5158
|
setInlineEditingElementId(null);
|
|
5159
5159
|
setInlineEditingText("");
|
|
5160
5160
|
return;
|
|
5161
5161
|
}
|
|
5162
5162
|
const editorEl = document.querySelector("[data-inline-editor]");
|
|
5163
|
-
const newHeight =
|
|
5164
|
-
const shrink =
|
|
5163
|
+
const newHeight = chunkL2MOKP3E_js.resolveInlineEditAutoFitHeight(el.textStyle, el.height, editorEl);
|
|
5164
|
+
const shrink = chunkL2MOKP3E_js.resolveInlineEditNormAutofitShrink(el.textStyle, el.height, editorEl);
|
|
5165
5165
|
ops.updateElementById(editId, {
|
|
5166
5166
|
...textPatch,
|
|
5167
5167
|
...newHeight !== void 0 ? { height: newHeight } : {},
|
|
@@ -5179,7 +5179,7 @@ function useCanvasInteractions(input) {
|
|
|
5179
5179
|
setInlineEditingText("");
|
|
5180
5180
|
};
|
|
5181
5181
|
const openEquationEditorForElement = (el) => {
|
|
5182
|
-
if (!
|
|
5182
|
+
if (!chunkL2MOKP3E_js.hasTextProperties(el)) {
|
|
5183
5183
|
return false;
|
|
5184
5184
|
}
|
|
5185
5185
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -5209,7 +5209,7 @@ function useCanvasInteractions(input) {
|
|
|
5209
5209
|
justInteractedRef.current = false;
|
|
5210
5210
|
} else {
|
|
5211
5211
|
const el = elementLookup.get(elementId);
|
|
5212
|
-
if (el &&
|
|
5212
|
+
if (el && chunkL2MOKP3E_js.hasTextProperties(el) && chunkL2MOKP3E_js.canInteractWithElement(el, "textEdit")) {
|
|
5213
5213
|
if (!openEquationEditorForElement(el)) {
|
|
5214
5214
|
setInlineEditingElementId(elementId);
|
|
5215
5215
|
setInlineEditingText(el.text ?? "");
|
|
@@ -5228,7 +5228,7 @@ function useCanvasInteractions(input) {
|
|
|
5228
5228
|
if (openEquationEditorForElement(el)) {
|
|
5229
5229
|
return;
|
|
5230
5230
|
}
|
|
5231
|
-
if (
|
|
5231
|
+
if (chunkL2MOKP3E_js.hasTextProperties(el) && chunkL2MOKP3E_js.canInteractWithElement(el, "textEdit")) {
|
|
5232
5232
|
setInlineEditingElementId(elementId);
|
|
5233
5233
|
setInlineEditingText(el.text ?? "");
|
|
5234
5234
|
}
|
|
@@ -5251,7 +5251,7 @@ function useCanvasInteractions(input) {
|
|
|
5251
5251
|
justSelectedRef.current = false;
|
|
5252
5252
|
}
|
|
5253
5253
|
const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
|
|
5254
|
-
const movableIds =
|
|
5254
|
+
const movableIds = chunkL2MOKP3E_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
|
|
5255
5255
|
if (movableIds.length === 0) {
|
|
5256
5256
|
return;
|
|
5257
5257
|
}
|
|
@@ -5321,7 +5321,7 @@ function useCanvasInteractions(input) {
|
|
|
5321
5321
|
const handleResizePointerDown = (elementId, e, handle) => {
|
|
5322
5322
|
e.stopPropagation();
|
|
5323
5323
|
const el = elementLookup.get(elementId);
|
|
5324
|
-
if (!el || !
|
|
5324
|
+
if (!el || !chunkL2MOKP3E_js.canInteractWithElement(el, "resize")) {
|
|
5325
5325
|
return;
|
|
5326
5326
|
}
|
|
5327
5327
|
resizeStateRef.current = {
|
|
@@ -5343,7 +5343,7 @@ function useCanvasInteractions(input) {
|
|
|
5343
5343
|
};
|
|
5344
5344
|
const handleRotate = (elementId, rotationDeg) => {
|
|
5345
5345
|
const el = elementLookup.get(elementId);
|
|
5346
|
-
if (!el || !
|
|
5346
|
+
if (!el || !chunkL2MOKP3E_js.canInteractWithElement(el, "rotate")) {
|
|
5347
5347
|
return;
|
|
5348
5348
|
}
|
|
5349
5349
|
ops.updateElementById(elementId, { rotation: rotationDeg });
|
|
@@ -5363,10 +5363,10 @@ function useCanvasInteractions(input) {
|
|
|
5363
5363
|
const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
|
|
5364
5364
|
e.stopPropagation();
|
|
5365
5365
|
const el = elementLookup.get(elementId);
|
|
5366
|
-
if (!el || !
|
|
5366
|
+
if (!el || !chunkL2MOKP3E_js.canInteractWithElement(el, "adjustHandle")) {
|
|
5367
5367
|
return;
|
|
5368
5368
|
}
|
|
5369
|
-
shapeAdjustmentDragStateRef.current =
|
|
5369
|
+
shapeAdjustmentDragStateRef.current = chunkL2MOKP3E_js.beginShapeAdjustment(
|
|
5370
5370
|
el,
|
|
5371
5371
|
descriptor,
|
|
5372
5372
|
e.clientX,
|
|
@@ -5413,7 +5413,7 @@ function createFileHandlers(deps) {
|
|
|
5413
5413
|
h = Math.round(h * scale);
|
|
5414
5414
|
}
|
|
5415
5415
|
addElement({
|
|
5416
|
-
id:
|
|
5416
|
+
id: chunkL2MOKP3E_js.generateElementId(),
|
|
5417
5417
|
type: "image",
|
|
5418
5418
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5419
5419
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5424,7 +5424,7 @@ function createFileHandlers(deps) {
|
|
|
5424
5424
|
};
|
|
5425
5425
|
img.onerror = () => {
|
|
5426
5426
|
addElement({
|
|
5427
|
-
id:
|
|
5427
|
+
id: chunkL2MOKP3E_js.generateElementId(),
|
|
5428
5428
|
type: "image",
|
|
5429
5429
|
x: 100,
|
|
5430
5430
|
y: 100,
|
|
@@ -5443,14 +5443,14 @@ function createFileHandlers(deps) {
|
|
|
5443
5443
|
return;
|
|
5444
5444
|
}
|
|
5445
5445
|
e.target.value = "";
|
|
5446
|
-
const mediaType =
|
|
5446
|
+
const mediaType = chunkL2MOKP3E_js.classifyMediaType(file.type);
|
|
5447
5447
|
if (!mediaType) {
|
|
5448
5448
|
return;
|
|
5449
5449
|
}
|
|
5450
5450
|
const elFilePath = file.path;
|
|
5451
5451
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5452
5452
|
addElement({
|
|
5453
|
-
id:
|
|
5453
|
+
id: chunkL2MOKP3E_js.generateElementId(),
|
|
5454
5454
|
type: "media",
|
|
5455
5455
|
mediaType,
|
|
5456
5456
|
mediaMimeType: file.type || void 0,
|
|
@@ -5625,13 +5625,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5625
5625
|
return;
|
|
5626
5626
|
}
|
|
5627
5627
|
addElement({
|
|
5628
|
-
id:
|
|
5628
|
+
id: chunkL2MOKP3E_js.generateElementId(),
|
|
5629
5629
|
type: "smartArt",
|
|
5630
5630
|
x: 100,
|
|
5631
5631
|
y: 120,
|
|
5632
5632
|
width: 600,
|
|
5633
5633
|
height: 340,
|
|
5634
|
-
smartArtData:
|
|
5634
|
+
smartArtData: chunkL2MOKP3E_js.buildSmartArtPresetData(
|
|
5635
5635
|
layout,
|
|
5636
5636
|
defaultItems,
|
|
5637
5637
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5643,7 +5643,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5643
5643
|
return;
|
|
5644
5644
|
}
|
|
5645
5645
|
addElement({
|
|
5646
|
-
id:
|
|
5646
|
+
id: chunkL2MOKP3E_js.generateElementId(),
|
|
5647
5647
|
type: "shape",
|
|
5648
5648
|
x: 120,
|
|
5649
5649
|
y: 200,
|
|
@@ -5681,7 +5681,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5681
5681
|
return;
|
|
5682
5682
|
}
|
|
5683
5683
|
const resolved = resolveHyperlinkEditResult(data);
|
|
5684
|
-
if (resolved.url && !
|
|
5684
|
+
if (resolved.url && !chunkL2MOKP3E_js.isUrlSafe(resolved.url)) {
|
|
5685
5685
|
return;
|
|
5686
5686
|
}
|
|
5687
5687
|
const actionClick = {
|
|
@@ -5705,7 +5705,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5705
5705
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5706
5706
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5707
5707
|
addElement({
|
|
5708
|
-
id:
|
|
5708
|
+
id: chunkL2MOKP3E_js.generateElementId(),
|
|
5709
5709
|
type: "shape",
|
|
5710
5710
|
x: 120,
|
|
5711
5711
|
y: 200,
|
|
@@ -5727,11 +5727,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5727
5727
|
if (!activeSlide) {
|
|
5728
5728
|
return;
|
|
5729
5729
|
}
|
|
5730
|
-
const preset =
|
|
5730
|
+
const preset = chunkL2MOKP3E_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5731
5731
|
if (!preset) {
|
|
5732
5732
|
return;
|
|
5733
5733
|
}
|
|
5734
|
-
const defaultPptxAction =
|
|
5734
|
+
const defaultPptxAction = chunkL2MOKP3E_js.elementActionToPptxAction({
|
|
5735
5735
|
trigger: "click",
|
|
5736
5736
|
type: preset.defaultAction
|
|
5737
5737
|
});
|
|
@@ -5740,7 +5740,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5740
5740
|
defaultPptxAction.highlightClick = true;
|
|
5741
5741
|
}
|
|
5742
5742
|
addElement({
|
|
5743
|
-
id:
|
|
5743
|
+
id: chunkL2MOKP3E_js.generateElementId(),
|
|
5744
5744
|
type: "shape",
|
|
5745
5745
|
x: 150,
|
|
5746
5746
|
y: 150,
|
|
@@ -5807,14 +5807,14 @@ function useInsertElements(input) {
|
|
|
5807
5807
|
return;
|
|
5808
5808
|
}
|
|
5809
5809
|
addElement({
|
|
5810
|
-
id:
|
|
5810
|
+
id: chunkL2MOKP3E_js.generateElementId(),
|
|
5811
5811
|
type: "text",
|
|
5812
5812
|
x: 100,
|
|
5813
5813
|
y: 100,
|
|
5814
5814
|
width: 300,
|
|
5815
5815
|
height: 60,
|
|
5816
5816
|
text: "",
|
|
5817
|
-
textStyle: { fontSize:
|
|
5817
|
+
textStyle: { fontSize: chunkW5W75MFP_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5818
5818
|
});
|
|
5819
5819
|
};
|
|
5820
5820
|
const handleAddShape = () => {
|
|
@@ -5822,7 +5822,7 @@ function useInsertElements(input) {
|
|
|
5822
5822
|
return;
|
|
5823
5823
|
}
|
|
5824
5824
|
addElement({
|
|
5825
|
-
id:
|
|
5825
|
+
id: chunkL2MOKP3E_js.generateElementId(),
|
|
5826
5826
|
type: "shape",
|
|
5827
5827
|
x: 150,
|
|
5828
5828
|
y: 150,
|
|
@@ -5841,15 +5841,15 @@ function useInsertElements(input) {
|
|
|
5841
5841
|
return;
|
|
5842
5842
|
}
|
|
5843
5843
|
addElement({
|
|
5844
|
-
...
|
|
5845
|
-
id:
|
|
5844
|
+
...chunkL2MOKP3E_js.newTableElement(chunkW5W75MFP_js.DEFAULT_TABLE_ROWS, chunkW5W75MFP_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5845
|
+
id: chunkL2MOKP3E_js.generateElementId()
|
|
5846
5846
|
});
|
|
5847
5847
|
};
|
|
5848
5848
|
const handleAddChart = (chartKind) => {
|
|
5849
5849
|
if (!activeSlide) {
|
|
5850
5850
|
return;
|
|
5851
5851
|
}
|
|
5852
|
-
addElement(
|
|
5852
|
+
addElement(chunkL2MOKP3E_js.createDefaultChartElement(chartKind));
|
|
5853
5853
|
};
|
|
5854
5854
|
const structured = createStructuredElementHandlers({
|
|
5855
5855
|
activeSlide,
|
|
@@ -5919,7 +5919,7 @@ function useClipboardHandlers(input) {
|
|
|
5919
5919
|
if (!selectedElement) {
|
|
5920
5920
|
return;
|
|
5921
5921
|
}
|
|
5922
|
-
setClipboardPayload(
|
|
5922
|
+
setClipboardPayload(chunkL2MOKP3E_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5923
5923
|
};
|
|
5924
5924
|
const handleDelete = () => {
|
|
5925
5925
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5936,7 +5936,7 @@ function useClipboardHandlers(input) {
|
|
|
5936
5936
|
handleDelete();
|
|
5937
5937
|
};
|
|
5938
5938
|
const insertClone = (source) => {
|
|
5939
|
-
const clone =
|
|
5939
|
+
const clone = chunkL2MOKP3E_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5940
5940
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5941
5941
|
ops.applySelection(clone.id);
|
|
5942
5942
|
history.markDirty();
|
|
@@ -5971,7 +5971,7 @@ function resolveShapePath(el) {
|
|
|
5971
5971
|
return el.pathData;
|
|
5972
5972
|
}
|
|
5973
5973
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5974
|
-
const clipPath =
|
|
5974
|
+
const clipPath = chunkL2MOKP3E_js.getPresetShapeClipPath(el.shapeType);
|
|
5975
5975
|
if (clipPath) {
|
|
5976
5976
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5977
5977
|
if (svgPath) {
|
|
@@ -6022,7 +6022,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
6022
6022
|
return parts.join(" ");
|
|
6023
6023
|
}
|
|
6024
6024
|
function transformPathToGlobal(pathData, el) {
|
|
6025
|
-
const polys =
|
|
6025
|
+
const polys = chunkL2MOKP3E_js.svgPathToPolygons(pathData);
|
|
6026
6026
|
if (polys.length === 0) {
|
|
6027
6027
|
return pathData;
|
|
6028
6028
|
}
|
|
@@ -6042,10 +6042,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
6042
6042
|
y: pt.y * scaleY + el.y
|
|
6043
6043
|
}))
|
|
6044
6044
|
);
|
|
6045
|
-
return
|
|
6045
|
+
return chunkL2MOKP3E_js.polygonsToSvgPath(transformed);
|
|
6046
6046
|
}
|
|
6047
6047
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
6048
|
-
const polys =
|
|
6048
|
+
const polys = chunkL2MOKP3E_js.svgPathToPolygons(pathData);
|
|
6049
6049
|
if (polys.length === 0) {
|
|
6050
6050
|
return pathData;
|
|
6051
6051
|
}
|
|
@@ -6055,10 +6055,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
6055
6055
|
y: pt.y - y
|
|
6056
6056
|
}))
|
|
6057
6057
|
);
|
|
6058
|
-
return
|
|
6058
|
+
return chunkL2MOKP3E_js.polygonsToSvgPath(transformed);
|
|
6059
6059
|
}
|
|
6060
6060
|
function pathBounds(pathData) {
|
|
6061
|
-
const polys =
|
|
6061
|
+
const polys = chunkL2MOKP3E_js.svgPathToPolygons(pathData);
|
|
6062
6062
|
let minX = Infinity;
|
|
6063
6063
|
let minY = Infinity;
|
|
6064
6064
|
let maxX = -Infinity;
|
|
@@ -6117,7 +6117,7 @@ function useMergeShapesHandler(input) {
|
|
|
6117
6117
|
let allFragments = [];
|
|
6118
6118
|
let remaining = globalPaths[0];
|
|
6119
6119
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
6120
|
-
const frags =
|
|
6120
|
+
const frags = chunkL2MOKP3E_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
6121
6121
|
if (Array.isArray(frags)) {
|
|
6122
6122
|
allFragments = frags;
|
|
6123
6123
|
}
|
|
@@ -6146,7 +6146,7 @@ function useMergeShapesHandler(input) {
|
|
|
6146
6146
|
bounds.height
|
|
6147
6147
|
);
|
|
6148
6148
|
const newEl = {
|
|
6149
|
-
id:
|
|
6149
|
+
id: chunkL2MOKP3E_js.generateElementId(),
|
|
6150
6150
|
type: "shape",
|
|
6151
6151
|
x: bounds.x,
|
|
6152
6152
|
y: bounds.y,
|
|
@@ -6184,7 +6184,7 @@ function useMergeShapesHandler(input) {
|
|
|
6184
6184
|
} else {
|
|
6185
6185
|
let resultPath = globalPaths[0];
|
|
6186
6186
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
6187
|
-
const result =
|
|
6187
|
+
const result = chunkL2MOKP3E_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
6188
6188
|
if (typeof result === "string") {
|
|
6189
6189
|
resultPath = result;
|
|
6190
6190
|
}
|
|
@@ -6205,7 +6205,7 @@ function useMergeShapesHandler(input) {
|
|
|
6205
6205
|
);
|
|
6206
6206
|
const primary = targets[0];
|
|
6207
6207
|
const newEl = {
|
|
6208
|
-
id:
|
|
6208
|
+
id: chunkL2MOKP3E_js.generateElementId(),
|
|
6209
6209
|
type: "shape",
|
|
6210
6210
|
x: bounds.x,
|
|
6211
6211
|
y: bounds.y,
|
|
@@ -6268,10 +6268,10 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6268
6268
|
if (ids.length < 2 || !activeSlide) {
|
|
6269
6269
|
return;
|
|
6270
6270
|
}
|
|
6271
|
-
if (!selectedElements.every((el) =>
|
|
6271
|
+
if (!selectedElements.every((el) => chunkL2MOKP3E_js.canInteractWithElement(el, "group"))) {
|
|
6272
6272
|
return;
|
|
6273
6273
|
}
|
|
6274
|
-
const { elements, groupId } =
|
|
6274
|
+
const { elements, groupId } = chunkL2MOKP3E_js.groupElements(ops.activeElements, ids, chunkL2MOKP3E_js.generateElementId());
|
|
6275
6275
|
if (groupId === null) {
|
|
6276
6276
|
return;
|
|
6277
6277
|
}
|
|
@@ -6283,15 +6283,15 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6283
6283
|
if (!selectedElement || selectedElement.type !== "group" || !activeSlide) {
|
|
6284
6284
|
return;
|
|
6285
6285
|
}
|
|
6286
|
-
if (!
|
|
6286
|
+
if (!chunkL2MOKP3E_js.canInteractWithElement(selectedElement, "group")) {
|
|
6287
6287
|
return;
|
|
6288
6288
|
}
|
|
6289
6289
|
const group = selectedElement;
|
|
6290
|
-
const intoTemplate =
|
|
6290
|
+
const intoTemplate = chunkL2MOKP3E_js.isTemplateElementId(group.id);
|
|
6291
6291
|
const childIds = group.children.map(
|
|
6292
|
-
(child) => intoTemplate ?
|
|
6292
|
+
(child) => intoTemplate ? chunkL2MOKP3E_js.makeCloneId(true, child.id || group.id) : child.id || chunkL2MOKP3E_js.generateElementId()
|
|
6293
6293
|
);
|
|
6294
|
-
const { elements, childIds: usedIds } =
|
|
6294
|
+
const { elements, childIds: usedIds } = chunkL2MOKP3E_js.ungroupElements(
|
|
6295
6295
|
ops.activeElements,
|
|
6296
6296
|
group.id,
|
|
6297
6297
|
childIds,
|
|
@@ -6320,7 +6320,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6320
6320
|
if (!edge) {
|
|
6321
6321
|
return;
|
|
6322
6322
|
}
|
|
6323
|
-
const positions =
|
|
6323
|
+
const positions = chunkL2MOKP3E_js.alignElements(selectedElements, edge);
|
|
6324
6324
|
for (const [id, pos] of positions) {
|
|
6325
6325
|
const el = elementLookup.get(id);
|
|
6326
6326
|
if (!el) {
|
|
@@ -6338,7 +6338,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6338
6338
|
if (!distAxis) {
|
|
6339
6339
|
return;
|
|
6340
6340
|
}
|
|
6341
|
-
const positions =
|
|
6341
|
+
const positions = chunkL2MOKP3E_js.distributeElements(selectedElements, distAxis);
|
|
6342
6342
|
for (const [id, pos] of positions) {
|
|
6343
6343
|
const el = elementLookup.get(id);
|
|
6344
6344
|
if (!el) {
|
|
@@ -6349,14 +6349,14 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6349
6349
|
history.markDirty();
|
|
6350
6350
|
};
|
|
6351
6351
|
const canDistribute = selectedElements.length >= 3;
|
|
6352
|
-
const selectionGroupable = selectedElements.every((el) =>
|
|
6352
|
+
const selectionGroupable = selectedElements.every((el) => chunkL2MOKP3E_js.canInteractWithElement(el, "group"));
|
|
6353
6353
|
const handleMoveLayer = (direction) => {
|
|
6354
6354
|
if (!selectedElement || !activeSlide) {
|
|
6355
6355
|
return;
|
|
6356
6356
|
}
|
|
6357
6357
|
const id = selectedElement.id;
|
|
6358
6358
|
ops.updateActiveElements(
|
|
6359
|
-
(els) => direction === "forward" ?
|
|
6359
|
+
(els) => direction === "forward" ? chunkL2MOKP3E_js.bringForward(els, id) : direction === "backward" ? chunkL2MOKP3E_js.sendBackward(els, id) : els
|
|
6360
6360
|
);
|
|
6361
6361
|
history.markDirty();
|
|
6362
6362
|
};
|
|
@@ -6366,7 +6366,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6366
6366
|
}
|
|
6367
6367
|
const id = selectedElement.id;
|
|
6368
6368
|
ops.updateActiveElements(
|
|
6369
|
-
(els) => direction === "front" ?
|
|
6369
|
+
(els) => direction === "front" ? chunkL2MOKP3E_js.bringToFront(els, id) : chunkL2MOKP3E_js.sendToBack(els, id)
|
|
6370
6370
|
);
|
|
6371
6371
|
history.markDirty();
|
|
6372
6372
|
};
|
|
@@ -6499,16 +6499,18 @@ function useSlideManagement(input) {
|
|
|
6499
6499
|
canvasSize,
|
|
6500
6500
|
theme
|
|
6501
6501
|
} = input;
|
|
6502
|
-
const
|
|
6503
|
-
const
|
|
6502
|
+
const handleAddSlideAfter = (afterIndex) => {
|
|
6503
|
+
const insertAt = Math.max(0, Math.min(afterIndex + 1, slides.length));
|
|
6504
|
+
const newSlide = chunkL2MOKP3E_js.createBlankSlide(slides.length + 1);
|
|
6504
6505
|
ops.updateSlides((prev) => {
|
|
6505
6506
|
const next = [...prev];
|
|
6506
|
-
next.splice(
|
|
6507
|
+
next.splice(insertAt, 0, newSlide);
|
|
6507
6508
|
return next;
|
|
6508
6509
|
});
|
|
6509
|
-
setActiveSlideIndex(
|
|
6510
|
+
setActiveSlideIndex(insertAt);
|
|
6510
6511
|
history.markDirty();
|
|
6511
6512
|
};
|
|
6513
|
+
const handleAddSlide = () => handleAddSlideAfter(activeSlideIndex);
|
|
6512
6514
|
const handleMoveSlide = (fromIndex, toIndex) => {
|
|
6513
6515
|
if (fromIndex === toIndex) {
|
|
6514
6516
|
return;
|
|
@@ -6563,7 +6565,7 @@ function useSlideManagement(input) {
|
|
|
6563
6565
|
}
|
|
6564
6566
|
const clone = {
|
|
6565
6567
|
...src,
|
|
6566
|
-
id:
|
|
6568
|
+
id: chunkL2MOKP3E_js.makeSlideId(),
|
|
6567
6569
|
elements: src.elements.map((el) => ({
|
|
6568
6570
|
...el,
|
|
6569
6571
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6595,7 +6597,7 @@ function useSlideManagement(input) {
|
|
|
6595
6597
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6596
6598
|
const insertAt = activeSlideIndex + 1;
|
|
6597
6599
|
const draft = {
|
|
6598
|
-
...
|
|
6600
|
+
...chunkL2MOKP3E_js.createBlankSlide(slides.length + 1),
|
|
6599
6601
|
layoutPath,
|
|
6600
6602
|
...layoutName ? { layoutName } : {}
|
|
6601
6603
|
};
|
|
@@ -6628,9 +6630,9 @@ function useSlideManagement(input) {
|
|
|
6628
6630
|
};
|
|
6629
6631
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6630
6632
|
const insertAt = activeSlideIndex + 1;
|
|
6631
|
-
const draft =
|
|
6633
|
+
const draft = chunkL2MOKP3E_js.buildSlideTemplateSlide(templateId, chunkL2MOKP3E_js.makeSlideId(), slides.length + 1, {
|
|
6632
6634
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6633
|
-
scheme:
|
|
6635
|
+
scheme: chunkL2MOKP3E_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6634
6636
|
});
|
|
6635
6637
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6636
6638
|
setActiveSlideIndex(insertAt);
|
|
@@ -6638,6 +6640,7 @@ function useSlideManagement(input) {
|
|
|
6638
6640
|
};
|
|
6639
6641
|
return {
|
|
6640
6642
|
handleAddSlide,
|
|
6643
|
+
handleAddSlideAfter,
|
|
6641
6644
|
handleMoveSlide,
|
|
6642
6645
|
handleSlideContextMenu,
|
|
6643
6646
|
handleDeleteSlides,
|
|
@@ -6667,7 +6670,7 @@ function createTableMergeHandlers(input) {
|
|
|
6667
6670
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6668
6671
|
return;
|
|
6669
6672
|
}
|
|
6670
|
-
const newTableData =
|
|
6673
|
+
const newTableData = chunkL2MOKP3E_js.mergeCells(
|
|
6671
6674
|
[
|
|
6672
6675
|
{ row: rowIndex, col: columnIndex },
|
|
6673
6676
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6675,7 +6678,7 @@ function createTableMergeHandlers(input) {
|
|
|
6675
6678
|
td
|
|
6676
6679
|
);
|
|
6677
6680
|
const updates = { tableData: newTableData };
|
|
6678
|
-
const newRawXml =
|
|
6681
|
+
const newRawXml = chunkL2MOKP3E_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6679
6682
|
if (newRawXml) {
|
|
6680
6683
|
updates.rawXml = newRawXml;
|
|
6681
6684
|
}
|
|
@@ -6701,7 +6704,7 @@ function createTableMergeHandlers(input) {
|
|
|
6701
6704
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6702
6705
|
return;
|
|
6703
6706
|
}
|
|
6704
|
-
const newTableData =
|
|
6707
|
+
const newTableData = chunkL2MOKP3E_js.mergeCells(
|
|
6705
6708
|
[
|
|
6706
6709
|
{ row: rowIndex, col: columnIndex },
|
|
6707
6710
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6709,7 +6712,7 @@ function createTableMergeHandlers(input) {
|
|
|
6709
6712
|
td
|
|
6710
6713
|
);
|
|
6711
6714
|
const updates = { tableData: newTableData };
|
|
6712
|
-
const newRawXml =
|
|
6715
|
+
const newRawXml = chunkL2MOKP3E_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6713
6716
|
if (newRawXml) {
|
|
6714
6717
|
updates.rawXml = newRawXml;
|
|
6715
6718
|
}
|
|
@@ -6724,9 +6727,9 @@ function createTableMergeHandlers(input) {
|
|
|
6724
6727
|
return;
|
|
6725
6728
|
}
|
|
6726
6729
|
const td = selectedElement.tableData;
|
|
6727
|
-
const newTableData =
|
|
6730
|
+
const newTableData = chunkL2MOKP3E_js.mergeCells(ts.selectedCells, td);
|
|
6728
6731
|
const updates = { tableData: newTableData };
|
|
6729
|
-
const newRawXml =
|
|
6732
|
+
const newRawXml = chunkL2MOKP3E_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6730
6733
|
if (newRawXml) {
|
|
6731
6734
|
updates.rawXml = newRawXml;
|
|
6732
6735
|
}
|
|
@@ -6743,9 +6746,9 @@ function createTableMergeHandlers(input) {
|
|
|
6743
6746
|
}
|
|
6744
6747
|
const { rowIndex, columnIndex } = ts;
|
|
6745
6748
|
const td = selectedElement.tableData;
|
|
6746
|
-
const newTableData =
|
|
6749
|
+
const newTableData = chunkL2MOKP3E_js.splitCell(rowIndex, columnIndex, td);
|
|
6747
6750
|
const updates = { tableData: newTableData };
|
|
6748
|
-
const newRawXml =
|
|
6751
|
+
const newRawXml = chunkL2MOKP3E_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6749
6752
|
if (newRawXml) {
|
|
6750
6753
|
updates.rawXml = newRawXml;
|
|
6751
6754
|
}
|
|
@@ -6779,10 +6782,10 @@ function createTableStructHandlers(input) {
|
|
|
6779
6782
|
const text = transformCommittedText ? transformCommittedText(rawText) : rawText;
|
|
6780
6783
|
const updates = {};
|
|
6781
6784
|
if (el.tableData) {
|
|
6782
|
-
updates.tableData =
|
|
6785
|
+
updates.tableData = chunkL2MOKP3E_js.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
6783
6786
|
}
|
|
6784
6787
|
if (el.rawXml) {
|
|
6785
|
-
const newRawXml =
|
|
6788
|
+
const newRawXml = chunkL2MOKP3E_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6786
6789
|
if (newRawXml) {
|
|
6787
6790
|
updates.rawXml = newRawXml;
|
|
6788
6791
|
}
|
|
@@ -6806,7 +6809,7 @@ function createTableStructHandlers(input) {
|
|
|
6806
6809
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6807
6810
|
const updates = {};
|
|
6808
6811
|
if (selectedElement.rawXml) {
|
|
6809
|
-
const newRawXml =
|
|
6812
|
+
const newRawXml = chunkL2MOKP3E_js.updateCellTextStyleInRawXml(
|
|
6810
6813
|
selectedElement,
|
|
6811
6814
|
rowIndex,
|
|
6812
6815
|
colIndex,
|
|
@@ -6870,31 +6873,20 @@ function createTableStructHandlers(input) {
|
|
|
6870
6873
|
return;
|
|
6871
6874
|
}
|
|
6872
6875
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6873
|
-
const
|
|
6874
|
-
|
|
6875
|
-
const newRawXml = chunkMH4VFSDL_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6876
|
-
if (newRawXml) {
|
|
6877
|
-
updates.rawXml = newRawXml;
|
|
6878
|
-
}
|
|
6879
|
-
ops.updateSelectedElement(updates);
|
|
6876
|
+
const next = chunkL2MOKP3E_js.insertTableElementRow(selectedElement, rowIdx, position);
|
|
6877
|
+
ops.updateSelectedElement({ tableData: next.tableData, rawXml: next.rawXml });
|
|
6880
6878
|
history.markDirty();
|
|
6881
6879
|
};
|
|
6882
6880
|
const handleDeleteTableRow = () => {
|
|
6883
6881
|
if (!selectedElement || selectedElement.type !== "table" || !selectedElement.tableData) {
|
|
6884
6882
|
return;
|
|
6885
6883
|
}
|
|
6886
|
-
const td = selectedElement.tableData;
|
|
6887
6884
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6888
|
-
const
|
|
6889
|
-
if (
|
|
6885
|
+
const next = chunkL2MOKP3E_js.removeTableElementRow(selectedElement, rowIdx);
|
|
6886
|
+
if (next === selectedElement) {
|
|
6890
6887
|
return;
|
|
6891
6888
|
}
|
|
6892
|
-
|
|
6893
|
-
const newRawXml = chunkMH4VFSDL_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6894
|
-
if (newRawXml) {
|
|
6895
|
-
updates.rawXml = newRawXml;
|
|
6896
|
-
}
|
|
6897
|
-
ops.updateSelectedElement(updates);
|
|
6889
|
+
ops.updateSelectedElement({ tableData: next.tableData, rawXml: next.rawXml });
|
|
6898
6890
|
history.markDirty();
|
|
6899
6891
|
};
|
|
6900
6892
|
const handleInsertTableColumn = (position) => {
|
|
@@ -6902,31 +6894,20 @@ function createTableStructHandlers(input) {
|
|
|
6902
6894
|
return;
|
|
6903
6895
|
}
|
|
6904
6896
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6905
|
-
const
|
|
6906
|
-
|
|
6907
|
-
const newRawXml = chunkMH4VFSDL_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6908
|
-
if (newRawXml) {
|
|
6909
|
-
updates.rawXml = newRawXml;
|
|
6910
|
-
}
|
|
6911
|
-
ops.updateSelectedElement(updates);
|
|
6897
|
+
const next = chunkL2MOKP3E_js.insertTableElementColumn(selectedElement, colIdx, position);
|
|
6898
|
+
ops.updateSelectedElement({ tableData: next.tableData, rawXml: next.rawXml });
|
|
6912
6899
|
history.markDirty();
|
|
6913
6900
|
};
|
|
6914
6901
|
const handleDeleteTableColumn = () => {
|
|
6915
6902
|
if (!selectedElement || selectedElement.type !== "table" || !selectedElement.tableData) {
|
|
6916
6903
|
return;
|
|
6917
6904
|
}
|
|
6918
|
-
const td = selectedElement.tableData;
|
|
6919
6905
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6920
|
-
const
|
|
6921
|
-
if (
|
|
6906
|
+
const next = chunkL2MOKP3E_js.removeTableElementColumn(selectedElement, colIdx);
|
|
6907
|
+
if (next === selectedElement) {
|
|
6922
6908
|
return;
|
|
6923
6909
|
}
|
|
6924
|
-
|
|
6925
|
-
const newRawXml = chunkMH4VFSDL_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6926
|
-
if (newRawXml) {
|
|
6927
|
-
updates.rawXml = newRawXml;
|
|
6928
|
-
}
|
|
6929
|
-
ops.updateSelectedElement(updates);
|
|
6910
|
+
ops.updateSelectedElement({ tableData: next.tableData, rawXml: next.rawXml });
|
|
6930
6911
|
history.markDirty();
|
|
6931
6912
|
};
|
|
6932
6913
|
return {
|
|
@@ -6958,8 +6939,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6958
6939
|
return html2canvasPro(element, {
|
|
6959
6940
|
...options,
|
|
6960
6941
|
onclone: async (doc, clonedEl) => {
|
|
6961
|
-
await
|
|
6962
|
-
|
|
6942
|
+
await chunkL2MOKP3E_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6943
|
+
chunkL2MOKP3E_js.preprocessCssForCapture(clonedEl);
|
|
6963
6944
|
if (typeof userOnClone === "function") {
|
|
6964
6945
|
userOnClone(doc, clonedEl);
|
|
6965
6946
|
}
|
|
@@ -6989,7 +6970,7 @@ function useExportSaveAs(input) {
|
|
|
6989
6970
|
slideSizeEmu
|
|
6990
6971
|
} = input;
|
|
6991
6972
|
const handleSaveAsFormat = async (format) => {
|
|
6992
|
-
const downloadName =
|
|
6973
|
+
const downloadName = chunkL2MOKP3E_js.savedPresentationFileName(filePath, format);
|
|
6993
6974
|
try {
|
|
6994
6975
|
const data = await serializeSlides(format);
|
|
6995
6976
|
if (!data) {
|
|
@@ -6997,16 +6978,16 @@ function useExportSaveAs(input) {
|
|
|
6997
6978
|
}
|
|
6998
6979
|
const mimeType = format === "ppt" ? "application/vnd.ms-powerpoint" : "application/vnd.openxmlformats-officedocument.presentationml.presentation";
|
|
6999
6980
|
const blob = new Blob([data], { type: mimeType });
|
|
7000
|
-
|
|
6981
|
+
chunkL2MOKP3E_js.downloadBlob(blob, downloadName);
|
|
7001
6982
|
} catch (err) {
|
|
7002
6983
|
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
7003
6984
|
}
|
|
7004
6985
|
};
|
|
7005
6986
|
const handleExportJson = () => {
|
|
7006
6987
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7007
|
-
const slideSize =
|
|
6988
|
+
const slideSize = chunkL2MOKP3E_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
7008
6989
|
const data = {
|
|
7009
|
-
slides:
|
|
6990
|
+
slides: chunkL2MOKP3E_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7010
6991
|
width: canvasSize.width,
|
|
7011
6992
|
height: canvasSize.height,
|
|
7012
6993
|
widthEmu: slideSize.widthEmu,
|
|
@@ -7025,7 +7006,7 @@ function useExportSaveAs(input) {
|
|
|
7025
7006
|
handoutMaster
|
|
7026
7007
|
};
|
|
7027
7008
|
try {
|
|
7028
|
-
|
|
7009
|
+
chunkL2MOKP3E_js.exportDeckJson(data, sourceName);
|
|
7029
7010
|
} catch (err) {
|
|
7030
7011
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7031
7012
|
}
|
|
@@ -7090,7 +7071,7 @@ function buildRasterOptions(element, scale, backgroundColor, mode) {
|
|
|
7090
7071
|
}
|
|
7091
7072
|
async function renderElementToRaster(element, scale = 2, backgroundColor, mode = "auto") {
|
|
7092
7073
|
const { width, height } = measureNaturalSize(element);
|
|
7093
|
-
return
|
|
7074
|
+
return chunkL2MOKP3E_js.rasterizeElement(
|
|
7094
7075
|
element,
|
|
7095
7076
|
width,
|
|
7096
7077
|
height,
|
|
@@ -7100,7 +7081,7 @@ async function renderElementToRaster(element, scale = 2, backgroundColor, mode =
|
|
|
7100
7081
|
}
|
|
7101
7082
|
async function renderElementToTiles(element, scale = 2, backgroundColor, mode = "auto") {
|
|
7102
7083
|
const { width, height } = measureNaturalSize(element);
|
|
7103
|
-
return
|
|
7084
|
+
return chunkL2MOKP3E_js.rasterizeElementTiles(
|
|
7104
7085
|
element,
|
|
7105
7086
|
width,
|
|
7106
7087
|
height,
|
|
@@ -7110,7 +7091,7 @@ async function renderElementToTiles(element, scale = 2, backgroundColor, mode =
|
|
|
7110
7091
|
}
|
|
7111
7092
|
async function renderElementToTiledCanvas(element, scale = 2, backgroundColor, mode = "auto") {
|
|
7112
7093
|
const { width, height } = measureNaturalSize(element);
|
|
7113
|
-
return
|
|
7094
|
+
return chunkL2MOKP3E_js.rasterizeElementTiledToCanvas(
|
|
7114
7095
|
element,
|
|
7115
7096
|
width,
|
|
7116
7097
|
height,
|
|
@@ -7132,11 +7113,11 @@ function waitForRender(ms = 100) {
|
|
|
7132
7113
|
async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
7133
7114
|
const { scale = 2, backgroundColor } = options;
|
|
7134
7115
|
const result = await renderElementToRaster(slideElement, scale, backgroundColor);
|
|
7135
|
-
return
|
|
7116
|
+
return chunkL2MOKP3E_js.rasterResultToPngBlob(result);
|
|
7136
7117
|
}
|
|
7137
7118
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
7138
7119
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
7139
|
-
|
|
7120
|
+
chunkL2MOKP3E_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
7140
7121
|
}
|
|
7141
7122
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
7142
7123
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -7165,13 +7146,13 @@ async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActi
|
|
|
7165
7146
|
// src/viewer/utils/export-pdf.ts
|
|
7166
7147
|
function tilesToPdfPage(tilesResult) {
|
|
7167
7148
|
return tilesResult.tiles.map((tile) => ({
|
|
7168
|
-
image:
|
|
7169
|
-
placement:
|
|
7149
|
+
image: chunkL2MOKP3E_js.canvasToJpegData(tile.canvas),
|
|
7150
|
+
placement: chunkL2MOKP3E_js.placeTileOnPage(
|
|
7170
7151
|
tile,
|
|
7171
7152
|
tilesResult.fullWidth,
|
|
7172
7153
|
tilesResult.fullHeight,
|
|
7173
|
-
|
|
7174
|
-
|
|
7154
|
+
chunkL2MOKP3E_js.PDF_SLIDES_PAGE_WIDTH_PT,
|
|
7155
|
+
chunkL2MOKP3E_js.PDF_SLIDES_PAGE_HEIGHT_PT
|
|
7175
7156
|
)
|
|
7176
7157
|
}));
|
|
7177
7158
|
}
|
|
@@ -7198,8 +7179,8 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7198
7179
|
if (pages.length === 0) {
|
|
7199
7180
|
throw new Error(chunk3AJ54EAB_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
7200
7181
|
}
|
|
7201
|
-
const pdfBlobUrl =
|
|
7202
|
-
|
|
7182
|
+
const pdfBlobUrl = chunkW5W75MFP_js.buildPdfFromTiledImageData(pages);
|
|
7183
|
+
chunkL2MOKP3E_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
7203
7184
|
}
|
|
7204
7185
|
async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, slideNotes, filename = "presentation-notes.pdf", options = {}) {
|
|
7205
7186
|
const { scale = 2, onProgress, signal } = options;
|
|
@@ -7228,8 +7209,8 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
7228
7209
|
if (pages.length === 0) {
|
|
7229
7210
|
throw new Error(chunk3AJ54EAB_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
7230
7211
|
}
|
|
7231
|
-
const pdfDataUrl =
|
|
7232
|
-
|
|
7212
|
+
const pdfDataUrl = chunkW5W75MFP_js.buildNotesPdf(pages);
|
|
7213
|
+
chunkL2MOKP3E_js.downloadDataUrl(pdfDataUrl, filename);
|
|
7233
7214
|
}
|
|
7234
7215
|
|
|
7235
7216
|
// src/viewer/utils/export-video.ts
|
|
@@ -7273,7 +7254,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7273
7254
|
const fps = 30;
|
|
7274
7255
|
const stream = recordingCanvas.captureStream(fps);
|
|
7275
7256
|
const recorder = new MediaRecorder(stream, {
|
|
7276
|
-
mimeType:
|
|
7257
|
+
mimeType: chunkL2MOKP3E_js.pickSupportedMimeType([...chunkL2MOKP3E_js.WEBM_MIME_CANDIDATES]),
|
|
7277
7258
|
videoBitsPerSecond: 5e6
|
|
7278
7259
|
});
|
|
7279
7260
|
const chunks = [];
|
|
@@ -7296,8 +7277,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7296
7277
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
7297
7278
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
7298
7279
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
7299
|
-
const frameInterval =
|
|
7300
|
-
const framesNeeded =
|
|
7280
|
+
const frameInterval = chunkL2MOKP3E_js.fpsToFrameIntervalMs(fps);
|
|
7281
|
+
const framesNeeded = chunkL2MOKP3E_js.segmentFrameCount(duration, fps);
|
|
7301
7282
|
for (let f = 0; f < framesNeeded; f++) {
|
|
7302
7283
|
if (signal?.aborted) {
|
|
7303
7284
|
recorder.stop();
|
|
@@ -7317,7 +7298,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7317
7298
|
|
|
7318
7299
|
// src/viewer/utils/export-gif.ts
|
|
7319
7300
|
function frameFromCanvas(canvas, maxSide) {
|
|
7320
|
-
const { width, height } =
|
|
7301
|
+
const { width, height } = chunkL2MOKP3E_js.clampGifDimensions(canvas.width, canvas.height, maxSide);
|
|
7321
7302
|
let source = canvas;
|
|
7322
7303
|
if (width !== canvas.width || height !== canvas.height) {
|
|
7323
7304
|
const scaled = canvas.ownerDocument.createElement("canvas");
|
|
@@ -7340,7 +7321,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7340
7321
|
const {
|
|
7341
7322
|
scale = 0.5,
|
|
7342
7323
|
slideDurationMs = 2e3,
|
|
7343
|
-
maxSide =
|
|
7324
|
+
maxSide = chunkL2MOKP3E_js.GIF_POST_CAPTURE_MAX_SIDE,
|
|
7344
7325
|
onProgress,
|
|
7345
7326
|
signal
|
|
7346
7327
|
} = options;
|
|
@@ -7367,7 +7348,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7367
7348
|
if (frames.length === 0) {
|
|
7368
7349
|
throw new Error(chunk3AJ54EAB_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
7369
7350
|
}
|
|
7370
|
-
const gifBytes =
|
|
7351
|
+
const gifBytes = chunkL2MOKP3E_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
7371
7352
|
onProgress?.(totalSlides, totalSlides);
|
|
7372
7353
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
7373
7354
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -7421,7 +7402,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
7421
7402
|
continue;
|
|
7422
7403
|
}
|
|
7423
7404
|
onProgress?.(processedCount, data.slides.length);
|
|
7424
|
-
let svg =
|
|
7405
|
+
let svg = chunkL2MOKP3E_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
7425
7406
|
if (embedFonts && fontFaces?.length) {
|
|
7426
7407
|
svg = injectFontFaces(svg, fontFaces);
|
|
7427
7408
|
}
|
|
@@ -7473,7 +7454,7 @@ function useExportMediaHandlers(input) {
|
|
|
7473
7454
|
setExportProgress(0);
|
|
7474
7455
|
setExportModalOpen(true);
|
|
7475
7456
|
try {
|
|
7476
|
-
const { scale } =
|
|
7457
|
+
const { scale } = chunkL2MOKP3E_js.resolveExportCaptureDecision(imageResolutionScale, "video");
|
|
7477
7458
|
const blob = await exportAllSlidesAsVideo(
|
|
7478
7459
|
canvasStageRef,
|
|
7479
7460
|
slides.length,
|
|
@@ -7483,22 +7464,22 @@ function useExportMediaHandlers(input) {
|
|
|
7483
7464
|
scale,
|
|
7484
7465
|
slideDurationMs: 3e3,
|
|
7485
7466
|
onProgress: (current, total) => {
|
|
7486
|
-
setExportProgress(
|
|
7487
|
-
setExportStatusMessage(
|
|
7467
|
+
setExportProgress(chunkL2MOKP3E_js.slideProgressPercent(current, total, 45));
|
|
7468
|
+
setExportStatusMessage(chunkL2MOKP3E_js.slideStatusLabel("Capturing", current, total));
|
|
7488
7469
|
},
|
|
7489
7470
|
onRecordProgress: (current, total) => {
|
|
7490
|
-
setExportProgress(
|
|
7491
|
-
setExportStatusMessage(
|
|
7471
|
+
setExportProgress(chunkL2MOKP3E_js.recordProgressPercent(current, total));
|
|
7472
|
+
setExportStatusMessage(chunkL2MOKP3E_js.slideStatusLabel("Recording", current, total));
|
|
7492
7473
|
},
|
|
7493
7474
|
signal: abortCtrl.signal
|
|
7494
7475
|
}
|
|
7495
7476
|
);
|
|
7496
|
-
setExportProgress(
|
|
7477
|
+
setExportProgress(chunkL2MOKP3E_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7497
7478
|
setExportStatusMessage("Saving file...");
|
|
7498
|
-
|
|
7499
|
-
setExportProgress(
|
|
7479
|
+
chunkL2MOKP3E_js.downloadBlob(blob, "presentation.webm");
|
|
7480
|
+
setExportProgress(chunkL2MOKP3E_js.EXPORT_DONE_PERCENT);
|
|
7500
7481
|
} catch (err) {
|
|
7501
|
-
if (!
|
|
7482
|
+
if (!chunkL2MOKP3E_js.isExportAbortError(err)) {
|
|
7502
7483
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7503
7484
|
}
|
|
7504
7485
|
} finally {
|
|
@@ -7528,7 +7509,7 @@ function useExportMediaHandlers(input) {
|
|
|
7528
7509
|
setExportProgress(0);
|
|
7529
7510
|
setExportModalOpen(true);
|
|
7530
7511
|
try {
|
|
7531
|
-
const { scale, postCaptureMaxSide } =
|
|
7512
|
+
const { scale, postCaptureMaxSide } = chunkL2MOKP3E_js.resolveExportCaptureDecision(
|
|
7532
7513
|
imageResolutionScale,
|
|
7533
7514
|
"gif"
|
|
7534
7515
|
);
|
|
@@ -7542,18 +7523,18 @@ function useExportMediaHandlers(input) {
|
|
|
7542
7523
|
maxSide: postCaptureMaxSide,
|
|
7543
7524
|
slideDurationMs: 2e3,
|
|
7544
7525
|
onProgress: (current, total) => {
|
|
7545
|
-
setExportProgress(
|
|
7546
|
-
setExportStatusMessage(
|
|
7526
|
+
setExportProgress(chunkL2MOKP3E_js.slideProgressPercent(current, total));
|
|
7527
|
+
setExportStatusMessage(chunkL2MOKP3E_js.slideStatusLabel("Encoding", current, total));
|
|
7547
7528
|
},
|
|
7548
7529
|
signal: abortCtrl.signal
|
|
7549
7530
|
}
|
|
7550
7531
|
);
|
|
7551
|
-
setExportProgress(
|
|
7532
|
+
setExportProgress(chunkL2MOKP3E_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7552
7533
|
setExportStatusMessage("Saving file...");
|
|
7553
|
-
|
|
7554
|
-
setExportProgress(
|
|
7534
|
+
chunkL2MOKP3E_js.downloadBlob(blob, "presentation.gif");
|
|
7535
|
+
setExportProgress(chunkL2MOKP3E_js.EXPORT_DONE_PERCENT);
|
|
7555
7536
|
} catch (err) {
|
|
7556
|
-
if (!
|
|
7537
|
+
if (!chunkL2MOKP3E_js.isExportAbortError(err)) {
|
|
7557
7538
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7558
7539
|
}
|
|
7559
7540
|
} finally {
|
|
@@ -7679,21 +7660,21 @@ function useExportHandlers(input) {
|
|
|
7679
7660
|
{
|
|
7680
7661
|
scale: imageExportScale,
|
|
7681
7662
|
onProgress: (current, total) => {
|
|
7682
|
-
setExportProgress(
|
|
7683
|
-
setExportStatusMessage(
|
|
7663
|
+
setExportProgress(chunkL2MOKP3E_js.slideProgressPercent(current, total));
|
|
7664
|
+
setExportStatusMessage(chunkL2MOKP3E_js.slideStatusLabel("Rendering", current, total));
|
|
7684
7665
|
},
|
|
7685
7666
|
signal: abortCtrl.signal
|
|
7686
7667
|
}
|
|
7687
7668
|
);
|
|
7688
|
-
setExportProgress(
|
|
7669
|
+
setExportProgress(chunkL2MOKP3E_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7689
7670
|
setExportStatusMessage("Building PDF...");
|
|
7690
7671
|
await new Promise((r) => {
|
|
7691
7672
|
setTimeout(r, 100);
|
|
7692
7673
|
});
|
|
7693
|
-
setExportProgress(
|
|
7674
|
+
setExportProgress(chunkL2MOKP3E_js.EXPORT_DONE_PERCENT);
|
|
7694
7675
|
setExportStatusMessage("Done!");
|
|
7695
7676
|
} catch (err) {
|
|
7696
|
-
if (!
|
|
7677
|
+
if (!chunkL2MOKP3E_js.isExportAbortError(err)) {
|
|
7697
7678
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7698
7679
|
}
|
|
7699
7680
|
} finally {
|
|
@@ -7723,21 +7704,21 @@ function useExportHandlers(input) {
|
|
|
7723
7704
|
{
|
|
7724
7705
|
scale: imageExportScale,
|
|
7725
7706
|
onProgress: (current, total) => {
|
|
7726
|
-
setExportProgress(
|
|
7727
|
-
setExportStatusMessage(
|
|
7707
|
+
setExportProgress(chunkL2MOKP3E_js.slideProgressPercent(current, total));
|
|
7708
|
+
setExportStatusMessage(chunkL2MOKP3E_js.slideStatusLabel("Rendering", current, total));
|
|
7728
7709
|
},
|
|
7729
7710
|
signal: abortCtrl.signal
|
|
7730
7711
|
}
|
|
7731
7712
|
);
|
|
7732
|
-
setExportProgress(
|
|
7713
|
+
setExportProgress(chunkL2MOKP3E_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7733
7714
|
setExportStatusMessage("Building PDF...");
|
|
7734
7715
|
await new Promise((r) => {
|
|
7735
7716
|
setTimeout(r, 100);
|
|
7736
7717
|
});
|
|
7737
|
-
setExportProgress(
|
|
7718
|
+
setExportProgress(chunkL2MOKP3E_js.EXPORT_DONE_PERCENT);
|
|
7738
7719
|
setExportStatusMessage("Done!");
|
|
7739
7720
|
} catch (err) {
|
|
7740
|
-
if (!
|
|
7721
|
+
if (!chunkL2MOKP3E_js.isExportAbortError(err)) {
|
|
7741
7722
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7742
7723
|
}
|
|
7743
7724
|
} finally {
|
|
@@ -7785,7 +7766,7 @@ function useExportHandlers(input) {
|
|
|
7785
7766
|
exportStatusMessage
|
|
7786
7767
|
};
|
|
7787
7768
|
}
|
|
7788
|
-
var ViewerOptionsContext = react.createContext(
|
|
7769
|
+
var ViewerOptionsContext = react.createContext(chunkL2MOKP3E_js.DEFAULT_VIEWER_OPTIONS);
|
|
7789
7770
|
function useViewerOptionsContext() {
|
|
7790
7771
|
return react.useContext(ViewerOptionsContext);
|
|
7791
7772
|
}
|
|
@@ -7797,13 +7778,13 @@ function usePrintHandlers(input) {
|
|
|
7797
7778
|
const { t } = reactI18next.useTranslation();
|
|
7798
7779
|
const viewerOptions = useViewerOptionsContext();
|
|
7799
7780
|
const includeHiddenSlides = viewerOptions.advanced.printHiddenSlides;
|
|
7800
|
-
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) *
|
|
7781
|
+
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) * chunkL2MOKP3E_js.resolveImageResolutionScale(viewerOptions);
|
|
7801
7782
|
const handlePrint = () => {
|
|
7802
7783
|
setIsPrintDialogOpen(true);
|
|
7803
7784
|
};
|
|
7804
7785
|
const handlePrintSvg = async (settings) => {
|
|
7805
7786
|
setIsPrintDialogOpen(false);
|
|
7806
|
-
const printWindow =
|
|
7787
|
+
const printWindow = chunkL2MOKP3E_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7807
7788
|
if (!printWindow) {
|
|
7808
7789
|
console.warn(
|
|
7809
7790
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7813,9 +7794,9 @@ function usePrintHandlers(input) {
|
|
|
7813
7794
|
if (!pptxData || settings.printWhat !== "slides") {
|
|
7814
7795
|
return runRasterPrint(printWindow, settings);
|
|
7815
7796
|
}
|
|
7816
|
-
const colorFilter =
|
|
7817
|
-
const slideIndices =
|
|
7818
|
-
|
|
7797
|
+
const colorFilter = chunkL2MOKP3E_js.computeColorFilter(settings.colorMode);
|
|
7798
|
+
const slideIndices = chunkL2MOKP3E_js.filterHiddenSlideIndices(
|
|
7799
|
+
chunkL2MOKP3E_js.computeSlideIndices(
|
|
7819
7800
|
settings.slideRange,
|
|
7820
7801
|
activeSlideIndex,
|
|
7821
7802
|
slides.length,
|
|
@@ -7833,22 +7814,22 @@ function usePrintHandlers(input) {
|
|
|
7833
7814
|
printWindow.close();
|
|
7834
7815
|
return;
|
|
7835
7816
|
}
|
|
7836
|
-
const printDoc =
|
|
7817
|
+
const printDoc = chunkL2MOKP3E_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7837
7818
|
title: "Slides (Vector)",
|
|
7838
7819
|
orientation: settings.orientation,
|
|
7839
7820
|
colorFilter,
|
|
7840
7821
|
scaleToFit: settings.scaleToFit
|
|
7841
7822
|
});
|
|
7842
|
-
|
|
7823
|
+
chunkL2MOKP3E_js.finishPrintWindow(printWindow, printDoc);
|
|
7843
7824
|
} catch (err) {
|
|
7844
7825
|
console.warn("[PowerPointViewer] SVG print path failed, falling back to raster:", err);
|
|
7845
7826
|
return runRasterPrint(printWindow, settings);
|
|
7846
7827
|
}
|
|
7847
7828
|
};
|
|
7848
7829
|
const runRasterPrint = async (printWindow, settings) => {
|
|
7849
|
-
const colorFilter =
|
|
7850
|
-
const slideIndices =
|
|
7851
|
-
|
|
7830
|
+
const colorFilter = chunkL2MOKP3E_js.computeColorFilter(settings.colorMode);
|
|
7831
|
+
const slideIndices = chunkL2MOKP3E_js.filterHiddenSlideIndices(
|
|
7832
|
+
chunkL2MOKP3E_js.computeSlideIndices(
|
|
7852
7833
|
settings.slideRange,
|
|
7853
7834
|
activeSlideIndex,
|
|
7854
7835
|
slides.length,
|
|
@@ -7859,11 +7840,11 @@ function usePrintHandlers(input) {
|
|
|
7859
7840
|
includeHiddenSlides
|
|
7860
7841
|
);
|
|
7861
7842
|
if (settings.printWhat === "outline") {
|
|
7862
|
-
|
|
7843
|
+
chunkL2MOKP3E_js.finishPrintWindow(
|
|
7863
7844
|
printWindow,
|
|
7864
|
-
|
|
7845
|
+
chunkL2MOKP3E_js.buildPrintHtmlDocument({
|
|
7865
7846
|
title: "Outline",
|
|
7866
|
-
bodyHtml: `<div class="outline-page">${
|
|
7847
|
+
bodyHtml: `<div class="outline-page">${chunkL2MOKP3E_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7867
7848
|
orientation: settings.orientation,
|
|
7868
7849
|
colorFilter,
|
|
7869
7850
|
frameSlides: settings.frameSlides,
|
|
@@ -7890,11 +7871,11 @@ function usePrintHandlers(input) {
|
|
|
7890
7871
|
}
|
|
7891
7872
|
const slideImages = slideIndices.map((idx) => allImages[idx]).filter(Boolean);
|
|
7892
7873
|
if (settings.printWhat === "slides") {
|
|
7893
|
-
|
|
7874
|
+
chunkL2MOKP3E_js.finishPrintWindow(
|
|
7894
7875
|
printWindow,
|
|
7895
|
-
|
|
7876
|
+
chunkL2MOKP3E_js.buildPrintHtmlDocument({
|
|
7896
7877
|
title: "Slides",
|
|
7897
|
-
bodyHtml:
|
|
7878
|
+
bodyHtml: chunkL2MOKP3E_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7898
7879
|
orientation: settings.orientation,
|
|
7899
7880
|
colorFilter,
|
|
7900
7881
|
frameSlides: settings.frameSlides,
|
|
@@ -7904,11 +7885,11 @@ function usePrintHandlers(input) {
|
|
|
7904
7885
|
return;
|
|
7905
7886
|
}
|
|
7906
7887
|
if (settings.printWhat === "notes") {
|
|
7907
|
-
|
|
7888
|
+
chunkL2MOKP3E_js.finishPrintWindow(
|
|
7908
7889
|
printWindow,
|
|
7909
|
-
|
|
7890
|
+
chunkL2MOKP3E_js.buildPrintHtmlDocument({
|
|
7910
7891
|
title: "Notes Pages",
|
|
7911
|
-
bodyHtml:
|
|
7892
|
+
bodyHtml: chunkL2MOKP3E_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7912
7893
|
orientation: "portrait",
|
|
7913
7894
|
colorFilter,
|
|
7914
7895
|
frameSlides: settings.frameSlides,
|
|
@@ -7919,11 +7900,11 @@ function usePrintHandlers(input) {
|
|
|
7919
7900
|
}
|
|
7920
7901
|
if (settings.printWhat === "handouts") {
|
|
7921
7902
|
const spp = settings.slidesPerPage;
|
|
7922
|
-
|
|
7903
|
+
chunkL2MOKP3E_js.finishPrintWindow(
|
|
7923
7904
|
printWindow,
|
|
7924
|
-
|
|
7905
|
+
chunkL2MOKP3E_js.buildPrintHtmlDocument({
|
|
7925
7906
|
title: `Handout ${spp} per page`,
|
|
7926
|
-
bodyHtml:
|
|
7907
|
+
bodyHtml: chunkL2MOKP3E_js.buildHandoutsHtml(slideImages, slideIndices, spp, pptxData?.handoutMaster),
|
|
7927
7908
|
orientation: "portrait",
|
|
7928
7909
|
colorFilter,
|
|
7929
7910
|
frameSlides: settings.frameSlides,
|
|
@@ -7937,7 +7918,7 @@ function usePrintHandlers(input) {
|
|
|
7937
7918
|
};
|
|
7938
7919
|
const handlePrintWithSettings = async (settings) => {
|
|
7939
7920
|
setIsPrintDialogOpen(false);
|
|
7940
|
-
const printWindow =
|
|
7921
|
+
const printWindow = chunkL2MOKP3E_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7941
7922
|
if (!printWindow) {
|
|
7942
7923
|
console.warn(
|
|
7943
7924
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -8002,13 +7983,13 @@ function useThemeHandlers(input) {
|
|
|
8002
7983
|
return;
|
|
8003
7984
|
}
|
|
8004
7985
|
await handler.updateThemeColorScheme(colorScheme);
|
|
8005
|
-
const previousMap = theme?.colorScheme ?
|
|
8006
|
-
setSlides((prev) =>
|
|
7986
|
+
const previousMap = theme?.colorScheme ? chunkL2MOKP3E_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7987
|
+
setSlides((prev) => chunkL2MOKP3E_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
8007
7988
|
if (Object.keys(templateElementsBySlideId).length > 0) {
|
|
8008
7989
|
setTemplateElementsBySlideId((prev) => {
|
|
8009
7990
|
const next = {};
|
|
8010
7991
|
for (const [slideId, elements] of Object.entries(prev)) {
|
|
8011
|
-
next[slideId] =
|
|
7992
|
+
next[slideId] = chunkL2MOKP3E_js.reResolveElementColors(elements, previousMap, colorScheme);
|
|
8012
7993
|
}
|
|
8013
7994
|
return next;
|
|
8014
7995
|
});
|
|
@@ -8117,7 +8098,7 @@ function useThemeSwitching(input) {
|
|
|
8117
8098
|
}
|
|
8118
8099
|
try {
|
|
8119
8100
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
8120
|
-
const newData =
|
|
8101
|
+
const newData = chunkL2MOKP3E_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
8121
8102
|
onDataChange(newData);
|
|
8122
8103
|
onThemeChanged?.(preset);
|
|
8123
8104
|
} catch (error) {
|
|
@@ -8134,7 +8115,7 @@ function useThemeSwitching(input) {
|
|
|
8134
8115
|
}
|
|
8135
8116
|
try {
|
|
8136
8117
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
8137
|
-
const newData =
|
|
8118
|
+
const newData = chunkL2MOKP3E_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
8138
8119
|
onDataChange(newData);
|
|
8139
8120
|
} catch (error) {
|
|
8140
8121
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -8146,12 +8127,12 @@ function useThemeSwitching(input) {
|
|
|
8146
8127
|
if (!data?.theme?.colorScheme) {
|
|
8147
8128
|
return void 0;
|
|
8148
8129
|
}
|
|
8149
|
-
return
|
|
8150
|
-
(p) =>
|
|
8130
|
+
return chunkL2MOKP3E_js.THEME_PRESETS.find(
|
|
8131
|
+
(p) => chunkL2MOKP3E_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
8151
8132
|
);
|
|
8152
8133
|
}, [data?.theme?.colorScheme]);
|
|
8153
8134
|
return {
|
|
8154
|
-
presets:
|
|
8135
|
+
presets: chunkL2MOKP3E_js.THEME_PRESETS,
|
|
8155
8136
|
switchToPreset,
|
|
8156
8137
|
switchToCustom,
|
|
8157
8138
|
currentPreset
|
|
@@ -8226,7 +8207,7 @@ function usePropertyHandlers(input) {
|
|
|
8226
8207
|
}
|
|
8227
8208
|
try {
|
|
8228
8209
|
const ab = await file.arrayBuffer();
|
|
8229
|
-
const h = new
|
|
8210
|
+
const h = new chunkL2MOKP3E_js.PptxHandler();
|
|
8230
8211
|
const other = await h.load(ab);
|
|
8231
8212
|
if (!other) {
|
|
8232
8213
|
return;
|
|
@@ -8236,7 +8217,7 @@ function usePropertyHandlers(input) {
|
|
|
8236
8217
|
width: canvasSize.width,
|
|
8237
8218
|
height: canvasSize.height
|
|
8238
8219
|
};
|
|
8239
|
-
setCompareResult(
|
|
8220
|
+
setCompareResult(chunkL2MOKP3E_js.comparePresentation(cur, other));
|
|
8240
8221
|
setIsComparePanelOpen(true);
|
|
8241
8222
|
} catch (err) {
|
|
8242
8223
|
console.warn("Compare failed:", err);
|
|
@@ -8253,7 +8234,7 @@ function usePropertyHandlers(input) {
|
|
|
8253
8234
|
if (!diff || diff.status === "unchanged") {
|
|
8254
8235
|
return;
|
|
8255
8236
|
}
|
|
8256
|
-
setSlides((prev) =>
|
|
8237
|
+
setSlides((prev) => chunkL2MOKP3E_js.applyAcceptSlide(prev, diff));
|
|
8257
8238
|
setIsDirty(true);
|
|
8258
8239
|
},
|
|
8259
8240
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -8264,10 +8245,10 @@ function usePropertyHandlers(input) {
|
|
|
8264
8245
|
if (!compareResult) {
|
|
8265
8246
|
return;
|
|
8266
8247
|
}
|
|
8267
|
-
setSlides((prev) =>
|
|
8248
|
+
setSlides((prev) => chunkL2MOKP3E_js.applyAcceptAllSlides(prev, compareResult));
|
|
8268
8249
|
setIsDirty(true);
|
|
8269
8250
|
}, [compareResult, setSlides, setIsDirty]);
|
|
8270
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
8251
|
+
const usedFontFamilies = react.useMemo(() => chunkL2MOKP3E_js.collectUsedFonts(slides), [slides]);
|
|
8271
8252
|
return {
|
|
8272
8253
|
handleUpdateNotes,
|
|
8273
8254
|
handleUpdateSlide,
|
|
@@ -8422,7 +8403,7 @@ function useViewerDialogs(input) {
|
|
|
8422
8403
|
);
|
|
8423
8404
|
const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
|
|
8424
8405
|
const fontEmbedding = react.useMemo(
|
|
8425
|
-
() =>
|
|
8406
|
+
() => chunkL2MOKP3E_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
|
|
8426
8407
|
[embeddedFontKey]
|
|
8427
8408
|
);
|
|
8428
8409
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
|
|
@@ -8432,11 +8413,11 @@ function useViewerDialogs(input) {
|
|
|
8432
8413
|
setEmbedFontsEnabled(fontEmbedding.initialEnabled);
|
|
8433
8414
|
}
|
|
8434
8415
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8435
|
-
() => typeof window !== "undefined" ?
|
|
8416
|
+
() => typeof window !== "undefined" ? chunkL2MOKP3E_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8436
8417
|
);
|
|
8437
8418
|
react.useEffect(() => {
|
|
8438
8419
|
const handleWindow = () => setIsNarrowViewport(
|
|
8439
|
-
|
|
8420
|
+
chunkL2MOKP3E_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8440
8421
|
);
|
|
8441
8422
|
window.addEventListener("resize", handleWindow);
|
|
8442
8423
|
return () => window.removeEventListener("resize", handleWindow);
|
|
@@ -8589,16 +8570,16 @@ function useViewerDialogs(input) {
|
|
|
8589
8570
|
};
|
|
8590
8571
|
}
|
|
8591
8572
|
function computeGridSpacingPx2(documentGridSpacing) {
|
|
8592
|
-
return
|
|
8573
|
+
return chunkL2MOKP3E_js.computeGridSpacingPx(documentGridSpacing, chunkW5W75MFP_js.GRID_SIZE);
|
|
8593
8574
|
}
|
|
8594
8575
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows, presentationProperties) {
|
|
8595
8576
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8596
|
-
const authoredRange =
|
|
8597
|
-
return
|
|
8577
|
+
const authoredRange = chunkL2MOKP3E_js.resolveAuthoredSlideRange(presentationProperties, slides.length);
|
|
8578
|
+
return chunkL2MOKP3E_js.resolveShowSlideIndexes(slides, activeShow, authoredRange);
|
|
8598
8579
|
}
|
|
8599
8580
|
function computeSlideSectionGroups(slides, sections) {
|
|
8600
|
-
return
|
|
8601
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8581
|
+
return chunkL2MOKP3E_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8582
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkW5W75MFP_js.UNGROUPED_SECTION_ID : chunkW5W75MFP_js.DEFAULT_SECTION_GROUP_ID),
|
|
8602
8583
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8603
8584
|
slideIndexes: group.slideIndexes,
|
|
8604
8585
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8610,7 +8591,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
|
8610
8591
|
return void 0;
|
|
8611
8592
|
}
|
|
8612
8593
|
const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
|
|
8613
|
-
return
|
|
8594
|
+
return chunkL2MOKP3E_js.masterViewPseudoSlide(document2, {
|
|
8614
8595
|
tab: "slides",
|
|
8615
8596
|
masterIndex: 0,
|
|
8616
8597
|
layoutIndex: activeLayout ? 0 : null
|
|
@@ -8638,15 +8619,15 @@ function useDerivedSlideState(input) {
|
|
|
8638
8619
|
[slides, activeCustomShowId, customShows, presentationProperties]
|
|
8639
8620
|
);
|
|
8640
8621
|
const authoredRange = react.useMemo(
|
|
8641
|
-
() =>
|
|
8622
|
+
() => chunkL2MOKP3E_js.resolveAuthoredSlideRange(presentationProperties, slides.length),
|
|
8642
8623
|
[presentationProperties, slides.length]
|
|
8643
8624
|
);
|
|
8644
8625
|
const slideSectionGroups = react.useMemo(
|
|
8645
8626
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8646
|
-
if (group.id ===
|
|
8627
|
+
if (group.id === chunkW5W75MFP_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8647
8628
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8648
8629
|
}
|
|
8649
|
-
if (group.id ===
|
|
8630
|
+
if (group.id === chunkW5W75MFP_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
8650
8631
|
return { ...group, label: t("pptx.sections.slides") };
|
|
8651
8632
|
}
|
|
8652
8633
|
return group;
|
|
@@ -8747,13 +8728,13 @@ function useAnnotationHandlers(input) {
|
|
|
8747
8728
|
}, [annotations, setMode, setSlides, history]);
|
|
8748
8729
|
const handleSetMode = react.useCallback(
|
|
8749
8730
|
(nextMode) => {
|
|
8750
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8731
|
+
if (mode === "present" && nextMode !== "present" && !chunkL2MOKP3E_js.mayLeaveSlideShow()) {
|
|
8751
8732
|
return;
|
|
8752
8733
|
}
|
|
8753
8734
|
if (nextMode === "present") {
|
|
8754
8735
|
presentation.enterPresentMode();
|
|
8755
8736
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8756
|
-
|
|
8737
|
+
chunkL2MOKP3E_js.stopAllPersistentAudio();
|
|
8757
8738
|
if (promptKeepInkAnnotations) {
|
|
8758
8739
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8759
8740
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8763,7 +8744,7 @@ function useAnnotationHandlers(input) {
|
|
|
8763
8744
|
}
|
|
8764
8745
|
} else {
|
|
8765
8746
|
if (mode === "present") {
|
|
8766
|
-
|
|
8747
|
+
chunkL2MOKP3E_js.stopAllPersistentAudio();
|
|
8767
8748
|
}
|
|
8768
8749
|
setMode(nextMode);
|
|
8769
8750
|
}
|
|
@@ -8832,13 +8813,13 @@ function useSerialize(input) {
|
|
|
8832
8813
|
let processedSlide = slide;
|
|
8833
8814
|
if (pendingEditId) {
|
|
8834
8815
|
const updatedElements = slide.elements.map((el) => {
|
|
8835
|
-
if (el.id !== pendingEditId || !
|
|
8816
|
+
if (el.id !== pendingEditId || !chunkL2MOKP3E_js.hasTextProperties(el)) {
|
|
8836
8817
|
return el;
|
|
8837
8818
|
}
|
|
8838
8819
|
return {
|
|
8839
8820
|
...el,
|
|
8840
8821
|
text: pendingEditText,
|
|
8841
|
-
textSegments:
|
|
8822
|
+
textSegments: chunkL2MOKP3E_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8842
8823
|
};
|
|
8843
8824
|
});
|
|
8844
8825
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8851,19 +8832,19 @@ function useSerialize(input) {
|
|
|
8851
8832
|
const pptxGuides = guides.map((g) => ({
|
|
8852
8833
|
id: g.id,
|
|
8853
8834
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8854
|
-
positionEmu:
|
|
8835
|
+
positionEmu: chunkL2MOKP3E_js.guidePxToEmu(g.position)
|
|
8855
8836
|
}));
|
|
8856
8837
|
return {
|
|
8857
8838
|
...processedSlide,
|
|
8858
8839
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8859
8840
|
};
|
|
8860
8841
|
});
|
|
8861
|
-
const slidesToSave =
|
|
8862
|
-
const saveOptions =
|
|
8842
|
+
const slidesToSave = chunkL2MOKP3E_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8843
|
+
const saveOptions = chunkL2MOKP3E_js.buildDeckSaveOptions({
|
|
8863
8844
|
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
8864
8845
|
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
8865
8846
|
// slide-size edit reaches the file.
|
|
8866
|
-
slideSize:
|
|
8847
|
+
slideSize: chunkL2MOKP3E_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
8867
8848
|
headerFooter,
|
|
8868
8849
|
presentationProperties,
|
|
8869
8850
|
viewProperties,
|
|
@@ -8882,7 +8863,7 @@ function useSerialize(input) {
|
|
|
8882
8863
|
embedFonts,
|
|
8883
8864
|
outputFormat: format
|
|
8884
8865
|
});
|
|
8885
|
-
return
|
|
8866
|
+
return chunkL2MOKP3E_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
|
|
8886
8867
|
},
|
|
8887
8868
|
[
|
|
8888
8869
|
slides,
|
|
@@ -8923,7 +8904,7 @@ function useRecoveryDetection(input) {
|
|
|
8923
8904
|
const onRestore = input.onRestore;
|
|
8924
8905
|
const openVersionHistory = input.openVersionHistory;
|
|
8925
8906
|
react.useEffect(() => {
|
|
8926
|
-
if (!
|
|
8907
|
+
if (!chunkL2MOKP3E_js.shouldProbeAutosaveRecovery({
|
|
8927
8908
|
alreadyChecked: recoveryCheckedRef.current,
|
|
8928
8909
|
filePath,
|
|
8929
8910
|
loading,
|
|
@@ -8935,7 +8916,7 @@ function useRecoveryDetection(input) {
|
|
|
8935
8916
|
}
|
|
8936
8917
|
recoveryCheckedRef.current = true;
|
|
8937
8918
|
void (async () => {
|
|
8938
|
-
const offer = await
|
|
8919
|
+
const offer = await chunkL2MOKP3E_js.probeAutosaveRecovery(filePath);
|
|
8939
8920
|
if (!offer) {
|
|
8940
8921
|
return;
|
|
8941
8922
|
}
|
|
@@ -8948,7 +8929,7 @@ function useRecoveryDetection(input) {
|
|
|
8948
8929
|
const record = recordRef.current;
|
|
8949
8930
|
setPrompt(null);
|
|
8950
8931
|
if (record && onRestore) {
|
|
8951
|
-
onRestore(
|
|
8932
|
+
onRestore(chunkL2MOKP3E_js.acceptAutosaveRecovery(record));
|
|
8952
8933
|
}
|
|
8953
8934
|
recordRef.current = null;
|
|
8954
8935
|
}, [onRestore]);
|
|
@@ -8957,7 +8938,7 @@ function useRecoveryDetection(input) {
|
|
|
8957
8938
|
setPrompt(null);
|
|
8958
8939
|
recordRef.current = null;
|
|
8959
8940
|
if (record) {
|
|
8960
|
-
void
|
|
8941
|
+
void chunkL2MOKP3E_js.discardAutosaveRecovery(record);
|
|
8961
8942
|
}
|
|
8962
8943
|
}, []);
|
|
8963
8944
|
return { prompt, restore, discard };
|
|
@@ -9008,11 +8989,11 @@ function usePresentationSetup(input) {
|
|
|
9008
8989
|
containerRef,
|
|
9009
8990
|
content,
|
|
9010
8991
|
onSetMode: (nextMode) => {
|
|
9011
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8992
|
+
if (mode === "present" && nextMode !== "present" && !chunkL2MOKP3E_js.mayLeaveSlideShow()) {
|
|
9012
8993
|
return;
|
|
9013
8994
|
}
|
|
9014
8995
|
if (mode === "present" && nextMode !== "present") {
|
|
9015
|
-
|
|
8996
|
+
chunkL2MOKP3E_js.stopAllPersistentAudio();
|
|
9016
8997
|
stopAnimationSound();
|
|
9017
8998
|
const exitHandler = exitModeHandlerRef.current;
|
|
9018
8999
|
if (exitHandler) {
|
|
@@ -9080,10 +9061,10 @@ function usePresentationSetup(input) {
|
|
|
9080
9061
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
9081
9062
|
onToggleSubtitles,
|
|
9082
9063
|
onSaveRehearsalTimings: (timings) => {
|
|
9083
|
-
setSlides((prev) =>
|
|
9064
|
+
setSlides((prev) => chunkL2MOKP3E_js.applyRehearsalTimings(prev, timings));
|
|
9084
9065
|
history.markDirty();
|
|
9085
9066
|
},
|
|
9086
|
-
loopContinuously:
|
|
9067
|
+
loopContinuously: chunkL2MOKP3E_js.shouldLoopContinuously(presentationProperties),
|
|
9087
9068
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
9088
9069
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
9089
9070
|
endWithBlackSlide,
|
|
@@ -9290,7 +9271,7 @@ function useEditorOperations(input) {
|
|
|
9290
9271
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
9291
9272
|
react.useEffect(() => {
|
|
9292
9273
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9293
|
-
copiedFormatRef.current =
|
|
9274
|
+
copiedFormatRef.current = chunkL2MOKP3E_js.copyFormatFromElement(selectedElement);
|
|
9294
9275
|
} else if (!formatPainterActive) {
|
|
9295
9276
|
copiedFormatRef.current = null;
|
|
9296
9277
|
}
|
|
@@ -9316,12 +9297,12 @@ function useEditorOperations(input) {
|
|
|
9316
9297
|
e.stopPropagation();
|
|
9317
9298
|
const element = elementLookup.get(elementId);
|
|
9318
9299
|
if (element) {
|
|
9319
|
-
const updated =
|
|
9300
|
+
const updated = chunkL2MOKP3E_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
9320
9301
|
const updates = {};
|
|
9321
|
-
if (
|
|
9302
|
+
if (chunkL2MOKP3E_js.hasShapeProperties(updated)) {
|
|
9322
9303
|
updates.shapeStyle = updated.shapeStyle;
|
|
9323
9304
|
}
|
|
9324
|
-
if (
|
|
9305
|
+
if (chunkL2MOKP3E_js.hasTextProperties(updated)) {
|
|
9325
9306
|
updates.textStyle = updated.textStyle;
|
|
9326
9307
|
}
|
|
9327
9308
|
ops.updateElementById(elementId, updates);
|
|
@@ -9507,10 +9488,10 @@ function useFontInjection({ embeddedFonts, slides }) {
|
|
|
9507
9488
|
}
|
|
9508
9489
|
};
|
|
9509
9490
|
}, [embeddedFonts]);
|
|
9510
|
-
const referencedFamilies = react.useMemo(() =>
|
|
9491
|
+
const referencedFamilies = react.useMemo(() => chunkL2MOKP3E_js.collectReferencedFontFamilies(slides), [slides]);
|
|
9511
9492
|
react.useEffect(() => {
|
|
9512
9493
|
let cancelled = false;
|
|
9513
|
-
void
|
|
9494
|
+
void chunkL2MOKP3E_js.resolveGoogleWebfontHref(slides, embeddedFonts).then((href) => {
|
|
9514
9495
|
if (cancelled) {
|
|
9515
9496
|
return null;
|
|
9516
9497
|
}
|
|
@@ -9535,15 +9516,15 @@ function useFontInjection({ embeddedFonts, slides }) {
|
|
|
9535
9516
|
const [, setOutlineFontsTick] = react.useState(0);
|
|
9536
9517
|
react.useEffect(() => {
|
|
9537
9518
|
let cancelled = false;
|
|
9538
|
-
const referenced =
|
|
9539
|
-
const candidates =
|
|
9519
|
+
const referenced = chunkL2MOKP3E_js.collectReferencedFontFamilies(slides);
|
|
9520
|
+
const candidates = chunkL2MOKP3E_js.selectGoogleWebfontFamilies(
|
|
9540
9521
|
referenced,
|
|
9541
9522
|
embeddedFonts.map((font) => font.name)
|
|
9542
9523
|
);
|
|
9543
9524
|
if (candidates.length === 0) {
|
|
9544
9525
|
return;
|
|
9545
9526
|
}
|
|
9546
|
-
void
|
|
9527
|
+
void chunkL2MOKP3E_js.resolveGoogleWebfontHref(slides, embeddedFonts).then(async (href) => {
|
|
9547
9528
|
if (cancelled || !href) {
|
|
9548
9529
|
return;
|
|
9549
9530
|
}
|
|
@@ -9557,7 +9538,7 @@ function useFontInjection({ embeddedFonts, slides }) {
|
|
|
9557
9538
|
if (cancelled) {
|
|
9558
9539
|
return;
|
|
9559
9540
|
}
|
|
9560
|
-
const bytes = await
|
|
9541
|
+
const bytes = await chunkL2MOKP3E_js.fetchGoogleWebfontOutlineBytes(
|
|
9561
9542
|
href,
|
|
9562
9543
|
family,
|
|
9563
9544
|
variant.bold,
|
|
@@ -9746,7 +9727,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9746
9727
|
inputRef.current = input;
|
|
9747
9728
|
const handleKeyDown = react.useCallback((e) => {
|
|
9748
9729
|
const current = inputRef.current;
|
|
9749
|
-
const startAction =
|
|
9730
|
+
const startAction = chunkL2MOKP3E_js.mapSlideShowStartKey(e, { isPresenting: current.mode === "present" });
|
|
9750
9731
|
if (startAction !== null) {
|
|
9751
9732
|
e.preventDefault();
|
|
9752
9733
|
if (startAction === "fromBeginning") {
|
|
@@ -9756,7 +9737,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9756
9737
|
}
|
|
9757
9738
|
return;
|
|
9758
9739
|
}
|
|
9759
|
-
const { action, dx, dy } =
|
|
9740
|
+
const { action, dx, dy } = chunkL2MOKP3E_js.mapEditorKey(e, {
|
|
9760
9741
|
canEdit: current.canEdit,
|
|
9761
9742
|
// The Slide Master view is an editing surface, not a viewing one.
|
|
9762
9743
|
// Gating on `mode !== 'edit'` alone made `mapEditorKey` return
|
|
@@ -9769,7 +9750,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9769
9750
|
hasSelection: current.hasSelection,
|
|
9770
9751
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9771
9752
|
isDrawing: current.activeTool !== "select",
|
|
9772
|
-
isTextInputTarget:
|
|
9753
|
+
isTextInputTarget: chunkL2MOKP3E_js.isEditorTextInputTarget(e.target)
|
|
9773
9754
|
});
|
|
9774
9755
|
if (action === null) {
|
|
9775
9756
|
return;
|
|
@@ -10101,7 +10082,7 @@ function useViewerIntegration(input) {
|
|
|
10101
10082
|
return zoom.scale;
|
|
10102
10083
|
},
|
|
10103
10084
|
setZoom(level) {
|
|
10104
|
-
zoom.setScale(
|
|
10085
|
+
zoom.setScale(chunkL2MOKP3E_js.clampZoomScale(level));
|
|
10105
10086
|
},
|
|
10106
10087
|
zoomIn() {
|
|
10107
10088
|
zoom.handleZoomIn();
|
|
@@ -10155,8 +10136,12 @@ function useViewerIntegration(input) {
|
|
|
10155
10136
|
return slides[activeSlideIndex];
|
|
10156
10137
|
},
|
|
10157
10138
|
// -- Slide manipulation --
|
|
10158
|
-
addSlide(
|
|
10159
|
-
|
|
10139
|
+
addSlide(afterIndex) {
|
|
10140
|
+
if (afterIndex === void 0) {
|
|
10141
|
+
editorOps.slideOps.handleAddSlide();
|
|
10142
|
+
} else {
|
|
10143
|
+
editorOps.slideOps.handleAddSlideAfter(afterIndex);
|
|
10144
|
+
}
|
|
10160
10145
|
},
|
|
10161
10146
|
deleteSlides(indexes) {
|
|
10162
10147
|
editorOps.slideOps.handleDeleteSlides(indexes);
|
|
@@ -10319,7 +10304,7 @@ function useReducedMotion() {
|
|
|
10319
10304
|
}
|
|
10320
10305
|
function useViewerOptions() {
|
|
10321
10306
|
const storeRef = react.useRef(null);
|
|
10322
|
-
storeRef.current ??=
|
|
10307
|
+
storeRef.current ??= chunkL2MOKP3E_js.createViewerOptionsStore();
|
|
10323
10308
|
const store = storeRef.current;
|
|
10324
10309
|
const options = react.useSyncExternalStore(
|
|
10325
10310
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -10328,9 +10313,9 @@ function useViewerOptions() {
|
|
|
10328
10313
|
);
|
|
10329
10314
|
return { optionsStore: store, options };
|
|
10330
10315
|
}
|
|
10331
|
-
var KNOWN_TAB_IDS = new Set(
|
|
10316
|
+
var KNOWN_TAB_IDS = new Set(chunkL2MOKP3E_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
10332
10317
|
function computeToolbarVisibility(hiddenActions, hiddenTabIds = []) {
|
|
10333
|
-
const isHidden = (id) =>
|
|
10318
|
+
const isHidden = (id) => chunkL2MOKP3E_js.isActionHidden(id, hiddenActions);
|
|
10334
10319
|
const userHidden = new Set(hiddenTabIds);
|
|
10335
10320
|
userHidden.delete("file");
|
|
10336
10321
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id) && !userHidden.has(id);
|
|
@@ -10423,12 +10408,12 @@ function useYjsDocumentSync({
|
|
|
10423
10408
|
return;
|
|
10424
10409
|
}
|
|
10425
10410
|
try {
|
|
10426
|
-
const handler = new
|
|
10411
|
+
const handler = new chunkL2MOKP3E_js.PptxHandler();
|
|
10427
10412
|
await handler.load(sourceBytes.buffer);
|
|
10428
|
-
const currentSlides =
|
|
10413
|
+
const currentSlides = chunkL2MOKP3E_js.readSlidesFromYDoc(
|
|
10429
10414
|
doc
|
|
10430
10415
|
);
|
|
10431
|
-
const slidesToSave =
|
|
10416
|
+
const slidesToSave = chunkL2MOKP3E_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10432
10417
|
const bytes = await handler.save(slidesToSave, getSaveOptions?.());
|
|
10433
10418
|
config.onWriteBack(bytes);
|
|
10434
10419
|
} catch {
|
|
@@ -10443,10 +10428,10 @@ function useYjsDocumentSync({
|
|
|
10443
10428
|
if (!doc || !isConnected) {
|
|
10444
10429
|
return;
|
|
10445
10430
|
}
|
|
10446
|
-
const docSlides =
|
|
10431
|
+
const docSlides = chunkL2MOKP3E_js.readSlidesFromYDoc(
|
|
10447
10432
|
doc
|
|
10448
10433
|
);
|
|
10449
|
-
if (!
|
|
10434
|
+
if (!chunkL2MOKP3E_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
|
|
10450
10435
|
return;
|
|
10451
10436
|
}
|
|
10452
10437
|
lastSyncedRef.current = JSON.stringify(docSlides);
|
|
@@ -10465,11 +10450,11 @@ function useYjsDocumentSync({
|
|
|
10465
10450
|
lastSyncedRef.current = serialized;
|
|
10466
10451
|
void (async () => {
|
|
10467
10452
|
const factories = await getFactories();
|
|
10468
|
-
|
|
10453
|
+
chunkL2MOKP3E_js.reconcileSlidesInYDoc(
|
|
10469
10454
|
slides,
|
|
10470
10455
|
doc,
|
|
10471
10456
|
factories,
|
|
10472
|
-
|
|
10457
|
+
chunkL2MOKP3E_js.LOCAL_SYNC_ORIGIN
|
|
10473
10458
|
);
|
|
10474
10459
|
scheduleWriteBack();
|
|
10475
10460
|
})();
|
|
@@ -10483,10 +10468,10 @@ function useYjsDocumentSync({
|
|
|
10483
10468
|
return;
|
|
10484
10469
|
}
|
|
10485
10470
|
const handleChange = (_events, transaction) => {
|
|
10486
|
-
if (transaction?.origin ===
|
|
10471
|
+
if (transaction?.origin === chunkL2MOKP3E_js.LOCAL_SYNC_ORIGIN) {
|
|
10487
10472
|
return;
|
|
10488
10473
|
}
|
|
10489
|
-
const remoteSlides =
|
|
10474
|
+
const remoteSlides = chunkL2MOKP3E_js.readSlidesFromYDoc(
|
|
10490
10475
|
doc
|
|
10491
10476
|
);
|
|
10492
10477
|
if (remoteSlides.length === 0) {
|
|
@@ -10502,7 +10487,7 @@ function useYjsDocumentSync({
|
|
|
10502
10487
|
isApplyingRemoteRef.current = false;
|
|
10503
10488
|
scheduleWriteBack();
|
|
10504
10489
|
};
|
|
10505
|
-
const unobserve =
|
|
10490
|
+
const unobserve = chunkL2MOKP3E_js.observeYDocSlides(
|
|
10506
10491
|
doc,
|
|
10507
10492
|
handleChange
|
|
10508
10493
|
);
|
|
@@ -10540,7 +10525,7 @@ function useBroadcastFollower({
|
|
|
10540
10525
|
if (!broadcaster) {
|
|
10541
10526
|
return;
|
|
10542
10527
|
}
|
|
10543
|
-
if (!
|
|
10528
|
+
if (!chunkL2MOKP3E_js.shouldAutoFollowBroadcaster({
|
|
10544
10529
|
localRole: collab.config.role,
|
|
10545
10530
|
broadcasterRole: broadcaster.role
|
|
10546
10531
|
})) {
|
|
@@ -10698,7 +10683,7 @@ function useLayoutSwitching(input) {
|
|
|
10698
10683
|
currentLayoutPath
|
|
10699
10684
|
};
|
|
10700
10685
|
}
|
|
10701
|
-
var MIN_TOUCH_TARGET =
|
|
10686
|
+
var MIN_TOUCH_TARGET = chunkL2MOKP3E_js.MIN_TOUCH_TARGET_PX;
|
|
10702
10687
|
function subscribeTouchCapability(callback) {
|
|
10703
10688
|
if (typeof window === "undefined") {
|
|
10704
10689
|
return () => {
|
|
@@ -10711,7 +10696,7 @@ function subscribeTouchCapability(callback) {
|
|
|
10711
10696
|
function useIsMobile() {
|
|
10712
10697
|
const isTouchDevice = react.useSyncExternalStore(
|
|
10713
10698
|
subscribeTouchCapability,
|
|
10714
|
-
|
|
10699
|
+
chunkL2MOKP3E_js.detectTouchDevice,
|
|
10715
10700
|
() => false
|
|
10716
10701
|
// server snapshot
|
|
10717
10702
|
);
|
|
@@ -10721,7 +10706,7 @@ function useIsMobile() {
|
|
|
10721
10706
|
const [viewportHeight, setViewportHeight] = react.useState(
|
|
10722
10707
|
() => typeof window === "undefined" ? 768 : window.innerHeight
|
|
10723
10708
|
);
|
|
10724
|
-
const [orientation, setOrientation] = react.useState(
|
|
10709
|
+
const [orientation, setOrientation] = react.useState(chunkL2MOKP3E_js.detectOrientation);
|
|
10725
10710
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
10726
10711
|
const [initialViewportHeight] = react.useState(
|
|
10727
10712
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -10742,7 +10727,7 @@ function useIsMobile() {
|
|
|
10742
10727
|
return;
|
|
10743
10728
|
}
|
|
10744
10729
|
const handleOrientationChange = () => {
|
|
10745
|
-
setOrientation(
|
|
10730
|
+
setOrientation(chunkL2MOKP3E_js.detectOrientation());
|
|
10746
10731
|
};
|
|
10747
10732
|
if (screen.orientation) {
|
|
10748
10733
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -10772,7 +10757,7 @@ function useIsMobile() {
|
|
|
10772
10757
|
window.addEventListener("resize", handleResize);
|
|
10773
10758
|
return () => window.removeEventListener("resize", handleResize);
|
|
10774
10759
|
}, [isTouchDevice, initialViewportHeight]);
|
|
10775
|
-
const { isMobile, isTablet, isDesktop } =
|
|
10760
|
+
const { isMobile, isTablet, isDesktop } = chunkL2MOKP3E_js.deriveViewportBreakpoints(
|
|
10776
10761
|
viewportWidth,
|
|
10777
10762
|
viewportHeight,
|
|
10778
10763
|
isTouchDevice
|
|
@@ -10805,10 +10790,10 @@ function useTouchGestures(input) {
|
|
|
10805
10790
|
if (!el || !enabled) {
|
|
10806
10791
|
return;
|
|
10807
10792
|
}
|
|
10808
|
-
const recognizer =
|
|
10793
|
+
const recognizer = chunkL2MOKP3E_js.createTouchGestureRecognizer({
|
|
10809
10794
|
getScale: () => scaleRef.current,
|
|
10810
|
-
minScale:
|
|
10811
|
-
maxScale:
|
|
10795
|
+
minScale: chunkL2MOKP3E_js.MIN_ZOOM_SCALE,
|
|
10796
|
+
maxScale: chunkL2MOKP3E_js.MAX_ZOOM_SCALE,
|
|
10812
10797
|
callbacks: {
|
|
10813
10798
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10814
10799
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10848,7 +10833,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10848
10833
|
return;
|
|
10849
10834
|
}
|
|
10850
10835
|
const rect = active.getBoundingClientRect();
|
|
10851
|
-
const delta =
|
|
10836
|
+
const delta = chunkL2MOKP3E_js.computeScrollDelta(
|
|
10852
10837
|
{ top: rect.top, bottom: rect.bottom },
|
|
10853
10838
|
window.innerHeight,
|
|
10854
10839
|
keyboardInset
|
|
@@ -10868,8 +10853,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10868
10853
|
return;
|
|
10869
10854
|
}
|
|
10870
10855
|
const update = () => {
|
|
10871
|
-
const metrics =
|
|
10872
|
-
const inset = metrics ?
|
|
10856
|
+
const metrics = chunkL2MOKP3E_js.readViewportMetrics(window);
|
|
10857
|
+
const inset = metrics ? chunkL2MOKP3E_js.computeKeyboardInset(metrics) : 0;
|
|
10873
10858
|
setKeyboardInset(inset);
|
|
10874
10859
|
if (inset > 0) {
|
|
10875
10860
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10880,8 +10865,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10880
10865
|
vv.addEventListener("scroll", update);
|
|
10881
10866
|
const onFocusIn = () => {
|
|
10882
10867
|
window.requestAnimationFrame(() => {
|
|
10883
|
-
const metrics =
|
|
10884
|
-
const inset = metrics ?
|
|
10868
|
+
const metrics = chunkL2MOKP3E_js.readViewportMetrics(window);
|
|
10869
|
+
const inset = metrics ? chunkL2MOKP3E_js.computeKeyboardInset(metrics) : 0;
|
|
10885
10870
|
if (inset > 0) {
|
|
10886
10871
|
scrollFocusedIntoView(inset);
|
|
10887
10872
|
}
|
|
@@ -10894,7 +10879,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10894
10879
|
document.removeEventListener("focusin", onFocusIn);
|
|
10895
10880
|
};
|
|
10896
10881
|
}, [enabled]);
|
|
10897
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10882
|
+
return { keyboardInset, isKeyboardOpen: chunkL2MOKP3E_js.isKeyboardOpen(keyboardInset) };
|
|
10898
10883
|
}
|
|
10899
10884
|
|
|
10900
10885
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10923,21 +10908,21 @@ function buildCanvasProps(input) {
|
|
|
10923
10908
|
} = input;
|
|
10924
10909
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10925
10910
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10926
|
-
const fieldContext =
|
|
10911
|
+
const fieldContext = chunkL2MOKP3E_js.buildFieldSubstitutionContext({
|
|
10927
10912
|
headerFooter: s.headerFooter,
|
|
10928
10913
|
customProperties: s.customProperties,
|
|
10929
10914
|
slide: activeSlide
|
|
10930
10915
|
});
|
|
10931
10916
|
const tableStyleContext = s.theme || s.tableStyleMap ? { theme: s.theme, tableStyleMap: s.tableStyleMap } : void 0;
|
|
10932
10917
|
const openExternalUrl = (url, target) => {
|
|
10933
|
-
if (
|
|
10918
|
+
if (chunkL2MOKP3E_js.shouldConfirmExternalHyperlink(viewerOptions, url) && !window.confirm(buildHyperlinkConfirmMessage(url))) {
|
|
10934
10919
|
return;
|
|
10935
10920
|
}
|
|
10936
|
-
|
|
10921
|
+
chunkL2MOKP3E_js.safeOpenUrl(url, target);
|
|
10937
10922
|
};
|
|
10938
10923
|
const handleActionClick = (elementId, action) => {
|
|
10939
10924
|
if (mode === "present") {
|
|
10940
|
-
const resolved =
|
|
10925
|
+
const resolved = chunkL2MOKP3E_js.resolvePresentationAction(action, { slideCount: slides.length });
|
|
10941
10926
|
if (resolved.intent.kind === "openUrl") {
|
|
10942
10927
|
openExternalUrl(resolved.intent.url);
|
|
10943
10928
|
return;
|
|
@@ -10948,9 +10933,9 @@ function buildCanvasProps(input) {
|
|
|
10948
10933
|
}
|
|
10949
10934
|
};
|
|
10950
10935
|
const handleHyperlinkClick = (url, target) => {
|
|
10951
|
-
if (
|
|
10936
|
+
if (chunkL2MOKP3E_js.isPpactionUrl(url)) {
|
|
10952
10937
|
if (mode === "present") {
|
|
10953
|
-
const parsed =
|
|
10938
|
+
const parsed = chunkL2MOKP3E_js.parsePpactionUrl(url);
|
|
10954
10939
|
if (parsed) {
|
|
10955
10940
|
presentation.handlePresentationAction({
|
|
10956
10941
|
action: parsed.action,
|
|
@@ -11056,7 +11041,7 @@ function buildCanvasProps(input) {
|
|
|
11056
11041
|
|
|
11057
11042
|
// src/viewer/hooks/useScopedLayoutOptions.ts
|
|
11058
11043
|
function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
|
|
11059
|
-
return
|
|
11044
|
+
return chunkL2MOKP3E_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
|
|
11060
11045
|
}
|
|
11061
11046
|
|
|
11062
11047
|
// src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
|
|
@@ -11069,7 +11054,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
11069
11054
|
const current = activeSlide.animations ?? [];
|
|
11070
11055
|
if (group === "motionPath") {
|
|
11071
11056
|
propertyHandlers.handleUpdateSlide({
|
|
11072
|
-
animations:
|
|
11057
|
+
animations: chunkL2MOKP3E_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
11073
11058
|
});
|
|
11074
11059
|
return;
|
|
11075
11060
|
}
|
|
@@ -11265,7 +11250,7 @@ function buildToolbarProps(input) {
|
|
|
11265
11250
|
onOpenFile,
|
|
11266
11251
|
onOpenRecentFile,
|
|
11267
11252
|
onCreatePresentation: (templateId) => {
|
|
11268
|
-
s.setSlides(
|
|
11253
|
+
s.setSlides(chunkL2MOKP3E_js.createBackstagePresentation(templateId));
|
|
11269
11254
|
s.setActiveSlideIndex(0);
|
|
11270
11255
|
s.setSelectedElementId(null);
|
|
11271
11256
|
s.setSelectedElementIds([]);
|
|
@@ -11295,7 +11280,7 @@ function buildToolbarProps(input) {
|
|
|
11295
11280
|
loadLayoutPreviews: input.loadLayoutPreviews,
|
|
11296
11281
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
11297
11282
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
11298
|
-
templateScheme:
|
|
11283
|
+
templateScheme: chunkL2MOKP3E_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
11299
11284
|
customShows: s.customShows,
|
|
11300
11285
|
activeCustomShowId: s.activeCustomShowId,
|
|
11301
11286
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -11336,7 +11321,7 @@ function buildToolbarProps(input) {
|
|
|
11336
11321
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
11337
11322
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
11338
11323
|
formatPainterActive: s.formatPainterActive,
|
|
11339
|
-
canActivateFormatPainter:
|
|
11324
|
+
canActivateFormatPainter: chunkL2MOKP3E_js.hasCopyableFormat(selectedElement),
|
|
11340
11325
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
11341
11326
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
11342
11327
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -11414,7 +11399,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11414
11399
|
headerFooter: state.headerFooter,
|
|
11415
11400
|
loading,
|
|
11416
11401
|
error,
|
|
11417
|
-
maxHistoryEntries:
|
|
11402
|
+
maxHistoryEntries: chunkL2MOKP3E_js.resolveHistoryDepth(viewerOptions),
|
|
11418
11403
|
hasActivePointerInteraction,
|
|
11419
11404
|
pointerCommitNonce: state.pointerCommitNonce,
|
|
11420
11405
|
onDirty: markDocumentDirty,
|
|
@@ -11439,7 +11424,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11439
11424
|
documentGridSpacing: state.viewProperties?.gridSpacing
|
|
11440
11425
|
});
|
|
11441
11426
|
const themeColorMap = react.useMemo(
|
|
11442
|
-
() => state.theme?.colorScheme ?
|
|
11427
|
+
() => state.theme?.colorScheme ? chunkL2MOKP3E_js.buildThemeColorMap(state.theme.colorScheme) : void 0,
|
|
11443
11428
|
[state.theme?.colorScheme]
|
|
11444
11429
|
);
|
|
11445
11430
|
const { presentation, annotations, actionSoundHandlerRef, setExitModeHandler } = usePresentationSetup({
|
|
@@ -11488,8 +11473,8 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11488
11473
|
gridSpacingPx,
|
|
11489
11474
|
// Multiplied against the pre-existing 2x baseline; see the matching
|
|
11490
11475
|
// comment in `PowerPointViewer.tsx`.
|
|
11491
|
-
imageExportScale: 2 *
|
|
11492
|
-
imageResolutionScale:
|
|
11476
|
+
imageExportScale: 2 * chunkL2MOKP3E_js.resolveImageResolutionScale(viewerOptions),
|
|
11477
|
+
imageResolutionScale: chunkL2MOKP3E_js.resolveImageResolutionScale(viewerOptions),
|
|
11493
11478
|
viewerOptions
|
|
11494
11479
|
};
|
|
11495
11480
|
}
|
|
@@ -11505,7 +11490,7 @@ function useCompatibilityToastsState() {
|
|
|
11505
11490
|
}
|
|
11506
11491
|
function useReadOnlyRecommendationState(content) {
|
|
11507
11492
|
const [recommendation, setRecommendation] = react.useState(
|
|
11508
|
-
() =>
|
|
11493
|
+
() => chunkL2MOKP3E_js.readOnlyRecommendation(void 0)
|
|
11509
11494
|
);
|
|
11510
11495
|
const [modifyVerifier, setModifyVerifier] = react.useState(void 0);
|
|
11511
11496
|
const [bannerHidden, setBannerHidden] = react.useState(false);
|
|
@@ -11545,7 +11530,7 @@ function useReadOnlyRecommendationState(content) {
|
|
|
11545
11530
|
async (password) => {
|
|
11546
11531
|
setCheckingPassword(true);
|
|
11547
11532
|
try {
|
|
11548
|
-
const result = await
|
|
11533
|
+
const result = await chunkL2MOKP3E_js.checkModifyPassword(modifyVerifier, password);
|
|
11549
11534
|
if (result.ok) {
|
|
11550
11535
|
unlock();
|
|
11551
11536
|
} else {
|
|
@@ -11590,9 +11575,9 @@ function useViewPreferencesSync(input) {
|
|
|
11590
11575
|
setShowGuides
|
|
11591
11576
|
} = input;
|
|
11592
11577
|
react.useEffect(() => {
|
|
11593
|
-
const seeded =
|
|
11578
|
+
const seeded = chunkL2MOKP3E_js.viewerPreferencesFromViewProperties(
|
|
11594
11579
|
{ viewProperties },
|
|
11595
|
-
{ ...
|
|
11580
|
+
{ ...chunkL2MOKP3E_js.DEFAULT_VIEWER_PREFERENCES, snapToGrid, snapToObjects: snapToShape, showGuides }
|
|
11596
11581
|
);
|
|
11597
11582
|
setSnapToGrid(seeded.snapToGrid);
|
|
11598
11583
|
setSnapToShape(seeded.snapToObjects ?? snapToShape);
|
|
@@ -11602,7 +11587,7 @@ function useViewPreferencesSync(input) {
|
|
|
11602
11587
|
(prefsOverride) => {
|
|
11603
11588
|
setViewProperties((prev) => {
|
|
11604
11589
|
const merged = {
|
|
11605
|
-
...
|
|
11590
|
+
...chunkL2MOKP3E_js.DEFAULT_VIEWER_PREFERENCES,
|
|
11606
11591
|
snapToGrid,
|
|
11607
11592
|
snapToObjects: snapToShape,
|
|
11608
11593
|
showGuides,
|
|
@@ -11610,7 +11595,7 @@ function useViewPreferencesSync(input) {
|
|
|
11610
11595
|
gridSpacingCy: prev?.gridSpacing?.cy,
|
|
11611
11596
|
...prefsOverride
|
|
11612
11597
|
};
|
|
11613
|
-
const patch =
|
|
11598
|
+
const patch = chunkL2MOKP3E_js.viewPropertiesPatchFromPreferences(merged);
|
|
11614
11599
|
return {
|
|
11615
11600
|
...prev,
|
|
11616
11601
|
slideViewPr: { ...prev?.slideViewPr, ...patch.slideViewPr },
|
|
@@ -11831,7 +11816,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11831
11816
|
}, [incomingContent]);
|
|
11832
11817
|
const onOpenFile = react.useCallback(() => {
|
|
11833
11818
|
void (async () => {
|
|
11834
|
-
const picked = await
|
|
11819
|
+
const picked = await chunkL2MOKP3E_js.openPptxFile();
|
|
11835
11820
|
if (picked) {
|
|
11836
11821
|
setContent(picked.buffer);
|
|
11837
11822
|
}
|
|
@@ -11839,7 +11824,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11839
11824
|
}, []);
|
|
11840
11825
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11841
11826
|
void (async () => {
|
|
11842
|
-
const bytes = await
|
|
11827
|
+
const bytes = await chunkL2MOKP3E_js.readBackstageRecentFile(key);
|
|
11843
11828
|
if (bytes) {
|
|
11844
11829
|
setContent(bytes);
|
|
11845
11830
|
}
|