pptx-react-viewer 3.4.0 → 3.5.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 +42 -0
- package/dist/{AiChatPanel-NQZBZIRM.mjs → AiChatPanel-KZX4NZ5R.mjs} +4 -4
- package/dist/AiChatPanel-KZX4NZ5R.mjs.br +0 -0
- package/dist/AiChatPanel-KZX4NZ5R.mjs.gz +0 -0
- package/dist/{AiChatPanel-3Q4STA5E.js → AiChatPanel-M7RSMOZV.js} +25 -25
- package/dist/AiChatPanel-M7RSMOZV.js.br +0 -0
- package/dist/AiChatPanel-M7RSMOZV.js.gz +0 -0
- package/dist/{Area3DChartScene-THLG74CM.js → Area3DChartScene-7AYWOGBC.js} +2 -2
- package/dist/Area3DChartScene-7AYWOGBC.js.br +0 -0
- package/dist/Area3DChartScene-7AYWOGBC.js.gz +0 -0
- package/dist/{Area3DChartScene-7PARQDOZ.mjs → Area3DChartScene-AD6BO2VM.mjs} +1 -1
- package/dist/Area3DChartScene-AD6BO2VM.mjs.br +3 -0
- package/dist/Area3DChartScene-AD6BO2VM.mjs.gz +0 -0
- package/dist/{Bar3DChartScene-OLZ2V56I.js → Bar3DChartScene-FWKMBT4O.js} +2 -2
- package/dist/Bar3DChartScene-FWKMBT4O.js.br +0 -0
- package/dist/Bar3DChartScene-FWKMBT4O.js.gz +0 -0
- package/dist/{Bar3DChartScene-QUU6RUXM.mjs → Bar3DChartScene-JOGF3C5E.mjs} +1 -1
- package/dist/Bar3DChartScene-JOGF3C5E.mjs.br +0 -0
- package/dist/Bar3DChartScene-JOGF3C5E.mjs.gz +0 -0
- package/dist/{Line3DChartScene-D77ORA4K.mjs → Line3DChartScene-ADORAAXV.mjs} +1 -1
- package/dist/Line3DChartScene-ADORAAXV.mjs.br +3 -0
- package/dist/Line3DChartScene-ADORAAXV.mjs.gz +0 -0
- package/dist/{Line3DChartScene-2VZS52IB.js → Line3DChartScene-X2BJNGIK.js} +2 -2
- package/dist/Line3DChartScene-X2BJNGIK.js.br +0 -0
- package/dist/Line3DChartScene-X2BJNGIK.js.gz +0 -0
- package/dist/{Model3DScene-3WCALTXO.js → Model3DScene-KSZHZAVD.js} +2 -2
- package/dist/Model3DScene-KSZHZAVD.js.br +0 -0
- package/dist/Model3DScene-KSZHZAVD.js.gz +0 -0
- package/dist/{Model3DScene-ZEGWNILH.mjs → Model3DScene-RORDMQ6Q.mjs} +1 -1
- package/dist/Model3DScene-RORDMQ6Q.mjs.br +0 -0
- package/dist/Model3DScene-RORDMQ6Q.mjs.gz +0 -0
- package/dist/{PieChart3DScene-7C3ACGKN.js → PieChart3DScene-BXMI7U2X.js} +2 -2
- package/dist/PieChart3DScene-BXMI7U2X.js.br +0 -0
- package/dist/PieChart3DScene-BXMI7U2X.js.gz +0 -0
- package/dist/{PieChart3DScene-DGD4PZVV.mjs → PieChart3DScene-IXJHU3MI.mjs} +1 -1
- package/dist/PieChart3DScene-IXJHU3MI.mjs.br +0 -0
- package/dist/PieChart3DScene-IXJHU3MI.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-QGH3OLJV.mjs → SurfaceChart3DScene-SJ2IDLP6.mjs} +1 -1
- package/dist/SurfaceChart3DScene-SJ2IDLP6.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-SJ2IDLP6.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-SJPQGGGE.js → SurfaceChart3DScene-TTBGVNYL.js} +2 -2
- package/dist/SurfaceChart3DScene-TTBGVNYL.js.br +0 -0
- package/dist/SurfaceChart3DScene-TTBGVNYL.js.gz +0 -0
- package/dist/{chunk-SFMATKNJ.mjs → chunk-24XC5C2B.mjs} +2 -2
- package/dist/chunk-24XC5C2B.mjs.br +0 -0
- package/dist/chunk-24XC5C2B.mjs.gz +0 -0
- package/dist/{chunk-XBTHWXNO.js → chunk-AEP6X24D.js} +169 -169
- package/dist/chunk-AEP6X24D.js.br +0 -0
- package/dist/chunk-AEP6X24D.js.gz +0 -0
- package/dist/{chunk-PCW2KT7Z.js → chunk-AU5YFUUK.js} +155 -27
- package/dist/chunk-AU5YFUUK.js.br +0 -0
- package/dist/chunk-AU5YFUUK.js.gz +0 -0
- package/dist/{chunk-MSUUPLQ7.mjs → chunk-C7ZSRYF4.mjs} +76 -26
- package/dist/chunk-C7ZSRYF4.mjs.br +0 -0
- package/dist/chunk-C7ZSRYF4.mjs.gz +0 -0
- package/dist/{chunk-L5MRKDRM.mjs → chunk-DUC32SQJ.mjs} +75 -20
- package/dist/chunk-DUC32SQJ.mjs.br +0 -0
- package/dist/chunk-DUC32SQJ.mjs.gz +0 -0
- package/dist/{chunk-TJNG5VEK.js → chunk-HCTJCUGP.js} +501 -451
- package/dist/chunk-HCTJCUGP.js.br +0 -0
- package/dist/chunk-HCTJCUGP.js.gz +0 -0
- package/dist/{chunk-XWUMM2TX.mjs → chunk-JCJ3EPG6.mjs} +1 -0
- package/dist/chunk-JCJ3EPG6.mjs.br +0 -0
- package/dist/chunk-JCJ3EPG6.mjs.gz +0 -0
- package/dist/{chunk-KY6JQJXK.js → chunk-JTS7AZYQ.js} +5 -5
- package/dist/chunk-JTS7AZYQ.js.br +0 -0
- package/dist/chunk-JTS7AZYQ.js.gz +0 -0
- package/dist/{chunk-UNIJUD5C.js → chunk-UTIMT5CZ.js} +1 -0
- package/dist/chunk-UTIMT5CZ.js.br +0 -0
- package/dist/chunk-UTIMT5CZ.js.gz +0 -0
- package/dist/{chunk-C4WTQIC6.mjs → chunk-X6OJYCTW.mjs} +1 -1
- package/dist/chunk-X6OJYCTW.mjs.br +0 -0
- package/dist/chunk-X6OJYCTW.mjs.gz +0 -0
- package/dist/{chunk-B7WAGQW4.mjs → chunk-X7L3RHFQ.mjs} +153 -28
- package/dist/chunk-X7L3RHFQ.mjs.br +0 -0
- package/dist/chunk-X7L3RHFQ.mjs.gz +0 -0
- package/dist/{chunk-7E6SM42A.js → chunk-XSHYXVPD.js} +1233 -1178
- package/dist/chunk-XSHYXVPD.js.br +0 -0
- package/dist/chunk-XSHYXVPD.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.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 +22 -0
- 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/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-3Q4STA5E.js.br +0 -0
- package/dist/AiChatPanel-3Q4STA5E.js.gz +0 -0
- package/dist/AiChatPanel-NQZBZIRM.mjs.br +0 -0
- package/dist/AiChatPanel-NQZBZIRM.mjs.gz +0 -0
- package/dist/Area3DChartScene-7PARQDOZ.mjs.br +0 -3
- package/dist/Area3DChartScene-7PARQDOZ.mjs.gz +0 -0
- package/dist/Area3DChartScene-THLG74CM.js.br +0 -0
- package/dist/Area3DChartScene-THLG74CM.js.gz +0 -0
- package/dist/Bar3DChartScene-OLZ2V56I.js.br +0 -2
- package/dist/Bar3DChartScene-OLZ2V56I.js.gz +0 -0
- package/dist/Bar3DChartScene-QUU6RUXM.mjs.br +0 -0
- package/dist/Bar3DChartScene-QUU6RUXM.mjs.gz +0 -0
- package/dist/Line3DChartScene-2VZS52IB.js.br +0 -0
- package/dist/Line3DChartScene-2VZS52IB.js.gz +0 -0
- package/dist/Line3DChartScene-D77ORA4K.mjs.br +0 -3
- package/dist/Line3DChartScene-D77ORA4K.mjs.gz +0 -0
- package/dist/Model3DScene-3WCALTXO.js.br +0 -0
- package/dist/Model3DScene-3WCALTXO.js.gz +0 -0
- package/dist/Model3DScene-ZEGWNILH.mjs.br +0 -0
- package/dist/Model3DScene-ZEGWNILH.mjs.gz +0 -0
- package/dist/PieChart3DScene-7C3ACGKN.js.br +0 -0
- package/dist/PieChart3DScene-7C3ACGKN.js.gz +0 -0
- package/dist/PieChart3DScene-DGD4PZVV.mjs.br +0 -0
- package/dist/PieChart3DScene-DGD4PZVV.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-QGH3OLJV.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-QGH3OLJV.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-SJPQGGGE.js.br +0 -0
- package/dist/SurfaceChart3DScene-SJPQGGGE.js.gz +0 -0
- package/dist/chunk-7E6SM42A.js.br +0 -0
- package/dist/chunk-7E6SM42A.js.gz +0 -0
- package/dist/chunk-B7WAGQW4.mjs.br +0 -0
- package/dist/chunk-B7WAGQW4.mjs.gz +0 -0
- package/dist/chunk-C4WTQIC6.mjs.br +0 -0
- package/dist/chunk-C4WTQIC6.mjs.gz +0 -0
- package/dist/chunk-KY6JQJXK.js.br +0 -0
- package/dist/chunk-KY6JQJXK.js.gz +0 -0
- package/dist/chunk-L5MRKDRM.mjs.br +0 -0
- package/dist/chunk-L5MRKDRM.mjs.gz +0 -0
- package/dist/chunk-MSUUPLQ7.mjs.br +0 -0
- package/dist/chunk-MSUUPLQ7.mjs.gz +0 -0
- package/dist/chunk-PCW2KT7Z.js.br +0 -0
- package/dist/chunk-PCW2KT7Z.js.gz +0 -0
- package/dist/chunk-SFMATKNJ.mjs.br +0 -0
- package/dist/chunk-SFMATKNJ.mjs.gz +0 -0
- package/dist/chunk-TJNG5VEK.js.br +0 -0
- package/dist/chunk-TJNG5VEK.js.gz +0 -0
- package/dist/chunk-UNIJUD5C.js.br +0 -0
- package/dist/chunk-UNIJUD5C.js.gz +0 -0
- package/dist/chunk-XBTHWXNO.js.br +0 -0
- package/dist/chunk-XBTHWXNO.js.gz +0 -0
- package/dist/chunk-XWUMM2TX.mjs.br +0 -0
- package/dist/chunk-XWUMM2TX.mjs.gz +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkAEP6X24D_js = require('./chunk-AEP6X24D.js');
|
|
4
|
+
var chunkAU5YFUUK_js = require('./chunk-AU5YFUUK.js');
|
|
5
|
+
var chunkUTIMT5CZ_js = require('./chunk-UTIMT5CZ.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 = chunkAU5YFUUK_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 = chunkAU5YFUUK_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 ??= chunkAU5YFUUK_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 >= chunkAU5YFUUK_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
|
+
}, chunkAU5YFUUK_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 = chunkAU5YFUUK_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
|
+
chunkAU5YFUUK_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 = chunkAU5YFUUK_js.validateRoomId(config.roomId);
|
|
244
244
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
245
|
-
departureRef.current =
|
|
245
|
+
departureRef.current = chunkAU5YFUUK_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 = chunkAU5YFUUK_js.validateRoomId(config.roomId);
|
|
288
|
+
const transport = config.transport ?? chunkAU5YFUUK_js.resolveTransportForServerUrl(config.serverUrl);
|
|
289
289
|
if (transport === "webrtc") {
|
|
290
290
|
await initWebrtc();
|
|
291
291
|
return;
|
|
292
292
|
}
|
|
293
|
-
if (
|
|
293
|
+
if (chunkAU5YFUUK_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 = chunkAU5YFUUK_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
|
+
chunkAU5YFUUK_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
|
+
}, chunkAU5YFUUK_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
|
+
chunkAU5YFUUK_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 = chunkAU5YFUUK_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 = chunkAU5YFUUK_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(chunkAU5YFUUK_js.cloneSlide),
|
|
531
|
+
templateElementsBySlideId: chunkAU5YFUUK_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(chunkAU5YFUUK_js.cloneSlide));
|
|
545
545
|
setTemplateElementsBySlideId(
|
|
546
|
-
|
|
546
|
+
chunkAU5YFUUK_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 = chunkAEP6X24D_js.cloneHistorySnapshot(previousSnapshot);
|
|
586
|
+
lastHistorySnapshotRef.current = chunkAEP6X24D_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 = chunkAEP6X24D_js.cloneHistorySnapshot(nextSnapshot);
|
|
608
|
+
lastHistorySnapshotRef.current = chunkAEP6X24D_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 = chunkAEP6X24D_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 = chunkAEP6X24D_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(chunkAEP6X24D_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 = chunkAEP6X24D_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(chunkAU5YFUUK_js.createWheelStepBuffer());
|
|
747
747
|
const storeRef = react.useRef(null);
|
|
748
|
-
storeRef.current ??=
|
|
748
|
+
storeRef.current ??= chunkAU5YFUUK_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 = chunkAU5YFUUK_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, chunkAEP6X24D_js.MIN_ELEMENT_SIZE));
|
|
847
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkAEP6X24D_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, chunkAEP6X24D_js.MIN_ELEMENT_SIZE);
|
|
854
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkAEP6X24D_js.MIN_ELEMENT_SIZE);
|
|
855
855
|
const availableWidth = Math.max(
|
|
856
|
-
effectiveEditorDimensions.width -
|
|
857
|
-
|
|
856
|
+
effectiveEditorDimensions.width - chunkAEP6X24D_js.ZOOM_TO_SELECTION_PADDING,
|
|
857
|
+
chunkAEP6X24D_js.MIN_ELEMENT_SIZE
|
|
858
858
|
);
|
|
859
859
|
const availableHeight = Math.max(
|
|
860
|
-
effectiveEditorDimensions.height -
|
|
861
|
-
|
|
860
|
+
effectiveEditorDimensions.height - chunkAEP6X24D_js.ZOOM_TO_SELECTION_PADDING,
|
|
861
|
+
chunkAEP6X24D_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 = chunkAU5YFUUK_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 = chunkAU5YFUUK_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: chunkAU5YFUUK_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
|
+
chunkAU5YFUUK_js.playGroup(controller, group, ctx);
|
|
1061
|
+
chunkAU5YFUUK_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 = chunkAU5YFUUK_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1081
1081
|
const timer = window.setTimeout(() => {
|
|
1082
1082
|
setPresentationAnimations(
|
|
1083
1083
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1119,7 +1119,7 @@ function useAnimationPlayback(input) {
|
|
|
1119
1119
|
}, [onPlayActionSound]);
|
|
1120
1120
|
react.useEffect(() => {
|
|
1121
1121
|
return () => {
|
|
1122
|
-
|
|
1122
|
+
chunkAU5YFUUK_js.cancelBuildReveal(buildRafRef);
|
|
1123
1123
|
};
|
|
1124
1124
|
}, []);
|
|
1125
1125
|
const clearPresentationTimers = react.useCallback(() => {
|
|
@@ -1127,7 +1127,7 @@ function useAnimationPlayback(input) {
|
|
|
1127
1127
|
window.clearTimeout(timer);
|
|
1128
1128
|
});
|
|
1129
1129
|
presentationTimersRef.current = [];
|
|
1130
|
-
|
|
1130
|
+
chunkAU5YFUUK_js.cancelBuildReveal(buildRafRef);
|
|
1131
1131
|
activeAnimationGroupRef.current = null;
|
|
1132
1132
|
activeAnimationEndAtRef.current = 0;
|
|
1133
1133
|
}, []);
|
|
@@ -1137,7 +1137,7 @@ function useAnimationPlayback(input) {
|
|
|
1137
1137
|
}, []);
|
|
1138
1138
|
const resetSlideTimeline = react.useCallback(
|
|
1139
1139
|
(slideIndex) => {
|
|
1140
|
-
|
|
1140
|
+
chunkAU5YFUUK_js.cancelBuildReveal(buildRafRef);
|
|
1141
1141
|
const slide = slides[slideIndex];
|
|
1142
1142
|
if (!slide) {
|
|
1143
1143
|
controllerRef.current = null;
|
|
@@ -1147,7 +1147,7 @@ function useAnimationPlayback(input) {
|
|
|
1147
1147
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1148
1148
|
return;
|
|
1149
1149
|
}
|
|
1150
|
-
const controller =
|
|
1150
|
+
const controller = chunkAU5YFUUK_js.PresentationAnimationController.fromSlide(slide);
|
|
1151
1151
|
controllerRef.current = controller;
|
|
1152
1152
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1153
1153
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
@@ -1164,11 +1164,11 @@ function useAnimationPlayback(input) {
|
|
|
1164
1164
|
const activeGroup = activeAnimationGroupRef.current;
|
|
1165
1165
|
if (controller && controller.hasMoreSteps() && shouldSeekAnimationGroup(activeGroup, activeAnimationEndAtRef.current, performance.now())) {
|
|
1166
1166
|
finishDomAnimationsForGroup(activeGroup);
|
|
1167
|
-
const buildIds =
|
|
1167
|
+
const buildIds = chunkAU5YFUUK_js.PresentationAnimationController.collectBuildStepIds(activeGroup);
|
|
1168
1168
|
const completedStates = controller.computeStatesFor(buildIds);
|
|
1169
1169
|
clearPresentationTimers();
|
|
1170
1170
|
finishAnimationGroupSteps(activeGroup, setPresentationElementStates, completedStates);
|
|
1171
|
-
|
|
1171
|
+
chunkAU5YFUUK_js.scheduleAutoAdvanceChain(controller, buildPlaybackContext());
|
|
1172
1172
|
return true;
|
|
1173
1173
|
}
|
|
1174
1174
|
if (!controller || !controller.hasMoreSteps()) {
|
|
@@ -1179,9 +1179,9 @@ function useAnimationPlayback(input) {
|
|
|
1179
1179
|
return false;
|
|
1180
1180
|
}
|
|
1181
1181
|
const ctx = buildPlaybackContext();
|
|
1182
|
-
|
|
1182
|
+
chunkAU5YFUUK_js.playGroup(controller, group, ctx);
|
|
1183
1183
|
markAnimationGroupActive(group);
|
|
1184
|
-
|
|
1184
|
+
chunkAU5YFUUK_js.scheduleAutoAdvanceChain(controller, ctx);
|
|
1185
1185
|
return true;
|
|
1186
1186
|
}, [animationsEnabled, buildPlaybackContext, clearPresentationTimers, markAnimationGroupActive]);
|
|
1187
1187
|
const handleInteractiveShapeClick = react.useCallback(
|
|
@@ -1194,7 +1194,7 @@ function useAnimationPlayback(input) {
|
|
|
1194
1194
|
if (!group) {
|
|
1195
1195
|
return false;
|
|
1196
1196
|
}
|
|
1197
|
-
|
|
1197
|
+
chunkAU5YFUUK_js.playGroup(controller, group, buildPlaybackContext());
|
|
1198
1198
|
return true;
|
|
1199
1199
|
},
|
|
1200
1200
|
[buildPlaybackContext]
|
|
@@ -1213,7 +1213,7 @@ function useAnimationPlayback(input) {
|
|
|
1213
1213
|
if (!group) {
|
|
1214
1214
|
return false;
|
|
1215
1215
|
}
|
|
1216
|
-
|
|
1216
|
+
chunkAU5YFUUK_js.playGroup(controller, group, buildPlaybackContext());
|
|
1217
1217
|
return true;
|
|
1218
1218
|
},
|
|
1219
1219
|
[animationsEnabled, buildPlaybackContext]
|
|
@@ -1294,12 +1294,12 @@ function useAnimationPlayback(input) {
|
|
|
1294
1294
|
presentationTimersRef
|
|
1295
1295
|
};
|
|
1296
1296
|
}
|
|
1297
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1298
|
-
var AUDIENCE_HASH =
|
|
1299
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1300
|
-
var AUDIENCE_NONCE_KEY =
|
|
1297
|
+
var PRESENTER_CHANNEL_NAME = chunkAU5YFUUK_js.PRESENTATION_CHANNEL_NAME;
|
|
1298
|
+
var AUDIENCE_HASH = chunkAU5YFUUK_js.PRESENTATION_HASH;
|
|
1299
|
+
var PRESENTER_MSG_ORIGIN = chunkAU5YFUUK_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1300
|
+
var AUDIENCE_NONCE_KEY = chunkAU5YFUUK_js.PRESENTATION_NONCE_KEY;
|
|
1301
1301
|
function generateSessionId() {
|
|
1302
|
-
return
|
|
1302
|
+
return chunkAU5YFUUK_js.createPresentationSessionId();
|
|
1303
1303
|
}
|
|
1304
1304
|
function parseAudienceNonce() {
|
|
1305
1305
|
const hash = window.location.hash;
|
|
@@ -1335,7 +1335,7 @@ function usePresenterWindow(input) {
|
|
|
1335
1335
|
}, []);
|
|
1336
1336
|
const swapDisplays = react.useCallback(async () => {
|
|
1337
1337
|
const audience = audienceWindowRef.current;
|
|
1338
|
-
return audience && !audience.closed ?
|
|
1338
|
+
return audience && !audience.closed ? chunkAU5YFUUK_js.swapPresentationWindows(window, audience) : false;
|
|
1339
1339
|
}, []);
|
|
1340
1340
|
const syncSlideToAudience = react.useCallback(
|
|
1341
1341
|
(slideIndex) => {
|
|
@@ -1399,7 +1399,7 @@ function usePresenterWindow(input) {
|
|
|
1399
1399
|
pollTimerRef.current = null;
|
|
1400
1400
|
}
|
|
1401
1401
|
if (closingSessionId) {
|
|
1402
|
-
void
|
|
1402
|
+
void chunkAU5YFUUK_js.clearAudienceContent(closingSessionId);
|
|
1403
1403
|
}
|
|
1404
1404
|
}, [getChannel]);
|
|
1405
1405
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1417,10 +1417,10 @@ function usePresenterWindow(input) {
|
|
|
1417
1417
|
audienceWindowRef.current = blankWin;
|
|
1418
1418
|
const sessionId = generateSessionId();
|
|
1419
1419
|
sessionIdRef.current = sessionId;
|
|
1420
|
-
const audienceUrl =
|
|
1421
|
-
void
|
|
1420
|
+
const audienceUrl = chunkAU5YFUUK_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1421
|
+
void chunkAU5YFUUK_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1422
1422
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1423
|
-
|
|
1423
|
+
chunkAU5YFUUK_js.placeAudienceWindow(blankWin, placement);
|
|
1424
1424
|
}
|
|
1425
1425
|
return void 0;
|
|
1426
1426
|
});
|
|
@@ -1450,7 +1450,7 @@ function usePresenterWindow(input) {
|
|
|
1450
1450
|
}
|
|
1451
1451
|
};
|
|
1452
1452
|
if (content) {
|
|
1453
|
-
void
|
|
1453
|
+
void chunkAU5YFUUK_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1454
1454
|
} else {
|
|
1455
1455
|
navigateOrClose(true);
|
|
1456
1456
|
}
|
|
@@ -1476,7 +1476,7 @@ function usePresenterWindow(input) {
|
|
|
1476
1476
|
}
|
|
1477
1477
|
const handleMessage = (event) => {
|
|
1478
1478
|
const message = event.data;
|
|
1479
|
-
if (
|
|
1479
|
+
if (chunkAU5YFUUK_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1480
1480
|
syncStateToAudience(snapshotRef.current);
|
|
1481
1481
|
}
|
|
1482
1482
|
};
|
|
@@ -1505,7 +1505,7 @@ function usePresenterWindow(input) {
|
|
|
1505
1505
|
react.useEffect(() => {
|
|
1506
1506
|
const handleBeforeUnload = () => {
|
|
1507
1507
|
if (sessionIdRef.current) {
|
|
1508
|
-
void
|
|
1508
|
+
void chunkAU5YFUUK_js.clearAudienceContent(sessionIdRef.current);
|
|
1509
1509
|
}
|
|
1510
1510
|
};
|
|
1511
1511
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1567,7 +1567,7 @@ function useAudienceMode(input) {
|
|
|
1567
1567
|
}
|
|
1568
1568
|
channel.onmessage = (event) => {
|
|
1569
1569
|
const data = event.data;
|
|
1570
|
-
if (!
|
|
1570
|
+
if (!chunkAU5YFUUK_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1571
1571
|
return;
|
|
1572
1572
|
}
|
|
1573
1573
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1583,16 +1583,16 @@ function useAudienceMode(input) {
|
|
|
1583
1583
|
}
|
|
1584
1584
|
if (data.type === "presenter-exit") {
|
|
1585
1585
|
if (expectedSessionId) {
|
|
1586
|
-
void
|
|
1586
|
+
void chunkAU5YFUUK_js.clearAudienceContent(expectedSessionId);
|
|
1587
1587
|
}
|
|
1588
|
-
if (
|
|
1588
|
+
if (chunkAU5YFUUK_js.endAudienceDisplay(window)) {
|
|
1589
1589
|
handlers.onPresenterEnded?.();
|
|
1590
1590
|
}
|
|
1591
1591
|
}
|
|
1592
1592
|
};
|
|
1593
1593
|
if (expectedSessionId) {
|
|
1594
1594
|
channel.postMessage({
|
|
1595
|
-
origin:
|
|
1595
|
+
origin: chunkAU5YFUUK_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1596
1596
|
type: "audience-ready",
|
|
1597
1597
|
sessionId: expectedSessionId
|
|
1598
1598
|
});
|
|
@@ -1606,7 +1606,7 @@ function useAudienceMode(input) {
|
|
|
1606
1606
|
}, []);
|
|
1607
1607
|
}
|
|
1608
1608
|
function usePresentationKeyboard(input) {
|
|
1609
|
-
const wheelBufferRef = react.useRef(
|
|
1609
|
+
const wheelBufferRef = react.useRef(chunkAU5YFUUK_js.createWheelStepBuffer());
|
|
1610
1610
|
const {
|
|
1611
1611
|
mode,
|
|
1612
1612
|
movePresentationSlide,
|
|
@@ -1627,14 +1627,14 @@ function usePresentationKeyboard(input) {
|
|
|
1627
1627
|
presentationSlideIndex,
|
|
1628
1628
|
setShowRehearsalSummary
|
|
1629
1629
|
} = input;
|
|
1630
|
-
const keyBufferRef = react.useRef(
|
|
1630
|
+
const keyBufferRef = react.useRef(chunkAU5YFUUK_js.createPresentationKeyBuffer());
|
|
1631
1631
|
react.useEffect(() => {
|
|
1632
|
-
if (mode !== "present" || !
|
|
1633
|
-
keyBufferRef.current =
|
|
1632
|
+
if (mode !== "present" || !chunkAU5YFUUK_js.acceptsPresentationInput()) {
|
|
1633
|
+
keyBufferRef.current = chunkAU5YFUUK_js.createPresentationKeyBuffer();
|
|
1634
1634
|
return;
|
|
1635
1635
|
}
|
|
1636
1636
|
const handleKeyDown = (event) => {
|
|
1637
|
-
const mapped =
|
|
1637
|
+
const mapped = chunkAU5YFUUK_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1638
1638
|
if (mapped.action === "none") {
|
|
1639
1639
|
return;
|
|
1640
1640
|
}
|
|
@@ -1654,12 +1654,12 @@ function usePresentationKeyboard(input) {
|
|
|
1654
1654
|
movePresentationSlide(-1);
|
|
1655
1655
|
return;
|
|
1656
1656
|
case "first": {
|
|
1657
|
-
const first =
|
|
1657
|
+
const first = chunkAU5YFUUK_js.firstShowSlideIndex(showSlideIndexes);
|
|
1658
1658
|
navigateToSlide(first ?? 0);
|
|
1659
1659
|
return;
|
|
1660
1660
|
}
|
|
1661
1661
|
case "last": {
|
|
1662
|
-
const last =
|
|
1662
|
+
const last = chunkAU5YFUUK_js.lastShowSlideIndex(showSlideIndexes);
|
|
1663
1663
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1664
1664
|
return;
|
|
1665
1665
|
}
|
|
@@ -1697,10 +1697,10 @@ function usePresentationKeyboard(input) {
|
|
|
1697
1697
|
}
|
|
1698
1698
|
};
|
|
1699
1699
|
const handleWheel = (event) => {
|
|
1700
|
-
if (mode !== "present" || !
|
|
1700
|
+
if (mode !== "present" || !chunkAU5YFUUK_js.acceptsPresentationInput()) {
|
|
1701
1701
|
return;
|
|
1702
1702
|
}
|
|
1703
|
-
const mapped =
|
|
1703
|
+
const mapped = chunkAU5YFUUK_js.mapPresentationWheel(event, wheelBufferRef.current);
|
|
1704
1704
|
if (mapped.intent === "next-slide") {
|
|
1705
1705
|
event.preventDefault();
|
|
1706
1706
|
movePresentationSlide(1);
|
|
@@ -1833,7 +1833,7 @@ function useRehearsalTimings(input) {
|
|
|
1833
1833
|
|
|
1834
1834
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1835
1835
|
function handlePresentationActionImpl(action, deps) {
|
|
1836
|
-
|
|
1836
|
+
chunkAU5YFUUK_js.runPresentationAction(
|
|
1837
1837
|
action,
|
|
1838
1838
|
{ slideCount: deps.slidesLength, ...deps.elementId ? { elementId: deps.elementId } : {} },
|
|
1839
1839
|
{
|
|
@@ -1861,7 +1861,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1861
1861
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1862
1862
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1863
1863
|
const transition = deps.reverse ? deps.slides[deps.currentSlideIndex]?.transition : incomingSlide?.transition;
|
|
1864
|
-
const durationMs = deps.playTransition ?
|
|
1864
|
+
const durationMs = deps.playTransition ? chunkAU5YFUUK_js.resolveTransitionDurationMs(transition) : 0;
|
|
1865
1865
|
deps.clearPresentationTimers();
|
|
1866
1866
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1867
1867
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -1926,7 +1926,7 @@ function useSlideNavigation(input) {
|
|
|
1926
1926
|
});
|
|
1927
1927
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
1928
1928
|
(slideIndex) => {
|
|
1929
|
-
const delayMs =
|
|
1929
|
+
const delayMs = chunkAU5YFUUK_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
1930
1930
|
if (delayMs === void 0) {
|
|
1931
1931
|
return;
|
|
1932
1932
|
}
|
|
@@ -1949,7 +1949,7 @@ function useSlideNavigation(input) {
|
|
|
1949
1949
|
if (availableSlideIndexes.length === 0) {
|
|
1950
1950
|
return;
|
|
1951
1951
|
}
|
|
1952
|
-
const pastLastSlide = direction === 1 && !
|
|
1952
|
+
const pastLastSlide = direction === 1 && !chunkAU5YFUUK_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
1953
1953
|
if (rehearsing && pastLastSlide) {
|
|
1954
1954
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
1955
1955
|
try {
|
|
@@ -1967,9 +1967,9 @@ function useSlideNavigation(input) {
|
|
|
1967
1967
|
onAdvancePastLastSlide();
|
|
1968
1968
|
return;
|
|
1969
1969
|
}
|
|
1970
|
-
const nextSlideIndex = direction === 1 ?
|
|
1970
|
+
const nextSlideIndex = direction === 1 ? chunkAU5YFUUK_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
1971
1971
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
1972
|
-
}) :
|
|
1972
|
+
}) : chunkAU5YFUUK_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
1973
1973
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
1974
1974
|
return;
|
|
1975
1975
|
}
|
|
@@ -2144,7 +2144,7 @@ function createCustomShowRunner(deps) {
|
|
|
2144
2144
|
return;
|
|
2145
2145
|
}
|
|
2146
2146
|
origin = returnAfter ? { showId: deps.getActiveCustomShowId(), slideIndex: deps.getPresentationSlideIndex() } : null;
|
|
2147
|
-
const first =
|
|
2147
|
+
const first = chunkAU5YFUUK_js.firstShowSlideIndex(chunkAU5YFUUK_js.resolveShowSlideIndexes(deps.getSlides(), target));
|
|
2148
2148
|
deps.setActiveCustomShowId(customShowId);
|
|
2149
2149
|
if (first !== void 0) {
|
|
2150
2150
|
deps.navigateToSlide(first);
|
|
@@ -2221,22 +2221,22 @@ function usePresentationActionExtensions(input) {
|
|
|
2221
2221
|
}
|
|
2222
2222
|
}, [navigateToSlideViaRef]);
|
|
2223
2223
|
const onOpenFile = react.useCallback((target) => {
|
|
2224
|
-
|
|
2224
|
+
chunkAU5YFUUK_js.safeOpenUrl(target);
|
|
2225
2225
|
}, []);
|
|
2226
2226
|
const onOpenPresentation = react.useCallback((target) => {
|
|
2227
|
-
|
|
2227
|
+
chunkAU5YFUUK_js.safeOpenUrl(target);
|
|
2228
2228
|
}, []);
|
|
2229
2229
|
const onPlayMedia = react.useCallback(
|
|
2230
2230
|
(elementId) => {
|
|
2231
|
-
|
|
2231
|
+
chunkAU5YFUUK_js.toggleStageElementMedia(containerRef.current, elementId);
|
|
2232
2232
|
},
|
|
2233
2233
|
[containerRef]
|
|
2234
2234
|
);
|
|
2235
2235
|
const onOleVerb = react.useCallback(
|
|
2236
2236
|
(verb, elementId) => {
|
|
2237
|
-
const target =
|
|
2237
|
+
const target = chunkAU5YFUUK_js.resolveOleVerbTarget(slides[presentationSlideIndex], elementId, verb);
|
|
2238
2238
|
if (target) {
|
|
2239
|
-
|
|
2239
|
+
chunkAU5YFUUK_js.openUrlInNewTab(target.url);
|
|
2240
2240
|
}
|
|
2241
2241
|
},
|
|
2242
2242
|
[slides, presentationSlideIndex]
|
|
@@ -2266,22 +2266,22 @@ function usePresentationActionExtensions(input) {
|
|
|
2266
2266
|
};
|
|
2267
2267
|
}
|
|
2268
2268
|
function usePresenterConsole(slideIndex, active) {
|
|
2269
|
-
const timerRef = react.useRef(
|
|
2270
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2269
|
+
const timerRef = react.useRef(chunkAU5YFUUK_js.createPresenterTimer());
|
|
2270
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkAU5YFUUK_js.createInitialPresentationSnapshot(slideIndex));
|
|
2271
2271
|
const patch = react.useCallback((value) => {
|
|
2272
|
-
setSnapshot((current) =>
|
|
2272
|
+
setSnapshot((current) => chunkAU5YFUUK_js.mergePresentationSnapshot(current, value));
|
|
2273
2273
|
}, []);
|
|
2274
2274
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2275
2275
|
react.useEffect(() => {
|
|
2276
2276
|
if (!active) {
|
|
2277
2277
|
return;
|
|
2278
2278
|
}
|
|
2279
|
-
timerRef.current =
|
|
2279
|
+
timerRef.current = chunkAU5YFUUK_js.resetPresenterTimer();
|
|
2280
2280
|
patch({ paused: false, elapsedMs: 0 });
|
|
2281
2281
|
const timer = window.setInterval(() => {
|
|
2282
2282
|
patch({
|
|
2283
2283
|
paused: timerRef.current.paused,
|
|
2284
|
-
elapsedMs:
|
|
2284
|
+
elapsedMs: chunkAU5YFUUK_js.presenterElapsed(timerRef.current)
|
|
2285
2285
|
});
|
|
2286
2286
|
}, 1e3);
|
|
2287
2287
|
return () => window.clearInterval(timer);
|
|
@@ -2291,19 +2291,19 @@ function usePresenterConsole(slideIndex, active) {
|
|
|
2291
2291
|
applyAudienceSnapshot: setSnapshot,
|
|
2292
2292
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2293
2293
|
toggleTimer: () => {
|
|
2294
|
-
timerRef.current =
|
|
2294
|
+
timerRef.current = chunkAU5YFUUK_js.togglePresenterTimer(timerRef.current);
|
|
2295
2295
|
patch({
|
|
2296
2296
|
paused: timerRef.current.paused,
|
|
2297
|
-
elapsedMs:
|
|
2297
|
+
elapsedMs: chunkAU5YFUUK_js.presenterElapsed(timerRef.current)
|
|
2298
2298
|
});
|
|
2299
2299
|
},
|
|
2300
2300
|
resetTimer: () => {
|
|
2301
|
-
timerRef.current =
|
|
2301
|
+
timerRef.current = chunkAU5YFUUK_js.resetPresenterTimer();
|
|
2302
2302
|
patch({ paused: false, elapsedMs: 0 });
|
|
2303
2303
|
},
|
|
2304
2304
|
stepZoom: (direction) => setSnapshot(
|
|
2305
|
-
(current) =>
|
|
2306
|
-
zoom:
|
|
2305
|
+
(current) => chunkAU5YFUUK_js.mergePresentationSnapshot(current, {
|
|
2306
|
+
zoom: chunkAU5YFUUK_js.stepPresenterZoom(
|
|
2307
2307
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2308
2308
|
direction
|
|
2309
2309
|
)
|
|
@@ -2353,7 +2353,7 @@ function usePresentationMode(input) {
|
|
|
2353
2353
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2354
2354
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2355
2355
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2356
|
-
const showGuard = react.useMemo(() =>
|
|
2356
|
+
const showGuard = react.useMemo(() => chunkAU5YFUUK_js.createPresenterShowGuard(), []);
|
|
2357
2357
|
const {
|
|
2358
2358
|
presentationAnimations,
|
|
2359
2359
|
presentationElementStates,
|
|
@@ -2443,7 +2443,7 @@ function usePresentationMode(input) {
|
|
|
2443
2443
|
actionExtensions.bindNavigateToSlide(navigateToSlide);
|
|
2444
2444
|
const movePresentationSlide = react.useCallback(
|
|
2445
2445
|
(direction, trigger = "explicit") => {
|
|
2446
|
-
if (!
|
|
2446
|
+
if (!chunkAU5YFUUK_js.acceptsPresentationInput()) {
|
|
2447
2447
|
return;
|
|
2448
2448
|
}
|
|
2449
2449
|
if (endOfShowVisible) {
|
|
@@ -2512,7 +2512,7 @@ function usePresentationMode(input) {
|
|
|
2512
2512
|
onSetMode("present");
|
|
2513
2513
|
}, [containerRef, onSetMode, setRehearsing]);
|
|
2514
2514
|
const enterPresentModeFromBeginning = react.useCallback(() => {
|
|
2515
|
-
const first =
|
|
2515
|
+
const first = chunkAU5YFUUK_js.firstShowSlideIndex(visibleSlideIndexes);
|
|
2516
2516
|
if (first !== void 0) {
|
|
2517
2517
|
onSetActiveSlideIndex(first);
|
|
2518
2518
|
}
|
|
@@ -2592,7 +2592,7 @@ function usePresentationMode(input) {
|
|
|
2592
2592
|
if (mode !== "present") {
|
|
2593
2593
|
return;
|
|
2594
2594
|
}
|
|
2595
|
-
return
|
|
2595
|
+
return chunkAU5YFUUK_js.attachPresentationVisibilityPause({
|
|
2596
2596
|
root: containerRef.current ?? void 0,
|
|
2597
2597
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2598
2598
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
@@ -2600,7 +2600,7 @@ function usePresentationMode(input) {
|
|
|
2600
2600
|
}, [mode, containerRef]);
|
|
2601
2601
|
react.useLayoutEffect(() => {
|
|
2602
2602
|
if (mode === "present") {
|
|
2603
|
-
const idx =
|
|
2603
|
+
const idx = chunkAU5YFUUK_js.presentationEntrySlideIndex(
|
|
2604
2604
|
activeSlideIndexRef.current,
|
|
2605
2605
|
visibleSlideIndexesRef.current
|
|
2606
2606
|
);
|
|
@@ -2679,11 +2679,11 @@ function usePresentationMode(input) {
|
|
|
2679
2679
|
return void 0;
|
|
2680
2680
|
}
|
|
2681
2681
|
const incoming = slides[transitionOverlay.incomingSlideIndex];
|
|
2682
|
-
return
|
|
2682
|
+
return chunkAU5YFUUK_js.buildMorphTransitionPlan(
|
|
2683
2683
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2684
2684
|
incoming,
|
|
2685
2685
|
transitionOverlay.durationMs,
|
|
2686
|
-
|
|
2686
|
+
chunkAU5YFUUK_js.morphOptionToMode(transitionOverlay.transition.morphOption),
|
|
2687
2687
|
// `PresentationStage` stacks the incoming slide's elements above its
|
|
2688
2688
|
// template shapes (`zIndex = templateElements.length + index`), so a
|
|
2689
2689
|
// z-index journey has to start counting where the stage does.
|
|
@@ -2708,7 +2708,7 @@ function usePresentationMode(input) {
|
|
|
2708
2708
|
if (!morphPlan) {
|
|
2709
2709
|
return presentationKeyframesCss;
|
|
2710
2710
|
}
|
|
2711
|
-
const imageRules =
|
|
2711
|
+
const imageRules = chunkAU5YFUUK_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
|
|
2712
2712
|
return `${presentationKeyframesCss ?? ""}
|
|
2713
2713
|
${morphPlan.keyframesCss}
|
|
2714
2714
|
${imageRules}`;
|
|
@@ -3005,7 +3005,7 @@ function useFindReplace({
|
|
|
3005
3005
|
const [findResults, setFindResults] = react.useState([]);
|
|
3006
3006
|
const [findResultIndex, setFindResultIndex] = react.useState(-1);
|
|
3007
3007
|
const performFind = react.useCallback(() => {
|
|
3008
|
-
const results =
|
|
3008
|
+
const results = chunkAU5YFUUK_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
|
|
3009
3009
|
if (!findQuery) {
|
|
3010
3010
|
setFindResults([]);
|
|
3011
3011
|
setFindResultIndex(-1);
|
|
@@ -3039,7 +3039,7 @@ function useFindReplace({
|
|
|
3039
3039
|
return;
|
|
3040
3040
|
}
|
|
3041
3041
|
onUpdateSlides(
|
|
3042
|
-
(prevSlides) =>
|
|
3042
|
+
(prevSlides) => chunkAU5YFUUK_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
|
|
3043
3043
|
);
|
|
3044
3044
|
onMarkDirty();
|
|
3045
3045
|
},
|
|
@@ -3061,9 +3061,9 @@ function useFindReplace({
|
|
|
3061
3061
|
}, [findResults, applyReplacements, performFind]);
|
|
3062
3062
|
react.useEffect(() => {
|
|
3063
3063
|
const handler = (event) => {
|
|
3064
|
-
const { action } =
|
|
3064
|
+
const { action } = chunkAU5YFUUK_js.mapEditorKey(event, {
|
|
3065
3065
|
canEdit: mode === "edit",
|
|
3066
|
-
isTextInputTarget:
|
|
3066
|
+
isTextInputTarget: chunkAU5YFUUK_js.isEditorTextInputTarget(event.target)
|
|
3067
3067
|
});
|
|
3068
3068
|
if (action !== "find") {
|
|
3069
3069
|
return;
|
|
@@ -3174,7 +3174,7 @@ function addCommentToSlide(slides, slideIndex, text, authorName, elementId, ment
|
|
|
3174
3174
|
if (!slide) {
|
|
3175
3175
|
return { slides, didAdd: false };
|
|
3176
3176
|
}
|
|
3177
|
-
const next =
|
|
3177
|
+
const next = chunkAU5YFUUK_js.addCommentToList(
|
|
3178
3178
|
slide.comments || [],
|
|
3179
3179
|
text,
|
|
3180
3180
|
authorName,
|
|
@@ -3195,7 +3195,7 @@ function removeCommentFromSlide(slides, slideIndex, commentId) {
|
|
|
3195
3195
|
if (!slide) {
|
|
3196
3196
|
return { slides, didDelete: false };
|
|
3197
3197
|
}
|
|
3198
|
-
const next =
|
|
3198
|
+
const next = chunkAU5YFUUK_js.removeCommentFromList(slide.comments || [], commentId);
|
|
3199
3199
|
if (!next) {
|
|
3200
3200
|
return { slides, didDelete: false };
|
|
3201
3201
|
}
|
|
@@ -3206,7 +3206,7 @@ function editCommentInSlide(slides, slideIndex, commentId, newText) {
|
|
|
3206
3206
|
if (!slide) {
|
|
3207
3207
|
return { slides, didUpdate: false };
|
|
3208
3208
|
}
|
|
3209
|
-
const next =
|
|
3209
|
+
const next = chunkAU5YFUUK_js.editCommentInList(slide.comments || [], commentId, newText);
|
|
3210
3210
|
if (!next) {
|
|
3211
3211
|
return { slides, didUpdate: false };
|
|
3212
3212
|
}
|
|
@@ -3217,7 +3217,7 @@ function toggleResolvedInSlide(slides, slideIndex, commentId) {
|
|
|
3217
3217
|
if (!slide) {
|
|
3218
3218
|
return { slides, didUpdate: false };
|
|
3219
3219
|
}
|
|
3220
|
-
const next =
|
|
3220
|
+
const next = chunkAU5YFUUK_js.toggleCommentResolvedInList(slide.comments || [], commentId);
|
|
3221
3221
|
if (!next) {
|
|
3222
3222
|
return { slides, didUpdate: false };
|
|
3223
3223
|
}
|
|
@@ -3228,7 +3228,7 @@ function addReplyToSlide(slides, slideIndex, parentId, text, authorName, mention
|
|
|
3228
3228
|
if (!slide) {
|
|
3229
3229
|
return { slides, didAdd: false };
|
|
3230
3230
|
}
|
|
3231
|
-
const next =
|
|
3231
|
+
const next = chunkAU5YFUUK_js.replyToCommentInList(slide.comments || [], parentId, text, authorName);
|
|
3232
3232
|
if (!next) {
|
|
3233
3233
|
return { slides, didAdd: false };
|
|
3234
3234
|
}
|
|
@@ -3614,7 +3614,9 @@ function useDerivedElementState(input) {
|
|
|
3614
3614
|
if (!activeSlide) {
|
|
3615
3615
|
return [];
|
|
3616
3616
|
}
|
|
3617
|
-
return
|
|
3617
|
+
return [
|
|
3618
|
+
...chunkAU5YFUUK_js.visibleTemplateElements(activeSlide, templateElementsBySlideId[activeSlide.id] ?? [])
|
|
3619
|
+
];
|
|
3618
3620
|
}, [activeSlide, templateElementsBySlideId]);
|
|
3619
3621
|
const activeMaster = slideMasters[activeMasterIndex];
|
|
3620
3622
|
const activeLayout = react.useMemo(
|
|
@@ -3680,7 +3682,7 @@ function useViewerCoreState(_input) {
|
|
|
3680
3682
|
const marqueeStateRef = react.useRef(null);
|
|
3681
3683
|
const isDrawingRef = react.useRef(false);
|
|
3682
3684
|
const justInteractedRef = react.useRef(false);
|
|
3683
|
-
const livePatcher = react.useMemo(() =>
|
|
3685
|
+
const livePatcher = react.useMemo(() => chunkAU5YFUUK_js.createCollaborationLivePatcher(), []);
|
|
3684
3686
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3685
3687
|
const slidesRef = react.useRef([]);
|
|
3686
3688
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3689,8 +3691,8 @@ function useViewerCoreState(_input) {
|
|
|
3689
3691
|
const [slides, setSlides] = react.useState([]);
|
|
3690
3692
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3691
3693
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3692
|
-
width:
|
|
3693
|
-
height:
|
|
3694
|
+
width: chunkAEP6X24D_js.DEFAULT_CANVAS_WIDTH,
|
|
3695
|
+
height: chunkAEP6X24D_js.DEFAULT_CANVAS_HEIGHT
|
|
3694
3696
|
});
|
|
3695
3697
|
const [slideSizeEmu, setSlideSizeEmu] = react.useState();
|
|
3696
3698
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
@@ -3711,7 +3713,7 @@ function useViewerCoreState(_input) {
|
|
|
3711
3713
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3712
3714
|
inlineEditingTextRef.current = resolved;
|
|
3713
3715
|
setInlineEditingTextBase(value);
|
|
3714
|
-
|
|
3716
|
+
chunkAU5YFUUK_js.publishLiveInlineText(
|
|
3715
3717
|
livePatcher,
|
|
3716
3718
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3717
3719
|
inlineEditingElementIdRef.current,
|
|
@@ -4065,7 +4067,7 @@ function useLoadContent({
|
|
|
4065
4067
|
);
|
|
4066
4068
|
}
|
|
4067
4069
|
const previousHandler = handlerRef.current;
|
|
4068
|
-
const handler = new
|
|
4070
|
+
const handler = new chunkAU5YFUUK_js.PptxHandler();
|
|
4069
4071
|
const parsed = await handler.load(buffer, { allowExternalImages });
|
|
4070
4072
|
if (cancelled || token !== renderTokenRef.current) {
|
|
4071
4073
|
handler.dispose();
|
|
@@ -4077,7 +4079,7 @@ function useLoadContent({
|
|
|
4077
4079
|
handlerRef.current = null;
|
|
4078
4080
|
const mediaElements = [];
|
|
4079
4081
|
for (const slide of parsed.slides) {
|
|
4080
|
-
|
|
4082
|
+
chunkAU5YFUUK_js.collectMediaElements(slide.elements, mediaElements);
|
|
4081
4083
|
}
|
|
4082
4084
|
for (const url of mediaDataUrls.values()) {
|
|
4083
4085
|
if (url.startsWith("blob:")) {
|
|
@@ -4118,7 +4120,7 @@ function useLoadContent({
|
|
|
4118
4120
|
}
|
|
4119
4121
|
})
|
|
4120
4122
|
);
|
|
4121
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
4123
|
+
const { paths: imagePaths, refs: imageRefs } = chunkAU5YFUUK_js.collectImagePaths(parsed.slides);
|
|
4122
4124
|
let nextSlides = parsed.slides;
|
|
4123
4125
|
if (imagePaths.size > 0) {
|
|
4124
4126
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -4134,25 +4136,25 @@ function useLoadContent({
|
|
|
4134
4136
|
})
|
|
4135
4137
|
);
|
|
4136
4138
|
nextSlides = parsed.slides.map((s) => {
|
|
4137
|
-
const newElements =
|
|
4139
|
+
const newElements = chunkAU5YFUUK_js.applyImagePathPatches(s.elements, resolvedMap, imageRefs);
|
|
4138
4140
|
return newElements === s.elements ? s : { ...s, elements: newElements };
|
|
4139
4141
|
});
|
|
4140
4142
|
}
|
|
4141
|
-
nextSlides = await
|
|
4143
|
+
nextSlides = await chunkAU5YFUUK_js.resolveTableCellImageUrls(
|
|
4142
4144
|
nextSlides,
|
|
4143
4145
|
(path) => handler.getImageData(path)
|
|
4144
4146
|
);
|
|
4145
|
-
const nextTableStyleMap = await
|
|
4147
|
+
const nextTableStyleMap = await chunkAU5YFUUK_js.resolveTableStyleImageUrls(
|
|
4146
4148
|
parsed.tableStyleMap,
|
|
4147
4149
|
(path) => handler.getImageData(path)
|
|
4148
4150
|
);
|
|
4149
4151
|
handlerRef.current = handler;
|
|
4150
|
-
const partition =
|
|
4152
|
+
const partition = chunkAU5YFUUK_js.partitionTemplateElements(nextSlides);
|
|
4151
4153
|
setSlides(partition.slides);
|
|
4152
4154
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
4153
4155
|
setCanvasSize({
|
|
4154
|
-
width: parsed.width ??
|
|
4155
|
-
height: parsed.height ??
|
|
4156
|
+
width: parsed.width ?? chunkAEP6X24D_js.DEFAULT_CANVAS_WIDTH,
|
|
4157
|
+
height: parsed.height ?? chunkAEP6X24D_js.DEFAULT_CANVAS_HEIGHT
|
|
4156
4158
|
});
|
|
4157
4159
|
setSlideSizeEmu(
|
|
4158
4160
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -4165,13 +4167,13 @@ function useLoadContent({
|
|
|
4165
4167
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
4166
4168
|
setSlideMasters(parsed.slideMasters ?? []);
|
|
4167
4169
|
setModernCommentAuthors(parsed.modernCommentAuthors ?? []);
|
|
4168
|
-
setRecentColors(
|
|
4170
|
+
setRecentColors(chunkAU5YFUUK_js.seedRecentColors({ mruColors: parsed.mruColors }));
|
|
4169
4171
|
setTheme(parsed.theme);
|
|
4170
4172
|
setTableStyleMap(nextTableStyleMap);
|
|
4171
4173
|
setThemeOptions(parsed.themeOptions ?? []);
|
|
4172
4174
|
setCustomShows(parsed.customShows ?? []);
|
|
4173
4175
|
setActiveCustomShowId(
|
|
4174
|
-
|
|
4176
|
+
chunkAU5YFUUK_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
|
|
4175
4177
|
);
|
|
4176
4178
|
setSections(parsed.sections ?? []);
|
|
4177
4179
|
setPresentationProperties(parsed.presentationProperties ?? {});
|
|
@@ -4194,10 +4196,10 @@ function useLoadContent({
|
|
|
4194
4196
|
setHasMacros(parsed.hasMacros === true);
|
|
4195
4197
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
4196
4198
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
4197
|
-
setGuides(
|
|
4198
|
-
setReadOnlyRecommendation(
|
|
4199
|
+
setGuides(chunkAU5YFUUK_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
4200
|
+
setReadOnlyRecommendation(chunkAU5YFUUK_js.readOnlyRecommendation(parsed));
|
|
4199
4201
|
setCompatToasts(
|
|
4200
|
-
|
|
4202
|
+
chunkAU5YFUUK_js.compatibilityWarningToasts([
|
|
4201
4203
|
...parsed.warnings ?? [],
|
|
4202
4204
|
...parsed.slides.flatMap((slide) => slide.warnings ?? [])
|
|
4203
4205
|
])
|
|
@@ -4209,7 +4211,7 @@ function useLoadContent({
|
|
|
4209
4211
|
onContentApplied?.();
|
|
4210
4212
|
} catch (err) {
|
|
4211
4213
|
if (!cancelled && token === renderTokenRef.current) {
|
|
4212
|
-
if (err instanceof
|
|
4214
|
+
if (err instanceof chunkAU5YFUUK_js.EncryptedFileError) {
|
|
4213
4215
|
setIsEncrypted(true);
|
|
4214
4216
|
} else {
|
|
4215
4217
|
console.error("[pptx] Failed to load presentation content:", err);
|
|
@@ -4237,7 +4239,7 @@ function useLoadContent({
|
|
|
4237
4239
|
}
|
|
4238
4240
|
function useAutosave(input) {
|
|
4239
4241
|
const { isDirty, filePath, serializeSlides, enabled = true, getChangeSources } = input;
|
|
4240
|
-
const intervalMs =
|
|
4242
|
+
const intervalMs = chunkAU5YFUUK_js.resolveAutosaveIntervalMs({
|
|
4241
4243
|
hostIntervalMs: input.intervalMs,
|
|
4242
4244
|
optionsIntervalSeconds: input.intervalSeconds
|
|
4243
4245
|
});
|
|
@@ -4268,7 +4270,7 @@ function useAutosave(input) {
|
|
|
4268
4270
|
return;
|
|
4269
4271
|
}
|
|
4270
4272
|
const sources = changeSourcesRef.current?.() ?? [];
|
|
4271
|
-
if (!
|
|
4273
|
+
if (!chunkAU5YFUUK_js.shouldWriteAutosaveSnapshot({
|
|
4272
4274
|
filePath: path,
|
|
4273
4275
|
isDirty: isDirtyRef.current,
|
|
4274
4276
|
saving: isSavingRef.current,
|
|
@@ -4286,8 +4288,8 @@ function useAutosave(input) {
|
|
|
4286
4288
|
isSavingRef.current = false;
|
|
4287
4289
|
return;
|
|
4288
4290
|
}
|
|
4289
|
-
await
|
|
4290
|
-
lastSnapshotRef.current =
|
|
4291
|
+
await chunkAU5YFUUK_js.saveAutosaveSnapshot(path, data);
|
|
4292
|
+
lastSnapshotRef.current = chunkAU5YFUUK_js.autosaveSnapshotMark(path, sources);
|
|
4291
4293
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4292
4294
|
} catch (err) {
|
|
4293
4295
|
setAutosaveStatus({
|
|
@@ -4336,8 +4338,23 @@ function useElementOperations(input) {
|
|
|
4336
4338
|
setSelectedElementId,
|
|
4337
4339
|
setSelectedElementIds,
|
|
4338
4340
|
setInlineEditingElementId,
|
|
4339
|
-
setContextMenuState
|
|
4341
|
+
setContextMenuState,
|
|
4342
|
+
inlineEditingElementId,
|
|
4343
|
+
inlineEditingText
|
|
4340
4344
|
} = input;
|
|
4345
|
+
const liveTextSegments = react.useCallback(() => {
|
|
4346
|
+
if (!selectedElement || !chunkAU5YFUUK_js.hasTextProperties(selectedElement)) {
|
|
4347
|
+
return void 0;
|
|
4348
|
+
}
|
|
4349
|
+
if (selectedElement.id !== inlineEditingElementId) {
|
|
4350
|
+
return selectedElement.textSegments;
|
|
4351
|
+
}
|
|
4352
|
+
return chunkAU5YFUUK_js.remapTextToSegments(
|
|
4353
|
+
inlineEditingText,
|
|
4354
|
+
selectedElement.textSegments,
|
|
4355
|
+
selectedElement.textStyle
|
|
4356
|
+
);
|
|
4357
|
+
}, [selectedElement, inlineEditingElementId, inlineEditingText]);
|
|
4341
4358
|
const applySelection = react.useCallback(
|
|
4342
4359
|
(primaryId, ids = []) => {
|
|
4343
4360
|
setSelectedElementId(primaryId);
|
|
@@ -4373,11 +4390,11 @@ function useElementOperations(input) {
|
|
|
4373
4390
|
(elementId, updates) => {
|
|
4374
4391
|
if (masterView?.target) {
|
|
4375
4392
|
applyMasterViewWrite(
|
|
4376
|
-
|
|
4393
|
+
chunkAU5YFUUK_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
|
|
4377
4394
|
);
|
|
4378
4395
|
return;
|
|
4379
4396
|
}
|
|
4380
|
-
if (
|
|
4397
|
+
if (chunkAU5YFUUK_js.isTemplateElementId(elementId)) {
|
|
4381
4398
|
const slideId = activeSlide?.id;
|
|
4382
4399
|
if (slideId) {
|
|
4383
4400
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4388,7 +4405,7 @@ function useElementOperations(input) {
|
|
|
4388
4405
|
}));
|
|
4389
4406
|
}
|
|
4390
4407
|
} else {
|
|
4391
|
-
setSlides((prev) =>
|
|
4408
|
+
setSlides((prev) => chunkAU5YFUUK_js.updateElement(prev, activeSlideIndex, elementId, updates));
|
|
4392
4409
|
}
|
|
4393
4410
|
history.markDirty();
|
|
4394
4411
|
},
|
|
@@ -4413,7 +4430,7 @@ function useElementOperations(input) {
|
|
|
4413
4430
|
);
|
|
4414
4431
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4415
4432
|
(updates) => {
|
|
4416
|
-
if (!selectedElement || !
|
|
4433
|
+
if (!selectedElement || !chunkAU5YFUUK_js.hasShapeProperties(selectedElement)) {
|
|
4417
4434
|
return;
|
|
4418
4435
|
}
|
|
4419
4436
|
updateSelectedElement({
|
|
@@ -4424,63 +4441,81 @@ function useElementOperations(input) {
|
|
|
4424
4441
|
);
|
|
4425
4442
|
const updateSelectedTextStyle = react.useCallback(
|
|
4426
4443
|
(updates) => {
|
|
4427
|
-
if (!selectedElement || !
|
|
4444
|
+
if (!selectedElement || !chunkAU5YFUUK_js.hasTextProperties(selectedElement)) {
|
|
4428
4445
|
return;
|
|
4429
4446
|
}
|
|
4430
|
-
const
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4447
|
+
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
4448
|
+
const currentSegments = liveTextSegments();
|
|
4449
|
+
const inlineSel = chunkAU5YFUUK_js.getInlineEditorSelection(currentSegments);
|
|
4450
|
+
if (inlineSel && currentSegments) {
|
|
4451
|
+
const { newSegments: newSegments2, newSelection } = chunkAU5YFUUK_js.applyStyleToSelectedSegments(
|
|
4452
|
+
currentSegments,
|
|
4434
4453
|
inlineSel,
|
|
4435
4454
|
updates
|
|
4436
4455
|
);
|
|
4437
|
-
|
|
4456
|
+
chunkAU5YFUUK_js.setPendingSelectionRestore(newSelection);
|
|
4438
4457
|
updateSelectedElement({
|
|
4439
|
-
textSegments: newSegments2
|
|
4458
|
+
textSegments: newSegments2,
|
|
4459
|
+
...isLiveEditing ? { text: inlineEditingText } : {}
|
|
4440
4460
|
});
|
|
4441
4461
|
return;
|
|
4442
4462
|
}
|
|
4443
4463
|
const newTextStyle = { ...selectedElement.textStyle, ...updates };
|
|
4444
|
-
const newSegments =
|
|
4464
|
+
const newSegments = currentSegments?.map((seg) => ({
|
|
4445
4465
|
...seg,
|
|
4446
4466
|
style: { ...seg.style, ...updates }
|
|
4447
4467
|
}));
|
|
4448
4468
|
updateSelectedElement({
|
|
4449
4469
|
textStyle: newTextStyle,
|
|
4450
|
-
textSegments: newSegments
|
|
4470
|
+
textSegments: newSegments,
|
|
4471
|
+
...isLiveEditing ? { text: inlineEditingText } : {}
|
|
4451
4472
|
});
|
|
4452
4473
|
},
|
|
4453
|
-
[
|
|
4474
|
+
[
|
|
4475
|
+
selectedElement,
|
|
4476
|
+
updateSelectedElement,
|
|
4477
|
+
inlineEditingElementId,
|
|
4478
|
+
inlineEditingText,
|
|
4479
|
+
liveTextSegments
|
|
4480
|
+
]
|
|
4454
4481
|
);
|
|
4455
4482
|
const updateSelectedTextCase = react.useCallback(
|
|
4456
4483
|
(mode) => {
|
|
4457
|
-
if (!selectedElement || !
|
|
4484
|
+
if (!selectedElement || !chunkAU5YFUUK_js.hasTextProperties(selectedElement)) {
|
|
4458
4485
|
return;
|
|
4459
4486
|
}
|
|
4460
|
-
const
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4487
|
+
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
4488
|
+
const currentSegments = liveTextSegments();
|
|
4489
|
+
const inlineSel = chunkAU5YFUUK_js.getInlineEditorSelection(currentSegments);
|
|
4490
|
+
if (inlineSel && currentSegments) {
|
|
4491
|
+
const newSegments = chunkAU5YFUUK_js.applyCaseTransformToSegments(currentSegments, inlineSel, mode);
|
|
4492
|
+
updateSelectedElement({
|
|
4493
|
+
textSegments: newSegments,
|
|
4494
|
+
...isLiveEditing ? { text: inlineEditingText } : {}
|
|
4495
|
+
});
|
|
4468
4496
|
return;
|
|
4469
4497
|
}
|
|
4470
4498
|
const updates = {};
|
|
4471
|
-
if (
|
|
4472
|
-
updates.textSegments =
|
|
4473
|
-
|
|
4499
|
+
if (currentSegments && currentSegments.length > 0) {
|
|
4500
|
+
updates.textSegments = chunkAU5YFUUK_js.applyCaseTransformToSegments(
|
|
4501
|
+
currentSegments,
|
|
4474
4502
|
null,
|
|
4475
4503
|
mode
|
|
4476
4504
|
);
|
|
4477
4505
|
}
|
|
4478
|
-
|
|
4479
|
-
|
|
4506
|
+
const baseText = isLiveEditing ? inlineEditingText : selectedElement.text;
|
|
4507
|
+
if (typeof baseText === "string") {
|
|
4508
|
+
updates.text = chunkAU5YFUUK_js.transformTextCase(baseText, mode);
|
|
4480
4509
|
}
|
|
4481
4510
|
updateSelectedElement(updates);
|
|
4482
4511
|
},
|
|
4483
|
-
[
|
|
4512
|
+
[
|
|
4513
|
+
selectedElement,
|
|
4514
|
+
updateSelectedElement,
|
|
4515
|
+
inlineEditingElementId,
|
|
4516
|
+
inlineEditingText,
|
|
4517
|
+
liveTextSegments
|
|
4518
|
+
]
|
|
4484
4519
|
);
|
|
4485
4520
|
const updateSlides = react.useCallback(
|
|
4486
4521
|
(updater) => {
|
|
@@ -4489,15 +4524,15 @@ function useElementOperations(input) {
|
|
|
4489
4524
|
[setSlides]
|
|
4490
4525
|
);
|
|
4491
4526
|
const masterViewTarget = masterView?.target ?? null;
|
|
4492
|
-
const activeElements = masterViewTarget ?
|
|
4527
|
+
const activeElements = masterViewTarget ? chunkAU5YFUUK_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4493
4528
|
const updateActiveElements = react.useCallback(
|
|
4494
4529
|
(updater) => {
|
|
4495
4530
|
if (masterView?.target) {
|
|
4496
4531
|
applyMasterViewWrite(
|
|
4497
|
-
|
|
4532
|
+
chunkAU5YFUUK_js.replaceMasterViewElements(
|
|
4498
4533
|
masterView,
|
|
4499
4534
|
masterView.target,
|
|
4500
|
-
updater(
|
|
4535
|
+
updater(chunkAU5YFUUK_js.masterViewElements(masterView, masterView.target))
|
|
4501
4536
|
)
|
|
4502
4537
|
);
|
|
4503
4538
|
return;
|
|
@@ -4550,7 +4585,7 @@ function useSectionOperations(input) {
|
|
|
4550
4585
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4551
4586
|
const addSection2 = react.useCallback(
|
|
4552
4587
|
(name, afterSlideIndex) => {
|
|
4553
|
-
const result =
|
|
4588
|
+
const result = chunkAU5YFUUK_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4554
4589
|
setSlides(result.slides);
|
|
4555
4590
|
setSections(result.sections);
|
|
4556
4591
|
markDirty();
|
|
@@ -4559,7 +4594,7 @@ function useSectionOperations(input) {
|
|
|
4559
4594
|
);
|
|
4560
4595
|
const renameSection2 = react.useCallback(
|
|
4561
4596
|
(sectionId, newName) => {
|
|
4562
|
-
const result =
|
|
4597
|
+
const result = chunkAU5YFUUK_js.renameSection(sections, slides, sectionId, newName);
|
|
4563
4598
|
setSections(result.sections);
|
|
4564
4599
|
setSlides(result.slides);
|
|
4565
4600
|
markDirty();
|
|
@@ -4568,7 +4603,7 @@ function useSectionOperations(input) {
|
|
|
4568
4603
|
);
|
|
4569
4604
|
const deleteSection2 = react.useCallback(
|
|
4570
4605
|
(sectionId) => {
|
|
4571
|
-
const result =
|
|
4606
|
+
const result = chunkAU5YFUUK_js.deleteSection(sections, slides, sectionId);
|
|
4572
4607
|
setSections(result.sections);
|
|
4573
4608
|
setSlides(result.slides);
|
|
4574
4609
|
markDirty();
|
|
@@ -4577,21 +4612,21 @@ function useSectionOperations(input) {
|
|
|
4577
4612
|
);
|
|
4578
4613
|
const moveSectionUp2 = react.useCallback(
|
|
4579
4614
|
(sectionId) => {
|
|
4580
|
-
setSections(
|
|
4615
|
+
setSections(chunkAU5YFUUK_js.moveSectionUp(sections, sectionId));
|
|
4581
4616
|
markDirty();
|
|
4582
4617
|
},
|
|
4583
4618
|
[sections, setSections, markDirty]
|
|
4584
4619
|
);
|
|
4585
4620
|
const moveSectionDown2 = react.useCallback(
|
|
4586
4621
|
(sectionId) => {
|
|
4587
|
-
setSections(
|
|
4622
|
+
setSections(chunkAU5YFUUK_js.moveSectionDown(sections, sectionId));
|
|
4588
4623
|
markDirty();
|
|
4589
4624
|
},
|
|
4590
4625
|
[sections, setSections, markDirty]
|
|
4591
4626
|
);
|
|
4592
4627
|
const moveSlidesToSection2 = react.useCallback(
|
|
4593
4628
|
(slideIndexes, targetSectionId) => {
|
|
4594
|
-
const result =
|
|
4629
|
+
const result = chunkAU5YFUUK_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4595
4630
|
setSlides(result.slides);
|
|
4596
4631
|
setSections(result.sections);
|
|
4597
4632
|
markDirty();
|
|
@@ -4657,15 +4692,15 @@ function syncSelectionHandleOverlay(elementNode, elementId, geometry) {
|
|
|
4657
4692
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4658
4693
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx, lockAspect = false) {
|
|
4659
4694
|
const startBox = { x: startX, y: startY, width: startWidth, height: startHeight };
|
|
4660
|
-
let resized =
|
|
4695
|
+
let resized = chunkAU5YFUUK_js.applyResize(startBox, handle, dx, dy, 1, { minSize: chunkAEP6X24D_js.MIN_ELEMENT_SIZE });
|
|
4661
4696
|
if (lockAspect) {
|
|
4662
|
-
resized =
|
|
4697
|
+
resized = chunkAU5YFUUK_js.lockResizeAspect(resized, startBox, handle, chunkAEP6X24D_js.MIN_ELEMENT_SIZE);
|
|
4663
4698
|
}
|
|
4664
4699
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4665
4700
|
if (!snapToGrid) {
|
|
4666
4701
|
return box;
|
|
4667
4702
|
}
|
|
4668
|
-
return
|
|
4703
|
+
return chunkAU5YFUUK_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkAEP6X24D_js.MIN_ELEMENT_SIZE);
|
|
4669
4704
|
}
|
|
4670
4705
|
function resolveLiveTarget(input) {
|
|
4671
4706
|
const { livePatcher, editTemplateMode, activeSlide } = input;
|
|
@@ -4778,7 +4813,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4778
4813
|
width: el.width,
|
|
4779
4814
|
height: el.height
|
|
4780
4815
|
}));
|
|
4781
|
-
const snapResult =
|
|
4816
|
+
const snapResult = chunkAU5YFUUK_js.computeSnapToShape(
|
|
4782
4817
|
targetX,
|
|
4783
4818
|
targetY,
|
|
4784
4819
|
primaryEl.width,
|
|
@@ -4820,7 +4855,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4820
4855
|
if (live) {
|
|
4821
4856
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4822
4857
|
const start = drag.startPositionsById[id];
|
|
4823
|
-
|
|
4858
|
+
chunkAU5YFUUK_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4824
4859
|
x: start.x + appliedDx,
|
|
4825
4860
|
y: start.y + appliedDy
|
|
4826
4861
|
});
|
|
@@ -4852,8 +4887,8 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4852
4887
|
rs.lastY = geo.y;
|
|
4853
4888
|
rs.lastWidth = geo.width;
|
|
4854
4889
|
rs.lastHeight = geo.height;
|
|
4855
|
-
const width = Math.max(geo.width,
|
|
4856
|
-
const height = Math.max(geo.height,
|
|
4890
|
+
const width = Math.max(geo.width, chunkAEP6X24D_js.MIN_ELEMENT_SIZE);
|
|
4891
|
+
const height = Math.max(geo.height, chunkAEP6X24D_js.MIN_ELEMENT_SIZE);
|
|
4857
4892
|
if (rs.domEl) {
|
|
4858
4893
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4859
4894
|
rs.domEl.style.top = `${geo.y}px`;
|
|
@@ -4862,7 +4897,7 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4862
4897
|
syncSelectionHandleOverlay(rs.domEl, rs.elementId, { x: geo.x, y: geo.y, width, height });
|
|
4863
4898
|
}
|
|
4864
4899
|
if (live) {
|
|
4865
|
-
|
|
4900
|
+
chunkAU5YFUUK_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4866
4901
|
x: geo.x,
|
|
4867
4902
|
y: geo.y,
|
|
4868
4903
|
width,
|
|
@@ -4873,7 +4908,7 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4873
4908
|
function processAdjustmentMove(e, adj, editorScale, updateElementById) {
|
|
4874
4909
|
const dx = (e.clientX - adj.startClientX) / editorScale;
|
|
4875
4910
|
const dy = (e.clientY - adj.startClientY) / editorScale;
|
|
4876
|
-
const adjustments =
|
|
4911
|
+
const adjustments = chunkAU5YFUUK_js.getDraggedShapeAdjustments(adj, dx, dy);
|
|
4877
4912
|
if (!adj.moved && Math.hypot(dx, dy) > 2) {
|
|
4878
4913
|
adj.moved = true;
|
|
4879
4914
|
}
|
|
@@ -4948,13 +4983,13 @@ function processPointerUp(input) {
|
|
|
4948
4983
|
if (i !== activeSlideIndex) {
|
|
4949
4984
|
return s;
|
|
4950
4985
|
}
|
|
4951
|
-
const rerouted =
|
|
4986
|
+
const rerouted = chunkAU5YFUUK_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4952
4987
|
if (rerouted.length === 0) {
|
|
4953
4988
|
return s;
|
|
4954
4989
|
}
|
|
4955
4990
|
return {
|
|
4956
4991
|
...s,
|
|
4957
|
-
elements:
|
|
4992
|
+
elements: chunkAU5YFUUK_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4958
4993
|
};
|
|
4959
4994
|
})
|
|
4960
4995
|
);
|
|
@@ -4979,9 +5014,9 @@ function processPointerUp(input) {
|
|
|
4979
5014
|
}
|
|
4980
5015
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4981
5016
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4982
|
-
const hitIds =
|
|
5017
|
+
const hitIds = chunkAU5YFUUK_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4983
5018
|
if (marquee.additive) {
|
|
4984
|
-
const merged =
|
|
5019
|
+
const merged = chunkAU5YFUUK_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4985
5020
|
if (merged.length > 0) {
|
|
4986
5021
|
applySelection(merged[0], merged);
|
|
4987
5022
|
} else {
|
|
@@ -5004,8 +5039,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
5004
5039
|
}
|
|
5005
5040
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
5006
5041
|
});
|
|
5007
|
-
const rerouted =
|
|
5008
|
-
return
|
|
5042
|
+
const rerouted = chunkAU5YFUUK_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
5043
|
+
return chunkAU5YFUUK_js.applyReroutedConnectors(movedElements, rerouted);
|
|
5009
5044
|
};
|
|
5010
5045
|
if (editTemplateMode) {
|
|
5011
5046
|
const slideId = activeSlide?.id;
|
|
@@ -5161,11 +5196,11 @@ function useCanvasInteractions(input) {
|
|
|
5161
5196
|
return;
|
|
5162
5197
|
}
|
|
5163
5198
|
const el = elementLookup.get(editId);
|
|
5164
|
-
if (el &&
|
|
5199
|
+
if (el && chunkAU5YFUUK_js.hasTextProperties(el)) {
|
|
5165
5200
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
5166
|
-
const newSegments =
|
|
5201
|
+
const newSegments = chunkAU5YFUUK_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
5167
5202
|
const editorEl = document.querySelector("[data-inline-editor]");
|
|
5168
|
-
const newHeight =
|
|
5203
|
+
const newHeight = chunkAU5YFUUK_js.resolveInlineEditAutoFitHeight(el.textStyle, el.height, editorEl);
|
|
5169
5204
|
ops.updateElementById(editId, {
|
|
5170
5205
|
text: committedText,
|
|
5171
5206
|
textSegments: newSegments,
|
|
@@ -5177,7 +5212,7 @@ function useCanvasInteractions(input) {
|
|
|
5177
5212
|
setInlineEditingText("");
|
|
5178
5213
|
};
|
|
5179
5214
|
const openEquationEditorForElement = (el) => {
|
|
5180
|
-
if (!
|
|
5215
|
+
if (!chunkAU5YFUUK_js.hasTextProperties(el)) {
|
|
5181
5216
|
return false;
|
|
5182
5217
|
}
|
|
5183
5218
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -5207,7 +5242,7 @@ function useCanvasInteractions(input) {
|
|
|
5207
5242
|
justInteractedRef.current = false;
|
|
5208
5243
|
} else {
|
|
5209
5244
|
const el = elementLookup.get(elementId);
|
|
5210
|
-
if (el &&
|
|
5245
|
+
if (el && chunkAU5YFUUK_js.hasTextProperties(el) && chunkAU5YFUUK_js.canInteractWithElement(el, "textEdit")) {
|
|
5211
5246
|
if (!openEquationEditorForElement(el)) {
|
|
5212
5247
|
setInlineEditingElementId(elementId);
|
|
5213
5248
|
setInlineEditingText(el.text ?? "");
|
|
@@ -5226,7 +5261,7 @@ function useCanvasInteractions(input) {
|
|
|
5226
5261
|
if (openEquationEditorForElement(el)) {
|
|
5227
5262
|
return;
|
|
5228
5263
|
}
|
|
5229
|
-
if (
|
|
5264
|
+
if (chunkAU5YFUUK_js.hasTextProperties(el) && chunkAU5YFUUK_js.canInteractWithElement(el, "textEdit")) {
|
|
5230
5265
|
setInlineEditingElementId(elementId);
|
|
5231
5266
|
setInlineEditingText(el.text ?? "");
|
|
5232
5267
|
}
|
|
@@ -5249,7 +5284,7 @@ function useCanvasInteractions(input) {
|
|
|
5249
5284
|
justSelectedRef.current = false;
|
|
5250
5285
|
}
|
|
5251
5286
|
const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
|
|
5252
|
-
const movableIds =
|
|
5287
|
+
const movableIds = chunkAU5YFUUK_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
|
|
5253
5288
|
if (movableIds.length === 0) {
|
|
5254
5289
|
return;
|
|
5255
5290
|
}
|
|
@@ -5319,7 +5354,7 @@ function useCanvasInteractions(input) {
|
|
|
5319
5354
|
const handleResizePointerDown = (elementId, e, handle) => {
|
|
5320
5355
|
e.stopPropagation();
|
|
5321
5356
|
const el = elementLookup.get(elementId);
|
|
5322
|
-
if (!el || !
|
|
5357
|
+
if (!el || !chunkAU5YFUUK_js.canInteractWithElement(el, "resize")) {
|
|
5323
5358
|
return;
|
|
5324
5359
|
}
|
|
5325
5360
|
resizeStateRef.current = {
|
|
@@ -5341,7 +5376,7 @@ function useCanvasInteractions(input) {
|
|
|
5341
5376
|
};
|
|
5342
5377
|
const handleRotate = (elementId, rotationDeg) => {
|
|
5343
5378
|
const el = elementLookup.get(elementId);
|
|
5344
|
-
if (!el || !
|
|
5379
|
+
if (!el || !chunkAU5YFUUK_js.canInteractWithElement(el, "rotate")) {
|
|
5345
5380
|
return;
|
|
5346
5381
|
}
|
|
5347
5382
|
ops.updateElementById(elementId, { rotation: rotationDeg });
|
|
@@ -5361,10 +5396,10 @@ function useCanvasInteractions(input) {
|
|
|
5361
5396
|
const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
|
|
5362
5397
|
e.stopPropagation();
|
|
5363
5398
|
const el = elementLookup.get(elementId);
|
|
5364
|
-
if (!el || !
|
|
5399
|
+
if (!el || !chunkAU5YFUUK_js.canInteractWithElement(el, "adjustHandle")) {
|
|
5365
5400
|
return;
|
|
5366
5401
|
}
|
|
5367
|
-
shapeAdjustmentDragStateRef.current =
|
|
5402
|
+
shapeAdjustmentDragStateRef.current = chunkAU5YFUUK_js.beginShapeAdjustment(
|
|
5368
5403
|
el,
|
|
5369
5404
|
descriptor,
|
|
5370
5405
|
e.clientX,
|
|
@@ -5411,7 +5446,7 @@ function createFileHandlers(deps) {
|
|
|
5411
5446
|
h = Math.round(h * scale);
|
|
5412
5447
|
}
|
|
5413
5448
|
addElement({
|
|
5414
|
-
id:
|
|
5449
|
+
id: chunkAU5YFUUK_js.generateElementId(),
|
|
5415
5450
|
type: "image",
|
|
5416
5451
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5417
5452
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5422,7 +5457,7 @@ function createFileHandlers(deps) {
|
|
|
5422
5457
|
};
|
|
5423
5458
|
img.onerror = () => {
|
|
5424
5459
|
addElement({
|
|
5425
|
-
id:
|
|
5460
|
+
id: chunkAU5YFUUK_js.generateElementId(),
|
|
5426
5461
|
type: "image",
|
|
5427
5462
|
x: 100,
|
|
5428
5463
|
y: 100,
|
|
@@ -5441,14 +5476,14 @@ function createFileHandlers(deps) {
|
|
|
5441
5476
|
return;
|
|
5442
5477
|
}
|
|
5443
5478
|
e.target.value = "";
|
|
5444
|
-
const mediaType =
|
|
5479
|
+
const mediaType = chunkAU5YFUUK_js.classifyMediaType(file.type);
|
|
5445
5480
|
if (!mediaType) {
|
|
5446
5481
|
return;
|
|
5447
5482
|
}
|
|
5448
5483
|
const elFilePath = file.path;
|
|
5449
5484
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5450
5485
|
addElement({
|
|
5451
|
-
id:
|
|
5486
|
+
id: chunkAU5YFUUK_js.generateElementId(),
|
|
5452
5487
|
type: "media",
|
|
5453
5488
|
mediaType,
|
|
5454
5489
|
mediaMimeType: file.type || void 0,
|
|
@@ -5623,13 +5658,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5623
5658
|
return;
|
|
5624
5659
|
}
|
|
5625
5660
|
addElement({
|
|
5626
|
-
id:
|
|
5661
|
+
id: chunkAU5YFUUK_js.generateElementId(),
|
|
5627
5662
|
type: "smartArt",
|
|
5628
5663
|
x: 100,
|
|
5629
5664
|
y: 120,
|
|
5630
5665
|
width: 600,
|
|
5631
5666
|
height: 340,
|
|
5632
|
-
smartArtData:
|
|
5667
|
+
smartArtData: chunkAU5YFUUK_js.buildSmartArtPresetData(
|
|
5633
5668
|
layout,
|
|
5634
5669
|
defaultItems,
|
|
5635
5670
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5641,7 +5676,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5641
5676
|
return;
|
|
5642
5677
|
}
|
|
5643
5678
|
addElement({
|
|
5644
|
-
id:
|
|
5679
|
+
id: chunkAU5YFUUK_js.generateElementId(),
|
|
5645
5680
|
type: "shape",
|
|
5646
5681
|
x: 120,
|
|
5647
5682
|
y: 200,
|
|
@@ -5679,7 +5714,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5679
5714
|
return;
|
|
5680
5715
|
}
|
|
5681
5716
|
const resolved = resolveHyperlinkEditResult(data);
|
|
5682
|
-
if (resolved.url && !
|
|
5717
|
+
if (resolved.url && !chunkAU5YFUUK_js.isUrlSafe(resolved.url)) {
|
|
5683
5718
|
return;
|
|
5684
5719
|
}
|
|
5685
5720
|
const actionClick = {
|
|
@@ -5703,7 +5738,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5703
5738
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5704
5739
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5705
5740
|
addElement({
|
|
5706
|
-
id:
|
|
5741
|
+
id: chunkAU5YFUUK_js.generateElementId(),
|
|
5707
5742
|
type: "shape",
|
|
5708
5743
|
x: 120,
|
|
5709
5744
|
y: 200,
|
|
@@ -5725,11 +5760,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5725
5760
|
if (!activeSlide) {
|
|
5726
5761
|
return;
|
|
5727
5762
|
}
|
|
5728
|
-
const preset =
|
|
5763
|
+
const preset = chunkAU5YFUUK_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5729
5764
|
if (!preset) {
|
|
5730
5765
|
return;
|
|
5731
5766
|
}
|
|
5732
|
-
const defaultPptxAction =
|
|
5767
|
+
const defaultPptxAction = chunkAU5YFUUK_js.elementActionToPptxAction({
|
|
5733
5768
|
trigger: "click",
|
|
5734
5769
|
type: preset.defaultAction
|
|
5735
5770
|
});
|
|
@@ -5738,7 +5773,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5738
5773
|
defaultPptxAction.highlightClick = true;
|
|
5739
5774
|
}
|
|
5740
5775
|
addElement({
|
|
5741
|
-
id:
|
|
5776
|
+
id: chunkAU5YFUUK_js.generateElementId(),
|
|
5742
5777
|
type: "shape",
|
|
5743
5778
|
x: 150,
|
|
5744
5779
|
y: 150,
|
|
@@ -5805,14 +5840,14 @@ function useInsertElements(input) {
|
|
|
5805
5840
|
return;
|
|
5806
5841
|
}
|
|
5807
5842
|
addElement({
|
|
5808
|
-
id:
|
|
5843
|
+
id: chunkAU5YFUUK_js.generateElementId(),
|
|
5809
5844
|
type: "text",
|
|
5810
5845
|
x: 100,
|
|
5811
5846
|
y: 100,
|
|
5812
5847
|
width: 300,
|
|
5813
5848
|
height: 60,
|
|
5814
5849
|
text: "",
|
|
5815
|
-
textStyle: { fontSize:
|
|
5850
|
+
textStyle: { fontSize: chunkAEP6X24D_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5816
5851
|
});
|
|
5817
5852
|
};
|
|
5818
5853
|
const handleAddShape = () => {
|
|
@@ -5820,7 +5855,7 @@ function useInsertElements(input) {
|
|
|
5820
5855
|
return;
|
|
5821
5856
|
}
|
|
5822
5857
|
addElement({
|
|
5823
|
-
id:
|
|
5858
|
+
id: chunkAU5YFUUK_js.generateElementId(),
|
|
5824
5859
|
type: "shape",
|
|
5825
5860
|
x: 150,
|
|
5826
5861
|
y: 150,
|
|
@@ -5839,15 +5874,15 @@ function useInsertElements(input) {
|
|
|
5839
5874
|
return;
|
|
5840
5875
|
}
|
|
5841
5876
|
addElement({
|
|
5842
|
-
...
|
|
5843
|
-
id:
|
|
5877
|
+
...chunkAU5YFUUK_js.newTableElement(chunkAEP6X24D_js.DEFAULT_TABLE_ROWS, chunkAEP6X24D_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5878
|
+
id: chunkAU5YFUUK_js.generateElementId()
|
|
5844
5879
|
});
|
|
5845
5880
|
};
|
|
5846
5881
|
const handleAddChart = (chartKind) => {
|
|
5847
5882
|
if (!activeSlide) {
|
|
5848
5883
|
return;
|
|
5849
5884
|
}
|
|
5850
|
-
addElement(
|
|
5885
|
+
addElement(chunkAU5YFUUK_js.createDefaultChartElement(chartKind));
|
|
5851
5886
|
};
|
|
5852
5887
|
const structured = createStructuredElementHandlers({
|
|
5853
5888
|
activeSlide,
|
|
@@ -5917,7 +5952,7 @@ function useClipboardHandlers(input) {
|
|
|
5917
5952
|
if (!selectedElement) {
|
|
5918
5953
|
return;
|
|
5919
5954
|
}
|
|
5920
|
-
setClipboardPayload(
|
|
5955
|
+
setClipboardPayload(chunkAU5YFUUK_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5921
5956
|
};
|
|
5922
5957
|
const handleDelete = () => {
|
|
5923
5958
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5934,7 +5969,7 @@ function useClipboardHandlers(input) {
|
|
|
5934
5969
|
handleDelete();
|
|
5935
5970
|
};
|
|
5936
5971
|
const insertClone = (source) => {
|
|
5937
|
-
const clone =
|
|
5972
|
+
const clone = chunkAU5YFUUK_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5938
5973
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5939
5974
|
ops.applySelection(clone.id);
|
|
5940
5975
|
history.markDirty();
|
|
@@ -5969,7 +6004,7 @@ function resolveShapePath(el) {
|
|
|
5969
6004
|
return el.pathData;
|
|
5970
6005
|
}
|
|
5971
6006
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5972
|
-
const clipPath =
|
|
6007
|
+
const clipPath = chunkAU5YFUUK_js.getPresetShapeClipPath(el.shapeType);
|
|
5973
6008
|
if (clipPath) {
|
|
5974
6009
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5975
6010
|
if (svgPath) {
|
|
@@ -6020,7 +6055,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
6020
6055
|
return parts.join(" ");
|
|
6021
6056
|
}
|
|
6022
6057
|
function transformPathToGlobal(pathData, el) {
|
|
6023
|
-
const polys =
|
|
6058
|
+
const polys = chunkAU5YFUUK_js.svgPathToPolygons(pathData);
|
|
6024
6059
|
if (polys.length === 0) {
|
|
6025
6060
|
return pathData;
|
|
6026
6061
|
}
|
|
@@ -6040,10 +6075,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
6040
6075
|
y: pt.y * scaleY + el.y
|
|
6041
6076
|
}))
|
|
6042
6077
|
);
|
|
6043
|
-
return
|
|
6078
|
+
return chunkAU5YFUUK_js.polygonsToSvgPath(transformed);
|
|
6044
6079
|
}
|
|
6045
6080
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
6046
|
-
const polys =
|
|
6081
|
+
const polys = chunkAU5YFUUK_js.svgPathToPolygons(pathData);
|
|
6047
6082
|
if (polys.length === 0) {
|
|
6048
6083
|
return pathData;
|
|
6049
6084
|
}
|
|
@@ -6053,10 +6088,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
6053
6088
|
y: pt.y - y
|
|
6054
6089
|
}))
|
|
6055
6090
|
);
|
|
6056
|
-
return
|
|
6091
|
+
return chunkAU5YFUUK_js.polygonsToSvgPath(transformed);
|
|
6057
6092
|
}
|
|
6058
6093
|
function pathBounds(pathData) {
|
|
6059
|
-
const polys =
|
|
6094
|
+
const polys = chunkAU5YFUUK_js.svgPathToPolygons(pathData);
|
|
6060
6095
|
let minX = Infinity;
|
|
6061
6096
|
let minY = Infinity;
|
|
6062
6097
|
let maxX = -Infinity;
|
|
@@ -6115,7 +6150,7 @@ function useMergeShapesHandler(input) {
|
|
|
6115
6150
|
let allFragments = [];
|
|
6116
6151
|
let remaining = globalPaths[0];
|
|
6117
6152
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
6118
|
-
const frags =
|
|
6153
|
+
const frags = chunkAU5YFUUK_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
6119
6154
|
if (Array.isArray(frags)) {
|
|
6120
6155
|
allFragments = frags;
|
|
6121
6156
|
}
|
|
@@ -6144,7 +6179,7 @@ function useMergeShapesHandler(input) {
|
|
|
6144
6179
|
bounds.height
|
|
6145
6180
|
);
|
|
6146
6181
|
const newEl = {
|
|
6147
|
-
id:
|
|
6182
|
+
id: chunkAU5YFUUK_js.generateElementId(),
|
|
6148
6183
|
type: "shape",
|
|
6149
6184
|
x: bounds.x,
|
|
6150
6185
|
y: bounds.y,
|
|
@@ -6182,7 +6217,7 @@ function useMergeShapesHandler(input) {
|
|
|
6182
6217
|
} else {
|
|
6183
6218
|
let resultPath = globalPaths[0];
|
|
6184
6219
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
6185
|
-
const result =
|
|
6220
|
+
const result = chunkAU5YFUUK_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
6186
6221
|
if (typeof result === "string") {
|
|
6187
6222
|
resultPath = result;
|
|
6188
6223
|
}
|
|
@@ -6203,7 +6238,7 @@ function useMergeShapesHandler(input) {
|
|
|
6203
6238
|
);
|
|
6204
6239
|
const primary = targets[0];
|
|
6205
6240
|
const newEl = {
|
|
6206
|
-
id:
|
|
6241
|
+
id: chunkAU5YFUUK_js.generateElementId(),
|
|
6207
6242
|
type: "shape",
|
|
6208
6243
|
x: bounds.x,
|
|
6209
6244
|
y: bounds.y,
|
|
@@ -6266,7 +6301,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6266
6301
|
if (ids.length < 2 || !activeSlide) {
|
|
6267
6302
|
return;
|
|
6268
6303
|
}
|
|
6269
|
-
const { elements, groupId } =
|
|
6304
|
+
const { elements, groupId } = chunkAU5YFUUK_js.groupElements(ops.activeElements, ids, chunkAU5YFUUK_js.generateElementId());
|
|
6270
6305
|
if (groupId === null) {
|
|
6271
6306
|
return;
|
|
6272
6307
|
}
|
|
@@ -6279,11 +6314,11 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6279
6314
|
return;
|
|
6280
6315
|
}
|
|
6281
6316
|
const group = selectedElement;
|
|
6282
|
-
const intoTemplate =
|
|
6317
|
+
const intoTemplate = chunkAU5YFUUK_js.isTemplateElementId(group.id);
|
|
6283
6318
|
const childIds = group.children.map(
|
|
6284
|
-
(child) => intoTemplate ?
|
|
6319
|
+
(child) => intoTemplate ? chunkAU5YFUUK_js.makeCloneId(true, child.id || group.id) : child.id || chunkAU5YFUUK_js.generateElementId()
|
|
6285
6320
|
);
|
|
6286
|
-
const { elements, childIds: usedIds } =
|
|
6321
|
+
const { elements, childIds: usedIds } = chunkAU5YFUUK_js.ungroupElements(
|
|
6287
6322
|
ops.activeElements,
|
|
6288
6323
|
group.id,
|
|
6289
6324
|
childIds,
|
|
@@ -6312,7 +6347,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6312
6347
|
if (!edge) {
|
|
6313
6348
|
return;
|
|
6314
6349
|
}
|
|
6315
|
-
const positions =
|
|
6350
|
+
const positions = chunkAU5YFUUK_js.alignElements(selectedElements, edge);
|
|
6316
6351
|
for (const [id, pos] of positions) {
|
|
6317
6352
|
const el = elementLookup.get(id);
|
|
6318
6353
|
if (!el) {
|
|
@@ -6330,7 +6365,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6330
6365
|
if (!distAxis) {
|
|
6331
6366
|
return;
|
|
6332
6367
|
}
|
|
6333
|
-
const positions =
|
|
6368
|
+
const positions = chunkAU5YFUUK_js.distributeElements(selectedElements, distAxis);
|
|
6334
6369
|
for (const [id, pos] of positions) {
|
|
6335
6370
|
const el = elementLookup.get(id);
|
|
6336
6371
|
if (!el) {
|
|
@@ -6347,7 +6382,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6347
6382
|
}
|
|
6348
6383
|
const id = selectedElement.id;
|
|
6349
6384
|
ops.updateActiveElements(
|
|
6350
|
-
(els) => direction === "forward" ?
|
|
6385
|
+
(els) => direction === "forward" ? chunkAU5YFUUK_js.bringForward(els, id) : direction === "backward" ? chunkAU5YFUUK_js.sendBackward(els, id) : els
|
|
6351
6386
|
);
|
|
6352
6387
|
history.markDirty();
|
|
6353
6388
|
};
|
|
@@ -6357,7 +6392,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6357
6392
|
}
|
|
6358
6393
|
const id = selectedElement.id;
|
|
6359
6394
|
ops.updateActiveElements(
|
|
6360
|
-
(els) => direction === "front" ?
|
|
6395
|
+
(els) => direction === "front" ? chunkAU5YFUUK_js.bringToFront(els, id) : chunkAU5YFUUK_js.sendToBack(els, id)
|
|
6361
6396
|
);
|
|
6362
6397
|
history.markDirty();
|
|
6363
6398
|
};
|
|
@@ -6488,7 +6523,7 @@ function useSlideManagement(input) {
|
|
|
6488
6523
|
theme
|
|
6489
6524
|
} = input;
|
|
6490
6525
|
const handleAddSlide = () => {
|
|
6491
|
-
const newSlide =
|
|
6526
|
+
const newSlide = chunkAU5YFUUK_js.createBlankSlide(slides.length + 1);
|
|
6492
6527
|
ops.updateSlides((prev) => {
|
|
6493
6528
|
const next = [...prev];
|
|
6494
6529
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6551,7 +6586,7 @@ function useSlideManagement(input) {
|
|
|
6551
6586
|
}
|
|
6552
6587
|
const clone = {
|
|
6553
6588
|
...src,
|
|
6554
|
-
id:
|
|
6589
|
+
id: chunkAU5YFUUK_js.makeSlideId(),
|
|
6555
6590
|
elements: src.elements.map((el) => ({
|
|
6556
6591
|
...el,
|
|
6557
6592
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6583,7 +6618,7 @@ function useSlideManagement(input) {
|
|
|
6583
6618
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6584
6619
|
const insertAt = activeSlideIndex + 1;
|
|
6585
6620
|
const draft = {
|
|
6586
|
-
...
|
|
6621
|
+
...chunkAU5YFUUK_js.createBlankSlide(slides.length + 1),
|
|
6587
6622
|
layoutPath,
|
|
6588
6623
|
...layoutName ? { layoutName } : {}
|
|
6589
6624
|
};
|
|
@@ -6616,9 +6651,9 @@ function useSlideManagement(input) {
|
|
|
6616
6651
|
};
|
|
6617
6652
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6618
6653
|
const insertAt = activeSlideIndex + 1;
|
|
6619
|
-
const draft =
|
|
6654
|
+
const draft = chunkAU5YFUUK_js.buildSlideTemplateSlide(templateId, chunkAU5YFUUK_js.makeSlideId(), slides.length + 1, {
|
|
6620
6655
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6621
|
-
scheme:
|
|
6656
|
+
scheme: chunkAU5YFUUK_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6622
6657
|
});
|
|
6623
6658
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6624
6659
|
setActiveSlideIndex(insertAt);
|
|
@@ -6655,7 +6690,7 @@ function createTableMergeHandlers(input) {
|
|
|
6655
6690
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6656
6691
|
return;
|
|
6657
6692
|
}
|
|
6658
|
-
const newTableData =
|
|
6693
|
+
const newTableData = chunkAU5YFUUK_js.mergeCells(
|
|
6659
6694
|
[
|
|
6660
6695
|
{ row: rowIndex, col: columnIndex },
|
|
6661
6696
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6663,7 +6698,7 @@ function createTableMergeHandlers(input) {
|
|
|
6663
6698
|
td
|
|
6664
6699
|
);
|
|
6665
6700
|
const updates = { tableData: newTableData };
|
|
6666
|
-
const newRawXml =
|
|
6701
|
+
const newRawXml = chunkAU5YFUUK_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6667
6702
|
if (newRawXml) {
|
|
6668
6703
|
updates.rawXml = newRawXml;
|
|
6669
6704
|
}
|
|
@@ -6689,7 +6724,7 @@ function createTableMergeHandlers(input) {
|
|
|
6689
6724
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6690
6725
|
return;
|
|
6691
6726
|
}
|
|
6692
|
-
const newTableData =
|
|
6727
|
+
const newTableData = chunkAU5YFUUK_js.mergeCells(
|
|
6693
6728
|
[
|
|
6694
6729
|
{ row: rowIndex, col: columnIndex },
|
|
6695
6730
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6697,7 +6732,7 @@ function createTableMergeHandlers(input) {
|
|
|
6697
6732
|
td
|
|
6698
6733
|
);
|
|
6699
6734
|
const updates = { tableData: newTableData };
|
|
6700
|
-
const newRawXml =
|
|
6735
|
+
const newRawXml = chunkAU5YFUUK_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6701
6736
|
if (newRawXml) {
|
|
6702
6737
|
updates.rawXml = newRawXml;
|
|
6703
6738
|
}
|
|
@@ -6712,9 +6747,9 @@ function createTableMergeHandlers(input) {
|
|
|
6712
6747
|
return;
|
|
6713
6748
|
}
|
|
6714
6749
|
const td = selectedElement.tableData;
|
|
6715
|
-
const newTableData =
|
|
6750
|
+
const newTableData = chunkAU5YFUUK_js.mergeCells(ts.selectedCells, td);
|
|
6716
6751
|
const updates = { tableData: newTableData };
|
|
6717
|
-
const newRawXml =
|
|
6752
|
+
const newRawXml = chunkAU5YFUUK_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6718
6753
|
if (newRawXml) {
|
|
6719
6754
|
updates.rawXml = newRawXml;
|
|
6720
6755
|
}
|
|
@@ -6731,9 +6766,9 @@ function createTableMergeHandlers(input) {
|
|
|
6731
6766
|
}
|
|
6732
6767
|
const { rowIndex, columnIndex } = ts;
|
|
6733
6768
|
const td = selectedElement.tableData;
|
|
6734
|
-
const newTableData =
|
|
6769
|
+
const newTableData = chunkAU5YFUUK_js.splitCell(rowIndex, columnIndex, td);
|
|
6735
6770
|
const updates = { tableData: newTableData };
|
|
6736
|
-
const newRawXml =
|
|
6771
|
+
const newRawXml = chunkAU5YFUUK_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6737
6772
|
if (newRawXml) {
|
|
6738
6773
|
updates.rawXml = newRawXml;
|
|
6739
6774
|
}
|
|
@@ -6767,10 +6802,10 @@ function createTableStructHandlers(input) {
|
|
|
6767
6802
|
const text = transformCommittedText ? transformCommittedText(rawText) : rawText;
|
|
6768
6803
|
const updates = {};
|
|
6769
6804
|
if (el.tableData) {
|
|
6770
|
-
updates.tableData =
|
|
6805
|
+
updates.tableData = chunkAU5YFUUK_js.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
6771
6806
|
}
|
|
6772
6807
|
if (el.rawXml) {
|
|
6773
|
-
const newRawXml =
|
|
6808
|
+
const newRawXml = chunkAU5YFUUK_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6774
6809
|
if (newRawXml) {
|
|
6775
6810
|
updates.rawXml = newRawXml;
|
|
6776
6811
|
}
|
|
@@ -6794,7 +6829,7 @@ function createTableStructHandlers(input) {
|
|
|
6794
6829
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6795
6830
|
const updates = {};
|
|
6796
6831
|
if (selectedElement.rawXml) {
|
|
6797
|
-
const newRawXml =
|
|
6832
|
+
const newRawXml = chunkAU5YFUUK_js.updateCellTextStyleInRawXml(
|
|
6798
6833
|
selectedElement,
|
|
6799
6834
|
rowIndex,
|
|
6800
6835
|
colIndex,
|
|
@@ -6858,9 +6893,9 @@ function createTableStructHandlers(input) {
|
|
|
6858
6893
|
return;
|
|
6859
6894
|
}
|
|
6860
6895
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6861
|
-
const newTableData =
|
|
6896
|
+
const newTableData = chunkAU5YFUUK_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6862
6897
|
const updates = { tableData: newTableData };
|
|
6863
|
-
const newRawXml =
|
|
6898
|
+
const newRawXml = chunkAU5YFUUK_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6864
6899
|
if (newRawXml) {
|
|
6865
6900
|
updates.rawXml = newRawXml;
|
|
6866
6901
|
}
|
|
@@ -6873,12 +6908,12 @@ function createTableStructHandlers(input) {
|
|
|
6873
6908
|
}
|
|
6874
6909
|
const td = selectedElement.tableData;
|
|
6875
6910
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6876
|
-
const newTableData =
|
|
6911
|
+
const newTableData = chunkAU5YFUUK_js.deleteTableRow(td, rowIdx);
|
|
6877
6912
|
if (newTableData === td) {
|
|
6878
6913
|
return;
|
|
6879
6914
|
}
|
|
6880
6915
|
const updates = { tableData: newTableData };
|
|
6881
|
-
const newRawXml =
|
|
6916
|
+
const newRawXml = chunkAU5YFUUK_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6882
6917
|
if (newRawXml) {
|
|
6883
6918
|
updates.rawXml = newRawXml;
|
|
6884
6919
|
}
|
|
@@ -6890,9 +6925,9 @@ function createTableStructHandlers(input) {
|
|
|
6890
6925
|
return;
|
|
6891
6926
|
}
|
|
6892
6927
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6893
|
-
const newTableData =
|
|
6928
|
+
const newTableData = chunkAU5YFUUK_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6894
6929
|
const updates = { tableData: newTableData };
|
|
6895
|
-
const newRawXml =
|
|
6930
|
+
const newRawXml = chunkAU5YFUUK_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6896
6931
|
if (newRawXml) {
|
|
6897
6932
|
updates.rawXml = newRawXml;
|
|
6898
6933
|
}
|
|
@@ -6905,12 +6940,12 @@ function createTableStructHandlers(input) {
|
|
|
6905
6940
|
}
|
|
6906
6941
|
const td = selectedElement.tableData;
|
|
6907
6942
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6908
|
-
const newTableData =
|
|
6943
|
+
const newTableData = chunkAU5YFUUK_js.deleteTableColumn(td, colIdx);
|
|
6909
6944
|
if (newTableData === td) {
|
|
6910
6945
|
return;
|
|
6911
6946
|
}
|
|
6912
6947
|
const updates = { tableData: newTableData };
|
|
6913
|
-
const newRawXml =
|
|
6948
|
+
const newRawXml = chunkAU5YFUUK_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6914
6949
|
if (newRawXml) {
|
|
6915
6950
|
updates.rawXml = newRawXml;
|
|
6916
6951
|
}
|
|
@@ -6946,8 +6981,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6946
6981
|
return html2canvasPro(element, {
|
|
6947
6982
|
...options,
|
|
6948
6983
|
onclone: async (doc, clonedEl) => {
|
|
6949
|
-
await
|
|
6950
|
-
|
|
6984
|
+
await chunkAU5YFUUK_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6985
|
+
chunkAU5YFUUK_js.preprocessCssForCapture(clonedEl);
|
|
6951
6986
|
if (typeof userOnClone === "function") {
|
|
6952
6987
|
userOnClone(doc, clonedEl);
|
|
6953
6988
|
}
|
|
@@ -6985,13 +7020,13 @@ function useExportSaveAs(input) {
|
|
|
6985
7020
|
if (!handler) {
|
|
6986
7021
|
return;
|
|
6987
7022
|
}
|
|
6988
|
-
const downloadName =
|
|
7023
|
+
const downloadName = chunkAU5YFUUK_js.savedPresentationFileName(filePath, format);
|
|
6989
7024
|
try {
|
|
6990
7025
|
const data = await buildSaveAsData(handler, format);
|
|
6991
7026
|
const blob = new Blob([data], {
|
|
6992
7027
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
6993
7028
|
});
|
|
6994
|
-
|
|
7029
|
+
chunkAU5YFUUK_js.downloadBlob(blob, downloadName);
|
|
6995
7030
|
} catch (err) {
|
|
6996
7031
|
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
6997
7032
|
}
|
|
@@ -7004,18 +7039,18 @@ function useExportSaveAs(input) {
|
|
|
7004
7039
|
const pptxGuides = guides.map((g) => ({
|
|
7005
7040
|
id: g.id,
|
|
7006
7041
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
7007
|
-
positionEmu:
|
|
7042
|
+
positionEmu: chunkAU5YFUUK_js.guidePxToEmu(g.position)
|
|
7008
7043
|
}));
|
|
7009
7044
|
return {
|
|
7010
7045
|
...slide,
|
|
7011
7046
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
7012
7047
|
};
|
|
7013
7048
|
});
|
|
7014
|
-
const slidesToSave =
|
|
7049
|
+
const slidesToSave = chunkAU5YFUUK_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
7015
7050
|
const saveOptions = {
|
|
7016
7051
|
// Save As shares Save's slide-size decision; leaving it out here is how
|
|
7017
7052
|
// a preset picked in the inspector reached one save path and not the other.
|
|
7018
|
-
slideSize:
|
|
7053
|
+
slideSize: chunkAU5YFUUK_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
7019
7054
|
headerFooter,
|
|
7020
7055
|
presentationProperties,
|
|
7021
7056
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -7029,13 +7064,13 @@ function useExportSaveAs(input) {
|
|
|
7029
7064
|
handoutMaster,
|
|
7030
7065
|
outputFormat: format
|
|
7031
7066
|
};
|
|
7032
|
-
return
|
|
7067
|
+
return chunkAU5YFUUK_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
|
|
7033
7068
|
};
|
|
7034
7069
|
const handleExportJson = () => {
|
|
7035
7070
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7036
|
-
const slideSize =
|
|
7071
|
+
const slideSize = chunkAU5YFUUK_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
7037
7072
|
const data = {
|
|
7038
|
-
slides:
|
|
7073
|
+
slides: chunkAU5YFUUK_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7039
7074
|
width: canvasSize.width,
|
|
7040
7075
|
height: canvasSize.height,
|
|
7041
7076
|
widthEmu: slideSize.widthEmu,
|
|
@@ -7054,7 +7089,7 @@ function useExportSaveAs(input) {
|
|
|
7054
7089
|
handoutMaster
|
|
7055
7090
|
};
|
|
7056
7091
|
try {
|
|
7057
|
-
|
|
7092
|
+
chunkAU5YFUUK_js.exportDeckJson(data, sourceName);
|
|
7058
7093
|
} catch (err) {
|
|
7059
7094
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7060
7095
|
}
|
|
@@ -7141,7 +7176,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
7141
7176
|
}
|
|
7142
7177
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
7143
7178
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
7144
|
-
|
|
7179
|
+
chunkAU5YFUUK_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
7145
7180
|
}
|
|
7146
7181
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
7147
7182
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -7163,15 +7198,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7163
7198
|
continue;
|
|
7164
7199
|
}
|
|
7165
7200
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
7166
|
-
images.push(
|
|
7201
|
+
images.push(chunkAU5YFUUK_js.canvasToJpegData(canvas));
|
|
7167
7202
|
}
|
|
7168
7203
|
onProgress?.(totalSlides, totalSlides);
|
|
7169
7204
|
setActiveSlide(currentSlideIndex);
|
|
7170
7205
|
if (images.length === 0) {
|
|
7171
|
-
throw new Error(
|
|
7206
|
+
throw new Error(chunkUTIMT5CZ_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
7172
7207
|
}
|
|
7173
|
-
const pdfBlobUrl =
|
|
7174
|
-
|
|
7208
|
+
const pdfBlobUrl = chunkAEP6X24D_js.buildPdfFromImageData(images);
|
|
7209
|
+
chunkAU5YFUUK_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
7175
7210
|
}
|
|
7176
7211
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
7177
7212
|
const { scale = 2, onProgress } = options;
|
|
@@ -7217,10 +7252,10 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
7217
7252
|
onProgress?.(totalSlides, totalSlides);
|
|
7218
7253
|
setActiveSlide(currentSlideIndex);
|
|
7219
7254
|
if (pages.length === 0) {
|
|
7220
|
-
throw new Error(
|
|
7255
|
+
throw new Error(chunkUTIMT5CZ_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
7221
7256
|
}
|
|
7222
|
-
const pdfDataUrl =
|
|
7223
|
-
|
|
7257
|
+
const pdfDataUrl = chunkAEP6X24D_js.buildNotesPdf(pages);
|
|
7258
|
+
chunkAU5YFUUK_js.downloadDataUrl(pdfDataUrl, filename);
|
|
7224
7259
|
}
|
|
7225
7260
|
|
|
7226
7261
|
// src/viewer/utils/export-video.ts
|
|
@@ -7251,7 +7286,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7251
7286
|
}
|
|
7252
7287
|
setActiveSlide(currentSlideIndex);
|
|
7253
7288
|
if (slideCanvases.length === 0) {
|
|
7254
|
-
throw new Error(
|
|
7289
|
+
throw new Error(chunkUTIMT5CZ_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
|
|
7255
7290
|
}
|
|
7256
7291
|
const firstCanvas = slideCanvases[0];
|
|
7257
7292
|
const recordingCanvas = document.createElement("canvas");
|
|
@@ -7259,12 +7294,12 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7259
7294
|
recordingCanvas.height = firstCanvas.height;
|
|
7260
7295
|
const ctx = recordingCanvas.getContext("2d");
|
|
7261
7296
|
if (!ctx) {
|
|
7262
|
-
throw new Error(
|
|
7297
|
+
throw new Error(chunkUTIMT5CZ_js.translationsEn["pptx.export.errorNo2dContext"]);
|
|
7263
7298
|
}
|
|
7264
7299
|
const fps = 30;
|
|
7265
7300
|
const stream = recordingCanvas.captureStream(fps);
|
|
7266
7301
|
const recorder = new MediaRecorder(stream, {
|
|
7267
|
-
mimeType:
|
|
7302
|
+
mimeType: chunkAU5YFUUK_js.pickSupportedMimeType([...chunkAU5YFUUK_js.WEBM_MIME_CANDIDATES]),
|
|
7268
7303
|
videoBitsPerSecond: 5e6
|
|
7269
7304
|
});
|
|
7270
7305
|
const chunks = [];
|
|
@@ -7287,8 +7322,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
7287
7322
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
7288
7323
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
7289
7324
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
7290
|
-
const frameInterval =
|
|
7291
|
-
const framesNeeded =
|
|
7325
|
+
const frameInterval = chunkAU5YFUUK_js.fpsToFrameIntervalMs(fps);
|
|
7326
|
+
const framesNeeded = chunkAU5YFUUK_js.segmentFrameCount(duration, fps);
|
|
7292
7327
|
for (let f = 0; f < framesNeeded; f++) {
|
|
7293
7328
|
if (signal?.aborted) {
|
|
7294
7329
|
recorder.stop();
|
|
@@ -7335,9 +7370,9 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7335
7370
|
}
|
|
7336
7371
|
setActiveSlide(currentSlideIndex);
|
|
7337
7372
|
if (frames.length === 0) {
|
|
7338
|
-
throw new Error(
|
|
7373
|
+
throw new Error(chunkUTIMT5CZ_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
7339
7374
|
}
|
|
7340
|
-
const gifBytes =
|
|
7375
|
+
const gifBytes = chunkAU5YFUUK_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
7341
7376
|
onProgress?.(totalSlides, totalSlides);
|
|
7342
7377
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
7343
7378
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -7391,7 +7426,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
7391
7426
|
continue;
|
|
7392
7427
|
}
|
|
7393
7428
|
onProgress?.(processedCount, data.slides.length);
|
|
7394
|
-
let svg =
|
|
7429
|
+
let svg = chunkAU5YFUUK_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
7395
7430
|
if (embedFonts && fontFaces?.length) {
|
|
7396
7431
|
svg = injectFontFaces(svg, fontFaces);
|
|
7397
7432
|
}
|
|
@@ -7500,21 +7535,21 @@ function useExportHandlers(input) {
|
|
|
7500
7535
|
{
|
|
7501
7536
|
scale: imageExportScale,
|
|
7502
7537
|
onProgress: (current, total) => {
|
|
7503
|
-
setExportProgress(
|
|
7504
|
-
setExportStatusMessage(
|
|
7538
|
+
setExportProgress(chunkAU5YFUUK_js.slideProgressPercent(current, total));
|
|
7539
|
+
setExportStatusMessage(chunkAU5YFUUK_js.slideStatusLabel("Rendering", current, total));
|
|
7505
7540
|
},
|
|
7506
7541
|
signal: abortCtrl.signal
|
|
7507
7542
|
}
|
|
7508
7543
|
);
|
|
7509
|
-
setExportProgress(
|
|
7544
|
+
setExportProgress(chunkAU5YFUUK_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7510
7545
|
setExportStatusMessage("Building PDF...");
|
|
7511
7546
|
await new Promise((r) => {
|
|
7512
7547
|
setTimeout(r, 100);
|
|
7513
7548
|
});
|
|
7514
|
-
setExportProgress(
|
|
7549
|
+
setExportProgress(chunkAU5YFUUK_js.EXPORT_DONE_PERCENT);
|
|
7515
7550
|
setExportStatusMessage("Done!");
|
|
7516
7551
|
} catch (err) {
|
|
7517
|
-
if (!
|
|
7552
|
+
if (!chunkAU5YFUUK_js.isExportAbortError(err)) {
|
|
7518
7553
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7519
7554
|
}
|
|
7520
7555
|
} finally {
|
|
@@ -7544,21 +7579,21 @@ function useExportHandlers(input) {
|
|
|
7544
7579
|
{
|
|
7545
7580
|
scale: imageExportScale,
|
|
7546
7581
|
onProgress: (current, total) => {
|
|
7547
|
-
setExportProgress(
|
|
7548
|
-
setExportStatusMessage(
|
|
7582
|
+
setExportProgress(chunkAU5YFUUK_js.slideProgressPercent(current, total));
|
|
7583
|
+
setExportStatusMessage(chunkAU5YFUUK_js.slideStatusLabel("Rendering", current, total));
|
|
7549
7584
|
},
|
|
7550
7585
|
signal: abortCtrl.signal
|
|
7551
7586
|
}
|
|
7552
7587
|
);
|
|
7553
|
-
setExportProgress(
|
|
7588
|
+
setExportProgress(chunkAU5YFUUK_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7554
7589
|
setExportStatusMessage("Building PDF...");
|
|
7555
7590
|
await new Promise((r) => {
|
|
7556
7591
|
setTimeout(r, 100);
|
|
7557
7592
|
});
|
|
7558
|
-
setExportProgress(
|
|
7593
|
+
setExportProgress(chunkAU5YFUUK_js.EXPORT_DONE_PERCENT);
|
|
7559
7594
|
setExportStatusMessage("Done!");
|
|
7560
7595
|
} catch (err) {
|
|
7561
|
-
if (!
|
|
7596
|
+
if (!chunkAU5YFUUK_js.isExportAbortError(err)) {
|
|
7562
7597
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7563
7598
|
}
|
|
7564
7599
|
} finally {
|
|
@@ -7600,22 +7635,22 @@ function useExportHandlers(input) {
|
|
|
7600
7635
|
scale: 1,
|
|
7601
7636
|
slideDurationMs: 3e3,
|
|
7602
7637
|
onProgress: (current, total) => {
|
|
7603
|
-
setExportProgress(
|
|
7604
|
-
setExportStatusMessage(
|
|
7638
|
+
setExportProgress(chunkAU5YFUUK_js.slideProgressPercent(current, total, 45));
|
|
7639
|
+
setExportStatusMessage(chunkAU5YFUUK_js.slideStatusLabel("Capturing", current, total));
|
|
7605
7640
|
},
|
|
7606
7641
|
onRecordProgress: (current, total) => {
|
|
7607
|
-
setExportProgress(
|
|
7608
|
-
setExportStatusMessage(
|
|
7642
|
+
setExportProgress(chunkAU5YFUUK_js.recordProgressPercent(current, total));
|
|
7643
|
+
setExportStatusMessage(chunkAU5YFUUK_js.slideStatusLabel("Recording", current, total));
|
|
7609
7644
|
},
|
|
7610
7645
|
signal: abortCtrl.signal
|
|
7611
7646
|
}
|
|
7612
7647
|
);
|
|
7613
|
-
setExportProgress(
|
|
7648
|
+
setExportProgress(chunkAU5YFUUK_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7614
7649
|
setExportStatusMessage("Saving file...");
|
|
7615
|
-
|
|
7616
|
-
setExportProgress(
|
|
7650
|
+
chunkAU5YFUUK_js.downloadBlob(blob, "presentation.webm");
|
|
7651
|
+
setExportProgress(chunkAU5YFUUK_js.EXPORT_DONE_PERCENT);
|
|
7617
7652
|
} catch (err) {
|
|
7618
|
-
if (!
|
|
7653
|
+
if (!chunkAU5YFUUK_js.isExportAbortError(err)) {
|
|
7619
7654
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7620
7655
|
}
|
|
7621
7656
|
} finally {
|
|
@@ -7643,18 +7678,18 @@ function useExportHandlers(input) {
|
|
|
7643
7678
|
scale: 0.5,
|
|
7644
7679
|
slideDurationMs: 2e3,
|
|
7645
7680
|
onProgress: (current, total) => {
|
|
7646
|
-
setExportProgress(
|
|
7647
|
-
setExportStatusMessage(
|
|
7681
|
+
setExportProgress(chunkAU5YFUUK_js.slideProgressPercent(current, total));
|
|
7682
|
+
setExportStatusMessage(chunkAU5YFUUK_js.slideStatusLabel("Encoding", current, total));
|
|
7648
7683
|
},
|
|
7649
7684
|
signal: abortCtrl.signal
|
|
7650
7685
|
}
|
|
7651
7686
|
);
|
|
7652
|
-
setExportProgress(
|
|
7687
|
+
setExportProgress(chunkAU5YFUUK_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7653
7688
|
setExportStatusMessage("Saving file...");
|
|
7654
|
-
|
|
7655
|
-
setExportProgress(
|
|
7689
|
+
chunkAU5YFUUK_js.downloadBlob(blob, "presentation.gif");
|
|
7690
|
+
setExportProgress(chunkAU5YFUUK_js.EXPORT_DONE_PERCENT);
|
|
7656
7691
|
} catch (err) {
|
|
7657
|
-
if (!
|
|
7692
|
+
if (!chunkAU5YFUUK_js.isExportAbortError(err)) {
|
|
7658
7693
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7659
7694
|
}
|
|
7660
7695
|
} finally {
|
|
@@ -7687,7 +7722,7 @@ function useExportHandlers(input) {
|
|
|
7687
7722
|
exportStatusMessage
|
|
7688
7723
|
};
|
|
7689
7724
|
}
|
|
7690
|
-
var ViewerOptionsContext = react.createContext(
|
|
7725
|
+
var ViewerOptionsContext = react.createContext(chunkAU5YFUUK_js.DEFAULT_VIEWER_OPTIONS);
|
|
7691
7726
|
function useViewerOptionsContext() {
|
|
7692
7727
|
return react.useContext(ViewerOptionsContext);
|
|
7693
7728
|
}
|
|
@@ -7699,13 +7734,13 @@ function usePrintHandlers(input) {
|
|
|
7699
7734
|
const { t } = reactI18next.useTranslation();
|
|
7700
7735
|
const viewerOptions = useViewerOptionsContext();
|
|
7701
7736
|
const includeHiddenSlides = viewerOptions.advanced.printHiddenSlides;
|
|
7702
|
-
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) *
|
|
7737
|
+
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) * chunkAU5YFUUK_js.resolveImageResolutionScale(viewerOptions);
|
|
7703
7738
|
const handlePrint = () => {
|
|
7704
7739
|
setIsPrintDialogOpen(true);
|
|
7705
7740
|
};
|
|
7706
7741
|
const handlePrintSvg = async (settings) => {
|
|
7707
7742
|
setIsPrintDialogOpen(false);
|
|
7708
|
-
const printWindow =
|
|
7743
|
+
const printWindow = chunkAU5YFUUK_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7709
7744
|
if (!printWindow) {
|
|
7710
7745
|
console.warn(
|
|
7711
7746
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7715,9 +7750,9 @@ function usePrintHandlers(input) {
|
|
|
7715
7750
|
if (!pptxData || settings.printWhat !== "slides") {
|
|
7716
7751
|
return runRasterPrint(printWindow, settings);
|
|
7717
7752
|
}
|
|
7718
|
-
const colorFilter =
|
|
7719
|
-
const slideIndices =
|
|
7720
|
-
|
|
7753
|
+
const colorFilter = chunkAU5YFUUK_js.computeColorFilter(settings.colorMode);
|
|
7754
|
+
const slideIndices = chunkAU5YFUUK_js.filterHiddenSlideIndices(
|
|
7755
|
+
chunkAU5YFUUK_js.computeSlideIndices(
|
|
7721
7756
|
settings.slideRange,
|
|
7722
7757
|
activeSlideIndex,
|
|
7723
7758
|
slides.length,
|
|
@@ -7735,22 +7770,22 @@ function usePrintHandlers(input) {
|
|
|
7735
7770
|
printWindow.close();
|
|
7736
7771
|
return;
|
|
7737
7772
|
}
|
|
7738
|
-
const printDoc =
|
|
7773
|
+
const printDoc = chunkAU5YFUUK_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7739
7774
|
title: "Slides (Vector)",
|
|
7740
7775
|
orientation: settings.orientation,
|
|
7741
7776
|
colorFilter,
|
|
7742
7777
|
scaleToFit: settings.scaleToFit
|
|
7743
7778
|
});
|
|
7744
|
-
|
|
7779
|
+
chunkAU5YFUUK_js.finishPrintWindow(printWindow, printDoc);
|
|
7745
7780
|
} catch (err) {
|
|
7746
7781
|
console.warn("[PowerPointViewer] SVG print path failed, falling back to raster:", err);
|
|
7747
7782
|
return runRasterPrint(printWindow, settings);
|
|
7748
7783
|
}
|
|
7749
7784
|
};
|
|
7750
7785
|
const runRasterPrint = async (printWindow, settings) => {
|
|
7751
|
-
const colorFilter =
|
|
7752
|
-
const slideIndices =
|
|
7753
|
-
|
|
7786
|
+
const colorFilter = chunkAU5YFUUK_js.computeColorFilter(settings.colorMode);
|
|
7787
|
+
const slideIndices = chunkAU5YFUUK_js.filterHiddenSlideIndices(
|
|
7788
|
+
chunkAU5YFUUK_js.computeSlideIndices(
|
|
7754
7789
|
settings.slideRange,
|
|
7755
7790
|
activeSlideIndex,
|
|
7756
7791
|
slides.length,
|
|
@@ -7761,11 +7796,11 @@ function usePrintHandlers(input) {
|
|
|
7761
7796
|
includeHiddenSlides
|
|
7762
7797
|
);
|
|
7763
7798
|
if (settings.printWhat === "outline") {
|
|
7764
|
-
|
|
7799
|
+
chunkAU5YFUUK_js.finishPrintWindow(
|
|
7765
7800
|
printWindow,
|
|
7766
|
-
|
|
7801
|
+
chunkAU5YFUUK_js.buildPrintHtmlDocument({
|
|
7767
7802
|
title: "Outline",
|
|
7768
|
-
bodyHtml: `<div class="outline-page">${
|
|
7803
|
+
bodyHtml: `<div class="outline-page">${chunkAU5YFUUK_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7769
7804
|
orientation: settings.orientation,
|
|
7770
7805
|
colorFilter,
|
|
7771
7806
|
frameSlides: settings.frameSlides,
|
|
@@ -7792,11 +7827,11 @@ function usePrintHandlers(input) {
|
|
|
7792
7827
|
}
|
|
7793
7828
|
const slideImages = slideIndices.map((idx) => allImages[idx]).filter(Boolean);
|
|
7794
7829
|
if (settings.printWhat === "slides") {
|
|
7795
|
-
|
|
7830
|
+
chunkAU5YFUUK_js.finishPrintWindow(
|
|
7796
7831
|
printWindow,
|
|
7797
|
-
|
|
7832
|
+
chunkAU5YFUUK_js.buildPrintHtmlDocument({
|
|
7798
7833
|
title: "Slides",
|
|
7799
|
-
bodyHtml:
|
|
7834
|
+
bodyHtml: chunkAU5YFUUK_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7800
7835
|
orientation: settings.orientation,
|
|
7801
7836
|
colorFilter,
|
|
7802
7837
|
frameSlides: settings.frameSlides,
|
|
@@ -7806,11 +7841,11 @@ function usePrintHandlers(input) {
|
|
|
7806
7841
|
return;
|
|
7807
7842
|
}
|
|
7808
7843
|
if (settings.printWhat === "notes") {
|
|
7809
|
-
|
|
7844
|
+
chunkAU5YFUUK_js.finishPrintWindow(
|
|
7810
7845
|
printWindow,
|
|
7811
|
-
|
|
7846
|
+
chunkAU5YFUUK_js.buildPrintHtmlDocument({
|
|
7812
7847
|
title: "Notes Pages",
|
|
7813
|
-
bodyHtml:
|
|
7848
|
+
bodyHtml: chunkAU5YFUUK_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7814
7849
|
orientation: "portrait",
|
|
7815
7850
|
colorFilter,
|
|
7816
7851
|
frameSlides: settings.frameSlides,
|
|
@@ -7821,11 +7856,11 @@ function usePrintHandlers(input) {
|
|
|
7821
7856
|
}
|
|
7822
7857
|
if (settings.printWhat === "handouts") {
|
|
7823
7858
|
const spp = settings.slidesPerPage;
|
|
7824
|
-
|
|
7859
|
+
chunkAU5YFUUK_js.finishPrintWindow(
|
|
7825
7860
|
printWindow,
|
|
7826
|
-
|
|
7861
|
+
chunkAU5YFUUK_js.buildPrintHtmlDocument({
|
|
7827
7862
|
title: `Handout ${spp} per page`,
|
|
7828
|
-
bodyHtml:
|
|
7863
|
+
bodyHtml: chunkAU5YFUUK_js.buildHandoutsHtml(slideImages, slideIndices, spp, pptxData?.handoutMaster),
|
|
7829
7864
|
orientation: "portrait",
|
|
7830
7865
|
colorFilter,
|
|
7831
7866
|
frameSlides: settings.frameSlides,
|
|
@@ -7839,7 +7874,7 @@ function usePrintHandlers(input) {
|
|
|
7839
7874
|
};
|
|
7840
7875
|
const handlePrintWithSettings = async (settings) => {
|
|
7841
7876
|
setIsPrintDialogOpen(false);
|
|
7842
|
-
const printWindow =
|
|
7877
|
+
const printWindow = chunkAU5YFUUK_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7843
7878
|
if (!printWindow) {
|
|
7844
7879
|
console.warn(
|
|
7845
7880
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7869,6 +7904,8 @@ function useThemeHandlers(input) {
|
|
|
7869
7904
|
slideMasters,
|
|
7870
7905
|
history,
|
|
7871
7906
|
setSlides,
|
|
7907
|
+
templateElementsBySlideId,
|
|
7908
|
+
setTemplateElementsBySlideId,
|
|
7872
7909
|
theme,
|
|
7873
7910
|
bumpHistory
|
|
7874
7911
|
} = input;
|
|
@@ -7902,8 +7939,17 @@ function useThemeHandlers(input) {
|
|
|
7902
7939
|
return;
|
|
7903
7940
|
}
|
|
7904
7941
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7905
|
-
const previousMap = theme?.colorScheme ?
|
|
7906
|
-
setSlides((prev) =>
|
|
7942
|
+
const previousMap = theme?.colorScheme ? chunkAU5YFUUK_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7943
|
+
setSlides((prev) => chunkAU5YFUUK_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7944
|
+
if (Object.keys(templateElementsBySlideId).length > 0) {
|
|
7945
|
+
setTemplateElementsBySlideId((prev) => {
|
|
7946
|
+
const next = {};
|
|
7947
|
+
for (const [slideId, elements] of Object.entries(prev)) {
|
|
7948
|
+
next[slideId] = chunkAU5YFUUK_js.reResolveElementColors(elements, previousMap, colorScheme);
|
|
7949
|
+
}
|
|
7950
|
+
return next;
|
|
7951
|
+
});
|
|
7952
|
+
}
|
|
7907
7953
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7908
7954
|
bumpHistory();
|
|
7909
7955
|
history.markDirty();
|
|
@@ -8008,7 +8054,7 @@ function useThemeSwitching(input) {
|
|
|
8008
8054
|
}
|
|
8009
8055
|
try {
|
|
8010
8056
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
8011
|
-
const newData =
|
|
8057
|
+
const newData = chunkAU5YFUUK_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
8012
8058
|
onDataChange(newData);
|
|
8013
8059
|
onThemeChanged?.(preset);
|
|
8014
8060
|
} catch (error) {
|
|
@@ -8025,7 +8071,7 @@ function useThemeSwitching(input) {
|
|
|
8025
8071
|
}
|
|
8026
8072
|
try {
|
|
8027
8073
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
8028
|
-
const newData =
|
|
8074
|
+
const newData = chunkAU5YFUUK_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
8029
8075
|
onDataChange(newData);
|
|
8030
8076
|
} catch (error) {
|
|
8031
8077
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -8037,12 +8083,12 @@ function useThemeSwitching(input) {
|
|
|
8037
8083
|
if (!data?.theme?.colorScheme) {
|
|
8038
8084
|
return void 0;
|
|
8039
8085
|
}
|
|
8040
|
-
return
|
|
8041
|
-
(p) =>
|
|
8086
|
+
return chunkAU5YFUUK_js.THEME_PRESETS.find(
|
|
8087
|
+
(p) => chunkAU5YFUUK_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
8042
8088
|
);
|
|
8043
8089
|
}, [data?.theme?.colorScheme]);
|
|
8044
8090
|
return {
|
|
8045
|
-
presets:
|
|
8091
|
+
presets: chunkAU5YFUUK_js.THEME_PRESETS,
|
|
8046
8092
|
switchToPreset,
|
|
8047
8093
|
switchToCustom,
|
|
8048
8094
|
currentPreset
|
|
@@ -8117,7 +8163,7 @@ function usePropertyHandlers(input) {
|
|
|
8117
8163
|
}
|
|
8118
8164
|
try {
|
|
8119
8165
|
const ab = await file.arrayBuffer();
|
|
8120
|
-
const h = new
|
|
8166
|
+
const h = new chunkAU5YFUUK_js.PptxHandler();
|
|
8121
8167
|
const other = await h.load(ab);
|
|
8122
8168
|
if (!other) {
|
|
8123
8169
|
return;
|
|
@@ -8127,7 +8173,7 @@ function usePropertyHandlers(input) {
|
|
|
8127
8173
|
width: canvasSize.width,
|
|
8128
8174
|
height: canvasSize.height
|
|
8129
8175
|
};
|
|
8130
|
-
setCompareResult(
|
|
8176
|
+
setCompareResult(chunkAU5YFUUK_js.comparePresentation(cur, other));
|
|
8131
8177
|
setIsComparePanelOpen(true);
|
|
8132
8178
|
} catch (err) {
|
|
8133
8179
|
console.warn("Compare failed:", err);
|
|
@@ -8144,7 +8190,7 @@ function usePropertyHandlers(input) {
|
|
|
8144
8190
|
if (!diff || diff.status === "unchanged") {
|
|
8145
8191
|
return;
|
|
8146
8192
|
}
|
|
8147
|
-
setSlides((prev) =>
|
|
8193
|
+
setSlides((prev) => chunkAU5YFUUK_js.applyAcceptSlide(prev, diff));
|
|
8148
8194
|
setIsDirty(true);
|
|
8149
8195
|
},
|
|
8150
8196
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -8155,10 +8201,10 @@ function usePropertyHandlers(input) {
|
|
|
8155
8201
|
if (!compareResult) {
|
|
8156
8202
|
return;
|
|
8157
8203
|
}
|
|
8158
|
-
setSlides((prev) =>
|
|
8204
|
+
setSlides((prev) => chunkAU5YFUUK_js.applyAcceptAllSlides(prev, compareResult));
|
|
8159
8205
|
setIsDirty(true);
|
|
8160
8206
|
}, [compareResult, setSlides, setIsDirty]);
|
|
8161
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
8207
|
+
const usedFontFamilies = react.useMemo(() => chunkAU5YFUUK_js.collectUsedFonts(slides), [slides]);
|
|
8162
8208
|
return {
|
|
8163
8209
|
handleUpdateNotes,
|
|
8164
8210
|
handleUpdateSlide,
|
|
@@ -8313,7 +8359,7 @@ function useViewerDialogs(input) {
|
|
|
8313
8359
|
);
|
|
8314
8360
|
const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
|
|
8315
8361
|
const fontEmbedding = react.useMemo(
|
|
8316
|
-
() =>
|
|
8362
|
+
() => chunkAU5YFUUK_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
|
|
8317
8363
|
[embeddedFontKey]
|
|
8318
8364
|
);
|
|
8319
8365
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
|
|
@@ -8323,11 +8369,11 @@ function useViewerDialogs(input) {
|
|
|
8323
8369
|
setEmbedFontsEnabled(fontEmbedding.initialEnabled);
|
|
8324
8370
|
}
|
|
8325
8371
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8326
|
-
() => typeof window !== "undefined" ?
|
|
8372
|
+
() => typeof window !== "undefined" ? chunkAU5YFUUK_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8327
8373
|
);
|
|
8328
8374
|
react.useEffect(() => {
|
|
8329
8375
|
const handleWindow = () => setIsNarrowViewport(
|
|
8330
|
-
|
|
8376
|
+
chunkAU5YFUUK_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8331
8377
|
);
|
|
8332
8378
|
window.addEventListener("resize", handleWindow);
|
|
8333
8379
|
return () => window.removeEventListener("resize", handleWindow);
|
|
@@ -8480,16 +8526,16 @@ function useViewerDialogs(input) {
|
|
|
8480
8526
|
};
|
|
8481
8527
|
}
|
|
8482
8528
|
function computeGridSpacingPx2(documentGridSpacing) {
|
|
8483
|
-
return
|
|
8529
|
+
return chunkAU5YFUUK_js.computeGridSpacingPx(documentGridSpacing, chunkAEP6X24D_js.GRID_SIZE);
|
|
8484
8530
|
}
|
|
8485
8531
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows, presentationProperties) {
|
|
8486
8532
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8487
|
-
const authoredRange =
|
|
8488
|
-
return
|
|
8533
|
+
const authoredRange = chunkAU5YFUUK_js.resolveAuthoredSlideRange(presentationProperties, slides.length);
|
|
8534
|
+
return chunkAU5YFUUK_js.resolveShowSlideIndexes(slides, activeShow, authoredRange);
|
|
8489
8535
|
}
|
|
8490
8536
|
function computeSlideSectionGroups(slides, sections) {
|
|
8491
|
-
return
|
|
8492
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8537
|
+
return chunkAU5YFUUK_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8538
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkAEP6X24D_js.UNGROUPED_SECTION_ID : chunkAEP6X24D_js.DEFAULT_SECTION_GROUP_ID),
|
|
8493
8539
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8494
8540
|
slideIndexes: group.slideIndexes,
|
|
8495
8541
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8501,7 +8547,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
|
8501
8547
|
return void 0;
|
|
8502
8548
|
}
|
|
8503
8549
|
const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
|
|
8504
|
-
return
|
|
8550
|
+
return chunkAU5YFUUK_js.masterViewPseudoSlide(document2, {
|
|
8505
8551
|
tab: "slides",
|
|
8506
8552
|
masterIndex: 0,
|
|
8507
8553
|
layoutIndex: activeLayout ? 0 : null
|
|
@@ -8529,15 +8575,15 @@ function useDerivedSlideState(input) {
|
|
|
8529
8575
|
[slides, activeCustomShowId, customShows, presentationProperties]
|
|
8530
8576
|
);
|
|
8531
8577
|
const authoredRange = react.useMemo(
|
|
8532
|
-
() =>
|
|
8578
|
+
() => chunkAU5YFUUK_js.resolveAuthoredSlideRange(presentationProperties, slides.length),
|
|
8533
8579
|
[presentationProperties, slides.length]
|
|
8534
8580
|
);
|
|
8535
8581
|
const slideSectionGroups = react.useMemo(
|
|
8536
8582
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8537
|
-
if (group.id ===
|
|
8583
|
+
if (group.id === chunkAEP6X24D_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8538
8584
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8539
8585
|
}
|
|
8540
|
-
if (group.id ===
|
|
8586
|
+
if (group.id === chunkAEP6X24D_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
8541
8587
|
return { ...group, label: t("pptx.sections.slides") };
|
|
8542
8588
|
}
|
|
8543
8589
|
return group;
|
|
@@ -8638,13 +8684,13 @@ function useAnnotationHandlers(input) {
|
|
|
8638
8684
|
}, [annotations, setMode, setSlides, history]);
|
|
8639
8685
|
const handleSetMode = react.useCallback(
|
|
8640
8686
|
(nextMode) => {
|
|
8641
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8687
|
+
if (mode === "present" && nextMode !== "present" && !chunkAU5YFUUK_js.mayLeaveSlideShow()) {
|
|
8642
8688
|
return;
|
|
8643
8689
|
}
|
|
8644
8690
|
if (nextMode === "present") {
|
|
8645
8691
|
presentation.enterPresentMode();
|
|
8646
8692
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8647
|
-
|
|
8693
|
+
chunkAU5YFUUK_js.stopAllPersistentAudio();
|
|
8648
8694
|
if (promptKeepInkAnnotations) {
|
|
8649
8695
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8650
8696
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8654,7 +8700,7 @@ function useAnnotationHandlers(input) {
|
|
|
8654
8700
|
}
|
|
8655
8701
|
} else {
|
|
8656
8702
|
if (mode === "present") {
|
|
8657
|
-
|
|
8703
|
+
chunkAU5YFUUK_js.stopAllPersistentAudio();
|
|
8658
8704
|
}
|
|
8659
8705
|
setMode(nextMode);
|
|
8660
8706
|
}
|
|
@@ -8719,13 +8765,13 @@ function useSerialize(input) {
|
|
|
8719
8765
|
let processedSlide = slide;
|
|
8720
8766
|
if (pendingEditId) {
|
|
8721
8767
|
const updatedElements = slide.elements.map((el) => {
|
|
8722
|
-
if (el.id !== pendingEditId || !
|
|
8768
|
+
if (el.id !== pendingEditId || !chunkAU5YFUUK_js.hasTextProperties(el)) {
|
|
8723
8769
|
return el;
|
|
8724
8770
|
}
|
|
8725
8771
|
return {
|
|
8726
8772
|
...el,
|
|
8727
8773
|
text: pendingEditText,
|
|
8728
|
-
textSegments:
|
|
8774
|
+
textSegments: chunkAU5YFUUK_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8729
8775
|
};
|
|
8730
8776
|
});
|
|
8731
8777
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8738,19 +8784,19 @@ function useSerialize(input) {
|
|
|
8738
8784
|
const pptxGuides = guides.map((g) => ({
|
|
8739
8785
|
id: g.id,
|
|
8740
8786
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8741
|
-
positionEmu:
|
|
8787
|
+
positionEmu: chunkAU5YFUUK_js.guidePxToEmu(g.position)
|
|
8742
8788
|
}));
|
|
8743
8789
|
return {
|
|
8744
8790
|
...processedSlide,
|
|
8745
8791
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8746
8792
|
};
|
|
8747
8793
|
});
|
|
8748
|
-
const slidesToSave =
|
|
8794
|
+
const slidesToSave = chunkAU5YFUUK_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8749
8795
|
const saveOptions = {
|
|
8750
8796
|
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
8751
8797
|
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
8752
8798
|
// slide-size edit reaches the file.
|
|
8753
|
-
slideSize:
|
|
8799
|
+
slideSize: chunkAU5YFUUK_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
8754
8800
|
headerFooter,
|
|
8755
8801
|
presentationProperties,
|
|
8756
8802
|
viewProperties,
|
|
@@ -8763,9 +8809,9 @@ function useSerialize(input) {
|
|
|
8763
8809
|
slideMasters,
|
|
8764
8810
|
notesMaster,
|
|
8765
8811
|
handoutMaster,
|
|
8766
|
-
...
|
|
8812
|
+
...chunkAU5YFUUK_js.embeddedFontSaveOptions(embedFonts)
|
|
8767
8813
|
};
|
|
8768
|
-
return
|
|
8814
|
+
return chunkAU5YFUUK_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
|
|
8769
8815
|
}, [
|
|
8770
8816
|
slides,
|
|
8771
8817
|
templateElementsBySlideId,
|
|
@@ -8801,7 +8847,7 @@ function useRecoveryDetection(input) {
|
|
|
8801
8847
|
const onRestore = input.onRestore;
|
|
8802
8848
|
const openVersionHistory = input.openVersionHistory;
|
|
8803
8849
|
react.useEffect(() => {
|
|
8804
|
-
if (!
|
|
8850
|
+
if (!chunkAU5YFUUK_js.shouldProbeAutosaveRecovery({
|
|
8805
8851
|
alreadyChecked: recoveryCheckedRef.current,
|
|
8806
8852
|
filePath,
|
|
8807
8853
|
loading,
|
|
@@ -8813,7 +8859,7 @@ function useRecoveryDetection(input) {
|
|
|
8813
8859
|
}
|
|
8814
8860
|
recoveryCheckedRef.current = true;
|
|
8815
8861
|
void (async () => {
|
|
8816
|
-
const offer = await
|
|
8862
|
+
const offer = await chunkAU5YFUUK_js.probeAutosaveRecovery(filePath);
|
|
8817
8863
|
if (!offer) {
|
|
8818
8864
|
return;
|
|
8819
8865
|
}
|
|
@@ -8826,7 +8872,7 @@ function useRecoveryDetection(input) {
|
|
|
8826
8872
|
const record = recordRef.current;
|
|
8827
8873
|
setPrompt(null);
|
|
8828
8874
|
if (record && onRestore) {
|
|
8829
|
-
onRestore(
|
|
8875
|
+
onRestore(chunkAU5YFUUK_js.acceptAutosaveRecovery(record));
|
|
8830
8876
|
}
|
|
8831
8877
|
recordRef.current = null;
|
|
8832
8878
|
}, [onRestore]);
|
|
@@ -8835,7 +8881,7 @@ function useRecoveryDetection(input) {
|
|
|
8835
8881
|
setPrompt(null);
|
|
8836
8882
|
recordRef.current = null;
|
|
8837
8883
|
if (record) {
|
|
8838
|
-
void
|
|
8884
|
+
void chunkAU5YFUUK_js.discardAutosaveRecovery(record);
|
|
8839
8885
|
}
|
|
8840
8886
|
}, []);
|
|
8841
8887
|
return { prompt, restore, discard };
|
|
@@ -8879,11 +8925,11 @@ function usePresentationSetup(input) {
|
|
|
8879
8925
|
containerRef,
|
|
8880
8926
|
content,
|
|
8881
8927
|
onSetMode: (nextMode) => {
|
|
8882
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8928
|
+
if (mode === "present" && nextMode !== "present" && !chunkAU5YFUUK_js.mayLeaveSlideShow()) {
|
|
8883
8929
|
return;
|
|
8884
8930
|
}
|
|
8885
8931
|
if (mode === "present" && nextMode !== "present") {
|
|
8886
|
-
|
|
8932
|
+
chunkAU5YFUUK_js.stopAllPersistentAudio();
|
|
8887
8933
|
stopAnimationSound();
|
|
8888
8934
|
const exitHandler = exitModeHandlerRef.current;
|
|
8889
8935
|
if (exitHandler) {
|
|
@@ -8945,10 +8991,10 @@ function usePresentationSetup(input) {
|
|
|
8945
8991
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8946
8992
|
onToggleSubtitles,
|
|
8947
8993
|
onSaveRehearsalTimings: (timings) => {
|
|
8948
|
-
setSlides((prev) =>
|
|
8994
|
+
setSlides((prev) => chunkAU5YFUUK_js.applyRehearsalTimings(prev, timings));
|
|
8949
8995
|
history.markDirty();
|
|
8950
8996
|
},
|
|
8951
|
-
loopContinuously:
|
|
8997
|
+
loopContinuously: chunkAU5YFUUK_js.shouldLoopContinuously(presentationProperties),
|
|
8952
8998
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8953
8999
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8954
9000
|
endWithBlackSlide,
|
|
@@ -9026,7 +9072,9 @@ function useEditorOperations(input) {
|
|
|
9026
9072
|
setSelectedElementId: state.setSelectedElementId,
|
|
9027
9073
|
setSelectedElementIds: state.setSelectedElementIds,
|
|
9028
9074
|
setInlineEditingElementId: state.setInlineEditingElementId,
|
|
9029
|
-
setContextMenuState: state.setContextMenuState
|
|
9075
|
+
setContextMenuState: state.setContextMenuState,
|
|
9076
|
+
inlineEditingElementId: state.inlineEditingElementId,
|
|
9077
|
+
inlineEditingText: state.inlineEditingText
|
|
9030
9078
|
});
|
|
9031
9079
|
const sectionOps = useSectionOperations({
|
|
9032
9080
|
sections: state.sections,
|
|
@@ -9152,7 +9200,7 @@ function useEditorOperations(input) {
|
|
|
9152
9200
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
9153
9201
|
react.useEffect(() => {
|
|
9154
9202
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9155
|
-
copiedFormatRef.current =
|
|
9203
|
+
copiedFormatRef.current = chunkAU5YFUUK_js.copyFormatFromElement(selectedElement);
|
|
9156
9204
|
} else if (!formatPainterActive) {
|
|
9157
9205
|
copiedFormatRef.current = null;
|
|
9158
9206
|
}
|
|
@@ -9178,12 +9226,12 @@ function useEditorOperations(input) {
|
|
|
9178
9226
|
e.stopPropagation();
|
|
9179
9227
|
const element = elementLookup.get(elementId);
|
|
9180
9228
|
if (element) {
|
|
9181
|
-
const updated =
|
|
9229
|
+
const updated = chunkAU5YFUUK_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
9182
9230
|
const updates = {};
|
|
9183
|
-
if (
|
|
9231
|
+
if (chunkAU5YFUUK_js.hasShapeProperties(updated)) {
|
|
9184
9232
|
updates.shapeStyle = updated.shapeStyle;
|
|
9185
9233
|
}
|
|
9186
|
-
if (
|
|
9234
|
+
if (chunkAU5YFUUK_js.hasTextProperties(updated)) {
|
|
9187
9235
|
updates.textStyle = updated.textStyle;
|
|
9188
9236
|
}
|
|
9189
9237
|
ops.updateElementById(elementId, updates);
|
|
@@ -9282,6 +9330,8 @@ function useIOHandlers(input) {
|
|
|
9282
9330
|
slideMasters: state.slideMasters,
|
|
9283
9331
|
history,
|
|
9284
9332
|
setSlides: state.setSlides,
|
|
9333
|
+
templateElementsBySlideId: state.templateElementsBySlideId,
|
|
9334
|
+
setTemplateElementsBySlideId: state.setTemplateElementsBySlideId,
|
|
9285
9335
|
theme: state.theme,
|
|
9286
9336
|
bumpHistory: () => state.setPointerCommitNonce((n) => n + 1)
|
|
9287
9337
|
});
|
|
@@ -9369,10 +9419,10 @@ function useFontInjection({ embeddedFonts, slides }) {
|
|
|
9369
9419
|
}
|
|
9370
9420
|
};
|
|
9371
9421
|
}, [embeddedFonts]);
|
|
9372
|
-
const referencedFamilies = react.useMemo(() =>
|
|
9422
|
+
const referencedFamilies = react.useMemo(() => chunkAU5YFUUK_js.collectReferencedFontFamilies(slides), [slides]);
|
|
9373
9423
|
react.useEffect(() => {
|
|
9374
9424
|
let cancelled = false;
|
|
9375
|
-
void
|
|
9425
|
+
void chunkAU5YFUUK_js.resolveGoogleWebfontHref(slides, embeddedFonts).then((href) => {
|
|
9376
9426
|
if (cancelled) {
|
|
9377
9427
|
return null;
|
|
9378
9428
|
}
|
|
@@ -9555,7 +9605,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9555
9605
|
inputRef.current = input;
|
|
9556
9606
|
const handleKeyDown = react.useCallback((e) => {
|
|
9557
9607
|
const current = inputRef.current;
|
|
9558
|
-
const startAction =
|
|
9608
|
+
const startAction = chunkAU5YFUUK_js.mapSlideShowStartKey(e, { isPresenting: current.mode === "present" });
|
|
9559
9609
|
if (startAction !== null) {
|
|
9560
9610
|
e.preventDefault();
|
|
9561
9611
|
if (startAction === "fromBeginning") {
|
|
@@ -9565,7 +9615,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9565
9615
|
}
|
|
9566
9616
|
return;
|
|
9567
9617
|
}
|
|
9568
|
-
const { action, dx, dy } =
|
|
9618
|
+
const { action, dx, dy } = chunkAU5YFUUK_js.mapEditorKey(e, {
|
|
9569
9619
|
canEdit: current.canEdit,
|
|
9570
9620
|
// The Slide Master view is an editing surface, not a viewing one.
|
|
9571
9621
|
// Gating on `mode !== 'edit'` alone made `mapEditorKey` return
|
|
@@ -9578,7 +9628,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9578
9628
|
hasSelection: current.hasSelection,
|
|
9579
9629
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9580
9630
|
isDrawing: current.activeTool !== "select",
|
|
9581
|
-
isTextInputTarget:
|
|
9631
|
+
isTextInputTarget: chunkAU5YFUUK_js.isEditorTextInputTarget(e.target)
|
|
9582
9632
|
});
|
|
9583
9633
|
if (action === null) {
|
|
9584
9634
|
return;
|
|
@@ -9906,7 +9956,7 @@ function useViewerIntegration(input) {
|
|
|
9906
9956
|
return zoom.scale;
|
|
9907
9957
|
},
|
|
9908
9958
|
setZoom(level) {
|
|
9909
|
-
zoom.setScale(
|
|
9959
|
+
zoom.setScale(chunkAU5YFUUK_js.clampZoomScale(level));
|
|
9910
9960
|
},
|
|
9911
9961
|
zoomIn() {
|
|
9912
9962
|
zoom.handleZoomIn();
|
|
@@ -10124,7 +10174,7 @@ function useReducedMotion() {
|
|
|
10124
10174
|
}
|
|
10125
10175
|
function useViewerOptions() {
|
|
10126
10176
|
const storeRef = react.useRef(null);
|
|
10127
|
-
storeRef.current ??=
|
|
10177
|
+
storeRef.current ??= chunkAU5YFUUK_js.createViewerOptionsStore();
|
|
10128
10178
|
const store = storeRef.current;
|
|
10129
10179
|
const options = react.useSyncExternalStore(
|
|
10130
10180
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -10133,9 +10183,9 @@ function useViewerOptions() {
|
|
|
10133
10183
|
);
|
|
10134
10184
|
return { optionsStore: store, options };
|
|
10135
10185
|
}
|
|
10136
|
-
var KNOWN_TAB_IDS = new Set(
|
|
10186
|
+
var KNOWN_TAB_IDS = new Set(chunkAU5YFUUK_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
10137
10187
|
function computeToolbarVisibility(hiddenActions, hiddenTabIds = []) {
|
|
10138
|
-
const isHidden = (id) =>
|
|
10188
|
+
const isHidden = (id) => chunkAU5YFUUK_js.isActionHidden(id, hiddenActions);
|
|
10139
10189
|
const userHidden = new Set(hiddenTabIds);
|
|
10140
10190
|
userHidden.delete("file");
|
|
10141
10191
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id) && !userHidden.has(id);
|
|
@@ -10227,12 +10277,12 @@ function useYjsDocumentSync({
|
|
|
10227
10277
|
return;
|
|
10228
10278
|
}
|
|
10229
10279
|
try {
|
|
10230
|
-
const handler = new
|
|
10280
|
+
const handler = new chunkAU5YFUUK_js.PptxHandler();
|
|
10231
10281
|
await handler.load(sourceBytes.buffer);
|
|
10232
|
-
const currentSlides =
|
|
10282
|
+
const currentSlides = chunkAU5YFUUK_js.readSlidesFromYDoc(
|
|
10233
10283
|
doc
|
|
10234
10284
|
);
|
|
10235
|
-
const slidesToSave =
|
|
10285
|
+
const slidesToSave = chunkAU5YFUUK_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10236
10286
|
const bytes = await handler.save(slidesToSave);
|
|
10237
10287
|
config.onWriteBack(bytes);
|
|
10238
10288
|
} catch {
|
|
@@ -10247,10 +10297,10 @@ function useYjsDocumentSync({
|
|
|
10247
10297
|
if (!doc || !isConnected) {
|
|
10248
10298
|
return;
|
|
10249
10299
|
}
|
|
10250
|
-
const docSlides =
|
|
10300
|
+
const docSlides = chunkAU5YFUUK_js.readSlidesFromYDoc(
|
|
10251
10301
|
doc
|
|
10252
10302
|
);
|
|
10253
|
-
if (!
|
|
10303
|
+
if (!chunkAU5YFUUK_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
|
|
10254
10304
|
return;
|
|
10255
10305
|
}
|
|
10256
10306
|
lastSyncedRef.current = JSON.stringify(docSlides);
|
|
@@ -10269,11 +10319,11 @@ function useYjsDocumentSync({
|
|
|
10269
10319
|
lastSyncedRef.current = serialized;
|
|
10270
10320
|
void (async () => {
|
|
10271
10321
|
const factories = await getFactories();
|
|
10272
|
-
|
|
10322
|
+
chunkAU5YFUUK_js.reconcileSlidesInYDoc(
|
|
10273
10323
|
slides,
|
|
10274
10324
|
doc,
|
|
10275
10325
|
factories,
|
|
10276
|
-
|
|
10326
|
+
chunkAU5YFUUK_js.LOCAL_SYNC_ORIGIN
|
|
10277
10327
|
);
|
|
10278
10328
|
scheduleWriteBack();
|
|
10279
10329
|
})();
|
|
@@ -10287,10 +10337,10 @@ function useYjsDocumentSync({
|
|
|
10287
10337
|
return;
|
|
10288
10338
|
}
|
|
10289
10339
|
const handleChange = (_events, transaction) => {
|
|
10290
|
-
if (transaction?.origin ===
|
|
10340
|
+
if (transaction?.origin === chunkAU5YFUUK_js.LOCAL_SYNC_ORIGIN) {
|
|
10291
10341
|
return;
|
|
10292
10342
|
}
|
|
10293
|
-
const remoteSlides =
|
|
10343
|
+
const remoteSlides = chunkAU5YFUUK_js.readSlidesFromYDoc(
|
|
10294
10344
|
doc
|
|
10295
10345
|
);
|
|
10296
10346
|
if (remoteSlides.length === 0) {
|
|
@@ -10306,7 +10356,7 @@ function useYjsDocumentSync({
|
|
|
10306
10356
|
isApplyingRemoteRef.current = false;
|
|
10307
10357
|
scheduleWriteBack();
|
|
10308
10358
|
};
|
|
10309
|
-
const unobserve =
|
|
10359
|
+
const unobserve = chunkAU5YFUUK_js.observeYDocSlides(
|
|
10310
10360
|
doc,
|
|
10311
10361
|
handleChange
|
|
10312
10362
|
);
|
|
@@ -10344,7 +10394,7 @@ function useBroadcastFollower({
|
|
|
10344
10394
|
if (!broadcaster) {
|
|
10345
10395
|
return;
|
|
10346
10396
|
}
|
|
10347
|
-
if (!
|
|
10397
|
+
if (!chunkAU5YFUUK_js.shouldAutoFollowBroadcaster({
|
|
10348
10398
|
localRole: collab.config.role,
|
|
10349
10399
|
broadcasterRole: broadcaster.role
|
|
10350
10400
|
})) {
|
|
@@ -10515,7 +10565,7 @@ function subscribeTouchCapability(callback) {
|
|
|
10515
10565
|
function useIsMobile() {
|
|
10516
10566
|
const isTouchDevice = react.useSyncExternalStore(
|
|
10517
10567
|
subscribeTouchCapability,
|
|
10518
|
-
|
|
10568
|
+
chunkAU5YFUUK_js.detectTouchDevice,
|
|
10519
10569
|
() => false
|
|
10520
10570
|
// server snapshot
|
|
10521
10571
|
);
|
|
@@ -10525,7 +10575,7 @@ function useIsMobile() {
|
|
|
10525
10575
|
const [viewportHeight, setViewportHeight] = react.useState(
|
|
10526
10576
|
() => typeof window === "undefined" ? 768 : window.innerHeight
|
|
10527
10577
|
);
|
|
10528
|
-
const [orientation, setOrientation] = react.useState(
|
|
10578
|
+
const [orientation, setOrientation] = react.useState(chunkAU5YFUUK_js.detectOrientation);
|
|
10529
10579
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
10530
10580
|
const [initialViewportHeight] = react.useState(
|
|
10531
10581
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -10546,7 +10596,7 @@ function useIsMobile() {
|
|
|
10546
10596
|
return;
|
|
10547
10597
|
}
|
|
10548
10598
|
const handleOrientationChange = () => {
|
|
10549
|
-
setOrientation(
|
|
10599
|
+
setOrientation(chunkAU5YFUUK_js.detectOrientation());
|
|
10550
10600
|
};
|
|
10551
10601
|
if (screen.orientation) {
|
|
10552
10602
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -10576,7 +10626,7 @@ function useIsMobile() {
|
|
|
10576
10626
|
window.addEventListener("resize", handleResize);
|
|
10577
10627
|
return () => window.removeEventListener("resize", handleResize);
|
|
10578
10628
|
}, [isTouchDevice, initialViewportHeight]);
|
|
10579
|
-
const { isMobile, isTablet, isDesktop } =
|
|
10629
|
+
const { isMobile, isTablet, isDesktop } = chunkAU5YFUUK_js.deriveViewportBreakpoints(
|
|
10580
10630
|
viewportWidth,
|
|
10581
10631
|
viewportHeight,
|
|
10582
10632
|
isTouchDevice
|
|
@@ -10607,10 +10657,10 @@ function useTouchGestures(input) {
|
|
|
10607
10657
|
if (!el || !enabled) {
|
|
10608
10658
|
return;
|
|
10609
10659
|
}
|
|
10610
|
-
const recognizer =
|
|
10660
|
+
const recognizer = chunkAU5YFUUK_js.createTouchGestureRecognizer({
|
|
10611
10661
|
getScale: () => scaleRef.current,
|
|
10612
|
-
minScale:
|
|
10613
|
-
maxScale:
|
|
10662
|
+
minScale: chunkAU5YFUUK_js.MIN_ZOOM_SCALE,
|
|
10663
|
+
maxScale: chunkAU5YFUUK_js.MAX_ZOOM_SCALE,
|
|
10614
10664
|
callbacks: {
|
|
10615
10665
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10616
10666
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10650,7 +10700,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10650
10700
|
return;
|
|
10651
10701
|
}
|
|
10652
10702
|
const rect = active.getBoundingClientRect();
|
|
10653
|
-
const delta =
|
|
10703
|
+
const delta = chunkAU5YFUUK_js.computeScrollDelta(
|
|
10654
10704
|
{ top: rect.top, bottom: rect.bottom },
|
|
10655
10705
|
window.innerHeight,
|
|
10656
10706
|
keyboardInset
|
|
@@ -10670,8 +10720,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10670
10720
|
return;
|
|
10671
10721
|
}
|
|
10672
10722
|
const update = () => {
|
|
10673
|
-
const metrics =
|
|
10674
|
-
const inset = metrics ?
|
|
10723
|
+
const metrics = chunkAU5YFUUK_js.readViewportMetrics(window);
|
|
10724
|
+
const inset = metrics ? chunkAU5YFUUK_js.computeKeyboardInset(metrics) : 0;
|
|
10675
10725
|
setKeyboardInset(inset);
|
|
10676
10726
|
if (inset > 0) {
|
|
10677
10727
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10682,8 +10732,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10682
10732
|
vv.addEventListener("scroll", update);
|
|
10683
10733
|
const onFocusIn = () => {
|
|
10684
10734
|
window.requestAnimationFrame(() => {
|
|
10685
|
-
const metrics =
|
|
10686
|
-
const inset = metrics ?
|
|
10735
|
+
const metrics = chunkAU5YFUUK_js.readViewportMetrics(window);
|
|
10736
|
+
const inset = metrics ? chunkAU5YFUUK_js.computeKeyboardInset(metrics) : 0;
|
|
10687
10737
|
if (inset > 0) {
|
|
10688
10738
|
scrollFocusedIntoView(inset);
|
|
10689
10739
|
}
|
|
@@ -10696,7 +10746,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10696
10746
|
document.removeEventListener("focusin", onFocusIn);
|
|
10697
10747
|
};
|
|
10698
10748
|
}, [enabled]);
|
|
10699
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10749
|
+
return { keyboardInset, isKeyboardOpen: chunkAU5YFUUK_js.isKeyboardOpen(keyboardInset) };
|
|
10700
10750
|
}
|
|
10701
10751
|
|
|
10702
10752
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10725,21 +10775,21 @@ function buildCanvasProps(input) {
|
|
|
10725
10775
|
} = input;
|
|
10726
10776
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10727
10777
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10728
|
-
const fieldContext =
|
|
10778
|
+
const fieldContext = chunkAU5YFUUK_js.buildFieldSubstitutionContext({
|
|
10729
10779
|
headerFooter: s.headerFooter,
|
|
10730
10780
|
customProperties: s.customProperties,
|
|
10731
10781
|
slide: activeSlide
|
|
10732
10782
|
});
|
|
10733
10783
|
const tableStyleContext = s.theme || s.tableStyleMap ? { theme: s.theme, tableStyleMap: s.tableStyleMap } : void 0;
|
|
10734
10784
|
const openExternalUrl = (url) => {
|
|
10735
|
-
if (
|
|
10785
|
+
if (chunkAU5YFUUK_js.shouldConfirmExternalHyperlink(viewerOptions, url) && !window.confirm(buildHyperlinkConfirmMessage(url))) {
|
|
10736
10786
|
return;
|
|
10737
10787
|
}
|
|
10738
|
-
|
|
10788
|
+
chunkAU5YFUUK_js.safeOpenUrl(url);
|
|
10739
10789
|
};
|
|
10740
10790
|
const handleActionClick = (elementId, action) => {
|
|
10741
10791
|
if (mode === "present") {
|
|
10742
|
-
const resolved =
|
|
10792
|
+
const resolved = chunkAU5YFUUK_js.resolvePresentationAction(action, { slideCount: slides.length });
|
|
10743
10793
|
if (resolved.intent.kind === "openUrl") {
|
|
10744
10794
|
openExternalUrl(resolved.intent.url);
|
|
10745
10795
|
return;
|
|
@@ -10750,9 +10800,9 @@ function buildCanvasProps(input) {
|
|
|
10750
10800
|
}
|
|
10751
10801
|
};
|
|
10752
10802
|
const handleHyperlinkClick = (url) => {
|
|
10753
|
-
if (
|
|
10803
|
+
if (chunkAU5YFUUK_js.isPpactionUrl(url)) {
|
|
10754
10804
|
if (mode === "present") {
|
|
10755
|
-
const parsed =
|
|
10805
|
+
const parsed = chunkAU5YFUUK_js.parsePpactionUrl(url);
|
|
10756
10806
|
if (parsed) {
|
|
10757
10807
|
presentation.handlePresentationAction({
|
|
10758
10808
|
action: parsed.action,
|
|
@@ -10858,7 +10908,7 @@ function buildCanvasProps(input) {
|
|
|
10858
10908
|
|
|
10859
10909
|
// src/viewer/hooks/useScopedLayoutOptions.ts
|
|
10860
10910
|
function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
|
|
10861
|
-
return
|
|
10911
|
+
return chunkAU5YFUUK_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
|
|
10862
10912
|
}
|
|
10863
10913
|
|
|
10864
10914
|
// src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
|
|
@@ -10871,7 +10921,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10871
10921
|
const current = activeSlide.animations ?? [];
|
|
10872
10922
|
if (group === "motionPath") {
|
|
10873
10923
|
propertyHandlers.handleUpdateSlide({
|
|
10874
|
-
animations:
|
|
10924
|
+
animations: chunkAU5YFUUK_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10875
10925
|
});
|
|
10876
10926
|
return;
|
|
10877
10927
|
}
|
|
@@ -11066,7 +11116,7 @@ function buildToolbarProps(input) {
|
|
|
11066
11116
|
onOpenFile,
|
|
11067
11117
|
onOpenRecentFile,
|
|
11068
11118
|
onCreatePresentation: (templateId) => {
|
|
11069
|
-
s.setSlides(
|
|
11119
|
+
s.setSlides(chunkAU5YFUUK_js.createBackstagePresentation(templateId));
|
|
11070
11120
|
s.setActiveSlideIndex(0);
|
|
11071
11121
|
s.setSelectedElementId(null);
|
|
11072
11122
|
s.setSelectedElementIds([]);
|
|
@@ -11095,7 +11145,7 @@ function buildToolbarProps(input) {
|
|
|
11095
11145
|
loadLayoutPreviews: input.loadLayoutPreviews,
|
|
11096
11146
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
11097
11147
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
11098
|
-
templateScheme:
|
|
11148
|
+
templateScheme: chunkAU5YFUUK_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
11099
11149
|
customShows: s.customShows,
|
|
11100
11150
|
activeCustomShowId: s.activeCustomShowId,
|
|
11101
11151
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -11136,7 +11186,7 @@ function buildToolbarProps(input) {
|
|
|
11136
11186
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
11137
11187
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
11138
11188
|
formatPainterActive: s.formatPainterActive,
|
|
11139
|
-
canActivateFormatPainter:
|
|
11189
|
+
canActivateFormatPainter: chunkAU5YFUUK_js.hasCopyableFormat(selectedElement),
|
|
11140
11190
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
11141
11191
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
11142
11192
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -11210,7 +11260,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11210
11260
|
headerFooter: state.headerFooter,
|
|
11211
11261
|
loading,
|
|
11212
11262
|
error,
|
|
11213
|
-
maxHistoryEntries:
|
|
11263
|
+
maxHistoryEntries: chunkAU5YFUUK_js.resolveHistoryDepth(viewerOptions),
|
|
11214
11264
|
hasActivePointerInteraction,
|
|
11215
11265
|
pointerCommitNonce: state.pointerCommitNonce,
|
|
11216
11266
|
setSlides: state.setSlides,
|
|
@@ -11277,7 +11327,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
11277
11327
|
gridSpacingPx,
|
|
11278
11328
|
// Multiplied against the pre-existing 2x baseline; see the matching
|
|
11279
11329
|
// comment in `PowerPointViewer.tsx`.
|
|
11280
|
-
imageExportScale: 2 *
|
|
11330
|
+
imageExportScale: 2 * chunkAU5YFUUK_js.resolveImageResolutionScale(viewerOptions),
|
|
11281
11331
|
viewerOptions
|
|
11282
11332
|
};
|
|
11283
11333
|
}
|
|
@@ -11293,7 +11343,7 @@ function useCompatibilityToastsState() {
|
|
|
11293
11343
|
}
|
|
11294
11344
|
function useReadOnlyRecommendationState(content) {
|
|
11295
11345
|
const [recommendation, setRecommendation] = react.useState(
|
|
11296
|
-
() =>
|
|
11346
|
+
() => chunkAU5YFUUK_js.readOnlyRecommendation(void 0)
|
|
11297
11347
|
);
|
|
11298
11348
|
const [bannerHidden, setBannerHidden] = react.useState(false);
|
|
11299
11349
|
const [editAnywayActive, setEditAnywayActive] = react.useState(false);
|
|
@@ -11331,9 +11381,9 @@ function useViewPreferencesSync(input) {
|
|
|
11331
11381
|
setShowGuides
|
|
11332
11382
|
} = input;
|
|
11333
11383
|
react.useEffect(() => {
|
|
11334
|
-
const seeded =
|
|
11384
|
+
const seeded = chunkAU5YFUUK_js.viewerPreferencesFromViewProperties(
|
|
11335
11385
|
{ viewProperties },
|
|
11336
|
-
{ ...
|
|
11386
|
+
{ ...chunkAU5YFUUK_js.DEFAULT_VIEWER_PREFERENCES, snapToGrid, snapToObjects: snapToShape, showGuides }
|
|
11337
11387
|
);
|
|
11338
11388
|
setSnapToGrid(seeded.snapToGrid);
|
|
11339
11389
|
setSnapToShape(seeded.snapToObjects ?? snapToShape);
|
|
@@ -11343,7 +11393,7 @@ function useViewPreferencesSync(input) {
|
|
|
11343
11393
|
(prefsOverride) => {
|
|
11344
11394
|
setViewProperties((prev) => {
|
|
11345
11395
|
const merged = {
|
|
11346
|
-
...
|
|
11396
|
+
...chunkAU5YFUUK_js.DEFAULT_VIEWER_PREFERENCES,
|
|
11347
11397
|
snapToGrid,
|
|
11348
11398
|
snapToObjects: snapToShape,
|
|
11349
11399
|
showGuides,
|
|
@@ -11351,7 +11401,7 @@ function useViewPreferencesSync(input) {
|
|
|
11351
11401
|
gridSpacingCy: prev?.gridSpacing?.cy,
|
|
11352
11402
|
...prefsOverride
|
|
11353
11403
|
};
|
|
11354
|
-
const patch =
|
|
11404
|
+
const patch = chunkAU5YFUUK_js.viewPropertiesPatchFromPreferences(merged);
|
|
11355
11405
|
return {
|
|
11356
11406
|
...prev,
|
|
11357
11407
|
slideViewPr: { ...prev?.slideViewPr, ...patch.slideViewPr },
|
|
@@ -11569,7 +11619,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11569
11619
|
}, [incomingContent]);
|
|
11570
11620
|
const onOpenFile = react.useCallback(() => {
|
|
11571
11621
|
void (async () => {
|
|
11572
|
-
const picked = await
|
|
11622
|
+
const picked = await chunkAU5YFUUK_js.openPptxFile();
|
|
11573
11623
|
if (picked) {
|
|
11574
11624
|
setContent(picked.buffer);
|
|
11575
11625
|
}
|
|
@@ -11577,7 +11627,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11577
11627
|
}, []);
|
|
11578
11628
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11579
11629
|
void (async () => {
|
|
11580
|
-
const bytes = await
|
|
11630
|
+
const bytes = await chunkAU5YFUUK_js.readBackstageRecentFile(key);
|
|
11581
11631
|
if (bytes) {
|
|
11582
11632
|
setContent(bytes);
|
|
11583
11633
|
}
|