pptx-react-viewer 3.5.4 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/{AiChatPanel-LPZWDNVU.js → AiChatPanel-LEOEDIW2.js} +25 -25
- package/dist/AiChatPanel-LEOEDIW2.js.br +0 -0
- package/dist/AiChatPanel-LEOEDIW2.js.gz +0 -0
- package/dist/{AiChatPanel-CCJNQGER.mjs → AiChatPanel-WRQGJJVD.mjs} +4 -4
- package/dist/AiChatPanel-WRQGJJVD.mjs.br +0 -0
- package/dist/AiChatPanel-WRQGJJVD.mjs.gz +0 -0
- package/dist/{Area3DChartScene-LJCWBNQ3.js → Area3DChartScene-3TJ2GTGI.js} +2 -2
- package/dist/Area3DChartScene-3TJ2GTGI.js.br +0 -0
- package/dist/Area3DChartScene-3TJ2GTGI.js.gz +0 -0
- package/dist/{Area3DChartScene-P6YM6ZL7.mjs → Area3DChartScene-SJC2ZB6R.mjs} +1 -1
- package/dist/Area3DChartScene-SJC2ZB6R.mjs.br +2 -0
- package/dist/Area3DChartScene-SJC2ZB6R.mjs.gz +0 -0
- package/dist/{Bar3DChartScene-7DNQ4X5T.js → Bar3DChartScene-2ZGOMOZO.js} +2 -2
- package/dist/Bar3DChartScene-2ZGOMOZO.js.br +0 -0
- package/dist/Bar3DChartScene-2ZGOMOZO.js.gz +0 -0
- package/dist/{Bar3DChartScene-DIVOJURZ.mjs → Bar3DChartScene-SPER4LQA.mjs} +1 -1
- package/dist/Bar3DChartScene-SPER4LQA.mjs.br +0 -0
- package/dist/Bar3DChartScene-SPER4LQA.mjs.gz +0 -0
- package/dist/{Line3DChartScene-UF6DHP36.js → Line3DChartScene-42FYFGLU.js} +2 -2
- package/dist/Line3DChartScene-42FYFGLU.js.br +0 -0
- package/dist/Line3DChartScene-42FYFGLU.js.gz +0 -0
- package/dist/{Line3DChartScene-ZZVNUKIJ.mjs → Line3DChartScene-FH3YHPXE.mjs} +1 -1
- package/dist/Line3DChartScene-FH3YHPXE.mjs.br +2 -0
- package/dist/Line3DChartScene-FH3YHPXE.mjs.gz +0 -0
- package/dist/{Model3DScene-XXMAAKBR.mjs → Model3DScene-2BCR2YYD.mjs} +1 -1
- package/dist/Model3DScene-2BCR2YYD.mjs.br +0 -0
- package/dist/Model3DScene-2BCR2YYD.mjs.gz +0 -0
- package/dist/{Model3DScene-C7MZ22DH.js → Model3DScene-EIU2GVUZ.js} +2 -2
- package/dist/Model3DScene-EIU2GVUZ.js.br +0 -0
- package/dist/Model3DScene-EIU2GVUZ.js.gz +0 -0
- package/dist/{PieChart3DScene-7LX3IL2Q.mjs → PieChart3DScene-QFQUJFDP.mjs} +1 -1
- package/dist/PieChart3DScene-QFQUJFDP.mjs.br +0 -0
- package/dist/PieChart3DScene-QFQUJFDP.mjs.gz +0 -0
- package/dist/{PieChart3DScene-N2Y25VG5.js → PieChart3DScene-VQOHZPHI.js} +2 -2
- package/dist/{PieChart3DScene-N2Y25VG5.js.br → PieChart3DScene-VQOHZPHI.js.br} +0 -0
- package/dist/PieChart3DScene-VQOHZPHI.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-ADA7NUIW.mjs → SurfaceChart3DScene-CGXMRBCL.mjs} +1 -1
- package/dist/SurfaceChart3DScene-CGXMRBCL.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-CGXMRBCL.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-WXJHYOGJ.js → SurfaceChart3DScene-FTVXZN6O.js} +2 -2
- package/dist/{SurfaceChart3DScene-WXJHYOGJ.js.br → SurfaceChart3DScene-FTVXZN6O.js.br} +0 -0
- package/dist/SurfaceChart3DScene-FTVXZN6O.js.gz +0 -0
- package/dist/{chunk-UTMTXJGM.js → chunk-7VPDHSWF.js} +330 -349
- package/dist/chunk-7VPDHSWF.js.br +0 -0
- package/dist/chunk-7VPDHSWF.js.gz +0 -0
- package/dist/{chunk-YQOK4E2A.js → chunk-AL2KLPOJ.js} +32381 -22178
- package/dist/chunk-AL2KLPOJ.js.br +0 -0
- package/dist/chunk-AL2KLPOJ.js.gz +0 -0
- package/dist/{chunk-IWQSAKPM.mjs → chunk-FG5VQFWP.mjs} +193 -71
- package/dist/chunk-FG5VQFWP.mjs.br +0 -0
- package/dist/chunk-FG5VQFWP.mjs.gz +0 -0
- package/dist/{chunk-UTIMT5CZ.js → chunk-MZI4DG3S.js} +12 -0
- package/dist/chunk-MZI4DG3S.js.br +0 -0
- package/dist/{chunk-UTIMT5CZ.js.gz → chunk-MZI4DG3S.js.gz} +0 -0
- package/dist/{chunk-HHJZK26I.js → chunk-NFOOONND.js} +1359 -1237
- package/dist/chunk-NFOOONND.js.br +0 -0
- package/dist/chunk-NFOOONND.js.gz +0 -0
- package/dist/{chunk-IVPT3U5C.mjs → chunk-T3V5FBXJ.mjs} +29 -1
- package/dist/chunk-T3V5FBXJ.mjs.br +0 -0
- package/dist/chunk-T3V5FBXJ.mjs.gz +0 -0
- package/dist/{chunk-JCJ3EPG6.mjs → chunk-TGCSZXOG.mjs} +12 -0
- package/dist/chunk-TGCSZXOG.mjs.br +0 -0
- package/dist/{chunk-JCJ3EPG6.mjs.gz → chunk-TGCSZXOG.mjs.gz} +0 -0
- package/dist/{chunk-EVVWCF2M.mjs → chunk-VYNICQ4O.mjs} +58 -37
- package/dist/chunk-VYNICQ4O.mjs.br +0 -0
- package/dist/chunk-VYNICQ4O.mjs.gz +0 -0
- package/dist/{chunk-U52MKWVA.mjs → chunk-WX7AFFBZ.mjs} +142 -161
- package/dist/chunk-WX7AFFBZ.mjs.br +0 -0
- package/dist/chunk-WX7AFFBZ.mjs.gz +0 -0
- package/dist/{chunk-2FMQ7M3L.js → chunk-ZHSBMG37.js} +490 -469
- package/dist/chunk-ZHSBMG37.js.br +0 -0
- package/dist/chunk-ZHSBMG37.js.gz +0 -0
- package/dist/{chunk-NM652EZS.mjs → chunk-ZUSYUWOV.mjs} +32358 -22178
- package/dist/chunk-ZUSYUWOV.mjs.br +0 -0
- package/dist/chunk-ZUSYUWOV.mjs.gz +0 -0
- package/dist/{chunk-UOMFINNJ.js → chunk-ZWPHUPL4.js} +33 -5
- package/dist/chunk-ZWPHUPL4.js.br +0 -0
- package/dist/chunk-ZWPHUPL4.js.gz +0 -0
- package/dist/i18n.js +4 -4
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.d.ts +599 -33
- package/dist/index.js +47 -47
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +610 -33
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +79 -79
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +4 -4
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/{useViewerBuildingBlocks-f6oNGKMX.d.ts → useViewerBuildingBlocks-C8F_4Pzb.d.ts} +3 -1
- package/dist/useViewerBuildingBlocks-C8F_4Pzb.d.ts.map +1 -0
- package/dist/viewer/index.d.ts +552 -33
- package/dist/viewer/index.js +27 -27
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +6 -6
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-CCJNQGER.mjs.br +0 -0
- package/dist/AiChatPanel-CCJNQGER.mjs.gz +0 -0
- package/dist/AiChatPanel-LPZWDNVU.js.br +0 -0
- package/dist/AiChatPanel-LPZWDNVU.js.gz +0 -0
- package/dist/Area3DChartScene-LJCWBNQ3.js.br +0 -0
- package/dist/Area3DChartScene-LJCWBNQ3.js.gz +0 -0
- package/dist/Area3DChartScene-P6YM6ZL7.mjs.br +0 -0
- package/dist/Area3DChartScene-P6YM6ZL7.mjs.gz +0 -0
- package/dist/Bar3DChartScene-7DNQ4X5T.js.br +0 -1
- package/dist/Bar3DChartScene-7DNQ4X5T.js.gz +0 -0
- package/dist/Bar3DChartScene-DIVOJURZ.mjs.br +0 -0
- package/dist/Bar3DChartScene-DIVOJURZ.mjs.gz +0 -0
- package/dist/Line3DChartScene-UF6DHP36.js.br +0 -0
- package/dist/Line3DChartScene-UF6DHP36.js.gz +0 -0
- package/dist/Line3DChartScene-ZZVNUKIJ.mjs.br +0 -0
- package/dist/Line3DChartScene-ZZVNUKIJ.mjs.gz +0 -0
- package/dist/Model3DScene-C7MZ22DH.js.br +0 -0
- package/dist/Model3DScene-C7MZ22DH.js.gz +0 -0
- package/dist/Model3DScene-XXMAAKBR.mjs.br +0 -0
- package/dist/Model3DScene-XXMAAKBR.mjs.gz +0 -0
- package/dist/PieChart3DScene-7LX3IL2Q.mjs.br +0 -0
- package/dist/PieChart3DScene-7LX3IL2Q.mjs.gz +0 -0
- package/dist/PieChart3DScene-N2Y25VG5.js.gz +0 -0
- package/dist/SurfaceChart3DScene-ADA7NUIW.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-ADA7NUIW.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-WXJHYOGJ.js.gz +0 -0
- package/dist/chunk-2FMQ7M3L.js.br +0 -0
- package/dist/chunk-2FMQ7M3L.js.gz +0 -0
- package/dist/chunk-EVVWCF2M.mjs.br +0 -0
- package/dist/chunk-EVVWCF2M.mjs.gz +0 -0
- package/dist/chunk-HHJZK26I.js.br +0 -0
- package/dist/chunk-HHJZK26I.js.gz +0 -0
- package/dist/chunk-IVPT3U5C.mjs.br +0 -0
- package/dist/chunk-IVPT3U5C.mjs.gz +0 -0
- package/dist/chunk-IWQSAKPM.mjs.br +0 -0
- package/dist/chunk-IWQSAKPM.mjs.gz +0 -0
- package/dist/chunk-JCJ3EPG6.mjs.br +0 -0
- package/dist/chunk-NM652EZS.mjs.br +0 -0
- package/dist/chunk-NM652EZS.mjs.gz +0 -0
- package/dist/chunk-U52MKWVA.mjs.br +0 -0
- package/dist/chunk-U52MKWVA.mjs.gz +0 -0
- package/dist/chunk-UOMFINNJ.js.br +0 -0
- package/dist/chunk-UOMFINNJ.js.gz +0 -0
- package/dist/chunk-UTIMT5CZ.js.br +0 -0
- package/dist/chunk-UTMTXJGM.js.br +0 -0
- package/dist/chunk-UTMTXJGM.js.gz +0 -0
- package/dist/chunk-YQOK4E2A.js.br +0 -0
- package/dist/chunk-YQOK4E2A.js.gz +0 -0
- package/dist/useViewerBuildingBlocks-f6oNGKMX.d.ts.map +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunk7VPDHSWF_js = require('./chunk-7VPDHSWF.js');
|
|
4
|
+
var chunkAL2KLPOJ_js = require('./chunk-AL2KLPOJ.js');
|
|
5
|
+
var chunkMZI4DG3S_js = require('./chunk-MZI4DG3S.js');
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var reactI18next = require('react-i18next');
|
|
8
8
|
|
|
9
9
|
function useVirtualizedSlides({
|
|
10
10
|
totalItems,
|
|
11
11
|
itemHeight,
|
|
12
|
-
overscan =
|
|
12
|
+
overscan = chunkAL2KLPOJ_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 = chunkAL2KLPOJ_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 ??= chunkAL2KLPOJ_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 >= chunkAL2KLPOJ_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
|
+
}, chunkAL2KLPOJ_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 = chunkAL2KLPOJ_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
|
+
chunkAL2KLPOJ_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 = chunkAL2KLPOJ_js.validateRoomId(config.roomId);
|
|
244
244
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
245
|
-
departureRef.current =
|
|
245
|
+
departureRef.current = chunkAL2KLPOJ_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 = chunkAL2KLPOJ_js.validateRoomId(config.roomId);
|
|
288
|
+
const transport = config.transport ?? chunkAL2KLPOJ_js.resolveTransportForServerUrl(config.serverUrl);
|
|
289
289
|
if (transport === "webrtc") {
|
|
290
290
|
await initWebrtc();
|
|
291
291
|
return;
|
|
292
292
|
}
|
|
293
|
-
if (
|
|
293
|
+
if (chunkAL2KLPOJ_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 = chunkAL2KLPOJ_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
|
+
chunkAL2KLPOJ_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
|
+
}, chunkAL2KLPOJ_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
|
+
chunkAL2KLPOJ_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 = chunkAL2KLPOJ_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 = chunkAL2KLPOJ_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(chunkAL2KLPOJ_js.cloneSlide),
|
|
531
|
+
templateElementsBySlideId: chunkAL2KLPOJ_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(chunkAL2KLPOJ_js.cloneSlide));
|
|
545
545
|
setTemplateElementsBySlideId(
|
|
546
|
-
|
|
546
|
+
chunkAL2KLPOJ_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 = chunk7VPDHSWF_js.cloneHistorySnapshot(previousSnapshot);
|
|
586
|
+
lastHistorySnapshotRef.current = chunk7VPDHSWF_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 = chunk7VPDHSWF_js.cloneHistorySnapshot(nextSnapshot);
|
|
608
|
+
lastHistorySnapshotRef.current = chunk7VPDHSWF_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 = chunk7VPDHSWF_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 = chunk7VPDHSWF_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(chunk7VPDHSWF_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 = chunk7VPDHSWF_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(chunkAL2KLPOJ_js.createWheelStepBuffer());
|
|
747
747
|
const storeRef = react.useRef(null);
|
|
748
|
-
storeRef.current ??=
|
|
748
|
+
storeRef.current ??= chunkAL2KLPOJ_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 = chunkAL2KLPOJ_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, chunk7VPDHSWF_js.MIN_ELEMENT_SIZE));
|
|
847
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunk7VPDHSWF_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, chunk7VPDHSWF_js.MIN_ELEMENT_SIZE);
|
|
854
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunk7VPDHSWF_js.MIN_ELEMENT_SIZE);
|
|
855
855
|
const availableWidth = Math.max(
|
|
856
|
-
effectiveEditorDimensions.width -
|
|
857
|
-
|
|
856
|
+
effectiveEditorDimensions.width - chunk7VPDHSWF_js.ZOOM_TO_SELECTION_PADDING,
|
|
857
|
+
chunk7VPDHSWF_js.MIN_ELEMENT_SIZE
|
|
858
858
|
);
|
|
859
859
|
const availableHeight = Math.max(
|
|
860
|
-
effectiveEditorDimensions.height -
|
|
861
|
-
|
|
860
|
+
effectiveEditorDimensions.height - chunk7VPDHSWF_js.ZOOM_TO_SELECTION_PADDING,
|
|
861
|
+
chunk7VPDHSWF_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 = chunkAL2KLPOJ_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 = chunkAL2KLPOJ_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: chunkAL2KLPOJ_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
|
|
893
893
|
});
|
|
894
894
|
},
|
|
895
895
|
[store]
|
|
@@ -1057,8 +1057,8 @@ function scheduleOpeningAutoPlayGroup(controller, ctx) {
|
|
|
1057
1057
|
if (!group) {
|
|
1058
1058
|
return;
|
|
1059
1059
|
}
|
|
1060
|
-
|
|
1061
|
-
|
|
1060
|
+
chunkAL2KLPOJ_js.playGroup(controller, group, ctx);
|
|
1061
|
+
chunkAL2KLPOJ_js.scheduleAutoAdvanceChain(controller, ctx);
|
|
1062
1062
|
}, firstGroup.autoAdvanceDelayMs ?? 0);
|
|
1063
1063
|
ctx.timers.push(timer);
|
|
1064
1064
|
}
|
|
@@ -1077,7 +1077,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
|
|
|
1077
1077
|
}))
|
|
1078
1078
|
);
|
|
1079
1079
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1080
|
-
const delay =
|
|
1080
|
+
const delay = chunkAL2KLPOJ_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1081
1081
|
const timer = window.setTimeout(() => {
|
|
1082
1082
|
setPresentationAnimations(
|
|
1083
1083
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1106,6 +1106,7 @@ function useAnimationPlayback(input) {
|
|
|
1106
1106
|
const activeAnimationGroupRef = react.useRef(null);
|
|
1107
1107
|
const activeAnimationEndAtRef = react.useRef(0);
|
|
1108
1108
|
const seededCompletedRef = react.useRef(false);
|
|
1109
|
+
const mediaTimeNodeElementIdsRef = react.useRef(/* @__PURE__ */ new Map());
|
|
1109
1110
|
const lastSeedCompletedRef = react.useRef(false);
|
|
1110
1111
|
const buildPlaybackContext = react.useCallback(() => {
|
|
1111
1112
|
return {
|
|
@@ -1114,12 +1115,13 @@ function useAnimationPlayback(input) {
|
|
|
1114
1115
|
buildHandle: buildRafRef,
|
|
1115
1116
|
onPlayActionSound,
|
|
1116
1117
|
playSound: playAnimationSound,
|
|
1117
|
-
stopSound: stopAnimationSound
|
|
1118
|
+
stopSound: stopAnimationSound,
|
|
1119
|
+
mediaTimeNodeElementIds: mediaTimeNodeElementIdsRef.current
|
|
1118
1120
|
};
|
|
1119
1121
|
}, [onPlayActionSound]);
|
|
1120
1122
|
react.useEffect(() => {
|
|
1121
1123
|
return () => {
|
|
1122
|
-
|
|
1124
|
+
chunkAL2KLPOJ_js.cancelBuildReveal(buildRafRef);
|
|
1123
1125
|
};
|
|
1124
1126
|
}, []);
|
|
1125
1127
|
const clearPresentationTimers = react.useCallback(() => {
|
|
@@ -1127,7 +1129,7 @@ function useAnimationPlayback(input) {
|
|
|
1127
1129
|
window.clearTimeout(timer);
|
|
1128
1130
|
});
|
|
1129
1131
|
presentationTimersRef.current = [];
|
|
1130
|
-
|
|
1132
|
+
chunkAL2KLPOJ_js.cancelBuildReveal(buildRafRef);
|
|
1131
1133
|
activeAnimationGroupRef.current = null;
|
|
1132
1134
|
activeAnimationEndAtRef.current = 0;
|
|
1133
1135
|
}, []);
|
|
@@ -1137,18 +1139,22 @@ function useAnimationPlayback(input) {
|
|
|
1137
1139
|
}, []);
|
|
1138
1140
|
const resetSlideTimeline = react.useCallback(
|
|
1139
1141
|
(slideIndex) => {
|
|
1140
|
-
|
|
1142
|
+
chunkAL2KLPOJ_js.cancelBuildReveal(buildRafRef);
|
|
1141
1143
|
const slide = slides[slideIndex];
|
|
1142
1144
|
if (!slide) {
|
|
1143
1145
|
controllerRef.current = null;
|
|
1146
|
+
mediaTimeNodeElementIdsRef.current = /* @__PURE__ */ new Map();
|
|
1144
1147
|
setPresentationElementStates(/* @__PURE__ */ new Map());
|
|
1145
1148
|
setPresentationKeyframesCss("");
|
|
1146
1149
|
setInteractiveTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1147
1150
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1148
1151
|
return;
|
|
1149
1152
|
}
|
|
1150
|
-
const controller =
|
|
1153
|
+
const controller = chunkAL2KLPOJ_js.PresentationAnimationController.fromSlide(slide);
|
|
1151
1154
|
controllerRef.current = controller;
|
|
1155
|
+
mediaTimeNodeElementIdsRef.current = chunkAL2KLPOJ_js.resolveMediaTimeNodeElementIds(
|
|
1156
|
+
slide.nativeAnimations ?? []
|
|
1157
|
+
);
|
|
1152
1158
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1153
1159
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
1154
1160
|
setHoverTriggerShapeIds(controller.hoverTriggerShapeIds);
|
|
@@ -1164,11 +1170,11 @@ function useAnimationPlayback(input) {
|
|
|
1164
1170
|
const activeGroup = activeAnimationGroupRef.current;
|
|
1165
1171
|
if (controller && controller.hasMoreSteps() && shouldSeekAnimationGroup(activeGroup, activeAnimationEndAtRef.current, performance.now())) {
|
|
1166
1172
|
finishDomAnimationsForGroup(activeGroup);
|
|
1167
|
-
const buildIds =
|
|
1173
|
+
const buildIds = chunkAL2KLPOJ_js.PresentationAnimationController.collectBuildStepIds(activeGroup);
|
|
1168
1174
|
const completedStates = controller.computeStatesFor(buildIds);
|
|
1169
1175
|
clearPresentationTimers();
|
|
1170
1176
|
finishAnimationGroupSteps(activeGroup, setPresentationElementStates, completedStates);
|
|
1171
|
-
|
|
1177
|
+
chunkAL2KLPOJ_js.scheduleAutoAdvanceChain(controller, buildPlaybackContext());
|
|
1172
1178
|
return true;
|
|
1173
1179
|
}
|
|
1174
1180
|
if (!controller || !controller.hasMoreSteps()) {
|
|
@@ -1179,9 +1185,9 @@ function useAnimationPlayback(input) {
|
|
|
1179
1185
|
return false;
|
|
1180
1186
|
}
|
|
1181
1187
|
const ctx = buildPlaybackContext();
|
|
1182
|
-
|
|
1188
|
+
chunkAL2KLPOJ_js.playGroup(controller, group, ctx);
|
|
1183
1189
|
markAnimationGroupActive(group);
|
|
1184
|
-
|
|
1190
|
+
chunkAL2KLPOJ_js.scheduleAutoAdvanceChain(controller, ctx);
|
|
1185
1191
|
return true;
|
|
1186
1192
|
}, [animationsEnabled, buildPlaybackContext, clearPresentationTimers, markAnimationGroupActive]);
|
|
1187
1193
|
const handleInteractiveShapeClick = react.useCallback(
|
|
@@ -1194,7 +1200,7 @@ function useAnimationPlayback(input) {
|
|
|
1194
1200
|
if (!group) {
|
|
1195
1201
|
return false;
|
|
1196
1202
|
}
|
|
1197
|
-
|
|
1203
|
+
chunkAL2KLPOJ_js.playGroup(controller, group, buildPlaybackContext());
|
|
1198
1204
|
return true;
|
|
1199
1205
|
},
|
|
1200
1206
|
[buildPlaybackContext]
|
|
@@ -1213,7 +1219,7 @@ function useAnimationPlayback(input) {
|
|
|
1213
1219
|
if (!group) {
|
|
1214
1220
|
return false;
|
|
1215
1221
|
}
|
|
1216
|
-
|
|
1222
|
+
chunkAL2KLPOJ_js.playGroup(controller, group, buildPlaybackContext());
|
|
1217
1223
|
return true;
|
|
1218
1224
|
},
|
|
1219
1225
|
[animationsEnabled, buildPlaybackContext]
|
|
@@ -1294,12 +1300,12 @@ function useAnimationPlayback(input) {
|
|
|
1294
1300
|
presentationTimersRef
|
|
1295
1301
|
};
|
|
1296
1302
|
}
|
|
1297
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1298
|
-
var AUDIENCE_HASH =
|
|
1299
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1300
|
-
var AUDIENCE_NONCE_KEY =
|
|
1303
|
+
var PRESENTER_CHANNEL_NAME = chunkAL2KLPOJ_js.PRESENTATION_CHANNEL_NAME;
|
|
1304
|
+
var AUDIENCE_HASH = chunkAL2KLPOJ_js.PRESENTATION_HASH;
|
|
1305
|
+
var PRESENTER_MSG_ORIGIN = chunkAL2KLPOJ_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1306
|
+
var AUDIENCE_NONCE_KEY = chunkAL2KLPOJ_js.PRESENTATION_NONCE_KEY;
|
|
1301
1307
|
function generateSessionId() {
|
|
1302
|
-
return
|
|
1308
|
+
return chunkAL2KLPOJ_js.createPresentationSessionId();
|
|
1303
1309
|
}
|
|
1304
1310
|
function parseAudienceNonce() {
|
|
1305
1311
|
const hash = window.location.hash;
|
|
@@ -1335,7 +1341,7 @@ function usePresenterWindow(input) {
|
|
|
1335
1341
|
}, []);
|
|
1336
1342
|
const swapDisplays = react.useCallback(async () => {
|
|
1337
1343
|
const audience = audienceWindowRef.current;
|
|
1338
|
-
return audience && !audience.closed ?
|
|
1344
|
+
return audience && !audience.closed ? chunkAL2KLPOJ_js.swapPresentationWindows(window, audience) : false;
|
|
1339
1345
|
}, []);
|
|
1340
1346
|
const syncSlideToAudience = react.useCallback(
|
|
1341
1347
|
(slideIndex) => {
|
|
@@ -1399,7 +1405,7 @@ function usePresenterWindow(input) {
|
|
|
1399
1405
|
pollTimerRef.current = null;
|
|
1400
1406
|
}
|
|
1401
1407
|
if (closingSessionId) {
|
|
1402
|
-
void
|
|
1408
|
+
void chunkAL2KLPOJ_js.clearAudienceContent(closingSessionId);
|
|
1403
1409
|
}
|
|
1404
1410
|
}, [getChannel]);
|
|
1405
1411
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1417,10 +1423,10 @@ function usePresenterWindow(input) {
|
|
|
1417
1423
|
audienceWindowRef.current = blankWin;
|
|
1418
1424
|
const sessionId = generateSessionId();
|
|
1419
1425
|
sessionIdRef.current = sessionId;
|
|
1420
|
-
const audienceUrl =
|
|
1421
|
-
void
|
|
1426
|
+
const audienceUrl = chunkAL2KLPOJ_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1427
|
+
void chunkAL2KLPOJ_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1422
1428
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1423
|
-
|
|
1429
|
+
chunkAL2KLPOJ_js.placeAudienceWindow(blankWin, placement);
|
|
1424
1430
|
}
|
|
1425
1431
|
return void 0;
|
|
1426
1432
|
});
|
|
@@ -1450,7 +1456,7 @@ function usePresenterWindow(input) {
|
|
|
1450
1456
|
}
|
|
1451
1457
|
};
|
|
1452
1458
|
if (content) {
|
|
1453
|
-
void
|
|
1459
|
+
void chunkAL2KLPOJ_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1454
1460
|
} else {
|
|
1455
1461
|
navigateOrClose(true);
|
|
1456
1462
|
}
|
|
@@ -1476,7 +1482,7 @@ function usePresenterWindow(input) {
|
|
|
1476
1482
|
}
|
|
1477
1483
|
const handleMessage = (event) => {
|
|
1478
1484
|
const message = event.data;
|
|
1479
|
-
if (
|
|
1485
|
+
if (chunkAL2KLPOJ_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1480
1486
|
syncStateToAudience(snapshotRef.current);
|
|
1481
1487
|
}
|
|
1482
1488
|
};
|
|
@@ -1505,7 +1511,7 @@ function usePresenterWindow(input) {
|
|
|
1505
1511
|
react.useEffect(() => {
|
|
1506
1512
|
const handleBeforeUnload = () => {
|
|
1507
1513
|
if (sessionIdRef.current) {
|
|
1508
|
-
void
|
|
1514
|
+
void chunkAL2KLPOJ_js.clearAudienceContent(sessionIdRef.current);
|
|
1509
1515
|
}
|
|
1510
1516
|
};
|
|
1511
1517
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1567,7 +1573,7 @@ function useAudienceMode(input) {
|
|
|
1567
1573
|
}
|
|
1568
1574
|
channel.onmessage = (event) => {
|
|
1569
1575
|
const data = event.data;
|
|
1570
|
-
if (!
|
|
1576
|
+
if (!chunkAL2KLPOJ_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1571
1577
|
return;
|
|
1572
1578
|
}
|
|
1573
1579
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1583,16 +1589,16 @@ function useAudienceMode(input) {
|
|
|
1583
1589
|
}
|
|
1584
1590
|
if (data.type === "presenter-exit") {
|
|
1585
1591
|
if (expectedSessionId) {
|
|
1586
|
-
void
|
|
1592
|
+
void chunkAL2KLPOJ_js.clearAudienceContent(expectedSessionId);
|
|
1587
1593
|
}
|
|
1588
|
-
if (
|
|
1594
|
+
if (chunkAL2KLPOJ_js.endAudienceDisplay(window)) {
|
|
1589
1595
|
handlers.onPresenterEnded?.();
|
|
1590
1596
|
}
|
|
1591
1597
|
}
|
|
1592
1598
|
};
|
|
1593
1599
|
if (expectedSessionId) {
|
|
1594
1600
|
channel.postMessage({
|
|
1595
|
-
origin:
|
|
1601
|
+
origin: chunkAL2KLPOJ_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1596
1602
|
type: "audience-ready",
|
|
1597
1603
|
sessionId: expectedSessionId
|
|
1598
1604
|
});
|
|
@@ -1606,7 +1612,7 @@ function useAudienceMode(input) {
|
|
|
1606
1612
|
}, []);
|
|
1607
1613
|
}
|
|
1608
1614
|
function usePresentationKeyboard(input) {
|
|
1609
|
-
const wheelBufferRef = react.useRef(
|
|
1615
|
+
const wheelBufferRef = react.useRef(chunkAL2KLPOJ_js.createWheelStepBuffer());
|
|
1610
1616
|
const {
|
|
1611
1617
|
mode,
|
|
1612
1618
|
movePresentationSlide,
|
|
@@ -1627,14 +1633,14 @@ function usePresentationKeyboard(input) {
|
|
|
1627
1633
|
presentationSlideIndex,
|
|
1628
1634
|
setShowRehearsalSummary
|
|
1629
1635
|
} = input;
|
|
1630
|
-
const keyBufferRef = react.useRef(
|
|
1636
|
+
const keyBufferRef = react.useRef(chunkAL2KLPOJ_js.createPresentationKeyBuffer());
|
|
1631
1637
|
react.useEffect(() => {
|
|
1632
|
-
if (mode !== "present" || !
|
|
1633
|
-
keyBufferRef.current =
|
|
1638
|
+
if (mode !== "present" || !chunkAL2KLPOJ_js.acceptsPresentationInput()) {
|
|
1639
|
+
keyBufferRef.current = chunkAL2KLPOJ_js.createPresentationKeyBuffer();
|
|
1634
1640
|
return;
|
|
1635
1641
|
}
|
|
1636
1642
|
const handleKeyDown = (event) => {
|
|
1637
|
-
const mapped =
|
|
1643
|
+
const mapped = chunkAL2KLPOJ_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1638
1644
|
if (mapped.action === "none") {
|
|
1639
1645
|
return;
|
|
1640
1646
|
}
|
|
@@ -1654,12 +1660,12 @@ function usePresentationKeyboard(input) {
|
|
|
1654
1660
|
movePresentationSlide(-1);
|
|
1655
1661
|
return;
|
|
1656
1662
|
case "first": {
|
|
1657
|
-
const first =
|
|
1663
|
+
const first = chunkAL2KLPOJ_js.firstShowSlideIndex(showSlideIndexes);
|
|
1658
1664
|
navigateToSlide(first ?? 0);
|
|
1659
1665
|
return;
|
|
1660
1666
|
}
|
|
1661
1667
|
case "last": {
|
|
1662
|
-
const last =
|
|
1668
|
+
const last = chunkAL2KLPOJ_js.lastShowSlideIndex(showSlideIndexes);
|
|
1663
1669
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1664
1670
|
return;
|
|
1665
1671
|
}
|
|
@@ -1697,10 +1703,10 @@ function usePresentationKeyboard(input) {
|
|
|
1697
1703
|
}
|
|
1698
1704
|
};
|
|
1699
1705
|
const handleWheel = (event) => {
|
|
1700
|
-
if (mode !== "present" || !
|
|
1706
|
+
if (mode !== "present" || !chunkAL2KLPOJ_js.acceptsPresentationInput()) {
|
|
1701
1707
|
return;
|
|
1702
1708
|
}
|
|
1703
|
-
const mapped =
|
|
1709
|
+
const mapped = chunkAL2KLPOJ_js.mapPresentationWheel(event, wheelBufferRef.current);
|
|
1704
1710
|
if (mapped.intent === "next-slide") {
|
|
1705
1711
|
event.preventDefault();
|
|
1706
1712
|
movePresentationSlide(1);
|
|
@@ -1833,7 +1839,7 @@ function useRehearsalTimings(input) {
|
|
|
1833
1839
|
|
|
1834
1840
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1835
1841
|
function handlePresentationActionImpl(action, deps) {
|
|
1836
|
-
|
|
1842
|
+
chunkAL2KLPOJ_js.runPresentationAction(
|
|
1837
1843
|
action,
|
|
1838
1844
|
{ slideCount: deps.slidesLength, ...deps.elementId ? { elementId: deps.elementId } : {} },
|
|
1839
1845
|
{
|
|
@@ -1861,16 +1867,19 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1861
1867
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1862
1868
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1863
1869
|
const transition = deps.reverse ? deps.slides[deps.currentSlideIndex]?.transition : incomingSlide?.transition;
|
|
1864
|
-
const durationMs = deps.playTransition ?
|
|
1870
|
+
const durationMs = deps.playTransition ? chunkAL2KLPOJ_js.resolveTransitionDurationMs(transition) : 0;
|
|
1865
1871
|
deps.clearPresentationTimers();
|
|
1866
1872
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1867
1873
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
1868
1874
|
deps.setPresentationSlideVisible(true);
|
|
1869
1875
|
deps.seedSlideAnimations(nextSlideIndex, { completed: deps.seedCompleted });
|
|
1876
|
+
const soundAction = chunkAL2KLPOJ_js.resolveTransitionSoundAction(transition);
|
|
1877
|
+
if (soundAction.kind === "play" && deps.onPlayActionSound) {
|
|
1878
|
+
deps.onPlayActionSound(soundAction.soundPath, { loop: soundAction.loop });
|
|
1879
|
+
} else if (soundAction.kind === "stop" && deps.onStopActionSound) {
|
|
1880
|
+
deps.onStopActionSound();
|
|
1881
|
+
}
|
|
1870
1882
|
if (durationMs > 0 && transition) {
|
|
1871
|
-
if (transition.soundPath && deps.onPlayActionSound) {
|
|
1872
|
-
deps.onPlayActionSound(transition.soundPath, { loop: transition.soundLoop === true });
|
|
1873
|
-
}
|
|
1874
1883
|
deps.setTransitionOverlay({
|
|
1875
1884
|
outgoingSlideIndex: deps.currentSlideIndex,
|
|
1876
1885
|
incomingSlideIndex: nextSlideIndex,
|
|
@@ -1904,6 +1913,7 @@ function useSlideNavigation(input) {
|
|
|
1904
1913
|
onSetMode,
|
|
1905
1914
|
onSetActiveSlideIndex,
|
|
1906
1915
|
onPlayActionSound,
|
|
1916
|
+
onStopActionSound,
|
|
1907
1917
|
loopContinuously,
|
|
1908
1918
|
useTimings,
|
|
1909
1919
|
onAdvancePastLastSlide,
|
|
@@ -1926,7 +1936,7 @@ function useSlideNavigation(input) {
|
|
|
1926
1936
|
});
|
|
1927
1937
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
1928
1938
|
(slideIndex) => {
|
|
1929
|
-
const delayMs =
|
|
1939
|
+
const delayMs = chunkAL2KLPOJ_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
1930
1940
|
if (delayMs === void 0) {
|
|
1931
1941
|
return;
|
|
1932
1942
|
}
|
|
@@ -1949,7 +1959,7 @@ function useSlideNavigation(input) {
|
|
|
1949
1959
|
if (availableSlideIndexes.length === 0) {
|
|
1950
1960
|
return;
|
|
1951
1961
|
}
|
|
1952
|
-
const pastLastSlide = direction === 1 && !
|
|
1962
|
+
const pastLastSlide = direction === 1 && !chunkAL2KLPOJ_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
1953
1963
|
if (rehearsing && pastLastSlide) {
|
|
1954
1964
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
1955
1965
|
try {
|
|
@@ -1967,9 +1977,9 @@ function useSlideNavigation(input) {
|
|
|
1967
1977
|
onAdvancePastLastSlide();
|
|
1968
1978
|
return;
|
|
1969
1979
|
}
|
|
1970
|
-
const nextSlideIndex = direction === 1 ?
|
|
1980
|
+
const nextSlideIndex = direction === 1 ? chunkAL2KLPOJ_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
1971
1981
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
1972
|
-
}) :
|
|
1982
|
+
}) : chunkAL2KLPOJ_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
1973
1983
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
1974
1984
|
return;
|
|
1975
1985
|
}
|
|
@@ -1980,6 +1990,7 @@ function useSlideNavigation(input) {
|
|
|
1980
1990
|
slides,
|
|
1981
1991
|
currentSlideIndex: presentationSlideIndex,
|
|
1982
1992
|
onPlayActionSound,
|
|
1993
|
+
onStopActionSound,
|
|
1983
1994
|
setPresentationSlideVisible,
|
|
1984
1995
|
clearPresentationTimers,
|
|
1985
1996
|
setPresentationSlideIndex,
|
|
@@ -2003,6 +2014,7 @@ function useSlideNavigation(input) {
|
|
|
2003
2014
|
loopContinuously,
|
|
2004
2015
|
onAdvancePastLastSlide,
|
|
2005
2016
|
onPlayActionSound,
|
|
2017
|
+
onStopActionSound,
|
|
2006
2018
|
onSetActiveSlideIndex,
|
|
2007
2019
|
onSetMode,
|
|
2008
2020
|
playNextAnimationGroup,
|
|
@@ -2034,6 +2046,7 @@ function useSlideNavigation(input) {
|
|
|
2034
2046
|
slides,
|
|
2035
2047
|
currentSlideIndex: presentationSlideIndex,
|
|
2036
2048
|
onPlayActionSound,
|
|
2049
|
+
onStopActionSound,
|
|
2037
2050
|
setPresentationSlideVisible,
|
|
2038
2051
|
clearPresentationTimers,
|
|
2039
2052
|
setPresentationSlideIndex,
|
|
@@ -2056,6 +2069,7 @@ function useSlideNavigation(input) {
|
|
|
2056
2069
|
[
|
|
2057
2070
|
clearPresentationTimers,
|
|
2058
2071
|
onPlayActionSound,
|
|
2072
|
+
onStopActionSound,
|
|
2059
2073
|
onSetActiveSlideIndex,
|
|
2060
2074
|
presentationSlideIndex,
|
|
2061
2075
|
presentationTimersRef,
|
|
@@ -2144,7 +2158,7 @@ function createCustomShowRunner(deps) {
|
|
|
2144
2158
|
return;
|
|
2145
2159
|
}
|
|
2146
2160
|
origin = returnAfter ? { showId: deps.getActiveCustomShowId(), slideIndex: deps.getPresentationSlideIndex() } : null;
|
|
2147
|
-
const first =
|
|
2161
|
+
const first = chunkAL2KLPOJ_js.firstShowSlideIndex(chunkAL2KLPOJ_js.resolveShowSlideIndexes(deps.getSlides(), target));
|
|
2148
2162
|
deps.setActiveCustomShowId(customShowId);
|
|
2149
2163
|
if (first !== void 0) {
|
|
2150
2164
|
deps.navigateToSlide(first);
|
|
@@ -2221,22 +2235,22 @@ function usePresentationActionExtensions(input) {
|
|
|
2221
2235
|
}
|
|
2222
2236
|
}, [navigateToSlideViaRef]);
|
|
2223
2237
|
const onOpenFile = react.useCallback((target) => {
|
|
2224
|
-
|
|
2238
|
+
chunkAL2KLPOJ_js.safeOpenUrl(target);
|
|
2225
2239
|
}, []);
|
|
2226
2240
|
const onOpenPresentation = react.useCallback((target) => {
|
|
2227
|
-
|
|
2241
|
+
chunkAL2KLPOJ_js.safeOpenUrl(target);
|
|
2228
2242
|
}, []);
|
|
2229
2243
|
const onPlayMedia = react.useCallback(
|
|
2230
2244
|
(elementId) => {
|
|
2231
|
-
|
|
2245
|
+
chunkAL2KLPOJ_js.toggleStageElementMedia(containerRef.current, elementId);
|
|
2232
2246
|
},
|
|
2233
2247
|
[containerRef]
|
|
2234
2248
|
);
|
|
2235
2249
|
const onOleVerb = react.useCallback(
|
|
2236
2250
|
(verb, elementId) => {
|
|
2237
|
-
const target =
|
|
2251
|
+
const target = chunkAL2KLPOJ_js.resolveOleVerbTarget(slides[presentationSlideIndex], elementId, verb);
|
|
2238
2252
|
if (target) {
|
|
2239
|
-
|
|
2253
|
+
chunkAL2KLPOJ_js.openUrlInNewTab(target.url);
|
|
2240
2254
|
}
|
|
2241
2255
|
},
|
|
2242
2256
|
[slides, presentationSlideIndex]
|
|
@@ -2266,22 +2280,22 @@ function usePresentationActionExtensions(input) {
|
|
|
2266
2280
|
};
|
|
2267
2281
|
}
|
|
2268
2282
|
function usePresenterConsole(slideIndex, active) {
|
|
2269
|
-
const timerRef = react.useRef(
|
|
2270
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2283
|
+
const timerRef = react.useRef(chunkAL2KLPOJ_js.createPresenterTimer());
|
|
2284
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkAL2KLPOJ_js.createInitialPresentationSnapshot(slideIndex));
|
|
2271
2285
|
const patch = react.useCallback((value) => {
|
|
2272
|
-
setSnapshot((current) =>
|
|
2286
|
+
setSnapshot((current) => chunkAL2KLPOJ_js.mergePresentationSnapshot(current, value));
|
|
2273
2287
|
}, []);
|
|
2274
2288
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2275
2289
|
react.useEffect(() => {
|
|
2276
2290
|
if (!active) {
|
|
2277
2291
|
return;
|
|
2278
2292
|
}
|
|
2279
|
-
timerRef.current =
|
|
2293
|
+
timerRef.current = chunkAL2KLPOJ_js.resetPresenterTimer();
|
|
2280
2294
|
patch({ paused: false, elapsedMs: 0 });
|
|
2281
2295
|
const timer = window.setInterval(() => {
|
|
2282
2296
|
patch({
|
|
2283
2297
|
paused: timerRef.current.paused,
|
|
2284
|
-
elapsedMs:
|
|
2298
|
+
elapsedMs: chunkAL2KLPOJ_js.presenterElapsed(timerRef.current)
|
|
2285
2299
|
});
|
|
2286
2300
|
}, 1e3);
|
|
2287
2301
|
return () => window.clearInterval(timer);
|
|
@@ -2291,19 +2305,19 @@ function usePresenterConsole(slideIndex, active) {
|
|
|
2291
2305
|
applyAudienceSnapshot: setSnapshot,
|
|
2292
2306
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2293
2307
|
toggleTimer: () => {
|
|
2294
|
-
timerRef.current =
|
|
2308
|
+
timerRef.current = chunkAL2KLPOJ_js.togglePresenterTimer(timerRef.current);
|
|
2295
2309
|
patch({
|
|
2296
2310
|
paused: timerRef.current.paused,
|
|
2297
|
-
elapsedMs:
|
|
2311
|
+
elapsedMs: chunkAL2KLPOJ_js.presenterElapsed(timerRef.current)
|
|
2298
2312
|
});
|
|
2299
2313
|
},
|
|
2300
2314
|
resetTimer: () => {
|
|
2301
|
-
timerRef.current =
|
|
2315
|
+
timerRef.current = chunkAL2KLPOJ_js.resetPresenterTimer();
|
|
2302
2316
|
patch({ paused: false, elapsedMs: 0 });
|
|
2303
2317
|
},
|
|
2304
2318
|
stepZoom: (direction) => setSnapshot(
|
|
2305
|
-
(current) =>
|
|
2306
|
-
zoom:
|
|
2319
|
+
(current) => chunkAL2KLPOJ_js.mergePresentationSnapshot(current, {
|
|
2320
|
+
zoom: chunkAL2KLPOJ_js.stepPresenterZoom(
|
|
2307
2321
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2308
2322
|
direction
|
|
2309
2323
|
)
|
|
@@ -2329,6 +2343,7 @@ function usePresentationMode(input) {
|
|
|
2329
2343
|
onSetMode,
|
|
2330
2344
|
onSetActiveSlideIndex,
|
|
2331
2345
|
onPlayActionSound,
|
|
2346
|
+
onStopActionSound,
|
|
2332
2347
|
onSetPointerTool,
|
|
2333
2348
|
onEraseAnnotations,
|
|
2334
2349
|
onToggleInkMarkup,
|
|
@@ -2353,7 +2368,7 @@ function usePresentationMode(input) {
|
|
|
2353
2368
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2354
2369
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2355
2370
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2356
|
-
const showGuard = react.useMemo(() =>
|
|
2371
|
+
const showGuard = react.useMemo(() => chunkAL2KLPOJ_js.createPresenterShowGuard(), []);
|
|
2357
2372
|
const {
|
|
2358
2373
|
presentationAnimations,
|
|
2359
2374
|
presentationElementStates,
|
|
@@ -2422,6 +2437,7 @@ function usePresentationMode(input) {
|
|
|
2422
2437
|
onSetMode,
|
|
2423
2438
|
onSetActiveSlideIndex,
|
|
2424
2439
|
onPlayActionSound,
|
|
2440
|
+
onStopActionSound,
|
|
2425
2441
|
loopContinuously,
|
|
2426
2442
|
useTimings,
|
|
2427
2443
|
onAdvancePastLastSlide: actionExtensions.handleAdvancePastLastSlide,
|
|
@@ -2443,7 +2459,7 @@ function usePresentationMode(input) {
|
|
|
2443
2459
|
actionExtensions.bindNavigateToSlide(navigateToSlide);
|
|
2444
2460
|
const movePresentationSlide = react.useCallback(
|
|
2445
2461
|
(direction, trigger = "explicit") => {
|
|
2446
|
-
if (!
|
|
2462
|
+
if (!chunkAL2KLPOJ_js.acceptsPresentationInput()) {
|
|
2447
2463
|
return;
|
|
2448
2464
|
}
|
|
2449
2465
|
if (endOfShowVisible) {
|
|
@@ -2512,7 +2528,7 @@ function usePresentationMode(input) {
|
|
|
2512
2528
|
onSetMode("present");
|
|
2513
2529
|
}, [containerRef, onSetMode, setRehearsing]);
|
|
2514
2530
|
const enterPresentModeFromBeginning = react.useCallback(() => {
|
|
2515
|
-
const first =
|
|
2531
|
+
const first = chunkAL2KLPOJ_js.firstShowSlideIndex(visibleSlideIndexes);
|
|
2516
2532
|
if (first !== void 0) {
|
|
2517
2533
|
onSetActiveSlideIndex(first);
|
|
2518
2534
|
}
|
|
@@ -2592,7 +2608,7 @@ function usePresentationMode(input) {
|
|
|
2592
2608
|
if (mode !== "present") {
|
|
2593
2609
|
return;
|
|
2594
2610
|
}
|
|
2595
|
-
return
|
|
2611
|
+
return chunkAL2KLPOJ_js.attachPresentationVisibilityPause({
|
|
2596
2612
|
root: containerRef.current ?? void 0,
|
|
2597
2613
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2598
2614
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
@@ -2600,7 +2616,7 @@ function usePresentationMode(input) {
|
|
|
2600
2616
|
}, [mode, containerRef]);
|
|
2601
2617
|
react.useLayoutEffect(() => {
|
|
2602
2618
|
if (mode === "present") {
|
|
2603
|
-
const idx =
|
|
2619
|
+
const idx = chunkAL2KLPOJ_js.presentationEntrySlideIndex(
|
|
2604
2620
|
activeSlideIndexRef.current,
|
|
2605
2621
|
visibleSlideIndexesRef.current
|
|
2606
2622
|
);
|
|
@@ -2679,11 +2695,11 @@ function usePresentationMode(input) {
|
|
|
2679
2695
|
return void 0;
|
|
2680
2696
|
}
|
|
2681
2697
|
const incoming = slides[transitionOverlay.incomingSlideIndex];
|
|
2682
|
-
return
|
|
2698
|
+
return chunkAL2KLPOJ_js.buildMorphTransitionPlan(
|
|
2683
2699
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2684
2700
|
incoming,
|
|
2685
2701
|
transitionOverlay.durationMs,
|
|
2686
|
-
|
|
2702
|
+
chunkAL2KLPOJ_js.morphOptionToMode(transitionOverlay.transition.morphOption),
|
|
2687
2703
|
// `PresentationStage` stacks the incoming slide's elements above its
|
|
2688
2704
|
// template shapes (`zIndex = templateElements.length + index`), so a
|
|
2689
2705
|
// z-index journey has to start counting where the stage does.
|
|
@@ -2708,7 +2724,7 @@ function usePresentationMode(input) {
|
|
|
2708
2724
|
if (!morphPlan) {
|
|
2709
2725
|
return presentationKeyframesCss;
|
|
2710
2726
|
}
|
|
2711
|
-
const imageRules =
|
|
2727
|
+
const imageRules = chunkAL2KLPOJ_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
|
|
2712
2728
|
return `${presentationKeyframesCss ?? ""}
|
|
2713
2729
|
${morphPlan.keyframesCss}
|
|
2714
2730
|
${imageRules}`;
|
|
@@ -3005,7 +3021,7 @@ function useFindReplace({
|
|
|
3005
3021
|
const [findResults, setFindResults] = react.useState([]);
|
|
3006
3022
|
const [findResultIndex, setFindResultIndex] = react.useState(-1);
|
|
3007
3023
|
const performFind = react.useCallback(() => {
|
|
3008
|
-
const results =
|
|
3024
|
+
const results = chunkAL2KLPOJ_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
|
|
3009
3025
|
if (!findQuery) {
|
|
3010
3026
|
setFindResults([]);
|
|
3011
3027
|
setFindResultIndex(-1);
|
|
@@ -3039,7 +3055,7 @@ function useFindReplace({
|
|
|
3039
3055
|
return;
|
|
3040
3056
|
}
|
|
3041
3057
|
onUpdateSlides(
|
|
3042
|
-
(prevSlides) =>
|
|
3058
|
+
(prevSlides) => chunkAL2KLPOJ_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
|
|
3043
3059
|
);
|
|
3044
3060
|
onMarkDirty();
|
|
3045
3061
|
},
|
|
@@ -3061,9 +3077,9 @@ function useFindReplace({
|
|
|
3061
3077
|
}, [findResults, applyReplacements, performFind]);
|
|
3062
3078
|
react.useEffect(() => {
|
|
3063
3079
|
const handler = (event) => {
|
|
3064
|
-
const { action } =
|
|
3080
|
+
const { action } = chunkAL2KLPOJ_js.mapEditorKey(event, {
|
|
3065
3081
|
canEdit: mode === "edit",
|
|
3066
|
-
isTextInputTarget:
|
|
3082
|
+
isTextInputTarget: chunkAL2KLPOJ_js.isEditorTextInputTarget(event.target)
|
|
3067
3083
|
});
|
|
3068
3084
|
if (action !== "find") {
|
|
3069
3085
|
return;
|
|
@@ -3174,7 +3190,7 @@ function addCommentToSlide(slides, slideIndex, text, authorName, elementId, ment
|
|
|
3174
3190
|
if (!slide) {
|
|
3175
3191
|
return { slides, didAdd: false };
|
|
3176
3192
|
}
|
|
3177
|
-
const next =
|
|
3193
|
+
const next = chunkAL2KLPOJ_js.addCommentToList(
|
|
3178
3194
|
slide.comments || [],
|
|
3179
3195
|
text,
|
|
3180
3196
|
authorName,
|
|
@@ -3195,7 +3211,7 @@ function removeCommentFromSlide(slides, slideIndex, commentId) {
|
|
|
3195
3211
|
if (!slide) {
|
|
3196
3212
|
return { slides, didDelete: false };
|
|
3197
3213
|
}
|
|
3198
|
-
const next =
|
|
3214
|
+
const next = chunkAL2KLPOJ_js.removeCommentFromList(slide.comments || [], commentId);
|
|
3199
3215
|
if (!next) {
|
|
3200
3216
|
return { slides, didDelete: false };
|
|
3201
3217
|
}
|
|
@@ -3206,7 +3222,7 @@ function editCommentInSlide(slides, slideIndex, commentId, newText) {
|
|
|
3206
3222
|
if (!slide) {
|
|
3207
3223
|
return { slides, didUpdate: false };
|
|
3208
3224
|
}
|
|
3209
|
-
const next =
|
|
3225
|
+
const next = chunkAL2KLPOJ_js.editCommentInList(slide.comments || [], commentId, newText);
|
|
3210
3226
|
if (!next) {
|
|
3211
3227
|
return { slides, didUpdate: false };
|
|
3212
3228
|
}
|
|
@@ -3217,7 +3233,7 @@ function toggleResolvedInSlide(slides, slideIndex, commentId) {
|
|
|
3217
3233
|
if (!slide) {
|
|
3218
3234
|
return { slides, didUpdate: false };
|
|
3219
3235
|
}
|
|
3220
|
-
const next =
|
|
3236
|
+
const next = chunkAL2KLPOJ_js.toggleCommentResolvedInList(slide.comments || [], commentId);
|
|
3221
3237
|
if (!next) {
|
|
3222
3238
|
return { slides, didUpdate: false };
|
|
3223
3239
|
}
|
|
@@ -3228,7 +3244,7 @@ function addReplyToSlide(slides, slideIndex, parentId, text, authorName, mention
|
|
|
3228
3244
|
if (!slide) {
|
|
3229
3245
|
return { slides, didAdd: false };
|
|
3230
3246
|
}
|
|
3231
|
-
const next =
|
|
3247
|
+
const next = chunkAL2KLPOJ_js.replyToCommentInList(slide.comments || [], parentId, text, authorName);
|
|
3232
3248
|
if (!next) {
|
|
3233
3249
|
return { slides, didAdd: false };
|
|
3234
3250
|
}
|
|
@@ -3615,7 +3631,7 @@ function useDerivedElementState(input) {
|
|
|
3615
3631
|
return [];
|
|
3616
3632
|
}
|
|
3617
3633
|
return [
|
|
3618
|
-
...
|
|
3634
|
+
...chunkAL2KLPOJ_js.visibleTemplateElements(activeSlide, templateElementsBySlideId[activeSlide.id] ?? [])
|
|
3619
3635
|
];
|
|
3620
3636
|
}, [activeSlide, templateElementsBySlideId]);
|
|
3621
3637
|
const activeMaster = slideMasters[activeMasterIndex];
|
|
@@ -3682,7 +3698,7 @@ function useViewerCoreState(_input) {
|
|
|
3682
3698
|
const marqueeStateRef = react.useRef(null);
|
|
3683
3699
|
const isDrawingRef = react.useRef(false);
|
|
3684
3700
|
const justInteractedRef = react.useRef(false);
|
|
3685
|
-
const livePatcher = react.useMemo(() =>
|
|
3701
|
+
const livePatcher = react.useMemo(() => chunkAL2KLPOJ_js.createCollaborationLivePatcher(), []);
|
|
3686
3702
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3687
3703
|
const slidesRef = react.useRef([]);
|
|
3688
3704
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3691,8 +3707,8 @@ function useViewerCoreState(_input) {
|
|
|
3691
3707
|
const [slides, setSlides] = react.useState([]);
|
|
3692
3708
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3693
3709
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3694
|
-
width:
|
|
3695
|
-
height:
|
|
3710
|
+
width: chunk7VPDHSWF_js.DEFAULT_CANVAS_WIDTH,
|
|
3711
|
+
height: chunk7VPDHSWF_js.DEFAULT_CANVAS_HEIGHT
|
|
3696
3712
|
});
|
|
3697
3713
|
const [slideSizeEmu, setSlideSizeEmu] = react.useState();
|
|
3698
3714
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
@@ -3713,7 +3729,7 @@ function useViewerCoreState(_input) {
|
|
|
3713
3729
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3714
3730
|
inlineEditingTextRef.current = resolved;
|
|
3715
3731
|
setInlineEditingTextBase(value);
|
|
3716
|
-
|
|
3732
|
+
chunkAL2KLPOJ_js.publishLiveInlineText(
|
|
3717
3733
|
livePatcher,
|
|
3718
3734
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3719
3735
|
inlineEditingElementIdRef.current,
|
|
@@ -4067,7 +4083,7 @@ function useLoadContent({
|
|
|
4067
4083
|
);
|
|
4068
4084
|
}
|
|
4069
4085
|
const previousHandler = handlerRef.current;
|
|
4070
|
-
const handler = new
|
|
4086
|
+
const handler = new chunkAL2KLPOJ_js.PptxHandler();
|
|
4071
4087
|
const parsed = await handler.load(buffer, { allowExternalImages });
|
|
4072
4088
|
if (cancelled || token !== renderTokenRef.current) {
|
|
4073
4089
|
handler.dispose();
|
|
@@ -4079,7 +4095,7 @@ function useLoadContent({
|
|
|
4079
4095
|
handlerRef.current = null;
|
|
4080
4096
|
const mediaElements = [];
|
|
4081
4097
|
for (const slide of parsed.slides) {
|
|
4082
|
-
|
|
4098
|
+
chunkAL2KLPOJ_js.collectMediaElements(slide.elements, mediaElements);
|
|
4083
4099
|
}
|
|
4084
4100
|
for (const url of mediaDataUrls.values()) {
|
|
4085
4101
|
if (url.startsWith("blob:")) {
|
|
@@ -4089,38 +4105,18 @@ function useLoadContent({
|
|
|
4089
4105
|
mediaDataUrls.clear();
|
|
4090
4106
|
await Promise.all(
|
|
4091
4107
|
mediaElements.map(async (mediaElement) => {
|
|
4092
|
-
const
|
|
4093
|
-
if (!mediaPath) {
|
|
4108
|
+
const resolved = await chunkAL2KLPOJ_js.resolveMediaElementSource(mediaElement, handler);
|
|
4109
|
+
if (resolved.missing || !resolved.mediaPath || !resolved.url) {
|
|
4094
4110
|
mediaElement.mediaMissing = true;
|
|
4095
4111
|
return;
|
|
4096
4112
|
}
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
const arrayBuffer = await handler.getMediaArrayBuffer(mediaPath);
|
|
4101
|
-
if (arrayBuffer) {
|
|
4102
|
-
const mimeType = mediaElement.mediaMimeType || "application/octet-stream";
|
|
4103
|
-
const blob = new Blob([arrayBuffer], { type: mimeType });
|
|
4104
|
-
const blobUrl = URL.createObjectURL(blob);
|
|
4105
|
-
loadBlobUrls.push(blobUrl);
|
|
4106
|
-
mediaDataUrls.set(mediaPath, blobUrl);
|
|
4107
|
-
} else {
|
|
4108
|
-
mediaElement.mediaMissing = true;
|
|
4109
|
-
}
|
|
4110
|
-
} else {
|
|
4111
|
-
const dataUrl = await handler.getImageData(mediaPath);
|
|
4112
|
-
if (dataUrl) {
|
|
4113
|
-
mediaDataUrls.set(mediaPath, dataUrl);
|
|
4114
|
-
} else {
|
|
4115
|
-
mediaElement.mediaMissing = true;
|
|
4116
|
-
}
|
|
4117
|
-
}
|
|
4118
|
-
} catch {
|
|
4119
|
-
mediaElement.mediaMissing = true;
|
|
4113
|
+
mediaDataUrls.set(resolved.mediaPath, resolved.url);
|
|
4114
|
+
if (resolved.isBlobUrl) {
|
|
4115
|
+
loadBlobUrls.push(resolved.url);
|
|
4120
4116
|
}
|
|
4121
4117
|
})
|
|
4122
4118
|
);
|
|
4123
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
4119
|
+
const { paths: imagePaths, refs: imageRefs } = chunkAL2KLPOJ_js.collectImagePaths(parsed.slides);
|
|
4124
4120
|
let nextSlides = parsed.slides;
|
|
4125
4121
|
if (imagePaths.size > 0) {
|
|
4126
4122
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -4136,25 +4132,25 @@ function useLoadContent({
|
|
|
4136
4132
|
})
|
|
4137
4133
|
);
|
|
4138
4134
|
nextSlides = parsed.slides.map((s) => {
|
|
4139
|
-
const newElements =
|
|
4135
|
+
const newElements = chunkAL2KLPOJ_js.applyImagePathPatches(s.elements, resolvedMap, imageRefs);
|
|
4140
4136
|
return newElements === s.elements ? s : { ...s, elements: newElements };
|
|
4141
4137
|
});
|
|
4142
4138
|
}
|
|
4143
|
-
nextSlides = await
|
|
4139
|
+
nextSlides = await chunkAL2KLPOJ_js.resolveTableCellImageUrls(
|
|
4144
4140
|
nextSlides,
|
|
4145
4141
|
(path) => handler.getImageData(path)
|
|
4146
4142
|
);
|
|
4147
|
-
const nextTableStyleMap = await
|
|
4143
|
+
const nextTableStyleMap = await chunkAL2KLPOJ_js.resolveTableStyleImageUrls(
|
|
4148
4144
|
parsed.tableStyleMap,
|
|
4149
4145
|
(path) => handler.getImageData(path)
|
|
4150
4146
|
);
|
|
4151
4147
|
handlerRef.current = handler;
|
|
4152
|
-
const partition =
|
|
4148
|
+
const partition = chunkAL2KLPOJ_js.partitionTemplateElements(nextSlides);
|
|
4153
4149
|
setSlides(partition.slides);
|
|
4154
4150
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
4155
4151
|
setCanvasSize({
|
|
4156
|
-
width: parsed.width ??
|
|
4157
|
-
height: parsed.height ??
|
|
4152
|
+
width: parsed.width ?? chunk7VPDHSWF_js.DEFAULT_CANVAS_WIDTH,
|
|
4153
|
+
height: parsed.height ?? chunk7VPDHSWF_js.DEFAULT_CANVAS_HEIGHT
|
|
4158
4154
|
});
|
|
4159
4155
|
setSlideSizeEmu(
|
|
4160
4156
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -4167,13 +4163,13 @@ function useLoadContent({
|
|
|
4167
4163
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
4168
4164
|
setSlideMasters(parsed.slideMasters ?? []);
|
|
4169
4165
|
setModernCommentAuthors(parsed.modernCommentAuthors ?? []);
|
|
4170
|
-
setRecentColors(
|
|
4166
|
+
setRecentColors(chunkAL2KLPOJ_js.seedRecentColors({ mruColors: parsed.mruColors }));
|
|
4171
4167
|
setTheme(parsed.theme);
|
|
4172
4168
|
setTableStyleMap(nextTableStyleMap);
|
|
4173
4169
|
setThemeOptions(parsed.themeOptions ?? []);
|
|
4174
4170
|
setCustomShows(parsed.customShows ?? []);
|
|
4175
4171
|
setActiveCustomShowId(
|
|
4176
|
-
|
|
4172
|
+
chunkAL2KLPOJ_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
|
|
4177
4173
|
);
|
|
4178
4174
|
setSections(parsed.sections ?? []);
|
|
4179
4175
|
setPresentationProperties(parsed.presentationProperties ?? {});
|
|
@@ -4196,10 +4192,10 @@ function useLoadContent({
|
|
|
4196
4192
|
setHasMacros(parsed.hasMacros === true);
|
|
4197
4193
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
4198
4194
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
4199
|
-
setGuides(
|
|
4200
|
-
setReadOnlyRecommendation(
|
|
4195
|
+
setGuides(chunkAL2KLPOJ_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
4196
|
+
setReadOnlyRecommendation(chunkAL2KLPOJ_js.readOnlyRecommendation(parsed));
|
|
4201
4197
|
setCompatToasts(
|
|
4202
|
-
|
|
4198
|
+
chunkAL2KLPOJ_js.compatibilityWarningToasts([
|
|
4203
4199
|
...parsed.warnings ?? [],
|
|
4204
4200
|
...parsed.slides.flatMap((slide) => slide.warnings ?? [])
|
|
4205
4201
|
])
|
|
@@ -4211,7 +4207,7 @@ function useLoadContent({
|
|
|
4211
4207
|
onContentApplied?.();
|
|
4212
4208
|
} catch (err) {
|
|
4213
4209
|
if (!cancelled && token === renderTokenRef.current) {
|
|
4214
|
-
if (err instanceof
|
|
4210
|
+
if (err instanceof chunkAL2KLPOJ_js.EncryptedFileError) {
|
|
4215
4211
|
setIsEncrypted(true);
|
|
4216
4212
|
} else {
|
|
4217
4213
|
console.error("[pptx] Failed to load presentation content:", err);
|
|
@@ -4239,7 +4235,7 @@ function useLoadContent({
|
|
|
4239
4235
|
}
|
|
4240
4236
|
function useAutosave(input) {
|
|
4241
4237
|
const { isDirty, filePath, serializeSlides, enabled = true, getChangeSources } = input;
|
|
4242
|
-
const intervalMs =
|
|
4238
|
+
const intervalMs = chunkAL2KLPOJ_js.resolveAutosaveIntervalMs({
|
|
4243
4239
|
hostIntervalMs: input.intervalMs,
|
|
4244
4240
|
optionsIntervalSeconds: input.intervalSeconds
|
|
4245
4241
|
});
|
|
@@ -4270,7 +4266,7 @@ function useAutosave(input) {
|
|
|
4270
4266
|
return;
|
|
4271
4267
|
}
|
|
4272
4268
|
const sources = changeSourcesRef.current?.() ?? [];
|
|
4273
|
-
if (!
|
|
4269
|
+
if (!chunkAL2KLPOJ_js.shouldWriteAutosaveSnapshot({
|
|
4274
4270
|
filePath: path,
|
|
4275
4271
|
isDirty: isDirtyRef.current,
|
|
4276
4272
|
saving: isSavingRef.current,
|
|
@@ -4288,8 +4284,8 @@ function useAutosave(input) {
|
|
|
4288
4284
|
isSavingRef.current = false;
|
|
4289
4285
|
return;
|
|
4290
4286
|
}
|
|
4291
|
-
await
|
|
4292
|
-
lastSnapshotRef.current =
|
|
4287
|
+
await chunkAL2KLPOJ_js.saveAutosaveSnapshot(path, data);
|
|
4288
|
+
lastSnapshotRef.current = chunkAL2KLPOJ_js.autosaveSnapshotMark(path, sources);
|
|
4293
4289
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4294
4290
|
} catch (err) {
|
|
4295
4291
|
setAutosaveStatus({
|
|
@@ -4343,13 +4339,13 @@ function useElementOperations(input) {
|
|
|
4343
4339
|
inlineEditingText
|
|
4344
4340
|
} = input;
|
|
4345
4341
|
const liveTextSegments = react.useCallback(() => {
|
|
4346
|
-
if (!selectedElement || !
|
|
4342
|
+
if (!selectedElement || !chunkAL2KLPOJ_js.hasTextProperties(selectedElement)) {
|
|
4347
4343
|
return void 0;
|
|
4348
4344
|
}
|
|
4349
4345
|
if (selectedElement.id !== inlineEditingElementId) {
|
|
4350
4346
|
return selectedElement.textSegments;
|
|
4351
4347
|
}
|
|
4352
|
-
return
|
|
4348
|
+
return chunkAL2KLPOJ_js.remapTextToSegments(
|
|
4353
4349
|
inlineEditingText,
|
|
4354
4350
|
selectedElement.textSegments,
|
|
4355
4351
|
selectedElement.textStyle
|
|
@@ -4390,11 +4386,11 @@ function useElementOperations(input) {
|
|
|
4390
4386
|
(elementId, updates) => {
|
|
4391
4387
|
if (masterView?.target) {
|
|
4392
4388
|
applyMasterViewWrite(
|
|
4393
|
-
|
|
4389
|
+
chunkAL2KLPOJ_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
|
|
4394
4390
|
);
|
|
4395
4391
|
return;
|
|
4396
4392
|
}
|
|
4397
|
-
if (
|
|
4393
|
+
if (chunkAL2KLPOJ_js.isTemplateElementId(elementId)) {
|
|
4398
4394
|
const slideId = activeSlide?.id;
|
|
4399
4395
|
if (slideId) {
|
|
4400
4396
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4405,7 +4401,7 @@ function useElementOperations(input) {
|
|
|
4405
4401
|
}));
|
|
4406
4402
|
}
|
|
4407
4403
|
} else {
|
|
4408
|
-
setSlides((prev) =>
|
|
4404
|
+
setSlides((prev) => chunkAL2KLPOJ_js.updateElement(prev, activeSlideIndex, elementId, updates));
|
|
4409
4405
|
}
|
|
4410
4406
|
history.markDirty();
|
|
4411
4407
|
},
|
|
@@ -4430,7 +4426,7 @@ function useElementOperations(input) {
|
|
|
4430
4426
|
);
|
|
4431
4427
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4432
4428
|
(updates) => {
|
|
4433
|
-
if (!selectedElement || !
|
|
4429
|
+
if (!selectedElement || !chunkAL2KLPOJ_js.hasShapeProperties(selectedElement)) {
|
|
4434
4430
|
return;
|
|
4435
4431
|
}
|
|
4436
4432
|
updateSelectedElement({
|
|
@@ -4441,19 +4437,19 @@ function useElementOperations(input) {
|
|
|
4441
4437
|
);
|
|
4442
4438
|
const updateSelectedTextStyle = react.useCallback(
|
|
4443
4439
|
(updates) => {
|
|
4444
|
-
if (!selectedElement || !
|
|
4440
|
+
if (!selectedElement || !chunkAL2KLPOJ_js.hasTextProperties(selectedElement)) {
|
|
4445
4441
|
return;
|
|
4446
4442
|
}
|
|
4447
4443
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
4448
4444
|
const currentSegments = liveTextSegments();
|
|
4449
|
-
const inlineSel =
|
|
4445
|
+
const inlineSel = chunkAL2KLPOJ_js.getInlineEditorSelection(currentSegments);
|
|
4450
4446
|
if (inlineSel && currentSegments) {
|
|
4451
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4447
|
+
const { newSegments: newSegments2, newSelection } = chunkAL2KLPOJ_js.applyStyleToSelectedSegments(
|
|
4452
4448
|
currentSegments,
|
|
4453
4449
|
inlineSel,
|
|
4454
4450
|
updates
|
|
4455
4451
|
);
|
|
4456
|
-
|
|
4452
|
+
chunkAL2KLPOJ_js.setPendingSelectionRestore(newSelection);
|
|
4457
4453
|
updateSelectedElement({
|
|
4458
4454
|
textSegments: newSegments2,
|
|
4459
4455
|
...isLiveEditing ? { text: inlineEditingText } : {}
|
|
@@ -4481,14 +4477,14 @@ function useElementOperations(input) {
|
|
|
4481
4477
|
);
|
|
4482
4478
|
const updateSelectedTextCase = react.useCallback(
|
|
4483
4479
|
(mode) => {
|
|
4484
|
-
if (!selectedElement || !
|
|
4480
|
+
if (!selectedElement || !chunkAL2KLPOJ_js.hasTextProperties(selectedElement)) {
|
|
4485
4481
|
return;
|
|
4486
4482
|
}
|
|
4487
4483
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
4488
4484
|
const currentSegments = liveTextSegments();
|
|
4489
|
-
const inlineSel =
|
|
4485
|
+
const inlineSel = chunkAL2KLPOJ_js.getInlineEditorSelection(currentSegments);
|
|
4490
4486
|
if (inlineSel && currentSegments) {
|
|
4491
|
-
const newSegments =
|
|
4487
|
+
const newSegments = chunkAL2KLPOJ_js.applyCaseTransformToSegments(currentSegments, inlineSel, mode);
|
|
4492
4488
|
updateSelectedElement({
|
|
4493
4489
|
textSegments: newSegments,
|
|
4494
4490
|
...isLiveEditing ? { text: inlineEditingText } : {}
|
|
@@ -4497,7 +4493,7 @@ function useElementOperations(input) {
|
|
|
4497
4493
|
}
|
|
4498
4494
|
const updates = {};
|
|
4499
4495
|
if (currentSegments && currentSegments.length > 0) {
|
|
4500
|
-
updates.textSegments =
|
|
4496
|
+
updates.textSegments = chunkAL2KLPOJ_js.applyCaseTransformToSegments(
|
|
4501
4497
|
currentSegments,
|
|
4502
4498
|
null,
|
|
4503
4499
|
mode
|
|
@@ -4505,7 +4501,7 @@ function useElementOperations(input) {
|
|
|
4505
4501
|
}
|
|
4506
4502
|
const baseText = isLiveEditing ? inlineEditingText : selectedElement.text;
|
|
4507
4503
|
if (typeof baseText === "string") {
|
|
4508
|
-
updates.text =
|
|
4504
|
+
updates.text = chunkAL2KLPOJ_js.transformTextCase(baseText, mode);
|
|
4509
4505
|
}
|
|
4510
4506
|
updateSelectedElement(updates);
|
|
4511
4507
|
},
|
|
@@ -4524,15 +4520,15 @@ function useElementOperations(input) {
|
|
|
4524
4520
|
[setSlides]
|
|
4525
4521
|
);
|
|
4526
4522
|
const masterViewTarget = masterView?.target ?? null;
|
|
4527
|
-
const activeElements = masterViewTarget ?
|
|
4523
|
+
const activeElements = masterViewTarget ? chunkAL2KLPOJ_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4528
4524
|
const updateActiveElements = react.useCallback(
|
|
4529
4525
|
(updater) => {
|
|
4530
4526
|
if (masterView?.target) {
|
|
4531
4527
|
applyMasterViewWrite(
|
|
4532
|
-
|
|
4528
|
+
chunkAL2KLPOJ_js.replaceMasterViewElements(
|
|
4533
4529
|
masterView,
|
|
4534
4530
|
masterView.target,
|
|
4535
|
-
updater(
|
|
4531
|
+
updater(chunkAL2KLPOJ_js.masterViewElements(masterView, masterView.target))
|
|
4536
4532
|
)
|
|
4537
4533
|
);
|
|
4538
4534
|
return;
|
|
@@ -4585,7 +4581,7 @@ function useSectionOperations(input) {
|
|
|
4585
4581
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4586
4582
|
const addSection2 = react.useCallback(
|
|
4587
4583
|
(name, afterSlideIndex) => {
|
|
4588
|
-
const result =
|
|
4584
|
+
const result = chunkAL2KLPOJ_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4589
4585
|
setSlides(result.slides);
|
|
4590
4586
|
setSections(result.sections);
|
|
4591
4587
|
markDirty();
|
|
@@ -4594,7 +4590,7 @@ function useSectionOperations(input) {
|
|
|
4594
4590
|
);
|
|
4595
4591
|
const renameSection2 = react.useCallback(
|
|
4596
4592
|
(sectionId, newName) => {
|
|
4597
|
-
const result =
|
|
4593
|
+
const result = chunkAL2KLPOJ_js.renameSection(sections, slides, sectionId, newName);
|
|
4598
4594
|
setSections(result.sections);
|
|
4599
4595
|
setSlides(result.slides);
|
|
4600
4596
|
markDirty();
|
|
@@ -4603,7 +4599,7 @@ function useSectionOperations(input) {
|
|
|
4603
4599
|
);
|
|
4604
4600
|
const deleteSection2 = react.useCallback(
|
|
4605
4601
|
(sectionId) => {
|
|
4606
|
-
const result =
|
|
4602
|
+
const result = chunkAL2KLPOJ_js.deleteSection(sections, slides, sectionId);
|
|
4607
4603
|
setSections(result.sections);
|
|
4608
4604
|
setSlides(result.slides);
|
|
4609
4605
|
markDirty();
|
|
@@ -4612,21 +4608,21 @@ function useSectionOperations(input) {
|
|
|
4612
4608
|
);
|
|
4613
4609
|
const moveSectionUp2 = react.useCallback(
|
|
4614
4610
|
(sectionId) => {
|
|
4615
|
-
setSections(
|
|
4611
|
+
setSections(chunkAL2KLPOJ_js.moveSectionUp(sections, sectionId));
|
|
4616
4612
|
markDirty();
|
|
4617
4613
|
},
|
|
4618
4614
|
[sections, setSections, markDirty]
|
|
4619
4615
|
);
|
|
4620
4616
|
const moveSectionDown2 = react.useCallback(
|
|
4621
4617
|
(sectionId) => {
|
|
4622
|
-
setSections(
|
|
4618
|
+
setSections(chunkAL2KLPOJ_js.moveSectionDown(sections, sectionId));
|
|
4623
4619
|
markDirty();
|
|
4624
4620
|
},
|
|
4625
4621
|
[sections, setSections, markDirty]
|
|
4626
4622
|
);
|
|
4627
4623
|
const moveSlidesToSection2 = react.useCallback(
|
|
4628
4624
|
(slideIndexes, targetSectionId) => {
|
|
4629
|
-
const result =
|
|
4625
|
+
const result = chunkAL2KLPOJ_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4630
4626
|
setSlides(result.slides);
|
|
4631
4627
|
setSections(result.sections);
|
|
4632
4628
|
markDirty();
|
|
@@ -4692,15 +4688,15 @@ function syncSelectionHandleOverlay(elementNode, elementId, geometry) {
|
|
|
4692
4688
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4693
4689
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx, lockAspect = false) {
|
|
4694
4690
|
const startBox = { x: startX, y: startY, width: startWidth, height: startHeight };
|
|
4695
|
-
let resized =
|
|
4691
|
+
let resized = chunkAL2KLPOJ_js.applyResize(startBox, handle, dx, dy, 1, { minSize: chunk7VPDHSWF_js.MIN_ELEMENT_SIZE });
|
|
4696
4692
|
if (lockAspect) {
|
|
4697
|
-
resized =
|
|
4693
|
+
resized = chunkAL2KLPOJ_js.lockResizeAspect(resized, startBox, handle, chunk7VPDHSWF_js.MIN_ELEMENT_SIZE);
|
|
4698
4694
|
}
|
|
4699
4695
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4700
4696
|
if (!snapToGrid) {
|
|
4701
4697
|
return box;
|
|
4702
4698
|
}
|
|
4703
|
-
return
|
|
4699
|
+
return chunkAL2KLPOJ_js.snapBoxToGrid(box, handle, gridSpacingPx, chunk7VPDHSWF_js.MIN_ELEMENT_SIZE);
|
|
4704
4700
|
}
|
|
4705
4701
|
function resolveLiveTarget(input) {
|
|
4706
4702
|
const { livePatcher, editTemplateMode, activeSlide } = input;
|
|
@@ -4813,7 +4809,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4813
4809
|
width: el.width,
|
|
4814
4810
|
height: el.height
|
|
4815
4811
|
}));
|
|
4816
|
-
const snapResult =
|
|
4812
|
+
const snapResult = chunkAL2KLPOJ_js.computeSnapToShape(
|
|
4817
4813
|
targetX,
|
|
4818
4814
|
targetY,
|
|
4819
4815
|
primaryEl.width,
|
|
@@ -4855,7 +4851,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4855
4851
|
if (live) {
|
|
4856
4852
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4857
4853
|
const start = drag.startPositionsById[id];
|
|
4858
|
-
|
|
4854
|
+
chunkAL2KLPOJ_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4859
4855
|
x: start.x + appliedDx,
|
|
4860
4856
|
y: start.y + appliedDy
|
|
4861
4857
|
});
|
|
@@ -4887,8 +4883,8 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4887
4883
|
rs.lastY = geo.y;
|
|
4888
4884
|
rs.lastWidth = geo.width;
|
|
4889
4885
|
rs.lastHeight = geo.height;
|
|
4890
|
-
const width = Math.max(geo.width,
|
|
4891
|
-
const height = Math.max(geo.height,
|
|
4886
|
+
const width = Math.max(geo.width, chunk7VPDHSWF_js.MIN_ELEMENT_SIZE);
|
|
4887
|
+
const height = Math.max(geo.height, chunk7VPDHSWF_js.MIN_ELEMENT_SIZE);
|
|
4892
4888
|
if (rs.domEl) {
|
|
4893
4889
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4894
4890
|
rs.domEl.style.top = `${geo.y}px`;
|
|
@@ -4897,7 +4893,7 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4897
4893
|
syncSelectionHandleOverlay(rs.domEl, rs.elementId, { x: geo.x, y: geo.y, width, height });
|
|
4898
4894
|
}
|
|
4899
4895
|
if (live) {
|
|
4900
|
-
|
|
4896
|
+
chunkAL2KLPOJ_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4901
4897
|
x: geo.x,
|
|
4902
4898
|
y: geo.y,
|
|
4903
4899
|
width,
|
|
@@ -4908,7 +4904,7 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4908
4904
|
function processAdjustmentMove(e, adj, editorScale, updateElementById) {
|
|
4909
4905
|
const dx = (e.clientX - adj.startClientX) / editorScale;
|
|
4910
4906
|
const dy = (e.clientY - adj.startClientY) / editorScale;
|
|
4911
|
-
const adjustments =
|
|
4907
|
+
const adjustments = chunkAL2KLPOJ_js.getDraggedShapeAdjustments(adj, dx, dy);
|
|
4912
4908
|
if (!adj.moved && Math.hypot(dx, dy) > 2) {
|
|
4913
4909
|
adj.moved = true;
|
|
4914
4910
|
}
|
|
@@ -4983,13 +4979,13 @@ function processPointerUp(input) {
|
|
|
4983
4979
|
if (i !== activeSlideIndex) {
|
|
4984
4980
|
return s;
|
|
4985
4981
|
}
|
|
4986
|
-
const rerouted =
|
|
4982
|
+
const rerouted = chunkAL2KLPOJ_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4987
4983
|
if (rerouted.length === 0) {
|
|
4988
4984
|
return s;
|
|
4989
4985
|
}
|
|
4990
4986
|
return {
|
|
4991
4987
|
...s,
|
|
4992
|
-
elements:
|
|
4988
|
+
elements: chunkAL2KLPOJ_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4993
4989
|
};
|
|
4994
4990
|
})
|
|
4995
4991
|
);
|
|
@@ -5014,9 +5010,9 @@ function processPointerUp(input) {
|
|
|
5014
5010
|
}
|
|
5015
5011
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
5016
5012
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
5017
|
-
const hitIds =
|
|
5013
|
+
const hitIds = chunkAL2KLPOJ_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
5018
5014
|
if (marquee.additive) {
|
|
5019
|
-
const merged =
|
|
5015
|
+
const merged = chunkAL2KLPOJ_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
5020
5016
|
if (merged.length > 0) {
|
|
5021
5017
|
applySelection(merged[0], merged);
|
|
5022
5018
|
} else {
|
|
@@ -5039,8 +5035,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
5039
5035
|
}
|
|
5040
5036
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
5041
5037
|
});
|
|
5042
|
-
const rerouted =
|
|
5043
|
-
return
|
|
5038
|
+
const rerouted = chunkAL2KLPOJ_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
5039
|
+
return chunkAL2KLPOJ_js.applyReroutedConnectors(movedElements, rerouted);
|
|
5044
5040
|
};
|
|
5045
5041
|
if (editTemplateMode) {
|
|
5046
5042
|
const slideId = activeSlide?.id;
|
|
@@ -5196,15 +5192,23 @@ function useCanvasInteractions(input) {
|
|
|
5196
5192
|
return;
|
|
5197
5193
|
}
|
|
5198
5194
|
const el = elementLookup.get(editId);
|
|
5199
|
-
if (el &&
|
|
5195
|
+
if (el && chunkAL2KLPOJ_js.hasTextProperties(el)) {
|
|
5200
5196
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
5201
|
-
const newSegments =
|
|
5197
|
+
const newSegments = chunkAL2KLPOJ_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
5202
5198
|
const editorEl = document.querySelector("[data-inline-editor]");
|
|
5203
|
-
const newHeight =
|
|
5199
|
+
const newHeight = chunkAL2KLPOJ_js.resolveInlineEditAutoFitHeight(el.textStyle, el.height, editorEl);
|
|
5200
|
+
const shrink = chunkAL2KLPOJ_js.resolveInlineEditNormAutofitShrink(el.textStyle, el.height, editorEl);
|
|
5204
5201
|
ops.updateElementById(editId, {
|
|
5205
5202
|
text: committedText,
|
|
5206
5203
|
textSegments: newSegments,
|
|
5207
|
-
...newHeight !== void 0 ? { height: newHeight } : {}
|
|
5204
|
+
...newHeight !== void 0 ? { height: newHeight } : {},
|
|
5205
|
+
...shrink !== "unchanged" ? {
|
|
5206
|
+
textStyle: {
|
|
5207
|
+
...el.textStyle,
|
|
5208
|
+
autoFitFontScale: shrink.fontScale,
|
|
5209
|
+
autoFitLineSpacingReduction: shrink.lnSpcReduction
|
|
5210
|
+
}
|
|
5211
|
+
} : {}
|
|
5208
5212
|
});
|
|
5209
5213
|
history.markDirty();
|
|
5210
5214
|
}
|
|
@@ -5212,7 +5216,7 @@ function useCanvasInteractions(input) {
|
|
|
5212
5216
|
setInlineEditingText("");
|
|
5213
5217
|
};
|
|
5214
5218
|
const openEquationEditorForElement = (el) => {
|
|
5215
|
-
if (!
|
|
5219
|
+
if (!chunkAL2KLPOJ_js.hasTextProperties(el)) {
|
|
5216
5220
|
return false;
|
|
5217
5221
|
}
|
|
5218
5222
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -5242,7 +5246,7 @@ function useCanvasInteractions(input) {
|
|
|
5242
5246
|
justInteractedRef.current = false;
|
|
5243
5247
|
} else {
|
|
5244
5248
|
const el = elementLookup.get(elementId);
|
|
5245
|
-
if (el &&
|
|
5249
|
+
if (el && chunkAL2KLPOJ_js.hasTextProperties(el) && chunkAL2KLPOJ_js.canInteractWithElement(el, "textEdit")) {
|
|
5246
5250
|
if (!openEquationEditorForElement(el)) {
|
|
5247
5251
|
setInlineEditingElementId(elementId);
|
|
5248
5252
|
setInlineEditingText(el.text ?? "");
|
|
@@ -5261,7 +5265,7 @@ function useCanvasInteractions(input) {
|
|
|
5261
5265
|
if (openEquationEditorForElement(el)) {
|
|
5262
5266
|
return;
|
|
5263
5267
|
}
|
|
5264
|
-
if (
|
|
5268
|
+
if (chunkAL2KLPOJ_js.hasTextProperties(el) && chunkAL2KLPOJ_js.canInteractWithElement(el, "textEdit")) {
|
|
5265
5269
|
setInlineEditingElementId(elementId);
|
|
5266
5270
|
setInlineEditingText(el.text ?? "");
|
|
5267
5271
|
}
|
|
@@ -5284,7 +5288,7 @@ function useCanvasInteractions(input) {
|
|
|
5284
5288
|
justSelectedRef.current = false;
|
|
5285
5289
|
}
|
|
5286
5290
|
const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
|
|
5287
|
-
const movableIds =
|
|
5291
|
+
const movableIds = chunkAL2KLPOJ_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
|
|
5288
5292
|
if (movableIds.length === 0) {
|
|
5289
5293
|
return;
|
|
5290
5294
|
}
|
|
@@ -5354,7 +5358,7 @@ function useCanvasInteractions(input) {
|
|
|
5354
5358
|
const handleResizePointerDown = (elementId, e, handle) => {
|
|
5355
5359
|
e.stopPropagation();
|
|
5356
5360
|
const el = elementLookup.get(elementId);
|
|
5357
|
-
if (!el || !
|
|
5361
|
+
if (!el || !chunkAL2KLPOJ_js.canInteractWithElement(el, "resize")) {
|
|
5358
5362
|
return;
|
|
5359
5363
|
}
|
|
5360
5364
|
resizeStateRef.current = {
|
|
@@ -5376,7 +5380,7 @@ function useCanvasInteractions(input) {
|
|
|
5376
5380
|
};
|
|
5377
5381
|
const handleRotate = (elementId, rotationDeg) => {
|
|
5378
5382
|
const el = elementLookup.get(elementId);
|
|
5379
|
-
if (!el || !
|
|
5383
|
+
if (!el || !chunkAL2KLPOJ_js.canInteractWithElement(el, "rotate")) {
|
|
5380
5384
|
return;
|
|
5381
5385
|
}
|
|
5382
5386
|
ops.updateElementById(elementId, { rotation: rotationDeg });
|
|
@@ -5396,10 +5400,10 @@ function useCanvasInteractions(input) {
|
|
|
5396
5400
|
const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
|
|
5397
5401
|
e.stopPropagation();
|
|
5398
5402
|
const el = elementLookup.get(elementId);
|
|
5399
|
-
if (!el || !
|
|
5403
|
+
if (!el || !chunkAL2KLPOJ_js.canInteractWithElement(el, "adjustHandle")) {
|
|
5400
5404
|
return;
|
|
5401
5405
|
}
|
|
5402
|
-
shapeAdjustmentDragStateRef.current =
|
|
5406
|
+
shapeAdjustmentDragStateRef.current = chunkAL2KLPOJ_js.beginShapeAdjustment(
|
|
5403
5407
|
el,
|
|
5404
5408
|
descriptor,
|
|
5405
5409
|
e.clientX,
|
|
@@ -5446,7 +5450,7 @@ function createFileHandlers(deps) {
|
|
|
5446
5450
|
h = Math.round(h * scale);
|
|
5447
5451
|
}
|
|
5448
5452
|
addElement({
|
|
5449
|
-
id:
|
|
5453
|
+
id: chunkAL2KLPOJ_js.generateElementId(),
|
|
5450
5454
|
type: "image",
|
|
5451
5455
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5452
5456
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5457,7 +5461,7 @@ function createFileHandlers(deps) {
|
|
|
5457
5461
|
};
|
|
5458
5462
|
img.onerror = () => {
|
|
5459
5463
|
addElement({
|
|
5460
|
-
id:
|
|
5464
|
+
id: chunkAL2KLPOJ_js.generateElementId(),
|
|
5461
5465
|
type: "image",
|
|
5462
5466
|
x: 100,
|
|
5463
5467
|
y: 100,
|
|
@@ -5476,14 +5480,14 @@ function createFileHandlers(deps) {
|
|
|
5476
5480
|
return;
|
|
5477
5481
|
}
|
|
5478
5482
|
e.target.value = "";
|
|
5479
|
-
const mediaType =
|
|
5483
|
+
const mediaType = chunkAL2KLPOJ_js.classifyMediaType(file.type);
|
|
5480
5484
|
if (!mediaType) {
|
|
5481
5485
|
return;
|
|
5482
5486
|
}
|
|
5483
5487
|
const elFilePath = file.path;
|
|
5484
5488
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5485
5489
|
addElement({
|
|
5486
|
-
id:
|
|
5490
|
+
id: chunkAL2KLPOJ_js.generateElementId(),
|
|
5487
5491
|
type: "media",
|
|
5488
5492
|
mediaType,
|
|
5489
5493
|
mediaMimeType: file.type || void 0,
|
|
@@ -5658,13 +5662,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5658
5662
|
return;
|
|
5659
5663
|
}
|
|
5660
5664
|
addElement({
|
|
5661
|
-
id:
|
|
5665
|
+
id: chunkAL2KLPOJ_js.generateElementId(),
|
|
5662
5666
|
type: "smartArt",
|
|
5663
5667
|
x: 100,
|
|
5664
5668
|
y: 120,
|
|
5665
5669
|
width: 600,
|
|
5666
5670
|
height: 340,
|
|
5667
|
-
smartArtData:
|
|
5671
|
+
smartArtData: chunkAL2KLPOJ_js.buildSmartArtPresetData(
|
|
5668
5672
|
layout,
|
|
5669
5673
|
defaultItems,
|
|
5670
5674
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5676,7 +5680,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5676
5680
|
return;
|
|
5677
5681
|
}
|
|
5678
5682
|
addElement({
|
|
5679
|
-
id:
|
|
5683
|
+
id: chunkAL2KLPOJ_js.generateElementId(),
|
|
5680
5684
|
type: "shape",
|
|
5681
5685
|
x: 120,
|
|
5682
5686
|
y: 200,
|
|
@@ -5714,7 +5718,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5714
5718
|
return;
|
|
5715
5719
|
}
|
|
5716
5720
|
const resolved = resolveHyperlinkEditResult(data);
|
|
5717
|
-
if (resolved.url && !
|
|
5721
|
+
if (resolved.url && !chunkAL2KLPOJ_js.isUrlSafe(resolved.url)) {
|
|
5718
5722
|
return;
|
|
5719
5723
|
}
|
|
5720
5724
|
const actionClick = {
|
|
@@ -5738,7 +5742,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5738
5742
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5739
5743
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5740
5744
|
addElement({
|
|
5741
|
-
id:
|
|
5745
|
+
id: chunkAL2KLPOJ_js.generateElementId(),
|
|
5742
5746
|
type: "shape",
|
|
5743
5747
|
x: 120,
|
|
5744
5748
|
y: 200,
|
|
@@ -5760,11 +5764,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5760
5764
|
if (!activeSlide) {
|
|
5761
5765
|
return;
|
|
5762
5766
|
}
|
|
5763
|
-
const preset =
|
|
5767
|
+
const preset = chunkAL2KLPOJ_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5764
5768
|
if (!preset) {
|
|
5765
5769
|
return;
|
|
5766
5770
|
}
|
|
5767
|
-
const defaultPptxAction =
|
|
5771
|
+
const defaultPptxAction = chunkAL2KLPOJ_js.elementActionToPptxAction({
|
|
5768
5772
|
trigger: "click",
|
|
5769
5773
|
type: preset.defaultAction
|
|
5770
5774
|
});
|
|
@@ -5773,7 +5777,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5773
5777
|
defaultPptxAction.highlightClick = true;
|
|
5774
5778
|
}
|
|
5775
5779
|
addElement({
|
|
5776
|
-
id:
|
|
5780
|
+
id: chunkAL2KLPOJ_js.generateElementId(),
|
|
5777
5781
|
type: "shape",
|
|
5778
5782
|
x: 150,
|
|
5779
5783
|
y: 150,
|
|
@@ -5840,14 +5844,14 @@ function useInsertElements(input) {
|
|
|
5840
5844
|
return;
|
|
5841
5845
|
}
|
|
5842
5846
|
addElement({
|
|
5843
|
-
id:
|
|
5847
|
+
id: chunkAL2KLPOJ_js.generateElementId(),
|
|
5844
5848
|
type: "text",
|
|
5845
5849
|
x: 100,
|
|
5846
5850
|
y: 100,
|
|
5847
5851
|
width: 300,
|
|
5848
5852
|
height: 60,
|
|
5849
5853
|
text: "",
|
|
5850
|
-
textStyle: { fontSize:
|
|
5854
|
+
textStyle: { fontSize: chunk7VPDHSWF_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5851
5855
|
});
|
|
5852
5856
|
};
|
|
5853
5857
|
const handleAddShape = () => {
|
|
@@ -5855,7 +5859,7 @@ function useInsertElements(input) {
|
|
|
5855
5859
|
return;
|
|
5856
5860
|
}
|
|
5857
5861
|
addElement({
|
|
5858
|
-
id:
|
|
5862
|
+
id: chunkAL2KLPOJ_js.generateElementId(),
|
|
5859
5863
|
type: "shape",
|
|
5860
5864
|
x: 150,
|
|
5861
5865
|
y: 150,
|
|
@@ -5874,15 +5878,15 @@ function useInsertElements(input) {
|
|
|
5874
5878
|
return;
|
|
5875
5879
|
}
|
|
5876
5880
|
addElement({
|
|
5877
|
-
...
|
|
5878
|
-
id:
|
|
5881
|
+
...chunkAL2KLPOJ_js.newTableElement(chunk7VPDHSWF_js.DEFAULT_TABLE_ROWS, chunk7VPDHSWF_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5882
|
+
id: chunkAL2KLPOJ_js.generateElementId()
|
|
5879
5883
|
});
|
|
5880
5884
|
};
|
|
5881
5885
|
const handleAddChart = (chartKind) => {
|
|
5882
5886
|
if (!activeSlide) {
|
|
5883
5887
|
return;
|
|
5884
5888
|
}
|
|
5885
|
-
addElement(
|
|
5889
|
+
addElement(chunkAL2KLPOJ_js.createDefaultChartElement(chartKind));
|
|
5886
5890
|
};
|
|
5887
5891
|
const structured = createStructuredElementHandlers({
|
|
5888
5892
|
activeSlide,
|
|
@@ -5952,7 +5956,7 @@ function useClipboardHandlers(input) {
|
|
|
5952
5956
|
if (!selectedElement) {
|
|
5953
5957
|
return;
|
|
5954
5958
|
}
|
|
5955
|
-
setClipboardPayload(
|
|
5959
|
+
setClipboardPayload(chunkAL2KLPOJ_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5956
5960
|
};
|
|
5957
5961
|
const handleDelete = () => {
|
|
5958
5962
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5969,7 +5973,7 @@ function useClipboardHandlers(input) {
|
|
|
5969
5973
|
handleDelete();
|
|
5970
5974
|
};
|
|
5971
5975
|
const insertClone = (source) => {
|
|
5972
|
-
const clone =
|
|
5976
|
+
const clone = chunkAL2KLPOJ_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5973
5977
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5974
5978
|
ops.applySelection(clone.id);
|
|
5975
5979
|
history.markDirty();
|
|
@@ -6004,7 +6008,7 @@ function resolveShapePath(el) {
|
|
|
6004
6008
|
return el.pathData;
|
|
6005
6009
|
}
|
|
6006
6010
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
6007
|
-
const clipPath =
|
|
6011
|
+
const clipPath = chunkAL2KLPOJ_js.getPresetShapeClipPath(el.shapeType);
|
|
6008
6012
|
if (clipPath) {
|
|
6009
6013
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
6010
6014
|
if (svgPath) {
|
|
@@ -6055,7 +6059,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
6055
6059
|
return parts.join(" ");
|
|
6056
6060
|
}
|
|
6057
6061
|
function transformPathToGlobal(pathData, el) {
|
|
6058
|
-
const polys =
|
|
6062
|
+
const polys = chunkAL2KLPOJ_js.svgPathToPolygons(pathData);
|
|
6059
6063
|
if (polys.length === 0) {
|
|
6060
6064
|
return pathData;
|
|
6061
6065
|
}
|
|
@@ -6075,10 +6079,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
6075
6079
|
y: pt.y * scaleY + el.y
|
|
6076
6080
|
}))
|
|
6077
6081
|
);
|
|
6078
|
-
return
|
|
6082
|
+
return chunkAL2KLPOJ_js.polygonsToSvgPath(transformed);
|
|
6079
6083
|
}
|
|
6080
6084
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
6081
|
-
const polys =
|
|
6085
|
+
const polys = chunkAL2KLPOJ_js.svgPathToPolygons(pathData);
|
|
6082
6086
|
if (polys.length === 0) {
|
|
6083
6087
|
return pathData;
|
|
6084
6088
|
}
|
|
@@ -6088,10 +6092,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
6088
6092
|
y: pt.y - y
|
|
6089
6093
|
}))
|
|
6090
6094
|
);
|
|
6091
|
-
return
|
|
6095
|
+
return chunkAL2KLPOJ_js.polygonsToSvgPath(transformed);
|
|
6092
6096
|
}
|
|
6093
6097
|
function pathBounds(pathData) {
|
|
6094
|
-
const polys =
|
|
6098
|
+
const polys = chunkAL2KLPOJ_js.svgPathToPolygons(pathData);
|
|
6095
6099
|
let minX = Infinity;
|
|
6096
6100
|
let minY = Infinity;
|
|
6097
6101
|
let maxX = -Infinity;
|
|
@@ -6150,7 +6154,7 @@ function useMergeShapesHandler(input) {
|
|
|
6150
6154
|
let allFragments = [];
|
|
6151
6155
|
let remaining = globalPaths[0];
|
|
6152
6156
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
6153
|
-
const frags =
|
|
6157
|
+
const frags = chunkAL2KLPOJ_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
6154
6158
|
if (Array.isArray(frags)) {
|
|
6155
6159
|
allFragments = frags;
|
|
6156
6160
|
}
|
|
@@ -6179,7 +6183,7 @@ function useMergeShapesHandler(input) {
|
|
|
6179
6183
|
bounds.height
|
|
6180
6184
|
);
|
|
6181
6185
|
const newEl = {
|
|
6182
|
-
id:
|
|
6186
|
+
id: chunkAL2KLPOJ_js.generateElementId(),
|
|
6183
6187
|
type: "shape",
|
|
6184
6188
|
x: bounds.x,
|
|
6185
6189
|
y: bounds.y,
|
|
@@ -6217,7 +6221,7 @@ function useMergeShapesHandler(input) {
|
|
|
6217
6221
|
} else {
|
|
6218
6222
|
let resultPath = globalPaths[0];
|
|
6219
6223
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
6220
|
-
const result =
|
|
6224
|
+
const result = chunkAL2KLPOJ_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
6221
6225
|
if (typeof result === "string") {
|
|
6222
6226
|
resultPath = result;
|
|
6223
6227
|
}
|
|
@@ -6238,7 +6242,7 @@ function useMergeShapesHandler(input) {
|
|
|
6238
6242
|
);
|
|
6239
6243
|
const primary = targets[0];
|
|
6240
6244
|
const newEl = {
|
|
6241
|
-
id:
|
|
6245
|
+
id: chunkAL2KLPOJ_js.generateElementId(),
|
|
6242
6246
|
type: "shape",
|
|
6243
6247
|
x: bounds.x,
|
|
6244
6248
|
y: bounds.y,
|
|
@@ -6301,7 +6305,10 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6301
6305
|
if (ids.length < 2 || !activeSlide) {
|
|
6302
6306
|
return;
|
|
6303
6307
|
}
|
|
6304
|
-
|
|
6308
|
+
if (!selectedElements.every((el) => chunkAL2KLPOJ_js.canInteractWithElement(el, "group"))) {
|
|
6309
|
+
return;
|
|
6310
|
+
}
|
|
6311
|
+
const { elements, groupId } = chunkAL2KLPOJ_js.groupElements(ops.activeElements, ids, chunkAL2KLPOJ_js.generateElementId());
|
|
6305
6312
|
if (groupId === null) {
|
|
6306
6313
|
return;
|
|
6307
6314
|
}
|
|
@@ -6313,12 +6320,15 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6313
6320
|
if (!selectedElement || selectedElement.type !== "group" || !activeSlide) {
|
|
6314
6321
|
return;
|
|
6315
6322
|
}
|
|
6323
|
+
if (!chunkAL2KLPOJ_js.canInteractWithElement(selectedElement, "group")) {
|
|
6324
|
+
return;
|
|
6325
|
+
}
|
|
6316
6326
|
const group = selectedElement;
|
|
6317
|
-
const intoTemplate =
|
|
6327
|
+
const intoTemplate = chunkAL2KLPOJ_js.isTemplateElementId(group.id);
|
|
6318
6328
|
const childIds = group.children.map(
|
|
6319
|
-
(child) => intoTemplate ?
|
|
6329
|
+
(child) => intoTemplate ? chunkAL2KLPOJ_js.makeCloneId(true, child.id || group.id) : child.id || chunkAL2KLPOJ_js.generateElementId()
|
|
6320
6330
|
);
|
|
6321
|
-
const { elements, childIds: usedIds } =
|
|
6331
|
+
const { elements, childIds: usedIds } = chunkAL2KLPOJ_js.ungroupElements(
|
|
6322
6332
|
ops.activeElements,
|
|
6323
6333
|
group.id,
|
|
6324
6334
|
childIds,
|
|
@@ -6347,7 +6357,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6347
6357
|
if (!edge) {
|
|
6348
6358
|
return;
|
|
6349
6359
|
}
|
|
6350
|
-
const positions =
|
|
6360
|
+
const positions = chunkAL2KLPOJ_js.alignElements(selectedElements, edge);
|
|
6351
6361
|
for (const [id, pos] of positions) {
|
|
6352
6362
|
const el = elementLookup.get(id);
|
|
6353
6363
|
if (!el) {
|
|
@@ -6365,7 +6375,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6365
6375
|
if (!distAxis) {
|
|
6366
6376
|
return;
|
|
6367
6377
|
}
|
|
6368
|
-
const positions =
|
|
6378
|
+
const positions = chunkAL2KLPOJ_js.distributeElements(selectedElements, distAxis);
|
|
6369
6379
|
for (const [id, pos] of positions) {
|
|
6370
6380
|
const el = elementLookup.get(id);
|
|
6371
6381
|
if (!el) {
|
|
@@ -6376,13 +6386,14 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6376
6386
|
history.markDirty();
|
|
6377
6387
|
};
|
|
6378
6388
|
const canDistribute = selectedElements.length >= 3;
|
|
6389
|
+
const selectionGroupable = selectedElements.every((el) => chunkAL2KLPOJ_js.canInteractWithElement(el, "group"));
|
|
6379
6390
|
const handleMoveLayer = (direction) => {
|
|
6380
6391
|
if (!selectedElement || !activeSlide) {
|
|
6381
6392
|
return;
|
|
6382
6393
|
}
|
|
6383
6394
|
const id = selectedElement.id;
|
|
6384
6395
|
ops.updateActiveElements(
|
|
6385
|
-
(els) => direction === "forward" ?
|
|
6396
|
+
(els) => direction === "forward" ? chunkAL2KLPOJ_js.bringForward(els, id) : direction === "backward" ? chunkAL2KLPOJ_js.sendBackward(els, id) : els
|
|
6386
6397
|
);
|
|
6387
6398
|
history.markDirty();
|
|
6388
6399
|
};
|
|
@@ -6392,7 +6403,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6392
6403
|
}
|
|
6393
6404
|
const id = selectedElement.id;
|
|
6394
6405
|
ops.updateActiveElements(
|
|
6395
|
-
(els) => direction === "front" ?
|
|
6406
|
+
(els) => direction === "front" ? chunkAL2KLPOJ_js.bringToFront(els, id) : chunkAL2KLPOJ_js.sendToBack(els, id)
|
|
6396
6407
|
);
|
|
6397
6408
|
history.markDirty();
|
|
6398
6409
|
};
|
|
@@ -6412,6 +6423,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6412
6423
|
handleAlignElements,
|
|
6413
6424
|
handleDistributeElements,
|
|
6414
6425
|
canDistribute,
|
|
6426
|
+
selectionGroupable,
|
|
6415
6427
|
handleMoveLayer,
|
|
6416
6428
|
handleMoveLayerToEdge,
|
|
6417
6429
|
handleMergeShapes,
|
|
@@ -6430,6 +6442,7 @@ function useElementManipulation(input) {
|
|
|
6430
6442
|
handleAlignElements,
|
|
6431
6443
|
handleDistributeElements,
|
|
6432
6444
|
canDistribute,
|
|
6445
|
+
selectionGroupable,
|
|
6433
6446
|
handleMoveLayer,
|
|
6434
6447
|
handleMoveLayerToEdge,
|
|
6435
6448
|
handleMergeShapes,
|
|
@@ -6496,6 +6509,7 @@ function useElementManipulation(input) {
|
|
|
6496
6509
|
handleAlignElements,
|
|
6497
6510
|
handleDistributeElements,
|
|
6498
6511
|
canDistribute,
|
|
6512
|
+
selectionGroupable,
|
|
6499
6513
|
handleMoveLayer,
|
|
6500
6514
|
handleMoveLayerToEdge,
|
|
6501
6515
|
handleMergeShapes,
|
|
@@ -6523,7 +6537,7 @@ function useSlideManagement(input) {
|
|
|
6523
6537
|
theme
|
|
6524
6538
|
} = input;
|
|
6525
6539
|
const handleAddSlide = () => {
|
|
6526
|
-
const newSlide =
|
|
6540
|
+
const newSlide = chunkAL2KLPOJ_js.createBlankSlide(slides.length + 1);
|
|
6527
6541
|
ops.updateSlides((prev) => {
|
|
6528
6542
|
const next = [...prev];
|
|
6529
6543
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6586,7 +6600,7 @@ function useSlideManagement(input) {
|
|
|
6586
6600
|
}
|
|
6587
6601
|
const clone = {
|
|
6588
6602
|
...src,
|
|
6589
|
-
id:
|
|
6603
|
+
id: chunkAL2KLPOJ_js.makeSlideId(),
|
|
6590
6604
|
elements: src.elements.map((el) => ({
|
|
6591
6605
|
...el,
|
|
6592
6606
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6618,7 +6632,7 @@ function useSlideManagement(input) {
|
|
|
6618
6632
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6619
6633
|
const insertAt = activeSlideIndex + 1;
|
|
6620
6634
|
const draft = {
|
|
6621
|
-
...
|
|
6635
|
+
...chunkAL2KLPOJ_js.createBlankSlide(slides.length + 1),
|
|
6622
6636
|
layoutPath,
|
|
6623
6637
|
...layoutName ? { layoutName } : {}
|
|
6624
6638
|
};
|
|
@@ -6651,9 +6665,9 @@ function useSlideManagement(input) {
|
|
|
6651
6665
|
};
|
|
6652
6666
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6653
6667
|
const insertAt = activeSlideIndex + 1;
|
|
6654
|
-
const draft =
|
|
6668
|
+
const draft = chunkAL2KLPOJ_js.buildSlideTemplateSlide(templateId, chunkAL2KLPOJ_js.makeSlideId(), slides.length + 1, {
|
|
6655
6669
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6656
|
-
scheme:
|
|
6670
|
+
scheme: chunkAL2KLPOJ_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6657
6671
|
});
|
|
6658
6672
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6659
6673
|
setActiveSlideIndex(insertAt);
|
|
@@ -6690,7 +6704,7 @@ function createTableMergeHandlers(input) {
|
|
|
6690
6704
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6691
6705
|
return;
|
|
6692
6706
|
}
|
|
6693
|
-
const newTableData =
|
|
6707
|
+
const newTableData = chunkAL2KLPOJ_js.mergeCells(
|
|
6694
6708
|
[
|
|
6695
6709
|
{ row: rowIndex, col: columnIndex },
|
|
6696
6710
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6698,7 +6712,7 @@ function createTableMergeHandlers(input) {
|
|
|
6698
6712
|
td
|
|
6699
6713
|
);
|
|
6700
6714
|
const updates = { tableData: newTableData };
|
|
6701
|
-
const newRawXml =
|
|
6715
|
+
const newRawXml = chunkAL2KLPOJ_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6702
6716
|
if (newRawXml) {
|
|
6703
6717
|
updates.rawXml = newRawXml;
|
|
6704
6718
|
}
|
|
@@ -6724,7 +6738,7 @@ function createTableMergeHandlers(input) {
|
|
|
6724
6738
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6725
6739
|
return;
|
|
6726
6740
|
}
|
|
6727
|
-
const newTableData =
|
|
6741
|
+
const newTableData = chunkAL2KLPOJ_js.mergeCells(
|
|
6728
6742
|
[
|
|
6729
6743
|
{ row: rowIndex, col: columnIndex },
|
|
6730
6744
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6732,7 +6746,7 @@ function createTableMergeHandlers(input) {
|
|
|
6732
6746
|
td
|
|
6733
6747
|
);
|
|
6734
6748
|
const updates = { tableData: newTableData };
|
|
6735
|
-
const newRawXml =
|
|
6749
|
+
const newRawXml = chunkAL2KLPOJ_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6736
6750
|
if (newRawXml) {
|
|
6737
6751
|
updates.rawXml = newRawXml;
|
|
6738
6752
|
}
|
|
@@ -6747,9 +6761,9 @@ function createTableMergeHandlers(input) {
|
|
|
6747
6761
|
return;
|
|
6748
6762
|
}
|
|
6749
6763
|
const td = selectedElement.tableData;
|
|
6750
|
-
const newTableData =
|
|
6764
|
+
const newTableData = chunkAL2KLPOJ_js.mergeCells(ts.selectedCells, td);
|
|
6751
6765
|
const updates = { tableData: newTableData };
|
|
6752
|
-
const newRawXml =
|
|
6766
|
+
const newRawXml = chunkAL2KLPOJ_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6753
6767
|
if (newRawXml) {
|
|
6754
6768
|
updates.rawXml = newRawXml;
|
|
6755
6769
|
}
|
|
@@ -6766,9 +6780,9 @@ function createTableMergeHandlers(input) {
|
|
|
6766
6780
|
}
|
|
6767
6781
|
const { rowIndex, columnIndex } = ts;
|
|
6768
6782
|
const td = selectedElement.tableData;
|
|
6769
|
-
const newTableData =
|
|
6783
|
+
const newTableData = chunkAL2KLPOJ_js.splitCell(rowIndex, columnIndex, td);
|
|
6770
6784
|
const updates = { tableData: newTableData };
|
|
6771
|
-
const newRawXml =
|
|
6785
|
+
const newRawXml = chunkAL2KLPOJ_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6772
6786
|
if (newRawXml) {
|
|
6773
6787
|
updates.rawXml = newRawXml;
|
|
6774
6788
|
}
|
|
@@ -6802,10 +6816,10 @@ function createTableStructHandlers(input) {
|
|
|
6802
6816
|
const text = transformCommittedText ? transformCommittedText(rawText) : rawText;
|
|
6803
6817
|
const updates = {};
|
|
6804
6818
|
if (el.tableData) {
|
|
6805
|
-
updates.tableData =
|
|
6819
|
+
updates.tableData = chunkAL2KLPOJ_js.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
6806
6820
|
}
|
|
6807
6821
|
if (el.rawXml) {
|
|
6808
|
-
const newRawXml =
|
|
6822
|
+
const newRawXml = chunkAL2KLPOJ_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6809
6823
|
if (newRawXml) {
|
|
6810
6824
|
updates.rawXml = newRawXml;
|
|
6811
6825
|
}
|
|
@@ -6829,7 +6843,7 @@ function createTableStructHandlers(input) {
|
|
|
6829
6843
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6830
6844
|
const updates = {};
|
|
6831
6845
|
if (selectedElement.rawXml) {
|
|
6832
|
-
const newRawXml =
|
|
6846
|
+
const newRawXml = chunkAL2KLPOJ_js.updateCellTextStyleInRawXml(
|
|
6833
6847
|
selectedElement,
|
|
6834
6848
|
rowIndex,
|
|
6835
6849
|
colIndex,
|
|
@@ -6893,9 +6907,9 @@ function createTableStructHandlers(input) {
|
|
|
6893
6907
|
return;
|
|
6894
6908
|
}
|
|
6895
6909
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6896
|
-
const newTableData =
|
|
6910
|
+
const newTableData = chunkAL2KLPOJ_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6897
6911
|
const updates = { tableData: newTableData };
|
|
6898
|
-
const newRawXml =
|
|
6912
|
+
const newRawXml = chunkAL2KLPOJ_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6899
6913
|
if (newRawXml) {
|
|
6900
6914
|
updates.rawXml = newRawXml;
|
|
6901
6915
|
}
|
|
@@ -6908,12 +6922,12 @@ function createTableStructHandlers(input) {
|
|
|
6908
6922
|
}
|
|
6909
6923
|
const td = selectedElement.tableData;
|
|
6910
6924
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6911
|
-
const newTableData =
|
|
6925
|
+
const newTableData = chunkAL2KLPOJ_js.deleteTableRow(td, rowIdx);
|
|
6912
6926
|
if (newTableData === td) {
|
|
6913
6927
|
return;
|
|
6914
6928
|
}
|
|
6915
6929
|
const updates = { tableData: newTableData };
|
|
6916
|
-
const newRawXml =
|
|
6930
|
+
const newRawXml = chunkAL2KLPOJ_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6917
6931
|
if (newRawXml) {
|
|
6918
6932
|
updates.rawXml = newRawXml;
|
|
6919
6933
|
}
|
|
@@ -6925,9 +6939,9 @@ function createTableStructHandlers(input) {
|
|
|
6925
6939
|
return;
|
|
6926
6940
|
}
|
|
6927
6941
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6928
|
-
const newTableData =
|
|
6942
|
+
const newTableData = chunkAL2KLPOJ_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6929
6943
|
const updates = { tableData: newTableData };
|
|
6930
|
-
const newRawXml =
|
|
6944
|
+
const newRawXml = chunkAL2KLPOJ_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6931
6945
|
if (newRawXml) {
|
|
6932
6946
|
updates.rawXml = newRawXml;
|
|
6933
6947
|
}
|
|
@@ -6940,12 +6954,12 @@ function createTableStructHandlers(input) {
|
|
|
6940
6954
|
}
|
|
6941
6955
|
const td = selectedElement.tableData;
|
|
6942
6956
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6943
|
-
const newTableData =
|
|
6957
|
+
const newTableData = chunkAL2KLPOJ_js.deleteTableColumn(td, colIdx);
|
|
6944
6958
|
if (newTableData === td) {
|
|
6945
6959
|
return;
|
|
6946
6960
|
}
|
|
6947
6961
|
const updates = { tableData: newTableData };
|
|
6948
|
-
const newRawXml =
|
|
6962
|
+
const newRawXml = chunkAL2KLPOJ_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6949
6963
|
if (newRawXml) {
|
|
6950
6964
|
updates.rawXml = newRawXml;
|
|
6951
6965
|
}
|
|
@@ -6981,8 +6995,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6981
6995
|
return html2canvasPro(element, {
|
|
6982
6996
|
...options,
|
|
6983
6997
|
onclone: async (doc, clonedEl) => {
|
|
6984
|
-
await
|
|
6985
|
-
|
|
6998
|
+
await chunkAL2KLPOJ_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6999
|
+
chunkAL2KLPOJ_js.preprocessCssForCapture(clonedEl);
|
|
6986
7000
|
if (typeof userOnClone === "function") {
|
|
6987
7001
|
userOnClone(doc, clonedEl);
|
|
6988
7002
|
}
|
|
@@ -7020,13 +7034,13 @@ function useExportSaveAs(input) {
|
|
|
7020
7034
|
if (!handler) {
|
|
7021
7035
|
return;
|
|
7022
7036
|
}
|
|
7023
|
-
const downloadName =
|
|
7037
|
+
const downloadName = chunkAL2KLPOJ_js.savedPresentationFileName(filePath, format);
|
|
7024
7038
|
try {
|
|
7025
7039
|
const data = await buildSaveAsData(handler, format);
|
|
7026
7040
|
const blob = new Blob([data], {
|
|
7027
7041
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
7028
7042
|
});
|
|
7029
|
-
|
|
7043
|
+
chunkAL2KLPOJ_js.downloadBlob(blob, downloadName);
|
|
7030
7044
|
} catch (err) {
|
|
7031
7045
|
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
7032
7046
|
}
|
|
@@ -7039,18 +7053,18 @@ function useExportSaveAs(input) {
|
|
|
7039
7053
|
const pptxGuides = guides.map((g) => ({
|
|
7040
7054
|
id: g.id,
|
|
7041
7055
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
7042
|
-
positionEmu:
|
|
7056
|
+
positionEmu: chunkAL2KLPOJ_js.guidePxToEmu(g.position)
|
|
7043
7057
|
}));
|
|
7044
7058
|
return {
|
|
7045
7059
|
...slide,
|
|
7046
7060
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
7047
7061
|
};
|
|
7048
7062
|
});
|
|
7049
|
-
const slidesToSave =
|
|
7063
|
+
const slidesToSave = chunkAL2KLPOJ_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
7050
7064
|
const saveOptions = {
|
|
7051
7065
|
// Save As shares Save's slide-size decision; leaving it out here is how
|
|
7052
7066
|
// a preset picked in the inspector reached one save path and not the other.
|
|
7053
|
-
slideSize:
|
|
7067
|
+
slideSize: chunkAL2KLPOJ_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
7054
7068
|
headerFooter,
|
|
7055
7069
|
presentationProperties,
|
|
7056
7070
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -7064,13 +7078,13 @@ function useExportSaveAs(input) {
|
|
|
7064
7078
|
handoutMaster,
|
|
7065
7079
|
outputFormat: format
|
|
7066
7080
|
};
|
|
7067
|
-
return
|
|
7081
|
+
return chunkAL2KLPOJ_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
|
|
7068
7082
|
};
|
|
7069
7083
|
const handleExportJson = () => {
|
|
7070
7084
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7071
|
-
const slideSize =
|
|
7085
|
+
const slideSize = chunkAL2KLPOJ_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
7072
7086
|
const data = {
|
|
7073
|
-
slides:
|
|
7087
|
+
slides: chunkAL2KLPOJ_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7074
7088
|
width: canvasSize.width,
|
|
7075
7089
|
height: canvasSize.height,
|
|
7076
7090
|
widthEmu: slideSize.widthEmu,
|
|
@@ -7089,7 +7103,7 @@ function useExportSaveAs(input) {
|
|
|
7089
7103
|
handoutMaster
|
|
7090
7104
|
};
|
|
7091
7105
|
try {
|
|
7092
|
-
|
|
7106
|
+
chunkAL2KLPOJ_js.exportDeckJson(data, sourceName);
|
|
7093
7107
|
} catch (err) {
|
|
7094
7108
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7095
7109
|
}
|
|
@@ -7176,7 +7190,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
7176
7190
|
}
|
|
7177
7191
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
7178
7192
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
7179
|
-
|
|
7193
|
+
chunkAL2KLPOJ_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
7180
7194
|
}
|
|
7181
7195
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
7182
7196
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -7198,15 +7212,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7198
7212
|
continue;
|
|
7199
7213
|
}
|
|
7200
7214
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
7201
|
-
images.push(
|
|
7215
|
+
images.push(chunkAL2KLPOJ_js.canvasToJpegData(canvas));
|
|
7202
7216
|
}
|
|
7203
7217
|
onProgress?.(totalSlides, totalSlides);
|
|
7204
7218
|
setActiveSlide(currentSlideIndex);
|
|
7205
7219
|
if (images.length === 0) {
|
|
7206
|
-
throw new Error(
|
|
7220
|
+
throw new Error(chunkMZI4DG3S_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
7207
7221
|
}
|
|
7208
|
-
const pdfBlobUrl =
|
|
7209
|
-
|
|
7222
|
+
const pdfBlobUrl = chunk7VPDHSWF_js.buildPdfFromImageData(images);
|
|
7223
|
+
chunkAL2KLPOJ_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
7210
7224
|
}
|
|
7211
7225
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
7212
7226
|
const { scale = 2, onProgress } = options;
|
|
@@ -7252,10 +7266,10 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
7252
7266
|
onProgress?.(totalSlides, totalSlides);
|
|
7253
7267
|
setActiveSlide(currentSlideIndex);
|
|
7254
7268
|
if (pages.length === 0) {
|
|
7255
|
-
throw new Error(
|
|
7269
|
+
throw new Error(chunkMZI4DG3S_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
7256
7270
|
}
|
|
7257
|
-
const pdfDataUrl =
|
|
7258
|
-
|
|
7271
|
+
const pdfDataUrl = chunk7VPDHSWF_js.buildNotesPdf(pages);
|
|
7272
|
+
chunkAL2KLPOJ_js.downloadDataUrl(pdfDataUrl, filename);
|
|
7259
7273
|
}
|
|
7260
7274
|
|
|
7261
7275
|
// src/viewer/utils/export-video.ts
|
|
@@ -7286,7 +7300,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7286
7300
|
}
|
|
7287
7301
|
setActiveSlide(currentSlideIndex);
|
|
7288
7302
|
if (slideCanvases.length === 0) {
|
|
7289
|
-
throw new Error(
|
|
7303
|
+
throw new Error(chunkMZI4DG3S_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
|
|
7290
7304
|
}
|
|
7291
7305
|
const firstCanvas = slideCanvases[0];
|
|
7292
7306
|
const recordingCanvas = document.createElement("canvas");
|
|
@@ -7294,12 +7308,12 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7294
7308
|
recordingCanvas.height = firstCanvas.height;
|
|
7295
7309
|
const ctx = recordingCanvas.getContext("2d");
|
|
7296
7310
|
if (!ctx) {
|
|
7297
|
-
throw new Error(
|
|
7311
|
+
throw new Error(chunkMZI4DG3S_js.translationsEn["pptx.export.errorNo2dContext"]);
|
|
7298
7312
|
}
|
|
7299
7313
|
const fps = 30;
|
|
7300
7314
|
const stream = recordingCanvas.captureStream(fps);
|
|
7301
7315
|
const recorder = new MediaRecorder(stream, {
|
|
7302
|
-
mimeType:
|
|
7316
|
+
mimeType: chunkAL2KLPOJ_js.pickSupportedMimeType([...chunkAL2KLPOJ_js.WEBM_MIME_CANDIDATES]),
|
|
7303
7317
|
videoBitsPerSecond: 5e6
|
|
7304
7318
|
});
|
|
7305
7319
|
const chunks = [];
|
|
@@ -7322,8 +7336,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7322
7336
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
7323
7337
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
7324
7338
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
7325
|
-
const frameInterval =
|
|
7326
|
-
const framesNeeded =
|
|
7339
|
+
const frameInterval = chunkAL2KLPOJ_js.fpsToFrameIntervalMs(fps);
|
|
7340
|
+
const framesNeeded = chunkAL2KLPOJ_js.segmentFrameCount(duration, fps);
|
|
7327
7341
|
for (let f = 0; f < framesNeeded; f++) {
|
|
7328
7342
|
if (signal?.aborted) {
|
|
7329
7343
|
recorder.stop();
|
|
@@ -7370,9 +7384,9 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7370
7384
|
}
|
|
7371
7385
|
setActiveSlide(currentSlideIndex);
|
|
7372
7386
|
if (frames.length === 0) {
|
|
7373
|
-
throw new Error(
|
|
7387
|
+
throw new Error(chunkMZI4DG3S_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
7374
7388
|
}
|
|
7375
|
-
const gifBytes =
|
|
7389
|
+
const gifBytes = chunkAL2KLPOJ_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
7376
7390
|
onProgress?.(totalSlides, totalSlides);
|
|
7377
7391
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
7378
7392
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -7426,7 +7440,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
7426
7440
|
continue;
|
|
7427
7441
|
}
|
|
7428
7442
|
onProgress?.(processedCount, data.slides.length);
|
|
7429
|
-
let svg =
|
|
7443
|
+
let svg = chunkAL2KLPOJ_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
7430
7444
|
if (embedFonts && fontFaces?.length) {
|
|
7431
7445
|
svg = injectFontFaces(svg, fontFaces);
|
|
7432
7446
|
}
|
|
@@ -7535,21 +7549,21 @@ function useExportHandlers(input) {
|
|
|
7535
7549
|
{
|
|
7536
7550
|
scale: imageExportScale,
|
|
7537
7551
|
onProgress: (current, total) => {
|
|
7538
|
-
setExportProgress(
|
|
7539
|
-
setExportStatusMessage(
|
|
7552
|
+
setExportProgress(chunkAL2KLPOJ_js.slideProgressPercent(current, total));
|
|
7553
|
+
setExportStatusMessage(chunkAL2KLPOJ_js.slideStatusLabel("Rendering", current, total));
|
|
7540
7554
|
},
|
|
7541
7555
|
signal: abortCtrl.signal
|
|
7542
7556
|
}
|
|
7543
7557
|
);
|
|
7544
|
-
setExportProgress(
|
|
7558
|
+
setExportProgress(chunkAL2KLPOJ_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7545
7559
|
setExportStatusMessage("Building PDF...");
|
|
7546
7560
|
await new Promise((r) => {
|
|
7547
7561
|
setTimeout(r, 100);
|
|
7548
7562
|
});
|
|
7549
|
-
setExportProgress(
|
|
7563
|
+
setExportProgress(chunkAL2KLPOJ_js.EXPORT_DONE_PERCENT);
|
|
7550
7564
|
setExportStatusMessage("Done!");
|
|
7551
7565
|
} catch (err) {
|
|
7552
|
-
if (!
|
|
7566
|
+
if (!chunkAL2KLPOJ_js.isExportAbortError(err)) {
|
|
7553
7567
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7554
7568
|
}
|
|
7555
7569
|
} finally {
|
|
@@ -7579,21 +7593,21 @@ function useExportHandlers(input) {
|
|
|
7579
7593
|
{
|
|
7580
7594
|
scale: imageExportScale,
|
|
7581
7595
|
onProgress: (current, total) => {
|
|
7582
|
-
setExportProgress(
|
|
7583
|
-
setExportStatusMessage(
|
|
7596
|
+
setExportProgress(chunkAL2KLPOJ_js.slideProgressPercent(current, total));
|
|
7597
|
+
setExportStatusMessage(chunkAL2KLPOJ_js.slideStatusLabel("Rendering", current, total));
|
|
7584
7598
|
},
|
|
7585
7599
|
signal: abortCtrl.signal
|
|
7586
7600
|
}
|
|
7587
7601
|
);
|
|
7588
|
-
setExportProgress(
|
|
7602
|
+
setExportProgress(chunkAL2KLPOJ_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7589
7603
|
setExportStatusMessage("Building PDF...");
|
|
7590
7604
|
await new Promise((r) => {
|
|
7591
7605
|
setTimeout(r, 100);
|
|
7592
7606
|
});
|
|
7593
|
-
setExportProgress(
|
|
7607
|
+
setExportProgress(chunkAL2KLPOJ_js.EXPORT_DONE_PERCENT);
|
|
7594
7608
|
setExportStatusMessage("Done!");
|
|
7595
7609
|
} catch (err) {
|
|
7596
|
-
if (!
|
|
7610
|
+
if (!chunkAL2KLPOJ_js.isExportAbortError(err)) {
|
|
7597
7611
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7598
7612
|
}
|
|
7599
7613
|
} finally {
|
|
@@ -7635,22 +7649,22 @@ function useExportHandlers(input) {
|
|
|
7635
7649
|
scale: 1,
|
|
7636
7650
|
slideDurationMs: 3e3,
|
|
7637
7651
|
onProgress: (current, total) => {
|
|
7638
|
-
setExportProgress(
|
|
7639
|
-
setExportStatusMessage(
|
|
7652
|
+
setExportProgress(chunkAL2KLPOJ_js.slideProgressPercent(current, total, 45));
|
|
7653
|
+
setExportStatusMessage(chunkAL2KLPOJ_js.slideStatusLabel("Capturing", current, total));
|
|
7640
7654
|
},
|
|
7641
7655
|
onRecordProgress: (current, total) => {
|
|
7642
|
-
setExportProgress(
|
|
7643
|
-
setExportStatusMessage(
|
|
7656
|
+
setExportProgress(chunkAL2KLPOJ_js.recordProgressPercent(current, total));
|
|
7657
|
+
setExportStatusMessage(chunkAL2KLPOJ_js.slideStatusLabel("Recording", current, total));
|
|
7644
7658
|
},
|
|
7645
7659
|
signal: abortCtrl.signal
|
|
7646
7660
|
}
|
|
7647
7661
|
);
|
|
7648
|
-
setExportProgress(
|
|
7662
|
+
setExportProgress(chunkAL2KLPOJ_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7649
7663
|
setExportStatusMessage("Saving file...");
|
|
7650
|
-
|
|
7651
|
-
setExportProgress(
|
|
7664
|
+
chunkAL2KLPOJ_js.downloadBlob(blob, "presentation.webm");
|
|
7665
|
+
setExportProgress(chunkAL2KLPOJ_js.EXPORT_DONE_PERCENT);
|
|
7652
7666
|
} catch (err) {
|
|
7653
|
-
if (!
|
|
7667
|
+
if (!chunkAL2KLPOJ_js.isExportAbortError(err)) {
|
|
7654
7668
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7655
7669
|
}
|
|
7656
7670
|
} finally {
|
|
@@ -7678,18 +7692,18 @@ function useExportHandlers(input) {
|
|
|
7678
7692
|
scale: 0.5,
|
|
7679
7693
|
slideDurationMs: 2e3,
|
|
7680
7694
|
onProgress: (current, total) => {
|
|
7681
|
-
setExportProgress(
|
|
7682
|
-
setExportStatusMessage(
|
|
7695
|
+
setExportProgress(chunkAL2KLPOJ_js.slideProgressPercent(current, total));
|
|
7696
|
+
setExportStatusMessage(chunkAL2KLPOJ_js.slideStatusLabel("Encoding", current, total));
|
|
7683
7697
|
},
|
|
7684
7698
|
signal: abortCtrl.signal
|
|
7685
7699
|
}
|
|
7686
7700
|
);
|
|
7687
|
-
setExportProgress(
|
|
7701
|
+
setExportProgress(chunkAL2KLPOJ_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7688
7702
|
setExportStatusMessage("Saving file...");
|
|
7689
|
-
|
|
7690
|
-
setExportProgress(
|
|
7703
|
+
chunkAL2KLPOJ_js.downloadBlob(blob, "presentation.gif");
|
|
7704
|
+
setExportProgress(chunkAL2KLPOJ_js.EXPORT_DONE_PERCENT);
|
|
7691
7705
|
} catch (err) {
|
|
7692
|
-
if (!
|
|
7706
|
+
if (!chunkAL2KLPOJ_js.isExportAbortError(err)) {
|
|
7693
7707
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7694
7708
|
}
|
|
7695
7709
|
} finally {
|
|
@@ -7722,7 +7736,7 @@ function useExportHandlers(input) {
|
|
|
7722
7736
|
exportStatusMessage
|
|
7723
7737
|
};
|
|
7724
7738
|
}
|
|
7725
|
-
var ViewerOptionsContext = react.createContext(
|
|
7739
|
+
var ViewerOptionsContext = react.createContext(chunkAL2KLPOJ_js.DEFAULT_VIEWER_OPTIONS);
|
|
7726
7740
|
function useViewerOptionsContext() {
|
|
7727
7741
|
return react.useContext(ViewerOptionsContext);
|
|
7728
7742
|
}
|
|
@@ -7734,13 +7748,13 @@ function usePrintHandlers(input) {
|
|
|
7734
7748
|
const { t } = reactI18next.useTranslation();
|
|
7735
7749
|
const viewerOptions = useViewerOptionsContext();
|
|
7736
7750
|
const includeHiddenSlides = viewerOptions.advanced.printHiddenSlides;
|
|
7737
|
-
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) *
|
|
7751
|
+
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) * chunkAL2KLPOJ_js.resolveImageResolutionScale(viewerOptions);
|
|
7738
7752
|
const handlePrint = () => {
|
|
7739
7753
|
setIsPrintDialogOpen(true);
|
|
7740
7754
|
};
|
|
7741
7755
|
const handlePrintSvg = async (settings) => {
|
|
7742
7756
|
setIsPrintDialogOpen(false);
|
|
7743
|
-
const printWindow =
|
|
7757
|
+
const printWindow = chunkAL2KLPOJ_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7744
7758
|
if (!printWindow) {
|
|
7745
7759
|
console.warn(
|
|
7746
7760
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7750,9 +7764,9 @@ function usePrintHandlers(input) {
|
|
|
7750
7764
|
if (!pptxData || settings.printWhat !== "slides") {
|
|
7751
7765
|
return runRasterPrint(printWindow, settings);
|
|
7752
7766
|
}
|
|
7753
|
-
const colorFilter =
|
|
7754
|
-
const slideIndices =
|
|
7755
|
-
|
|
7767
|
+
const colorFilter = chunkAL2KLPOJ_js.computeColorFilter(settings.colorMode);
|
|
7768
|
+
const slideIndices = chunkAL2KLPOJ_js.filterHiddenSlideIndices(
|
|
7769
|
+
chunkAL2KLPOJ_js.computeSlideIndices(
|
|
7756
7770
|
settings.slideRange,
|
|
7757
7771
|
activeSlideIndex,
|
|
7758
7772
|
slides.length,
|
|
@@ -7770,22 +7784,22 @@ function usePrintHandlers(input) {
|
|
|
7770
7784
|
printWindow.close();
|
|
7771
7785
|
return;
|
|
7772
7786
|
}
|
|
7773
|
-
const printDoc =
|
|
7787
|
+
const printDoc = chunkAL2KLPOJ_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7774
7788
|
title: "Slides (Vector)",
|
|
7775
7789
|
orientation: settings.orientation,
|
|
7776
7790
|
colorFilter,
|
|
7777
7791
|
scaleToFit: settings.scaleToFit
|
|
7778
7792
|
});
|
|
7779
|
-
|
|
7793
|
+
chunkAL2KLPOJ_js.finishPrintWindow(printWindow, printDoc);
|
|
7780
7794
|
} catch (err) {
|
|
7781
7795
|
console.warn("[PowerPointViewer] SVG print path failed, falling back to raster:", err);
|
|
7782
7796
|
return runRasterPrint(printWindow, settings);
|
|
7783
7797
|
}
|
|
7784
7798
|
};
|
|
7785
7799
|
const runRasterPrint = async (printWindow, settings) => {
|
|
7786
|
-
const colorFilter =
|
|
7787
|
-
const slideIndices =
|
|
7788
|
-
|
|
7800
|
+
const colorFilter = chunkAL2KLPOJ_js.computeColorFilter(settings.colorMode);
|
|
7801
|
+
const slideIndices = chunkAL2KLPOJ_js.filterHiddenSlideIndices(
|
|
7802
|
+
chunkAL2KLPOJ_js.computeSlideIndices(
|
|
7789
7803
|
settings.slideRange,
|
|
7790
7804
|
activeSlideIndex,
|
|
7791
7805
|
slides.length,
|
|
@@ -7796,11 +7810,11 @@ function usePrintHandlers(input) {
|
|
|
7796
7810
|
includeHiddenSlides
|
|
7797
7811
|
);
|
|
7798
7812
|
if (settings.printWhat === "outline") {
|
|
7799
|
-
|
|
7813
|
+
chunkAL2KLPOJ_js.finishPrintWindow(
|
|
7800
7814
|
printWindow,
|
|
7801
|
-
|
|
7815
|
+
chunkAL2KLPOJ_js.buildPrintHtmlDocument({
|
|
7802
7816
|
title: "Outline",
|
|
7803
|
-
bodyHtml: `<div class="outline-page">${
|
|
7817
|
+
bodyHtml: `<div class="outline-page">${chunkAL2KLPOJ_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7804
7818
|
orientation: settings.orientation,
|
|
7805
7819
|
colorFilter,
|
|
7806
7820
|
frameSlides: settings.frameSlides,
|
|
@@ -7827,11 +7841,11 @@ function usePrintHandlers(input) {
|
|
|
7827
7841
|
}
|
|
7828
7842
|
const slideImages = slideIndices.map((idx) => allImages[idx]).filter(Boolean);
|
|
7829
7843
|
if (settings.printWhat === "slides") {
|
|
7830
|
-
|
|
7844
|
+
chunkAL2KLPOJ_js.finishPrintWindow(
|
|
7831
7845
|
printWindow,
|
|
7832
|
-
|
|
7846
|
+
chunkAL2KLPOJ_js.buildPrintHtmlDocument({
|
|
7833
7847
|
title: "Slides",
|
|
7834
|
-
bodyHtml:
|
|
7848
|
+
bodyHtml: chunkAL2KLPOJ_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7835
7849
|
orientation: settings.orientation,
|
|
7836
7850
|
colorFilter,
|
|
7837
7851
|
frameSlides: settings.frameSlides,
|
|
@@ -7841,11 +7855,11 @@ function usePrintHandlers(input) {
|
|
|
7841
7855
|
return;
|
|
7842
7856
|
}
|
|
7843
7857
|
if (settings.printWhat === "notes") {
|
|
7844
|
-
|
|
7858
|
+
chunkAL2KLPOJ_js.finishPrintWindow(
|
|
7845
7859
|
printWindow,
|
|
7846
|
-
|
|
7860
|
+
chunkAL2KLPOJ_js.buildPrintHtmlDocument({
|
|
7847
7861
|
title: "Notes Pages",
|
|
7848
|
-
bodyHtml:
|
|
7862
|
+
bodyHtml: chunkAL2KLPOJ_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7849
7863
|
orientation: "portrait",
|
|
7850
7864
|
colorFilter,
|
|
7851
7865
|
frameSlides: settings.frameSlides,
|
|
@@ -7856,11 +7870,11 @@ function usePrintHandlers(input) {
|
|
|
7856
7870
|
}
|
|
7857
7871
|
if (settings.printWhat === "handouts") {
|
|
7858
7872
|
const spp = settings.slidesPerPage;
|
|
7859
|
-
|
|
7873
|
+
chunkAL2KLPOJ_js.finishPrintWindow(
|
|
7860
7874
|
printWindow,
|
|
7861
|
-
|
|
7875
|
+
chunkAL2KLPOJ_js.buildPrintHtmlDocument({
|
|
7862
7876
|
title: `Handout ${spp} per page`,
|
|
7863
|
-
bodyHtml:
|
|
7877
|
+
bodyHtml: chunkAL2KLPOJ_js.buildHandoutsHtml(slideImages, slideIndices, spp, pptxData?.handoutMaster),
|
|
7864
7878
|
orientation: "portrait",
|
|
7865
7879
|
colorFilter,
|
|
7866
7880
|
frameSlides: settings.frameSlides,
|
|
@@ -7874,7 +7888,7 @@ function usePrintHandlers(input) {
|
|
|
7874
7888
|
};
|
|
7875
7889
|
const handlePrintWithSettings = async (settings) => {
|
|
7876
7890
|
setIsPrintDialogOpen(false);
|
|
7877
|
-
const printWindow =
|
|
7891
|
+
const printWindow = chunkAL2KLPOJ_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7878
7892
|
if (!printWindow) {
|
|
7879
7893
|
console.warn(
|
|
7880
7894
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7939,13 +7953,13 @@ function useThemeHandlers(input) {
|
|
|
7939
7953
|
return;
|
|
7940
7954
|
}
|
|
7941
7955
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7942
|
-
const previousMap = theme?.colorScheme ?
|
|
7943
|
-
setSlides((prev) =>
|
|
7956
|
+
const previousMap = theme?.colorScheme ? chunkAL2KLPOJ_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7957
|
+
setSlides((prev) => chunkAL2KLPOJ_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7944
7958
|
if (Object.keys(templateElementsBySlideId).length > 0) {
|
|
7945
7959
|
setTemplateElementsBySlideId((prev) => {
|
|
7946
7960
|
const next = {};
|
|
7947
7961
|
for (const [slideId, elements] of Object.entries(prev)) {
|
|
7948
|
-
next[slideId] =
|
|
7962
|
+
next[slideId] = chunkAL2KLPOJ_js.reResolveElementColors(elements, previousMap, colorScheme);
|
|
7949
7963
|
}
|
|
7950
7964
|
return next;
|
|
7951
7965
|
});
|
|
@@ -8054,7 +8068,7 @@ function useThemeSwitching(input) {
|
|
|
8054
8068
|
}
|
|
8055
8069
|
try {
|
|
8056
8070
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
8057
|
-
const newData =
|
|
8071
|
+
const newData = chunkAL2KLPOJ_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
8058
8072
|
onDataChange(newData);
|
|
8059
8073
|
onThemeChanged?.(preset);
|
|
8060
8074
|
} catch (error) {
|
|
@@ -8071,7 +8085,7 @@ function useThemeSwitching(input) {
|
|
|
8071
8085
|
}
|
|
8072
8086
|
try {
|
|
8073
8087
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
8074
|
-
const newData =
|
|
8088
|
+
const newData = chunkAL2KLPOJ_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
8075
8089
|
onDataChange(newData);
|
|
8076
8090
|
} catch (error) {
|
|
8077
8091
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -8083,12 +8097,12 @@ function useThemeSwitching(input) {
|
|
|
8083
8097
|
if (!data?.theme?.colorScheme) {
|
|
8084
8098
|
return void 0;
|
|
8085
8099
|
}
|
|
8086
|
-
return
|
|
8087
|
-
(p) =>
|
|
8100
|
+
return chunkAL2KLPOJ_js.THEME_PRESETS.find(
|
|
8101
|
+
(p) => chunkAL2KLPOJ_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
8088
8102
|
);
|
|
8089
8103
|
}, [data?.theme?.colorScheme]);
|
|
8090
8104
|
return {
|
|
8091
|
-
presets:
|
|
8105
|
+
presets: chunkAL2KLPOJ_js.THEME_PRESETS,
|
|
8092
8106
|
switchToPreset,
|
|
8093
8107
|
switchToCustom,
|
|
8094
8108
|
currentPreset
|
|
@@ -8163,7 +8177,7 @@ function usePropertyHandlers(input) {
|
|
|
8163
8177
|
}
|
|
8164
8178
|
try {
|
|
8165
8179
|
const ab = await file.arrayBuffer();
|
|
8166
|
-
const h = new
|
|
8180
|
+
const h = new chunkAL2KLPOJ_js.PptxHandler();
|
|
8167
8181
|
const other = await h.load(ab);
|
|
8168
8182
|
if (!other) {
|
|
8169
8183
|
return;
|
|
@@ -8173,7 +8187,7 @@ function usePropertyHandlers(input) {
|
|
|
8173
8187
|
width: canvasSize.width,
|
|
8174
8188
|
height: canvasSize.height
|
|
8175
8189
|
};
|
|
8176
|
-
setCompareResult(
|
|
8190
|
+
setCompareResult(chunkAL2KLPOJ_js.comparePresentation(cur, other));
|
|
8177
8191
|
setIsComparePanelOpen(true);
|
|
8178
8192
|
} catch (err) {
|
|
8179
8193
|
console.warn("Compare failed:", err);
|
|
@@ -8190,7 +8204,7 @@ function usePropertyHandlers(input) {
|
|
|
8190
8204
|
if (!diff || diff.status === "unchanged") {
|
|
8191
8205
|
return;
|
|
8192
8206
|
}
|
|
8193
|
-
setSlides((prev) =>
|
|
8207
|
+
setSlides((prev) => chunkAL2KLPOJ_js.applyAcceptSlide(prev, diff));
|
|
8194
8208
|
setIsDirty(true);
|
|
8195
8209
|
},
|
|
8196
8210
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -8201,10 +8215,10 @@ function usePropertyHandlers(input) {
|
|
|
8201
8215
|
if (!compareResult) {
|
|
8202
8216
|
return;
|
|
8203
8217
|
}
|
|
8204
|
-
setSlides((prev) =>
|
|
8218
|
+
setSlides((prev) => chunkAL2KLPOJ_js.applyAcceptAllSlides(prev, compareResult));
|
|
8205
8219
|
setIsDirty(true);
|
|
8206
8220
|
}, [compareResult, setSlides, setIsDirty]);
|
|
8207
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
8221
|
+
const usedFontFamilies = react.useMemo(() => chunkAL2KLPOJ_js.collectUsedFonts(slides), [slides]);
|
|
8208
8222
|
return {
|
|
8209
8223
|
handleUpdateNotes,
|
|
8210
8224
|
handleUpdateSlide,
|
|
@@ -8359,7 +8373,7 @@ function useViewerDialogs(input) {
|
|
|
8359
8373
|
);
|
|
8360
8374
|
const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
|
|
8361
8375
|
const fontEmbedding = react.useMemo(
|
|
8362
|
-
() =>
|
|
8376
|
+
() => chunkAL2KLPOJ_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
|
|
8363
8377
|
[embeddedFontKey]
|
|
8364
8378
|
);
|
|
8365
8379
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
|
|
@@ -8369,11 +8383,11 @@ function useViewerDialogs(input) {
|
|
|
8369
8383
|
setEmbedFontsEnabled(fontEmbedding.initialEnabled);
|
|
8370
8384
|
}
|
|
8371
8385
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8372
|
-
() => typeof window !== "undefined" ?
|
|
8386
|
+
() => typeof window !== "undefined" ? chunkAL2KLPOJ_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8373
8387
|
);
|
|
8374
8388
|
react.useEffect(() => {
|
|
8375
8389
|
const handleWindow = () => setIsNarrowViewport(
|
|
8376
|
-
|
|
8390
|
+
chunkAL2KLPOJ_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8377
8391
|
);
|
|
8378
8392
|
window.addEventListener("resize", handleWindow);
|
|
8379
8393
|
return () => window.removeEventListener("resize", handleWindow);
|
|
@@ -8526,16 +8540,16 @@ function useViewerDialogs(input) {
|
|
|
8526
8540
|
};
|
|
8527
8541
|
}
|
|
8528
8542
|
function computeGridSpacingPx2(documentGridSpacing) {
|
|
8529
|
-
return
|
|
8543
|
+
return chunkAL2KLPOJ_js.computeGridSpacingPx(documentGridSpacing, chunk7VPDHSWF_js.GRID_SIZE);
|
|
8530
8544
|
}
|
|
8531
8545
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows, presentationProperties) {
|
|
8532
8546
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8533
|
-
const authoredRange =
|
|
8534
|
-
return
|
|
8547
|
+
const authoredRange = chunkAL2KLPOJ_js.resolveAuthoredSlideRange(presentationProperties, slides.length);
|
|
8548
|
+
return chunkAL2KLPOJ_js.resolveShowSlideIndexes(slides, activeShow, authoredRange);
|
|
8535
8549
|
}
|
|
8536
8550
|
function computeSlideSectionGroups(slides, sections) {
|
|
8537
|
-
return
|
|
8538
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8551
|
+
return chunkAL2KLPOJ_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8552
|
+
id: group.section?.id ?? (sections.length > 0 ? chunk7VPDHSWF_js.UNGROUPED_SECTION_ID : chunk7VPDHSWF_js.DEFAULT_SECTION_GROUP_ID),
|
|
8539
8553
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8540
8554
|
slideIndexes: group.slideIndexes,
|
|
8541
8555
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8547,7 +8561,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
|
8547
8561
|
return void 0;
|
|
8548
8562
|
}
|
|
8549
8563
|
const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
|
|
8550
|
-
return
|
|
8564
|
+
return chunkAL2KLPOJ_js.masterViewPseudoSlide(document2, {
|
|
8551
8565
|
tab: "slides",
|
|
8552
8566
|
masterIndex: 0,
|
|
8553
8567
|
layoutIndex: activeLayout ? 0 : null
|
|
@@ -8575,15 +8589,15 @@ function useDerivedSlideState(input) {
|
|
|
8575
8589
|
[slides, activeCustomShowId, customShows, presentationProperties]
|
|
8576
8590
|
);
|
|
8577
8591
|
const authoredRange = react.useMemo(
|
|
8578
|
-
() =>
|
|
8592
|
+
() => chunkAL2KLPOJ_js.resolveAuthoredSlideRange(presentationProperties, slides.length),
|
|
8579
8593
|
[presentationProperties, slides.length]
|
|
8580
8594
|
);
|
|
8581
8595
|
const slideSectionGroups = react.useMemo(
|
|
8582
8596
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8583
|
-
if (group.id ===
|
|
8597
|
+
if (group.id === chunk7VPDHSWF_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8584
8598
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8585
8599
|
}
|
|
8586
|
-
if (group.id ===
|
|
8600
|
+
if (group.id === chunk7VPDHSWF_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
8587
8601
|
return { ...group, label: t("pptx.sections.slides") };
|
|
8588
8602
|
}
|
|
8589
8603
|
return group;
|
|
@@ -8684,13 +8698,13 @@ function useAnnotationHandlers(input) {
|
|
|
8684
8698
|
}, [annotations, setMode, setSlides, history]);
|
|
8685
8699
|
const handleSetMode = react.useCallback(
|
|
8686
8700
|
(nextMode) => {
|
|
8687
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8701
|
+
if (mode === "present" && nextMode !== "present" && !chunkAL2KLPOJ_js.mayLeaveSlideShow()) {
|
|
8688
8702
|
return;
|
|
8689
8703
|
}
|
|
8690
8704
|
if (nextMode === "present") {
|
|
8691
8705
|
presentation.enterPresentMode();
|
|
8692
8706
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8693
|
-
|
|
8707
|
+
chunkAL2KLPOJ_js.stopAllPersistentAudio();
|
|
8694
8708
|
if (promptKeepInkAnnotations) {
|
|
8695
8709
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8696
8710
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8700,7 +8714,7 @@ function useAnnotationHandlers(input) {
|
|
|
8700
8714
|
}
|
|
8701
8715
|
} else {
|
|
8702
8716
|
if (mode === "present") {
|
|
8703
|
-
|
|
8717
|
+
chunkAL2KLPOJ_js.stopAllPersistentAudio();
|
|
8704
8718
|
}
|
|
8705
8719
|
setMode(nextMode);
|
|
8706
8720
|
}
|
|
@@ -8765,13 +8779,13 @@ function useSerialize(input) {
|
|
|
8765
8779
|
let processedSlide = slide;
|
|
8766
8780
|
if (pendingEditId) {
|
|
8767
8781
|
const updatedElements = slide.elements.map((el) => {
|
|
8768
|
-
if (el.id !== pendingEditId || !
|
|
8782
|
+
if (el.id !== pendingEditId || !chunkAL2KLPOJ_js.hasTextProperties(el)) {
|
|
8769
8783
|
return el;
|
|
8770
8784
|
}
|
|
8771
8785
|
return {
|
|
8772
8786
|
...el,
|
|
8773
8787
|
text: pendingEditText,
|
|
8774
|
-
textSegments:
|
|
8788
|
+
textSegments: chunkAL2KLPOJ_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8775
8789
|
};
|
|
8776
8790
|
});
|
|
8777
8791
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8784,19 +8798,19 @@ function useSerialize(input) {
|
|
|
8784
8798
|
const pptxGuides = guides.map((g) => ({
|
|
8785
8799
|
id: g.id,
|
|
8786
8800
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8787
|
-
positionEmu:
|
|
8801
|
+
positionEmu: chunkAL2KLPOJ_js.guidePxToEmu(g.position)
|
|
8788
8802
|
}));
|
|
8789
8803
|
return {
|
|
8790
8804
|
...processedSlide,
|
|
8791
8805
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8792
8806
|
};
|
|
8793
8807
|
});
|
|
8794
|
-
const slidesToSave =
|
|
8808
|
+
const slidesToSave = chunkAL2KLPOJ_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8795
8809
|
const saveOptions = {
|
|
8796
8810
|
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
8797
8811
|
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
8798
8812
|
// slide-size edit reaches the file.
|
|
8799
|
-
slideSize:
|
|
8813
|
+
slideSize: chunkAL2KLPOJ_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
8800
8814
|
headerFooter,
|
|
8801
8815
|
presentationProperties,
|
|
8802
8816
|
viewProperties,
|
|
@@ -8809,9 +8823,9 @@ function useSerialize(input) {
|
|
|
8809
8823
|
slideMasters,
|
|
8810
8824
|
notesMaster,
|
|
8811
8825
|
handoutMaster,
|
|
8812
|
-
...
|
|
8826
|
+
...chunkAL2KLPOJ_js.embeddedFontSaveOptions(embedFonts)
|
|
8813
8827
|
};
|
|
8814
|
-
return
|
|
8828
|
+
return chunkAL2KLPOJ_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
|
|
8815
8829
|
}, [
|
|
8816
8830
|
slides,
|
|
8817
8831
|
templateElementsBySlideId,
|
|
@@ -8847,7 +8861,7 @@ function useRecoveryDetection(input) {
|
|
|
8847
8861
|
const onRestore = input.onRestore;
|
|
8848
8862
|
const openVersionHistory = input.openVersionHistory;
|
|
8849
8863
|
react.useEffect(() => {
|
|
8850
|
-
if (!
|
|
8864
|
+
if (!chunkAL2KLPOJ_js.shouldProbeAutosaveRecovery({
|
|
8851
8865
|
alreadyChecked: recoveryCheckedRef.current,
|
|
8852
8866
|
filePath,
|
|
8853
8867
|
loading,
|
|
@@ -8859,7 +8873,7 @@ function useRecoveryDetection(input) {
|
|
|
8859
8873
|
}
|
|
8860
8874
|
recoveryCheckedRef.current = true;
|
|
8861
8875
|
void (async () => {
|
|
8862
|
-
const offer = await
|
|
8876
|
+
const offer = await chunkAL2KLPOJ_js.probeAutosaveRecovery(filePath);
|
|
8863
8877
|
if (!offer) {
|
|
8864
8878
|
return;
|
|
8865
8879
|
}
|
|
@@ -8872,7 +8886,7 @@ function useRecoveryDetection(input) {
|
|
|
8872
8886
|
const record = recordRef.current;
|
|
8873
8887
|
setPrompt(null);
|
|
8874
8888
|
if (record && onRestore) {
|
|
8875
|
-
onRestore(
|
|
8889
|
+
onRestore(chunkAL2KLPOJ_js.acceptAutosaveRecovery(record));
|
|
8876
8890
|
}
|
|
8877
8891
|
recordRef.current = null;
|
|
8878
8892
|
}, [onRestore]);
|
|
@@ -8881,7 +8895,7 @@ function useRecoveryDetection(input) {
|
|
|
8881
8895
|
setPrompt(null);
|
|
8882
8896
|
recordRef.current = null;
|
|
8883
8897
|
if (record) {
|
|
8884
|
-
void
|
|
8898
|
+
void chunkAL2KLPOJ_js.discardAutosaveRecovery(record);
|
|
8885
8899
|
}
|
|
8886
8900
|
}, []);
|
|
8887
8901
|
return { prompt, restore, discard };
|
|
@@ -8925,11 +8939,11 @@ function usePresentationSetup(input) {
|
|
|
8925
8939
|
containerRef,
|
|
8926
8940
|
content,
|
|
8927
8941
|
onSetMode: (nextMode) => {
|
|
8928
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8942
|
+
if (mode === "present" && nextMode !== "present" && !chunkAL2KLPOJ_js.mayLeaveSlideShow()) {
|
|
8929
8943
|
return;
|
|
8930
8944
|
}
|
|
8931
8945
|
if (mode === "present" && nextMode !== "present") {
|
|
8932
|
-
|
|
8946
|
+
chunkAL2KLPOJ_js.stopAllPersistentAudio();
|
|
8933
8947
|
stopAnimationSound();
|
|
8934
8948
|
const exitHandler = exitModeHandlerRef.current;
|
|
8935
8949
|
if (exitHandler) {
|
|
@@ -8943,6 +8957,12 @@ function usePresentationSetup(input) {
|
|
|
8943
8957
|
setMode(nextMode);
|
|
8944
8958
|
},
|
|
8945
8959
|
onSetActiveSlideIndex: setActiveSlideIndex,
|
|
8960
|
+
// `p:sndAc/p:endSnd` ("Stop Previous Sound"): silences whatever transition
|
|
8961
|
+
// sound is currently looping. A non-looping transition sound plays through
|
|
8962
|
+
// its own ad hoc `Audio` below rather than this singleton (it finishes on
|
|
8963
|
+
// its own in a few seconds either way), so only the loop case is stoppable
|
|
8964
|
+
// here - matching the common "Loop Until Next Sound... then Stop" pairing.
|
|
8965
|
+
onStopActionSound: () => stopAnimationSound(),
|
|
8946
8966
|
onPlayActionSound: (soundPath, options) => {
|
|
8947
8967
|
void (async () => {
|
|
8948
8968
|
if (!soundPath) {
|
|
@@ -8991,10 +9011,10 @@ function usePresentationSetup(input) {
|
|
|
8991
9011
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8992
9012
|
onToggleSubtitles,
|
|
8993
9013
|
onSaveRehearsalTimings: (timings) => {
|
|
8994
|
-
setSlides((prev) =>
|
|
9014
|
+
setSlides((prev) => chunkAL2KLPOJ_js.applyRehearsalTimings(prev, timings));
|
|
8995
9015
|
history.markDirty();
|
|
8996
9016
|
},
|
|
8997
|
-
loopContinuously:
|
|
9017
|
+
loopContinuously: chunkAL2KLPOJ_js.shouldLoopContinuously(presentationProperties),
|
|
8998
9018
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8999
9019
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
9000
9020
|
endWithBlackSlide,
|
|
@@ -9200,7 +9220,7 @@ function useEditorOperations(input) {
|
|
|
9200
9220
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
9201
9221
|
react.useEffect(() => {
|
|
9202
9222
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9203
|
-
copiedFormatRef.current =
|
|
9223
|
+
copiedFormatRef.current = chunkAL2KLPOJ_js.copyFormatFromElement(selectedElement);
|
|
9204
9224
|
} else if (!formatPainterActive) {
|
|
9205
9225
|
copiedFormatRef.current = null;
|
|
9206
9226
|
}
|
|
@@ -9226,12 +9246,12 @@ function useEditorOperations(input) {
|
|
|
9226
9246
|
e.stopPropagation();
|
|
9227
9247
|
const element = elementLookup.get(elementId);
|
|
9228
9248
|
if (element) {
|
|
9229
|
-
const updated =
|
|
9249
|
+
const updated = chunkAL2KLPOJ_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
9230
9250
|
const updates = {};
|
|
9231
|
-
if (
|
|
9251
|
+
if (chunkAL2KLPOJ_js.hasShapeProperties(updated)) {
|
|
9232
9252
|
updates.shapeStyle = updated.shapeStyle;
|
|
9233
9253
|
}
|
|
9234
|
-
if (
|
|
9254
|
+
if (chunkAL2KLPOJ_js.hasTextProperties(updated)) {
|
|
9235
9255
|
updates.textStyle = updated.textStyle;
|
|
9236
9256
|
}
|
|
9237
9257
|
ops.updateElementById(elementId, updates);
|
|
@@ -9419,10 +9439,10 @@ function useFontInjection({ embeddedFonts, slides }) {
|
|
|
9419
9439
|
}
|
|
9420
9440
|
};
|
|
9421
9441
|
}, [embeddedFonts]);
|
|
9422
|
-
const referencedFamilies = react.useMemo(() =>
|
|
9442
|
+
const referencedFamilies = react.useMemo(() => chunkAL2KLPOJ_js.collectReferencedFontFamilies(slides), [slides]);
|
|
9423
9443
|
react.useEffect(() => {
|
|
9424
9444
|
let cancelled = false;
|
|
9425
|
-
void
|
|
9445
|
+
void chunkAL2KLPOJ_js.resolveGoogleWebfontHref(slides, embeddedFonts).then((href) => {
|
|
9426
9446
|
if (cancelled) {
|
|
9427
9447
|
return null;
|
|
9428
9448
|
}
|
|
@@ -9605,7 +9625,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9605
9625
|
inputRef.current = input;
|
|
9606
9626
|
const handleKeyDown = react.useCallback((e) => {
|
|
9607
9627
|
const current = inputRef.current;
|
|
9608
|
-
const startAction =
|
|
9628
|
+
const startAction = chunkAL2KLPOJ_js.mapSlideShowStartKey(e, { isPresenting: current.mode === "present" });
|
|
9609
9629
|
if (startAction !== null) {
|
|
9610
9630
|
e.preventDefault();
|
|
9611
9631
|
if (startAction === "fromBeginning") {
|
|
@@ -9615,7 +9635,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9615
9635
|
}
|
|
9616
9636
|
return;
|
|
9617
9637
|
}
|
|
9618
|
-
const { action, dx, dy } =
|
|
9638
|
+
const { action, dx, dy } = chunkAL2KLPOJ_js.mapEditorKey(e, {
|
|
9619
9639
|
canEdit: current.canEdit,
|
|
9620
9640
|
// The Slide Master view is an editing surface, not a viewing one.
|
|
9621
9641
|
// Gating on `mode !== 'edit'` alone made `mapEditorKey` return
|
|
@@ -9628,7 +9648,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9628
9648
|
hasSelection: current.hasSelection,
|
|
9629
9649
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9630
9650
|
isDrawing: current.activeTool !== "select",
|
|
9631
|
-
isTextInputTarget:
|
|
9651
|
+
isTextInputTarget: chunkAL2KLPOJ_js.isEditorTextInputTarget(e.target)
|
|
9632
9652
|
});
|
|
9633
9653
|
if (action === null) {
|
|
9634
9654
|
return;
|
|
@@ -9956,7 +9976,7 @@ function useViewerIntegration(input) {
|
|
|
9956
9976
|
return zoom.scale;
|
|
9957
9977
|
},
|
|
9958
9978
|
setZoom(level) {
|
|
9959
|
-
zoom.setScale(
|
|
9979
|
+
zoom.setScale(chunkAL2KLPOJ_js.clampZoomScale(level));
|
|
9960
9980
|
},
|
|
9961
9981
|
zoomIn() {
|
|
9962
9982
|
zoom.handleZoomIn();
|
|
@@ -10174,7 +10194,7 @@ function useReducedMotion() {
|
|
|
10174
10194
|
}
|
|
10175
10195
|
function useViewerOptions() {
|
|
10176
10196
|
const storeRef = react.useRef(null);
|
|
10177
|
-
storeRef.current ??=
|
|
10197
|
+
storeRef.current ??= chunkAL2KLPOJ_js.createViewerOptionsStore();
|
|
10178
10198
|
const store = storeRef.current;
|
|
10179
10199
|
const options = react.useSyncExternalStore(
|
|
10180
10200
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -10183,9 +10203,9 @@ function useViewerOptions() {
|
|
|
10183
10203
|
);
|
|
10184
10204
|
return { optionsStore: store, options };
|
|
10185
10205
|
}
|
|
10186
|
-
var KNOWN_TAB_IDS = new Set(
|
|
10206
|
+
var KNOWN_TAB_IDS = new Set(chunkAL2KLPOJ_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
10187
10207
|
function computeToolbarVisibility(hiddenActions, hiddenTabIds = []) {
|
|
10188
|
-
const isHidden = (id) =>
|
|
10208
|
+
const isHidden = (id) => chunkAL2KLPOJ_js.isActionHidden(id, hiddenActions);
|
|
10189
10209
|
const userHidden = new Set(hiddenTabIds);
|
|
10190
10210
|
userHidden.delete("file");
|
|
10191
10211
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id) && !userHidden.has(id);
|
|
@@ -10277,12 +10297,12 @@ function useYjsDocumentSync({
|
|
|
10277
10297
|
return;
|
|
10278
10298
|
}
|
|
10279
10299
|
try {
|
|
10280
|
-
const handler = new
|
|
10300
|
+
const handler = new chunkAL2KLPOJ_js.PptxHandler();
|
|
10281
10301
|
await handler.load(sourceBytes.buffer);
|
|
10282
|
-
const currentSlides =
|
|
10302
|
+
const currentSlides = chunkAL2KLPOJ_js.readSlidesFromYDoc(
|
|
10283
10303
|
doc
|
|
10284
10304
|
);
|
|
10285
|
-
const slidesToSave =
|
|
10305
|
+
const slidesToSave = chunkAL2KLPOJ_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10286
10306
|
const bytes = await handler.save(slidesToSave);
|
|
10287
10307
|
config.onWriteBack(bytes);
|
|
10288
10308
|
} catch {
|
|
@@ -10297,10 +10317,10 @@ function useYjsDocumentSync({
|
|
|
10297
10317
|
if (!doc || !isConnected) {
|
|
10298
10318
|
return;
|
|
10299
10319
|
}
|
|
10300
|
-
const docSlides =
|
|
10320
|
+
const docSlides = chunkAL2KLPOJ_js.readSlidesFromYDoc(
|
|
10301
10321
|
doc
|
|
10302
10322
|
);
|
|
10303
|
-
if (!
|
|
10323
|
+
if (!chunkAL2KLPOJ_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
|
|
10304
10324
|
return;
|
|
10305
10325
|
}
|
|
10306
10326
|
lastSyncedRef.current = JSON.stringify(docSlides);
|
|
@@ -10319,11 +10339,11 @@ function useYjsDocumentSync({
|
|
|
10319
10339
|
lastSyncedRef.current = serialized;
|
|
10320
10340
|
void (async () => {
|
|
10321
10341
|
const factories = await getFactories();
|
|
10322
|
-
|
|
10342
|
+
chunkAL2KLPOJ_js.reconcileSlidesInYDoc(
|
|
10323
10343
|
slides,
|
|
10324
10344
|
doc,
|
|
10325
10345
|
factories,
|
|
10326
|
-
|
|
10346
|
+
chunkAL2KLPOJ_js.LOCAL_SYNC_ORIGIN
|
|
10327
10347
|
);
|
|
10328
10348
|
scheduleWriteBack();
|
|
10329
10349
|
})();
|
|
@@ -10337,10 +10357,10 @@ function useYjsDocumentSync({
|
|
|
10337
10357
|
return;
|
|
10338
10358
|
}
|
|
10339
10359
|
const handleChange = (_events, transaction) => {
|
|
10340
|
-
if (transaction?.origin ===
|
|
10360
|
+
if (transaction?.origin === chunkAL2KLPOJ_js.LOCAL_SYNC_ORIGIN) {
|
|
10341
10361
|
return;
|
|
10342
10362
|
}
|
|
10343
|
-
const remoteSlides =
|
|
10363
|
+
const remoteSlides = chunkAL2KLPOJ_js.readSlidesFromYDoc(
|
|
10344
10364
|
doc
|
|
10345
10365
|
);
|
|
10346
10366
|
if (remoteSlides.length === 0) {
|
|
@@ -10356,7 +10376,7 @@ function useYjsDocumentSync({
|
|
|
10356
10376
|
isApplyingRemoteRef.current = false;
|
|
10357
10377
|
scheduleWriteBack();
|
|
10358
10378
|
};
|
|
10359
|
-
const unobserve =
|
|
10379
|
+
const unobserve = chunkAL2KLPOJ_js.observeYDocSlides(
|
|
10360
10380
|
doc,
|
|
10361
10381
|
handleChange
|
|
10362
10382
|
);
|
|
@@ -10394,7 +10414,7 @@ function useBroadcastFollower({
|
|
|
10394
10414
|
if (!broadcaster) {
|
|
10395
10415
|
return;
|
|
10396
10416
|
}
|
|
10397
|
-
if (!
|
|
10417
|
+
if (!chunkAL2KLPOJ_js.shouldAutoFollowBroadcaster({
|
|
10398
10418
|
localRole: collab.config.role,
|
|
10399
10419
|
broadcasterRole: broadcaster.role
|
|
10400
10420
|
})) {
|
|
@@ -10565,7 +10585,7 @@ function subscribeTouchCapability(callback) {
|
|
|
10565
10585
|
function useIsMobile() {
|
|
10566
10586
|
const isTouchDevice = react.useSyncExternalStore(
|
|
10567
10587
|
subscribeTouchCapability,
|
|
10568
|
-
|
|
10588
|
+
chunkAL2KLPOJ_js.detectTouchDevice,
|
|
10569
10589
|
() => false
|
|
10570
10590
|
// server snapshot
|
|
10571
10591
|
);
|
|
@@ -10575,7 +10595,7 @@ function useIsMobile() {
|
|
|
10575
10595
|
const [viewportHeight, setViewportHeight] = react.useState(
|
|
10576
10596
|
() => typeof window === "undefined" ? 768 : window.innerHeight
|
|
10577
10597
|
);
|
|
10578
|
-
const [orientation, setOrientation] = react.useState(
|
|
10598
|
+
const [orientation, setOrientation] = react.useState(chunkAL2KLPOJ_js.detectOrientation);
|
|
10579
10599
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
10580
10600
|
const [initialViewportHeight] = react.useState(
|
|
10581
10601
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -10596,7 +10616,7 @@ function useIsMobile() {
|
|
|
10596
10616
|
return;
|
|
10597
10617
|
}
|
|
10598
10618
|
const handleOrientationChange = () => {
|
|
10599
|
-
setOrientation(
|
|
10619
|
+
setOrientation(chunkAL2KLPOJ_js.detectOrientation());
|
|
10600
10620
|
};
|
|
10601
10621
|
if (screen.orientation) {
|
|
10602
10622
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -10626,7 +10646,7 @@ function useIsMobile() {
|
|
|
10626
10646
|
window.addEventListener("resize", handleResize);
|
|
10627
10647
|
return () => window.removeEventListener("resize", handleResize);
|
|
10628
10648
|
}, [isTouchDevice, initialViewportHeight]);
|
|
10629
|
-
const { isMobile, isTablet, isDesktop } =
|
|
10649
|
+
const { isMobile, isTablet, isDesktop } = chunkAL2KLPOJ_js.deriveViewportBreakpoints(
|
|
10630
10650
|
viewportWidth,
|
|
10631
10651
|
viewportHeight,
|
|
10632
10652
|
isTouchDevice
|
|
@@ -10657,10 +10677,10 @@ function useTouchGestures(input) {
|
|
|
10657
10677
|
if (!el || !enabled) {
|
|
10658
10678
|
return;
|
|
10659
10679
|
}
|
|
10660
|
-
const recognizer =
|
|
10680
|
+
const recognizer = chunkAL2KLPOJ_js.createTouchGestureRecognizer({
|
|
10661
10681
|
getScale: () => scaleRef.current,
|
|
10662
|
-
minScale:
|
|
10663
|
-
maxScale:
|
|
10682
|
+
minScale: chunkAL2KLPOJ_js.MIN_ZOOM_SCALE,
|
|
10683
|
+
maxScale: chunkAL2KLPOJ_js.MAX_ZOOM_SCALE,
|
|
10664
10684
|
callbacks: {
|
|
10665
10685
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10666
10686
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10700,7 +10720,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10700
10720
|
return;
|
|
10701
10721
|
}
|
|
10702
10722
|
const rect = active.getBoundingClientRect();
|
|
10703
|
-
const delta =
|
|
10723
|
+
const delta = chunkAL2KLPOJ_js.computeScrollDelta(
|
|
10704
10724
|
{ top: rect.top, bottom: rect.bottom },
|
|
10705
10725
|
window.innerHeight,
|
|
10706
10726
|
keyboardInset
|
|
@@ -10720,8 +10740,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10720
10740
|
return;
|
|
10721
10741
|
}
|
|
10722
10742
|
const update = () => {
|
|
10723
|
-
const metrics =
|
|
10724
|
-
const inset = metrics ?
|
|
10743
|
+
const metrics = chunkAL2KLPOJ_js.readViewportMetrics(window);
|
|
10744
|
+
const inset = metrics ? chunkAL2KLPOJ_js.computeKeyboardInset(metrics) : 0;
|
|
10725
10745
|
setKeyboardInset(inset);
|
|
10726
10746
|
if (inset > 0) {
|
|
10727
10747
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10732,8 +10752,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10732
10752
|
vv.addEventListener("scroll", update);
|
|
10733
10753
|
const onFocusIn = () => {
|
|
10734
10754
|
window.requestAnimationFrame(() => {
|
|
10735
|
-
const metrics =
|
|
10736
|
-
const inset = metrics ?
|
|
10755
|
+
const metrics = chunkAL2KLPOJ_js.readViewportMetrics(window);
|
|
10756
|
+
const inset = metrics ? chunkAL2KLPOJ_js.computeKeyboardInset(metrics) : 0;
|
|
10737
10757
|
if (inset > 0) {
|
|
10738
10758
|
scrollFocusedIntoView(inset);
|
|
10739
10759
|
}
|
|
@@ -10746,7 +10766,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10746
10766
|
document.removeEventListener("focusin", onFocusIn);
|
|
10747
10767
|
};
|
|
10748
10768
|
}, [enabled]);
|
|
10749
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10769
|
+
return { keyboardInset, isKeyboardOpen: chunkAL2KLPOJ_js.isKeyboardOpen(keyboardInset) };
|
|
10750
10770
|
}
|
|
10751
10771
|
|
|
10752
10772
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10775,21 +10795,21 @@ function buildCanvasProps(input) {
|
|
|
10775
10795
|
} = input;
|
|
10776
10796
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10777
10797
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10778
|
-
const fieldContext =
|
|
10798
|
+
const fieldContext = chunkAL2KLPOJ_js.buildFieldSubstitutionContext({
|
|
10779
10799
|
headerFooter: s.headerFooter,
|
|
10780
10800
|
customProperties: s.customProperties,
|
|
10781
10801
|
slide: activeSlide
|
|
10782
10802
|
});
|
|
10783
10803
|
const tableStyleContext = s.theme || s.tableStyleMap ? { theme: s.theme, tableStyleMap: s.tableStyleMap } : void 0;
|
|
10784
|
-
const openExternalUrl = (url) => {
|
|
10785
|
-
if (
|
|
10804
|
+
const openExternalUrl = (url, target) => {
|
|
10805
|
+
if (chunkAL2KLPOJ_js.shouldConfirmExternalHyperlink(viewerOptions, url) && !window.confirm(buildHyperlinkConfirmMessage(url))) {
|
|
10786
10806
|
return;
|
|
10787
10807
|
}
|
|
10788
|
-
|
|
10808
|
+
chunkAL2KLPOJ_js.safeOpenUrl(url, target);
|
|
10789
10809
|
};
|
|
10790
10810
|
const handleActionClick = (elementId, action) => {
|
|
10791
10811
|
if (mode === "present") {
|
|
10792
|
-
const resolved =
|
|
10812
|
+
const resolved = chunkAL2KLPOJ_js.resolvePresentationAction(action, { slideCount: slides.length });
|
|
10793
10813
|
if (resolved.intent.kind === "openUrl") {
|
|
10794
10814
|
openExternalUrl(resolved.intent.url);
|
|
10795
10815
|
return;
|
|
@@ -10799,10 +10819,10 @@ function buildCanvasProps(input) {
|
|
|
10799
10819
|
openExternalUrl(action.url);
|
|
10800
10820
|
}
|
|
10801
10821
|
};
|
|
10802
|
-
const handleHyperlinkClick = (url) => {
|
|
10803
|
-
if (
|
|
10822
|
+
const handleHyperlinkClick = (url, target) => {
|
|
10823
|
+
if (chunkAL2KLPOJ_js.isPpactionUrl(url)) {
|
|
10804
10824
|
if (mode === "present") {
|
|
10805
|
-
const parsed =
|
|
10825
|
+
const parsed = chunkAL2KLPOJ_js.parsePpactionUrl(url);
|
|
10806
10826
|
if (parsed) {
|
|
10807
10827
|
presentation.handlePresentationAction({
|
|
10808
10828
|
action: parsed.action,
|
|
@@ -10812,7 +10832,7 @@ function buildCanvasProps(input) {
|
|
|
10812
10832
|
}
|
|
10813
10833
|
return;
|
|
10814
10834
|
}
|
|
10815
|
-
openExternalUrl(url);
|
|
10835
|
+
openExternalUrl(url, target);
|
|
10816
10836
|
};
|
|
10817
10837
|
return {
|
|
10818
10838
|
activeSlide: effectiveSlide,
|
|
@@ -10908,7 +10928,7 @@ function buildCanvasProps(input) {
|
|
|
10908
10928
|
|
|
10909
10929
|
// src/viewer/hooks/useScopedLayoutOptions.ts
|
|
10910
10930
|
function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
|
|
10911
|
-
return
|
|
10931
|
+
return chunkAL2KLPOJ_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
|
|
10912
10932
|
}
|
|
10913
10933
|
|
|
10914
10934
|
// src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
|
|
@@ -10921,7 +10941,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10921
10941
|
const current = activeSlide.animations ?? [];
|
|
10922
10942
|
if (group === "motionPath") {
|
|
10923
10943
|
propertyHandlers.handleUpdateSlide({
|
|
10924
|
-
animations:
|
|
10944
|
+
animations: chunkAL2KLPOJ_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10925
10945
|
});
|
|
10926
10946
|
return;
|
|
10927
10947
|
}
|
|
@@ -11105,6 +11125,7 @@ function buildToolbarProps(input) {
|
|
|
11105
11125
|
onUngroupElement: manipulation.handleUngroupElement,
|
|
11106
11126
|
onUpdateElementStyle: ops.updateSelectedShapeStyle,
|
|
11107
11127
|
selectedCount: s.selectedElementIds.length > 0 ? s.selectedElementIds.length : selectionSize,
|
|
11128
|
+
selectionGroupable: manipulation.selectionGroupable,
|
|
11108
11129
|
onOpenHyperlinkDialog: () => dialogs.setIsHyperlinkDialogOpen(true),
|
|
11109
11130
|
onDuplicate: manipulation.handleDuplicate,
|
|
11110
11131
|
onDelete: manipulation.handleDelete,
|
|
@@ -11116,7 +11137,7 @@ function buildToolbarProps(input) {
|
|
|
11116
11137
|
onOpenFile,
|
|
11117
11138
|
onOpenRecentFile,
|
|
11118
11139
|
onCreatePresentation: (templateId) => {
|
|
11119
|
-
s.setSlides(
|
|
11140
|
+
s.setSlides(chunkAL2KLPOJ_js.createBackstagePresentation(templateId));
|
|
11120
11141
|
s.setActiveSlideIndex(0);
|
|
11121
11142
|
s.setSelectedElementId(null);
|
|
11122
11143
|
s.setSelectedElementIds([]);
|
|
@@ -11145,7 +11166,7 @@ function buildToolbarProps(input) {
|
|
|
11145
11166
|
loadLayoutPreviews: input.loadLayoutPreviews,
|
|
11146
11167
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
11147
11168
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
11148
|
-
templateScheme:
|
|
11169
|
+
templateScheme: chunkAL2KLPOJ_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
11149
11170
|
customShows: s.customShows,
|
|
11150
11171
|
activeCustomShowId: s.activeCustomShowId,
|
|
11151
11172
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -11186,7 +11207,7 @@ function buildToolbarProps(input) {
|
|
|
11186
11207
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
11187
11208
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
11188
11209
|
formatPainterActive: s.formatPainterActive,
|
|
11189
|
-
canActivateFormatPainter:
|
|
11210
|
+
canActivateFormatPainter: chunkAL2KLPOJ_js.hasCopyableFormat(selectedElement),
|
|
11190
11211
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
11191
11212
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
11192
11213
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -11264,7 +11285,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11264
11285
|
headerFooter: state.headerFooter,
|
|
11265
11286
|
loading,
|
|
11266
11287
|
error,
|
|
11267
|
-
maxHistoryEntries:
|
|
11288
|
+
maxHistoryEntries: chunkAL2KLPOJ_js.resolveHistoryDepth(viewerOptions),
|
|
11268
11289
|
hasActivePointerInteraction,
|
|
11269
11290
|
pointerCommitNonce: state.pointerCommitNonce,
|
|
11270
11291
|
onDirty: markDocumentDirty,
|
|
@@ -11332,7 +11353,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11332
11353
|
gridSpacingPx,
|
|
11333
11354
|
// Multiplied against the pre-existing 2x baseline; see the matching
|
|
11334
11355
|
// comment in `PowerPointViewer.tsx`.
|
|
11335
|
-
imageExportScale: 2 *
|
|
11356
|
+
imageExportScale: 2 * chunkAL2KLPOJ_js.resolveImageResolutionScale(viewerOptions),
|
|
11336
11357
|
viewerOptions
|
|
11337
11358
|
};
|
|
11338
11359
|
}
|
|
@@ -11348,7 +11369,7 @@ function useCompatibilityToastsState() {
|
|
|
11348
11369
|
}
|
|
11349
11370
|
function useReadOnlyRecommendationState(content) {
|
|
11350
11371
|
const [recommendation, setRecommendation] = react.useState(
|
|
11351
|
-
() =>
|
|
11372
|
+
() => chunkAL2KLPOJ_js.readOnlyRecommendation(void 0)
|
|
11352
11373
|
);
|
|
11353
11374
|
const [bannerHidden, setBannerHidden] = react.useState(false);
|
|
11354
11375
|
const [editAnywayActive, setEditAnywayActive] = react.useState(false);
|
|
@@ -11386,9 +11407,9 @@ function useViewPreferencesSync(input) {
|
|
|
11386
11407
|
setShowGuides
|
|
11387
11408
|
} = input;
|
|
11388
11409
|
react.useEffect(() => {
|
|
11389
|
-
const seeded =
|
|
11410
|
+
const seeded = chunkAL2KLPOJ_js.viewerPreferencesFromViewProperties(
|
|
11390
11411
|
{ viewProperties },
|
|
11391
|
-
{ ...
|
|
11412
|
+
{ ...chunkAL2KLPOJ_js.DEFAULT_VIEWER_PREFERENCES, snapToGrid, snapToObjects: snapToShape, showGuides }
|
|
11392
11413
|
);
|
|
11393
11414
|
setSnapToGrid(seeded.snapToGrid);
|
|
11394
11415
|
setSnapToShape(seeded.snapToObjects ?? snapToShape);
|
|
@@ -11398,7 +11419,7 @@ function useViewPreferencesSync(input) {
|
|
|
11398
11419
|
(prefsOverride) => {
|
|
11399
11420
|
setViewProperties((prev) => {
|
|
11400
11421
|
const merged = {
|
|
11401
|
-
...
|
|
11422
|
+
...chunkAL2KLPOJ_js.DEFAULT_VIEWER_PREFERENCES,
|
|
11402
11423
|
snapToGrid,
|
|
11403
11424
|
snapToObjects: snapToShape,
|
|
11404
11425
|
showGuides,
|
|
@@ -11406,7 +11427,7 @@ function useViewPreferencesSync(input) {
|
|
|
11406
11427
|
gridSpacingCy: prev?.gridSpacing?.cy,
|
|
11407
11428
|
...prefsOverride
|
|
11408
11429
|
};
|
|
11409
|
-
const patch =
|
|
11430
|
+
const patch = chunkAL2KLPOJ_js.viewPropertiesPatchFromPreferences(merged);
|
|
11410
11431
|
return {
|
|
11411
11432
|
...prev,
|
|
11412
11433
|
slideViewPr: { ...prev?.slideViewPr, ...patch.slideViewPr },
|
|
@@ -11624,7 +11645,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11624
11645
|
}, [incomingContent]);
|
|
11625
11646
|
const onOpenFile = react.useCallback(() => {
|
|
11626
11647
|
void (async () => {
|
|
11627
|
-
const picked = await
|
|
11648
|
+
const picked = await chunkAL2KLPOJ_js.openPptxFile();
|
|
11628
11649
|
if (picked) {
|
|
11629
11650
|
setContent(picked.buffer);
|
|
11630
11651
|
}
|
|
@@ -11632,7 +11653,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11632
11653
|
}, []);
|
|
11633
11654
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11634
11655
|
void (async () => {
|
|
11635
|
-
const bytes = await
|
|
11656
|
+
const bytes = await chunkAL2KLPOJ_js.readBackstageRecentFile(key);
|
|
11636
11657
|
if (bytes) {
|
|
11637
11658
|
setContent(bytes);
|
|
11638
11659
|
}
|