pptx-react-viewer 3.3.0 → 3.4.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 +24 -0
- package/dist/{AiChatPanel-WNQCTQB5.js → AiChatPanel-3Q4STA5E.js} +25 -25
- package/dist/AiChatPanel-3Q4STA5E.js.br +0 -0
- package/dist/AiChatPanel-3Q4STA5E.js.gz +0 -0
- package/dist/{AiChatPanel-BNFDBP4S.mjs → AiChatPanel-NQZBZIRM.mjs} +4 -4
- package/dist/AiChatPanel-NQZBZIRM.mjs.br +0 -0
- package/dist/AiChatPanel-NQZBZIRM.mjs.gz +0 -0
- package/dist/{Area3DChartScene-SAQVRYOH.mjs → Area3DChartScene-7PARQDOZ.mjs} +1 -1
- package/dist/Area3DChartScene-7PARQDOZ.mjs.br +3 -0
- package/dist/Area3DChartScene-7PARQDOZ.mjs.gz +0 -0
- package/dist/{Area3DChartScene-FXBSLIGX.js → Area3DChartScene-THLG74CM.js} +2 -2
- package/dist/Area3DChartScene-THLG74CM.js.br +0 -0
- package/dist/Area3DChartScene-THLG74CM.js.gz +0 -0
- package/dist/{Bar3DChartScene-7HVUTP2E.js → Bar3DChartScene-OLZ2V56I.js} +2 -2
- package/dist/Bar3DChartScene-OLZ2V56I.js.br +2 -0
- package/dist/Bar3DChartScene-OLZ2V56I.js.gz +0 -0
- package/dist/{Bar3DChartScene-LUA6E2K6.mjs → Bar3DChartScene-QUU6RUXM.mjs} +1 -1
- package/dist/Bar3DChartScene-QUU6RUXM.mjs.br +0 -0
- package/dist/Bar3DChartScene-QUU6RUXM.mjs.gz +0 -0
- package/dist/{Line3DChartScene-OVPULUTF.js → Line3DChartScene-2VZS52IB.js} +2 -2
- package/dist/Line3DChartScene-2VZS52IB.js.br +0 -0
- package/dist/Line3DChartScene-2VZS52IB.js.gz +0 -0
- package/dist/{Line3DChartScene-IW4JGH57.mjs → Line3DChartScene-D77ORA4K.mjs} +1 -1
- package/dist/Line3DChartScene-D77ORA4K.mjs.br +3 -0
- package/dist/Line3DChartScene-D77ORA4K.mjs.gz +0 -0
- package/dist/{Model3DScene-5KP6BVCV.js → Model3DScene-3WCALTXO.js} +2 -2
- package/dist/Model3DScene-3WCALTXO.js.br +0 -0
- package/dist/Model3DScene-3WCALTXO.js.gz +0 -0
- package/dist/{Model3DScene-BERTZYCJ.mjs → Model3DScene-ZEGWNILH.mjs} +1 -1
- package/dist/Model3DScene-ZEGWNILH.mjs.br +0 -0
- package/dist/Model3DScene-ZEGWNILH.mjs.gz +0 -0
- package/dist/{PieChart3DScene-3R2ETTGA.js → PieChart3DScene-7C3ACGKN.js} +2 -2
- package/dist/PieChart3DScene-7C3ACGKN.js.br +0 -0
- package/dist/PieChart3DScene-7C3ACGKN.js.gz +0 -0
- package/dist/{PieChart3DScene-O6FFK5L7.mjs → PieChart3DScene-DGD4PZVV.mjs} +1 -1
- package/dist/PieChart3DScene-DGD4PZVV.mjs.br +0 -0
- package/dist/PieChart3DScene-DGD4PZVV.mjs.gz +0 -0
- package/dist/PowerPointViewer-Cl6jBPNw.d.ts.map +1 -1
- package/dist/{SurfaceChart3DScene-OCR26R5D.mjs → SurfaceChart3DScene-QGH3OLJV.mjs} +1 -1
- package/dist/SurfaceChart3DScene-QGH3OLJV.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-QGH3OLJV.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-TGFAOLHL.js → SurfaceChart3DScene-SJPQGGGE.js} +2 -2
- package/dist/SurfaceChart3DScene-SJPQGGGE.js.br +0 -0
- package/dist/SurfaceChart3DScene-SJPQGGGE.js.gz +0 -0
- package/dist/{chunk-QKSYKQEL.js → chunk-7E6SM42A.js} +2513 -1626
- package/dist/chunk-7E6SM42A.js.br +0 -0
- package/dist/chunk-7E6SM42A.js.gz +0 -0
- package/dist/{chunk-DM2IZCSD.mjs → chunk-B7WAGQW4.mjs} +2955 -835
- package/dist/chunk-B7WAGQW4.mjs.br +0 -0
- package/dist/chunk-B7WAGQW4.mjs.gz +0 -0
- package/dist/{chunk-2FTJAMFA.mjs → chunk-C4WTQIC6.mjs} +13 -5
- package/dist/chunk-C4WTQIC6.mjs.br +0 -0
- package/dist/chunk-C4WTQIC6.mjs.gz +0 -0
- package/dist/{chunk-FSQCEAMG.js → chunk-KY6JQJXK.js} +17 -9
- package/dist/chunk-KY6JQJXK.js.br +0 -0
- package/dist/chunk-KY6JQJXK.js.gz +0 -0
- package/dist/{chunk-3B5FRKYU.mjs → chunk-L5MRKDRM.mjs} +1397 -510
- package/dist/chunk-L5MRKDRM.mjs.br +0 -0
- package/dist/chunk-L5MRKDRM.mjs.gz +0 -0
- package/dist/{chunk-QEEU4S4Z.mjs → chunk-MSUUPLQ7.mjs} +671 -114
- package/dist/chunk-MSUUPLQ7.mjs.br +0 -0
- package/dist/chunk-MSUUPLQ7.mjs.gz +0 -0
- package/dist/{chunk-K6R2JNCK.js → chunk-PCW2KT7Z.js} +2987 -834
- package/dist/chunk-PCW2KT7Z.js.br +0 -0
- package/dist/chunk-PCW2KT7Z.js.gz +0 -0
- package/dist/{chunk-ITN5NYYM.mjs → chunk-SFMATKNJ.mjs} +6 -19
- package/dist/chunk-SFMATKNJ.mjs.br +0 -0
- package/dist/chunk-SFMATKNJ.mjs.gz +0 -0
- package/dist/{chunk-GR6SJJIT.js → chunk-TJNG5VEK.js} +1080 -518
- package/dist/chunk-TJNG5VEK.js.br +0 -0
- package/dist/chunk-TJNG5VEK.js.gz +0 -0
- package/dist/{chunk-3P7FYHJH.js → chunk-UNIJUD5C.js} +44 -1
- package/dist/chunk-UNIJUD5C.js.br +0 -0
- package/dist/{chunk-3P7FYHJH.js.gz → chunk-UNIJUD5C.js.gz} +0 -0
- package/dist/{chunk-44CQ67GQ.js → chunk-XBTHWXNO.js} +172 -185
- package/dist/chunk-XBTHWXNO.js.br +0 -0
- package/dist/chunk-XBTHWXNO.js.gz +0 -0
- package/dist/{chunk-AMRT3AE4.mjs → chunk-XWUMM2TX.mjs} +44 -1
- package/dist/chunk-XWUMM2TX.mjs.br +0 -0
- package/dist/{chunk-AMRT3AE4.mjs.gz → chunk-XWUMM2TX.mjs.gz} +0 -0
- package/dist/i18n.js +4 -4
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.d.ts +7 -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 +176 -5
- 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/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/{useViewerBuildingBlocks-X1L8BjsQ.d.ts → useViewerBuildingBlocks-f6oNGKMX.d.ts} +8 -1
- package/dist/useViewerBuildingBlocks-f6oNGKMX.d.ts.map +1 -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-BNFDBP4S.mjs.br +0 -0
- package/dist/AiChatPanel-BNFDBP4S.mjs.gz +0 -0
- package/dist/AiChatPanel-WNQCTQB5.js.br +0 -0
- package/dist/AiChatPanel-WNQCTQB5.js.gz +0 -0
- package/dist/Area3DChartScene-FXBSLIGX.js.br +0 -0
- package/dist/Area3DChartScene-FXBSLIGX.js.gz +0 -0
- package/dist/Area3DChartScene-SAQVRYOH.mjs.br +0 -0
- package/dist/Area3DChartScene-SAQVRYOH.mjs.gz +0 -0
- package/dist/Bar3DChartScene-7HVUTP2E.js.br +0 -0
- package/dist/Bar3DChartScene-7HVUTP2E.js.gz +0 -0
- package/dist/Bar3DChartScene-LUA6E2K6.mjs.br +0 -3
- package/dist/Bar3DChartScene-LUA6E2K6.mjs.gz +0 -0
- package/dist/Line3DChartScene-IW4JGH57.mjs.br +0 -0
- package/dist/Line3DChartScene-IW4JGH57.mjs.gz +0 -0
- package/dist/Line3DChartScene-OVPULUTF.js.br +0 -0
- package/dist/Line3DChartScene-OVPULUTF.js.gz +0 -0
- package/dist/Model3DScene-5KP6BVCV.js.br +0 -0
- package/dist/Model3DScene-5KP6BVCV.js.gz +0 -0
- package/dist/Model3DScene-BERTZYCJ.mjs.br +0 -0
- package/dist/Model3DScene-BERTZYCJ.mjs.gz +0 -0
- package/dist/PieChart3DScene-3R2ETTGA.js.br +0 -0
- package/dist/PieChart3DScene-3R2ETTGA.js.gz +0 -0
- package/dist/PieChart3DScene-O6FFK5L7.mjs.br +0 -0
- package/dist/PieChart3DScene-O6FFK5L7.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-OCR26R5D.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-OCR26R5D.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-TGFAOLHL.js.br +0 -0
- package/dist/SurfaceChart3DScene-TGFAOLHL.js.gz +0 -0
- package/dist/chunk-2FTJAMFA.mjs.br +0 -0
- package/dist/chunk-2FTJAMFA.mjs.gz +0 -0
- package/dist/chunk-3B5FRKYU.mjs.br +0 -0
- package/dist/chunk-3B5FRKYU.mjs.gz +0 -0
- package/dist/chunk-3P7FYHJH.js.br +0 -0
- package/dist/chunk-44CQ67GQ.js.br +0 -0
- package/dist/chunk-44CQ67GQ.js.gz +0 -0
- package/dist/chunk-AMRT3AE4.mjs.br +0 -0
- package/dist/chunk-DM2IZCSD.mjs.br +0 -0
- package/dist/chunk-DM2IZCSD.mjs.gz +0 -0
- package/dist/chunk-FSQCEAMG.js.br +0 -0
- package/dist/chunk-FSQCEAMG.js.gz +0 -0
- package/dist/chunk-GR6SJJIT.js.br +0 -0
- package/dist/chunk-GR6SJJIT.js.gz +0 -0
- package/dist/chunk-ITN5NYYM.mjs.br +0 -0
- package/dist/chunk-ITN5NYYM.mjs.gz +0 -0
- package/dist/chunk-K6R2JNCK.js.br +0 -0
- package/dist/chunk-K6R2JNCK.js.gz +0 -0
- package/dist/chunk-QEEU4S4Z.mjs.br +0 -0
- package/dist/chunk-QEEU4S4Z.mjs.gz +0 -0
- package/dist/chunk-QKSYKQEL.js.br +0 -0
- package/dist/chunk-QKSYKQEL.js.gz +0 -0
- package/dist/useViewerBuildingBlocks-X1L8BjsQ.d.ts.map +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkXBTHWXNO_js = require('./chunk-XBTHWXNO.js');
|
|
4
|
+
var chunkPCW2KT7Z_js = require('./chunk-PCW2KT7Z.js');
|
|
5
|
+
var chunkUNIJUD5C_js = require('./chunk-UNIJUD5C.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 = chunkPCW2KT7Z_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 = chunkPCW2KT7Z_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 ??= chunkPCW2KT7Z_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 >= chunkPCW2KT7Z_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
|
+
}, chunkPCW2KT7Z_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 = chunkPCW2KT7Z_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
|
+
chunkPCW2KT7Z_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 = chunkPCW2KT7Z_js.validateRoomId(config.roomId);
|
|
244
244
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
245
|
-
departureRef.current =
|
|
245
|
+
departureRef.current = chunkPCW2KT7Z_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 = chunkPCW2KT7Z_js.validateRoomId(config.roomId);
|
|
288
|
+
const transport = config.transport ?? chunkPCW2KT7Z_js.resolveTransportForServerUrl(config.serverUrl);
|
|
289
289
|
if (transport === "webrtc") {
|
|
290
290
|
await initWebrtc();
|
|
291
291
|
return;
|
|
292
292
|
}
|
|
293
|
-
if (
|
|
293
|
+
if (chunkPCW2KT7Z_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 = chunkPCW2KT7Z_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
|
+
chunkPCW2KT7Z_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
|
+
}, chunkPCW2KT7Z_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
|
+
chunkPCW2KT7Z_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 = chunkPCW2KT7Z_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 = chunkPCW2KT7Z_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(chunkPCW2KT7Z_js.cloneSlide),
|
|
531
|
+
templateElementsBySlideId: chunkPCW2KT7Z_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(chunkPCW2KT7Z_js.cloneSlide));
|
|
545
545
|
setTemplateElementsBySlideId(
|
|
546
|
-
|
|
546
|
+
chunkPCW2KT7Z_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 = chunkXBTHWXNO_js.cloneHistorySnapshot(previousSnapshot);
|
|
586
|
+
lastHistorySnapshotRef.current = chunkXBTHWXNO_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 = chunkXBTHWXNO_js.cloneHistorySnapshot(nextSnapshot);
|
|
608
|
+
lastHistorySnapshotRef.current = chunkXBTHWXNO_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 = chunkXBTHWXNO_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 = chunkXBTHWXNO_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(chunkXBTHWXNO_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 = chunkXBTHWXNO_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(chunkPCW2KT7Z_js.createWheelStepBuffer());
|
|
747
747
|
const storeRef = react.useRef(null);
|
|
748
|
-
storeRef.current ??=
|
|
748
|
+
storeRef.current ??= chunkPCW2KT7Z_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 = chunkPCW2KT7Z_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, chunkXBTHWXNO_js.MIN_ELEMENT_SIZE));
|
|
847
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkXBTHWXNO_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, chunkXBTHWXNO_js.MIN_ELEMENT_SIZE);
|
|
854
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkXBTHWXNO_js.MIN_ELEMENT_SIZE);
|
|
855
855
|
const availableWidth = Math.max(
|
|
856
|
-
effectiveEditorDimensions.width -
|
|
857
|
-
|
|
856
|
+
effectiveEditorDimensions.width - chunkXBTHWXNO_js.ZOOM_TO_SELECTION_PADDING,
|
|
857
|
+
chunkXBTHWXNO_js.MIN_ELEMENT_SIZE
|
|
858
858
|
);
|
|
859
859
|
const availableHeight = Math.max(
|
|
860
|
-
effectiveEditorDimensions.height -
|
|
861
|
-
|
|
860
|
+
effectiveEditorDimensions.height - chunkXBTHWXNO_js.ZOOM_TO_SELECTION_PADDING,
|
|
861
|
+
chunkXBTHWXNO_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 = chunkPCW2KT7Z_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 = chunkPCW2KT7Z_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: chunkPCW2KT7Z_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
|
+
chunkPCW2KT7Z_js.playGroup(controller, group, ctx);
|
|
1061
|
+
chunkPCW2KT7Z_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 = chunkPCW2KT7Z_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
|
+
chunkPCW2KT7Z_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
|
+
chunkPCW2KT7Z_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
|
+
chunkPCW2KT7Z_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 = chunkPCW2KT7Z_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 = chunkPCW2KT7Z_js.PresentationAnimationController.collectBuildStepIds(activeGroup);
|
|
1168
1168
|
const completedStates = controller.computeStatesFor(buildIds);
|
|
1169
1169
|
clearPresentationTimers();
|
|
1170
1170
|
finishAnimationGroupSteps(activeGroup, setPresentationElementStates, completedStates);
|
|
1171
|
-
|
|
1171
|
+
chunkPCW2KT7Z_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
|
+
chunkPCW2KT7Z_js.playGroup(controller, group, ctx);
|
|
1183
1183
|
markAnimationGroupActive(group);
|
|
1184
|
-
|
|
1184
|
+
chunkPCW2KT7Z_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
|
+
chunkPCW2KT7Z_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
|
+
chunkPCW2KT7Z_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 = chunkPCW2KT7Z_js.PRESENTATION_CHANNEL_NAME;
|
|
1298
|
+
var AUDIENCE_HASH = chunkPCW2KT7Z_js.PRESENTATION_HASH;
|
|
1299
|
+
var PRESENTER_MSG_ORIGIN = chunkPCW2KT7Z_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1300
|
+
var AUDIENCE_NONCE_KEY = chunkPCW2KT7Z_js.PRESENTATION_NONCE_KEY;
|
|
1301
1301
|
function generateSessionId() {
|
|
1302
|
-
return
|
|
1302
|
+
return chunkPCW2KT7Z_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 ? chunkPCW2KT7Z_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 chunkPCW2KT7Z_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 = chunkPCW2KT7Z_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1421
|
+
void chunkPCW2KT7Z_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1422
1422
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1423
|
-
|
|
1423
|
+
chunkPCW2KT7Z_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 chunkPCW2KT7Z_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 (chunkPCW2KT7Z_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 chunkPCW2KT7Z_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 (!chunkPCW2KT7Z_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 chunkPCW2KT7Z_js.clearAudienceContent(expectedSessionId);
|
|
1587
1587
|
}
|
|
1588
|
-
if (
|
|
1588
|
+
if (chunkPCW2KT7Z_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: chunkPCW2KT7Z_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(chunkPCW2KT7Z_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(chunkPCW2KT7Z_js.createPresentationKeyBuffer());
|
|
1631
1631
|
react.useEffect(() => {
|
|
1632
|
-
if (mode !== "present" || !
|
|
1633
|
-
keyBufferRef.current =
|
|
1632
|
+
if (mode !== "present" || !chunkPCW2KT7Z_js.acceptsPresentationInput()) {
|
|
1633
|
+
keyBufferRef.current = chunkPCW2KT7Z_js.createPresentationKeyBuffer();
|
|
1634
1634
|
return;
|
|
1635
1635
|
}
|
|
1636
1636
|
const handleKeyDown = (event) => {
|
|
1637
|
-
const mapped =
|
|
1637
|
+
const mapped = chunkPCW2KT7Z_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 = chunkPCW2KT7Z_js.firstShowSlideIndex(showSlideIndexes);
|
|
1658
1658
|
navigateToSlide(first ?? 0);
|
|
1659
1659
|
return;
|
|
1660
1660
|
}
|
|
1661
1661
|
case "last": {
|
|
1662
|
-
const last =
|
|
1662
|
+
const last = chunkPCW2KT7Z_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" || !chunkPCW2KT7Z_js.acceptsPresentationInput()) {
|
|
1701
1701
|
return;
|
|
1702
1702
|
}
|
|
1703
|
-
const mapped =
|
|
1703
|
+
const mapped = chunkPCW2KT7Z_js.mapPresentationWheel(event, wheelBufferRef.current);
|
|
1704
1704
|
if (mapped.intent === "next-slide") {
|
|
1705
1705
|
event.preventDefault();
|
|
1706
1706
|
movePresentationSlide(1);
|
|
@@ -1833,9 +1833,9 @@ function useRehearsalTimings(input) {
|
|
|
1833
1833
|
|
|
1834
1834
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1835
1835
|
function handlePresentationActionImpl(action, deps) {
|
|
1836
|
-
|
|
1836
|
+
chunkPCW2KT7Z_js.runPresentationAction(
|
|
1837
1837
|
action,
|
|
1838
|
-
{ slideCount: deps.slidesLength },
|
|
1838
|
+
{ slideCount: deps.slidesLength, ...deps.elementId ? { elementId: deps.elementId } : {} },
|
|
1839
1839
|
{
|
|
1840
1840
|
goToSlide: (slideIndex) => {
|
|
1841
1841
|
deps.navigateToSlide(slideIndex);
|
|
@@ -1846,7 +1846,13 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1846
1846
|
endShow: () => {
|
|
1847
1847
|
deps.onSetMode("edit");
|
|
1848
1848
|
},
|
|
1849
|
-
playSound: deps.onPlayActionSound ? (soundPath) => deps.onPlayActionSound?.(soundPath) : void 0
|
|
1849
|
+
playSound: deps.onPlayActionSound ? (soundPath) => deps.onPlayActionSound?.(soundPath) : void 0,
|
|
1850
|
+
lastViewed: deps.onLastViewed,
|
|
1851
|
+
customShow: deps.onCustomShow,
|
|
1852
|
+
openFile: deps.onOpenFile,
|
|
1853
|
+
openPresentation: deps.onOpenPresentation,
|
|
1854
|
+
playMedia: deps.onPlayMedia,
|
|
1855
|
+
oleVerb: deps.onOleVerb
|
|
1850
1856
|
}
|
|
1851
1857
|
);
|
|
1852
1858
|
}
|
|
@@ -1854,8 +1860,8 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1854
1860
|
// src/viewer/hooks/presentation-mode/slide-transition.ts
|
|
1855
1861
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1856
1862
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1857
|
-
const transition = incomingSlide?.transition;
|
|
1858
|
-
const durationMs = deps.playTransition ?
|
|
1863
|
+
const transition = deps.reverse ? deps.slides[deps.currentSlideIndex]?.transition : incomingSlide?.transition;
|
|
1864
|
+
const durationMs = deps.playTransition ? chunkPCW2KT7Z_js.resolveTransitionDurationMs(transition) : 0;
|
|
1859
1865
|
deps.clearPresentationTimers();
|
|
1860
1866
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1861
1867
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -1908,13 +1914,19 @@ function useSlideNavigation(input) {
|
|
|
1908
1914
|
presentationTimersRef,
|
|
1909
1915
|
rehearsing,
|
|
1910
1916
|
recordCurrentSlideTime,
|
|
1911
|
-
setShowRehearsalSummary
|
|
1917
|
+
setShowRehearsalSummary,
|
|
1918
|
+
onLastViewed,
|
|
1919
|
+
onCustomShow,
|
|
1920
|
+
onOpenFile,
|
|
1921
|
+
onOpenPresentation,
|
|
1922
|
+
onPlayMedia,
|
|
1923
|
+
onOleVerb
|
|
1912
1924
|
} = input;
|
|
1913
1925
|
const movePresentationSlideRef = react.useRef(() => {
|
|
1914
1926
|
});
|
|
1915
1927
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
1916
1928
|
(slideIndex) => {
|
|
1917
|
-
const delayMs =
|
|
1929
|
+
const delayMs = chunkPCW2KT7Z_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
1918
1930
|
if (delayMs === void 0) {
|
|
1919
1931
|
return;
|
|
1920
1932
|
}
|
|
@@ -1937,7 +1949,7 @@ function useSlideNavigation(input) {
|
|
|
1937
1949
|
if (availableSlideIndexes.length === 0) {
|
|
1938
1950
|
return;
|
|
1939
1951
|
}
|
|
1940
|
-
const pastLastSlide = direction === 1 && !
|
|
1952
|
+
const pastLastSlide = direction === 1 && !chunkPCW2KT7Z_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
1941
1953
|
if (rehearsing && pastLastSlide) {
|
|
1942
1954
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
1943
1955
|
try {
|
|
@@ -1955,9 +1967,9 @@ function useSlideNavigation(input) {
|
|
|
1955
1967
|
onAdvancePastLastSlide();
|
|
1956
1968
|
return;
|
|
1957
1969
|
}
|
|
1958
|
-
const nextSlideIndex = direction === 1 ?
|
|
1970
|
+
const nextSlideIndex = direction === 1 ? chunkPCW2KT7Z_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
1959
1971
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
1960
|
-
}) :
|
|
1972
|
+
}) : chunkPCW2KT7Z_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
1961
1973
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
1962
1974
|
return;
|
|
1963
1975
|
}
|
|
@@ -1977,8 +1989,11 @@ function useSlideNavigation(input) {
|
|
|
1977
1989
|
scheduleAutoAdvanceForSlide: rehearsing ? void 0 : scheduleAutoAdvanceForSlide,
|
|
1978
1990
|
presentationTimersRef,
|
|
1979
1991
|
setTransitionOverlay,
|
|
1980
|
-
// PowerPoint plays a slide's transition only when advancing into it
|
|
1981
|
-
|
|
1992
|
+
// PowerPoint plays a slide's transition only when advancing into it,
|
|
1993
|
+
// and replays the LEAVING slide's transition in reverse when stepping
|
|
1994
|
+
// back (a morph glides its shapes back to where they came from).
|
|
1995
|
+
playTransition: true,
|
|
1996
|
+
reverse: direction === -1,
|
|
1982
1997
|
// Stepping back onto a slide shows it with its builds already played.
|
|
1983
1998
|
seedCompleted: direction === -1
|
|
1984
1999
|
});
|
|
@@ -2054,16 +2069,35 @@ function useSlideNavigation(input) {
|
|
|
2054
2069
|
]
|
|
2055
2070
|
);
|
|
2056
2071
|
const handlePresentationAction = react.useCallback(
|
|
2057
|
-
(action) => {
|
|
2072
|
+
(action, elementId) => {
|
|
2058
2073
|
handlePresentationActionImpl(action, {
|
|
2074
|
+
elementId,
|
|
2059
2075
|
movePresentationSlide,
|
|
2060
2076
|
navigateToSlide,
|
|
2061
2077
|
onPlayActionSound,
|
|
2062
2078
|
onSetMode,
|
|
2063
|
-
slidesLength: slides.length
|
|
2079
|
+
slidesLength: slides.length,
|
|
2080
|
+
onLastViewed,
|
|
2081
|
+
onCustomShow,
|
|
2082
|
+
onOpenFile,
|
|
2083
|
+
onOpenPresentation,
|
|
2084
|
+
onPlayMedia,
|
|
2085
|
+
onOleVerb
|
|
2064
2086
|
});
|
|
2065
2087
|
},
|
|
2066
|
-
[
|
|
2088
|
+
[
|
|
2089
|
+
movePresentationSlide,
|
|
2090
|
+
navigateToSlide,
|
|
2091
|
+
onPlayActionSound,
|
|
2092
|
+
onSetMode,
|
|
2093
|
+
slides.length,
|
|
2094
|
+
onLastViewed,
|
|
2095
|
+
onCustomShow,
|
|
2096
|
+
onOpenFile,
|
|
2097
|
+
onOpenPresentation,
|
|
2098
|
+
onPlayMedia,
|
|
2099
|
+
onOleVerb
|
|
2100
|
+
]
|
|
2067
2101
|
);
|
|
2068
2102
|
return {
|
|
2069
2103
|
movePresentationSlide,
|
|
@@ -2101,23 +2135,153 @@ function useZoomNavigation(input) {
|
|
|
2101
2135
|
clearZoomReturn
|
|
2102
2136
|
};
|
|
2103
2137
|
}
|
|
2138
|
+
function createCustomShowRunner(deps) {
|
|
2139
|
+
let origin = null;
|
|
2140
|
+
return {
|
|
2141
|
+
runCustomShow(customShowId, returnAfter) {
|
|
2142
|
+
const target = deps.getCustomShows().find((show) => show.id === customShowId);
|
|
2143
|
+
if (!target) {
|
|
2144
|
+
return;
|
|
2145
|
+
}
|
|
2146
|
+
origin = returnAfter ? { showId: deps.getActiveCustomShowId(), slideIndex: deps.getPresentationSlideIndex() } : null;
|
|
2147
|
+
const first = chunkPCW2KT7Z_js.firstShowSlideIndex(chunkPCW2KT7Z_js.resolveShowSlideIndexes(deps.getSlides(), target));
|
|
2148
|
+
deps.setActiveCustomShowId(customShowId);
|
|
2149
|
+
if (first !== void 0) {
|
|
2150
|
+
deps.navigateToSlide(first);
|
|
2151
|
+
}
|
|
2152
|
+
},
|
|
2153
|
+
tryReturnFromCustomShow() {
|
|
2154
|
+
if (!origin) {
|
|
2155
|
+
return false;
|
|
2156
|
+
}
|
|
2157
|
+
const { showId, slideIndex } = origin;
|
|
2158
|
+
origin = null;
|
|
2159
|
+
deps.setActiveCustomShowId(showId);
|
|
2160
|
+
deps.navigateToSlide(slideIndex);
|
|
2161
|
+
return true;
|
|
2162
|
+
}
|
|
2163
|
+
};
|
|
2164
|
+
}
|
|
2165
|
+
function useCustomShowRunner(deps) {
|
|
2166
|
+
const depsRef = react.useRef(deps);
|
|
2167
|
+
depsRef.current = deps;
|
|
2168
|
+
const runnerRef = react.useRef(null);
|
|
2169
|
+
runnerRef.current ??= createCustomShowRunner({
|
|
2170
|
+
getSlides: () => depsRef.current.getSlides(),
|
|
2171
|
+
getCustomShows: () => depsRef.current.getCustomShows(),
|
|
2172
|
+
getActiveCustomShowId: () => depsRef.current.getActiveCustomShowId(),
|
|
2173
|
+
setActiveCustomShowId: (id) => depsRef.current.setActiveCustomShowId(id),
|
|
2174
|
+
navigateToSlide: (index) => depsRef.current.navigateToSlide(index),
|
|
2175
|
+
getPresentationSlideIndex: () => depsRef.current.getPresentationSlideIndex()
|
|
2176
|
+
});
|
|
2177
|
+
return runnerRef.current;
|
|
2178
|
+
}
|
|
2179
|
+
|
|
2180
|
+
// src/viewer/hooks/presentation-mode/usePresentationActionExtensions.ts
|
|
2181
|
+
function usePresentationActionExtensions(input) {
|
|
2182
|
+
const {
|
|
2183
|
+
slides,
|
|
2184
|
+
customShows,
|
|
2185
|
+
activeCustomShowId,
|
|
2186
|
+
onSetActiveCustomShowId,
|
|
2187
|
+
presentationSlideIndex,
|
|
2188
|
+
containerRef,
|
|
2189
|
+
endWithBlackSlide,
|
|
2190
|
+
onSetMode,
|
|
2191
|
+
setEndOfShowVisible
|
|
2192
|
+
} = input;
|
|
2193
|
+
const navigateToSlideRef = react.useRef(null);
|
|
2194
|
+
const navigateToSlideViaRef = react.useCallback((index) => {
|
|
2195
|
+
navigateToSlideRef.current?.(index);
|
|
2196
|
+
}, []);
|
|
2197
|
+
const customShowRunner = useCustomShowRunner({
|
|
2198
|
+
getSlides: () => slides,
|
|
2199
|
+
getCustomShows: () => customShows,
|
|
2200
|
+
getActiveCustomShowId: () => activeCustomShowId,
|
|
2201
|
+
setActiveCustomShowId: (id) => onSetActiveCustomShowId?.(id),
|
|
2202
|
+
navigateToSlide: navigateToSlideViaRef,
|
|
2203
|
+
getPresentationSlideIndex: () => presentationSlideIndex
|
|
2204
|
+
});
|
|
2205
|
+
const previousSlideRef = react.useRef(presentationSlideIndex);
|
|
2206
|
+
const lastViewedSlideRef = react.useRef(null);
|
|
2207
|
+
react.useEffect(() => {
|
|
2208
|
+
lastViewedSlideRef.current = previousSlideRef.current;
|
|
2209
|
+
previousSlideRef.current = presentationSlideIndex;
|
|
2210
|
+
}, [presentationSlideIndex]);
|
|
2211
|
+
const onCustomShow = react.useCallback(
|
|
2212
|
+
(customShowId, returnAfter) => {
|
|
2213
|
+
customShowRunner.runCustomShow(customShowId, returnAfter);
|
|
2214
|
+
},
|
|
2215
|
+
[customShowRunner]
|
|
2216
|
+
);
|
|
2217
|
+
const onLastViewed = react.useCallback(() => {
|
|
2218
|
+
const previous = lastViewedSlideRef.current;
|
|
2219
|
+
if (previous !== null) {
|
|
2220
|
+
navigateToSlideViaRef(previous);
|
|
2221
|
+
}
|
|
2222
|
+
}, [navigateToSlideViaRef]);
|
|
2223
|
+
const onOpenFile = react.useCallback((target) => {
|
|
2224
|
+
chunkPCW2KT7Z_js.safeOpenUrl(target);
|
|
2225
|
+
}, []);
|
|
2226
|
+
const onOpenPresentation = react.useCallback((target) => {
|
|
2227
|
+
chunkPCW2KT7Z_js.safeOpenUrl(target);
|
|
2228
|
+
}, []);
|
|
2229
|
+
const onPlayMedia = react.useCallback(
|
|
2230
|
+
(elementId) => {
|
|
2231
|
+
chunkPCW2KT7Z_js.toggleStageElementMedia(containerRef.current, elementId);
|
|
2232
|
+
},
|
|
2233
|
+
[containerRef]
|
|
2234
|
+
);
|
|
2235
|
+
const onOleVerb = react.useCallback(
|
|
2236
|
+
(verb, elementId) => {
|
|
2237
|
+
const target = chunkPCW2KT7Z_js.resolveOleVerbTarget(slides[presentationSlideIndex], elementId, verb);
|
|
2238
|
+
if (target) {
|
|
2239
|
+
chunkPCW2KT7Z_js.openUrlInNewTab(target.url);
|
|
2240
|
+
}
|
|
2241
|
+
},
|
|
2242
|
+
[slides, presentationSlideIndex]
|
|
2243
|
+
);
|
|
2244
|
+
const handleAdvancePastLastSlide = react.useCallback(() => {
|
|
2245
|
+
if (customShowRunner.tryReturnFromCustomShow()) {
|
|
2246
|
+
return;
|
|
2247
|
+
}
|
|
2248
|
+
if (endWithBlackSlide) {
|
|
2249
|
+
setEndOfShowVisible(true);
|
|
2250
|
+
} else {
|
|
2251
|
+
onSetMode("edit");
|
|
2252
|
+
}
|
|
2253
|
+
}, [customShowRunner, endWithBlackSlide, onSetMode, setEndOfShowVisible]);
|
|
2254
|
+
const bindNavigateToSlide = react.useCallback((navigateToSlide) => {
|
|
2255
|
+
navigateToSlideRef.current = navigateToSlide;
|
|
2256
|
+
}, []);
|
|
2257
|
+
return {
|
|
2258
|
+
onLastViewed,
|
|
2259
|
+
onCustomShow,
|
|
2260
|
+
onOpenFile,
|
|
2261
|
+
onOpenPresentation,
|
|
2262
|
+
onPlayMedia,
|
|
2263
|
+
onOleVerb,
|
|
2264
|
+
handleAdvancePastLastSlide,
|
|
2265
|
+
bindNavigateToSlide
|
|
2266
|
+
};
|
|
2267
|
+
}
|
|
2104
2268
|
function usePresenterConsole(slideIndex, active) {
|
|
2105
|
-
const timerRef = react.useRef(
|
|
2106
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2269
|
+
const timerRef = react.useRef(chunkPCW2KT7Z_js.createPresenterTimer());
|
|
2270
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkPCW2KT7Z_js.createInitialPresentationSnapshot(slideIndex));
|
|
2107
2271
|
const patch = react.useCallback((value) => {
|
|
2108
|
-
setSnapshot((current) =>
|
|
2272
|
+
setSnapshot((current) => chunkPCW2KT7Z_js.mergePresentationSnapshot(current, value));
|
|
2109
2273
|
}, []);
|
|
2110
2274
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2111
2275
|
react.useEffect(() => {
|
|
2112
2276
|
if (!active) {
|
|
2113
2277
|
return;
|
|
2114
2278
|
}
|
|
2115
|
-
timerRef.current =
|
|
2279
|
+
timerRef.current = chunkPCW2KT7Z_js.resetPresenterTimer();
|
|
2116
2280
|
patch({ paused: false, elapsedMs: 0 });
|
|
2117
2281
|
const timer = window.setInterval(() => {
|
|
2118
2282
|
patch({
|
|
2119
2283
|
paused: timerRef.current.paused,
|
|
2120
|
-
elapsedMs:
|
|
2284
|
+
elapsedMs: chunkPCW2KT7Z_js.presenterElapsed(timerRef.current)
|
|
2121
2285
|
});
|
|
2122
2286
|
}, 1e3);
|
|
2123
2287
|
return () => window.clearInterval(timer);
|
|
@@ -2127,19 +2291,19 @@ function usePresenterConsole(slideIndex, active) {
|
|
|
2127
2291
|
applyAudienceSnapshot: setSnapshot,
|
|
2128
2292
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2129
2293
|
toggleTimer: () => {
|
|
2130
|
-
timerRef.current =
|
|
2294
|
+
timerRef.current = chunkPCW2KT7Z_js.togglePresenterTimer(timerRef.current);
|
|
2131
2295
|
patch({
|
|
2132
2296
|
paused: timerRef.current.paused,
|
|
2133
|
-
elapsedMs:
|
|
2297
|
+
elapsedMs: chunkPCW2KT7Z_js.presenterElapsed(timerRef.current)
|
|
2134
2298
|
});
|
|
2135
2299
|
},
|
|
2136
2300
|
resetTimer: () => {
|
|
2137
|
-
timerRef.current =
|
|
2301
|
+
timerRef.current = chunkPCW2KT7Z_js.resetPresenterTimer();
|
|
2138
2302
|
patch({ paused: false, elapsedMs: 0 });
|
|
2139
2303
|
},
|
|
2140
2304
|
stepZoom: (direction) => setSnapshot(
|
|
2141
|
-
(current) =>
|
|
2142
|
-
zoom:
|
|
2305
|
+
(current) => chunkPCW2KT7Z_js.mergePresentationSnapshot(current, {
|
|
2306
|
+
zoom: chunkPCW2KT7Z_js.stepPresenterZoom(
|
|
2143
2307
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2144
2308
|
direction
|
|
2145
2309
|
)
|
|
@@ -2157,6 +2321,7 @@ function usePresentationMode(input) {
|
|
|
2157
2321
|
const {
|
|
2158
2322
|
mode,
|
|
2159
2323
|
slides,
|
|
2324
|
+
templateElementsBySlideId,
|
|
2160
2325
|
visibleSlideIndexes,
|
|
2161
2326
|
activeSlideIndex,
|
|
2162
2327
|
containerRef,
|
|
@@ -2173,7 +2338,10 @@ function usePresentationMode(input) {
|
|
|
2173
2338
|
loopContinuously,
|
|
2174
2339
|
showWithAnimation,
|
|
2175
2340
|
useTimings,
|
|
2176
|
-
endWithBlackSlide = true
|
|
2341
|
+
endWithBlackSlide = true,
|
|
2342
|
+
customShows = [],
|
|
2343
|
+
activeCustomShowId = null,
|
|
2344
|
+
onSetActiveCustomShowId
|
|
2177
2345
|
} = input;
|
|
2178
2346
|
const [presentationSlideIndex, setPresentationSlideIndex] = react.useState(0);
|
|
2179
2347
|
const [presentationSlideVisible, setPresentationSlideVisible] = react.useState(true);
|
|
@@ -2185,7 +2353,7 @@ function usePresentationMode(input) {
|
|
|
2185
2353
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2186
2354
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2187
2355
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2188
|
-
const showGuard = react.useMemo(() =>
|
|
2356
|
+
const showGuard = react.useMemo(() => chunkPCW2KT7Z_js.createPresenterShowGuard(), []);
|
|
2189
2357
|
const {
|
|
2190
2358
|
presentationAnimations,
|
|
2191
2359
|
presentationElementStates,
|
|
@@ -2228,13 +2396,17 @@ function usePresentationMode(input) {
|
|
|
2228
2396
|
setPresenterMode(false);
|
|
2229
2397
|
}
|
|
2230
2398
|
}, [mode]);
|
|
2231
|
-
const
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2399
|
+
const actionExtensions = usePresentationActionExtensions({
|
|
2400
|
+
slides,
|
|
2401
|
+
customShows,
|
|
2402
|
+
activeCustomShowId,
|
|
2403
|
+
onSetActiveCustomShowId,
|
|
2404
|
+
presentationSlideIndex,
|
|
2405
|
+
containerRef,
|
|
2406
|
+
endWithBlackSlide,
|
|
2407
|
+
onSetMode,
|
|
2408
|
+
setEndOfShowVisible
|
|
2409
|
+
});
|
|
2238
2410
|
const {
|
|
2239
2411
|
movePresentationSlide: moveNavigationSlide,
|
|
2240
2412
|
navigateToSlide,
|
|
@@ -2252,7 +2424,7 @@ function usePresentationMode(input) {
|
|
|
2252
2424
|
onPlayActionSound,
|
|
2253
2425
|
loopContinuously,
|
|
2254
2426
|
useTimings,
|
|
2255
|
-
onAdvancePastLastSlide: handleAdvancePastLastSlide,
|
|
2427
|
+
onAdvancePastLastSlide: actionExtensions.handleAdvancePastLastSlide,
|
|
2256
2428
|
playNextAnimationGroup,
|
|
2257
2429
|
clearPresentationTimers,
|
|
2258
2430
|
seedSlideAnimations,
|
|
@@ -2260,11 +2432,18 @@ function usePresentationMode(input) {
|
|
|
2260
2432
|
presentationTimersRef,
|
|
2261
2433
|
rehearsing,
|
|
2262
2434
|
recordCurrentSlideTime,
|
|
2263
|
-
setShowRehearsalSummary
|
|
2435
|
+
setShowRehearsalSummary,
|
|
2436
|
+
onLastViewed: actionExtensions.onLastViewed,
|
|
2437
|
+
onCustomShow: actionExtensions.onCustomShow,
|
|
2438
|
+
onOpenFile: actionExtensions.onOpenFile,
|
|
2439
|
+
onOpenPresentation: actionExtensions.onOpenPresentation,
|
|
2440
|
+
onPlayMedia: actionExtensions.onPlayMedia,
|
|
2441
|
+
onOleVerb: actionExtensions.onOleVerb
|
|
2264
2442
|
});
|
|
2443
|
+
actionExtensions.bindNavigateToSlide(navigateToSlide);
|
|
2265
2444
|
const movePresentationSlide = react.useCallback(
|
|
2266
2445
|
(direction, trigger = "explicit") => {
|
|
2267
|
-
if (!
|
|
2446
|
+
if (!chunkPCW2KT7Z_js.acceptsPresentationInput()) {
|
|
2268
2447
|
return;
|
|
2269
2448
|
}
|
|
2270
2449
|
if (endOfShowVisible) {
|
|
@@ -2332,6 +2511,13 @@ function usePresentationMode(input) {
|
|
|
2332
2511
|
}
|
|
2333
2512
|
onSetMode("present");
|
|
2334
2513
|
}, [containerRef, onSetMode, setRehearsing]);
|
|
2514
|
+
const enterPresentModeFromBeginning = react.useCallback(() => {
|
|
2515
|
+
const first = chunkPCW2KT7Z_js.firstShowSlideIndex(visibleSlideIndexes);
|
|
2516
|
+
if (first !== void 0) {
|
|
2517
|
+
onSetActiveSlideIndex(first);
|
|
2518
|
+
}
|
|
2519
|
+
enterPresentMode();
|
|
2520
|
+
}, [visibleSlideIndexes, onSetActiveSlideIndex, enterPresentMode]);
|
|
2335
2521
|
const enterPresenterView = react.useCallback(() => {
|
|
2336
2522
|
setPresenterMode(true);
|
|
2337
2523
|
setRehearsing(false);
|
|
@@ -2394,6 +2580,10 @@ function usePresentationMode(input) {
|
|
|
2394
2580
|
scheduleAutoAdvanceRef.current = scheduleAutoAdvanceForSlide;
|
|
2395
2581
|
const activeSlideIndexRef = react.useRef(activeSlideIndex);
|
|
2396
2582
|
activeSlideIndexRef.current = activeSlideIndex;
|
|
2583
|
+
const visibleSlideIndexesRef = react.useRef(visibleSlideIndexes);
|
|
2584
|
+
visibleSlideIndexesRef.current = visibleSlideIndexes;
|
|
2585
|
+
const onSetActiveSlideIndexRef = react.useRef(onSetActiveSlideIndex);
|
|
2586
|
+
onSetActiveSlideIndexRef.current = onSetActiveSlideIndex;
|
|
2397
2587
|
const presentationSlideIndexRef = react.useRef(presentationSlideIndex);
|
|
2398
2588
|
presentationSlideIndexRef.current = presentationSlideIndex;
|
|
2399
2589
|
const clearPresentationTimersRef = react.useRef(clearPresentationTimers);
|
|
@@ -2402,7 +2592,7 @@ function usePresentationMode(input) {
|
|
|
2402
2592
|
if (mode !== "present") {
|
|
2403
2593
|
return;
|
|
2404
2594
|
}
|
|
2405
|
-
return
|
|
2595
|
+
return chunkPCW2KT7Z_js.attachPresentationVisibilityPause({
|
|
2406
2596
|
root: containerRef.current ?? void 0,
|
|
2407
2597
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2408
2598
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
@@ -2410,8 +2600,14 @@ function usePresentationMode(input) {
|
|
|
2410
2600
|
}, [mode, containerRef]);
|
|
2411
2601
|
react.useLayoutEffect(() => {
|
|
2412
2602
|
if (mode === "present") {
|
|
2413
|
-
const idx =
|
|
2603
|
+
const idx = chunkPCW2KT7Z_js.presentationEntrySlideIndex(
|
|
2604
|
+
activeSlideIndexRef.current,
|
|
2605
|
+
visibleSlideIndexesRef.current
|
|
2606
|
+
);
|
|
2414
2607
|
setPresentationSlideIndex(idx);
|
|
2608
|
+
if (idx !== activeSlideIndexRef.current) {
|
|
2609
|
+
onSetActiveSlideIndexRef.current(idx);
|
|
2610
|
+
}
|
|
2415
2611
|
runEntranceAnimationsRef.current(idx);
|
|
2416
2612
|
scheduleAutoAdvanceRef.current(idx);
|
|
2417
2613
|
} else {
|
|
@@ -2482,13 +2678,18 @@ function usePresentationMode(input) {
|
|
|
2482
2678
|
if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
|
|
2483
2679
|
return void 0;
|
|
2484
2680
|
}
|
|
2485
|
-
|
|
2681
|
+
const incoming = slides[transitionOverlay.incomingSlideIndex];
|
|
2682
|
+
return chunkPCW2KT7Z_js.buildMorphTransitionPlan(
|
|
2486
2683
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2487
|
-
|
|
2684
|
+
incoming,
|
|
2488
2685
|
transitionOverlay.durationMs,
|
|
2489
|
-
|
|
2686
|
+
chunkPCW2KT7Z_js.morphOptionToMode(transitionOverlay.transition.morphOption),
|
|
2687
|
+
// `PresentationStage` stacks the incoming slide's elements above its
|
|
2688
|
+
// template shapes (`zIndex = templateElements.length + index`), so a
|
|
2689
|
+
// z-index journey has to start counting where the stage does.
|
|
2690
|
+
{ zIndexBase: incoming ? templateElementsBySlideId?.[incoming.id]?.length ?? 0 : 0 }
|
|
2490
2691
|
);
|
|
2491
|
-
}, [transitionOverlay, slides]);
|
|
2692
|
+
}, [transitionOverlay, slides, templateElementsBySlideId]);
|
|
2492
2693
|
const morphedElementStates = react.useMemo(() => {
|
|
2493
2694
|
if (!morphPlan || morphPlan.incomingAnimations.size === 0) {
|
|
2494
2695
|
return presentationElementStates;
|
|
@@ -2507,7 +2708,7 @@ function usePresentationMode(input) {
|
|
|
2507
2708
|
if (!morphPlan) {
|
|
2508
2709
|
return presentationKeyframesCss;
|
|
2509
2710
|
}
|
|
2510
|
-
const imageRules =
|
|
2711
|
+
const imageRules = chunkPCW2KT7Z_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
|
|
2511
2712
|
return `${presentationKeyframesCss ?? ""}
|
|
2512
2713
|
${morphPlan.keyframesCss}
|
|
2513
2714
|
${imageRules}`;
|
|
@@ -2537,6 +2738,7 @@ ${imageRules}`;
|
|
|
2537
2738
|
handleHoverStart,
|
|
2538
2739
|
handleHoverEnd,
|
|
2539
2740
|
enterPresentMode,
|
|
2741
|
+
enterPresentModeFromBeginning,
|
|
2540
2742
|
presenterMode,
|
|
2541
2743
|
enterPresenterView,
|
|
2542
2744
|
togglePresenterView,
|
|
@@ -2803,7 +3005,7 @@ function useFindReplace({
|
|
|
2803
3005
|
const [findResults, setFindResults] = react.useState([]);
|
|
2804
3006
|
const [findResultIndex, setFindResultIndex] = react.useState(-1);
|
|
2805
3007
|
const performFind = react.useCallback(() => {
|
|
2806
|
-
const results =
|
|
3008
|
+
const results = chunkPCW2KT7Z_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
|
|
2807
3009
|
if (!findQuery) {
|
|
2808
3010
|
setFindResults([]);
|
|
2809
3011
|
setFindResultIndex(-1);
|
|
@@ -2837,7 +3039,7 @@ function useFindReplace({
|
|
|
2837
3039
|
return;
|
|
2838
3040
|
}
|
|
2839
3041
|
onUpdateSlides(
|
|
2840
|
-
(prevSlides) =>
|
|
3042
|
+
(prevSlides) => chunkPCW2KT7Z_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
|
|
2841
3043
|
);
|
|
2842
3044
|
onMarkDirty();
|
|
2843
3045
|
},
|
|
@@ -2859,9 +3061,9 @@ function useFindReplace({
|
|
|
2859
3061
|
}, [findResults, applyReplacements, performFind]);
|
|
2860
3062
|
react.useEffect(() => {
|
|
2861
3063
|
const handler = (event) => {
|
|
2862
|
-
const { action } =
|
|
3064
|
+
const { action } = chunkPCW2KT7Z_js.mapEditorKey(event, {
|
|
2863
3065
|
canEdit: mode === "edit",
|
|
2864
|
-
isTextInputTarget:
|
|
3066
|
+
isTextInputTarget: chunkPCW2KT7Z_js.isEditorTextInputTarget(event.target)
|
|
2865
3067
|
});
|
|
2866
3068
|
if (action !== "find") {
|
|
2867
3069
|
return;
|
|
@@ -2928,6 +3130,38 @@ function useModalDismissDrag(onClose, threshold = 120) {
|
|
|
2928
3130
|
handlers: { onPointerDown, onPointerMove, onPointerUp, onPointerCancel: onPointerUp }
|
|
2929
3131
|
};
|
|
2930
3132
|
}
|
|
3133
|
+
function withoutKey(map, key) {
|
|
3134
|
+
if (!(key in map)) {
|
|
3135
|
+
return map;
|
|
3136
|
+
}
|
|
3137
|
+
const next = { ...map };
|
|
3138
|
+
delete next[key];
|
|
3139
|
+
return next;
|
|
3140
|
+
}
|
|
3141
|
+
function useCommentMentionDrafts() {
|
|
3142
|
+
const [commentDraftMentionsBySlideId, setCommentDraftMentionsBySlideId] = react.useState({});
|
|
3143
|
+
const [replyDraftMentionsByCommentId, setReplyDraftMentionsByCommentId] = react.useState({});
|
|
3144
|
+
const setCommentDraftMentions = react.useCallback((slideId, mentions) => {
|
|
3145
|
+
setCommentDraftMentionsBySlideId((prev) => ({ ...prev, [slideId]: mentions }));
|
|
3146
|
+
}, []);
|
|
3147
|
+
const setReplyDraftMentions = react.useCallback((commentId, mentions) => {
|
|
3148
|
+
setReplyDraftMentionsByCommentId((prev) => ({ ...prev, [commentId]: mentions }));
|
|
3149
|
+
}, []);
|
|
3150
|
+
const clearCommentDraftMentions = react.useCallback((slideId) => {
|
|
3151
|
+
setCommentDraftMentionsBySlideId((prev) => withoutKey(prev, slideId));
|
|
3152
|
+
}, []);
|
|
3153
|
+
const clearReplyDraftMentions = react.useCallback((commentId) => {
|
|
3154
|
+
setReplyDraftMentionsByCommentId((prev) => withoutKey(prev, commentId));
|
|
3155
|
+
}, []);
|
|
3156
|
+
return {
|
|
3157
|
+
commentDraftMentionsBySlideId,
|
|
3158
|
+
replyDraftMentionsByCommentId,
|
|
3159
|
+
setCommentDraftMentions,
|
|
3160
|
+
setReplyDraftMentions,
|
|
3161
|
+
clearCommentDraftMentions,
|
|
3162
|
+
clearReplyDraftMentions
|
|
3163
|
+
};
|
|
3164
|
+
}
|
|
2931
3165
|
|
|
2932
3166
|
// src/viewer/hooks/useComments-helpers.ts
|
|
2933
3167
|
function replaceCommentsOnSlide(slides, slideIndex, next) {
|
|
@@ -2935,12 +3169,12 @@ function replaceCommentsOnSlide(slides, slideIndex, next) {
|
|
|
2935
3169
|
(entry, index) => index === slideIndex ? { ...entry, comments: next } : entry
|
|
2936
3170
|
);
|
|
2937
3171
|
}
|
|
2938
|
-
function addCommentToSlide(slides, slideIndex, text, authorName, elementId) {
|
|
3172
|
+
function addCommentToSlide(slides, slideIndex, text, authorName, elementId, mentions) {
|
|
2939
3173
|
const slide = slides[slideIndex];
|
|
2940
3174
|
if (!slide) {
|
|
2941
3175
|
return { slides, didAdd: false };
|
|
2942
3176
|
}
|
|
2943
|
-
const next =
|
|
3177
|
+
const next = chunkPCW2KT7Z_js.addCommentToList(
|
|
2944
3178
|
slide.comments || [],
|
|
2945
3179
|
text,
|
|
2946
3180
|
authorName,
|
|
@@ -2951,14 +3185,17 @@ function addCommentToSlide(slides, slideIndex, text, authorName, elementId) {
|
|
|
2951
3185
|
if (!next) {
|
|
2952
3186
|
return { slides, didAdd: false };
|
|
2953
3187
|
}
|
|
2954
|
-
|
|
3188
|
+
const withMentions = mentions && mentions.length > 0 ? next.map(
|
|
3189
|
+
(comment, index) => index === next.length - 1 ? { ...comment, mentions } : comment
|
|
3190
|
+
) : next;
|
|
3191
|
+
return { slides: replaceCommentsOnSlide(slides, slideIndex, withMentions), didAdd: true };
|
|
2955
3192
|
}
|
|
2956
3193
|
function removeCommentFromSlide(slides, slideIndex, commentId) {
|
|
2957
3194
|
const slide = slides[slideIndex];
|
|
2958
3195
|
if (!slide) {
|
|
2959
3196
|
return { slides, didDelete: false };
|
|
2960
3197
|
}
|
|
2961
|
-
const next =
|
|
3198
|
+
const next = chunkPCW2KT7Z_js.removeCommentFromList(slide.comments || [], commentId);
|
|
2962
3199
|
if (!next) {
|
|
2963
3200
|
return { slides, didDelete: false };
|
|
2964
3201
|
}
|
|
@@ -2969,7 +3206,7 @@ function editCommentInSlide(slides, slideIndex, commentId, newText) {
|
|
|
2969
3206
|
if (!slide) {
|
|
2970
3207
|
return { slides, didUpdate: false };
|
|
2971
3208
|
}
|
|
2972
|
-
const next =
|
|
3209
|
+
const next = chunkPCW2KT7Z_js.editCommentInList(slide.comments || [], commentId, newText);
|
|
2973
3210
|
if (!next) {
|
|
2974
3211
|
return { slides, didUpdate: false };
|
|
2975
3212
|
}
|
|
@@ -2980,22 +3217,30 @@ function toggleResolvedInSlide(slides, slideIndex, commentId) {
|
|
|
2980
3217
|
if (!slide) {
|
|
2981
3218
|
return { slides, didUpdate: false };
|
|
2982
3219
|
}
|
|
2983
|
-
const next =
|
|
3220
|
+
const next = chunkPCW2KT7Z_js.toggleCommentResolvedInList(slide.comments || [], commentId);
|
|
2984
3221
|
if (!next) {
|
|
2985
3222
|
return { slides, didUpdate: false };
|
|
2986
3223
|
}
|
|
2987
3224
|
return { slides: replaceCommentsOnSlide(slides, slideIndex, next), didUpdate: true };
|
|
2988
3225
|
}
|
|
2989
|
-
function addReplyToSlide(slides, slideIndex, parentId, text, authorName) {
|
|
3226
|
+
function addReplyToSlide(slides, slideIndex, parentId, text, authorName, mentions) {
|
|
2990
3227
|
const slide = slides[slideIndex];
|
|
2991
3228
|
if (!slide) {
|
|
2992
3229
|
return { slides, didAdd: false };
|
|
2993
3230
|
}
|
|
2994
|
-
const next =
|
|
3231
|
+
const next = chunkPCW2KT7Z_js.replyToCommentInList(slide.comments || [], parentId, text, authorName);
|
|
2995
3232
|
if (!next) {
|
|
2996
3233
|
return { slides, didAdd: false };
|
|
2997
3234
|
}
|
|
2998
|
-
|
|
3235
|
+
const withMentions = mentions && mentions.length > 0 ? next.map(
|
|
3236
|
+
(comment) => comment.id === parentId && comment.replies && comment.replies.length > 0 ? {
|
|
3237
|
+
...comment,
|
|
3238
|
+
replies: comment.replies.map(
|
|
3239
|
+
(reply, index) => index === comment.replies.length - 1 ? { ...reply, mentions } : reply
|
|
3240
|
+
)
|
|
3241
|
+
} : comment
|
|
3242
|
+
) : next;
|
|
3243
|
+
return { slides: replaceCommentsOnSlide(slides, slideIndex, withMentions), didAdd: true };
|
|
2999
3244
|
}
|
|
3000
3245
|
function pruneSlideDrafts(drafts, slideIds) {
|
|
3001
3246
|
const next = {};
|
|
@@ -3010,6 +3255,95 @@ function pruneSlideDrafts(drafts, slideIds) {
|
|
|
3010
3255
|
return changed ? next : null;
|
|
3011
3256
|
}
|
|
3012
3257
|
|
|
3258
|
+
// src/viewer/hooks/useCommentReplyHandlers.ts
|
|
3259
|
+
function useCommentReplyHandlers(input) {
|
|
3260
|
+
const {
|
|
3261
|
+
slides,
|
|
3262
|
+
canEdit,
|
|
3263
|
+
userName,
|
|
3264
|
+
onUpdateSlides,
|
|
3265
|
+
onMarkDirty,
|
|
3266
|
+
replyDraftMentionsByCommentId,
|
|
3267
|
+
setReplyDraftMentions,
|
|
3268
|
+
clearReplyDraftMentions
|
|
3269
|
+
} = input;
|
|
3270
|
+
const [replyDraftByCommentId, setReplyDraftByCommentId] = react.useState({});
|
|
3271
|
+
const [replyingToCommentId, setReplyingToCommentId] = react.useState(null);
|
|
3272
|
+
const handleStartReply = react.useCallback((_slideIndex, commentId) => {
|
|
3273
|
+
setReplyingToCommentId(commentId);
|
|
3274
|
+
setReplyDraftByCommentId((prev) => ({ ...prev, [commentId]: "" }));
|
|
3275
|
+
}, []);
|
|
3276
|
+
const handleCancelReply = react.useCallback(() => {
|
|
3277
|
+
setReplyingToCommentId(null);
|
|
3278
|
+
}, []);
|
|
3279
|
+
const handleReplyDraftChange = react.useCallback(
|
|
3280
|
+
(commentId, draft, mentions) => {
|
|
3281
|
+
setReplyDraftByCommentId((prev) => ({ ...prev, [commentId]: draft }));
|
|
3282
|
+
if (mentions) {
|
|
3283
|
+
setReplyDraftMentions(commentId, mentions);
|
|
3284
|
+
}
|
|
3285
|
+
},
|
|
3286
|
+
[setReplyDraftMentions]
|
|
3287
|
+
);
|
|
3288
|
+
const handleSubmitReply = react.useCallback(
|
|
3289
|
+
(slideIndex, commentId) => {
|
|
3290
|
+
if (!canEdit) {
|
|
3291
|
+
return;
|
|
3292
|
+
}
|
|
3293
|
+
const slide = slides[slideIndex];
|
|
3294
|
+
if (!slide) {
|
|
3295
|
+
return;
|
|
3296
|
+
}
|
|
3297
|
+
const replyText = String(replyDraftByCommentId[commentId] || "").trim();
|
|
3298
|
+
if (replyText.length === 0) {
|
|
3299
|
+
return;
|
|
3300
|
+
}
|
|
3301
|
+
let didAdd = false;
|
|
3302
|
+
onUpdateSlides((prev) => {
|
|
3303
|
+
const result = addReplyToSlide(
|
|
3304
|
+
prev,
|
|
3305
|
+
slideIndex,
|
|
3306
|
+
commentId,
|
|
3307
|
+
replyText,
|
|
3308
|
+
userName,
|
|
3309
|
+
replyDraftMentionsByCommentId[commentId]
|
|
3310
|
+
);
|
|
3311
|
+
didAdd = result.didAdd;
|
|
3312
|
+
return result.slides;
|
|
3313
|
+
});
|
|
3314
|
+
if (!didAdd) {
|
|
3315
|
+
return;
|
|
3316
|
+
}
|
|
3317
|
+
setReplyingToCommentId(null);
|
|
3318
|
+
setReplyDraftByCommentId((prev) => {
|
|
3319
|
+
const next = { ...prev };
|
|
3320
|
+
delete next[commentId];
|
|
3321
|
+
return next;
|
|
3322
|
+
});
|
|
3323
|
+
clearReplyDraftMentions(commentId);
|
|
3324
|
+
onMarkDirty();
|
|
3325
|
+
},
|
|
3326
|
+
[
|
|
3327
|
+
canEdit,
|
|
3328
|
+
onMarkDirty,
|
|
3329
|
+
onUpdateSlides,
|
|
3330
|
+
replyDraftByCommentId,
|
|
3331
|
+
replyDraftMentionsByCommentId,
|
|
3332
|
+
clearReplyDraftMentions,
|
|
3333
|
+
slides,
|
|
3334
|
+
userName
|
|
3335
|
+
]
|
|
3336
|
+
);
|
|
3337
|
+
return {
|
|
3338
|
+
replyingToCommentId,
|
|
3339
|
+
replyDraftByCommentId,
|
|
3340
|
+
handleStartReply,
|
|
3341
|
+
handleCancelReply,
|
|
3342
|
+
handleReplyDraftChange,
|
|
3343
|
+
handleSubmitReply
|
|
3344
|
+
};
|
|
3345
|
+
}
|
|
3346
|
+
|
|
3013
3347
|
// src/viewer/hooks/useComments.ts
|
|
3014
3348
|
function useComments({
|
|
3015
3349
|
slides,
|
|
@@ -3022,11 +3356,33 @@ function useComments({
|
|
|
3022
3356
|
const [commentDraftBySlideId, setCommentDraftBySlideId] = react.useState({});
|
|
3023
3357
|
const [editingCommentIdBySlideId, setEditingCommentIdBySlideId] = react.useState({});
|
|
3024
3358
|
const [commentEditDraftByCommentId, setCommentEditDraftByCommentId] = react.useState({});
|
|
3025
|
-
const
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3359
|
+
const {
|
|
3360
|
+
commentDraftMentionsBySlideId,
|
|
3361
|
+
replyDraftMentionsByCommentId,
|
|
3362
|
+
setCommentDraftMentions,
|
|
3363
|
+
setReplyDraftMentions,
|
|
3364
|
+
clearCommentDraftMentions,
|
|
3365
|
+
clearReplyDraftMentions
|
|
3366
|
+
} = useCommentMentionDrafts();
|
|
3367
|
+
const reply = useCommentReplyHandlers({
|
|
3368
|
+
slides,
|
|
3369
|
+
canEdit,
|
|
3370
|
+
userName,
|
|
3371
|
+
onUpdateSlides,
|
|
3372
|
+
onMarkDirty,
|
|
3373
|
+
replyDraftMentionsByCommentId,
|
|
3374
|
+
setReplyDraftMentions,
|
|
3375
|
+
clearReplyDraftMentions
|
|
3376
|
+
});
|
|
3377
|
+
const handleCommentDraftChange = react.useCallback(
|
|
3378
|
+
(slideId, draft, mentions) => {
|
|
3379
|
+
setCommentDraftBySlideId((prev) => ({ ...prev, [slideId]: draft }));
|
|
3380
|
+
if (mentions) {
|
|
3381
|
+
setCommentDraftMentions(slideId, mentions);
|
|
3382
|
+
}
|
|
3383
|
+
},
|
|
3384
|
+
[setCommentDraftMentions]
|
|
3385
|
+
);
|
|
3030
3386
|
const handleSetCommentEditDraft = react.useCallback((commentId, draft) => {
|
|
3031
3387
|
setCommentEditDraftByCommentId((prev) => ({
|
|
3032
3388
|
...prev,
|
|
@@ -3053,7 +3409,8 @@ function useComments({
|
|
|
3053
3409
|
slideIndex,
|
|
3054
3410
|
draft,
|
|
3055
3411
|
userName,
|
|
3056
|
-
selectedElementId ?? void 0
|
|
3412
|
+
selectedElementId ?? void 0,
|
|
3413
|
+
commentDraftMentionsBySlideId[slide.id]
|
|
3057
3414
|
);
|
|
3058
3415
|
didAdd = result.didAdd;
|
|
3059
3416
|
return result.slides;
|
|
@@ -3065,11 +3422,14 @@ function useComments({
|
|
|
3065
3422
|
...prev,
|
|
3066
3423
|
[slide.id]: ""
|
|
3067
3424
|
}));
|
|
3425
|
+
clearCommentDraftMentions(slide.id);
|
|
3068
3426
|
onMarkDirty();
|
|
3069
3427
|
},
|
|
3070
3428
|
[
|
|
3071
3429
|
canEdit,
|
|
3072
3430
|
commentDraftBySlideId,
|
|
3431
|
+
commentDraftMentionsBySlideId,
|
|
3432
|
+
clearCommentDraftMentions,
|
|
3073
3433
|
onMarkDirty,
|
|
3074
3434
|
onUpdateSlides,
|
|
3075
3435
|
selectedElementId,
|
|
@@ -3181,48 +3541,6 @@ function useComments({
|
|
|
3181
3541
|
},
|
|
3182
3542
|
[canEdit, onMarkDirty, onUpdateSlides, slides]
|
|
3183
3543
|
);
|
|
3184
|
-
const handleStartReply = react.useCallback((_slideIndex, commentId) => {
|
|
3185
|
-
setReplyingToCommentId(commentId);
|
|
3186
|
-
setReplyDraftByCommentId((prev) => ({ ...prev, [commentId]: "" }));
|
|
3187
|
-
}, []);
|
|
3188
|
-
const handleCancelReply = react.useCallback(() => {
|
|
3189
|
-
setReplyingToCommentId(null);
|
|
3190
|
-
}, []);
|
|
3191
|
-
const handleReplyDraftChange = react.useCallback((commentId, draft) => {
|
|
3192
|
-
setReplyDraftByCommentId((prev) => ({ ...prev, [commentId]: draft }));
|
|
3193
|
-
}, []);
|
|
3194
|
-
const handleSubmitReply = react.useCallback(
|
|
3195
|
-
(slideIndex, commentId) => {
|
|
3196
|
-
if (!canEdit) {
|
|
3197
|
-
return;
|
|
3198
|
-
}
|
|
3199
|
-
const slide = slides[slideIndex];
|
|
3200
|
-
if (!slide) {
|
|
3201
|
-
return;
|
|
3202
|
-
}
|
|
3203
|
-
const replyText = String(replyDraftByCommentId[commentId] || "").trim();
|
|
3204
|
-
if (replyText.length === 0) {
|
|
3205
|
-
return;
|
|
3206
|
-
}
|
|
3207
|
-
let didAdd = false;
|
|
3208
|
-
onUpdateSlides((prev) => {
|
|
3209
|
-
const result = addReplyToSlide(prev, slideIndex, commentId, replyText, userName);
|
|
3210
|
-
didAdd = result.didAdd;
|
|
3211
|
-
return result.slides;
|
|
3212
|
-
});
|
|
3213
|
-
if (!didAdd) {
|
|
3214
|
-
return;
|
|
3215
|
-
}
|
|
3216
|
-
setReplyingToCommentId(null);
|
|
3217
|
-
setReplyDraftByCommentId((prev) => {
|
|
3218
|
-
const next = { ...prev };
|
|
3219
|
-
delete next[commentId];
|
|
3220
|
-
return next;
|
|
3221
|
-
});
|
|
3222
|
-
onMarkDirty();
|
|
3223
|
-
},
|
|
3224
|
-
[canEdit, onMarkDirty, onUpdateSlides, replyDraftByCommentId, slides, userName]
|
|
3225
|
-
);
|
|
3226
3544
|
react.useEffect(() => {
|
|
3227
3545
|
const slideIds = new Set(slides.map((slide) => slide.id));
|
|
3228
3546
|
setCommentDraftBySlideId((prev) => {
|
|
@@ -3234,8 +3552,8 @@ function useComments({
|
|
|
3234
3552
|
commentDraftBySlideId,
|
|
3235
3553
|
editingCommentIdBySlideId,
|
|
3236
3554
|
commentEditDraftByCommentId,
|
|
3237
|
-
|
|
3238
|
-
|
|
3555
|
+
commentDraftMentionsBySlideId,
|
|
3556
|
+
replyDraftMentionsByCommentId,
|
|
3239
3557
|
handleCommentDraftChange,
|
|
3240
3558
|
handleAddSlideComment,
|
|
3241
3559
|
handleDeleteSlideComment,
|
|
@@ -3244,10 +3562,7 @@ function useComments({
|
|
|
3244
3562
|
handleSaveCommentEdit,
|
|
3245
3563
|
handleSetCommentEditDraft,
|
|
3246
3564
|
handleToggleCommentResolved,
|
|
3247
|
-
|
|
3248
|
-
handleCancelReply,
|
|
3249
|
-
handleReplyDraftChange,
|
|
3250
|
-
handleSubmitReply
|
|
3565
|
+
...reply
|
|
3251
3566
|
};
|
|
3252
3567
|
}
|
|
3253
3568
|
function buildElementLookup(templateElements, slideElements) {
|
|
@@ -3365,7 +3680,7 @@ function useViewerCoreState(_input) {
|
|
|
3365
3680
|
const marqueeStateRef = react.useRef(null);
|
|
3366
3681
|
const isDrawingRef = react.useRef(false);
|
|
3367
3682
|
const justInteractedRef = react.useRef(false);
|
|
3368
|
-
const livePatcher = react.useMemo(() =>
|
|
3683
|
+
const livePatcher = react.useMemo(() => chunkPCW2KT7Z_js.createCollaborationLivePatcher(), []);
|
|
3369
3684
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3370
3685
|
const slidesRef = react.useRef([]);
|
|
3371
3686
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3374,8 +3689,8 @@ function useViewerCoreState(_input) {
|
|
|
3374
3689
|
const [slides, setSlides] = react.useState([]);
|
|
3375
3690
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3376
3691
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3377
|
-
width:
|
|
3378
|
-
height:
|
|
3692
|
+
width: chunkXBTHWXNO_js.DEFAULT_CANVAS_WIDTH,
|
|
3693
|
+
height: chunkXBTHWXNO_js.DEFAULT_CANVAS_HEIGHT
|
|
3379
3694
|
});
|
|
3380
3695
|
const [slideSizeEmu, setSlideSizeEmu] = react.useState();
|
|
3381
3696
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
@@ -3396,7 +3711,7 @@ function useViewerCoreState(_input) {
|
|
|
3396
3711
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3397
3712
|
inlineEditingTextRef.current = resolved;
|
|
3398
3713
|
setInlineEditingTextBase(value);
|
|
3399
|
-
|
|
3714
|
+
chunkPCW2KT7Z_js.publishLiveInlineText(
|
|
3400
3715
|
livePatcher,
|
|
3401
3716
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3402
3717
|
inlineEditingElementIdRef.current,
|
|
@@ -3412,6 +3727,8 @@ function useViewerCoreState(_input) {
|
|
|
3412
3727
|
const [headerFooter, setHeaderFooter] = react.useState({});
|
|
3413
3728
|
const [layoutOptions, setLayoutOptions] = react.useState([]);
|
|
3414
3729
|
const [slideMasters, setSlideMasters] = react.useState([]);
|
|
3730
|
+
const [modernCommentAuthors, setModernCommentAuthors] = react.useState([]);
|
|
3731
|
+
const [recentColors, setRecentColors] = react.useState([]);
|
|
3415
3732
|
const [theme, setTheme] = react.useState();
|
|
3416
3733
|
const [tableStyleMap, setTableStyleMap] = react.useState();
|
|
3417
3734
|
const [themeOptions, setThemeOptions] = react.useState([]);
|
|
@@ -3505,6 +3822,10 @@ function useViewerCoreState(_input) {
|
|
|
3505
3822
|
setLayoutOptions,
|
|
3506
3823
|
slideMasters,
|
|
3507
3824
|
setSlideMasters,
|
|
3825
|
+
modernCommentAuthors,
|
|
3826
|
+
setModernCommentAuthors,
|
|
3827
|
+
recentColors,
|
|
3828
|
+
setRecentColors,
|
|
3508
3829
|
theme,
|
|
3509
3830
|
setTheme,
|
|
3510
3831
|
tableStyleMap,
|
|
@@ -3689,6 +4010,8 @@ function useLoadContent({
|
|
|
3689
4010
|
setHeaderFooter,
|
|
3690
4011
|
setLayoutOptions,
|
|
3691
4012
|
setSlideMasters,
|
|
4013
|
+
setModernCommentAuthors,
|
|
4014
|
+
setRecentColors,
|
|
3692
4015
|
setTheme,
|
|
3693
4016
|
setTableStyleMap,
|
|
3694
4017
|
setThemeOptions,
|
|
@@ -3710,6 +4033,8 @@ function useLoadContent({
|
|
|
3710
4033
|
setHasDigitalSignatures,
|
|
3711
4034
|
setDigitalSignatureCount,
|
|
3712
4035
|
setGuides,
|
|
4036
|
+
setReadOnlyRecommendation,
|
|
4037
|
+
setCompatToasts,
|
|
3713
4038
|
setLoading,
|
|
3714
4039
|
setError,
|
|
3715
4040
|
setIsDirty,
|
|
@@ -3740,7 +4065,7 @@ function useLoadContent({
|
|
|
3740
4065
|
);
|
|
3741
4066
|
}
|
|
3742
4067
|
const previousHandler = handlerRef.current;
|
|
3743
|
-
const handler = new
|
|
4068
|
+
const handler = new chunkPCW2KT7Z_js.PptxHandler();
|
|
3744
4069
|
const parsed = await handler.load(buffer, { allowExternalImages });
|
|
3745
4070
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3746
4071
|
handler.dispose();
|
|
@@ -3752,7 +4077,7 @@ function useLoadContent({
|
|
|
3752
4077
|
handlerRef.current = null;
|
|
3753
4078
|
const mediaElements = [];
|
|
3754
4079
|
for (const slide of parsed.slides) {
|
|
3755
|
-
|
|
4080
|
+
chunkPCW2KT7Z_js.collectMediaElements(slide.elements, mediaElements);
|
|
3756
4081
|
}
|
|
3757
4082
|
for (const url of mediaDataUrls.values()) {
|
|
3758
4083
|
if (url.startsWith("blob:")) {
|
|
@@ -3793,7 +4118,7 @@ function useLoadContent({
|
|
|
3793
4118
|
}
|
|
3794
4119
|
})
|
|
3795
4120
|
);
|
|
3796
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
4121
|
+
const { paths: imagePaths, refs: imageRefs } = chunkPCW2KT7Z_js.collectImagePaths(parsed.slides);
|
|
3797
4122
|
let nextSlides = parsed.slides;
|
|
3798
4123
|
if (imagePaths.size > 0) {
|
|
3799
4124
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3809,25 +4134,25 @@ function useLoadContent({
|
|
|
3809
4134
|
})
|
|
3810
4135
|
);
|
|
3811
4136
|
nextSlides = parsed.slides.map((s) => {
|
|
3812
|
-
const newElements =
|
|
4137
|
+
const newElements = chunkPCW2KT7Z_js.applyImagePathPatches(s.elements, resolvedMap, imageRefs);
|
|
3813
4138
|
return newElements === s.elements ? s : { ...s, elements: newElements };
|
|
3814
4139
|
});
|
|
3815
4140
|
}
|
|
3816
|
-
nextSlides = await
|
|
4141
|
+
nextSlides = await chunkPCW2KT7Z_js.resolveTableCellImageUrls(
|
|
3817
4142
|
nextSlides,
|
|
3818
4143
|
(path) => handler.getImageData(path)
|
|
3819
4144
|
);
|
|
3820
|
-
const nextTableStyleMap = await
|
|
4145
|
+
const nextTableStyleMap = await chunkPCW2KT7Z_js.resolveTableStyleImageUrls(
|
|
3821
4146
|
parsed.tableStyleMap,
|
|
3822
4147
|
(path) => handler.getImageData(path)
|
|
3823
4148
|
);
|
|
3824
4149
|
handlerRef.current = handler;
|
|
3825
|
-
const partition =
|
|
4150
|
+
const partition = chunkPCW2KT7Z_js.partitionTemplateElements(nextSlides);
|
|
3826
4151
|
setSlides(partition.slides);
|
|
3827
4152
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
3828
4153
|
setCanvasSize({
|
|
3829
|
-
width: parsed.width ??
|
|
3830
|
-
height: parsed.height ??
|
|
4154
|
+
width: parsed.width ?? chunkXBTHWXNO_js.DEFAULT_CANVAS_WIDTH,
|
|
4155
|
+
height: parsed.height ?? chunkXBTHWXNO_js.DEFAULT_CANVAS_HEIGHT
|
|
3831
4156
|
});
|
|
3832
4157
|
setSlideSizeEmu(
|
|
3833
4158
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -3839,12 +4164,14 @@ function useLoadContent({
|
|
|
3839
4164
|
setHeaderFooter(parsed.headerFooter ?? {});
|
|
3840
4165
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
3841
4166
|
setSlideMasters(parsed.slideMasters ?? []);
|
|
4167
|
+
setModernCommentAuthors(parsed.modernCommentAuthors ?? []);
|
|
4168
|
+
setRecentColors(chunkPCW2KT7Z_js.seedRecentColors({ mruColors: parsed.mruColors }));
|
|
3842
4169
|
setTheme(parsed.theme);
|
|
3843
4170
|
setTableStyleMap(nextTableStyleMap);
|
|
3844
4171
|
setThemeOptions(parsed.themeOptions ?? []);
|
|
3845
4172
|
setCustomShows(parsed.customShows ?? []);
|
|
3846
4173
|
setActiveCustomShowId(
|
|
3847
|
-
|
|
4174
|
+
chunkPCW2KT7Z_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
|
|
3848
4175
|
);
|
|
3849
4176
|
setSections(parsed.sections ?? []);
|
|
3850
4177
|
setPresentationProperties(parsed.presentationProperties ?? {});
|
|
@@ -3867,7 +4194,14 @@ function useLoadContent({
|
|
|
3867
4194
|
setHasMacros(parsed.hasMacros === true);
|
|
3868
4195
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
3869
4196
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
3870
|
-
setGuides(
|
|
4197
|
+
setGuides(chunkPCW2KT7Z_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
4198
|
+
setReadOnlyRecommendation(chunkPCW2KT7Z_js.readOnlyRecommendation(parsed));
|
|
4199
|
+
setCompatToasts(
|
|
4200
|
+
chunkPCW2KT7Z_js.compatibilityWarningToasts([
|
|
4201
|
+
...parsed.warnings ?? [],
|
|
4202
|
+
...parsed.slides.flatMap((slide) => slide.warnings ?? [])
|
|
4203
|
+
])
|
|
4204
|
+
);
|
|
3871
4205
|
setActiveSlideIndex(0);
|
|
3872
4206
|
clearSelection();
|
|
3873
4207
|
setIsDirty(false);
|
|
@@ -3875,7 +4209,7 @@ function useLoadContent({
|
|
|
3875
4209
|
onContentApplied?.();
|
|
3876
4210
|
} catch (err) {
|
|
3877
4211
|
if (!cancelled && token === renderTokenRef.current) {
|
|
3878
|
-
if (err instanceof
|
|
4212
|
+
if (err instanceof chunkPCW2KT7Z_js.EncryptedFileError) {
|
|
3879
4213
|
setIsEncrypted(true);
|
|
3880
4214
|
} else {
|
|
3881
4215
|
console.error("[pptx] Failed to load presentation content:", err);
|
|
@@ -3903,7 +4237,7 @@ function useLoadContent({
|
|
|
3903
4237
|
}
|
|
3904
4238
|
function useAutosave(input) {
|
|
3905
4239
|
const { isDirty, filePath, serializeSlides, enabled = true, getChangeSources } = input;
|
|
3906
|
-
const intervalMs =
|
|
4240
|
+
const intervalMs = chunkPCW2KT7Z_js.resolveAutosaveIntervalMs({
|
|
3907
4241
|
hostIntervalMs: input.intervalMs,
|
|
3908
4242
|
optionsIntervalSeconds: input.intervalSeconds
|
|
3909
4243
|
});
|
|
@@ -3934,7 +4268,7 @@ function useAutosave(input) {
|
|
|
3934
4268
|
return;
|
|
3935
4269
|
}
|
|
3936
4270
|
const sources = changeSourcesRef.current?.() ?? [];
|
|
3937
|
-
if (!
|
|
4271
|
+
if (!chunkPCW2KT7Z_js.shouldWriteAutosaveSnapshot({
|
|
3938
4272
|
filePath: path,
|
|
3939
4273
|
isDirty: isDirtyRef.current,
|
|
3940
4274
|
saving: isSavingRef.current,
|
|
@@ -3952,8 +4286,8 @@ function useAutosave(input) {
|
|
|
3952
4286
|
isSavingRef.current = false;
|
|
3953
4287
|
return;
|
|
3954
4288
|
}
|
|
3955
|
-
await
|
|
3956
|
-
lastSnapshotRef.current =
|
|
4289
|
+
await chunkPCW2KT7Z_js.saveAutosaveSnapshot(path, data);
|
|
4290
|
+
lastSnapshotRef.current = chunkPCW2KT7Z_js.autosaveSnapshotMark(path, sources);
|
|
3957
4291
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
3958
4292
|
} catch (err) {
|
|
3959
4293
|
setAutosaveStatus({
|
|
@@ -4039,11 +4373,11 @@ function useElementOperations(input) {
|
|
|
4039
4373
|
(elementId, updates) => {
|
|
4040
4374
|
if (masterView?.target) {
|
|
4041
4375
|
applyMasterViewWrite(
|
|
4042
|
-
|
|
4376
|
+
chunkPCW2KT7Z_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
|
|
4043
4377
|
);
|
|
4044
4378
|
return;
|
|
4045
4379
|
}
|
|
4046
|
-
if (
|
|
4380
|
+
if (chunkPCW2KT7Z_js.isTemplateElementId(elementId)) {
|
|
4047
4381
|
const slideId = activeSlide?.id;
|
|
4048
4382
|
if (slideId) {
|
|
4049
4383
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4054,7 +4388,7 @@ function useElementOperations(input) {
|
|
|
4054
4388
|
}));
|
|
4055
4389
|
}
|
|
4056
4390
|
} else {
|
|
4057
|
-
setSlides((prev) =>
|
|
4391
|
+
setSlides((prev) => chunkPCW2KT7Z_js.updateElement(prev, activeSlideIndex, elementId, updates));
|
|
4058
4392
|
}
|
|
4059
4393
|
history.markDirty();
|
|
4060
4394
|
},
|
|
@@ -4079,7 +4413,7 @@ function useElementOperations(input) {
|
|
|
4079
4413
|
);
|
|
4080
4414
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4081
4415
|
(updates) => {
|
|
4082
|
-
if (!selectedElement || !
|
|
4416
|
+
if (!selectedElement || !chunkPCW2KT7Z_js.hasShapeProperties(selectedElement)) {
|
|
4083
4417
|
return;
|
|
4084
4418
|
}
|
|
4085
4419
|
updateSelectedElement({
|
|
@@ -4090,17 +4424,17 @@ function useElementOperations(input) {
|
|
|
4090
4424
|
);
|
|
4091
4425
|
const updateSelectedTextStyle = react.useCallback(
|
|
4092
4426
|
(updates) => {
|
|
4093
|
-
if (!selectedElement || !
|
|
4427
|
+
if (!selectedElement || !chunkPCW2KT7Z_js.hasTextProperties(selectedElement)) {
|
|
4094
4428
|
return;
|
|
4095
4429
|
}
|
|
4096
|
-
const inlineSel =
|
|
4430
|
+
const inlineSel = chunkPCW2KT7Z_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4097
4431
|
if (inlineSel && selectedElement.textSegments) {
|
|
4098
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4432
|
+
const { newSegments: newSegments2, newSelection } = chunkPCW2KT7Z_js.applyStyleToSelectedSegments(
|
|
4099
4433
|
selectedElement.textSegments,
|
|
4100
4434
|
inlineSel,
|
|
4101
4435
|
updates
|
|
4102
4436
|
);
|
|
4103
|
-
|
|
4437
|
+
chunkPCW2KT7Z_js.setPendingSelectionRestore(newSelection);
|
|
4104
4438
|
updateSelectedElement({
|
|
4105
4439
|
textSegments: newSegments2
|
|
4106
4440
|
});
|
|
@@ -4120,12 +4454,12 @@ function useElementOperations(input) {
|
|
|
4120
4454
|
);
|
|
4121
4455
|
const updateSelectedTextCase = react.useCallback(
|
|
4122
4456
|
(mode) => {
|
|
4123
|
-
if (!selectedElement || !
|
|
4457
|
+
if (!selectedElement || !chunkPCW2KT7Z_js.hasTextProperties(selectedElement)) {
|
|
4124
4458
|
return;
|
|
4125
4459
|
}
|
|
4126
|
-
const inlineSel =
|
|
4460
|
+
const inlineSel = chunkPCW2KT7Z_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4127
4461
|
if (inlineSel && selectedElement.textSegments) {
|
|
4128
|
-
const newSegments =
|
|
4462
|
+
const newSegments = chunkPCW2KT7Z_js.applyCaseTransformToSegments(
|
|
4129
4463
|
selectedElement.textSegments,
|
|
4130
4464
|
inlineSel,
|
|
4131
4465
|
mode
|
|
@@ -4135,14 +4469,14 @@ function useElementOperations(input) {
|
|
|
4135
4469
|
}
|
|
4136
4470
|
const updates = {};
|
|
4137
4471
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
4138
|
-
updates.textSegments =
|
|
4472
|
+
updates.textSegments = chunkPCW2KT7Z_js.applyCaseTransformToSegments(
|
|
4139
4473
|
selectedElement.textSegments,
|
|
4140
4474
|
null,
|
|
4141
4475
|
mode
|
|
4142
4476
|
);
|
|
4143
4477
|
}
|
|
4144
4478
|
if (typeof selectedElement.text === "string") {
|
|
4145
|
-
updates.text =
|
|
4479
|
+
updates.text = chunkPCW2KT7Z_js.transformTextCase(selectedElement.text, mode);
|
|
4146
4480
|
}
|
|
4147
4481
|
updateSelectedElement(updates);
|
|
4148
4482
|
},
|
|
@@ -4155,15 +4489,15 @@ function useElementOperations(input) {
|
|
|
4155
4489
|
[setSlides]
|
|
4156
4490
|
);
|
|
4157
4491
|
const masterViewTarget = masterView?.target ?? null;
|
|
4158
|
-
const activeElements = masterViewTarget ?
|
|
4492
|
+
const activeElements = masterViewTarget ? chunkPCW2KT7Z_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4159
4493
|
const updateActiveElements = react.useCallback(
|
|
4160
4494
|
(updater) => {
|
|
4161
4495
|
if (masterView?.target) {
|
|
4162
4496
|
applyMasterViewWrite(
|
|
4163
|
-
|
|
4497
|
+
chunkPCW2KT7Z_js.replaceMasterViewElements(
|
|
4164
4498
|
masterView,
|
|
4165
4499
|
masterView.target,
|
|
4166
|
-
updater(
|
|
4500
|
+
updater(chunkPCW2KT7Z_js.masterViewElements(masterView, masterView.target))
|
|
4167
4501
|
)
|
|
4168
4502
|
);
|
|
4169
4503
|
return;
|
|
@@ -4216,7 +4550,7 @@ function useSectionOperations(input) {
|
|
|
4216
4550
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4217
4551
|
const addSection2 = react.useCallback(
|
|
4218
4552
|
(name, afterSlideIndex) => {
|
|
4219
|
-
const result =
|
|
4553
|
+
const result = chunkPCW2KT7Z_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4220
4554
|
setSlides(result.slides);
|
|
4221
4555
|
setSections(result.sections);
|
|
4222
4556
|
markDirty();
|
|
@@ -4225,7 +4559,7 @@ function useSectionOperations(input) {
|
|
|
4225
4559
|
);
|
|
4226
4560
|
const renameSection2 = react.useCallback(
|
|
4227
4561
|
(sectionId, newName) => {
|
|
4228
|
-
const result =
|
|
4562
|
+
const result = chunkPCW2KT7Z_js.renameSection(sections, slides, sectionId, newName);
|
|
4229
4563
|
setSections(result.sections);
|
|
4230
4564
|
setSlides(result.slides);
|
|
4231
4565
|
markDirty();
|
|
@@ -4234,7 +4568,7 @@ function useSectionOperations(input) {
|
|
|
4234
4568
|
);
|
|
4235
4569
|
const deleteSection2 = react.useCallback(
|
|
4236
4570
|
(sectionId) => {
|
|
4237
|
-
const result =
|
|
4571
|
+
const result = chunkPCW2KT7Z_js.deleteSection(sections, slides, sectionId);
|
|
4238
4572
|
setSections(result.sections);
|
|
4239
4573
|
setSlides(result.slides);
|
|
4240
4574
|
markDirty();
|
|
@@ -4243,21 +4577,21 @@ function useSectionOperations(input) {
|
|
|
4243
4577
|
);
|
|
4244
4578
|
const moveSectionUp2 = react.useCallback(
|
|
4245
4579
|
(sectionId) => {
|
|
4246
|
-
setSections(
|
|
4580
|
+
setSections(chunkPCW2KT7Z_js.moveSectionUp(sections, sectionId));
|
|
4247
4581
|
markDirty();
|
|
4248
4582
|
},
|
|
4249
4583
|
[sections, setSections, markDirty]
|
|
4250
4584
|
);
|
|
4251
4585
|
const moveSectionDown2 = react.useCallback(
|
|
4252
4586
|
(sectionId) => {
|
|
4253
|
-
setSections(
|
|
4587
|
+
setSections(chunkPCW2KT7Z_js.moveSectionDown(sections, sectionId));
|
|
4254
4588
|
markDirty();
|
|
4255
4589
|
},
|
|
4256
4590
|
[sections, setSections, markDirty]
|
|
4257
4591
|
);
|
|
4258
4592
|
const moveSlidesToSection2 = react.useCallback(
|
|
4259
4593
|
(slideIndexes, targetSectionId) => {
|
|
4260
|
-
const result =
|
|
4594
|
+
const result = chunkPCW2KT7Z_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4261
4595
|
setSlides(result.slides);
|
|
4262
4596
|
setSections(result.sections);
|
|
4263
4597
|
markDirty();
|
|
@@ -4284,18 +4618,54 @@ function useSectionOperations(input) {
|
|
|
4284
4618
|
};
|
|
4285
4619
|
}
|
|
4286
4620
|
|
|
4621
|
+
// src/viewer/utils/selection-handle-overlay.ts
|
|
4622
|
+
var VIEWPORT_SELECTOR = "[data-pptx-viewport]";
|
|
4623
|
+
function findSelectionHandleHost(elementNode, elementId) {
|
|
4624
|
+
const scope = elementNode.closest(VIEWPORT_SELECTOR) ?? elementNode.parentElement;
|
|
4625
|
+
if (!scope) {
|
|
4626
|
+
return null;
|
|
4627
|
+
}
|
|
4628
|
+
for (const candidate of scope.querySelectorAll("[data-pptx-handle-for]")) {
|
|
4629
|
+
if (candidate.getAttribute("data-pptx-handle-for") === elementId) {
|
|
4630
|
+
return candidate;
|
|
4631
|
+
}
|
|
4632
|
+
}
|
|
4633
|
+
return null;
|
|
4634
|
+
}
|
|
4635
|
+
function syncSelectionHandleOverlay(elementNode, elementId, geometry) {
|
|
4636
|
+
const host = findSelectionHandleHost(elementNode, elementId);
|
|
4637
|
+
if (!host) {
|
|
4638
|
+
return;
|
|
4639
|
+
}
|
|
4640
|
+
if (geometry.x !== void 0) {
|
|
4641
|
+
host.style.left = `${geometry.x}px`;
|
|
4642
|
+
}
|
|
4643
|
+
if (geometry.y !== void 0) {
|
|
4644
|
+
host.style.top = `${geometry.y}px`;
|
|
4645
|
+
}
|
|
4646
|
+
if (geometry.width !== void 0) {
|
|
4647
|
+
host.style.width = `${geometry.width}px`;
|
|
4648
|
+
}
|
|
4649
|
+
if (geometry.height !== void 0) {
|
|
4650
|
+
host.style.height = `${geometry.height}px`;
|
|
4651
|
+
}
|
|
4652
|
+
if (geometry.transform !== void 0) {
|
|
4653
|
+
host.style.transform = geometry.transform;
|
|
4654
|
+
}
|
|
4655
|
+
}
|
|
4656
|
+
|
|
4287
4657
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4288
4658
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx, lockAspect = false) {
|
|
4289
4659
|
const startBox = { x: startX, y: startY, width: startWidth, height: startHeight };
|
|
4290
|
-
let resized =
|
|
4660
|
+
let resized = chunkPCW2KT7Z_js.applyResize(startBox, handle, dx, dy, 1, { minSize: chunkXBTHWXNO_js.MIN_ELEMENT_SIZE });
|
|
4291
4661
|
if (lockAspect) {
|
|
4292
|
-
resized =
|
|
4662
|
+
resized = chunkPCW2KT7Z_js.lockResizeAspect(resized, startBox, handle, chunkXBTHWXNO_js.MIN_ELEMENT_SIZE);
|
|
4293
4663
|
}
|
|
4294
4664
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4295
4665
|
if (!snapToGrid) {
|
|
4296
4666
|
return box;
|
|
4297
4667
|
}
|
|
4298
|
-
return
|
|
4668
|
+
return chunkPCW2KT7Z_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkXBTHWXNO_js.MIN_ELEMENT_SIZE);
|
|
4299
4669
|
}
|
|
4300
4670
|
function resolveLiveTarget(input) {
|
|
4301
4671
|
const { livePatcher, editTemplateMode, activeSlide } = input;
|
|
@@ -4408,7 +4778,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4408
4778
|
width: el.width,
|
|
4409
4779
|
height: el.height
|
|
4410
4780
|
}));
|
|
4411
|
-
const snapResult =
|
|
4781
|
+
const snapResult = chunkPCW2KT7Z_js.computeSnapToShape(
|
|
4412
4782
|
targetX,
|
|
4413
4783
|
targetY,
|
|
4414
4784
|
primaryEl.width,
|
|
@@ -4440,14 +4810,17 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4440
4810
|
for (const [id, domEl] of drag.domEls) {
|
|
4441
4811
|
const start = drag.startPositionsById[id];
|
|
4442
4812
|
if (start) {
|
|
4443
|
-
|
|
4444
|
-
|
|
4813
|
+
const x = start.x + appliedDx;
|
|
4814
|
+
const y = start.y + appliedDy;
|
|
4815
|
+
domEl.style.left = `${x}px`;
|
|
4816
|
+
domEl.style.top = `${y}px`;
|
|
4817
|
+
syncSelectionHandleOverlay(domEl, id, { x, y });
|
|
4445
4818
|
}
|
|
4446
4819
|
}
|
|
4447
4820
|
if (live) {
|
|
4448
4821
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4449
4822
|
const start = drag.startPositionsById[id];
|
|
4450
|
-
|
|
4823
|
+
chunkPCW2KT7Z_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4451
4824
|
x: start.x + appliedDx,
|
|
4452
4825
|
y: start.y + appliedDy
|
|
4453
4826
|
});
|
|
@@ -4479,25 +4852,28 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4479
4852
|
rs.lastY = geo.y;
|
|
4480
4853
|
rs.lastWidth = geo.width;
|
|
4481
4854
|
rs.lastHeight = geo.height;
|
|
4855
|
+
const width = Math.max(geo.width, chunkXBTHWXNO_js.MIN_ELEMENT_SIZE);
|
|
4856
|
+
const height = Math.max(geo.height, chunkXBTHWXNO_js.MIN_ELEMENT_SIZE);
|
|
4482
4857
|
if (rs.domEl) {
|
|
4483
4858
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4484
4859
|
rs.domEl.style.top = `${geo.y}px`;
|
|
4485
|
-
rs.domEl.style.width = `${
|
|
4486
|
-
rs.domEl.style.height = `${
|
|
4860
|
+
rs.domEl.style.width = `${width}px`;
|
|
4861
|
+
rs.domEl.style.height = `${height}px`;
|
|
4862
|
+
syncSelectionHandleOverlay(rs.domEl, rs.elementId, { x: geo.x, y: geo.y, width, height });
|
|
4487
4863
|
}
|
|
4488
4864
|
if (live) {
|
|
4489
|
-
|
|
4865
|
+
chunkPCW2KT7Z_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4490
4866
|
x: geo.x,
|
|
4491
4867
|
y: geo.y,
|
|
4492
|
-
width
|
|
4493
|
-
height
|
|
4868
|
+
width,
|
|
4869
|
+
height
|
|
4494
4870
|
});
|
|
4495
4871
|
}
|
|
4496
4872
|
}
|
|
4497
4873
|
function processAdjustmentMove(e, adj, editorScale, updateElementById) {
|
|
4498
4874
|
const dx = (e.clientX - adj.startClientX) / editorScale;
|
|
4499
4875
|
const dy = (e.clientY - adj.startClientY) / editorScale;
|
|
4500
|
-
const adjustments =
|
|
4876
|
+
const adjustments = chunkPCW2KT7Z_js.getDraggedShapeAdjustments(adj, dx, dy);
|
|
4501
4877
|
if (!adj.moved && Math.hypot(dx, dy) > 2) {
|
|
4502
4878
|
adj.moved = true;
|
|
4503
4879
|
}
|
|
@@ -4572,13 +4948,13 @@ function processPointerUp(input) {
|
|
|
4572
4948
|
if (i !== activeSlideIndex) {
|
|
4573
4949
|
return s;
|
|
4574
4950
|
}
|
|
4575
|
-
const rerouted =
|
|
4951
|
+
const rerouted = chunkPCW2KT7Z_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4576
4952
|
if (rerouted.length === 0) {
|
|
4577
4953
|
return s;
|
|
4578
4954
|
}
|
|
4579
4955
|
return {
|
|
4580
4956
|
...s,
|
|
4581
|
-
elements:
|
|
4957
|
+
elements: chunkPCW2KT7Z_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4582
4958
|
};
|
|
4583
4959
|
})
|
|
4584
4960
|
);
|
|
@@ -4603,9 +4979,9 @@ function processPointerUp(input) {
|
|
|
4603
4979
|
}
|
|
4604
4980
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4605
4981
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4606
|
-
const hitIds =
|
|
4982
|
+
const hitIds = chunkPCW2KT7Z_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4607
4983
|
if (marquee.additive) {
|
|
4608
|
-
const merged =
|
|
4984
|
+
const merged = chunkPCW2KT7Z_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4609
4985
|
if (merged.length > 0) {
|
|
4610
4986
|
applySelection(merged[0], merged);
|
|
4611
4987
|
} else {
|
|
@@ -4628,8 +5004,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4628
5004
|
}
|
|
4629
5005
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4630
5006
|
});
|
|
4631
|
-
const rerouted =
|
|
4632
|
-
return
|
|
5007
|
+
const rerouted = chunkPCW2KT7Z_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
5008
|
+
return chunkPCW2KT7Z_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4633
5009
|
};
|
|
4634
5010
|
if (editTemplateMode) {
|
|
4635
5011
|
const slideId = activeSlide?.id;
|
|
@@ -4785,11 +5161,11 @@ function useCanvasInteractions(input) {
|
|
|
4785
5161
|
return;
|
|
4786
5162
|
}
|
|
4787
5163
|
const el = elementLookup.get(editId);
|
|
4788
|
-
if (el &&
|
|
5164
|
+
if (el && chunkPCW2KT7Z_js.hasTextProperties(el)) {
|
|
4789
5165
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
4790
|
-
const newSegments =
|
|
5166
|
+
const newSegments = chunkPCW2KT7Z_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
4791
5167
|
const editorEl = document.querySelector("[data-inline-editor]");
|
|
4792
|
-
const newHeight =
|
|
5168
|
+
const newHeight = chunkPCW2KT7Z_js.resolveInlineEditAutoFitHeight(el.textStyle, el.height, editorEl);
|
|
4793
5169
|
ops.updateElementById(editId, {
|
|
4794
5170
|
text: committedText,
|
|
4795
5171
|
textSegments: newSegments,
|
|
@@ -4801,7 +5177,7 @@ function useCanvasInteractions(input) {
|
|
|
4801
5177
|
setInlineEditingText("");
|
|
4802
5178
|
};
|
|
4803
5179
|
const openEquationEditorForElement = (el) => {
|
|
4804
|
-
if (!
|
|
5180
|
+
if (!chunkPCW2KT7Z_js.hasTextProperties(el)) {
|
|
4805
5181
|
return false;
|
|
4806
5182
|
}
|
|
4807
5183
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -4831,7 +5207,7 @@ function useCanvasInteractions(input) {
|
|
|
4831
5207
|
justInteractedRef.current = false;
|
|
4832
5208
|
} else {
|
|
4833
5209
|
const el = elementLookup.get(elementId);
|
|
4834
|
-
if (el &&
|
|
5210
|
+
if (el && chunkPCW2KT7Z_js.hasTextProperties(el) && chunkPCW2KT7Z_js.canInteractWithElement(el, "textEdit")) {
|
|
4835
5211
|
if (!openEquationEditorForElement(el)) {
|
|
4836
5212
|
setInlineEditingElementId(elementId);
|
|
4837
5213
|
setInlineEditingText(el.text ?? "");
|
|
@@ -4850,7 +5226,7 @@ function useCanvasInteractions(input) {
|
|
|
4850
5226
|
if (openEquationEditorForElement(el)) {
|
|
4851
5227
|
return;
|
|
4852
5228
|
}
|
|
4853
|
-
if (
|
|
5229
|
+
if (chunkPCW2KT7Z_js.hasTextProperties(el) && chunkPCW2KT7Z_js.canInteractWithElement(el, "textEdit")) {
|
|
4854
5230
|
setInlineEditingElementId(elementId);
|
|
4855
5231
|
setInlineEditingText(el.text ?? "");
|
|
4856
5232
|
}
|
|
@@ -4873,7 +5249,7 @@ function useCanvasInteractions(input) {
|
|
|
4873
5249
|
justSelectedRef.current = false;
|
|
4874
5250
|
}
|
|
4875
5251
|
const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
|
|
4876
|
-
const movableIds =
|
|
5252
|
+
const movableIds = chunkPCW2KT7Z_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
|
|
4877
5253
|
if (movableIds.length === 0) {
|
|
4878
5254
|
return;
|
|
4879
5255
|
}
|
|
@@ -4943,7 +5319,7 @@ function useCanvasInteractions(input) {
|
|
|
4943
5319
|
const handleResizePointerDown = (elementId, e, handle) => {
|
|
4944
5320
|
e.stopPropagation();
|
|
4945
5321
|
const el = elementLookup.get(elementId);
|
|
4946
|
-
if (!el || !
|
|
5322
|
+
if (!el || !chunkPCW2KT7Z_js.canInteractWithElement(el, "resize")) {
|
|
4947
5323
|
return;
|
|
4948
5324
|
}
|
|
4949
5325
|
resizeStateRef.current = {
|
|
@@ -4965,7 +5341,7 @@ function useCanvasInteractions(input) {
|
|
|
4965
5341
|
};
|
|
4966
5342
|
const handleRotate = (elementId, rotationDeg) => {
|
|
4967
5343
|
const el = elementLookup.get(elementId);
|
|
4968
|
-
if (!el || !
|
|
5344
|
+
if (!el || !chunkPCW2KT7Z_js.canInteractWithElement(el, "rotate")) {
|
|
4969
5345
|
return;
|
|
4970
5346
|
}
|
|
4971
5347
|
ops.updateElementById(elementId, { rotation: rotationDeg });
|
|
@@ -4985,10 +5361,10 @@ function useCanvasInteractions(input) {
|
|
|
4985
5361
|
const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
|
|
4986
5362
|
e.stopPropagation();
|
|
4987
5363
|
const el = elementLookup.get(elementId);
|
|
4988
|
-
if (!el || !
|
|
5364
|
+
if (!el || !chunkPCW2KT7Z_js.canInteractWithElement(el, "adjustHandle")) {
|
|
4989
5365
|
return;
|
|
4990
5366
|
}
|
|
4991
|
-
shapeAdjustmentDragStateRef.current =
|
|
5367
|
+
shapeAdjustmentDragStateRef.current = chunkPCW2KT7Z_js.beginShapeAdjustment(
|
|
4992
5368
|
el,
|
|
4993
5369
|
descriptor,
|
|
4994
5370
|
e.clientX,
|
|
@@ -5035,7 +5411,7 @@ function createFileHandlers(deps) {
|
|
|
5035
5411
|
h = Math.round(h * scale);
|
|
5036
5412
|
}
|
|
5037
5413
|
addElement({
|
|
5038
|
-
id:
|
|
5414
|
+
id: chunkPCW2KT7Z_js.generateElementId(),
|
|
5039
5415
|
type: "image",
|
|
5040
5416
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5041
5417
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5046,7 +5422,7 @@ function createFileHandlers(deps) {
|
|
|
5046
5422
|
};
|
|
5047
5423
|
img.onerror = () => {
|
|
5048
5424
|
addElement({
|
|
5049
|
-
id:
|
|
5425
|
+
id: chunkPCW2KT7Z_js.generateElementId(),
|
|
5050
5426
|
type: "image",
|
|
5051
5427
|
x: 100,
|
|
5052
5428
|
y: 100,
|
|
@@ -5065,14 +5441,14 @@ function createFileHandlers(deps) {
|
|
|
5065
5441
|
return;
|
|
5066
5442
|
}
|
|
5067
5443
|
e.target.value = "";
|
|
5068
|
-
const mediaType =
|
|
5444
|
+
const mediaType = chunkPCW2KT7Z_js.classifyMediaType(file.type);
|
|
5069
5445
|
if (!mediaType) {
|
|
5070
5446
|
return;
|
|
5071
5447
|
}
|
|
5072
5448
|
const elFilePath = file.path;
|
|
5073
5449
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5074
5450
|
addElement({
|
|
5075
|
-
id:
|
|
5451
|
+
id: chunkPCW2KT7Z_js.generateElementId(),
|
|
5076
5452
|
type: "media",
|
|
5077
5453
|
mediaType,
|
|
5078
5454
|
mediaMimeType: file.type || void 0,
|
|
@@ -5247,13 +5623,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5247
5623
|
return;
|
|
5248
5624
|
}
|
|
5249
5625
|
addElement({
|
|
5250
|
-
id:
|
|
5626
|
+
id: chunkPCW2KT7Z_js.generateElementId(),
|
|
5251
5627
|
type: "smartArt",
|
|
5252
5628
|
x: 100,
|
|
5253
5629
|
y: 120,
|
|
5254
5630
|
width: 600,
|
|
5255
5631
|
height: 340,
|
|
5256
|
-
smartArtData:
|
|
5632
|
+
smartArtData: chunkPCW2KT7Z_js.buildSmartArtPresetData(
|
|
5257
5633
|
layout,
|
|
5258
5634
|
defaultItems,
|
|
5259
5635
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5265,7 +5641,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5265
5641
|
return;
|
|
5266
5642
|
}
|
|
5267
5643
|
addElement({
|
|
5268
|
-
id:
|
|
5644
|
+
id: chunkPCW2KT7Z_js.generateElementId(),
|
|
5269
5645
|
type: "shape",
|
|
5270
5646
|
x: 120,
|
|
5271
5647
|
y: 200,
|
|
@@ -5303,7 +5679,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5303
5679
|
return;
|
|
5304
5680
|
}
|
|
5305
5681
|
const resolved = resolveHyperlinkEditResult(data);
|
|
5306
|
-
if (resolved.url && !
|
|
5682
|
+
if (resolved.url && !chunkPCW2KT7Z_js.isUrlSafe(resolved.url)) {
|
|
5307
5683
|
return;
|
|
5308
5684
|
}
|
|
5309
5685
|
const actionClick = {
|
|
@@ -5327,7 +5703,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5327
5703
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5328
5704
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5329
5705
|
addElement({
|
|
5330
|
-
id:
|
|
5706
|
+
id: chunkPCW2KT7Z_js.generateElementId(),
|
|
5331
5707
|
type: "shape",
|
|
5332
5708
|
x: 120,
|
|
5333
5709
|
y: 200,
|
|
@@ -5349,11 +5725,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5349
5725
|
if (!activeSlide) {
|
|
5350
5726
|
return;
|
|
5351
5727
|
}
|
|
5352
|
-
const preset =
|
|
5728
|
+
const preset = chunkPCW2KT7Z_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5353
5729
|
if (!preset) {
|
|
5354
5730
|
return;
|
|
5355
5731
|
}
|
|
5356
|
-
const defaultPptxAction =
|
|
5732
|
+
const defaultPptxAction = chunkPCW2KT7Z_js.elementActionToPptxAction({
|
|
5357
5733
|
trigger: "click",
|
|
5358
5734
|
type: preset.defaultAction
|
|
5359
5735
|
});
|
|
@@ -5362,7 +5738,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5362
5738
|
defaultPptxAction.highlightClick = true;
|
|
5363
5739
|
}
|
|
5364
5740
|
addElement({
|
|
5365
|
-
id:
|
|
5741
|
+
id: chunkPCW2KT7Z_js.generateElementId(),
|
|
5366
5742
|
type: "shape",
|
|
5367
5743
|
x: 150,
|
|
5368
5744
|
y: 150,
|
|
@@ -5429,14 +5805,14 @@ function useInsertElements(input) {
|
|
|
5429
5805
|
return;
|
|
5430
5806
|
}
|
|
5431
5807
|
addElement({
|
|
5432
|
-
id:
|
|
5808
|
+
id: chunkPCW2KT7Z_js.generateElementId(),
|
|
5433
5809
|
type: "text",
|
|
5434
5810
|
x: 100,
|
|
5435
5811
|
y: 100,
|
|
5436
5812
|
width: 300,
|
|
5437
5813
|
height: 60,
|
|
5438
5814
|
text: "",
|
|
5439
|
-
textStyle: { fontSize:
|
|
5815
|
+
textStyle: { fontSize: chunkXBTHWXNO_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5440
5816
|
});
|
|
5441
5817
|
};
|
|
5442
5818
|
const handleAddShape = () => {
|
|
@@ -5444,7 +5820,7 @@ function useInsertElements(input) {
|
|
|
5444
5820
|
return;
|
|
5445
5821
|
}
|
|
5446
5822
|
addElement({
|
|
5447
|
-
id:
|
|
5823
|
+
id: chunkPCW2KT7Z_js.generateElementId(),
|
|
5448
5824
|
type: "shape",
|
|
5449
5825
|
x: 150,
|
|
5450
5826
|
y: 150,
|
|
@@ -5463,15 +5839,15 @@ function useInsertElements(input) {
|
|
|
5463
5839
|
return;
|
|
5464
5840
|
}
|
|
5465
5841
|
addElement({
|
|
5466
|
-
...
|
|
5467
|
-
id:
|
|
5842
|
+
...chunkPCW2KT7Z_js.newTableElement(chunkXBTHWXNO_js.DEFAULT_TABLE_ROWS, chunkXBTHWXNO_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5843
|
+
id: chunkPCW2KT7Z_js.generateElementId()
|
|
5468
5844
|
});
|
|
5469
5845
|
};
|
|
5470
5846
|
const handleAddChart = (chartKind) => {
|
|
5471
5847
|
if (!activeSlide) {
|
|
5472
5848
|
return;
|
|
5473
5849
|
}
|
|
5474
|
-
addElement(
|
|
5850
|
+
addElement(chunkPCW2KT7Z_js.createDefaultChartElement(chartKind));
|
|
5475
5851
|
};
|
|
5476
5852
|
const structured = createStructuredElementHandlers({
|
|
5477
5853
|
activeSlide,
|
|
@@ -5541,7 +5917,7 @@ function useClipboardHandlers(input) {
|
|
|
5541
5917
|
if (!selectedElement) {
|
|
5542
5918
|
return;
|
|
5543
5919
|
}
|
|
5544
|
-
setClipboardPayload(
|
|
5920
|
+
setClipboardPayload(chunkPCW2KT7Z_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5545
5921
|
};
|
|
5546
5922
|
const handleDelete = () => {
|
|
5547
5923
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5558,7 +5934,7 @@ function useClipboardHandlers(input) {
|
|
|
5558
5934
|
handleDelete();
|
|
5559
5935
|
};
|
|
5560
5936
|
const insertClone = (source) => {
|
|
5561
|
-
const clone =
|
|
5937
|
+
const clone = chunkPCW2KT7Z_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5562
5938
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5563
5939
|
ops.applySelection(clone.id);
|
|
5564
5940
|
history.markDirty();
|
|
@@ -5593,7 +5969,7 @@ function resolveShapePath(el) {
|
|
|
5593
5969
|
return el.pathData;
|
|
5594
5970
|
}
|
|
5595
5971
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5596
|
-
const clipPath =
|
|
5972
|
+
const clipPath = chunkPCW2KT7Z_js.getPresetShapeClipPath(el.shapeType);
|
|
5597
5973
|
if (clipPath) {
|
|
5598
5974
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5599
5975
|
if (svgPath) {
|
|
@@ -5644,7 +6020,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5644
6020
|
return parts.join(" ");
|
|
5645
6021
|
}
|
|
5646
6022
|
function transformPathToGlobal(pathData, el) {
|
|
5647
|
-
const polys =
|
|
6023
|
+
const polys = chunkPCW2KT7Z_js.svgPathToPolygons(pathData);
|
|
5648
6024
|
if (polys.length === 0) {
|
|
5649
6025
|
return pathData;
|
|
5650
6026
|
}
|
|
@@ -5664,10 +6040,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5664
6040
|
y: pt.y * scaleY + el.y
|
|
5665
6041
|
}))
|
|
5666
6042
|
);
|
|
5667
|
-
return
|
|
6043
|
+
return chunkPCW2KT7Z_js.polygonsToSvgPath(transformed);
|
|
5668
6044
|
}
|
|
5669
6045
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5670
|
-
const polys =
|
|
6046
|
+
const polys = chunkPCW2KT7Z_js.svgPathToPolygons(pathData);
|
|
5671
6047
|
if (polys.length === 0) {
|
|
5672
6048
|
return pathData;
|
|
5673
6049
|
}
|
|
@@ -5677,10 +6053,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5677
6053
|
y: pt.y - y
|
|
5678
6054
|
}))
|
|
5679
6055
|
);
|
|
5680
|
-
return
|
|
6056
|
+
return chunkPCW2KT7Z_js.polygonsToSvgPath(transformed);
|
|
5681
6057
|
}
|
|
5682
6058
|
function pathBounds(pathData) {
|
|
5683
|
-
const polys =
|
|
6059
|
+
const polys = chunkPCW2KT7Z_js.svgPathToPolygons(pathData);
|
|
5684
6060
|
let minX = Infinity;
|
|
5685
6061
|
let minY = Infinity;
|
|
5686
6062
|
let maxX = -Infinity;
|
|
@@ -5739,7 +6115,7 @@ function useMergeShapesHandler(input) {
|
|
|
5739
6115
|
let allFragments = [];
|
|
5740
6116
|
let remaining = globalPaths[0];
|
|
5741
6117
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5742
|
-
const frags =
|
|
6118
|
+
const frags = chunkPCW2KT7Z_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
5743
6119
|
if (Array.isArray(frags)) {
|
|
5744
6120
|
allFragments = frags;
|
|
5745
6121
|
}
|
|
@@ -5768,7 +6144,7 @@ function useMergeShapesHandler(input) {
|
|
|
5768
6144
|
bounds.height
|
|
5769
6145
|
);
|
|
5770
6146
|
const newEl = {
|
|
5771
|
-
id:
|
|
6147
|
+
id: chunkPCW2KT7Z_js.generateElementId(),
|
|
5772
6148
|
type: "shape",
|
|
5773
6149
|
x: bounds.x,
|
|
5774
6150
|
y: bounds.y,
|
|
@@ -5806,7 +6182,7 @@ function useMergeShapesHandler(input) {
|
|
|
5806
6182
|
} else {
|
|
5807
6183
|
let resultPath = globalPaths[0];
|
|
5808
6184
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5809
|
-
const result =
|
|
6185
|
+
const result = chunkPCW2KT7Z_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
5810
6186
|
if (typeof result === "string") {
|
|
5811
6187
|
resultPath = result;
|
|
5812
6188
|
}
|
|
@@ -5827,7 +6203,7 @@ function useMergeShapesHandler(input) {
|
|
|
5827
6203
|
);
|
|
5828
6204
|
const primary = targets[0];
|
|
5829
6205
|
const newEl = {
|
|
5830
|
-
id:
|
|
6206
|
+
id: chunkPCW2KT7Z_js.generateElementId(),
|
|
5831
6207
|
type: "shape",
|
|
5832
6208
|
x: bounds.x,
|
|
5833
6209
|
y: bounds.y,
|
|
@@ -5890,7 +6266,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5890
6266
|
if (ids.length < 2 || !activeSlide) {
|
|
5891
6267
|
return;
|
|
5892
6268
|
}
|
|
5893
|
-
const { elements, groupId } =
|
|
6269
|
+
const { elements, groupId } = chunkPCW2KT7Z_js.groupElements(ops.activeElements, ids, chunkPCW2KT7Z_js.generateElementId());
|
|
5894
6270
|
if (groupId === null) {
|
|
5895
6271
|
return;
|
|
5896
6272
|
}
|
|
@@ -5903,11 +6279,11 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5903
6279
|
return;
|
|
5904
6280
|
}
|
|
5905
6281
|
const group = selectedElement;
|
|
5906
|
-
const intoTemplate =
|
|
6282
|
+
const intoTemplate = chunkPCW2KT7Z_js.isTemplateElementId(group.id);
|
|
5907
6283
|
const childIds = group.children.map(
|
|
5908
|
-
(child) => intoTemplate ?
|
|
6284
|
+
(child) => intoTemplate ? chunkPCW2KT7Z_js.makeCloneId(true, child.id || group.id) : child.id || chunkPCW2KT7Z_js.generateElementId()
|
|
5909
6285
|
);
|
|
5910
|
-
const { elements, childIds: usedIds } =
|
|
6286
|
+
const { elements, childIds: usedIds } = chunkPCW2KT7Z_js.ungroupElements(
|
|
5911
6287
|
ops.activeElements,
|
|
5912
6288
|
group.id,
|
|
5913
6289
|
childIds,
|
|
@@ -5936,7 +6312,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5936
6312
|
if (!edge) {
|
|
5937
6313
|
return;
|
|
5938
6314
|
}
|
|
5939
|
-
const positions =
|
|
6315
|
+
const positions = chunkPCW2KT7Z_js.alignElements(selectedElements, edge);
|
|
5940
6316
|
for (const [id, pos] of positions) {
|
|
5941
6317
|
const el = elementLookup.get(id);
|
|
5942
6318
|
if (!el) {
|
|
@@ -5954,7 +6330,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5954
6330
|
if (!distAxis) {
|
|
5955
6331
|
return;
|
|
5956
6332
|
}
|
|
5957
|
-
const positions =
|
|
6333
|
+
const positions = chunkPCW2KT7Z_js.distributeElements(selectedElements, distAxis);
|
|
5958
6334
|
for (const [id, pos] of positions) {
|
|
5959
6335
|
const el = elementLookup.get(id);
|
|
5960
6336
|
if (!el) {
|
|
@@ -5971,7 +6347,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5971
6347
|
}
|
|
5972
6348
|
const id = selectedElement.id;
|
|
5973
6349
|
ops.updateActiveElements(
|
|
5974
|
-
(els) => direction === "forward" ?
|
|
6350
|
+
(els) => direction === "forward" ? chunkPCW2KT7Z_js.bringForward(els, id) : direction === "backward" ? chunkPCW2KT7Z_js.sendBackward(els, id) : els
|
|
5975
6351
|
);
|
|
5976
6352
|
history.markDirty();
|
|
5977
6353
|
};
|
|
@@ -5981,7 +6357,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5981
6357
|
}
|
|
5982
6358
|
const id = selectedElement.id;
|
|
5983
6359
|
ops.updateActiveElements(
|
|
5984
|
-
(els) => direction === "front" ?
|
|
6360
|
+
(els) => direction === "front" ? chunkPCW2KT7Z_js.bringToFront(els, id) : chunkPCW2KT7Z_js.sendToBack(els, id)
|
|
5985
6361
|
);
|
|
5986
6362
|
history.markDirty();
|
|
5987
6363
|
};
|
|
@@ -6112,7 +6488,7 @@ function useSlideManagement(input) {
|
|
|
6112
6488
|
theme
|
|
6113
6489
|
} = input;
|
|
6114
6490
|
const handleAddSlide = () => {
|
|
6115
|
-
const newSlide =
|
|
6491
|
+
const newSlide = chunkPCW2KT7Z_js.createBlankSlide(slides.length + 1);
|
|
6116
6492
|
ops.updateSlides((prev) => {
|
|
6117
6493
|
const next = [...prev];
|
|
6118
6494
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6175,7 +6551,7 @@ function useSlideManagement(input) {
|
|
|
6175
6551
|
}
|
|
6176
6552
|
const clone = {
|
|
6177
6553
|
...src,
|
|
6178
|
-
id:
|
|
6554
|
+
id: chunkPCW2KT7Z_js.makeSlideId(),
|
|
6179
6555
|
elements: src.elements.map((el) => ({
|
|
6180
6556
|
...el,
|
|
6181
6557
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6207,7 +6583,7 @@ function useSlideManagement(input) {
|
|
|
6207
6583
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6208
6584
|
const insertAt = activeSlideIndex + 1;
|
|
6209
6585
|
const draft = {
|
|
6210
|
-
...
|
|
6586
|
+
...chunkPCW2KT7Z_js.createBlankSlide(slides.length + 1),
|
|
6211
6587
|
layoutPath,
|
|
6212
6588
|
...layoutName ? { layoutName } : {}
|
|
6213
6589
|
};
|
|
@@ -6240,9 +6616,9 @@ function useSlideManagement(input) {
|
|
|
6240
6616
|
};
|
|
6241
6617
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6242
6618
|
const insertAt = activeSlideIndex + 1;
|
|
6243
|
-
const draft =
|
|
6619
|
+
const draft = chunkPCW2KT7Z_js.buildSlideTemplateSlide(templateId, chunkPCW2KT7Z_js.makeSlideId(), slides.length + 1, {
|
|
6244
6620
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6245
|
-
scheme:
|
|
6621
|
+
scheme: chunkPCW2KT7Z_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6246
6622
|
});
|
|
6247
6623
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6248
6624
|
setActiveSlideIndex(insertAt);
|
|
@@ -6279,7 +6655,7 @@ function createTableMergeHandlers(input) {
|
|
|
6279
6655
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6280
6656
|
return;
|
|
6281
6657
|
}
|
|
6282
|
-
const newTableData =
|
|
6658
|
+
const newTableData = chunkPCW2KT7Z_js.mergeCells(
|
|
6283
6659
|
[
|
|
6284
6660
|
{ row: rowIndex, col: columnIndex },
|
|
6285
6661
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6287,7 +6663,7 @@ function createTableMergeHandlers(input) {
|
|
|
6287
6663
|
td
|
|
6288
6664
|
);
|
|
6289
6665
|
const updates = { tableData: newTableData };
|
|
6290
|
-
const newRawXml =
|
|
6666
|
+
const newRawXml = chunkPCW2KT7Z_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6291
6667
|
if (newRawXml) {
|
|
6292
6668
|
updates.rawXml = newRawXml;
|
|
6293
6669
|
}
|
|
@@ -6313,7 +6689,7 @@ function createTableMergeHandlers(input) {
|
|
|
6313
6689
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6314
6690
|
return;
|
|
6315
6691
|
}
|
|
6316
|
-
const newTableData =
|
|
6692
|
+
const newTableData = chunkPCW2KT7Z_js.mergeCells(
|
|
6317
6693
|
[
|
|
6318
6694
|
{ row: rowIndex, col: columnIndex },
|
|
6319
6695
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6321,7 +6697,7 @@ function createTableMergeHandlers(input) {
|
|
|
6321
6697
|
td
|
|
6322
6698
|
);
|
|
6323
6699
|
const updates = { tableData: newTableData };
|
|
6324
|
-
const newRawXml =
|
|
6700
|
+
const newRawXml = chunkPCW2KT7Z_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6325
6701
|
if (newRawXml) {
|
|
6326
6702
|
updates.rawXml = newRawXml;
|
|
6327
6703
|
}
|
|
@@ -6336,9 +6712,9 @@ function createTableMergeHandlers(input) {
|
|
|
6336
6712
|
return;
|
|
6337
6713
|
}
|
|
6338
6714
|
const td = selectedElement.tableData;
|
|
6339
|
-
const newTableData =
|
|
6715
|
+
const newTableData = chunkPCW2KT7Z_js.mergeCells(ts.selectedCells, td);
|
|
6340
6716
|
const updates = { tableData: newTableData };
|
|
6341
|
-
const newRawXml =
|
|
6717
|
+
const newRawXml = chunkPCW2KT7Z_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6342
6718
|
if (newRawXml) {
|
|
6343
6719
|
updates.rawXml = newRawXml;
|
|
6344
6720
|
}
|
|
@@ -6355,9 +6731,9 @@ function createTableMergeHandlers(input) {
|
|
|
6355
6731
|
}
|
|
6356
6732
|
const { rowIndex, columnIndex } = ts;
|
|
6357
6733
|
const td = selectedElement.tableData;
|
|
6358
|
-
const newTableData =
|
|
6734
|
+
const newTableData = chunkPCW2KT7Z_js.splitCell(rowIndex, columnIndex, td);
|
|
6359
6735
|
const updates = { tableData: newTableData };
|
|
6360
|
-
const newRawXml =
|
|
6736
|
+
const newRawXml = chunkPCW2KT7Z_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6361
6737
|
if (newRawXml) {
|
|
6362
6738
|
updates.rawXml = newRawXml;
|
|
6363
6739
|
}
|
|
@@ -6391,10 +6767,10 @@ function createTableStructHandlers(input) {
|
|
|
6391
6767
|
const text = transformCommittedText ? transformCommittedText(rawText) : rawText;
|
|
6392
6768
|
const updates = {};
|
|
6393
6769
|
if (el.tableData) {
|
|
6394
|
-
updates.tableData =
|
|
6770
|
+
updates.tableData = chunkPCW2KT7Z_js.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
6395
6771
|
}
|
|
6396
6772
|
if (el.rawXml) {
|
|
6397
|
-
const newRawXml =
|
|
6773
|
+
const newRawXml = chunkPCW2KT7Z_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6398
6774
|
if (newRawXml) {
|
|
6399
6775
|
updates.rawXml = newRawXml;
|
|
6400
6776
|
}
|
|
@@ -6418,7 +6794,7 @@ function createTableStructHandlers(input) {
|
|
|
6418
6794
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6419
6795
|
const updates = {};
|
|
6420
6796
|
if (selectedElement.rawXml) {
|
|
6421
|
-
const newRawXml =
|
|
6797
|
+
const newRawXml = chunkPCW2KT7Z_js.updateCellTextStyleInRawXml(
|
|
6422
6798
|
selectedElement,
|
|
6423
6799
|
rowIndex,
|
|
6424
6800
|
colIndex,
|
|
@@ -6482,9 +6858,9 @@ function createTableStructHandlers(input) {
|
|
|
6482
6858
|
return;
|
|
6483
6859
|
}
|
|
6484
6860
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6485
|
-
const newTableData =
|
|
6861
|
+
const newTableData = chunkPCW2KT7Z_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6486
6862
|
const updates = { tableData: newTableData };
|
|
6487
|
-
const newRawXml =
|
|
6863
|
+
const newRawXml = chunkPCW2KT7Z_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6488
6864
|
if (newRawXml) {
|
|
6489
6865
|
updates.rawXml = newRawXml;
|
|
6490
6866
|
}
|
|
@@ -6497,12 +6873,12 @@ function createTableStructHandlers(input) {
|
|
|
6497
6873
|
}
|
|
6498
6874
|
const td = selectedElement.tableData;
|
|
6499
6875
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6500
|
-
const newTableData =
|
|
6876
|
+
const newTableData = chunkPCW2KT7Z_js.deleteTableRow(td, rowIdx);
|
|
6501
6877
|
if (newTableData === td) {
|
|
6502
6878
|
return;
|
|
6503
6879
|
}
|
|
6504
6880
|
const updates = { tableData: newTableData };
|
|
6505
|
-
const newRawXml =
|
|
6881
|
+
const newRawXml = chunkPCW2KT7Z_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6506
6882
|
if (newRawXml) {
|
|
6507
6883
|
updates.rawXml = newRawXml;
|
|
6508
6884
|
}
|
|
@@ -6514,9 +6890,9 @@ function createTableStructHandlers(input) {
|
|
|
6514
6890
|
return;
|
|
6515
6891
|
}
|
|
6516
6892
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6517
|
-
const newTableData =
|
|
6893
|
+
const newTableData = chunkPCW2KT7Z_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6518
6894
|
const updates = { tableData: newTableData };
|
|
6519
|
-
const newRawXml =
|
|
6895
|
+
const newRawXml = chunkPCW2KT7Z_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6520
6896
|
if (newRawXml) {
|
|
6521
6897
|
updates.rawXml = newRawXml;
|
|
6522
6898
|
}
|
|
@@ -6529,12 +6905,12 @@ function createTableStructHandlers(input) {
|
|
|
6529
6905
|
}
|
|
6530
6906
|
const td = selectedElement.tableData;
|
|
6531
6907
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6532
|
-
const newTableData =
|
|
6908
|
+
const newTableData = chunkPCW2KT7Z_js.deleteTableColumn(td, colIdx);
|
|
6533
6909
|
if (newTableData === td) {
|
|
6534
6910
|
return;
|
|
6535
6911
|
}
|
|
6536
6912
|
const updates = { tableData: newTableData };
|
|
6537
|
-
const newRawXml =
|
|
6913
|
+
const newRawXml = chunkPCW2KT7Z_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6538
6914
|
if (newRawXml) {
|
|
6539
6915
|
updates.rawXml = newRawXml;
|
|
6540
6916
|
}
|
|
@@ -6570,8 +6946,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6570
6946
|
return html2canvasPro(element, {
|
|
6571
6947
|
...options,
|
|
6572
6948
|
onclone: async (doc, clonedEl) => {
|
|
6573
|
-
await
|
|
6574
|
-
|
|
6949
|
+
await chunkPCW2KT7Z_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6950
|
+
chunkPCW2KT7Z_js.preprocessCssForCapture(clonedEl);
|
|
6575
6951
|
if (typeof userOnClone === "function") {
|
|
6576
6952
|
userOnClone(doc, clonedEl);
|
|
6577
6953
|
}
|
|
@@ -6609,13 +6985,13 @@ function useExportSaveAs(input) {
|
|
|
6609
6985
|
if (!handler) {
|
|
6610
6986
|
return;
|
|
6611
6987
|
}
|
|
6612
|
-
const downloadName =
|
|
6988
|
+
const downloadName = chunkPCW2KT7Z_js.savedPresentationFileName(filePath, format);
|
|
6613
6989
|
try {
|
|
6614
6990
|
const data = await buildSaveAsData(handler, format);
|
|
6615
6991
|
const blob = new Blob([data], {
|
|
6616
6992
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
6617
6993
|
});
|
|
6618
|
-
|
|
6994
|
+
chunkPCW2KT7Z_js.downloadBlob(blob, downloadName);
|
|
6619
6995
|
} catch (err) {
|
|
6620
6996
|
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
6621
6997
|
}
|
|
@@ -6628,18 +7004,18 @@ function useExportSaveAs(input) {
|
|
|
6628
7004
|
const pptxGuides = guides.map((g) => ({
|
|
6629
7005
|
id: g.id,
|
|
6630
7006
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
6631
|
-
positionEmu:
|
|
7007
|
+
positionEmu: chunkPCW2KT7Z_js.guidePxToEmu(g.position)
|
|
6632
7008
|
}));
|
|
6633
7009
|
return {
|
|
6634
7010
|
...slide,
|
|
6635
7011
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
6636
7012
|
};
|
|
6637
7013
|
});
|
|
6638
|
-
const slidesToSave =
|
|
7014
|
+
const slidesToSave = chunkPCW2KT7Z_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
6639
7015
|
const saveOptions = {
|
|
6640
7016
|
// Save As shares Save's slide-size decision; leaving it out here is how
|
|
6641
7017
|
// a preset picked in the inspector reached one save path and not the other.
|
|
6642
|
-
slideSize:
|
|
7018
|
+
slideSize: chunkPCW2KT7Z_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
6643
7019
|
headerFooter,
|
|
6644
7020
|
presentationProperties,
|
|
6645
7021
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -6653,13 +7029,13 @@ function useExportSaveAs(input) {
|
|
|
6653
7029
|
handoutMaster,
|
|
6654
7030
|
outputFormat: format
|
|
6655
7031
|
};
|
|
6656
|
-
return
|
|
7032
|
+
return chunkPCW2KT7Z_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
|
|
6657
7033
|
};
|
|
6658
7034
|
const handleExportJson = () => {
|
|
6659
7035
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
6660
|
-
const slideSize =
|
|
7036
|
+
const slideSize = chunkPCW2KT7Z_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
6661
7037
|
const data = {
|
|
6662
|
-
slides:
|
|
7038
|
+
slides: chunkPCW2KT7Z_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
6663
7039
|
width: canvasSize.width,
|
|
6664
7040
|
height: canvasSize.height,
|
|
6665
7041
|
widthEmu: slideSize.widthEmu,
|
|
@@ -6678,7 +7054,7 @@ function useExportSaveAs(input) {
|
|
|
6678
7054
|
handoutMaster
|
|
6679
7055
|
};
|
|
6680
7056
|
try {
|
|
6681
|
-
|
|
7057
|
+
chunkPCW2KT7Z_js.exportDeckJson(data, sourceName);
|
|
6682
7058
|
} catch (err) {
|
|
6683
7059
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
6684
7060
|
}
|
|
@@ -6765,7 +7141,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
6765
7141
|
}
|
|
6766
7142
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
6767
7143
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
6768
|
-
|
|
7144
|
+
chunkPCW2KT7Z_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
6769
7145
|
}
|
|
6770
7146
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
6771
7147
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -6787,15 +7163,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6787
7163
|
continue;
|
|
6788
7164
|
}
|
|
6789
7165
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
6790
|
-
images.push(
|
|
7166
|
+
images.push(chunkPCW2KT7Z_js.canvasToJpegData(canvas));
|
|
6791
7167
|
}
|
|
6792
7168
|
onProgress?.(totalSlides, totalSlides);
|
|
6793
7169
|
setActiveSlide(currentSlideIndex);
|
|
6794
7170
|
if (images.length === 0) {
|
|
6795
|
-
throw new Error(
|
|
7171
|
+
throw new Error(chunkUNIJUD5C_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
6796
7172
|
}
|
|
6797
|
-
const pdfBlobUrl =
|
|
6798
|
-
|
|
7173
|
+
const pdfBlobUrl = chunkXBTHWXNO_js.buildPdfFromImageData(images);
|
|
7174
|
+
chunkPCW2KT7Z_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
6799
7175
|
}
|
|
6800
7176
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
6801
7177
|
const { scale = 2, onProgress } = options;
|
|
@@ -6841,10 +7217,10 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
6841
7217
|
onProgress?.(totalSlides, totalSlides);
|
|
6842
7218
|
setActiveSlide(currentSlideIndex);
|
|
6843
7219
|
if (pages.length === 0) {
|
|
6844
|
-
throw new Error(
|
|
7220
|
+
throw new Error(chunkUNIJUD5C_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
6845
7221
|
}
|
|
6846
|
-
const pdfDataUrl =
|
|
6847
|
-
|
|
7222
|
+
const pdfDataUrl = chunkXBTHWXNO_js.buildNotesPdf(pages);
|
|
7223
|
+
chunkPCW2KT7Z_js.downloadDataUrl(pdfDataUrl, filename);
|
|
6848
7224
|
}
|
|
6849
7225
|
|
|
6850
7226
|
// src/viewer/utils/export-video.ts
|
|
@@ -6875,7 +7251,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6875
7251
|
}
|
|
6876
7252
|
setActiveSlide(currentSlideIndex);
|
|
6877
7253
|
if (slideCanvases.length === 0) {
|
|
6878
|
-
throw new Error(
|
|
7254
|
+
throw new Error(chunkUNIJUD5C_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
|
|
6879
7255
|
}
|
|
6880
7256
|
const firstCanvas = slideCanvases[0];
|
|
6881
7257
|
const recordingCanvas = document.createElement("canvas");
|
|
@@ -6883,12 +7259,12 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6883
7259
|
recordingCanvas.height = firstCanvas.height;
|
|
6884
7260
|
const ctx = recordingCanvas.getContext("2d");
|
|
6885
7261
|
if (!ctx) {
|
|
6886
|
-
throw new Error(
|
|
7262
|
+
throw new Error(chunkUNIJUD5C_js.translationsEn["pptx.export.errorNo2dContext"]);
|
|
6887
7263
|
}
|
|
6888
7264
|
const fps = 30;
|
|
6889
7265
|
const stream = recordingCanvas.captureStream(fps);
|
|
6890
7266
|
const recorder = new MediaRecorder(stream, {
|
|
6891
|
-
mimeType:
|
|
7267
|
+
mimeType: chunkPCW2KT7Z_js.pickSupportedMimeType([...chunkPCW2KT7Z_js.WEBM_MIME_CANDIDATES]),
|
|
6892
7268
|
videoBitsPerSecond: 5e6
|
|
6893
7269
|
});
|
|
6894
7270
|
const chunks = [];
|
|
@@ -6911,8 +7287,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6911
7287
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
6912
7288
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
6913
7289
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
6914
|
-
const frameInterval =
|
|
6915
|
-
const framesNeeded =
|
|
7290
|
+
const frameInterval = chunkPCW2KT7Z_js.fpsToFrameIntervalMs(fps);
|
|
7291
|
+
const framesNeeded = chunkPCW2KT7Z_js.segmentFrameCount(duration, fps);
|
|
6916
7292
|
for (let f = 0; f < framesNeeded; f++) {
|
|
6917
7293
|
if (signal?.aborted) {
|
|
6918
7294
|
recorder.stop();
|
|
@@ -6959,9 +7335,9 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6959
7335
|
}
|
|
6960
7336
|
setActiveSlide(currentSlideIndex);
|
|
6961
7337
|
if (frames.length === 0) {
|
|
6962
|
-
throw new Error(
|
|
7338
|
+
throw new Error(chunkUNIJUD5C_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
6963
7339
|
}
|
|
6964
|
-
const gifBytes =
|
|
7340
|
+
const gifBytes = chunkPCW2KT7Z_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
6965
7341
|
onProgress?.(totalSlides, totalSlides);
|
|
6966
7342
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
6967
7343
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -7015,7 +7391,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
7015
7391
|
continue;
|
|
7016
7392
|
}
|
|
7017
7393
|
onProgress?.(processedCount, data.slides.length);
|
|
7018
|
-
let svg =
|
|
7394
|
+
let svg = chunkPCW2KT7Z_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
7019
7395
|
if (embedFonts && fontFaces?.length) {
|
|
7020
7396
|
svg = injectFontFaces(svg, fontFaces);
|
|
7021
7397
|
}
|
|
@@ -7124,21 +7500,21 @@ function useExportHandlers(input) {
|
|
|
7124
7500
|
{
|
|
7125
7501
|
scale: imageExportScale,
|
|
7126
7502
|
onProgress: (current, total) => {
|
|
7127
|
-
setExportProgress(
|
|
7128
|
-
setExportStatusMessage(
|
|
7503
|
+
setExportProgress(chunkPCW2KT7Z_js.slideProgressPercent(current, total));
|
|
7504
|
+
setExportStatusMessage(chunkPCW2KT7Z_js.slideStatusLabel("Rendering", current, total));
|
|
7129
7505
|
},
|
|
7130
7506
|
signal: abortCtrl.signal
|
|
7131
7507
|
}
|
|
7132
7508
|
);
|
|
7133
|
-
setExportProgress(
|
|
7509
|
+
setExportProgress(chunkPCW2KT7Z_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7134
7510
|
setExportStatusMessage("Building PDF...");
|
|
7135
7511
|
await new Promise((r) => {
|
|
7136
7512
|
setTimeout(r, 100);
|
|
7137
7513
|
});
|
|
7138
|
-
setExportProgress(
|
|
7514
|
+
setExportProgress(chunkPCW2KT7Z_js.EXPORT_DONE_PERCENT);
|
|
7139
7515
|
setExportStatusMessage("Done!");
|
|
7140
7516
|
} catch (err) {
|
|
7141
|
-
if (!
|
|
7517
|
+
if (!chunkPCW2KT7Z_js.isExportAbortError(err)) {
|
|
7142
7518
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7143
7519
|
}
|
|
7144
7520
|
} finally {
|
|
@@ -7168,21 +7544,21 @@ function useExportHandlers(input) {
|
|
|
7168
7544
|
{
|
|
7169
7545
|
scale: imageExportScale,
|
|
7170
7546
|
onProgress: (current, total) => {
|
|
7171
|
-
setExportProgress(
|
|
7172
|
-
setExportStatusMessage(
|
|
7547
|
+
setExportProgress(chunkPCW2KT7Z_js.slideProgressPercent(current, total));
|
|
7548
|
+
setExportStatusMessage(chunkPCW2KT7Z_js.slideStatusLabel("Rendering", current, total));
|
|
7173
7549
|
},
|
|
7174
7550
|
signal: abortCtrl.signal
|
|
7175
7551
|
}
|
|
7176
7552
|
);
|
|
7177
|
-
setExportProgress(
|
|
7553
|
+
setExportProgress(chunkPCW2KT7Z_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7178
7554
|
setExportStatusMessage("Building PDF...");
|
|
7179
7555
|
await new Promise((r) => {
|
|
7180
7556
|
setTimeout(r, 100);
|
|
7181
7557
|
});
|
|
7182
|
-
setExportProgress(
|
|
7558
|
+
setExportProgress(chunkPCW2KT7Z_js.EXPORT_DONE_PERCENT);
|
|
7183
7559
|
setExportStatusMessage("Done!");
|
|
7184
7560
|
} catch (err) {
|
|
7185
|
-
if (!
|
|
7561
|
+
if (!chunkPCW2KT7Z_js.isExportAbortError(err)) {
|
|
7186
7562
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7187
7563
|
}
|
|
7188
7564
|
} finally {
|
|
@@ -7224,22 +7600,22 @@ function useExportHandlers(input) {
|
|
|
7224
7600
|
scale: 1,
|
|
7225
7601
|
slideDurationMs: 3e3,
|
|
7226
7602
|
onProgress: (current, total) => {
|
|
7227
|
-
setExportProgress(
|
|
7228
|
-
setExportStatusMessage(
|
|
7603
|
+
setExportProgress(chunkPCW2KT7Z_js.slideProgressPercent(current, total, 45));
|
|
7604
|
+
setExportStatusMessage(chunkPCW2KT7Z_js.slideStatusLabel("Capturing", current, total));
|
|
7229
7605
|
},
|
|
7230
7606
|
onRecordProgress: (current, total) => {
|
|
7231
|
-
setExportProgress(
|
|
7232
|
-
setExportStatusMessage(
|
|
7607
|
+
setExportProgress(chunkPCW2KT7Z_js.recordProgressPercent(current, total));
|
|
7608
|
+
setExportStatusMessage(chunkPCW2KT7Z_js.slideStatusLabel("Recording", current, total));
|
|
7233
7609
|
},
|
|
7234
7610
|
signal: abortCtrl.signal
|
|
7235
7611
|
}
|
|
7236
7612
|
);
|
|
7237
|
-
setExportProgress(
|
|
7613
|
+
setExportProgress(chunkPCW2KT7Z_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7238
7614
|
setExportStatusMessage("Saving file...");
|
|
7239
|
-
|
|
7240
|
-
setExportProgress(
|
|
7615
|
+
chunkPCW2KT7Z_js.downloadBlob(blob, "presentation.webm");
|
|
7616
|
+
setExportProgress(chunkPCW2KT7Z_js.EXPORT_DONE_PERCENT);
|
|
7241
7617
|
} catch (err) {
|
|
7242
|
-
if (!
|
|
7618
|
+
if (!chunkPCW2KT7Z_js.isExportAbortError(err)) {
|
|
7243
7619
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7244
7620
|
}
|
|
7245
7621
|
} finally {
|
|
@@ -7267,18 +7643,18 @@ function useExportHandlers(input) {
|
|
|
7267
7643
|
scale: 0.5,
|
|
7268
7644
|
slideDurationMs: 2e3,
|
|
7269
7645
|
onProgress: (current, total) => {
|
|
7270
|
-
setExportProgress(
|
|
7271
|
-
setExportStatusMessage(
|
|
7646
|
+
setExportProgress(chunkPCW2KT7Z_js.slideProgressPercent(current, total));
|
|
7647
|
+
setExportStatusMessage(chunkPCW2KT7Z_js.slideStatusLabel("Encoding", current, total));
|
|
7272
7648
|
},
|
|
7273
7649
|
signal: abortCtrl.signal
|
|
7274
7650
|
}
|
|
7275
7651
|
);
|
|
7276
|
-
setExportProgress(
|
|
7652
|
+
setExportProgress(chunkPCW2KT7Z_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7277
7653
|
setExportStatusMessage("Saving file...");
|
|
7278
|
-
|
|
7279
|
-
setExportProgress(
|
|
7654
|
+
chunkPCW2KT7Z_js.downloadBlob(blob, "presentation.gif");
|
|
7655
|
+
setExportProgress(chunkPCW2KT7Z_js.EXPORT_DONE_PERCENT);
|
|
7280
7656
|
} catch (err) {
|
|
7281
|
-
if (!
|
|
7657
|
+
if (!chunkPCW2KT7Z_js.isExportAbortError(err)) {
|
|
7282
7658
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7283
7659
|
}
|
|
7284
7660
|
} finally {
|
|
@@ -7311,7 +7687,7 @@ function useExportHandlers(input) {
|
|
|
7311
7687
|
exportStatusMessage
|
|
7312
7688
|
};
|
|
7313
7689
|
}
|
|
7314
|
-
var ViewerOptionsContext = react.createContext(
|
|
7690
|
+
var ViewerOptionsContext = react.createContext(chunkPCW2KT7Z_js.DEFAULT_VIEWER_OPTIONS);
|
|
7315
7691
|
function useViewerOptionsContext() {
|
|
7316
7692
|
return react.useContext(ViewerOptionsContext);
|
|
7317
7693
|
}
|
|
@@ -7323,13 +7699,13 @@ function usePrintHandlers(input) {
|
|
|
7323
7699
|
const { t } = reactI18next.useTranslation();
|
|
7324
7700
|
const viewerOptions = useViewerOptionsContext();
|
|
7325
7701
|
const includeHiddenSlides = viewerOptions.advanced.printHiddenSlides;
|
|
7326
|
-
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) *
|
|
7702
|
+
const printRasterScale = (viewerOptions.advanced.printHighQuality ? 4 : 3) * chunkPCW2KT7Z_js.resolveImageResolutionScale(viewerOptions);
|
|
7327
7703
|
const handlePrint = () => {
|
|
7328
7704
|
setIsPrintDialogOpen(true);
|
|
7329
7705
|
};
|
|
7330
7706
|
const handlePrintSvg = async (settings) => {
|
|
7331
7707
|
setIsPrintDialogOpen(false);
|
|
7332
|
-
const printWindow =
|
|
7708
|
+
const printWindow = chunkPCW2KT7Z_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7333
7709
|
if (!printWindow) {
|
|
7334
7710
|
console.warn(
|
|
7335
7711
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7339,9 +7715,9 @@ function usePrintHandlers(input) {
|
|
|
7339
7715
|
if (!pptxData || settings.printWhat !== "slides") {
|
|
7340
7716
|
return runRasterPrint(printWindow, settings);
|
|
7341
7717
|
}
|
|
7342
|
-
const colorFilter =
|
|
7343
|
-
const slideIndices =
|
|
7344
|
-
|
|
7718
|
+
const colorFilter = chunkPCW2KT7Z_js.computeColorFilter(settings.colorMode);
|
|
7719
|
+
const slideIndices = chunkPCW2KT7Z_js.filterHiddenSlideIndices(
|
|
7720
|
+
chunkPCW2KT7Z_js.computeSlideIndices(
|
|
7345
7721
|
settings.slideRange,
|
|
7346
7722
|
activeSlideIndex,
|
|
7347
7723
|
slides.length,
|
|
@@ -7359,22 +7735,22 @@ function usePrintHandlers(input) {
|
|
|
7359
7735
|
printWindow.close();
|
|
7360
7736
|
return;
|
|
7361
7737
|
}
|
|
7362
|
-
const printDoc =
|
|
7738
|
+
const printDoc = chunkPCW2KT7Z_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7363
7739
|
title: "Slides (Vector)",
|
|
7364
7740
|
orientation: settings.orientation,
|
|
7365
7741
|
colorFilter,
|
|
7366
7742
|
scaleToFit: settings.scaleToFit
|
|
7367
7743
|
});
|
|
7368
|
-
|
|
7744
|
+
chunkPCW2KT7Z_js.finishPrintWindow(printWindow, printDoc);
|
|
7369
7745
|
} catch (err) {
|
|
7370
7746
|
console.warn("[PowerPointViewer] SVG print path failed, falling back to raster:", err);
|
|
7371
7747
|
return runRasterPrint(printWindow, settings);
|
|
7372
7748
|
}
|
|
7373
7749
|
};
|
|
7374
7750
|
const runRasterPrint = async (printWindow, settings) => {
|
|
7375
|
-
const colorFilter =
|
|
7376
|
-
const slideIndices =
|
|
7377
|
-
|
|
7751
|
+
const colorFilter = chunkPCW2KT7Z_js.computeColorFilter(settings.colorMode);
|
|
7752
|
+
const slideIndices = chunkPCW2KT7Z_js.filterHiddenSlideIndices(
|
|
7753
|
+
chunkPCW2KT7Z_js.computeSlideIndices(
|
|
7378
7754
|
settings.slideRange,
|
|
7379
7755
|
activeSlideIndex,
|
|
7380
7756
|
slides.length,
|
|
@@ -7385,11 +7761,11 @@ function usePrintHandlers(input) {
|
|
|
7385
7761
|
includeHiddenSlides
|
|
7386
7762
|
);
|
|
7387
7763
|
if (settings.printWhat === "outline") {
|
|
7388
|
-
|
|
7764
|
+
chunkPCW2KT7Z_js.finishPrintWindow(
|
|
7389
7765
|
printWindow,
|
|
7390
|
-
|
|
7766
|
+
chunkPCW2KT7Z_js.buildPrintHtmlDocument({
|
|
7391
7767
|
title: "Outline",
|
|
7392
|
-
bodyHtml: `<div class="outline-page">${
|
|
7768
|
+
bodyHtml: `<div class="outline-page">${chunkPCW2KT7Z_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7393
7769
|
orientation: settings.orientation,
|
|
7394
7770
|
colorFilter,
|
|
7395
7771
|
frameSlides: settings.frameSlides,
|
|
@@ -7416,11 +7792,11 @@ function usePrintHandlers(input) {
|
|
|
7416
7792
|
}
|
|
7417
7793
|
const slideImages = slideIndices.map((idx) => allImages[idx]).filter(Boolean);
|
|
7418
7794
|
if (settings.printWhat === "slides") {
|
|
7419
|
-
|
|
7795
|
+
chunkPCW2KT7Z_js.finishPrintWindow(
|
|
7420
7796
|
printWindow,
|
|
7421
|
-
|
|
7797
|
+
chunkPCW2KT7Z_js.buildPrintHtmlDocument({
|
|
7422
7798
|
title: "Slides",
|
|
7423
|
-
bodyHtml:
|
|
7799
|
+
bodyHtml: chunkPCW2KT7Z_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7424
7800
|
orientation: settings.orientation,
|
|
7425
7801
|
colorFilter,
|
|
7426
7802
|
frameSlides: settings.frameSlides,
|
|
@@ -7430,11 +7806,11 @@ function usePrintHandlers(input) {
|
|
|
7430
7806
|
return;
|
|
7431
7807
|
}
|
|
7432
7808
|
if (settings.printWhat === "notes") {
|
|
7433
|
-
|
|
7809
|
+
chunkPCW2KT7Z_js.finishPrintWindow(
|
|
7434
7810
|
printWindow,
|
|
7435
|
-
|
|
7811
|
+
chunkPCW2KT7Z_js.buildPrintHtmlDocument({
|
|
7436
7812
|
title: "Notes Pages",
|
|
7437
|
-
bodyHtml:
|
|
7813
|
+
bodyHtml: chunkPCW2KT7Z_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7438
7814
|
orientation: "portrait",
|
|
7439
7815
|
colorFilter,
|
|
7440
7816
|
frameSlides: settings.frameSlides,
|
|
@@ -7445,11 +7821,11 @@ function usePrintHandlers(input) {
|
|
|
7445
7821
|
}
|
|
7446
7822
|
if (settings.printWhat === "handouts") {
|
|
7447
7823
|
const spp = settings.slidesPerPage;
|
|
7448
|
-
|
|
7824
|
+
chunkPCW2KT7Z_js.finishPrintWindow(
|
|
7449
7825
|
printWindow,
|
|
7450
|
-
|
|
7826
|
+
chunkPCW2KT7Z_js.buildPrintHtmlDocument({
|
|
7451
7827
|
title: `Handout ${spp} per page`,
|
|
7452
|
-
bodyHtml:
|
|
7828
|
+
bodyHtml: chunkPCW2KT7Z_js.buildHandoutsHtml(slideImages, slideIndices, spp, pptxData?.handoutMaster),
|
|
7453
7829
|
orientation: "portrait",
|
|
7454
7830
|
colorFilter,
|
|
7455
7831
|
frameSlides: settings.frameSlides,
|
|
@@ -7463,7 +7839,7 @@ function usePrintHandlers(input) {
|
|
|
7463
7839
|
};
|
|
7464
7840
|
const handlePrintWithSettings = async (settings) => {
|
|
7465
7841
|
setIsPrintDialogOpen(false);
|
|
7466
|
-
const printWindow =
|
|
7842
|
+
const printWindow = chunkPCW2KT7Z_js.openPendingPrintWindow(t("pptx.print.preparingToPrint"));
|
|
7467
7843
|
if (!printWindow) {
|
|
7468
7844
|
console.warn(
|
|
7469
7845
|
"[PowerPointViewer] Print window was blocked by the browser. Allow popups for this site to print."
|
|
@@ -7526,8 +7902,8 @@ function useThemeHandlers(input) {
|
|
|
7526
7902
|
return;
|
|
7527
7903
|
}
|
|
7528
7904
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7529
|
-
const previousMap = theme?.colorScheme ?
|
|
7530
|
-
setSlides((prev) =>
|
|
7905
|
+
const previousMap = theme?.colorScheme ? chunkPCW2KT7Z_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7906
|
+
setSlides((prev) => chunkPCW2KT7Z_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7531
7907
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7532
7908
|
bumpHistory();
|
|
7533
7909
|
history.markDirty();
|
|
@@ -7632,7 +8008,7 @@ function useThemeSwitching(input) {
|
|
|
7632
8008
|
}
|
|
7633
8009
|
try {
|
|
7634
8010
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7635
|
-
const newData =
|
|
8011
|
+
const newData = chunkPCW2KT7Z_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7636
8012
|
onDataChange(newData);
|
|
7637
8013
|
onThemeChanged?.(preset);
|
|
7638
8014
|
} catch (error) {
|
|
@@ -7649,7 +8025,7 @@ function useThemeSwitching(input) {
|
|
|
7649
8025
|
}
|
|
7650
8026
|
try {
|
|
7651
8027
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7652
|
-
const newData =
|
|
8028
|
+
const newData = chunkPCW2KT7Z_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7653
8029
|
onDataChange(newData);
|
|
7654
8030
|
} catch (error) {
|
|
7655
8031
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7661,12 +8037,12 @@ function useThemeSwitching(input) {
|
|
|
7661
8037
|
if (!data?.theme?.colorScheme) {
|
|
7662
8038
|
return void 0;
|
|
7663
8039
|
}
|
|
7664
|
-
return
|
|
7665
|
-
(p) =>
|
|
8040
|
+
return chunkPCW2KT7Z_js.THEME_PRESETS.find(
|
|
8041
|
+
(p) => chunkPCW2KT7Z_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7666
8042
|
);
|
|
7667
8043
|
}, [data?.theme?.colorScheme]);
|
|
7668
8044
|
return {
|
|
7669
|
-
presets:
|
|
8045
|
+
presets: chunkPCW2KT7Z_js.THEME_PRESETS,
|
|
7670
8046
|
switchToPreset,
|
|
7671
8047
|
switchToCustom,
|
|
7672
8048
|
currentPreset
|
|
@@ -7741,7 +8117,7 @@ function usePropertyHandlers(input) {
|
|
|
7741
8117
|
}
|
|
7742
8118
|
try {
|
|
7743
8119
|
const ab = await file.arrayBuffer();
|
|
7744
|
-
const h = new
|
|
8120
|
+
const h = new chunkPCW2KT7Z_js.PptxHandler();
|
|
7745
8121
|
const other = await h.load(ab);
|
|
7746
8122
|
if (!other) {
|
|
7747
8123
|
return;
|
|
@@ -7751,7 +8127,7 @@ function usePropertyHandlers(input) {
|
|
|
7751
8127
|
width: canvasSize.width,
|
|
7752
8128
|
height: canvasSize.height
|
|
7753
8129
|
};
|
|
7754
|
-
setCompareResult(
|
|
8130
|
+
setCompareResult(chunkPCW2KT7Z_js.comparePresentation(cur, other));
|
|
7755
8131
|
setIsComparePanelOpen(true);
|
|
7756
8132
|
} catch (err) {
|
|
7757
8133
|
console.warn("Compare failed:", err);
|
|
@@ -7768,7 +8144,7 @@ function usePropertyHandlers(input) {
|
|
|
7768
8144
|
if (!diff || diff.status === "unchanged") {
|
|
7769
8145
|
return;
|
|
7770
8146
|
}
|
|
7771
|
-
setSlides((prev) =>
|
|
8147
|
+
setSlides((prev) => chunkPCW2KT7Z_js.applyAcceptSlide(prev, diff));
|
|
7772
8148
|
setIsDirty(true);
|
|
7773
8149
|
},
|
|
7774
8150
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -7779,10 +8155,10 @@ function usePropertyHandlers(input) {
|
|
|
7779
8155
|
if (!compareResult) {
|
|
7780
8156
|
return;
|
|
7781
8157
|
}
|
|
7782
|
-
setSlides((prev) =>
|
|
8158
|
+
setSlides((prev) => chunkPCW2KT7Z_js.applyAcceptAllSlides(prev, compareResult));
|
|
7783
8159
|
setIsDirty(true);
|
|
7784
8160
|
}, [compareResult, setSlides, setIsDirty]);
|
|
7785
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
8161
|
+
const usedFontFamilies = react.useMemo(() => chunkPCW2KT7Z_js.collectUsedFonts(slides), [slides]);
|
|
7786
8162
|
return {
|
|
7787
8163
|
handleUpdateNotes,
|
|
7788
8164
|
handleUpdateSlide,
|
|
@@ -7937,7 +8313,7 @@ function useViewerDialogs(input) {
|
|
|
7937
8313
|
);
|
|
7938
8314
|
const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
|
|
7939
8315
|
const fontEmbedding = react.useMemo(
|
|
7940
|
-
() =>
|
|
8316
|
+
() => chunkPCW2KT7Z_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
|
|
7941
8317
|
[embeddedFontKey]
|
|
7942
8318
|
);
|
|
7943
8319
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
|
|
@@ -7947,11 +8323,11 @@ function useViewerDialogs(input) {
|
|
|
7947
8323
|
setEmbedFontsEnabled(fontEmbedding.initialEnabled);
|
|
7948
8324
|
}
|
|
7949
8325
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
7950
|
-
() => typeof window !== "undefined" ?
|
|
8326
|
+
() => typeof window !== "undefined" ? chunkPCW2KT7Z_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
7951
8327
|
);
|
|
7952
8328
|
react.useEffect(() => {
|
|
7953
8329
|
const handleWindow = () => setIsNarrowViewport(
|
|
7954
|
-
|
|
8330
|
+
chunkPCW2KT7Z_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
7955
8331
|
);
|
|
7956
8332
|
window.addEventListener("resize", handleWindow);
|
|
7957
8333
|
return () => window.removeEventListener("resize", handleWindow);
|
|
@@ -8104,15 +8480,16 @@ function useViewerDialogs(input) {
|
|
|
8104
8480
|
};
|
|
8105
8481
|
}
|
|
8106
8482
|
function computeGridSpacingPx2(documentGridSpacing) {
|
|
8107
|
-
return
|
|
8483
|
+
return chunkPCW2KT7Z_js.computeGridSpacingPx(documentGridSpacing, chunkXBTHWXNO_js.GRID_SIZE);
|
|
8108
8484
|
}
|
|
8109
|
-
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8485
|
+
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows, presentationProperties) {
|
|
8110
8486
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8111
|
-
|
|
8487
|
+
const authoredRange = chunkPCW2KT7Z_js.resolveAuthoredSlideRange(presentationProperties, slides.length);
|
|
8488
|
+
return chunkPCW2KT7Z_js.resolveShowSlideIndexes(slides, activeShow, authoredRange);
|
|
8112
8489
|
}
|
|
8113
8490
|
function computeSlideSectionGroups(slides, sections) {
|
|
8114
|
-
return
|
|
8115
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8491
|
+
return chunkPCW2KT7Z_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8492
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkXBTHWXNO_js.UNGROUPED_SECTION_ID : chunkXBTHWXNO_js.DEFAULT_SECTION_GROUP_ID),
|
|
8116
8493
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8117
8494
|
slideIndexes: group.slideIndexes,
|
|
8118
8495
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8124,7 +8501,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
|
8124
8501
|
return void 0;
|
|
8125
8502
|
}
|
|
8126
8503
|
const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
|
|
8127
|
-
return
|
|
8504
|
+
return chunkPCW2KT7Z_js.masterViewPseudoSlide(document2, {
|
|
8128
8505
|
tab: "slides",
|
|
8129
8506
|
masterIndex: 0,
|
|
8130
8507
|
layoutIndex: activeLayout ? 0 : null
|
|
@@ -8137,6 +8514,7 @@ function useDerivedSlideState(input) {
|
|
|
8137
8514
|
sections,
|
|
8138
8515
|
customShows,
|
|
8139
8516
|
activeCustomShowId,
|
|
8517
|
+
presentationProperties,
|
|
8140
8518
|
mode,
|
|
8141
8519
|
activeLayout,
|
|
8142
8520
|
activeMaster,
|
|
@@ -8147,15 +8525,19 @@ function useDerivedSlideState(input) {
|
|
|
8147
8525
|
[documentGridSpacing]
|
|
8148
8526
|
);
|
|
8149
8527
|
const visibleSlideIndexes = react.useMemo(
|
|
8150
|
-
() => computeVisibleSlideIndexes(slides, activeCustomShowId, customShows),
|
|
8151
|
-
[slides, activeCustomShowId, customShows]
|
|
8528
|
+
() => computeVisibleSlideIndexes(slides, activeCustomShowId, customShows, presentationProperties),
|
|
8529
|
+
[slides, activeCustomShowId, customShows, presentationProperties]
|
|
8530
|
+
);
|
|
8531
|
+
const authoredRange = react.useMemo(
|
|
8532
|
+
() => chunkPCW2KT7Z_js.resolveAuthoredSlideRange(presentationProperties, slides.length),
|
|
8533
|
+
[presentationProperties, slides.length]
|
|
8152
8534
|
);
|
|
8153
8535
|
const slideSectionGroups = react.useMemo(
|
|
8154
8536
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8155
|
-
if (group.id ===
|
|
8537
|
+
if (group.id === chunkXBTHWXNO_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8156
8538
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8157
8539
|
}
|
|
8158
|
-
if (group.id ===
|
|
8540
|
+
if (group.id === chunkXBTHWXNO_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
8159
8541
|
return { ...group, label: t("pptx.sections.slides") };
|
|
8160
8542
|
}
|
|
8161
8543
|
return group;
|
|
@@ -8170,7 +8552,8 @@ function useDerivedSlideState(input) {
|
|
|
8170
8552
|
gridSpacingPx,
|
|
8171
8553
|
visibleSlideIndexes,
|
|
8172
8554
|
slideSectionGroups,
|
|
8173
|
-
masterPseudoSlide
|
|
8555
|
+
masterPseudoSlide,
|
|
8556
|
+
authoredRange
|
|
8174
8557
|
};
|
|
8175
8558
|
}
|
|
8176
8559
|
function useAnnotationHandlers(input) {
|
|
@@ -8255,13 +8638,13 @@ function useAnnotationHandlers(input) {
|
|
|
8255
8638
|
}, [annotations, setMode, setSlides, history]);
|
|
8256
8639
|
const handleSetMode = react.useCallback(
|
|
8257
8640
|
(nextMode) => {
|
|
8258
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8641
|
+
if (mode === "present" && nextMode !== "present" && !chunkPCW2KT7Z_js.mayLeaveSlideShow()) {
|
|
8259
8642
|
return;
|
|
8260
8643
|
}
|
|
8261
8644
|
if (nextMode === "present") {
|
|
8262
8645
|
presentation.enterPresentMode();
|
|
8263
8646
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8264
|
-
|
|
8647
|
+
chunkPCW2KT7Z_js.stopAllPersistentAudio();
|
|
8265
8648
|
if (promptKeepInkAnnotations) {
|
|
8266
8649
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8267
8650
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8271,7 +8654,7 @@ function useAnnotationHandlers(input) {
|
|
|
8271
8654
|
}
|
|
8272
8655
|
} else {
|
|
8273
8656
|
if (mode === "present") {
|
|
8274
|
-
|
|
8657
|
+
chunkPCW2KT7Z_js.stopAllPersistentAudio();
|
|
8275
8658
|
}
|
|
8276
8659
|
setMode(nextMode);
|
|
8277
8660
|
}
|
|
@@ -8308,6 +8691,7 @@ function useSerialize(input) {
|
|
|
8308
8691
|
guides,
|
|
8309
8692
|
headerFooter,
|
|
8310
8693
|
presentationProperties,
|
|
8694
|
+
viewProperties,
|
|
8311
8695
|
customShows,
|
|
8312
8696
|
sections,
|
|
8313
8697
|
coreProperties,
|
|
@@ -8335,13 +8719,13 @@ function useSerialize(input) {
|
|
|
8335
8719
|
let processedSlide = slide;
|
|
8336
8720
|
if (pendingEditId) {
|
|
8337
8721
|
const updatedElements = slide.elements.map((el) => {
|
|
8338
|
-
if (el.id !== pendingEditId || !
|
|
8722
|
+
if (el.id !== pendingEditId || !chunkPCW2KT7Z_js.hasTextProperties(el)) {
|
|
8339
8723
|
return el;
|
|
8340
8724
|
}
|
|
8341
8725
|
return {
|
|
8342
8726
|
...el,
|
|
8343
8727
|
text: pendingEditText,
|
|
8344
|
-
textSegments:
|
|
8728
|
+
textSegments: chunkPCW2KT7Z_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8345
8729
|
};
|
|
8346
8730
|
});
|
|
8347
8731
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8354,21 +8738,22 @@ function useSerialize(input) {
|
|
|
8354
8738
|
const pptxGuides = guides.map((g) => ({
|
|
8355
8739
|
id: g.id,
|
|
8356
8740
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8357
|
-
positionEmu:
|
|
8741
|
+
positionEmu: chunkPCW2KT7Z_js.guidePxToEmu(g.position)
|
|
8358
8742
|
}));
|
|
8359
8743
|
return {
|
|
8360
8744
|
...processedSlide,
|
|
8361
8745
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8362
8746
|
};
|
|
8363
8747
|
});
|
|
8364
|
-
const slidesToSave =
|
|
8748
|
+
const slidesToSave = chunkPCW2KT7Z_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8365
8749
|
const saveOptions = {
|
|
8366
8750
|
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
8367
8751
|
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
8368
8752
|
// slide-size edit reaches the file.
|
|
8369
|
-
slideSize:
|
|
8753
|
+
slideSize: chunkPCW2KT7Z_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
8370
8754
|
headerFooter,
|
|
8371
8755
|
presentationProperties,
|
|
8756
|
+
viewProperties,
|
|
8372
8757
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
8373
8758
|
sections: sections.length > 0 ? sections : void 0,
|
|
8374
8759
|
coreProperties,
|
|
@@ -8378,9 +8763,9 @@ function useSerialize(input) {
|
|
|
8378
8763
|
slideMasters,
|
|
8379
8764
|
notesMaster,
|
|
8380
8765
|
handoutMaster,
|
|
8381
|
-
...
|
|
8766
|
+
...chunkPCW2KT7Z_js.embeddedFontSaveOptions(embedFonts)
|
|
8382
8767
|
};
|
|
8383
|
-
return
|
|
8768
|
+
return chunkPCW2KT7Z_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
|
|
8384
8769
|
}, [
|
|
8385
8770
|
slides,
|
|
8386
8771
|
templateElementsBySlideId,
|
|
@@ -8388,6 +8773,7 @@ function useSerialize(input) {
|
|
|
8388
8773
|
slideSizeEmu,
|
|
8389
8774
|
headerFooter,
|
|
8390
8775
|
presentationProperties,
|
|
8776
|
+
viewProperties,
|
|
8391
8777
|
customShows,
|
|
8392
8778
|
sections,
|
|
8393
8779
|
coreProperties,
|
|
@@ -8415,7 +8801,7 @@ function useRecoveryDetection(input) {
|
|
|
8415
8801
|
const onRestore = input.onRestore;
|
|
8416
8802
|
const openVersionHistory = input.openVersionHistory;
|
|
8417
8803
|
react.useEffect(() => {
|
|
8418
|
-
if (!
|
|
8804
|
+
if (!chunkPCW2KT7Z_js.shouldProbeAutosaveRecovery({
|
|
8419
8805
|
alreadyChecked: recoveryCheckedRef.current,
|
|
8420
8806
|
filePath,
|
|
8421
8807
|
loading,
|
|
@@ -8427,7 +8813,7 @@ function useRecoveryDetection(input) {
|
|
|
8427
8813
|
}
|
|
8428
8814
|
recoveryCheckedRef.current = true;
|
|
8429
8815
|
void (async () => {
|
|
8430
|
-
const offer = await
|
|
8816
|
+
const offer = await chunkPCW2KT7Z_js.probeAutosaveRecovery(filePath);
|
|
8431
8817
|
if (!offer) {
|
|
8432
8818
|
return;
|
|
8433
8819
|
}
|
|
@@ -8440,7 +8826,7 @@ function useRecoveryDetection(input) {
|
|
|
8440
8826
|
const record = recordRef.current;
|
|
8441
8827
|
setPrompt(null);
|
|
8442
8828
|
if (record && onRestore) {
|
|
8443
|
-
onRestore(
|
|
8829
|
+
onRestore(chunkPCW2KT7Z_js.acceptAutosaveRecovery(record));
|
|
8444
8830
|
}
|
|
8445
8831
|
recordRef.current = null;
|
|
8446
8832
|
}, [onRestore]);
|
|
@@ -8449,7 +8835,7 @@ function useRecoveryDetection(input) {
|
|
|
8449
8835
|
setPrompt(null);
|
|
8450
8836
|
recordRef.current = null;
|
|
8451
8837
|
if (record) {
|
|
8452
|
-
void
|
|
8838
|
+
void chunkPCW2KT7Z_js.discardAutosaveRecovery(record);
|
|
8453
8839
|
}
|
|
8454
8840
|
}, []);
|
|
8455
8841
|
return { prompt, restore, discard };
|
|
@@ -8458,6 +8844,7 @@ function usePresentationSetup(input) {
|
|
|
8458
8844
|
const {
|
|
8459
8845
|
mode,
|
|
8460
8846
|
slides,
|
|
8847
|
+
templateElementsBySlideId,
|
|
8461
8848
|
visibleSlideIndexes,
|
|
8462
8849
|
activeSlideIndex,
|
|
8463
8850
|
containerRef,
|
|
@@ -8471,7 +8858,10 @@ function usePresentationSetup(input) {
|
|
|
8471
8858
|
endWithBlackSlide = true,
|
|
8472
8859
|
promptKeepInkAnnotations = true,
|
|
8473
8860
|
popupToolbarEnabled = true,
|
|
8474
|
-
onToggleSubtitles
|
|
8861
|
+
onToggleSubtitles,
|
|
8862
|
+
customShows = [],
|
|
8863
|
+
activeCustomShowId = null,
|
|
8864
|
+
onSetActiveCustomShowId
|
|
8475
8865
|
} = input;
|
|
8476
8866
|
const actionSoundHandlerRef = react.useRef(null);
|
|
8477
8867
|
const exitModeHandlerRef = react.useRef(null);
|
|
@@ -8483,16 +8873,17 @@ function usePresentationSetup(input) {
|
|
|
8483
8873
|
const presentation = usePresentationMode({
|
|
8484
8874
|
mode,
|
|
8485
8875
|
slides,
|
|
8876
|
+
templateElementsBySlideId,
|
|
8486
8877
|
visibleSlideIndexes,
|
|
8487
8878
|
activeSlideIndex,
|
|
8488
8879
|
containerRef,
|
|
8489
8880
|
content,
|
|
8490
8881
|
onSetMode: (nextMode) => {
|
|
8491
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8882
|
+
if (mode === "present" && nextMode !== "present" && !chunkPCW2KT7Z_js.mayLeaveSlideShow()) {
|
|
8492
8883
|
return;
|
|
8493
8884
|
}
|
|
8494
8885
|
if (mode === "present" && nextMode !== "present") {
|
|
8495
|
-
|
|
8886
|
+
chunkPCW2KT7Z_js.stopAllPersistentAudio();
|
|
8496
8887
|
stopAnimationSound();
|
|
8497
8888
|
const exitHandler = exitModeHandlerRef.current;
|
|
8498
8889
|
if (exitHandler) {
|
|
@@ -8554,13 +8945,16 @@ function usePresentationSetup(input) {
|
|
|
8554
8945
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8555
8946
|
onToggleSubtitles,
|
|
8556
8947
|
onSaveRehearsalTimings: (timings) => {
|
|
8557
|
-
setSlides((prev) =>
|
|
8948
|
+
setSlides((prev) => chunkPCW2KT7Z_js.applyRehearsalTimings(prev, timings));
|
|
8558
8949
|
history.markDirty();
|
|
8559
8950
|
},
|
|
8560
|
-
loopContinuously:
|
|
8951
|
+
loopContinuously: chunkPCW2KT7Z_js.shouldLoopContinuously(presentationProperties),
|
|
8561
8952
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8562
8953
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8563
|
-
endWithBlackSlide
|
|
8954
|
+
endWithBlackSlide,
|
|
8955
|
+
customShows,
|
|
8956
|
+
activeCustomShowId,
|
|
8957
|
+
onSetActiveCustomShowId
|
|
8564
8958
|
});
|
|
8565
8959
|
return {
|
|
8566
8960
|
presentation,
|
|
@@ -8758,7 +9152,7 @@ function useEditorOperations(input) {
|
|
|
8758
9152
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
8759
9153
|
react.useEffect(() => {
|
|
8760
9154
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
8761
|
-
copiedFormatRef.current =
|
|
9155
|
+
copiedFormatRef.current = chunkPCW2KT7Z_js.copyFormatFromElement(selectedElement);
|
|
8762
9156
|
} else if (!formatPainterActive) {
|
|
8763
9157
|
copiedFormatRef.current = null;
|
|
8764
9158
|
}
|
|
@@ -8784,12 +9178,12 @@ function useEditorOperations(input) {
|
|
|
8784
9178
|
e.stopPropagation();
|
|
8785
9179
|
const element = elementLookup.get(elementId);
|
|
8786
9180
|
if (element) {
|
|
8787
|
-
const updated =
|
|
9181
|
+
const updated = chunkPCW2KT7Z_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
8788
9182
|
const updates = {};
|
|
8789
|
-
if (
|
|
9183
|
+
if (chunkPCW2KT7Z_js.hasShapeProperties(updated)) {
|
|
8790
9184
|
updates.shapeStyle = updated.shapeStyle;
|
|
8791
9185
|
}
|
|
8792
|
-
if (
|
|
9186
|
+
if (chunkPCW2KT7Z_js.hasTextProperties(updated)) {
|
|
8793
9187
|
updates.textStyle = updated.textStyle;
|
|
8794
9188
|
}
|
|
8795
9189
|
ops.updateElementById(elementId, updates);
|
|
@@ -8975,10 +9369,10 @@ function useFontInjection({ embeddedFonts, slides }) {
|
|
|
8975
9369
|
}
|
|
8976
9370
|
};
|
|
8977
9371
|
}, [embeddedFonts]);
|
|
8978
|
-
const referencedFamilies = react.useMemo(() =>
|
|
9372
|
+
const referencedFamilies = react.useMemo(() => chunkPCW2KT7Z_js.collectReferencedFontFamilies(slides), [slides]);
|
|
8979
9373
|
react.useEffect(() => {
|
|
8980
9374
|
let cancelled = false;
|
|
8981
|
-
void
|
|
9375
|
+
void chunkPCW2KT7Z_js.resolveGoogleWebfontHref(slides, embeddedFonts).then((href) => {
|
|
8982
9376
|
if (cancelled) {
|
|
8983
9377
|
return null;
|
|
8984
9378
|
}
|
|
@@ -9044,7 +9438,9 @@ function useContentLifecycle(input) {
|
|
|
9044
9438
|
setIsEncryptedDialogOpen,
|
|
9045
9439
|
password,
|
|
9046
9440
|
onContentApplied,
|
|
9047
|
-
allowExternalImages
|
|
9441
|
+
allowExternalImages,
|
|
9442
|
+
setReadOnlyRecommendation,
|
|
9443
|
+
setCompatToasts
|
|
9048
9444
|
} = input;
|
|
9049
9445
|
const { handlerRef } = useLoadContent({
|
|
9050
9446
|
content,
|
|
@@ -9058,6 +9454,8 @@ function useContentLifecycle(input) {
|
|
|
9058
9454
|
setHeaderFooter: state.setHeaderFooter,
|
|
9059
9455
|
setLayoutOptions: state.setLayoutOptions,
|
|
9060
9456
|
setSlideMasters: state.setSlideMasters,
|
|
9457
|
+
setModernCommentAuthors: state.setModernCommentAuthors,
|
|
9458
|
+
setRecentColors: state.setRecentColors,
|
|
9061
9459
|
setTheme: state.setTheme,
|
|
9062
9460
|
setTableStyleMap: state.setTableStyleMap,
|
|
9063
9461
|
setThemeOptions: state.setThemeOptions,
|
|
@@ -9079,6 +9477,8 @@ function useContentLifecycle(input) {
|
|
|
9079
9477
|
setHasDigitalSignatures: state.setHasDigitalSignatures,
|
|
9080
9478
|
setDigitalSignatureCount: state.setDigitalSignatureCount,
|
|
9081
9479
|
setGuides: state.setGuides,
|
|
9480
|
+
setReadOnlyRecommendation,
|
|
9481
|
+
setCompatToasts,
|
|
9082
9482
|
setLoading: state.setLoading,
|
|
9083
9483
|
setError: state.setError,
|
|
9084
9484
|
setIsDirty: state.setIsDirty,
|
|
@@ -9099,6 +9499,7 @@ function useContentLifecycle(input) {
|
|
|
9099
9499
|
guides: state.guides,
|
|
9100
9500
|
headerFooter: state.headerFooter,
|
|
9101
9501
|
presentationProperties: state.presentationProperties,
|
|
9502
|
+
viewProperties: state.viewProperties,
|
|
9102
9503
|
customShows: state.customShows,
|
|
9103
9504
|
sections: state.sections,
|
|
9104
9505
|
coreProperties: state.coreProperties,
|
|
@@ -9154,7 +9555,17 @@ function useKeyboardShortcuts(input) {
|
|
|
9154
9555
|
inputRef.current = input;
|
|
9155
9556
|
const handleKeyDown = react.useCallback((e) => {
|
|
9156
9557
|
const current = inputRef.current;
|
|
9157
|
-
const
|
|
9558
|
+
const startAction = chunkPCW2KT7Z_js.mapSlideShowStartKey(e, { isPresenting: current.mode === "present" });
|
|
9559
|
+
if (startAction !== null) {
|
|
9560
|
+
e.preventDefault();
|
|
9561
|
+
if (startAction === "fromBeginning") {
|
|
9562
|
+
current.onStartShowFromBeginning();
|
|
9563
|
+
} else {
|
|
9564
|
+
current.onStartShowFromCurrent();
|
|
9565
|
+
}
|
|
9566
|
+
return;
|
|
9567
|
+
}
|
|
9568
|
+
const { action, dx, dy } = chunkPCW2KT7Z_js.mapEditorKey(e, {
|
|
9158
9569
|
canEdit: current.canEdit,
|
|
9159
9570
|
// The Slide Master view is an editing surface, not a viewing one.
|
|
9160
9571
|
// Gating on `mode !== 'edit'` alone made `mapEditorKey` return
|
|
@@ -9167,7 +9578,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9167
9578
|
hasSelection: current.hasSelection,
|
|
9168
9579
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9169
9580
|
isDrawing: current.activeTool !== "select",
|
|
9170
|
-
isTextInputTarget:
|
|
9581
|
+
isTextInputTarget: chunkPCW2KT7Z_js.isEditorTextInputTarget(e.target)
|
|
9171
9582
|
});
|
|
9172
9583
|
if (action === null) {
|
|
9173
9584
|
return;
|
|
@@ -9234,7 +9645,18 @@ function useKeyboardShortcuts(input) {
|
|
|
9234
9645
|
|
|
9235
9646
|
// src/viewer/hooks/useKeyboardShortcutWiring.ts
|
|
9236
9647
|
function useKeyboardShortcutWiring(input) {
|
|
9237
|
-
const {
|
|
9648
|
+
const {
|
|
9649
|
+
state,
|
|
9650
|
+
mode,
|
|
9651
|
+
canEdit,
|
|
9652
|
+
slides,
|
|
9653
|
+
activeSlide,
|
|
9654
|
+
ops,
|
|
9655
|
+
manipulation,
|
|
9656
|
+
history,
|
|
9657
|
+
onEnterPresentModeFromBeginning,
|
|
9658
|
+
onSetMode
|
|
9659
|
+
} = input;
|
|
9238
9660
|
useKeyboardShortcuts({
|
|
9239
9661
|
containerRef: state.containerRef,
|
|
9240
9662
|
mode,
|
|
@@ -9304,7 +9726,9 @@ function useKeyboardShortcutWiring(input) {
|
|
|
9304
9726
|
return;
|
|
9305
9727
|
}
|
|
9306
9728
|
state.setActiveSlideIndex((prev) => Math.min(slides.length - 1, prev + 1));
|
|
9307
|
-
}
|
|
9729
|
+
},
|
|
9730
|
+
onStartShowFromBeginning: onEnterPresentModeFromBeginning,
|
|
9731
|
+
onStartShowFromCurrent: () => onSetMode("present")
|
|
9308
9732
|
});
|
|
9309
9733
|
}
|
|
9310
9734
|
function useViewerIntegration(input) {
|
|
@@ -9324,6 +9748,8 @@ function useViewerIntegration(input) {
|
|
|
9324
9748
|
autosaveAllowed = true,
|
|
9325
9749
|
autosaveIntervalMs,
|
|
9326
9750
|
allowExternalImages,
|
|
9751
|
+
setReadOnlyRecommendation,
|
|
9752
|
+
setCompatToasts,
|
|
9327
9753
|
canEdit,
|
|
9328
9754
|
promptKeepInkAnnotations,
|
|
9329
9755
|
imageExportScale,
|
|
@@ -9392,7 +9818,9 @@ function useViewerIntegration(input) {
|
|
|
9392
9818
|
setIsEncryptedDialogOpen,
|
|
9393
9819
|
password: dialogs.presentationPassword ?? void 0,
|
|
9394
9820
|
onContentApplied: () => setLoadVersion((v) => v + 1),
|
|
9395
|
-
allowExternalImages
|
|
9821
|
+
allowExternalImages,
|
|
9822
|
+
setReadOnlyRecommendation,
|
|
9823
|
+
setCompatToasts
|
|
9396
9824
|
}
|
|
9397
9825
|
);
|
|
9398
9826
|
const { exportHandlers, printHandlers, themeHandlers, propertyHandlers } = useIOHandlers({
|
|
@@ -9478,7 +9906,7 @@ function useViewerIntegration(input) {
|
|
|
9478
9906
|
return zoom.scale;
|
|
9479
9907
|
},
|
|
9480
9908
|
setZoom(level) {
|
|
9481
|
-
zoom.setScale(
|
|
9909
|
+
zoom.setScale(chunkPCW2KT7Z_js.clampZoomScale(level));
|
|
9482
9910
|
},
|
|
9483
9911
|
zoomIn() {
|
|
9484
9912
|
zoom.handleZoomIn();
|
|
@@ -9627,7 +10055,9 @@ function useViewerIntegration(input) {
|
|
|
9627
10055
|
activeSlide,
|
|
9628
10056
|
ops: editorOps.ops,
|
|
9629
10057
|
manipulation: editorOps.manipulation,
|
|
9630
|
-
history
|
|
10058
|
+
history,
|
|
10059
|
+
onEnterPresentModeFromBeginning: presentation.enterPresentModeFromBeginning,
|
|
10060
|
+
onSetMode: handleSetMode
|
|
9631
10061
|
});
|
|
9632
10062
|
return {
|
|
9633
10063
|
exportHandlers,
|
|
@@ -9694,7 +10124,7 @@ function useReducedMotion() {
|
|
|
9694
10124
|
}
|
|
9695
10125
|
function useViewerOptions() {
|
|
9696
10126
|
const storeRef = react.useRef(null);
|
|
9697
|
-
storeRef.current ??=
|
|
10127
|
+
storeRef.current ??= chunkPCW2KT7Z_js.createViewerOptionsStore();
|
|
9698
10128
|
const store = storeRef.current;
|
|
9699
10129
|
const options = react.useSyncExternalStore(
|
|
9700
10130
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -9703,9 +10133,9 @@ function useViewerOptions() {
|
|
|
9703
10133
|
);
|
|
9704
10134
|
return { optionsStore: store, options };
|
|
9705
10135
|
}
|
|
9706
|
-
var KNOWN_TAB_IDS = new Set(
|
|
10136
|
+
var KNOWN_TAB_IDS = new Set(chunkPCW2KT7Z_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
9707
10137
|
function computeToolbarVisibility(hiddenActions, hiddenTabIds = []) {
|
|
9708
|
-
const isHidden = (id) =>
|
|
10138
|
+
const isHidden = (id) => chunkPCW2KT7Z_js.isActionHidden(id, hiddenActions);
|
|
9709
10139
|
const userHidden = new Set(hiddenTabIds);
|
|
9710
10140
|
userHidden.delete("file");
|
|
9711
10141
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id) && !userHidden.has(id);
|
|
@@ -9797,12 +10227,12 @@ function useYjsDocumentSync({
|
|
|
9797
10227
|
return;
|
|
9798
10228
|
}
|
|
9799
10229
|
try {
|
|
9800
|
-
const handler = new
|
|
10230
|
+
const handler = new chunkPCW2KT7Z_js.PptxHandler();
|
|
9801
10231
|
await handler.load(sourceBytes.buffer);
|
|
9802
|
-
const currentSlides =
|
|
10232
|
+
const currentSlides = chunkPCW2KT7Z_js.readSlidesFromYDoc(
|
|
9803
10233
|
doc
|
|
9804
10234
|
);
|
|
9805
|
-
const slidesToSave =
|
|
10235
|
+
const slidesToSave = chunkPCW2KT7Z_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
9806
10236
|
const bytes = await handler.save(slidesToSave);
|
|
9807
10237
|
config.onWriteBack(bytes);
|
|
9808
10238
|
} catch {
|
|
@@ -9817,10 +10247,10 @@ function useYjsDocumentSync({
|
|
|
9817
10247
|
if (!doc || !isConnected) {
|
|
9818
10248
|
return;
|
|
9819
10249
|
}
|
|
9820
|
-
const docSlides =
|
|
10250
|
+
const docSlides = chunkPCW2KT7Z_js.readSlidesFromYDoc(
|
|
9821
10251
|
doc
|
|
9822
10252
|
);
|
|
9823
|
-
if (!
|
|
10253
|
+
if (!chunkPCW2KT7Z_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
|
|
9824
10254
|
return;
|
|
9825
10255
|
}
|
|
9826
10256
|
lastSyncedRef.current = JSON.stringify(docSlides);
|
|
@@ -9839,11 +10269,11 @@ function useYjsDocumentSync({
|
|
|
9839
10269
|
lastSyncedRef.current = serialized;
|
|
9840
10270
|
void (async () => {
|
|
9841
10271
|
const factories = await getFactories();
|
|
9842
|
-
|
|
10272
|
+
chunkPCW2KT7Z_js.reconcileSlidesInYDoc(
|
|
9843
10273
|
slides,
|
|
9844
10274
|
doc,
|
|
9845
10275
|
factories,
|
|
9846
|
-
|
|
10276
|
+
chunkPCW2KT7Z_js.LOCAL_SYNC_ORIGIN
|
|
9847
10277
|
);
|
|
9848
10278
|
scheduleWriteBack();
|
|
9849
10279
|
})();
|
|
@@ -9857,10 +10287,10 @@ function useYjsDocumentSync({
|
|
|
9857
10287
|
return;
|
|
9858
10288
|
}
|
|
9859
10289
|
const handleChange = (_events, transaction) => {
|
|
9860
|
-
if (transaction?.origin ===
|
|
10290
|
+
if (transaction?.origin === chunkPCW2KT7Z_js.LOCAL_SYNC_ORIGIN) {
|
|
9861
10291
|
return;
|
|
9862
10292
|
}
|
|
9863
|
-
const remoteSlides =
|
|
10293
|
+
const remoteSlides = chunkPCW2KT7Z_js.readSlidesFromYDoc(
|
|
9864
10294
|
doc
|
|
9865
10295
|
);
|
|
9866
10296
|
if (remoteSlides.length === 0) {
|
|
@@ -9876,7 +10306,7 @@ function useYjsDocumentSync({
|
|
|
9876
10306
|
isApplyingRemoteRef.current = false;
|
|
9877
10307
|
scheduleWriteBack();
|
|
9878
10308
|
};
|
|
9879
|
-
const unobserve =
|
|
10309
|
+
const unobserve = chunkPCW2KT7Z_js.observeYDocSlides(
|
|
9880
10310
|
doc,
|
|
9881
10311
|
handleChange
|
|
9882
10312
|
);
|
|
@@ -9914,7 +10344,7 @@ function useBroadcastFollower({
|
|
|
9914
10344
|
if (!broadcaster) {
|
|
9915
10345
|
return;
|
|
9916
10346
|
}
|
|
9917
|
-
if (!
|
|
10347
|
+
if (!chunkPCW2KT7Z_js.shouldAutoFollowBroadcaster({
|
|
9918
10348
|
localRole: collab.config.role,
|
|
9919
10349
|
broadcasterRole: broadcaster.role
|
|
9920
10350
|
})) {
|
|
@@ -10085,7 +10515,7 @@ function subscribeTouchCapability(callback) {
|
|
|
10085
10515
|
function useIsMobile() {
|
|
10086
10516
|
const isTouchDevice = react.useSyncExternalStore(
|
|
10087
10517
|
subscribeTouchCapability,
|
|
10088
|
-
|
|
10518
|
+
chunkPCW2KT7Z_js.detectTouchDevice,
|
|
10089
10519
|
() => false
|
|
10090
10520
|
// server snapshot
|
|
10091
10521
|
);
|
|
@@ -10095,7 +10525,7 @@ function useIsMobile() {
|
|
|
10095
10525
|
const [viewportHeight, setViewportHeight] = react.useState(
|
|
10096
10526
|
() => typeof window === "undefined" ? 768 : window.innerHeight
|
|
10097
10527
|
);
|
|
10098
|
-
const [orientation, setOrientation] = react.useState(
|
|
10528
|
+
const [orientation, setOrientation] = react.useState(chunkPCW2KT7Z_js.detectOrientation);
|
|
10099
10529
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
10100
10530
|
const [initialViewportHeight] = react.useState(
|
|
10101
10531
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -10116,7 +10546,7 @@ function useIsMobile() {
|
|
|
10116
10546
|
return;
|
|
10117
10547
|
}
|
|
10118
10548
|
const handleOrientationChange = () => {
|
|
10119
|
-
setOrientation(
|
|
10549
|
+
setOrientation(chunkPCW2KT7Z_js.detectOrientation());
|
|
10120
10550
|
};
|
|
10121
10551
|
if (screen.orientation) {
|
|
10122
10552
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -10146,7 +10576,7 @@ function useIsMobile() {
|
|
|
10146
10576
|
window.addEventListener("resize", handleResize);
|
|
10147
10577
|
return () => window.removeEventListener("resize", handleResize);
|
|
10148
10578
|
}, [isTouchDevice, initialViewportHeight]);
|
|
10149
|
-
const { isMobile, isTablet, isDesktop } =
|
|
10579
|
+
const { isMobile, isTablet, isDesktop } = chunkPCW2KT7Z_js.deriveViewportBreakpoints(
|
|
10150
10580
|
viewportWidth,
|
|
10151
10581
|
viewportHeight,
|
|
10152
10582
|
isTouchDevice
|
|
@@ -10177,10 +10607,10 @@ function useTouchGestures(input) {
|
|
|
10177
10607
|
if (!el || !enabled) {
|
|
10178
10608
|
return;
|
|
10179
10609
|
}
|
|
10180
|
-
const recognizer =
|
|
10610
|
+
const recognizer = chunkPCW2KT7Z_js.createTouchGestureRecognizer({
|
|
10181
10611
|
getScale: () => scaleRef.current,
|
|
10182
|
-
minScale:
|
|
10183
|
-
maxScale:
|
|
10612
|
+
minScale: chunkPCW2KT7Z_js.MIN_ZOOM_SCALE,
|
|
10613
|
+
maxScale: chunkPCW2KT7Z_js.MAX_ZOOM_SCALE,
|
|
10184
10614
|
callbacks: {
|
|
10185
10615
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10186
10616
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10220,7 +10650,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10220
10650
|
return;
|
|
10221
10651
|
}
|
|
10222
10652
|
const rect = active.getBoundingClientRect();
|
|
10223
|
-
const delta =
|
|
10653
|
+
const delta = chunkPCW2KT7Z_js.computeScrollDelta(
|
|
10224
10654
|
{ top: rect.top, bottom: rect.bottom },
|
|
10225
10655
|
window.innerHeight,
|
|
10226
10656
|
keyboardInset
|
|
@@ -10240,8 +10670,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10240
10670
|
return;
|
|
10241
10671
|
}
|
|
10242
10672
|
const update = () => {
|
|
10243
|
-
const metrics =
|
|
10244
|
-
const inset = metrics ?
|
|
10673
|
+
const metrics = chunkPCW2KT7Z_js.readViewportMetrics(window);
|
|
10674
|
+
const inset = metrics ? chunkPCW2KT7Z_js.computeKeyboardInset(metrics) : 0;
|
|
10245
10675
|
setKeyboardInset(inset);
|
|
10246
10676
|
if (inset > 0) {
|
|
10247
10677
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10252,8 +10682,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10252
10682
|
vv.addEventListener("scroll", update);
|
|
10253
10683
|
const onFocusIn = () => {
|
|
10254
10684
|
window.requestAnimationFrame(() => {
|
|
10255
|
-
const metrics =
|
|
10256
|
-
const inset = metrics ?
|
|
10685
|
+
const metrics = chunkPCW2KT7Z_js.readViewportMetrics(window);
|
|
10686
|
+
const inset = metrics ? chunkPCW2KT7Z_js.computeKeyboardInset(metrics) : 0;
|
|
10257
10687
|
if (inset > 0) {
|
|
10258
10688
|
scrollFocusedIntoView(inset);
|
|
10259
10689
|
}
|
|
@@ -10266,7 +10696,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10266
10696
|
document.removeEventListener("focusin", onFocusIn);
|
|
10267
10697
|
};
|
|
10268
10698
|
}, [enabled]);
|
|
10269
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10699
|
+
return { keyboardInset, isKeyboardOpen: chunkPCW2KT7Z_js.isKeyboardOpen(keyboardInset) };
|
|
10270
10700
|
}
|
|
10271
10701
|
|
|
10272
10702
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10295,34 +10725,34 @@ function buildCanvasProps(input) {
|
|
|
10295
10725
|
} = input;
|
|
10296
10726
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10297
10727
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10298
|
-
const fieldContext =
|
|
10728
|
+
const fieldContext = chunkPCW2KT7Z_js.buildFieldSubstitutionContext({
|
|
10299
10729
|
headerFooter: s.headerFooter,
|
|
10300
10730
|
customProperties: s.customProperties,
|
|
10301
10731
|
slide: activeSlide
|
|
10302
10732
|
});
|
|
10303
10733
|
const tableStyleContext = s.theme || s.tableStyleMap ? { theme: s.theme, tableStyleMap: s.tableStyleMap } : void 0;
|
|
10304
10734
|
const openExternalUrl = (url) => {
|
|
10305
|
-
if (
|
|
10735
|
+
if (chunkPCW2KT7Z_js.shouldConfirmExternalHyperlink(viewerOptions, url) && !window.confirm(buildHyperlinkConfirmMessage(url))) {
|
|
10306
10736
|
return;
|
|
10307
10737
|
}
|
|
10308
|
-
|
|
10738
|
+
chunkPCW2KT7Z_js.safeOpenUrl(url);
|
|
10309
10739
|
};
|
|
10310
|
-
const handleActionClick = (
|
|
10740
|
+
const handleActionClick = (elementId, action) => {
|
|
10311
10741
|
if (mode === "present") {
|
|
10312
|
-
const resolved =
|
|
10742
|
+
const resolved = chunkPCW2KT7Z_js.resolvePresentationAction(action, { slideCount: slides.length });
|
|
10313
10743
|
if (resolved.intent.kind === "openUrl") {
|
|
10314
10744
|
openExternalUrl(resolved.intent.url);
|
|
10315
10745
|
return;
|
|
10316
10746
|
}
|
|
10317
|
-
presentation.handlePresentationAction(action);
|
|
10747
|
+
presentation.handlePresentationAction(action, elementId);
|
|
10318
10748
|
} else if (action.url) {
|
|
10319
10749
|
openExternalUrl(action.url);
|
|
10320
10750
|
}
|
|
10321
10751
|
};
|
|
10322
10752
|
const handleHyperlinkClick = (url) => {
|
|
10323
|
-
if (
|
|
10753
|
+
if (chunkPCW2KT7Z_js.isPpactionUrl(url)) {
|
|
10324
10754
|
if (mode === "present") {
|
|
10325
|
-
const parsed =
|
|
10755
|
+
const parsed = chunkPCW2KT7Z_js.parsePpactionUrl(url);
|
|
10326
10756
|
if (parsed) {
|
|
10327
10757
|
presentation.handlePresentationAction({
|
|
10328
10758
|
action: parsed.action,
|
|
@@ -10428,7 +10858,7 @@ function buildCanvasProps(input) {
|
|
|
10428
10858
|
|
|
10429
10859
|
// src/viewer/hooks/useScopedLayoutOptions.ts
|
|
10430
10860
|
function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
|
|
10431
|
-
return
|
|
10861
|
+
return chunkPCW2KT7Z_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
|
|
10432
10862
|
}
|
|
10433
10863
|
|
|
10434
10864
|
// src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
|
|
@@ -10441,7 +10871,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10441
10871
|
const current = activeSlide.animations ?? [];
|
|
10442
10872
|
if (group === "motionPath") {
|
|
10443
10873
|
propertyHandlers.handleUpdateSlide({
|
|
10444
|
-
animations:
|
|
10874
|
+
animations: chunkPCW2KT7Z_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10445
10875
|
});
|
|
10446
10876
|
return;
|
|
10447
10877
|
}
|
|
@@ -10523,7 +10953,8 @@ function buildToolbarProps(input) {
|
|
|
10523
10953
|
onOpenFile,
|
|
10524
10954
|
onOpenRecentFile,
|
|
10525
10955
|
fileName,
|
|
10526
|
-
hiddenActions
|
|
10956
|
+
hiddenActions,
|
|
10957
|
+
viewPreferencesSync
|
|
10527
10958
|
} = input;
|
|
10528
10959
|
const {
|
|
10529
10960
|
handleAddAnimation,
|
|
@@ -10607,9 +11038,9 @@ function buildToolbarProps(input) {
|
|
|
10607
11038
|
onSetSpellCheckEnabled: s.setSpellCheckEnabled,
|
|
10608
11039
|
onSetShowGrid: s.setShowGrid,
|
|
10609
11040
|
onSetShowRulers: s.setShowRulers,
|
|
10610
|
-
onSetShowGuides: s.setShowGuides,
|
|
10611
|
-
onSetSnapToGrid: s.setSnapToGrid,
|
|
10612
|
-
onSetSnapToShape: s.setSnapToShape,
|
|
11041
|
+
onSetShowGuides: viewPreferencesSync?.handleSetShowGuides ?? s.setShowGuides,
|
|
11042
|
+
onSetSnapToGrid: viewPreferencesSync?.handleSetSnapToGrid ?? s.setSnapToGrid,
|
|
11043
|
+
onSetSnapToShape: viewPreferencesSync?.handleSetSnapToShape ?? s.setSnapToShape,
|
|
10613
11044
|
onAddGuide: dialogs.handleAddGuide,
|
|
10614
11045
|
onAlignElements: manipulation.handleAlignElements,
|
|
10615
11046
|
onDistributeElements: manipulation.handleDistributeElements,
|
|
@@ -10635,7 +11066,7 @@ function buildToolbarProps(input) {
|
|
|
10635
11066
|
onOpenFile,
|
|
10636
11067
|
onOpenRecentFile,
|
|
10637
11068
|
onCreatePresentation: (templateId) => {
|
|
10638
|
-
s.setSlides(
|
|
11069
|
+
s.setSlides(chunkPCW2KT7Z_js.createBackstagePresentation(templateId));
|
|
10639
11070
|
s.setActiveSlideIndex(0);
|
|
10640
11071
|
s.setSelectedElementId(null);
|
|
10641
11072
|
s.setSelectedElementIds([]);
|
|
@@ -10664,7 +11095,7 @@ function buildToolbarProps(input) {
|
|
|
10664
11095
|
loadLayoutPreviews: input.loadLayoutPreviews,
|
|
10665
11096
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
10666
11097
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
10667
|
-
templateScheme:
|
|
11098
|
+
templateScheme: chunkPCW2KT7Z_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
10668
11099
|
customShows: s.customShows,
|
|
10669
11100
|
activeCustomShowId: s.activeCustomShowId,
|
|
10670
11101
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -10705,7 +11136,7 @@ function buildToolbarProps(input) {
|
|
|
10705
11136
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
10706
11137
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
10707
11138
|
formatPainterActive: s.formatPainterActive,
|
|
10708
|
-
canActivateFormatPainter:
|
|
11139
|
+
canActivateFormatPainter: chunkPCW2KT7Z_js.hasCopyableFormat(selectedElement),
|
|
10709
11140
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
10710
11141
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
10711
11142
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -10779,7 +11210,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
10779
11210
|
headerFooter: state.headerFooter,
|
|
10780
11211
|
loading,
|
|
10781
11212
|
error,
|
|
10782
|
-
maxHistoryEntries:
|
|
11213
|
+
maxHistoryEntries: chunkPCW2KT7Z_js.resolveHistoryDepth(viewerOptions),
|
|
10783
11214
|
hasActivePointerInteraction,
|
|
10784
11215
|
pointerCommitNonce: state.pointerCommitNonce,
|
|
10785
11216
|
setSlides: state.setSlides,
|
|
@@ -10796,6 +11227,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
10796
11227
|
sections: state.sections,
|
|
10797
11228
|
customShows: state.customShows,
|
|
10798
11229
|
activeCustomShowId: state.activeCustomShowId,
|
|
11230
|
+
presentationProperties: state.presentationProperties,
|
|
10799
11231
|
mode,
|
|
10800
11232
|
activeLayout: state.activeLayout,
|
|
10801
11233
|
activeMaster: state.activeMaster,
|
|
@@ -10804,6 +11236,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
10804
11236
|
const { presentation, annotations, actionSoundHandlerRef, setExitModeHandler } = usePresentationSetup({
|
|
10805
11237
|
mode,
|
|
10806
11238
|
slides,
|
|
11239
|
+
templateElementsBySlideId,
|
|
10807
11240
|
visibleSlideIndexes,
|
|
10808
11241
|
endWithBlackSlide: viewerOptions.advanced.slideShowEndWithBlackSlide,
|
|
10809
11242
|
// File > Options > Advanced > "Prompt to keep ink annotations when
|
|
@@ -10844,10 +11277,115 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
10844
11277
|
gridSpacingPx,
|
|
10845
11278
|
// Multiplied against the pre-existing 2x baseline; see the matching
|
|
10846
11279
|
// comment in `PowerPointViewer.tsx`.
|
|
10847
|
-
imageExportScale: 2 *
|
|
11280
|
+
imageExportScale: 2 * chunkPCW2KT7Z_js.resolveImageResolutionScale(viewerOptions),
|
|
10848
11281
|
viewerOptions
|
|
10849
11282
|
};
|
|
10850
11283
|
}
|
|
11284
|
+
function useCompatibilityToastsState() {
|
|
11285
|
+
const [toasts, setToasts] = react.useState([]);
|
|
11286
|
+
const dismiss = react.useCallback((id) => {
|
|
11287
|
+
setToasts((prev) => prev.filter((toast) => toast.id !== id));
|
|
11288
|
+
}, []);
|
|
11289
|
+
const dismissAll = react.useCallback(() => {
|
|
11290
|
+
setToasts([]);
|
|
11291
|
+
}, []);
|
|
11292
|
+
return { toasts, setToasts, dismiss, dismissAll };
|
|
11293
|
+
}
|
|
11294
|
+
function useReadOnlyRecommendationState(content) {
|
|
11295
|
+
const [recommendation, setRecommendation] = react.useState(
|
|
11296
|
+
() => chunkPCW2KT7Z_js.readOnlyRecommendation(void 0)
|
|
11297
|
+
);
|
|
11298
|
+
const [bannerHidden, setBannerHidden] = react.useState(false);
|
|
11299
|
+
const [editAnywayActive, setEditAnywayActive] = react.useState(false);
|
|
11300
|
+
react.useEffect(() => {
|
|
11301
|
+
setBannerHidden(false);
|
|
11302
|
+
setEditAnywayActive(false);
|
|
11303
|
+
}, [content]);
|
|
11304
|
+
const editAnyway = react.useCallback(() => {
|
|
11305
|
+
setEditAnywayActive(true);
|
|
11306
|
+
setBannerHidden(true);
|
|
11307
|
+
}, []);
|
|
11308
|
+
const dismiss = react.useCallback(() => {
|
|
11309
|
+
setBannerHidden(true);
|
|
11310
|
+
}, []);
|
|
11311
|
+
return {
|
|
11312
|
+
recommendation,
|
|
11313
|
+
setRecommendation,
|
|
11314
|
+
/** Whether the viewer's `canEdit` should be forced off. */
|
|
11315
|
+
locked: recommendation.defaultReadOnly && !editAnywayActive,
|
|
11316
|
+
bannerVisible: recommendation.kind !== null && !bannerHidden,
|
|
11317
|
+
editAnyway,
|
|
11318
|
+
dismiss
|
|
11319
|
+
};
|
|
11320
|
+
}
|
|
11321
|
+
function useViewPreferencesSync(input) {
|
|
11322
|
+
const {
|
|
11323
|
+
loadVersion,
|
|
11324
|
+
viewProperties,
|
|
11325
|
+
setViewProperties,
|
|
11326
|
+
snapToGrid,
|
|
11327
|
+
setSnapToGrid,
|
|
11328
|
+
snapToShape,
|
|
11329
|
+
setSnapToShape,
|
|
11330
|
+
showGuides,
|
|
11331
|
+
setShowGuides
|
|
11332
|
+
} = input;
|
|
11333
|
+
react.useEffect(() => {
|
|
11334
|
+
const seeded = chunkPCW2KT7Z_js.viewerPreferencesFromViewProperties(
|
|
11335
|
+
{ viewProperties },
|
|
11336
|
+
{ ...chunkPCW2KT7Z_js.DEFAULT_VIEWER_PREFERENCES, snapToGrid, snapToObjects: snapToShape, showGuides }
|
|
11337
|
+
);
|
|
11338
|
+
setSnapToGrid(seeded.snapToGrid);
|
|
11339
|
+
setSnapToShape(seeded.snapToObjects ?? snapToShape);
|
|
11340
|
+
setShowGuides(seeded.showGuides ?? showGuides);
|
|
11341
|
+
}, [loadVersion]);
|
|
11342
|
+
const patchViewProperties = react.useCallback(
|
|
11343
|
+
(prefsOverride) => {
|
|
11344
|
+
setViewProperties((prev) => {
|
|
11345
|
+
const merged = {
|
|
11346
|
+
...chunkPCW2KT7Z_js.DEFAULT_VIEWER_PREFERENCES,
|
|
11347
|
+
snapToGrid,
|
|
11348
|
+
snapToObjects: snapToShape,
|
|
11349
|
+
showGuides,
|
|
11350
|
+
gridSpacingCx: prev?.gridSpacing?.cx,
|
|
11351
|
+
gridSpacingCy: prev?.gridSpacing?.cy,
|
|
11352
|
+
...prefsOverride
|
|
11353
|
+
};
|
|
11354
|
+
const patch = chunkPCW2KT7Z_js.viewPropertiesPatchFromPreferences(merged);
|
|
11355
|
+
return {
|
|
11356
|
+
...prev,
|
|
11357
|
+
slideViewPr: { ...prev?.slideViewPr, ...patch.slideViewPr },
|
|
11358
|
+
...patch.gridSpacing ? { gridSpacing: patch.gridSpacing } : {}
|
|
11359
|
+
};
|
|
11360
|
+
});
|
|
11361
|
+
},
|
|
11362
|
+
[setViewProperties, snapToGrid, snapToShape, showGuides]
|
|
11363
|
+
);
|
|
11364
|
+
const handleSetSnapToGrid = react.useCallback(
|
|
11365
|
+
(value) => {
|
|
11366
|
+
setSnapToGrid(value);
|
|
11367
|
+
patchViewProperties({ snapToGrid: value });
|
|
11368
|
+
},
|
|
11369
|
+
[setSnapToGrid, patchViewProperties]
|
|
11370
|
+
);
|
|
11371
|
+
const handleSetSnapToShape = react.useCallback(
|
|
11372
|
+
(value) => {
|
|
11373
|
+
setSnapToShape(value);
|
|
11374
|
+
patchViewProperties({ snapToObjects: value });
|
|
11375
|
+
},
|
|
11376
|
+
[setSnapToShape, patchViewProperties]
|
|
11377
|
+
);
|
|
11378
|
+
const handleSetShowGuides = react.useCallback(
|
|
11379
|
+
(value) => {
|
|
11380
|
+
setShowGuides(value);
|
|
11381
|
+
patchViewProperties({ showGuides: value });
|
|
11382
|
+
},
|
|
11383
|
+
[setShowGuides, patchViewProperties]
|
|
11384
|
+
);
|
|
11385
|
+
return { handleSetSnapToGrid, handleSetSnapToShape, handleSetShowGuides };
|
|
11386
|
+
}
|
|
11387
|
+
|
|
11388
|
+
// src/viewer/hooks/useViewerBuildingBlocksState.ts
|
|
10851
11389
|
function useViewerBuildingBlocksState(input) {
|
|
10852
11390
|
const { core, content, canEdit, filePath, autosaveEnabled, userName, handle, setContent } = input;
|
|
10853
11391
|
const {
|
|
@@ -10903,6 +11441,8 @@ function useViewerBuildingBlocksState(input) {
|
|
|
10903
11441
|
isDirty: state.isDirty,
|
|
10904
11442
|
history
|
|
10905
11443
|
});
|
|
11444
|
+
const readOnlyRec = useReadOnlyRecommendationState(content);
|
|
11445
|
+
const compatToastsState = useCompatibilityToastsState();
|
|
10906
11446
|
react.useEffect(() => {
|
|
10907
11447
|
state.setSelectedElementId(null);
|
|
10908
11448
|
state.setSelectedElementIds([]);
|
|
@@ -10933,7 +11473,8 @@ function useViewerBuildingBlocksState(input) {
|
|
|
10933
11473
|
handleSetMode,
|
|
10934
11474
|
handleEnterPresenterView,
|
|
10935
11475
|
handleEnterRehearsalMode,
|
|
10936
|
-
autosaveStatus
|
|
11476
|
+
autosaveStatus,
|
|
11477
|
+
loadVersion
|
|
10937
11478
|
} = useViewerIntegration({
|
|
10938
11479
|
state,
|
|
10939
11480
|
zoom,
|
|
@@ -10951,6 +11492,8 @@ function useViewerBuildingBlocksState(input) {
|
|
|
10951
11492
|
// applies, so the headless building-blocks API loads http(s) images
|
|
10952
11493
|
// under the same default-off, core-side SSRF/privacy guard.
|
|
10953
11494
|
allowExternalImages: viewerOptions.trust.allowExternalContent,
|
|
11495
|
+
setReadOnlyRecommendation: readOnlyRec.setRecommendation,
|
|
11496
|
+
setCompatToasts: compatToastsState.setToasts,
|
|
10954
11497
|
canEdit,
|
|
10955
11498
|
promptKeepInkAnnotations: viewerOptions.advanced.slideShowPromptKeepInkAnnotations,
|
|
10956
11499
|
imageExportScale,
|
|
@@ -10972,6 +11515,17 @@ function useViewerBuildingBlocksState(input) {
|
|
|
10972
11515
|
onSlideCountChange
|
|
10973
11516
|
});
|
|
10974
11517
|
setExitModeHandler(handleSetMode);
|
|
11518
|
+
const viewPreferencesSync = useViewPreferencesSync({
|
|
11519
|
+
loadVersion,
|
|
11520
|
+
viewProperties: state.viewProperties,
|
|
11521
|
+
setViewProperties: state.setViewProperties,
|
|
11522
|
+
snapToGrid: state.snapToGrid,
|
|
11523
|
+
setSnapToGrid: state.setSnapToGrid,
|
|
11524
|
+
snapToShape: state.snapToShape,
|
|
11525
|
+
setSnapToShape: state.setSnapToShape,
|
|
11526
|
+
showGuides: state.showGuides,
|
|
11527
|
+
setShowGuides: state.setShowGuides
|
|
11528
|
+
});
|
|
10975
11529
|
return {
|
|
10976
11530
|
dialogs,
|
|
10977
11531
|
editorOps,
|
|
@@ -10981,7 +11535,8 @@ function useViewerBuildingBlocksState(input) {
|
|
|
10981
11535
|
handleSetMode,
|
|
10982
11536
|
handleEnterPresenterView,
|
|
10983
11537
|
handleEnterRehearsalMode,
|
|
10984
|
-
autosaveStatus
|
|
11538
|
+
autosaveStatus,
|
|
11539
|
+
viewPreferencesSync
|
|
10985
11540
|
};
|
|
10986
11541
|
}
|
|
10987
11542
|
|
|
@@ -11014,7 +11569,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11014
11569
|
}, [incomingContent]);
|
|
11015
11570
|
const onOpenFile = react.useCallback(() => {
|
|
11016
11571
|
void (async () => {
|
|
11017
|
-
const picked = await
|
|
11572
|
+
const picked = await chunkPCW2KT7Z_js.openPptxFile();
|
|
11018
11573
|
if (picked) {
|
|
11019
11574
|
setContent(picked.buffer);
|
|
11020
11575
|
}
|
|
@@ -11022,7 +11577,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11022
11577
|
}, []);
|
|
11023
11578
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11024
11579
|
void (async () => {
|
|
11025
|
-
const bytes = await
|
|
11580
|
+
const bytes = await chunkPCW2KT7Z_js.readBackstageRecentFile(key);
|
|
11026
11581
|
if (bytes) {
|
|
11027
11582
|
setContent(bytes);
|
|
11028
11583
|
}
|
|
@@ -11054,7 +11609,8 @@ function useViewerBuildingBlocks(input) {
|
|
|
11054
11609
|
handleSetMode,
|
|
11055
11610
|
handleEnterPresenterView,
|
|
11056
11611
|
handleEnterRehearsalMode,
|
|
11057
|
-
autosaveStatus
|
|
11612
|
+
autosaveStatus,
|
|
11613
|
+
viewPreferencesSync
|
|
11058
11614
|
} = useViewerBuildingBlocksState({
|
|
11059
11615
|
core,
|
|
11060
11616
|
content,
|
|
@@ -11099,7 +11655,8 @@ function useViewerBuildingBlocks(input) {
|
|
|
11099
11655
|
onOpenFile,
|
|
11100
11656
|
onOpenRecentFile,
|
|
11101
11657
|
fileName,
|
|
11102
|
-
hiddenActions
|
|
11658
|
+
hiddenActions,
|
|
11659
|
+
viewPreferencesSync
|
|
11103
11660
|
});
|
|
11104
11661
|
const canvasProps = buildCanvasProps({
|
|
11105
11662
|
mode,
|
|
@@ -11207,7 +11764,9 @@ exports.parseAudienceNonce = parseAudienceNonce;
|
|
|
11207
11764
|
exports.parseEmailUrl = parseEmailUrl;
|
|
11208
11765
|
exports.parseSlideFromUrl = parseSlideFromUrl;
|
|
11209
11766
|
exports.renderToCanvas = renderToCanvas;
|
|
11767
|
+
exports.safePrompt = safePrompt;
|
|
11210
11768
|
exports.scopeLayoutOptionsToActiveSlide = scopeLayoutOptionsToActiveSlide;
|
|
11769
|
+
exports.syncSelectionHandleOverlay = syncSelectionHandleOverlay;
|
|
11211
11770
|
exports.useAnimationPlayback = useAnimationPlayback;
|
|
11212
11771
|
exports.useAnnotationHandlers = useAnnotationHandlers;
|
|
11213
11772
|
exports.useAudienceMode = useAudienceMode;
|
|
@@ -11219,6 +11778,7 @@ exports.useCollaborationLivePatch = useCollaborationLivePatch;
|
|
|
11219
11778
|
exports.useCollaborativeHistory = useCollaborativeHistory;
|
|
11220
11779
|
exports.useCollaborativeState = useCollaborativeState;
|
|
11221
11780
|
exports.useComments = useComments;
|
|
11781
|
+
exports.useCompatibilityToastsState = useCompatibilityToastsState;
|
|
11222
11782
|
exports.useContentLifecycle = useContentLifecycle;
|
|
11223
11783
|
exports.useDerivedElementState = useDerivedElementState;
|
|
11224
11784
|
exports.useDerivedSlideState = useDerivedSlideState;
|
|
@@ -11252,6 +11812,7 @@ exports.usePresentationSetup = usePresentationSetup;
|
|
|
11252
11812
|
exports.usePresenterWindow = usePresenterWindow;
|
|
11253
11813
|
exports.usePrintHandlers = usePrintHandlers;
|
|
11254
11814
|
exports.usePropertyHandlers = usePropertyHandlers;
|
|
11815
|
+
exports.useReadOnlyRecommendationState = useReadOnlyRecommendationState;
|
|
11255
11816
|
exports.useRecoveryDetection = useRecoveryDetection;
|
|
11256
11817
|
exports.useReducedMotion = useReducedMotion;
|
|
11257
11818
|
exports.useRehearsalTimings = useRehearsalTimings;
|
|
@@ -11267,6 +11828,7 @@ exports.useThemeHandlers = useThemeHandlers;
|
|
|
11267
11828
|
exports.useThemeSwitching = useThemeSwitching;
|
|
11268
11829
|
exports.useToolbarVisibility = useToolbarVisibility;
|
|
11269
11830
|
exports.useTouchGestures = useTouchGestures;
|
|
11831
|
+
exports.useViewPreferencesSync = useViewPreferencesSync;
|
|
11270
11832
|
exports.useViewerBuildingBlocks = useViewerBuildingBlocks;
|
|
11271
11833
|
exports.useViewerCoreState = useViewerCoreState;
|
|
11272
11834
|
exports.useViewerDialogs = useViewerDialogs;
|