pptx-react-viewer 2.17.0 → 2.18.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 +2 -0
- package/README.md +14 -14
- package/dist/{AiChatPanel-RZ4A7P4H.mjs → AiChatPanel-SSSBERWJ.mjs} +4 -4
- package/dist/AiChatPanel-SSSBERWJ.mjs.br +0 -0
- package/dist/AiChatPanel-SSSBERWJ.mjs.gz +0 -0
- package/dist/{AiChatPanel-HCHCVQN2.js → AiChatPanel-UN5DHPZY.js} +24 -24
- package/dist/AiChatPanel-UN5DHPZY.js.br +0 -0
- package/dist/AiChatPanel-UN5DHPZY.js.gz +0 -0
- package/dist/{Model3DScene-LK7LSQNH.js → Model3DScene-4RPYKC2I.js} +2 -2
- package/dist/Model3DScene-4RPYKC2I.js.br +0 -0
- package/dist/Model3DScene-4RPYKC2I.js.gz +0 -0
- package/dist/{Model3DScene-I7FR74AD.mjs → Model3DScene-LYEESYAI.mjs} +1 -1
- package/dist/Model3DScene-LYEESYAI.mjs.br +0 -0
- package/dist/Model3DScene-LYEESYAI.mjs.gz +0 -0
- package/dist/{PowerPointViewer-Du7u4INi.d.ts → PowerPointViewer-Cf4YHjdF.d.ts} +2 -2
- package/dist/{PowerPointViewer-Du7u4INi.d.ts.map → PowerPointViewer-Cf4YHjdF.d.ts.map} +1 -1
- package/dist/{SurfaceChart3DScene-ODQY77SZ.js → SurfaceChart3DScene-ACPKCWLJ.js} +2 -2
- package/dist/SurfaceChart3DScene-ACPKCWLJ.js.br +0 -0
- package/dist/SurfaceChart3DScene-ACPKCWLJ.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-DEQP5O3U.mjs → SurfaceChart3DScene-JR62SOYO.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-DEQP5O3U.mjs.br → SurfaceChart3DScene-JR62SOYO.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-JR62SOYO.mjs.gz +0 -0
- package/dist/{audience-content-store-BvqKy7Hf.d.ts → audience-content-store-CyS0oP6t.d.ts} +2 -2
- package/dist/{audience-content-store-BvqKy7Hf.d.ts.map → audience-content-store-CyS0oP6t.d.ts.map} +1 -1
- package/dist/{chunk-5BXATG54.js → chunk-4LWGAVAP.js} +239 -293
- package/dist/chunk-4LWGAVAP.js.br +0 -0
- package/dist/chunk-4LWGAVAP.js.gz +0 -0
- package/dist/{chunk-FXJOTEPO.mjs → chunk-7XF6S4AM.mjs} +1 -1
- package/dist/chunk-7XF6S4AM.mjs.br +0 -0
- package/dist/chunk-7XF6S4AM.mjs.gz +0 -0
- package/dist/{chunk-TCGXGD6E.js → chunk-ASKYZ5ZY.js} +544 -426
- package/dist/chunk-ASKYZ5ZY.js.br +0 -0
- package/dist/chunk-ASKYZ5ZY.js.gz +0 -0
- package/dist/{chunk-MQHC5TXI.mjs → chunk-BZOL6FXF.mjs} +25 -80
- package/dist/chunk-BZOL6FXF.mjs.br +0 -0
- package/dist/chunk-BZOL6FXF.mjs.gz +0 -0
- package/dist/{chunk-K2QU73KB.mjs → chunk-GODW6RNR.mjs} +9801 -6455
- package/dist/chunk-GODW6RNR.mjs.br +0 -0
- package/dist/chunk-GODW6RNR.mjs.gz +0 -0
- package/dist/{chunk-NQJPPIVH.js → chunk-ICZDMFF2.js} +1444 -1131
- package/dist/chunk-ICZDMFF2.js.br +0 -0
- package/dist/chunk-ICZDMFF2.js.gz +0 -0
- package/dist/{chunk-ATOUVRRQ.js → chunk-MAVLV56S.js} +3 -3
- package/dist/chunk-MAVLV56S.js.br +0 -0
- package/dist/chunk-MAVLV56S.js.gz +0 -0
- package/dist/{chunk-422DF424.mjs → chunk-O7FTUUXP.mjs} +464 -151
- package/dist/chunk-O7FTUUXP.mjs.br +0 -0
- package/dist/chunk-O7FTUUXP.mjs.gz +0 -0
- package/dist/{chunk-ZA5JONCW.mjs → chunk-QUB5OSKY.mjs} +193 -75
- package/dist/chunk-QUB5OSKY.mjs.br +0 -0
- package/dist/chunk-QUB5OSKY.mjs.gz +0 -0
- package/dist/{chunk-AONFHTTJ.js → chunk-RTUGI4HQ.js} +27 -4
- package/dist/chunk-RTUGI4HQ.js.br +0 -0
- package/dist/chunk-RTUGI4HQ.js.gz +0 -0
- package/dist/{chunk-S64T7C4V.mjs → chunk-SNL6LBRX.mjs} +27 -4
- package/dist/chunk-SNL6LBRX.mjs.br +0 -0
- package/dist/{chunk-S64T7C4V.mjs.gz → chunk-SNL6LBRX.mjs.gz} +0 -0
- package/dist/{chunk-7JPLVECA.js → chunk-WVDM36ZM.js} +9838 -6458
- package/dist/chunk-WVDM36ZM.js.br +0 -0
- package/dist/chunk-WVDM36ZM.js.gz +0 -0
- package/dist/i18n.js +4 -4
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.d.ts +497 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +65 -41
- 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 +543 -32
- 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/{types-DU35aAJK.d.ts → types-C_CTI-QE.d.ts} +3 -31
- package/dist/types-C_CTI-QE.d.ts.map +1 -0
- package/dist/{useViewerBuildingBlocks-C9-prKYB.d.ts → useViewerBuildingBlocks-DItilDbP.d.ts} +16 -3
- package/dist/useViewerBuildingBlocks-DItilDbP.d.ts.map +1 -0
- package/dist/viewer/index.d.ts +427 -39
- package/dist/viewer/index.js +27 -27
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +6 -6
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +2 -2
- package/dist/AiChatPanel-HCHCVQN2.js.br +0 -0
- package/dist/AiChatPanel-HCHCVQN2.js.gz +0 -0
- package/dist/AiChatPanel-RZ4A7P4H.mjs.br +0 -0
- package/dist/AiChatPanel-RZ4A7P4H.mjs.gz +0 -0
- package/dist/Model3DScene-I7FR74AD.mjs.br +0 -0
- package/dist/Model3DScene-I7FR74AD.mjs.gz +0 -0
- package/dist/Model3DScene-LK7LSQNH.js.br +0 -0
- package/dist/Model3DScene-LK7LSQNH.js.gz +0 -0
- package/dist/SurfaceChart3DScene-DEQP5O3U.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-ODQY77SZ.js.br +0 -0
- package/dist/SurfaceChart3DScene-ODQY77SZ.js.gz +0 -0
- package/dist/chunk-422DF424.mjs.br +0 -0
- package/dist/chunk-422DF424.mjs.gz +0 -0
- package/dist/chunk-5BXATG54.js.br +0 -0
- package/dist/chunk-5BXATG54.js.gz +0 -0
- package/dist/chunk-7JPLVECA.js.br +0 -0
- package/dist/chunk-7JPLVECA.js.gz +0 -0
- package/dist/chunk-AONFHTTJ.js.br +0 -0
- package/dist/chunk-AONFHTTJ.js.gz +0 -0
- package/dist/chunk-ATOUVRRQ.js.br +0 -0
- package/dist/chunk-ATOUVRRQ.js.gz +0 -0
- package/dist/chunk-FXJOTEPO.mjs.br +0 -0
- package/dist/chunk-FXJOTEPO.mjs.gz +0 -0
- package/dist/chunk-K2QU73KB.mjs.br +0 -0
- package/dist/chunk-K2QU73KB.mjs.gz +0 -0
- package/dist/chunk-MQHC5TXI.mjs.br +0 -0
- package/dist/chunk-MQHC5TXI.mjs.gz +0 -0
- package/dist/chunk-NQJPPIVH.js.br +0 -0
- package/dist/chunk-NQJPPIVH.js.gz +0 -0
- package/dist/chunk-S64T7C4V.mjs.br +0 -0
- package/dist/chunk-TCGXGD6E.js.br +0 -0
- package/dist/chunk-TCGXGD6E.js.gz +0 -0
- package/dist/chunk-ZA5JONCW.mjs.br +0 -0
- package/dist/chunk-ZA5JONCW.mjs.gz +0 -0
- package/dist/types-DU35aAJK.d.ts.map +0 -1
- package/dist/useViewerBuildingBlocks-C9-prKYB.d.ts.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunk4LWGAVAP_js = require('./chunk-4LWGAVAP.js');
|
|
4
|
+
var chunkRTUGI4HQ_js = require('./chunk-RTUGI4HQ.js');
|
|
5
|
+
var chunkWVDM36ZM_js = require('./chunk-WVDM36ZM.js');
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var JSZip = require('jszip');
|
|
8
8
|
var reactI18next = require('react-i18next');
|
|
@@ -14,7 +14,7 @@ var JSZip__default = /*#__PURE__*/_interopDefault(JSZip);
|
|
|
14
14
|
function useVirtualizedSlides({
|
|
15
15
|
totalItems,
|
|
16
16
|
itemHeight,
|
|
17
|
-
overscan =
|
|
17
|
+
overscan = chunkWVDM36ZM_js.DEFAULT_VIRTUAL_OVERSCAN
|
|
18
18
|
}) {
|
|
19
19
|
const scrollContainerRef = react.useRef(null);
|
|
20
20
|
const [scrollTop, setScrollTop] = react.useState(0);
|
|
@@ -44,7 +44,7 @@ function useVirtualizedSlides({
|
|
|
44
44
|
resizeObserver?.disconnect();
|
|
45
45
|
};
|
|
46
46
|
}, []);
|
|
47
|
-
const range =
|
|
47
|
+
const range = chunkWVDM36ZM_js.computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight, overscan);
|
|
48
48
|
const safeItemHeight = Math.max(itemHeight, 1);
|
|
49
49
|
const scrollToIndex = react.useCallback(
|
|
50
50
|
(index, behavior = "smooth") => {
|
|
@@ -85,7 +85,7 @@ function usePresenceTracking({
|
|
|
85
85
|
}) {
|
|
86
86
|
const [remoteUsers, setRemoteUsers] = react.useState([]);
|
|
87
87
|
const projectorRef = react.useRef(null);
|
|
88
|
-
projectorRef.current ??=
|
|
88
|
+
projectorRef.current ??= chunkWVDM36ZM_js.createPresenceProjector();
|
|
89
89
|
const projector = projectorRef.current;
|
|
90
90
|
const lastBroadcastRef = react.useRef(0);
|
|
91
91
|
const pendingBroadcastRef = react.useRef(null);
|
|
@@ -110,7 +110,7 @@ function usePresenceTracking({
|
|
|
110
110
|
awareness.setLocalStateField("presence", state);
|
|
111
111
|
lastBroadcastRef.current = Date.now();
|
|
112
112
|
};
|
|
113
|
-
if (elapsed >=
|
|
113
|
+
if (elapsed >= chunkWVDM36ZM_js.BROADCAST_THROTTLE_MS) {
|
|
114
114
|
if (pendingBroadcastRef.current) {
|
|
115
115
|
clearTimeout(pendingBroadcastRef.current);
|
|
116
116
|
pendingBroadcastRef.current = null;
|
|
@@ -120,7 +120,7 @@ function usePresenceTracking({
|
|
|
120
120
|
pendingBroadcastRef.current = setTimeout(() => {
|
|
121
121
|
pendingBroadcastRef.current = null;
|
|
122
122
|
flush();
|
|
123
|
-
},
|
|
123
|
+
}, chunkWVDM36ZM_js.BROADCAST_THROTTLE_MS - elapsed);
|
|
124
124
|
}
|
|
125
125
|
},
|
|
126
126
|
[awareness, userName, userColor, userAvatar, role]
|
|
@@ -200,7 +200,7 @@ function useYjsProvider({ config }) {
|
|
|
200
200
|
const departureRef = react.useRef(null);
|
|
201
201
|
const gateRef = react.useRef(null);
|
|
202
202
|
if (!gateRef.current) {
|
|
203
|
-
gateRef.current =
|
|
203
|
+
gateRef.current = chunkWVDM36ZM_js.createSyncGate(() => setSynced(true));
|
|
204
204
|
}
|
|
205
205
|
const teardown = react.useCallback(() => {
|
|
206
206
|
if (timeoutRef.current) {
|
|
@@ -220,7 +220,7 @@ function useYjsProvider({ config }) {
|
|
|
220
220
|
const buildCleanup = react.useCallback(
|
|
221
221
|
(provider, yDoc) => () => {
|
|
222
222
|
announceDeparture();
|
|
223
|
-
|
|
223
|
+
chunkWVDM36ZM_js.clearLocalAwareness(provider.awareness);
|
|
224
224
|
provider.destroy();
|
|
225
225
|
yDoc.destroy();
|
|
226
226
|
setDoc(null);
|
|
@@ -245,9 +245,9 @@ function useYjsProvider({ config }) {
|
|
|
245
245
|
if (config.authToken) {
|
|
246
246
|
opts.password = config.authToken;
|
|
247
247
|
}
|
|
248
|
-
const roomId =
|
|
248
|
+
const roomId = chunkWVDM36ZM_js.validateRoomId(config.roomId);
|
|
249
249
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
250
|
-
departureRef.current =
|
|
250
|
+
departureRef.current = chunkWVDM36ZM_js.createDepartureChannel(roomId, provider.awareness);
|
|
251
251
|
setDoc(yDoc);
|
|
252
252
|
setAwareness(provider.awareness);
|
|
253
253
|
setClientId(provider.awareness.clientID);
|
|
@@ -289,13 +289,13 @@ function useYjsProvider({ config }) {
|
|
|
289
289
|
if (!config) {
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
292
|
-
const roomId =
|
|
293
|
-
const transport = config.transport ??
|
|
292
|
+
const roomId = chunkWVDM36ZM_js.validateRoomId(config.roomId);
|
|
293
|
+
const transport = config.transport ?? chunkWVDM36ZM_js.resolveTransportForServerUrl(config.serverUrl);
|
|
294
294
|
if (transport === "webrtc") {
|
|
295
295
|
await initWebrtc();
|
|
296
296
|
return;
|
|
297
297
|
}
|
|
298
|
-
if (
|
|
298
|
+
if (chunkWVDM36ZM_js.isMixedContentBlocked(config.serverUrl)) {
|
|
299
299
|
console.warn(
|
|
300
300
|
`[pptx-viewer] Refusing to connect: insecure ws:// server "${config.serverUrl}" is blocked from a secure (https) page. Use a wss:// URL.`
|
|
301
301
|
);
|
|
@@ -309,7 +309,7 @@ function useYjsProvider({ config }) {
|
|
|
309
309
|
const provider = new WebsocketProvider(config.serverUrl, roomId, yDoc, {
|
|
310
310
|
params: config.authToken ? { token: config.authToken } : void 0
|
|
311
311
|
});
|
|
312
|
-
departureRef.current =
|
|
312
|
+
departureRef.current = chunkWVDM36ZM_js.createDepartureChannel(roomId, provider.awareness);
|
|
313
313
|
let connected = false;
|
|
314
314
|
const handleStatus = (event) => {
|
|
315
315
|
if (event.status === "connected") {
|
|
@@ -349,7 +349,7 @@ function useYjsProvider({ config }) {
|
|
|
349
349
|
provider.off("status", handleStatus);
|
|
350
350
|
provider.off("sync", handleSynced);
|
|
351
351
|
announceDeparture();
|
|
352
|
-
|
|
352
|
+
chunkWVDM36ZM_js.clearLocalAwareness(provider.awareness);
|
|
353
353
|
provider.destroy();
|
|
354
354
|
yDoc.destroy();
|
|
355
355
|
setDoc(null);
|
|
@@ -358,7 +358,7 @@ function useYjsProvider({ config }) {
|
|
|
358
358
|
cleanupRef.current = null;
|
|
359
359
|
setStatus("error");
|
|
360
360
|
}
|
|
361
|
-
},
|
|
361
|
+
}, chunkWVDM36ZM_js.CONNECTION_TIMEOUT_MS);
|
|
362
362
|
}
|
|
363
363
|
setDoc(yDoc);
|
|
364
364
|
setAwareness(provider.awareness);
|
|
@@ -367,7 +367,7 @@ function useYjsProvider({ config }) {
|
|
|
367
367
|
provider.off("status", handleStatus);
|
|
368
368
|
provider.off("sync", handleSynced);
|
|
369
369
|
announceDeparture();
|
|
370
|
-
|
|
370
|
+
chunkWVDM36ZM_js.clearLocalAwareness(provider.awareness);
|
|
371
371
|
provider.destroy();
|
|
372
372
|
yDoc.destroy();
|
|
373
373
|
setDoc(null);
|
|
@@ -393,7 +393,7 @@ function useYjsProvider({ config }) {
|
|
|
393
393
|
]);
|
|
394
394
|
react.useEffect(() => {
|
|
395
395
|
init();
|
|
396
|
-
const disposeTeardown =
|
|
396
|
+
const disposeTeardown = chunkWVDM36ZM_js.registerCollaborationTeardown({
|
|
397
397
|
leave: teardown,
|
|
398
398
|
rejoin: init
|
|
399
399
|
});
|
|
@@ -414,7 +414,7 @@ function useCollaborativeState({
|
|
|
414
414
|
canvasWidth,
|
|
415
415
|
canvasHeight
|
|
416
416
|
}) {
|
|
417
|
-
const userColor =
|
|
417
|
+
const userColor = chunkWVDM36ZM_js.sanitizeColor(config?.userColor, "#6366f1");
|
|
418
418
|
const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
|
|
419
419
|
const { remoteUsers, broadcastPresence } = usePresenceTracking({
|
|
420
420
|
awareness,
|
|
@@ -524,8 +524,8 @@ function useEditorHistory(input) {
|
|
|
524
524
|
width: canvasSize.width,
|
|
525
525
|
height: canvasSize.height,
|
|
526
526
|
activeSlideIndex,
|
|
527
|
-
slides: slides.map(
|
|
528
|
-
templateElementsBySlideId:
|
|
527
|
+
slides: slides.map(chunkWVDM36ZM_js.cloneSlide),
|
|
528
|
+
templateElementsBySlideId: chunkWVDM36ZM_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
529
529
|
...actionLabel ? { actionLabel } : {}
|
|
530
530
|
};
|
|
531
531
|
},
|
|
@@ -538,9 +538,9 @@ function useEditorHistory(input) {
|
|
|
538
538
|
width: snapshot.width,
|
|
539
539
|
height: snapshot.height
|
|
540
540
|
});
|
|
541
|
-
setSlides(snapshot.slides.map(
|
|
541
|
+
setSlides(snapshot.slides.map(chunkWVDM36ZM_js.cloneSlide));
|
|
542
542
|
setTemplateElementsBySlideId(
|
|
543
|
-
|
|
543
|
+
chunkWVDM36ZM_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
544
544
|
);
|
|
545
545
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
546
546
|
setSelectedElementIds([]);
|
|
@@ -579,8 +579,8 @@ function useEditorHistory(input) {
|
|
|
579
579
|
const currentSnapshot = buildHistorySnapshot();
|
|
580
580
|
historyFutureRef.current.push(currentSnapshot);
|
|
581
581
|
isApplyingHistoryRef.current = true;
|
|
582
|
-
const nextSnapshot =
|
|
583
|
-
lastHistorySnapshotRef.current =
|
|
582
|
+
const nextSnapshot = chunk4LWGAVAP_js.cloneHistorySnapshot(previousSnapshot);
|
|
583
|
+
lastHistorySnapshotRef.current = chunk4LWGAVAP_js.cloneHistorySnapshot(nextSnapshot);
|
|
584
584
|
lastHistorySerializedRef.current = JSON.stringify(nextSnapshot);
|
|
585
585
|
applyHistorySnapshot(nextSnapshot);
|
|
586
586
|
updateHistoryAvailability();
|
|
@@ -601,8 +601,8 @@ function useEditorHistory(input) {
|
|
|
601
601
|
const currentSnapshot = buildHistorySnapshot();
|
|
602
602
|
historyPastRef.current.push(currentSnapshot);
|
|
603
603
|
isApplyingHistoryRef.current = true;
|
|
604
|
-
const targetSnapshot =
|
|
605
|
-
lastHistorySnapshotRef.current =
|
|
604
|
+
const targetSnapshot = chunk4LWGAVAP_js.cloneHistorySnapshot(nextSnapshot);
|
|
605
|
+
lastHistorySnapshotRef.current = chunk4LWGAVAP_js.cloneHistorySnapshot(targetSnapshot);
|
|
606
606
|
lastHistorySerializedRef.current = JSON.stringify(targetSnapshot);
|
|
607
607
|
applyHistorySnapshot(targetSnapshot);
|
|
608
608
|
updateHistoryAvailability();
|
|
@@ -620,7 +620,7 @@ function useEditorHistory(input) {
|
|
|
620
620
|
historyPastRef.current = [];
|
|
621
621
|
historyFutureRef.current = [];
|
|
622
622
|
if (initialSnapshot) {
|
|
623
|
-
const clonedInitial =
|
|
623
|
+
const clonedInitial = chunk4LWGAVAP_js.cloneHistorySnapshot(initialSnapshot);
|
|
624
624
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
625
625
|
lastHistorySerializedRef.current = JSON.stringify(clonedInitial);
|
|
626
626
|
} else {
|
|
@@ -661,19 +661,19 @@ function useEditorHistory(input) {
|
|
|
661
661
|
}
|
|
662
662
|
const previousSnapshot = lastHistorySnapshotRef.current;
|
|
663
663
|
if (!previousSnapshot) {
|
|
664
|
-
lastHistorySnapshotRef.current =
|
|
664
|
+
lastHistorySnapshotRef.current = chunk4LWGAVAP_js.cloneHistorySnapshot(snapshot);
|
|
665
665
|
lastHistorySerializedRef.current = serialized;
|
|
666
666
|
lastCheapHashRef.current = cheapHash;
|
|
667
667
|
updateHistoryAvailability();
|
|
668
668
|
return;
|
|
669
669
|
}
|
|
670
670
|
onDirtyRef.current?.();
|
|
671
|
-
historyPastRef.current.push(
|
|
671
|
+
historyPastRef.current.push(chunk4LWGAVAP_js.cloneHistorySnapshot(previousSnapshot));
|
|
672
672
|
while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
|
|
673
673
|
historyPastRef.current.shift();
|
|
674
674
|
}
|
|
675
675
|
historyFutureRef.current = [];
|
|
676
|
-
lastHistorySnapshotRef.current =
|
|
676
|
+
lastHistorySnapshotRef.current = chunk4LWGAVAP_js.cloneHistorySnapshot(snapshot);
|
|
677
677
|
lastHistorySerializedRef.current = serialized;
|
|
678
678
|
lastCheapHashRef.current = cheapHash;
|
|
679
679
|
updateHistoryAvailability();
|
|
@@ -733,9 +733,9 @@ function useZoomViewport({
|
|
|
733
733
|
const canvasStageRef = react.useRef(null);
|
|
734
734
|
const canvasViewportRef = react.useRef(null);
|
|
735
735
|
const renderScaleRef = react.useRef(1);
|
|
736
|
-
const wheelBufferRef = react.useRef(
|
|
736
|
+
const wheelBufferRef = react.useRef(chunkWVDM36ZM_js.createWheelStepBuffer());
|
|
737
737
|
const storeRef = react.useRef(null);
|
|
738
|
-
storeRef.current ??=
|
|
738
|
+
storeRef.current ??= chunkWVDM36ZM_js.createViewerZoomStore();
|
|
739
739
|
const store = storeRef.current;
|
|
740
740
|
const scale = useViewerStore(store, selectZoom);
|
|
741
741
|
const setScale = react.useCallback(
|
|
@@ -796,7 +796,7 @@ function useZoomViewport({
|
|
|
796
796
|
if (!wrapper || !canvasViewport) {
|
|
797
797
|
return;
|
|
798
798
|
}
|
|
799
|
-
const boundedScale =
|
|
799
|
+
const boundedScale = chunkWVDM36ZM_js.clampZoomScale(nextScale);
|
|
800
800
|
const nextEditorScale = fitScale * boundedScale;
|
|
801
801
|
const centerX = (bounds.minX + bounds.maxX) / 2;
|
|
802
802
|
const centerY = (bounds.minY + bounds.maxY) / 2;
|
|
@@ -833,29 +833,29 @@ function useZoomViewport({
|
|
|
833
833
|
selectedElements.forEach((element) => {
|
|
834
834
|
minX = Math.min(minX, element.x);
|
|
835
835
|
minY = Math.min(minY, element.y);
|
|
836
|
-
maxX = Math.max(maxX, element.x + Math.max(element.width,
|
|
837
|
-
maxY = Math.max(maxY, element.y + Math.max(element.height,
|
|
836
|
+
maxX = Math.max(maxX, element.x + Math.max(element.width, chunk4LWGAVAP_js.MIN_ELEMENT_SIZE));
|
|
837
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunk4LWGAVAP_js.MIN_ELEMENT_SIZE));
|
|
838
838
|
});
|
|
839
839
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
840
840
|
return;
|
|
841
841
|
}
|
|
842
842
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
843
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
844
|
-
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY,
|
|
843
|
+
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunk4LWGAVAP_js.MIN_ELEMENT_SIZE);
|
|
844
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunk4LWGAVAP_js.MIN_ELEMENT_SIZE);
|
|
845
845
|
const availableWidth = Math.max(
|
|
846
|
-
effectiveEditorDimensions.width -
|
|
847
|
-
|
|
846
|
+
effectiveEditorDimensions.width - chunk4LWGAVAP_js.ZOOM_TO_SELECTION_PADDING,
|
|
847
|
+
chunk4LWGAVAP_js.MIN_ELEMENT_SIZE
|
|
848
848
|
);
|
|
849
849
|
const availableHeight = Math.max(
|
|
850
|
-
effectiveEditorDimensions.height -
|
|
851
|
-
|
|
850
|
+
effectiveEditorDimensions.height - chunk4LWGAVAP_js.ZOOM_TO_SELECTION_PADDING,
|
|
851
|
+
chunk4LWGAVAP_js.MIN_ELEMENT_SIZE
|
|
852
852
|
);
|
|
853
853
|
const targetEditorScale = Math.min(
|
|
854
854
|
availableWidth / boundsWidth,
|
|
855
855
|
availableHeight / boundsHeight
|
|
856
856
|
);
|
|
857
857
|
const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
|
|
858
|
-
const nextScale =
|
|
858
|
+
const nextScale = chunkWVDM36ZM_js.clampZoomScale(targetEditorScale / safeFitScale);
|
|
859
859
|
setScale(nextScale);
|
|
860
860
|
window.requestAnimationFrame(() => {
|
|
861
861
|
window.requestAnimationFrame(() => {
|
|
@@ -872,14 +872,14 @@ function useZoomViewport({
|
|
|
872
872
|
]);
|
|
873
873
|
const handleWheel = react.useCallback(
|
|
874
874
|
(event) => {
|
|
875
|
-
const mapped =
|
|
875
|
+
const mapped = chunkWVDM36ZM_js.mapEditingWheel(event, wheelBufferRef.current, true);
|
|
876
876
|
if (mapped.intent !== "zoom") {
|
|
877
877
|
return;
|
|
878
878
|
}
|
|
879
879
|
event.preventDefault();
|
|
880
880
|
store.dispatch({
|
|
881
881
|
type: "set-zoom",
|
|
882
|
-
zoom:
|
|
882
|
+
zoom: chunkWVDM36ZM_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
|
|
883
883
|
});
|
|
884
884
|
},
|
|
885
885
|
[store]
|
|
@@ -967,7 +967,7 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
|
|
|
967
967
|
const command = step.command;
|
|
968
968
|
const timer = window.setTimeout(
|
|
969
969
|
() => {
|
|
970
|
-
|
|
970
|
+
chunk4LWGAVAP_js.executeMediaCommand(command);
|
|
971
971
|
},
|
|
972
972
|
Math.max(0, step.delayMs)
|
|
973
973
|
);
|
|
@@ -1104,7 +1104,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
|
|
|
1104
1104
|
}))
|
|
1105
1105
|
);
|
|
1106
1106
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1107
|
-
const delay =
|
|
1107
|
+
const delay = chunkWVDM36ZM_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1108
1108
|
const timer = window.setTimeout(() => {
|
|
1109
1109
|
setPresentationAnimations(
|
|
1110
1110
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1136,7 +1136,7 @@ function useAnimationPlayback(input) {
|
|
|
1136
1136
|
(controller, group) => {
|
|
1137
1137
|
driveBuildReveal(
|
|
1138
1138
|
controller,
|
|
1139
|
-
|
|
1139
|
+
chunkWVDM36ZM_js.PresentationAnimationController.collectBuildStepIds(group),
|
|
1140
1140
|
setPresentationElementStates,
|
|
1141
1141
|
buildRafRef
|
|
1142
1142
|
);
|
|
@@ -1199,7 +1199,7 @@ function useAnimationPlayback(input) {
|
|
|
1199
1199
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1200
1200
|
return;
|
|
1201
1201
|
}
|
|
1202
|
-
const controller =
|
|
1202
|
+
const controller = chunkWVDM36ZM_js.PresentationAnimationController.fromSlide(slide);
|
|
1203
1203
|
controllerRef.current = controller;
|
|
1204
1204
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1205
1205
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
@@ -1357,12 +1357,12 @@ function useAnimationPlayback(input) {
|
|
|
1357
1357
|
presentationTimersRef
|
|
1358
1358
|
};
|
|
1359
1359
|
}
|
|
1360
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1361
|
-
var AUDIENCE_HASH =
|
|
1362
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1363
|
-
var AUDIENCE_NONCE_KEY =
|
|
1360
|
+
var PRESENTER_CHANNEL_NAME = chunkWVDM36ZM_js.PRESENTATION_CHANNEL_NAME;
|
|
1361
|
+
var AUDIENCE_HASH = chunkWVDM36ZM_js.PRESENTATION_HASH;
|
|
1362
|
+
var PRESENTER_MSG_ORIGIN = chunkWVDM36ZM_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1363
|
+
var AUDIENCE_NONCE_KEY = chunkWVDM36ZM_js.PRESENTATION_NONCE_KEY;
|
|
1364
1364
|
function generateSessionId() {
|
|
1365
|
-
return
|
|
1365
|
+
return chunkWVDM36ZM_js.createPresentationSessionId();
|
|
1366
1366
|
}
|
|
1367
1367
|
function parseAudienceNonce() {
|
|
1368
1368
|
const hash = window.location.hash;
|
|
@@ -1398,7 +1398,7 @@ function usePresenterWindow(input) {
|
|
|
1398
1398
|
}, []);
|
|
1399
1399
|
const swapDisplays = react.useCallback(async () => {
|
|
1400
1400
|
const audience = audienceWindowRef.current;
|
|
1401
|
-
return audience && !audience.closed ?
|
|
1401
|
+
return audience && !audience.closed ? chunkWVDM36ZM_js.swapPresentationWindows(window, audience) : false;
|
|
1402
1402
|
}, []);
|
|
1403
1403
|
const syncSlideToAudience = react.useCallback(
|
|
1404
1404
|
(slideIndex) => {
|
|
@@ -1462,7 +1462,7 @@ function usePresenterWindow(input) {
|
|
|
1462
1462
|
pollTimerRef.current = null;
|
|
1463
1463
|
}
|
|
1464
1464
|
if (closingSessionId) {
|
|
1465
|
-
void
|
|
1465
|
+
void chunkWVDM36ZM_js.clearAudienceContent(closingSessionId);
|
|
1466
1466
|
}
|
|
1467
1467
|
}, [getChannel]);
|
|
1468
1468
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1480,10 +1480,10 @@ function usePresenterWindow(input) {
|
|
|
1480
1480
|
audienceWindowRef.current = blankWin;
|
|
1481
1481
|
const sessionId = generateSessionId();
|
|
1482
1482
|
sessionIdRef.current = sessionId;
|
|
1483
|
-
const audienceUrl =
|
|
1484
|
-
void
|
|
1483
|
+
const audienceUrl = chunkWVDM36ZM_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1484
|
+
void chunkWVDM36ZM_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1485
1485
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1486
|
-
|
|
1486
|
+
chunkWVDM36ZM_js.placeAudienceWindow(blankWin, placement);
|
|
1487
1487
|
}
|
|
1488
1488
|
return void 0;
|
|
1489
1489
|
});
|
|
@@ -1513,7 +1513,7 @@ function usePresenterWindow(input) {
|
|
|
1513
1513
|
}
|
|
1514
1514
|
};
|
|
1515
1515
|
if (content) {
|
|
1516
|
-
void
|
|
1516
|
+
void chunkWVDM36ZM_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1517
1517
|
} else {
|
|
1518
1518
|
navigateOrClose(true);
|
|
1519
1519
|
}
|
|
@@ -1539,7 +1539,7 @@ function usePresenterWindow(input) {
|
|
|
1539
1539
|
}
|
|
1540
1540
|
const handleMessage = (event) => {
|
|
1541
1541
|
const message = event.data;
|
|
1542
|
-
if (
|
|
1542
|
+
if (chunkWVDM36ZM_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1543
1543
|
syncStateToAudience(snapshotRef.current);
|
|
1544
1544
|
}
|
|
1545
1545
|
};
|
|
@@ -1568,7 +1568,7 @@ function usePresenterWindow(input) {
|
|
|
1568
1568
|
react.useEffect(() => {
|
|
1569
1569
|
const handleBeforeUnload = () => {
|
|
1570
1570
|
if (sessionIdRef.current) {
|
|
1571
|
-
void
|
|
1571
|
+
void chunkWVDM36ZM_js.clearAudienceContent(sessionIdRef.current);
|
|
1572
1572
|
}
|
|
1573
1573
|
};
|
|
1574
1574
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1630,7 +1630,7 @@ function useAudienceMode(input) {
|
|
|
1630
1630
|
}
|
|
1631
1631
|
channel.onmessage = (event) => {
|
|
1632
1632
|
const data = event.data;
|
|
1633
|
-
if (!
|
|
1633
|
+
if (!chunkWVDM36ZM_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1634
1634
|
return;
|
|
1635
1635
|
}
|
|
1636
1636
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1646,16 +1646,16 @@ function useAudienceMode(input) {
|
|
|
1646
1646
|
}
|
|
1647
1647
|
if (data.type === "presenter-exit") {
|
|
1648
1648
|
if (expectedSessionId) {
|
|
1649
|
-
void
|
|
1649
|
+
void chunkWVDM36ZM_js.clearAudienceContent(expectedSessionId);
|
|
1650
1650
|
}
|
|
1651
|
-
if (
|
|
1651
|
+
if (chunkWVDM36ZM_js.endAudienceDisplay(window)) {
|
|
1652
1652
|
handlers.onPresenterEnded?.();
|
|
1653
1653
|
}
|
|
1654
1654
|
}
|
|
1655
1655
|
};
|
|
1656
1656
|
if (expectedSessionId) {
|
|
1657
1657
|
channel.postMessage({
|
|
1658
|
-
origin:
|
|
1658
|
+
origin: chunkWVDM36ZM_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1659
1659
|
type: "audience-ready",
|
|
1660
1660
|
sessionId: expectedSessionId
|
|
1661
1661
|
});
|
|
@@ -1669,7 +1669,7 @@ function useAudienceMode(input) {
|
|
|
1669
1669
|
}, []);
|
|
1670
1670
|
}
|
|
1671
1671
|
function usePresentationKeyboard(input) {
|
|
1672
|
-
const wheelBufferRef = react.useRef(
|
|
1672
|
+
const wheelBufferRef = react.useRef(chunkWVDM36ZM_js.createWheelStepBuffer());
|
|
1673
1673
|
const {
|
|
1674
1674
|
mode,
|
|
1675
1675
|
movePresentationSlide,
|
|
@@ -1682,6 +1682,7 @@ function usePresentationKeyboard(input) {
|
|
|
1682
1682
|
onToggleInkMarkup,
|
|
1683
1683
|
onToggleToolbar,
|
|
1684
1684
|
onShowAllSlides,
|
|
1685
|
+
onToggleSubtitles,
|
|
1685
1686
|
onToggleBlackScreen,
|
|
1686
1687
|
onToggleWhiteScreen,
|
|
1687
1688
|
rehearsing,
|
|
@@ -1689,14 +1690,14 @@ function usePresentationKeyboard(input) {
|
|
|
1689
1690
|
presentationSlideIndex,
|
|
1690
1691
|
setShowRehearsalSummary
|
|
1691
1692
|
} = input;
|
|
1692
|
-
const keyBufferRef = react.useRef(
|
|
1693
|
+
const keyBufferRef = react.useRef(chunkWVDM36ZM_js.createPresentationKeyBuffer());
|
|
1693
1694
|
react.useEffect(() => {
|
|
1694
|
-
if (mode !== "present" || !
|
|
1695
|
-
keyBufferRef.current =
|
|
1695
|
+
if (mode !== "present" || !chunkWVDM36ZM_js.acceptsPresentationInput()) {
|
|
1696
|
+
keyBufferRef.current = chunkWVDM36ZM_js.createPresentationKeyBuffer();
|
|
1696
1697
|
return;
|
|
1697
1698
|
}
|
|
1698
1699
|
const handleKeyDown = (event) => {
|
|
1699
|
-
const mapped =
|
|
1700
|
+
const mapped = chunkWVDM36ZM_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1700
1701
|
if (mapped.action === "none") {
|
|
1701
1702
|
return;
|
|
1702
1703
|
}
|
|
@@ -1716,12 +1717,12 @@ function usePresentationKeyboard(input) {
|
|
|
1716
1717
|
movePresentationSlide(-1);
|
|
1717
1718
|
return;
|
|
1718
1719
|
case "first": {
|
|
1719
|
-
const first =
|
|
1720
|
+
const first = chunkWVDM36ZM_js.firstShowSlideIndex(showSlideIndexes);
|
|
1720
1721
|
navigateToSlide(first ?? 0);
|
|
1721
1722
|
return;
|
|
1722
1723
|
}
|
|
1723
1724
|
case "last": {
|
|
1724
|
-
const last =
|
|
1725
|
+
const last = chunkWVDM36ZM_js.lastShowSlideIndex(showSlideIndexes);
|
|
1725
1726
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1726
1727
|
return;
|
|
1727
1728
|
}
|
|
@@ -1747,6 +1748,9 @@ function usePresentationKeyboard(input) {
|
|
|
1747
1748
|
case "showAllSlides":
|
|
1748
1749
|
onShowAllSlides?.();
|
|
1749
1750
|
return;
|
|
1751
|
+
case "toggleSubtitles":
|
|
1752
|
+
onToggleSubtitles?.();
|
|
1753
|
+
return;
|
|
1750
1754
|
case "toggleBlackScreen":
|
|
1751
1755
|
onToggleBlackScreen?.();
|
|
1752
1756
|
return;
|
|
@@ -1756,10 +1760,10 @@ function usePresentationKeyboard(input) {
|
|
|
1756
1760
|
}
|
|
1757
1761
|
};
|
|
1758
1762
|
const handleWheel = (event) => {
|
|
1759
|
-
if (mode !== "present" || !
|
|
1763
|
+
if (mode !== "present" || !chunkWVDM36ZM_js.acceptsPresentationInput()) {
|
|
1760
1764
|
return;
|
|
1761
1765
|
}
|
|
1762
|
-
const mapped =
|
|
1766
|
+
const mapped = chunkWVDM36ZM_js.mapPresentationWheel(event, wheelBufferRef.current);
|
|
1763
1767
|
if (mapped.intent === "next-slide") {
|
|
1764
1768
|
event.preventDefault();
|
|
1765
1769
|
movePresentationSlide(1);
|
|
@@ -1786,6 +1790,7 @@ function usePresentationKeyboard(input) {
|
|
|
1786
1790
|
onToggleInkMarkup,
|
|
1787
1791
|
onToggleToolbar,
|
|
1788
1792
|
onShowAllSlides,
|
|
1793
|
+
onToggleSubtitles,
|
|
1789
1794
|
onToggleBlackScreen,
|
|
1790
1795
|
onToggleWhiteScreen,
|
|
1791
1796
|
rehearsing,
|
|
@@ -1891,7 +1896,7 @@ function useRehearsalTimings(input) {
|
|
|
1891
1896
|
|
|
1892
1897
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1893
1898
|
function handlePresentationActionImpl(action, deps) {
|
|
1894
|
-
|
|
1899
|
+
chunkWVDM36ZM_js.runPresentationAction(
|
|
1895
1900
|
action,
|
|
1896
1901
|
{ slideCount: deps.slidesLength },
|
|
1897
1902
|
{
|
|
@@ -1913,7 +1918,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1913
1918
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1914
1919
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1915
1920
|
const transition = incomingSlide?.transition;
|
|
1916
|
-
const durationMs = deps.playTransition ?
|
|
1921
|
+
const durationMs = deps.playTransition ? chunkWVDM36ZM_js.resolveTransitionDurationMs(transition) : 0;
|
|
1917
1922
|
deps.clearPresentationTimers();
|
|
1918
1923
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1919
1924
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -1972,7 +1977,7 @@ function useSlideNavigation(input) {
|
|
|
1972
1977
|
});
|
|
1973
1978
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
1974
1979
|
(slideIndex) => {
|
|
1975
|
-
const delayMs =
|
|
1980
|
+
const delayMs = chunkWVDM36ZM_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
1976
1981
|
if (delayMs === void 0) {
|
|
1977
1982
|
return;
|
|
1978
1983
|
}
|
|
@@ -1995,7 +2000,7 @@ function useSlideNavigation(input) {
|
|
|
1995
2000
|
if (availableSlideIndexes.length === 0) {
|
|
1996
2001
|
return;
|
|
1997
2002
|
}
|
|
1998
|
-
const pastLastSlide = direction === 1 && !
|
|
2003
|
+
const pastLastSlide = direction === 1 && !chunkWVDM36ZM_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
1999
2004
|
if (rehearsing && pastLastSlide) {
|
|
2000
2005
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
2001
2006
|
try {
|
|
@@ -2013,9 +2018,9 @@ function useSlideNavigation(input) {
|
|
|
2013
2018
|
onAdvancePastLastSlide();
|
|
2014
2019
|
return;
|
|
2015
2020
|
}
|
|
2016
|
-
const nextSlideIndex = direction === 1 ?
|
|
2021
|
+
const nextSlideIndex = direction === 1 ? chunkWVDM36ZM_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
2017
2022
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
2018
|
-
}) :
|
|
2023
|
+
}) : chunkWVDM36ZM_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
2019
2024
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
2020
2025
|
return;
|
|
2021
2026
|
}
|
|
@@ -2160,22 +2165,22 @@ function useZoomNavigation(input) {
|
|
|
2160
2165
|
};
|
|
2161
2166
|
}
|
|
2162
2167
|
function usePresenterConsole(slideIndex, active) {
|
|
2163
|
-
const timerRef = react.useRef(
|
|
2164
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2168
|
+
const timerRef = react.useRef(chunkWVDM36ZM_js.createPresenterTimer());
|
|
2169
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkWVDM36ZM_js.createInitialPresentationSnapshot(slideIndex));
|
|
2165
2170
|
const patch = react.useCallback((value) => {
|
|
2166
|
-
setSnapshot((current) =>
|
|
2171
|
+
setSnapshot((current) => chunkWVDM36ZM_js.mergePresentationSnapshot(current, value));
|
|
2167
2172
|
}, []);
|
|
2168
2173
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2169
2174
|
react.useEffect(() => {
|
|
2170
2175
|
if (!active) {
|
|
2171
2176
|
return;
|
|
2172
2177
|
}
|
|
2173
|
-
timerRef.current =
|
|
2178
|
+
timerRef.current = chunkWVDM36ZM_js.resetPresenterTimer();
|
|
2174
2179
|
patch({ paused: false, elapsedMs: 0 });
|
|
2175
2180
|
const timer = window.setInterval(() => {
|
|
2176
2181
|
patch({
|
|
2177
2182
|
paused: timerRef.current.paused,
|
|
2178
|
-
elapsedMs:
|
|
2183
|
+
elapsedMs: chunkWVDM36ZM_js.presenterElapsed(timerRef.current)
|
|
2179
2184
|
});
|
|
2180
2185
|
}, 1e3);
|
|
2181
2186
|
return () => window.clearInterval(timer);
|
|
@@ -2185,19 +2190,19 @@ function usePresenterConsole(slideIndex, active) {
|
|
|
2185
2190
|
applyAudienceSnapshot: setSnapshot,
|
|
2186
2191
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2187
2192
|
toggleTimer: () => {
|
|
2188
|
-
timerRef.current =
|
|
2193
|
+
timerRef.current = chunkWVDM36ZM_js.togglePresenterTimer(timerRef.current);
|
|
2189
2194
|
patch({
|
|
2190
2195
|
paused: timerRef.current.paused,
|
|
2191
|
-
elapsedMs:
|
|
2196
|
+
elapsedMs: chunkWVDM36ZM_js.presenterElapsed(timerRef.current)
|
|
2192
2197
|
});
|
|
2193
2198
|
},
|
|
2194
2199
|
resetTimer: () => {
|
|
2195
|
-
timerRef.current =
|
|
2200
|
+
timerRef.current = chunkWVDM36ZM_js.resetPresenterTimer();
|
|
2196
2201
|
patch({ paused: false, elapsedMs: 0 });
|
|
2197
2202
|
},
|
|
2198
2203
|
stepZoom: (direction) => setSnapshot(
|
|
2199
|
-
(current) =>
|
|
2200
|
-
zoom:
|
|
2204
|
+
(current) => chunkWVDM36ZM_js.mergePresentationSnapshot(current, {
|
|
2205
|
+
zoom: chunkWVDM36ZM_js.stepPresenterZoom(
|
|
2201
2206
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2202
2207
|
direction
|
|
2203
2208
|
)
|
|
@@ -2226,6 +2231,7 @@ function usePresentationMode(input) {
|
|
|
2226
2231
|
onEraseAnnotations,
|
|
2227
2232
|
onToggleInkMarkup,
|
|
2228
2233
|
onToggleToolbar,
|
|
2234
|
+
onToggleSubtitles,
|
|
2229
2235
|
onSaveRehearsalTimings,
|
|
2230
2236
|
loopContinuously,
|
|
2231
2237
|
showWithAnimation,
|
|
@@ -2242,7 +2248,7 @@ function usePresentationMode(input) {
|
|
|
2242
2248
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2243
2249
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2244
2250
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2245
|
-
const showGuard = react.useMemo(() =>
|
|
2251
|
+
const showGuard = react.useMemo(() => chunkWVDM36ZM_js.createPresenterShowGuard(), []);
|
|
2246
2252
|
const {
|
|
2247
2253
|
presentationAnimations,
|
|
2248
2254
|
presentationElementStates,
|
|
@@ -2321,7 +2327,7 @@ function usePresentationMode(input) {
|
|
|
2321
2327
|
});
|
|
2322
2328
|
const movePresentationSlide = react.useCallback(
|
|
2323
2329
|
(direction, trigger = "explicit") => {
|
|
2324
|
-
if (!
|
|
2330
|
+
if (!chunkWVDM36ZM_js.acceptsPresentationInput()) {
|
|
2325
2331
|
return;
|
|
2326
2332
|
}
|
|
2327
2333
|
if (endOfShowVisible) {
|
|
@@ -2433,6 +2439,7 @@ function usePresentationMode(input) {
|
|
|
2433
2439
|
onToggleInkMarkup,
|
|
2434
2440
|
onToggleToolbar,
|
|
2435
2441
|
onShowAllSlides: openAllSlides,
|
|
2442
|
+
onToggleSubtitles,
|
|
2436
2443
|
onToggleBlackScreen: () => presenterConsole.setBlackout(
|
|
2437
2444
|
presenterConsole.snapshot.blackout === "black" ? "none" : "black"
|
|
2438
2445
|
),
|
|
@@ -2458,7 +2465,7 @@ function usePresentationMode(input) {
|
|
|
2458
2465
|
if (mode !== "present") {
|
|
2459
2466
|
return;
|
|
2460
2467
|
}
|
|
2461
|
-
return
|
|
2468
|
+
return chunkWVDM36ZM_js.attachPresentationVisibilityPause({
|
|
2462
2469
|
root: containerRef.current ?? void 0,
|
|
2463
2470
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2464
2471
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
@@ -2538,11 +2545,11 @@ function usePresentationMode(input) {
|
|
|
2538
2545
|
if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
|
|
2539
2546
|
return void 0;
|
|
2540
2547
|
}
|
|
2541
|
-
return
|
|
2548
|
+
return chunkWVDM36ZM_js.buildMorphTransitionPlan(
|
|
2542
2549
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2543
2550
|
slides[transitionOverlay.incomingSlideIndex],
|
|
2544
2551
|
transitionOverlay.durationMs,
|
|
2545
|
-
|
|
2552
|
+
chunkWVDM36ZM_js.morphOptionToMode(transitionOverlay.transition.morphOption)
|
|
2546
2553
|
);
|
|
2547
2554
|
}, [transitionOverlay, slides]);
|
|
2548
2555
|
const morphedElementStates = react.useMemo(() => {
|
|
@@ -2563,7 +2570,7 @@ function usePresentationMode(input) {
|
|
|
2563
2570
|
if (!morphPlan) {
|
|
2564
2571
|
return presentationKeyframesCss;
|
|
2565
2572
|
}
|
|
2566
|
-
const imageRules =
|
|
2573
|
+
const imageRules = chunkWVDM36ZM_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
|
|
2567
2574
|
return `${presentationKeyframesCss ?? ""}
|
|
2568
2575
|
${morphPlan.keyframesCss}
|
|
2569
2576
|
${imageRules}`;
|
|
@@ -2859,7 +2866,7 @@ function useFindReplace({
|
|
|
2859
2866
|
const [findResults, setFindResults] = react.useState([]);
|
|
2860
2867
|
const [findResultIndex, setFindResultIndex] = react.useState(-1);
|
|
2861
2868
|
const performFind = react.useCallback(() => {
|
|
2862
|
-
const results =
|
|
2869
|
+
const results = chunkWVDM36ZM_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
|
|
2863
2870
|
if (!findQuery) {
|
|
2864
2871
|
setFindResults([]);
|
|
2865
2872
|
setFindResultIndex(-1);
|
|
@@ -2893,7 +2900,7 @@ function useFindReplace({
|
|
|
2893
2900
|
return;
|
|
2894
2901
|
}
|
|
2895
2902
|
onUpdateSlides(
|
|
2896
|
-
(prevSlides) =>
|
|
2903
|
+
(prevSlides) => chunkWVDM36ZM_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
|
|
2897
2904
|
);
|
|
2898
2905
|
onMarkDirty();
|
|
2899
2906
|
},
|
|
@@ -2915,13 +2922,15 @@ function useFindReplace({
|
|
|
2915
2922
|
}, [findResults, applyReplacements, performFind]);
|
|
2916
2923
|
react.useEffect(() => {
|
|
2917
2924
|
const handler = (event) => {
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2925
|
+
const { action } = chunkWVDM36ZM_js.mapEditorKey(event, {
|
|
2926
|
+
canEdit: mode === "edit",
|
|
2927
|
+
isTextInputTarget: chunkWVDM36ZM_js.isEditorTextInputTarget(event.target)
|
|
2928
|
+
});
|
|
2929
|
+
if (action !== "find") {
|
|
2930
|
+
return;
|
|
2924
2931
|
}
|
|
2932
|
+
event.preventDefault();
|
|
2933
|
+
setFindReplaceOpen((prev) => !prev);
|
|
2925
2934
|
};
|
|
2926
2935
|
window.addEventListener("keydown", handler);
|
|
2927
2936
|
return () => window.removeEventListener("keydown", handler);
|
|
@@ -3361,9 +3370,28 @@ function useDerivedElementState(input) {
|
|
|
3361
3370
|
}
|
|
3362
3371
|
return templateElementsBySlideId[activeSlide.id] ?? [];
|
|
3363
3372
|
}, [activeSlide, templateElementsBySlideId]);
|
|
3373
|
+
const activeMaster = slideMasters[activeMasterIndex];
|
|
3374
|
+
const activeLayout = react.useMemo(
|
|
3375
|
+
() => resolveActiveLayout(activeMaster, activeLayoutIndex),
|
|
3376
|
+
[activeMaster, activeLayoutIndex]
|
|
3377
|
+
);
|
|
3378
|
+
const masterViewElements2 = react.useMemo(
|
|
3379
|
+
() => computeMasterViewElements(activeMaster, activeLayout),
|
|
3380
|
+
[activeMaster, activeLayout]
|
|
3381
|
+
);
|
|
3382
|
+
const notesMasterElements = react.useMemo(() => notesMaster?.elements ?? [], [notesMaster]);
|
|
3383
|
+
const handoutMasterElements = react.useMemo(() => handoutMaster?.elements ?? [], [handoutMaster]);
|
|
3364
3384
|
const elementLookup = react.useMemo(
|
|
3365
|
-
() => buildElementLookup(
|
|
3366
|
-
|
|
3385
|
+
() => buildElementLookup(
|
|
3386
|
+
[
|
|
3387
|
+
...templateElements,
|
|
3388
|
+
...masterViewElements2,
|
|
3389
|
+
...notesMasterElements,
|
|
3390
|
+
...handoutMasterElements
|
|
3391
|
+
],
|
|
3392
|
+
activeSlide?.elements ?? []
|
|
3393
|
+
),
|
|
3394
|
+
[activeSlide, templateElements, masterViewElements2, notesMasterElements, handoutMasterElements]
|
|
3367
3395
|
);
|
|
3368
3396
|
const selectedElement = react.useMemo(() => {
|
|
3369
3397
|
if (!selectedElementId) {
|
|
@@ -3380,17 +3408,6 @@ function useDerivedElementState(input) {
|
|
|
3380
3408
|
() => effectiveSelectedIds.map((id) => elementLookup.get(id)).filter(Boolean),
|
|
3381
3409
|
[effectiveSelectedIds, elementLookup]
|
|
3382
3410
|
);
|
|
3383
|
-
const activeMaster = slideMasters[activeMasterIndex];
|
|
3384
|
-
const activeLayout = react.useMemo(
|
|
3385
|
-
() => resolveActiveLayout(activeMaster, activeLayoutIndex),
|
|
3386
|
-
[activeMaster, activeLayoutIndex]
|
|
3387
|
-
);
|
|
3388
|
-
const masterViewElements2 = react.useMemo(
|
|
3389
|
-
() => computeMasterViewElements(activeMaster, activeLayout),
|
|
3390
|
-
[activeMaster, activeLayout]
|
|
3391
|
-
);
|
|
3392
|
-
const notesMasterElements = react.useMemo(() => notesMaster?.elements ?? [], [notesMaster]);
|
|
3393
|
-
const handoutMasterElements = react.useMemo(() => handoutMaster?.elements ?? [], [handoutMaster]);
|
|
3394
3411
|
return {
|
|
3395
3412
|
activeSlide,
|
|
3396
3413
|
templateElements,
|
|
@@ -3417,7 +3434,7 @@ function useViewerCoreState(_input) {
|
|
|
3417
3434
|
const marqueeStateRef = react.useRef(null);
|
|
3418
3435
|
const isDrawingRef = react.useRef(false);
|
|
3419
3436
|
const justInteractedRef = react.useRef(false);
|
|
3420
|
-
const livePatcher = react.useMemo(() =>
|
|
3437
|
+
const livePatcher = react.useMemo(() => chunkWVDM36ZM_js.createCollaborationLivePatcher(), []);
|
|
3421
3438
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3422
3439
|
const slidesRef = react.useRef([]);
|
|
3423
3440
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3426,9 +3443,10 @@ function useViewerCoreState(_input) {
|
|
|
3426
3443
|
const [slides, setSlides] = react.useState([]);
|
|
3427
3444
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3428
3445
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3429
|
-
width:
|
|
3430
|
-
height:
|
|
3446
|
+
width: chunk4LWGAVAP_js.DEFAULT_CANVAS_WIDTH,
|
|
3447
|
+
height: chunk4LWGAVAP_js.DEFAULT_CANVAS_HEIGHT
|
|
3431
3448
|
});
|
|
3449
|
+
const [slideSizeEmu, setSlideSizeEmu] = react.useState();
|
|
3432
3450
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
3433
3451
|
const [selectedElementId, setSelectedElementId] = react.useState(null);
|
|
3434
3452
|
const [selectedElementIds, setSelectedElementIds] = react.useState([]);
|
|
@@ -3447,7 +3465,7 @@ function useViewerCoreState(_input) {
|
|
|
3447
3465
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3448
3466
|
inlineEditingTextRef.current = resolved;
|
|
3449
3467
|
setInlineEditingTextBase(value);
|
|
3450
|
-
|
|
3468
|
+
chunkWVDM36ZM_js.publishLiveInlineText(
|
|
3451
3469
|
livePatcher,
|
|
3452
3470
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3453
3471
|
inlineEditingElementIdRef.current,
|
|
@@ -3527,6 +3545,8 @@ function useViewerCoreState(_input) {
|
|
|
3527
3545
|
setTemplateElementsBySlideId,
|
|
3528
3546
|
canvasSize,
|
|
3529
3547
|
setCanvasSize,
|
|
3548
|
+
slideSizeEmu,
|
|
3549
|
+
setSlideSizeEmu,
|
|
3530
3550
|
activeSlideIndex,
|
|
3531
3551
|
setActiveSlideIndex,
|
|
3532
3552
|
selectedElementId,
|
|
@@ -3731,6 +3751,7 @@ function useLoadContent({
|
|
|
3731
3751
|
setTemplateElementsBySlideId,
|
|
3732
3752
|
mediaDataUrls,
|
|
3733
3753
|
setCanvasSize,
|
|
3754
|
+
setSlideSizeEmu,
|
|
3734
3755
|
setHeaderFooter,
|
|
3735
3756
|
setLayoutOptions,
|
|
3736
3757
|
setSlideMasters,
|
|
@@ -3738,6 +3759,7 @@ function useLoadContent({
|
|
|
3738
3759
|
setTableStyleMap,
|
|
3739
3760
|
setThemeOptions,
|
|
3740
3761
|
setCustomShows,
|
|
3762
|
+
setActiveCustomShowId,
|
|
3741
3763
|
setSections,
|
|
3742
3764
|
setPresentationProperties,
|
|
3743
3765
|
setNotesMaster,
|
|
@@ -3782,7 +3804,7 @@ function useLoadContent({
|
|
|
3782
3804
|
);
|
|
3783
3805
|
}
|
|
3784
3806
|
const previousHandler = handlerRef.current;
|
|
3785
|
-
const handler = new
|
|
3807
|
+
const handler = new chunkWVDM36ZM_js.PptxHandler();
|
|
3786
3808
|
const parsed = await handler.load(buffer);
|
|
3787
3809
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3788
3810
|
handler.dispose();
|
|
@@ -3794,7 +3816,7 @@ function useLoadContent({
|
|
|
3794
3816
|
handlerRef.current = null;
|
|
3795
3817
|
const mediaElements = [];
|
|
3796
3818
|
for (const slide of parsed.slides) {
|
|
3797
|
-
|
|
3819
|
+
chunkWVDM36ZM_js.collectMediaElements(slide.elements, mediaElements);
|
|
3798
3820
|
}
|
|
3799
3821
|
for (const url of mediaDataUrls.values()) {
|
|
3800
3822
|
if (url.startsWith("blob:")) {
|
|
@@ -3835,7 +3857,7 @@ function useLoadContent({
|
|
|
3835
3857
|
}
|
|
3836
3858
|
})
|
|
3837
3859
|
);
|
|
3838
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3860
|
+
const { paths: imagePaths, refs: imageRefs } = chunkWVDM36ZM_js.collectImagePaths(parsed.slides);
|
|
3839
3861
|
let nextSlides = parsed.slides;
|
|
3840
3862
|
if (imagePaths.size > 0) {
|
|
3841
3863
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3890,13 +3912,20 @@ function useLoadContent({
|
|
|
3890
3912
|
}
|
|
3891
3913
|
}
|
|
3892
3914
|
handlerRef.current = handler;
|
|
3893
|
-
const partition =
|
|
3915
|
+
const partition = chunkWVDM36ZM_js.partitionTemplateElements(nextSlides);
|
|
3894
3916
|
setSlides(partition.slides);
|
|
3895
3917
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
3896
3918
|
setCanvasSize({
|
|
3897
|
-
width: parsed.width ??
|
|
3898
|
-
height: parsed.height ??
|
|
3919
|
+
width: parsed.width ?? chunk4LWGAVAP_js.DEFAULT_CANVAS_WIDTH,
|
|
3920
|
+
height: parsed.height ?? chunk4LWGAVAP_js.DEFAULT_CANVAS_HEIGHT
|
|
3899
3921
|
});
|
|
3922
|
+
setSlideSizeEmu(
|
|
3923
|
+
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
3924
|
+
widthEmu: parsed.widthEmu,
|
|
3925
|
+
heightEmu: parsed.heightEmu,
|
|
3926
|
+
type: parsed.slideSizeType ?? ""
|
|
3927
|
+
} : void 0
|
|
3928
|
+
);
|
|
3900
3929
|
setHeaderFooter(parsed.headerFooter ?? {});
|
|
3901
3930
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
3902
3931
|
setSlideMasters(parsed.slideMasters ?? []);
|
|
@@ -3904,6 +3933,9 @@ function useLoadContent({
|
|
|
3904
3933
|
setTableStyleMap(parsed.tableStyleMap);
|
|
3905
3934
|
setThemeOptions(parsed.themeOptions ?? []);
|
|
3906
3935
|
setCustomShows(parsed.customShows ?? []);
|
|
3936
|
+
setActiveCustomShowId(
|
|
3937
|
+
chunkWVDM36ZM_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
|
|
3938
|
+
);
|
|
3907
3939
|
setSections(parsed.sections ?? []);
|
|
3908
3940
|
setPresentationProperties(parsed.presentationProperties ?? {});
|
|
3909
3941
|
setNotesMaster(parsed.notesMaster);
|
|
@@ -3924,7 +3956,7 @@ function useLoadContent({
|
|
|
3924
3956
|
setHasMacros(parsed.hasMacros === true);
|
|
3925
3957
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
3926
3958
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
3927
|
-
setGuides(
|
|
3959
|
+
setGuides(chunkWVDM36ZM_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
3928
3960
|
setActiveSlideIndex(0);
|
|
3929
3961
|
clearSelection();
|
|
3930
3962
|
setIsDirty(false);
|
|
@@ -3932,7 +3964,7 @@ function useLoadContent({
|
|
|
3932
3964
|
onContentApplied?.();
|
|
3933
3965
|
} catch (err) {
|
|
3934
3966
|
if (!cancelled && token === renderTokenRef.current) {
|
|
3935
|
-
if (err instanceof
|
|
3967
|
+
if (err instanceof chunkWVDM36ZM_js.EncryptedFileError) {
|
|
3936
3968
|
setIsEncrypted(true);
|
|
3937
3969
|
} else {
|
|
3938
3970
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -3972,7 +4004,8 @@ function useAutosave(input) {
|
|
|
3972
4004
|
filePath,
|
|
3973
4005
|
serializeSlides,
|
|
3974
4006
|
intervalSeconds = DEFAULT_AUTOSAVE_INTERVAL_SECONDS,
|
|
3975
|
-
enabled = true
|
|
4007
|
+
enabled = true,
|
|
4008
|
+
getChangeSources
|
|
3976
4009
|
} = input;
|
|
3977
4010
|
const [autosaveStatus, setAutosaveStatus] = react.useState({
|
|
3978
4011
|
state: "idle"
|
|
@@ -3981,6 +4014,8 @@ function useAutosave(input) {
|
|
|
3981
4014
|
const filePathRef = react.useRef(filePath);
|
|
3982
4015
|
const serializeRef = react.useRef(serializeSlides);
|
|
3983
4016
|
const isSavingRef = react.useRef(false);
|
|
4017
|
+
const changeSourcesRef = react.useRef(getChangeSources);
|
|
4018
|
+
const lastSnapshotRef = react.useRef(void 0);
|
|
3984
4019
|
react.useEffect(() => {
|
|
3985
4020
|
isDirtyRef.current = isDirty;
|
|
3986
4021
|
}, [isDirty]);
|
|
@@ -3990,14 +4025,22 @@ function useAutosave(input) {
|
|
|
3990
4025
|
react.useEffect(() => {
|
|
3991
4026
|
serializeRef.current = serializeSlides;
|
|
3992
4027
|
}, [serializeSlides]);
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4028
|
+
react.useEffect(() => {
|
|
4029
|
+
changeSourcesRef.current = getChangeSources;
|
|
4030
|
+
}, [getChangeSources]);
|
|
4031
|
+
const doAutosave = react.useCallback(async (options) => {
|
|
4032
|
+
const path = filePathRef.current;
|
|
4033
|
+
if (!path) {
|
|
4034
|
+
return;
|
|
4035
|
+
}
|
|
4036
|
+
const sources = changeSourcesRef.current?.() ?? [];
|
|
4037
|
+
if (!chunkWVDM36ZM_js.shouldWriteAutosaveSnapshot({
|
|
4038
|
+
filePath: path,
|
|
4039
|
+
isDirty: isDirtyRef.current,
|
|
4040
|
+
saving: isSavingRef.current,
|
|
4041
|
+
sources: options?.polled === true ? sources : [],
|
|
4042
|
+
lastSnapshot: lastSnapshotRef.current
|
|
4043
|
+
})) {
|
|
4001
4044
|
return;
|
|
4002
4045
|
}
|
|
4003
4046
|
isSavingRef.current = true;
|
|
@@ -4009,7 +4052,8 @@ function useAutosave(input) {
|
|
|
4009
4052
|
isSavingRef.current = false;
|
|
4010
4053
|
return;
|
|
4011
4054
|
}
|
|
4012
|
-
await
|
|
4055
|
+
await chunkWVDM36ZM_js.saveAutosaveSnapshot(path, data);
|
|
4056
|
+
lastSnapshotRef.current = chunkWVDM36ZM_js.autosaveSnapshotMark(path, sources);
|
|
4013
4057
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4014
4058
|
} catch (err) {
|
|
4015
4059
|
setAutosaveStatus({
|
|
@@ -4035,13 +4079,13 @@ function useAutosave(input) {
|
|
|
4035
4079
|
setAutosaveStatus((prev) => prev.state === "disabled" ? { state: "idle" } : prev);
|
|
4036
4080
|
const ms = computeAutosaveIntervalMs(intervalSeconds);
|
|
4037
4081
|
const id = setInterval(() => {
|
|
4038
|
-
void doAutosave();
|
|
4082
|
+
void doAutosave({ polled: true });
|
|
4039
4083
|
}, ms);
|
|
4040
4084
|
return () => clearInterval(id);
|
|
4041
4085
|
}, [enabled, filePath, intervalSeconds, doAutosave]);
|
|
4042
4086
|
return {
|
|
4043
4087
|
autosaveStatus,
|
|
4044
|
-
triggerAutosave: doAutosave
|
|
4088
|
+
triggerAutosave: () => doAutosave()
|
|
4045
4089
|
};
|
|
4046
4090
|
}
|
|
4047
4091
|
function useElementOperations(input) {
|
|
@@ -4096,11 +4140,11 @@ function useElementOperations(input) {
|
|
|
4096
4140
|
(elementId, updates) => {
|
|
4097
4141
|
if (masterView?.target) {
|
|
4098
4142
|
applyMasterViewWrite(
|
|
4099
|
-
|
|
4143
|
+
chunkWVDM36ZM_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
|
|
4100
4144
|
);
|
|
4101
4145
|
return;
|
|
4102
4146
|
}
|
|
4103
|
-
if (
|
|
4147
|
+
if (chunkWVDM36ZM_js.isTemplateElementId(elementId)) {
|
|
4104
4148
|
const slideId = activeSlide?.id;
|
|
4105
4149
|
if (slideId) {
|
|
4106
4150
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4148,7 +4192,7 @@ function useElementOperations(input) {
|
|
|
4148
4192
|
);
|
|
4149
4193
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4150
4194
|
(updates) => {
|
|
4151
|
-
if (!selectedElement || !
|
|
4195
|
+
if (!selectedElement || !chunkWVDM36ZM_js.hasShapeProperties(selectedElement)) {
|
|
4152
4196
|
return;
|
|
4153
4197
|
}
|
|
4154
4198
|
updateSelectedElement({
|
|
@@ -4159,17 +4203,17 @@ function useElementOperations(input) {
|
|
|
4159
4203
|
);
|
|
4160
4204
|
const updateSelectedTextStyle = react.useCallback(
|
|
4161
4205
|
(updates) => {
|
|
4162
|
-
if (!selectedElement || !
|
|
4206
|
+
if (!selectedElement || !chunkWVDM36ZM_js.hasTextProperties(selectedElement)) {
|
|
4163
4207
|
return;
|
|
4164
4208
|
}
|
|
4165
|
-
const inlineSel =
|
|
4209
|
+
const inlineSel = chunkWVDM36ZM_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4166
4210
|
if (inlineSel && selectedElement.textSegments) {
|
|
4167
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4211
|
+
const { newSegments: newSegments2, newSelection } = chunkWVDM36ZM_js.applyStyleToSelectedSegments(
|
|
4168
4212
|
selectedElement.textSegments,
|
|
4169
4213
|
inlineSel,
|
|
4170
4214
|
updates
|
|
4171
4215
|
);
|
|
4172
|
-
|
|
4216
|
+
chunkWVDM36ZM_js.setPendingSelectionRestore(newSelection);
|
|
4173
4217
|
updateSelectedElement({
|
|
4174
4218
|
textSegments: newSegments2
|
|
4175
4219
|
});
|
|
@@ -4189,12 +4233,12 @@ function useElementOperations(input) {
|
|
|
4189
4233
|
);
|
|
4190
4234
|
const updateSelectedTextCase = react.useCallback(
|
|
4191
4235
|
(mode) => {
|
|
4192
|
-
if (!selectedElement || !
|
|
4236
|
+
if (!selectedElement || !chunkWVDM36ZM_js.hasTextProperties(selectedElement)) {
|
|
4193
4237
|
return;
|
|
4194
4238
|
}
|
|
4195
|
-
const inlineSel =
|
|
4239
|
+
const inlineSel = chunkWVDM36ZM_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4196
4240
|
if (inlineSel && selectedElement.textSegments) {
|
|
4197
|
-
const newSegments =
|
|
4241
|
+
const newSegments = chunkWVDM36ZM_js.applyCaseTransformToSegments(
|
|
4198
4242
|
selectedElement.textSegments,
|
|
4199
4243
|
inlineSel,
|
|
4200
4244
|
mode
|
|
@@ -4204,14 +4248,14 @@ function useElementOperations(input) {
|
|
|
4204
4248
|
}
|
|
4205
4249
|
const updates = {};
|
|
4206
4250
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
4207
|
-
updates.textSegments =
|
|
4251
|
+
updates.textSegments = chunkWVDM36ZM_js.applyCaseTransformToSegments(
|
|
4208
4252
|
selectedElement.textSegments,
|
|
4209
4253
|
null,
|
|
4210
4254
|
mode
|
|
4211
4255
|
);
|
|
4212
4256
|
}
|
|
4213
4257
|
if (typeof selectedElement.text === "string") {
|
|
4214
|
-
updates.text =
|
|
4258
|
+
updates.text = chunkWVDM36ZM_js.transformTextCase(selectedElement.text, mode);
|
|
4215
4259
|
}
|
|
4216
4260
|
updateSelectedElement(updates);
|
|
4217
4261
|
},
|
|
@@ -4224,15 +4268,15 @@ function useElementOperations(input) {
|
|
|
4224
4268
|
[setSlides]
|
|
4225
4269
|
);
|
|
4226
4270
|
const masterViewTarget = masterView?.target ?? null;
|
|
4227
|
-
const activeElements = masterViewTarget ?
|
|
4271
|
+
const activeElements = masterViewTarget ? chunkWVDM36ZM_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4228
4272
|
const updateActiveElements = react.useCallback(
|
|
4229
4273
|
(updater) => {
|
|
4230
4274
|
if (masterView?.target) {
|
|
4231
4275
|
applyMasterViewWrite(
|
|
4232
|
-
|
|
4276
|
+
chunkWVDM36ZM_js.replaceMasterViewElements(
|
|
4233
4277
|
masterView,
|
|
4234
4278
|
masterView.target,
|
|
4235
|
-
updater(
|
|
4279
|
+
updater(chunkWVDM36ZM_js.masterViewElements(masterView, masterView.target))
|
|
4236
4280
|
)
|
|
4237
4281
|
);
|
|
4238
4282
|
return;
|
|
@@ -4285,7 +4329,7 @@ function useSectionOperations(input) {
|
|
|
4285
4329
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4286
4330
|
const addSection2 = react.useCallback(
|
|
4287
4331
|
(name, afterSlideIndex) => {
|
|
4288
|
-
const result =
|
|
4332
|
+
const result = chunkWVDM36ZM_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4289
4333
|
setSlides(result.slides);
|
|
4290
4334
|
setSections(result.sections);
|
|
4291
4335
|
markDirty();
|
|
@@ -4294,7 +4338,7 @@ function useSectionOperations(input) {
|
|
|
4294
4338
|
);
|
|
4295
4339
|
const renameSection2 = react.useCallback(
|
|
4296
4340
|
(sectionId, newName) => {
|
|
4297
|
-
const result =
|
|
4341
|
+
const result = chunkWVDM36ZM_js.renameSection(sections, slides, sectionId, newName);
|
|
4298
4342
|
setSections(result.sections);
|
|
4299
4343
|
setSlides(result.slides);
|
|
4300
4344
|
markDirty();
|
|
@@ -4303,7 +4347,7 @@ function useSectionOperations(input) {
|
|
|
4303
4347
|
);
|
|
4304
4348
|
const deleteSection2 = react.useCallback(
|
|
4305
4349
|
(sectionId) => {
|
|
4306
|
-
const result =
|
|
4350
|
+
const result = chunkWVDM36ZM_js.deleteSection(sections, slides, sectionId);
|
|
4307
4351
|
setSections(result.sections);
|
|
4308
4352
|
setSlides(result.slides);
|
|
4309
4353
|
markDirty();
|
|
@@ -4312,52 +4356,62 @@ function useSectionOperations(input) {
|
|
|
4312
4356
|
);
|
|
4313
4357
|
const moveSectionUp2 = react.useCallback(
|
|
4314
4358
|
(sectionId) => {
|
|
4315
|
-
setSections(
|
|
4359
|
+
setSections(chunkWVDM36ZM_js.moveSectionUp(sections, sectionId));
|
|
4316
4360
|
markDirty();
|
|
4317
4361
|
},
|
|
4318
4362
|
[sections, setSections, markDirty]
|
|
4319
4363
|
);
|
|
4320
4364
|
const moveSectionDown2 = react.useCallback(
|
|
4321
4365
|
(sectionId) => {
|
|
4322
|
-
setSections(
|
|
4366
|
+
setSections(chunkWVDM36ZM_js.moveSectionDown(sections, sectionId));
|
|
4323
4367
|
markDirty();
|
|
4324
4368
|
},
|
|
4325
4369
|
[sections, setSections, markDirty]
|
|
4326
4370
|
);
|
|
4327
4371
|
const moveSlidesToSection2 = react.useCallback(
|
|
4328
4372
|
(slideIndexes, targetSectionId) => {
|
|
4329
|
-
const result =
|
|
4373
|
+
const result = chunkWVDM36ZM_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4330
4374
|
setSlides(result.slides);
|
|
4331
4375
|
setSections(result.sections);
|
|
4332
4376
|
markDirty();
|
|
4333
4377
|
},
|
|
4334
4378
|
[sections, slides, setSlides, setSections, markDirty]
|
|
4335
4379
|
);
|
|
4380
|
+
const toggleSectionCollapse = react.useCallback(
|
|
4381
|
+
(sectionId) => {
|
|
4382
|
+
setSections(
|
|
4383
|
+
(prev) => prev.map((sec) => sec.id === sectionId ? { ...sec, collapsed: !sec.collapsed } : sec)
|
|
4384
|
+
);
|
|
4385
|
+
markDirty();
|
|
4386
|
+
},
|
|
4387
|
+
[setSections, markDirty]
|
|
4388
|
+
);
|
|
4336
4389
|
return {
|
|
4337
4390
|
addSection: addSection2,
|
|
4338
4391
|
renameSection: renameSection2,
|
|
4339
4392
|
deleteSection: deleteSection2,
|
|
4340
4393
|
moveSectionUp: moveSectionUp2,
|
|
4341
4394
|
moveSectionDown: moveSectionDown2,
|
|
4342
|
-
moveSlidesToSection: moveSlidesToSection2
|
|
4395
|
+
moveSlidesToSection: moveSlidesToSection2,
|
|
4396
|
+
toggleSectionCollapse
|
|
4343
4397
|
};
|
|
4344
4398
|
}
|
|
4345
4399
|
|
|
4346
4400
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4347
4401
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
4348
|
-
const resized =
|
|
4402
|
+
const resized = chunkWVDM36ZM_js.applyResize(
|
|
4349
4403
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
4350
4404
|
handle,
|
|
4351
4405
|
dx,
|
|
4352
4406
|
dy,
|
|
4353
4407
|
1,
|
|
4354
|
-
{ minSize:
|
|
4408
|
+
{ minSize: chunk4LWGAVAP_js.MIN_ELEMENT_SIZE }
|
|
4355
4409
|
);
|
|
4356
4410
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4357
4411
|
if (!snapToGrid) {
|
|
4358
4412
|
return box;
|
|
4359
4413
|
}
|
|
4360
|
-
return
|
|
4414
|
+
return chunkWVDM36ZM_js.snapBoxToGrid(box, handle, gridSpacingPx, chunk4LWGAVAP_js.MIN_ELEMENT_SIZE);
|
|
4361
4415
|
}
|
|
4362
4416
|
function resolveLiveTarget(input) {
|
|
4363
4417
|
const { livePatcher, editTemplateMode, activeSlide } = input;
|
|
@@ -4470,7 +4524,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4470
4524
|
width: el.width,
|
|
4471
4525
|
height: el.height
|
|
4472
4526
|
}));
|
|
4473
|
-
const snapResult =
|
|
4527
|
+
const snapResult = chunkWVDM36ZM_js.computeSnapToShape(
|
|
4474
4528
|
targetX,
|
|
4475
4529
|
targetY,
|
|
4476
4530
|
primaryEl.width,
|
|
@@ -4509,7 +4563,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4509
4563
|
if (live) {
|
|
4510
4564
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4511
4565
|
const start = drag.startPositionsById[id];
|
|
4512
|
-
|
|
4566
|
+
chunkWVDM36ZM_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4513
4567
|
x: start.x + appliedDx,
|
|
4514
4568
|
y: start.y + appliedDy
|
|
4515
4569
|
});
|
|
@@ -4543,27 +4597,28 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4543
4597
|
if (rs.domEl) {
|
|
4544
4598
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4545
4599
|
rs.domEl.style.top = `${geo.y}px`;
|
|
4546
|
-
rs.domEl.style.width = `${Math.max(geo.width,
|
|
4547
|
-
rs.domEl.style.height = `${Math.max(geo.height,
|
|
4600
|
+
rs.domEl.style.width = `${Math.max(geo.width, chunk4LWGAVAP_js.MIN_ELEMENT_SIZE)}px`;
|
|
4601
|
+
rs.domEl.style.height = `${Math.max(geo.height, chunk4LWGAVAP_js.MIN_ELEMENT_SIZE)}px`;
|
|
4548
4602
|
}
|
|
4549
4603
|
if (live) {
|
|
4550
|
-
|
|
4604
|
+
chunkWVDM36ZM_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4551
4605
|
x: geo.x,
|
|
4552
4606
|
y: geo.y,
|
|
4553
|
-
width: Math.max(geo.width,
|
|
4554
|
-
height: Math.max(geo.height,
|
|
4607
|
+
width: Math.max(geo.width, chunk4LWGAVAP_js.MIN_ELEMENT_SIZE),
|
|
4608
|
+
height: Math.max(geo.height, chunk4LWGAVAP_js.MIN_ELEMENT_SIZE)
|
|
4555
4609
|
});
|
|
4556
4610
|
}
|
|
4557
4611
|
}
|
|
4558
4612
|
function processAdjustmentMove(e, adj, editorScale, updateElementById) {
|
|
4559
4613
|
const dx = (e.clientX - adj.startClientX) / editorScale;
|
|
4560
|
-
const
|
|
4561
|
-
|
|
4614
|
+
const dy = (e.clientY - adj.startClientY) / editorScale;
|
|
4615
|
+
const adjustments = chunkWVDM36ZM_js.getDraggedShapeAdjustments(adj, dx, dy);
|
|
4616
|
+
if (!adj.moved && Math.hypot(dx, dy) > 2) {
|
|
4562
4617
|
adj.moved = true;
|
|
4563
4618
|
}
|
|
4564
4619
|
if (adj.moved) {
|
|
4565
4620
|
updateElementById(adj.elementId, {
|
|
4566
|
-
shapeAdjustments:
|
|
4621
|
+
shapeAdjustments: adjustments
|
|
4567
4622
|
});
|
|
4568
4623
|
}
|
|
4569
4624
|
}
|
|
@@ -4632,13 +4687,13 @@ function processPointerUp(input) {
|
|
|
4632
4687
|
if (i !== activeSlideIndex) {
|
|
4633
4688
|
return s;
|
|
4634
4689
|
}
|
|
4635
|
-
const rerouted =
|
|
4690
|
+
const rerouted = chunkWVDM36ZM_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4636
4691
|
if (rerouted.length === 0) {
|
|
4637
4692
|
return s;
|
|
4638
4693
|
}
|
|
4639
4694
|
return {
|
|
4640
4695
|
...s,
|
|
4641
|
-
elements:
|
|
4696
|
+
elements: chunkWVDM36ZM_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4642
4697
|
};
|
|
4643
4698
|
})
|
|
4644
4699
|
);
|
|
@@ -4663,9 +4718,9 @@ function processPointerUp(input) {
|
|
|
4663
4718
|
}
|
|
4664
4719
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4665
4720
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4666
|
-
const hitIds =
|
|
4721
|
+
const hitIds = chunkWVDM36ZM_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4667
4722
|
if (marquee.additive) {
|
|
4668
|
-
const merged =
|
|
4723
|
+
const merged = chunkWVDM36ZM_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4669
4724
|
if (merged.length > 0) {
|
|
4670
4725
|
applySelection(merged[0], merged);
|
|
4671
4726
|
} else {
|
|
@@ -4688,8 +4743,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4688
4743
|
}
|
|
4689
4744
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4690
4745
|
});
|
|
4691
|
-
const rerouted =
|
|
4692
|
-
return
|
|
4746
|
+
const rerouted = chunkWVDM36ZM_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4747
|
+
return chunkWVDM36ZM_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4693
4748
|
};
|
|
4694
4749
|
if (editTemplateMode) {
|
|
4695
4750
|
const slideId = activeSlide?.id;
|
|
@@ -4846,9 +4901,9 @@ function useCanvasInteractions(input) {
|
|
|
4846
4901
|
return;
|
|
4847
4902
|
}
|
|
4848
4903
|
const el = elementLookup.get(editId);
|
|
4849
|
-
if (el &&
|
|
4904
|
+
if (el && chunkWVDM36ZM_js.hasTextProperties(el)) {
|
|
4850
4905
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
4851
|
-
const newSegments =
|
|
4906
|
+
const newSegments = chunkWVDM36ZM_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
4852
4907
|
ops.updateElementById(editId, {
|
|
4853
4908
|
text: committedText,
|
|
4854
4909
|
textSegments: newSegments
|
|
@@ -4859,7 +4914,7 @@ function useCanvasInteractions(input) {
|
|
|
4859
4914
|
setInlineEditingText("");
|
|
4860
4915
|
};
|
|
4861
4916
|
const openEquationEditorForElement = (el) => {
|
|
4862
|
-
if (!
|
|
4917
|
+
if (!chunkWVDM36ZM_js.hasTextProperties(el)) {
|
|
4863
4918
|
return false;
|
|
4864
4919
|
}
|
|
4865
4920
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -4889,7 +4944,7 @@ function useCanvasInteractions(input) {
|
|
|
4889
4944
|
justInteractedRef.current = false;
|
|
4890
4945
|
} else {
|
|
4891
4946
|
const el = elementLookup.get(elementId);
|
|
4892
|
-
if (el &&
|
|
4947
|
+
if (el && chunkWVDM36ZM_js.hasTextProperties(el) && chunkWVDM36ZM_js.canInteractWithElement(el, "textEdit")) {
|
|
4893
4948
|
if (!openEquationEditorForElement(el)) {
|
|
4894
4949
|
setInlineEditingElementId(elementId);
|
|
4895
4950
|
setInlineEditingText(el.text ?? "");
|
|
@@ -4908,7 +4963,7 @@ function useCanvasInteractions(input) {
|
|
|
4908
4963
|
if (openEquationEditorForElement(el)) {
|
|
4909
4964
|
return;
|
|
4910
4965
|
}
|
|
4911
|
-
if (
|
|
4966
|
+
if (chunkWVDM36ZM_js.hasTextProperties(el) && chunkWVDM36ZM_js.canInteractWithElement(el, "textEdit")) {
|
|
4912
4967
|
setInlineEditingElementId(elementId);
|
|
4913
4968
|
setInlineEditingText(el.text ?? "");
|
|
4914
4969
|
}
|
|
@@ -4931,7 +4986,7 @@ function useCanvasInteractions(input) {
|
|
|
4931
4986
|
justSelectedRef.current = false;
|
|
4932
4987
|
}
|
|
4933
4988
|
const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
|
|
4934
|
-
const movableIds =
|
|
4989
|
+
const movableIds = chunkWVDM36ZM_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
|
|
4935
4990
|
if (movableIds.length === 0) {
|
|
4936
4991
|
return;
|
|
4937
4992
|
}
|
|
@@ -5001,7 +5056,7 @@ function useCanvasInteractions(input) {
|
|
|
5001
5056
|
const handleResizePointerDown = (elementId, e, handle) => {
|
|
5002
5057
|
e.stopPropagation();
|
|
5003
5058
|
const el = elementLookup.get(elementId);
|
|
5004
|
-
if (!el || !
|
|
5059
|
+
if (!el || !chunkWVDM36ZM_js.canInteractWithElement(el, "resize")) {
|
|
5005
5060
|
return;
|
|
5006
5061
|
}
|
|
5007
5062
|
resizeStateRef.current = {
|
|
@@ -5023,7 +5078,7 @@ function useCanvasInteractions(input) {
|
|
|
5023
5078
|
};
|
|
5024
5079
|
const handleRotate = (elementId, rotationDeg) => {
|
|
5025
5080
|
const el = elementLookup.get(elementId);
|
|
5026
|
-
if (!el || !
|
|
5081
|
+
if (!el || !chunkWVDM36ZM_js.canInteractWithElement(el, "rotate")) {
|
|
5027
5082
|
return;
|
|
5028
5083
|
}
|
|
5029
5084
|
ops.updateElementById(elementId, { rotation: rotationDeg });
|
|
@@ -5040,33 +5095,18 @@ function useCanvasInteractions(input) {
|
|
|
5040
5095
|
const handleFormatText = (updates) => {
|
|
5041
5096
|
ops.updateSelectedTextStyle(updates);
|
|
5042
5097
|
};
|
|
5043
|
-
const handleAdjustmentPointerDown = (elementId, e) => {
|
|
5098
|
+
const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
|
|
5044
5099
|
e.stopPropagation();
|
|
5045
5100
|
const el = elementLookup.get(elementId);
|
|
5046
|
-
if (!el || !(
|
|
5047
|
-
return;
|
|
5048
|
-
}
|
|
5049
|
-
if (!chunk7JPLVECA_js.canInteractWithElement(el, "adjustHandle")) {
|
|
5101
|
+
if (!el || !chunkWVDM36ZM_js.canInteractWithElement(el, "adjustHandle")) {
|
|
5050
5102
|
return;
|
|
5051
5103
|
}
|
|
5052
|
-
|
|
5053
|
-
el
|
|
5104
|
+
shapeAdjustmentDragStateRef.current = chunkWVDM36ZM_js.beginShapeAdjustment(
|
|
5105
|
+
el,
|
|
5106
|
+
descriptor,
|
|
5107
|
+
e.clientX,
|
|
5108
|
+
e.clientY
|
|
5054
5109
|
);
|
|
5055
|
-
if (!adjEntries.length) {
|
|
5056
|
-
return;
|
|
5057
|
-
}
|
|
5058
|
-
const [key, value] = adjEntries[0];
|
|
5059
|
-
shapeAdjustmentDragStateRef.current = {
|
|
5060
|
-
elementId,
|
|
5061
|
-
key,
|
|
5062
|
-
shapeType: el.shapeType ?? "rect",
|
|
5063
|
-
startClientX: e.clientX,
|
|
5064
|
-
startClientY: e.clientY,
|
|
5065
|
-
startAdjustment: value,
|
|
5066
|
-
startWidth: el.width,
|
|
5067
|
-
startHeight: el.height,
|
|
5068
|
-
moved: false
|
|
5069
|
-
};
|
|
5070
5110
|
};
|
|
5071
5111
|
return {
|
|
5072
5112
|
handleElementClick,
|
|
@@ -5108,7 +5148,7 @@ function createFileHandlers(deps) {
|
|
|
5108
5148
|
h = Math.round(h * scale);
|
|
5109
5149
|
}
|
|
5110
5150
|
addElement({
|
|
5111
|
-
id:
|
|
5151
|
+
id: chunkWVDM36ZM_js.generateElementId(),
|
|
5112
5152
|
type: "image",
|
|
5113
5153
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5114
5154
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5119,7 +5159,7 @@ function createFileHandlers(deps) {
|
|
|
5119
5159
|
};
|
|
5120
5160
|
img.onerror = () => {
|
|
5121
5161
|
addElement({
|
|
5122
|
-
id:
|
|
5162
|
+
id: chunkWVDM36ZM_js.generateElementId(),
|
|
5123
5163
|
type: "image",
|
|
5124
5164
|
x: 100,
|
|
5125
5165
|
y: 100,
|
|
@@ -5145,7 +5185,7 @@ function createFileHandlers(deps) {
|
|
|
5145
5185
|
const elFilePath = file.path;
|
|
5146
5186
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5147
5187
|
addElement({
|
|
5148
|
-
id:
|
|
5188
|
+
id: chunkWVDM36ZM_js.generateElementId(),
|
|
5149
5189
|
type: "media",
|
|
5150
5190
|
mediaType,
|
|
5151
5191
|
mediaMimeType: file.type || void 0,
|
|
@@ -5320,13 +5360,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5320
5360
|
return;
|
|
5321
5361
|
}
|
|
5322
5362
|
addElement({
|
|
5323
|
-
id:
|
|
5363
|
+
id: chunkWVDM36ZM_js.generateElementId(),
|
|
5324
5364
|
type: "smartArt",
|
|
5325
5365
|
x: 100,
|
|
5326
5366
|
y: 120,
|
|
5327
5367
|
width: 600,
|
|
5328
5368
|
height: 340,
|
|
5329
|
-
smartArtData:
|
|
5369
|
+
smartArtData: chunkWVDM36ZM_js.buildSmartArtPresetData(
|
|
5330
5370
|
layout,
|
|
5331
5371
|
defaultItems,
|
|
5332
5372
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5338,7 +5378,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5338
5378
|
return;
|
|
5339
5379
|
}
|
|
5340
5380
|
addElement({
|
|
5341
|
-
id:
|
|
5381
|
+
id: chunkWVDM36ZM_js.generateElementId(),
|
|
5342
5382
|
type: "shape",
|
|
5343
5383
|
x: 120,
|
|
5344
5384
|
y: 200,
|
|
@@ -5397,7 +5437,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5397
5437
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5398
5438
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5399
5439
|
addElement({
|
|
5400
|
-
id:
|
|
5440
|
+
id: chunkWVDM36ZM_js.generateElementId(),
|
|
5401
5441
|
type: "shape",
|
|
5402
5442
|
x: 120,
|
|
5403
5443
|
y: 200,
|
|
@@ -5419,11 +5459,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5419
5459
|
if (!activeSlide) {
|
|
5420
5460
|
return;
|
|
5421
5461
|
}
|
|
5422
|
-
const preset =
|
|
5462
|
+
const preset = chunkWVDM36ZM_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5423
5463
|
if (!preset) {
|
|
5424
5464
|
return;
|
|
5425
5465
|
}
|
|
5426
|
-
const defaultPptxAction =
|
|
5466
|
+
const defaultPptxAction = chunkWVDM36ZM_js.elementActionToPptxAction({
|
|
5427
5467
|
trigger: "click",
|
|
5428
5468
|
type: preset.defaultAction
|
|
5429
5469
|
});
|
|
@@ -5432,7 +5472,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5432
5472
|
defaultPptxAction.highlightClick = true;
|
|
5433
5473
|
}
|
|
5434
5474
|
addElement({
|
|
5435
|
-
id:
|
|
5475
|
+
id: chunkWVDM36ZM_js.generateElementId(),
|
|
5436
5476
|
type: "shape",
|
|
5437
5477
|
x: 150,
|
|
5438
5478
|
y: 150,
|
|
@@ -5499,14 +5539,14 @@ function useInsertElements(input) {
|
|
|
5499
5539
|
return;
|
|
5500
5540
|
}
|
|
5501
5541
|
addElement({
|
|
5502
|
-
id:
|
|
5542
|
+
id: chunkWVDM36ZM_js.generateElementId(),
|
|
5503
5543
|
type: "text",
|
|
5504
5544
|
x: 100,
|
|
5505
5545
|
y: 100,
|
|
5506
5546
|
width: 300,
|
|
5507
5547
|
height: 60,
|
|
5508
5548
|
text: "",
|
|
5509
|
-
textStyle: { fontSize:
|
|
5549
|
+
textStyle: { fontSize: chunk4LWGAVAP_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5510
5550
|
});
|
|
5511
5551
|
};
|
|
5512
5552
|
const handleAddShape = () => {
|
|
@@ -5514,7 +5554,7 @@ function useInsertElements(input) {
|
|
|
5514
5554
|
return;
|
|
5515
5555
|
}
|
|
5516
5556
|
addElement({
|
|
5517
|
-
id:
|
|
5557
|
+
id: chunkWVDM36ZM_js.generateElementId(),
|
|
5518
5558
|
type: "shape",
|
|
5519
5559
|
x: 150,
|
|
5520
5560
|
y: 150,
|
|
@@ -5533,15 +5573,15 @@ function useInsertElements(input) {
|
|
|
5533
5573
|
return;
|
|
5534
5574
|
}
|
|
5535
5575
|
addElement({
|
|
5536
|
-
...
|
|
5537
|
-
id:
|
|
5576
|
+
...chunkWVDM36ZM_js.newTableElement(chunk4LWGAVAP_js.DEFAULT_TABLE_ROWS, chunk4LWGAVAP_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5577
|
+
id: chunkWVDM36ZM_js.generateElementId()
|
|
5538
5578
|
});
|
|
5539
5579
|
};
|
|
5540
5580
|
const handleAddChart = (chartKind) => {
|
|
5541
5581
|
if (!activeSlide) {
|
|
5542
5582
|
return;
|
|
5543
5583
|
}
|
|
5544
|
-
addElement(
|
|
5584
|
+
addElement(chunkWVDM36ZM_js.createDefaultChartElement(chartKind));
|
|
5545
5585
|
};
|
|
5546
5586
|
const structured = createStructuredElementHandlers({
|
|
5547
5587
|
activeSlide,
|
|
@@ -5611,7 +5651,7 @@ function useClipboardHandlers(input) {
|
|
|
5611
5651
|
if (!selectedElement) {
|
|
5612
5652
|
return;
|
|
5613
5653
|
}
|
|
5614
|
-
setClipboardPayload(
|
|
5654
|
+
setClipboardPayload(chunkWVDM36ZM_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5615
5655
|
};
|
|
5616
5656
|
const handleDelete = () => {
|
|
5617
5657
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5628,7 +5668,7 @@ function useClipboardHandlers(input) {
|
|
|
5628
5668
|
handleDelete();
|
|
5629
5669
|
};
|
|
5630
5670
|
const insertClone = (source) => {
|
|
5631
|
-
const clone =
|
|
5671
|
+
const clone = chunkWVDM36ZM_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5632
5672
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5633
5673
|
ops.applySelection(clone.id);
|
|
5634
5674
|
history.markDirty();
|
|
@@ -5663,7 +5703,7 @@ function resolveShapePath(el) {
|
|
|
5663
5703
|
return el.pathData;
|
|
5664
5704
|
}
|
|
5665
5705
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5666
|
-
const clipPath =
|
|
5706
|
+
const clipPath = chunkWVDM36ZM_js.getPresetShapeClipPath(el.shapeType);
|
|
5667
5707
|
if (clipPath) {
|
|
5668
5708
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5669
5709
|
if (svgPath) {
|
|
@@ -5714,7 +5754,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5714
5754
|
return parts.join(" ");
|
|
5715
5755
|
}
|
|
5716
5756
|
function transformPathToGlobal(pathData, el) {
|
|
5717
|
-
const polys =
|
|
5757
|
+
const polys = chunkWVDM36ZM_js.svgPathToPolygons(pathData);
|
|
5718
5758
|
if (polys.length === 0) {
|
|
5719
5759
|
return pathData;
|
|
5720
5760
|
}
|
|
@@ -5734,10 +5774,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5734
5774
|
y: pt.y * scaleY + el.y
|
|
5735
5775
|
}))
|
|
5736
5776
|
);
|
|
5737
|
-
return
|
|
5777
|
+
return chunkWVDM36ZM_js.polygonsToSvgPath(transformed);
|
|
5738
5778
|
}
|
|
5739
5779
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5740
|
-
const polys =
|
|
5780
|
+
const polys = chunkWVDM36ZM_js.svgPathToPolygons(pathData);
|
|
5741
5781
|
if (polys.length === 0) {
|
|
5742
5782
|
return pathData;
|
|
5743
5783
|
}
|
|
@@ -5747,10 +5787,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5747
5787
|
y: pt.y - y
|
|
5748
5788
|
}))
|
|
5749
5789
|
);
|
|
5750
|
-
return
|
|
5790
|
+
return chunkWVDM36ZM_js.polygonsToSvgPath(transformed);
|
|
5751
5791
|
}
|
|
5752
5792
|
function pathBounds(pathData) {
|
|
5753
|
-
const polys =
|
|
5793
|
+
const polys = chunkWVDM36ZM_js.svgPathToPolygons(pathData);
|
|
5754
5794
|
let minX = Infinity;
|
|
5755
5795
|
let minY = Infinity;
|
|
5756
5796
|
let maxX = -Infinity;
|
|
@@ -5809,7 +5849,7 @@ function useMergeShapesHandler(input) {
|
|
|
5809
5849
|
let allFragments = [];
|
|
5810
5850
|
let remaining = globalPaths[0];
|
|
5811
5851
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5812
|
-
const frags =
|
|
5852
|
+
const frags = chunkWVDM36ZM_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
5813
5853
|
if (Array.isArray(frags)) {
|
|
5814
5854
|
allFragments = frags;
|
|
5815
5855
|
}
|
|
@@ -5838,7 +5878,7 @@ function useMergeShapesHandler(input) {
|
|
|
5838
5878
|
bounds.height
|
|
5839
5879
|
);
|
|
5840
5880
|
const newEl = {
|
|
5841
|
-
id:
|
|
5881
|
+
id: chunkWVDM36ZM_js.generateElementId(),
|
|
5842
5882
|
type: "shape",
|
|
5843
5883
|
x: bounds.x,
|
|
5844
5884
|
y: bounds.y,
|
|
@@ -5876,7 +5916,7 @@ function useMergeShapesHandler(input) {
|
|
|
5876
5916
|
} else {
|
|
5877
5917
|
let resultPath = globalPaths[0];
|
|
5878
5918
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5879
|
-
const result =
|
|
5919
|
+
const result = chunkWVDM36ZM_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
5880
5920
|
if (typeof result === "string") {
|
|
5881
5921
|
resultPath = result;
|
|
5882
5922
|
}
|
|
@@ -5897,7 +5937,7 @@ function useMergeShapesHandler(input) {
|
|
|
5897
5937
|
);
|
|
5898
5938
|
const primary = targets[0];
|
|
5899
5939
|
const newEl = {
|
|
5900
|
-
id:
|
|
5940
|
+
id: chunkWVDM36ZM_js.generateElementId(),
|
|
5901
5941
|
type: "shape",
|
|
5902
5942
|
x: bounds.x,
|
|
5903
5943
|
y: bounds.y,
|
|
@@ -5960,7 +6000,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5960
6000
|
if (ids.length < 2 || !activeSlide) {
|
|
5961
6001
|
return;
|
|
5962
6002
|
}
|
|
5963
|
-
const { elements, groupId } =
|
|
6003
|
+
const { elements, groupId } = chunkWVDM36ZM_js.groupElements(ops.activeElements, ids, chunkWVDM36ZM_js.generateElementId());
|
|
5964
6004
|
if (groupId === null) {
|
|
5965
6005
|
return;
|
|
5966
6006
|
}
|
|
@@ -5973,11 +6013,11 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5973
6013
|
return;
|
|
5974
6014
|
}
|
|
5975
6015
|
const group = selectedElement;
|
|
5976
|
-
const intoTemplate =
|
|
6016
|
+
const intoTemplate = chunkWVDM36ZM_js.isTemplateElementId(group.id);
|
|
5977
6017
|
const childIds = group.children.map(
|
|
5978
|
-
(child) => intoTemplate ?
|
|
6018
|
+
(child) => intoTemplate ? chunkWVDM36ZM_js.makeCloneId(true, child.id || group.id) : child.id || chunkWVDM36ZM_js.generateElementId()
|
|
5979
6019
|
);
|
|
5980
|
-
const { elements, childIds: usedIds } =
|
|
6020
|
+
const { elements, childIds: usedIds } = chunkWVDM36ZM_js.ungroupElements(
|
|
5981
6021
|
ops.activeElements,
|
|
5982
6022
|
group.id,
|
|
5983
6023
|
childIds,
|
|
@@ -6006,7 +6046,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6006
6046
|
if (!edge) {
|
|
6007
6047
|
return;
|
|
6008
6048
|
}
|
|
6009
|
-
const positions =
|
|
6049
|
+
const positions = chunkWVDM36ZM_js.alignElements(selectedElements, edge);
|
|
6010
6050
|
for (const [id, pos] of positions) {
|
|
6011
6051
|
const el = elementLookup.get(id);
|
|
6012
6052
|
if (!el) {
|
|
@@ -6024,7 +6064,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6024
6064
|
if (!distAxis) {
|
|
6025
6065
|
return;
|
|
6026
6066
|
}
|
|
6027
|
-
const positions =
|
|
6067
|
+
const positions = chunkWVDM36ZM_js.distributeElements(selectedElements, distAxis);
|
|
6028
6068
|
for (const [id, pos] of positions) {
|
|
6029
6069
|
const el = elementLookup.get(id);
|
|
6030
6070
|
if (!el) {
|
|
@@ -6041,7 +6081,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6041
6081
|
}
|
|
6042
6082
|
const id = selectedElement.id;
|
|
6043
6083
|
ops.updateActiveElements(
|
|
6044
|
-
(els) => direction === "forward" ?
|
|
6084
|
+
(els) => direction === "forward" ? chunkWVDM36ZM_js.bringForward(els, id) : direction === "backward" ? chunkWVDM36ZM_js.sendBackward(els, id) : els
|
|
6045
6085
|
);
|
|
6046
6086
|
history.markDirty();
|
|
6047
6087
|
};
|
|
@@ -6051,7 +6091,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6051
6091
|
}
|
|
6052
6092
|
const id = selectedElement.id;
|
|
6053
6093
|
ops.updateActiveElements(
|
|
6054
|
-
(els) => direction === "front" ?
|
|
6094
|
+
(els) => direction === "front" ? chunkWVDM36ZM_js.bringToFront(els, id) : chunkWVDM36ZM_js.sendToBack(els, id)
|
|
6055
6095
|
);
|
|
6056
6096
|
history.markDirty();
|
|
6057
6097
|
};
|
|
@@ -6182,7 +6222,7 @@ function useSlideManagement(input) {
|
|
|
6182
6222
|
theme
|
|
6183
6223
|
} = input;
|
|
6184
6224
|
const handleAddSlide = () => {
|
|
6185
|
-
const newSlide =
|
|
6225
|
+
const newSlide = chunkWVDM36ZM_js.createBlankSlide(slides.length + 1);
|
|
6186
6226
|
ops.updateSlides((prev) => {
|
|
6187
6227
|
const next = [...prev];
|
|
6188
6228
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6245,7 +6285,7 @@ function useSlideManagement(input) {
|
|
|
6245
6285
|
}
|
|
6246
6286
|
const clone = {
|
|
6247
6287
|
...src,
|
|
6248
|
-
id:
|
|
6288
|
+
id: chunkWVDM36ZM_js.makeSlideId(),
|
|
6249
6289
|
elements: src.elements.map((el) => ({
|
|
6250
6290
|
...el,
|
|
6251
6291
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6277,7 +6317,7 @@ function useSlideManagement(input) {
|
|
|
6277
6317
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6278
6318
|
const insertAt = activeSlideIndex + 1;
|
|
6279
6319
|
const draft = {
|
|
6280
|
-
...
|
|
6320
|
+
...chunkWVDM36ZM_js.createBlankSlide(slides.length + 1),
|
|
6281
6321
|
layoutPath,
|
|
6282
6322
|
...layoutName ? { layoutName } : {}
|
|
6283
6323
|
};
|
|
@@ -6310,9 +6350,9 @@ function useSlideManagement(input) {
|
|
|
6310
6350
|
};
|
|
6311
6351
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6312
6352
|
const insertAt = activeSlideIndex + 1;
|
|
6313
|
-
const draft =
|
|
6353
|
+
const draft = chunkWVDM36ZM_js.buildSlideTemplateSlide(templateId, chunkWVDM36ZM_js.makeSlideId(), slides.length + 1, {
|
|
6314
6354
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6315
|
-
scheme:
|
|
6355
|
+
scheme: chunkWVDM36ZM_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6316
6356
|
});
|
|
6317
6357
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6318
6358
|
setActiveSlideIndex(insertAt);
|
|
@@ -6349,7 +6389,7 @@ function createTableMergeHandlers(input) {
|
|
|
6349
6389
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6350
6390
|
return;
|
|
6351
6391
|
}
|
|
6352
|
-
const newTableData =
|
|
6392
|
+
const newTableData = chunkWVDM36ZM_js.mergeCells(
|
|
6353
6393
|
[
|
|
6354
6394
|
{ row: rowIndex, col: columnIndex },
|
|
6355
6395
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6357,7 +6397,7 @@ function createTableMergeHandlers(input) {
|
|
|
6357
6397
|
td
|
|
6358
6398
|
);
|
|
6359
6399
|
const updates = { tableData: newTableData };
|
|
6360
|
-
const newRawXml =
|
|
6400
|
+
const newRawXml = chunkWVDM36ZM_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6361
6401
|
if (newRawXml) {
|
|
6362
6402
|
updates.rawXml = newRawXml;
|
|
6363
6403
|
}
|
|
@@ -6383,7 +6423,7 @@ function createTableMergeHandlers(input) {
|
|
|
6383
6423
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6384
6424
|
return;
|
|
6385
6425
|
}
|
|
6386
|
-
const newTableData =
|
|
6426
|
+
const newTableData = chunkWVDM36ZM_js.mergeCells(
|
|
6387
6427
|
[
|
|
6388
6428
|
{ row: rowIndex, col: columnIndex },
|
|
6389
6429
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6391,7 +6431,7 @@ function createTableMergeHandlers(input) {
|
|
|
6391
6431
|
td
|
|
6392
6432
|
);
|
|
6393
6433
|
const updates = { tableData: newTableData };
|
|
6394
|
-
const newRawXml =
|
|
6434
|
+
const newRawXml = chunkWVDM36ZM_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6395
6435
|
if (newRawXml) {
|
|
6396
6436
|
updates.rawXml = newRawXml;
|
|
6397
6437
|
}
|
|
@@ -6406,9 +6446,9 @@ function createTableMergeHandlers(input) {
|
|
|
6406
6446
|
return;
|
|
6407
6447
|
}
|
|
6408
6448
|
const td = selectedElement.tableData;
|
|
6409
|
-
const newTableData =
|
|
6449
|
+
const newTableData = chunkWVDM36ZM_js.mergeCells(ts.selectedCells, td);
|
|
6410
6450
|
const updates = { tableData: newTableData };
|
|
6411
|
-
const newRawXml =
|
|
6451
|
+
const newRawXml = chunkWVDM36ZM_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6412
6452
|
if (newRawXml) {
|
|
6413
6453
|
updates.rawXml = newRawXml;
|
|
6414
6454
|
}
|
|
@@ -6425,9 +6465,9 @@ function createTableMergeHandlers(input) {
|
|
|
6425
6465
|
}
|
|
6426
6466
|
const { rowIndex, columnIndex } = ts;
|
|
6427
6467
|
const td = selectedElement.tableData;
|
|
6428
|
-
const newTableData =
|
|
6468
|
+
const newTableData = chunkWVDM36ZM_js.splitCell(rowIndex, columnIndex, td);
|
|
6429
6469
|
const updates = { tableData: newTableData };
|
|
6430
|
-
const newRawXml =
|
|
6470
|
+
const newRawXml = chunkWVDM36ZM_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6431
6471
|
if (newRawXml) {
|
|
6432
6472
|
updates.rawXml = newRawXml;
|
|
6433
6473
|
}
|
|
@@ -6471,7 +6511,7 @@ function createTableStructHandlers(input) {
|
|
|
6471
6511
|
updates.tableData = { ...el.tableData, rows: newRows };
|
|
6472
6512
|
}
|
|
6473
6513
|
if (el.rawXml) {
|
|
6474
|
-
const newRawXml =
|
|
6514
|
+
const newRawXml = chunkWVDM36ZM_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6475
6515
|
if (newRawXml) {
|
|
6476
6516
|
updates.rawXml = newRawXml;
|
|
6477
6517
|
}
|
|
@@ -6495,7 +6535,7 @@ function createTableStructHandlers(input) {
|
|
|
6495
6535
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6496
6536
|
const updates = {};
|
|
6497
6537
|
if (selectedElement.rawXml) {
|
|
6498
|
-
const newRawXml =
|
|
6538
|
+
const newRawXml = chunkWVDM36ZM_js.updateCellTextStyleInRawXml(
|
|
6499
6539
|
selectedElement,
|
|
6500
6540
|
rowIndex,
|
|
6501
6541
|
colIndex,
|
|
@@ -6559,9 +6599,9 @@ function createTableStructHandlers(input) {
|
|
|
6559
6599
|
return;
|
|
6560
6600
|
}
|
|
6561
6601
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6562
|
-
const newTableData =
|
|
6602
|
+
const newTableData = chunkWVDM36ZM_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6563
6603
|
const updates = { tableData: newTableData };
|
|
6564
|
-
const newRawXml =
|
|
6604
|
+
const newRawXml = chunkWVDM36ZM_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6565
6605
|
if (newRawXml) {
|
|
6566
6606
|
updates.rawXml = newRawXml;
|
|
6567
6607
|
}
|
|
@@ -6574,12 +6614,12 @@ function createTableStructHandlers(input) {
|
|
|
6574
6614
|
}
|
|
6575
6615
|
const td = selectedElement.tableData;
|
|
6576
6616
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6577
|
-
const newTableData =
|
|
6617
|
+
const newTableData = chunkWVDM36ZM_js.deleteTableRow(td, rowIdx);
|
|
6578
6618
|
if (newTableData === td) {
|
|
6579
6619
|
return;
|
|
6580
6620
|
}
|
|
6581
6621
|
const updates = { tableData: newTableData };
|
|
6582
|
-
const newRawXml =
|
|
6622
|
+
const newRawXml = chunkWVDM36ZM_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6583
6623
|
if (newRawXml) {
|
|
6584
6624
|
updates.rawXml = newRawXml;
|
|
6585
6625
|
}
|
|
@@ -6591,9 +6631,9 @@ function createTableStructHandlers(input) {
|
|
|
6591
6631
|
return;
|
|
6592
6632
|
}
|
|
6593
6633
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6594
|
-
const newTableData =
|
|
6634
|
+
const newTableData = chunkWVDM36ZM_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6595
6635
|
const updates = { tableData: newTableData };
|
|
6596
|
-
const newRawXml =
|
|
6636
|
+
const newRawXml = chunkWVDM36ZM_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6597
6637
|
if (newRawXml) {
|
|
6598
6638
|
updates.rawXml = newRawXml;
|
|
6599
6639
|
}
|
|
@@ -6606,12 +6646,12 @@ function createTableStructHandlers(input) {
|
|
|
6606
6646
|
}
|
|
6607
6647
|
const td = selectedElement.tableData;
|
|
6608
6648
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6609
|
-
const newTableData =
|
|
6649
|
+
const newTableData = chunkWVDM36ZM_js.deleteTableColumn(td, colIdx);
|
|
6610
6650
|
if (newTableData === td) {
|
|
6611
6651
|
return;
|
|
6612
6652
|
}
|
|
6613
6653
|
const updates = { tableData: newTableData };
|
|
6614
|
-
const newRawXml =
|
|
6654
|
+
const newRawXml = chunkWVDM36ZM_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6615
6655
|
if (newRawXml) {
|
|
6616
6656
|
updates.rawXml = newRawXml;
|
|
6617
6657
|
}
|
|
@@ -6647,8 +6687,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6647
6687
|
return html2canvasPro(element, {
|
|
6648
6688
|
...options,
|
|
6649
6689
|
onclone: async (doc, clonedEl) => {
|
|
6650
|
-
await
|
|
6651
|
-
|
|
6690
|
+
await chunkWVDM36ZM_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6691
|
+
chunkWVDM36ZM_js.preprocessCssForCapture(clonedEl);
|
|
6652
6692
|
if (typeof userOnClone === "function") {
|
|
6653
6693
|
userOnClone(doc, clonedEl);
|
|
6654
6694
|
}
|
|
@@ -6704,7 +6744,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
6704
6744
|
}
|
|
6705
6745
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
6706
6746
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
6707
|
-
|
|
6747
|
+
chunkWVDM36ZM_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
6708
6748
|
}
|
|
6709
6749
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
6710
6750
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -6726,15 +6766,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6726
6766
|
continue;
|
|
6727
6767
|
}
|
|
6728
6768
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
6729
|
-
images.push(
|
|
6769
|
+
images.push(chunkWVDM36ZM_js.canvasToJpegData(canvas));
|
|
6730
6770
|
}
|
|
6731
6771
|
onProgress?.(totalSlides, totalSlides);
|
|
6732
6772
|
setActiveSlide(currentSlideIndex);
|
|
6733
6773
|
if (images.length === 0) {
|
|
6734
|
-
throw new Error(
|
|
6774
|
+
throw new Error(chunkRTUGI4HQ_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
6735
6775
|
}
|
|
6736
|
-
const pdfBlobUrl =
|
|
6737
|
-
|
|
6776
|
+
const pdfBlobUrl = chunk4LWGAVAP_js.buildPdfFromImageData(images);
|
|
6777
|
+
chunkWVDM36ZM_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
6738
6778
|
}
|
|
6739
6779
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
6740
6780
|
const { scale = 2, onProgress } = options;
|
|
@@ -6780,10 +6820,10 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
6780
6820
|
onProgress?.(totalSlides, totalSlides);
|
|
6781
6821
|
setActiveSlide(currentSlideIndex);
|
|
6782
6822
|
if (pages.length === 0) {
|
|
6783
|
-
throw new Error(
|
|
6823
|
+
throw new Error(chunkRTUGI4HQ_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
6784
6824
|
}
|
|
6785
|
-
const pdfDataUrl =
|
|
6786
|
-
|
|
6825
|
+
const pdfDataUrl = chunk4LWGAVAP_js.buildNotesPdf(pages);
|
|
6826
|
+
chunkWVDM36ZM_js.downloadDataUrl(pdfDataUrl, filename);
|
|
6787
6827
|
}
|
|
6788
6828
|
|
|
6789
6829
|
// src/viewer/utils/export-video.ts
|
|
@@ -6814,7 +6854,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6814
6854
|
}
|
|
6815
6855
|
setActiveSlide(currentSlideIndex);
|
|
6816
6856
|
if (slideCanvases.length === 0) {
|
|
6817
|
-
throw new Error(
|
|
6857
|
+
throw new Error(chunkRTUGI4HQ_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
|
|
6818
6858
|
}
|
|
6819
6859
|
const firstCanvas = slideCanvases[0];
|
|
6820
6860
|
const recordingCanvas = document.createElement("canvas");
|
|
@@ -6822,12 +6862,12 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6822
6862
|
recordingCanvas.height = firstCanvas.height;
|
|
6823
6863
|
const ctx = recordingCanvas.getContext("2d");
|
|
6824
6864
|
if (!ctx) {
|
|
6825
|
-
throw new Error(
|
|
6865
|
+
throw new Error(chunkRTUGI4HQ_js.translationsEn["pptx.export.errorNo2dContext"]);
|
|
6826
6866
|
}
|
|
6827
6867
|
const fps = 30;
|
|
6828
6868
|
const stream = recordingCanvas.captureStream(fps);
|
|
6829
6869
|
const recorder = new MediaRecorder(stream, {
|
|
6830
|
-
mimeType:
|
|
6870
|
+
mimeType: chunkWVDM36ZM_js.pickSupportedMimeType([...chunkWVDM36ZM_js.WEBM_MIME_CANDIDATES]),
|
|
6831
6871
|
videoBitsPerSecond: 5e6
|
|
6832
6872
|
});
|
|
6833
6873
|
const chunks = [];
|
|
@@ -6850,8 +6890,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6850
6890
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
6851
6891
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
6852
6892
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
6853
|
-
const frameInterval =
|
|
6854
|
-
const framesNeeded =
|
|
6893
|
+
const frameInterval = chunkWVDM36ZM_js.fpsToFrameIntervalMs(fps);
|
|
6894
|
+
const framesNeeded = chunkWVDM36ZM_js.segmentFrameCount(duration, fps);
|
|
6855
6895
|
for (let f = 0; f < framesNeeded; f++) {
|
|
6856
6896
|
if (signal?.aborted) {
|
|
6857
6897
|
recorder.stop();
|
|
@@ -6898,9 +6938,9 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6898
6938
|
}
|
|
6899
6939
|
setActiveSlide(currentSlideIndex);
|
|
6900
6940
|
if (frames.length === 0) {
|
|
6901
|
-
throw new Error(
|
|
6941
|
+
throw new Error(chunkRTUGI4HQ_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
6902
6942
|
}
|
|
6903
|
-
const gifBytes =
|
|
6943
|
+
const gifBytes = chunkWVDM36ZM_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
6904
6944
|
onProgress?.(totalSlides, totalSlides);
|
|
6905
6945
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
6906
6946
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -6954,7 +6994,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
6954
6994
|
continue;
|
|
6955
6995
|
}
|
|
6956
6996
|
onProgress?.(processedCount, data.slides.length);
|
|
6957
|
-
let svg =
|
|
6997
|
+
let svg = chunkWVDM36ZM_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
6958
6998
|
if (embedFonts && fontFaces?.length) {
|
|
6959
6999
|
svg = injectFontFaces(svg, fontFaces);
|
|
6960
7000
|
}
|
|
@@ -6981,12 +7021,14 @@ function useExportSaveAs(input) {
|
|
|
6981
7021
|
appProperties,
|
|
6982
7022
|
customProperties,
|
|
6983
7023
|
tagCollections,
|
|
7024
|
+
slideMasters,
|
|
6984
7025
|
notesMaster,
|
|
6985
7026
|
handoutMaster,
|
|
6986
7027
|
guides,
|
|
6987
7028
|
activeSlideIndexForGuides,
|
|
6988
7029
|
theme,
|
|
6989
7030
|
canvasSize,
|
|
7031
|
+
slideSizeEmu,
|
|
6990
7032
|
modalControls,
|
|
6991
7033
|
password
|
|
6992
7034
|
} = input;
|
|
@@ -7010,13 +7052,13 @@ function useExportSaveAs(input) {
|
|
|
7010
7052
|
setExportProgress(10);
|
|
7011
7053
|
setExportStatusMessage("Adding presentation...");
|
|
7012
7054
|
const pptxData = await serializeSlides();
|
|
7013
|
-
const pptxFilename =
|
|
7055
|
+
const pptxFilename = chunkWVDM36ZM_js.savedPresentationFileName(filePath);
|
|
7014
7056
|
if (pptxData) {
|
|
7015
7057
|
pkgFolder.file(pptxFilename, pptxData);
|
|
7016
7058
|
}
|
|
7017
7059
|
setExportProgress(70);
|
|
7018
7060
|
setExportStatusMessage("Writing README...");
|
|
7019
|
-
const readme =
|
|
7061
|
+
const readme = chunkWVDM36ZM_js.generatePackageReadme(pptxFilename);
|
|
7020
7062
|
pkgFolder.file("README.txt", readme);
|
|
7021
7063
|
if (abortCtrl.signal.aborted) {
|
|
7022
7064
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -7026,8 +7068,7 @@ function useExportSaveAs(input) {
|
|
|
7026
7068
|
const zipBlob = await zip.generateAsync({ type: "blob" });
|
|
7027
7069
|
setExportProgress(95);
|
|
7028
7070
|
setExportStatusMessage("Downloading...");
|
|
7029
|
-
|
|
7030
|
-
chunk7JPLVECA_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
|
|
7071
|
+
chunkWVDM36ZM_js.downloadBlob(zipBlob, `${chunkWVDM36ZM_js.presentationBaseName(pptxFilename)}-package.zip`);
|
|
7031
7072
|
setExportProgress(100);
|
|
7032
7073
|
} catch (err) {
|
|
7033
7074
|
if (err.name !== "AbortError") {
|
|
@@ -7043,16 +7084,15 @@ function useExportSaveAs(input) {
|
|
|
7043
7084
|
if (!handler) {
|
|
7044
7085
|
return;
|
|
7045
7086
|
}
|
|
7046
|
-
const
|
|
7047
|
-
const baseName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop()?.replace(/\.[^.]+$/u, "") ?? "presentation" : "presentation";
|
|
7087
|
+
const downloadName = chunkWVDM36ZM_js.savedPresentationFileName(filePath, format);
|
|
7048
7088
|
try {
|
|
7049
7089
|
const data = await buildSaveAsData(handler, format);
|
|
7050
7090
|
const blob = new Blob([data], {
|
|
7051
7091
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
7052
7092
|
});
|
|
7053
|
-
|
|
7093
|
+
chunkWVDM36ZM_js.downloadBlob(blob, downloadName);
|
|
7054
7094
|
} catch (err) {
|
|
7055
|
-
console.error(`[PowerPointViewer] Save as .${
|
|
7095
|
+
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
7056
7096
|
}
|
|
7057
7097
|
};
|
|
7058
7098
|
const buildSaveAsData = async (handler, format) => {
|
|
@@ -7063,15 +7103,18 @@ function useExportSaveAs(input) {
|
|
|
7063
7103
|
const pptxGuides = guides.map((g) => ({
|
|
7064
7104
|
id: g.id,
|
|
7065
7105
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
7066
|
-
positionEmu:
|
|
7106
|
+
positionEmu: chunkWVDM36ZM_js.guidePxToEmu(g.position)
|
|
7067
7107
|
}));
|
|
7068
7108
|
return {
|
|
7069
7109
|
...slide,
|
|
7070
7110
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
7071
7111
|
};
|
|
7072
7112
|
});
|
|
7073
|
-
const slidesToSave =
|
|
7113
|
+
const slidesToSave = chunkWVDM36ZM_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
7074
7114
|
const saveOptions = {
|
|
7115
|
+
// Save As shares Save's slide-size decision; leaving it out here is how
|
|
7116
|
+
// a preset picked in the inspector reached one save path and not the other.
|
|
7117
|
+
slideSize: chunkWVDM36ZM_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
7075
7118
|
headerFooter,
|
|
7076
7119
|
presentationProperties,
|
|
7077
7120
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -7080,20 +7123,23 @@ function useExportSaveAs(input) {
|
|
|
7080
7123
|
appProperties: appProperties ?? void 0,
|
|
7081
7124
|
customProperties: customProperties.length > 0 ? customProperties : void 0,
|
|
7082
7125
|
tags: tagCollections.length > 0 ? tagCollections : void 0,
|
|
7126
|
+
slideMasters,
|
|
7083
7127
|
notesMaster,
|
|
7084
7128
|
handoutMaster,
|
|
7085
7129
|
outputFormat: format
|
|
7086
7130
|
};
|
|
7087
|
-
return
|
|
7131
|
+
return chunkWVDM36ZM_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
|
|
7088
7132
|
};
|
|
7089
7133
|
const handleExportJson = () => {
|
|
7090
7134
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7135
|
+
const slideSize = chunkWVDM36ZM_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
7091
7136
|
const data = {
|
|
7092
|
-
slides:
|
|
7137
|
+
slides: chunkWVDM36ZM_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7093
7138
|
width: canvasSize.width,
|
|
7094
7139
|
height: canvasSize.height,
|
|
7095
|
-
widthEmu:
|
|
7096
|
-
heightEmu:
|
|
7140
|
+
widthEmu: slideSize.widthEmu,
|
|
7141
|
+
heightEmu: slideSize.heightEmu,
|
|
7142
|
+
slideSizeType: slideSize.type === "" ? void 0 : slideSize.type,
|
|
7097
7143
|
theme,
|
|
7098
7144
|
headerFooter,
|
|
7099
7145
|
presentationProperties,
|
|
@@ -7107,7 +7153,7 @@ function useExportSaveAs(input) {
|
|
|
7107
7153
|
handoutMaster
|
|
7108
7154
|
};
|
|
7109
7155
|
try {
|
|
7110
|
-
|
|
7156
|
+
chunkWVDM36ZM_js.exportDeckJson(data, sourceName);
|
|
7111
7157
|
} catch (err) {
|
|
7112
7158
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7113
7159
|
}
|
|
@@ -7147,7 +7193,7 @@ function safeConfirm(message) {
|
|
|
7147
7193
|
}
|
|
7148
7194
|
}
|
|
7149
7195
|
function downloadBlob2(blob, filename) {
|
|
7150
|
-
|
|
7196
|
+
chunkWVDM36ZM_js.downloadBlob(blob, chunkWVDM36ZM_js.sanitizeDownloadFilename(filename));
|
|
7151
7197
|
}
|
|
7152
7198
|
|
|
7153
7199
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -7170,12 +7216,14 @@ function useExportHandlers(input) {
|
|
|
7170
7216
|
appProperties,
|
|
7171
7217
|
customProperties,
|
|
7172
7218
|
tagCollections,
|
|
7219
|
+
slideMasters,
|
|
7173
7220
|
notesMaster,
|
|
7174
7221
|
handoutMaster,
|
|
7175
7222
|
guides,
|
|
7176
7223
|
activeSlideIndexForGuides,
|
|
7177
7224
|
theme,
|
|
7178
7225
|
canvasSize,
|
|
7226
|
+
slideSizeEmu,
|
|
7179
7227
|
password
|
|
7180
7228
|
} = input;
|
|
7181
7229
|
const [exportModalOpen, setExportModalOpen] = react.useState(false);
|
|
@@ -7211,12 +7259,14 @@ function useExportHandlers(input) {
|
|
|
7211
7259
|
appProperties,
|
|
7212
7260
|
customProperties,
|
|
7213
7261
|
tagCollections,
|
|
7262
|
+
slideMasters,
|
|
7214
7263
|
notesMaster,
|
|
7215
7264
|
handoutMaster,
|
|
7216
7265
|
guides,
|
|
7217
7266
|
activeSlideIndexForGuides,
|
|
7218
7267
|
theme,
|
|
7219
7268
|
canvasSize,
|
|
7269
|
+
slideSizeEmu,
|
|
7220
7270
|
modalControls,
|
|
7221
7271
|
password
|
|
7222
7272
|
});
|
|
@@ -7253,21 +7303,21 @@ function useExportHandlers(input) {
|
|
|
7253
7303
|
{
|
|
7254
7304
|
scale: 2,
|
|
7255
7305
|
onProgress: (current, total) => {
|
|
7256
|
-
setExportProgress(
|
|
7257
|
-
setExportStatusMessage(
|
|
7306
|
+
setExportProgress(chunkWVDM36ZM_js.slideProgressPercent(current, total));
|
|
7307
|
+
setExportStatusMessage(chunkWVDM36ZM_js.slideStatusLabel("Rendering", current, total));
|
|
7258
7308
|
},
|
|
7259
7309
|
signal: abortCtrl.signal
|
|
7260
7310
|
}
|
|
7261
7311
|
);
|
|
7262
|
-
setExportProgress(
|
|
7312
|
+
setExportProgress(chunkWVDM36ZM_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7263
7313
|
setExportStatusMessage("Building PDF...");
|
|
7264
7314
|
await new Promise((r) => {
|
|
7265
7315
|
setTimeout(r, 100);
|
|
7266
7316
|
});
|
|
7267
|
-
setExportProgress(
|
|
7317
|
+
setExportProgress(chunkWVDM36ZM_js.EXPORT_DONE_PERCENT);
|
|
7268
7318
|
setExportStatusMessage("Done!");
|
|
7269
7319
|
} catch (err) {
|
|
7270
|
-
if (!
|
|
7320
|
+
if (!chunkWVDM36ZM_js.isExportAbortError(err)) {
|
|
7271
7321
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7272
7322
|
}
|
|
7273
7323
|
} finally {
|
|
@@ -7297,21 +7347,21 @@ function useExportHandlers(input) {
|
|
|
7297
7347
|
{
|
|
7298
7348
|
scale: 2,
|
|
7299
7349
|
onProgress: (current, total) => {
|
|
7300
|
-
setExportProgress(
|
|
7301
|
-
setExportStatusMessage(
|
|
7350
|
+
setExportProgress(chunkWVDM36ZM_js.slideProgressPercent(current, total));
|
|
7351
|
+
setExportStatusMessage(chunkWVDM36ZM_js.slideStatusLabel("Rendering", current, total));
|
|
7302
7352
|
},
|
|
7303
7353
|
signal: abortCtrl.signal
|
|
7304
7354
|
}
|
|
7305
7355
|
);
|
|
7306
|
-
setExportProgress(
|
|
7356
|
+
setExportProgress(chunkWVDM36ZM_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7307
7357
|
setExportStatusMessage("Building PDF...");
|
|
7308
7358
|
await new Promise((r) => {
|
|
7309
7359
|
setTimeout(r, 100);
|
|
7310
7360
|
});
|
|
7311
|
-
setExportProgress(
|
|
7361
|
+
setExportProgress(chunkWVDM36ZM_js.EXPORT_DONE_PERCENT);
|
|
7312
7362
|
setExportStatusMessage("Done!");
|
|
7313
7363
|
} catch (err) {
|
|
7314
|
-
if (!
|
|
7364
|
+
if (!chunkWVDM36ZM_js.isExportAbortError(err)) {
|
|
7315
7365
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7316
7366
|
}
|
|
7317
7367
|
} finally {
|
|
@@ -7352,22 +7402,22 @@ function useExportHandlers(input) {
|
|
|
7352
7402
|
scale: 1,
|
|
7353
7403
|
slideDurationMs: 3e3,
|
|
7354
7404
|
onProgress: (current, total) => {
|
|
7355
|
-
setExportProgress(
|
|
7356
|
-
setExportStatusMessage(
|
|
7405
|
+
setExportProgress(chunkWVDM36ZM_js.slideProgressPercent(current, total, 45));
|
|
7406
|
+
setExportStatusMessage(chunkWVDM36ZM_js.slideStatusLabel("Capturing", current, total));
|
|
7357
7407
|
},
|
|
7358
7408
|
onRecordProgress: (current, total) => {
|
|
7359
|
-
setExportProgress(
|
|
7360
|
-
setExportStatusMessage(
|
|
7409
|
+
setExportProgress(chunkWVDM36ZM_js.recordProgressPercent(current, total));
|
|
7410
|
+
setExportStatusMessage(chunkWVDM36ZM_js.slideStatusLabel("Recording", current, total));
|
|
7361
7411
|
},
|
|
7362
7412
|
signal: abortCtrl.signal
|
|
7363
7413
|
}
|
|
7364
7414
|
);
|
|
7365
|
-
setExportProgress(
|
|
7415
|
+
setExportProgress(chunkWVDM36ZM_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7366
7416
|
setExportStatusMessage("Saving file...");
|
|
7367
7417
|
downloadBlob2(blob, "presentation.webm");
|
|
7368
|
-
setExportProgress(
|
|
7418
|
+
setExportProgress(chunkWVDM36ZM_js.EXPORT_DONE_PERCENT);
|
|
7369
7419
|
} catch (err) {
|
|
7370
|
-
if (!
|
|
7420
|
+
if (!chunkWVDM36ZM_js.isExportAbortError(err)) {
|
|
7371
7421
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7372
7422
|
}
|
|
7373
7423
|
} finally {
|
|
@@ -7395,18 +7445,18 @@ function useExportHandlers(input) {
|
|
|
7395
7445
|
scale: 0.5,
|
|
7396
7446
|
slideDurationMs: 2e3,
|
|
7397
7447
|
onProgress: (current, total) => {
|
|
7398
|
-
setExportProgress(
|
|
7399
|
-
setExportStatusMessage(
|
|
7448
|
+
setExportProgress(chunkWVDM36ZM_js.slideProgressPercent(current, total));
|
|
7449
|
+
setExportStatusMessage(chunkWVDM36ZM_js.slideStatusLabel("Encoding", current, total));
|
|
7400
7450
|
},
|
|
7401
7451
|
signal: abortCtrl.signal
|
|
7402
7452
|
}
|
|
7403
7453
|
);
|
|
7404
|
-
setExportProgress(
|
|
7454
|
+
setExportProgress(chunkWVDM36ZM_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7405
7455
|
setExportStatusMessage("Saving file...");
|
|
7406
7456
|
downloadBlob2(blob, "presentation.gif");
|
|
7407
|
-
setExportProgress(
|
|
7457
|
+
setExportProgress(chunkWVDM36ZM_js.EXPORT_DONE_PERCENT);
|
|
7408
7458
|
} catch (err) {
|
|
7409
|
-
if (!
|
|
7459
|
+
if (!chunkWVDM36ZM_js.isExportAbortError(err)) {
|
|
7410
7460
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7411
7461
|
}
|
|
7412
7462
|
} finally {
|
|
@@ -7447,7 +7497,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
7447
7497
|
}
|
|
7448
7498
|
printWindow.document.open();
|
|
7449
7499
|
printWindow.document.write(
|
|
7450
|
-
|
|
7500
|
+
chunkWVDM36ZM_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
7451
7501
|
);
|
|
7452
7502
|
printWindow.document.close();
|
|
7453
7503
|
printWindow.focus();
|
|
@@ -7508,7 +7558,7 @@ function usePrintHandlers(input) {
|
|
|
7508
7558
|
if (svgs.length === 0) {
|
|
7509
7559
|
return;
|
|
7510
7560
|
}
|
|
7511
|
-
const printDoc =
|
|
7561
|
+
const printDoc = chunkWVDM36ZM_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7512
7562
|
title: "Slides (Vector)",
|
|
7513
7563
|
orientation: settings.orientation,
|
|
7514
7564
|
colorFilter
|
|
@@ -7544,7 +7594,7 @@ function usePrintHandlers(input) {
|
|
|
7544
7594
|
if (settings.printWhat === "outline") {
|
|
7545
7595
|
openPrintWindow(
|
|
7546
7596
|
"Outline",
|
|
7547
|
-
`<div class="outline-page">${
|
|
7597
|
+
`<div class="outline-page">${chunkWVDM36ZM_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7548
7598
|
settings.orientation,
|
|
7549
7599
|
colorFilter,
|
|
7550
7600
|
settings.frameSlides
|
|
@@ -7569,7 +7619,7 @@ function usePrintHandlers(input) {
|
|
|
7569
7619
|
if (settings.printWhat === "slides") {
|
|
7570
7620
|
openPrintWindow(
|
|
7571
7621
|
"Slides",
|
|
7572
|
-
|
|
7622
|
+
chunkWVDM36ZM_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7573
7623
|
settings.orientation,
|
|
7574
7624
|
colorFilter,
|
|
7575
7625
|
settings.frameSlides
|
|
@@ -7579,7 +7629,7 @@ function usePrintHandlers(input) {
|
|
|
7579
7629
|
if (settings.printWhat === "notes") {
|
|
7580
7630
|
openPrintWindow(
|
|
7581
7631
|
"Notes Pages",
|
|
7582
|
-
|
|
7632
|
+
chunkWVDM36ZM_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7583
7633
|
"portrait",
|
|
7584
7634
|
colorFilter,
|
|
7585
7635
|
settings.frameSlides
|
|
@@ -7590,7 +7640,7 @@ function usePrintHandlers(input) {
|
|
|
7590
7640
|
const spp = settings.slidesPerPage;
|
|
7591
7641
|
openPrintWindow(
|
|
7592
7642
|
`Handout ${spp} per page`,
|
|
7593
|
-
|
|
7643
|
+
chunkWVDM36ZM_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
7594
7644
|
"portrait",
|
|
7595
7645
|
colorFilter,
|
|
7596
7646
|
settings.frameSlides
|
|
@@ -7654,8 +7704,8 @@ function useThemeHandlers(input) {
|
|
|
7654
7704
|
return;
|
|
7655
7705
|
}
|
|
7656
7706
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7657
|
-
const previousMap = theme?.colorScheme ?
|
|
7658
|
-
setSlides((prev) =>
|
|
7707
|
+
const previousMap = theme?.colorScheme ? chunkWVDM36ZM_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7708
|
+
setSlides((prev) => chunkWVDM36ZM_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7659
7709
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7660
7710
|
bumpHistory();
|
|
7661
7711
|
history.markDirty();
|
|
@@ -7760,7 +7810,7 @@ function useThemeSwitching(input) {
|
|
|
7760
7810
|
}
|
|
7761
7811
|
try {
|
|
7762
7812
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7763
|
-
const newData =
|
|
7813
|
+
const newData = chunkWVDM36ZM_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7764
7814
|
onDataChange(newData);
|
|
7765
7815
|
onThemeChanged?.(preset);
|
|
7766
7816
|
} catch (error) {
|
|
@@ -7777,7 +7827,7 @@ function useThemeSwitching(input) {
|
|
|
7777
7827
|
}
|
|
7778
7828
|
try {
|
|
7779
7829
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7780
|
-
const newData =
|
|
7830
|
+
const newData = chunkWVDM36ZM_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7781
7831
|
onDataChange(newData);
|
|
7782
7832
|
} catch (error) {
|
|
7783
7833
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7789,12 +7839,12 @@ function useThemeSwitching(input) {
|
|
|
7789
7839
|
if (!data?.theme?.colorScheme) {
|
|
7790
7840
|
return void 0;
|
|
7791
7841
|
}
|
|
7792
|
-
return
|
|
7793
|
-
(p) =>
|
|
7842
|
+
return chunkWVDM36ZM_js.THEME_PRESETS.find(
|
|
7843
|
+
(p) => chunkWVDM36ZM_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7794
7844
|
);
|
|
7795
7845
|
}, [data?.theme?.colorScheme]);
|
|
7796
7846
|
return {
|
|
7797
|
-
presets:
|
|
7847
|
+
presets: chunkWVDM36ZM_js.THEME_PRESETS,
|
|
7798
7848
|
switchToPreset,
|
|
7799
7849
|
switchToCustom,
|
|
7800
7850
|
currentPreset
|
|
@@ -7869,7 +7919,7 @@ function usePropertyHandlers(input) {
|
|
|
7869
7919
|
}
|
|
7870
7920
|
try {
|
|
7871
7921
|
const ab = await file.arrayBuffer();
|
|
7872
|
-
const h = new
|
|
7922
|
+
const h = new chunkWVDM36ZM_js.PptxHandler();
|
|
7873
7923
|
const other = await h.load(ab);
|
|
7874
7924
|
if (!other) {
|
|
7875
7925
|
return;
|
|
@@ -7879,7 +7929,7 @@ function usePropertyHandlers(input) {
|
|
|
7879
7929
|
width: canvasSize.width,
|
|
7880
7930
|
height: canvasSize.height
|
|
7881
7931
|
};
|
|
7882
|
-
setCompareResult(
|
|
7932
|
+
setCompareResult(chunkWVDM36ZM_js.comparePresentation(cur, other));
|
|
7883
7933
|
setIsComparePanelOpen(true);
|
|
7884
7934
|
} catch (err) {
|
|
7885
7935
|
console.warn("Compare failed:", err);
|
|
@@ -7896,7 +7946,7 @@ function usePropertyHandlers(input) {
|
|
|
7896
7946
|
if (!diff || diff.status === "unchanged") {
|
|
7897
7947
|
return;
|
|
7898
7948
|
}
|
|
7899
|
-
setSlides((prev) =>
|
|
7949
|
+
setSlides((prev) => chunkWVDM36ZM_js.applyAcceptSlide(prev, diff));
|
|
7900
7950
|
setIsDirty(true);
|
|
7901
7951
|
},
|
|
7902
7952
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -7907,10 +7957,10 @@ function usePropertyHandlers(input) {
|
|
|
7907
7957
|
if (!compareResult) {
|
|
7908
7958
|
return;
|
|
7909
7959
|
}
|
|
7910
|
-
setSlides((prev) =>
|
|
7960
|
+
setSlides((prev) => chunkWVDM36ZM_js.applyAcceptAllSlides(prev, compareResult));
|
|
7911
7961
|
setIsDirty(true);
|
|
7912
7962
|
}, [compareResult, setSlides, setIsDirty]);
|
|
7913
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
7963
|
+
const usedFontFamilies = react.useMemo(() => chunkWVDM36ZM_js.collectUsedFonts(slides), [slides]);
|
|
7914
7964
|
return {
|
|
7915
7965
|
handleUpdateNotes,
|
|
7916
7966
|
handleUpdateSlide,
|
|
@@ -8029,7 +8079,7 @@ function useIsMobile(input) {
|
|
|
8029
8079
|
const containerRef = input?.containerRef;
|
|
8030
8080
|
const isTouchDevice = react.useSyncExternalStore(
|
|
8031
8081
|
subscribeTouchCapability,
|
|
8032
|
-
|
|
8082
|
+
chunkWVDM36ZM_js.detectTouchDevice,
|
|
8033
8083
|
() => false
|
|
8034
8084
|
// server snapshot
|
|
8035
8085
|
);
|
|
@@ -8045,7 +8095,7 @@ function useIsMobile(input) {
|
|
|
8045
8095
|
}
|
|
8046
8096
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
8047
8097
|
});
|
|
8048
|
-
const [orientation, setOrientation] = react.useState(
|
|
8098
|
+
const [orientation, setOrientation] = react.useState(chunkWVDM36ZM_js.detectOrientation);
|
|
8049
8099
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
8050
8100
|
const [initialViewportHeight] = react.useState(
|
|
8051
8101
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -8089,7 +8139,7 @@ function useIsMobile(input) {
|
|
|
8089
8139
|
return;
|
|
8090
8140
|
}
|
|
8091
8141
|
const handleOrientationChange = () => {
|
|
8092
|
-
setOrientation(
|
|
8142
|
+
setOrientation(chunkWVDM36ZM_js.detectOrientation());
|
|
8093
8143
|
};
|
|
8094
8144
|
if (screen.orientation) {
|
|
8095
8145
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -8119,9 +8169,9 @@ function useIsMobile(input) {
|
|
|
8119
8169
|
window.addEventListener("resize", handleResize);
|
|
8120
8170
|
return () => window.removeEventListener("resize", handleResize);
|
|
8121
8171
|
}, [isTouchDevice, initialViewportHeight]);
|
|
8122
|
-
const isMobile =
|
|
8123
|
-
const isTablet = !isMobile && containerWidth >=
|
|
8124
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
8172
|
+
const isMobile = chunkWVDM36ZM_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
8173
|
+
const isTablet = !isMobile && containerWidth >= chunkWVDM36ZM_js.MOBILE_BREAKPOINT && containerWidth < chunkWVDM36ZM_js.TABLET_BREAKPOINT;
|
|
8174
|
+
const isDesktop = !isMobile && containerWidth >= chunkWVDM36ZM_js.TABLET_BREAKPOINT;
|
|
8125
8175
|
return {
|
|
8126
8176
|
isMobile,
|
|
8127
8177
|
isTablet,
|
|
@@ -8183,7 +8233,7 @@ function useViewerDialogs(input) {
|
|
|
8183
8233
|
);
|
|
8184
8234
|
const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
|
|
8185
8235
|
const fontEmbedding = react.useMemo(
|
|
8186
|
-
() =>
|
|
8236
|
+
() => chunkWVDM36ZM_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
|
|
8187
8237
|
[embeddedFontKey]
|
|
8188
8238
|
);
|
|
8189
8239
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
|
|
@@ -8191,11 +8241,11 @@ function useViewerDialogs(input) {
|
|
|
8191
8241
|
setEmbedFontsEnabled(fontEmbedding.initialEnabled);
|
|
8192
8242
|
}, [fontEmbedding]);
|
|
8193
8243
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8194
|
-
() => typeof window !== "undefined" ?
|
|
8244
|
+
() => typeof window !== "undefined" ? chunkWVDM36ZM_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8195
8245
|
);
|
|
8196
8246
|
react.useEffect(() => {
|
|
8197
8247
|
const handleWindow = () => setIsNarrowViewport(
|
|
8198
|
-
|
|
8248
|
+
chunkWVDM36ZM_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8199
8249
|
);
|
|
8200
8250
|
let observer = null;
|
|
8201
8251
|
let raf = 0;
|
|
@@ -8209,12 +8259,12 @@ function useViewerDialogs(input) {
|
|
|
8209
8259
|
const entry = entries[0];
|
|
8210
8260
|
if (entry) {
|
|
8211
8261
|
setIsNarrowViewport(
|
|
8212
|
-
|
|
8262
|
+
chunkWVDM36ZM_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
8213
8263
|
);
|
|
8214
8264
|
}
|
|
8215
8265
|
});
|
|
8216
8266
|
observer.observe(el);
|
|
8217
|
-
setIsNarrowViewport(
|
|
8267
|
+
setIsNarrowViewport(chunkWVDM36ZM_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
8218
8268
|
};
|
|
8219
8269
|
attach();
|
|
8220
8270
|
window.addEventListener("resize", handleWindow);
|
|
@@ -8373,20 +8423,20 @@ function useViewerDialogs(input) {
|
|
|
8373
8423
|
}
|
|
8374
8424
|
function computeGridSpacingPx(presentationGridSpacing) {
|
|
8375
8425
|
if (presentationGridSpacing) {
|
|
8376
|
-
const px = Math.round(presentationGridSpacing.cx /
|
|
8426
|
+
const px = Math.round(presentationGridSpacing.cx / chunk4LWGAVAP_js.EMU_PER_PX);
|
|
8377
8427
|
if (px > 0) {
|
|
8378
8428
|
return px;
|
|
8379
8429
|
}
|
|
8380
8430
|
}
|
|
8381
|
-
return
|
|
8431
|
+
return chunk4LWGAVAP_js.GRID_SIZE;
|
|
8382
8432
|
}
|
|
8383
8433
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8384
8434
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8385
|
-
return
|
|
8435
|
+
return chunkWVDM36ZM_js.resolveShowSlideIndexes(slides, activeShow);
|
|
8386
8436
|
}
|
|
8387
8437
|
function computeSlideSectionGroups(slides, sections) {
|
|
8388
|
-
return
|
|
8389
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8438
|
+
return chunkWVDM36ZM_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8439
|
+
id: group.section?.id ?? (sections.length > 0 ? chunk4LWGAVAP_js.UNGROUPED_SECTION_ID : chunk4LWGAVAP_js.DEFAULT_SECTION_GROUP_ID),
|
|
8390
8440
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8391
8441
|
slideIndexes: group.slideIndexes,
|
|
8392
8442
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8398,7 +8448,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
|
8398
8448
|
return void 0;
|
|
8399
8449
|
}
|
|
8400
8450
|
const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
|
|
8401
|
-
return
|
|
8451
|
+
return chunkWVDM36ZM_js.masterViewPseudoSlide(document2, {
|
|
8402
8452
|
tab: "slides",
|
|
8403
8453
|
masterIndex: 0,
|
|
8404
8454
|
layoutIndex: activeLayout ? 0 : null
|
|
@@ -8426,10 +8476,10 @@ function useDerivedSlideState(input) {
|
|
|
8426
8476
|
);
|
|
8427
8477
|
const slideSectionGroups = react.useMemo(
|
|
8428
8478
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8429
|
-
if (group.id ===
|
|
8479
|
+
if (group.id === chunk4LWGAVAP_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8430
8480
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8431
8481
|
}
|
|
8432
|
-
if (group.id ===
|
|
8482
|
+
if (group.id === chunk4LWGAVAP_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
8433
8483
|
return { ...group, label: t("pptx.sections.slides") };
|
|
8434
8484
|
}
|
|
8435
8485
|
return group;
|
|
@@ -8529,13 +8579,13 @@ function useAnnotationHandlers(input) {
|
|
|
8529
8579
|
}, [annotations, setMode, setSlides, history]);
|
|
8530
8580
|
const handleSetMode = react.useCallback(
|
|
8531
8581
|
(nextMode) => {
|
|
8532
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8582
|
+
if (mode === "present" && nextMode !== "present" && !chunkWVDM36ZM_js.mayLeaveSlideShow()) {
|
|
8533
8583
|
return;
|
|
8534
8584
|
}
|
|
8535
8585
|
if (nextMode === "present") {
|
|
8536
8586
|
presentation.enterPresentMode();
|
|
8537
8587
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8538
|
-
|
|
8588
|
+
chunkWVDM36ZM_js.stopAllPersistentAudio();
|
|
8539
8589
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8540
8590
|
if (promptKeepInkAnnotations) {
|
|
8541
8591
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8544,7 +8594,7 @@ function useAnnotationHandlers(input) {
|
|
|
8544
8594
|
}
|
|
8545
8595
|
} else {
|
|
8546
8596
|
if (mode === "present") {
|
|
8547
|
-
|
|
8597
|
+
chunkWVDM36ZM_js.stopAllPersistentAudio();
|
|
8548
8598
|
}
|
|
8549
8599
|
setMode(nextMode);
|
|
8550
8600
|
}
|
|
@@ -8583,6 +8633,8 @@ function useSerialize(input) {
|
|
|
8583
8633
|
slides,
|
|
8584
8634
|
templateElementsBySlideId,
|
|
8585
8635
|
activeSlideIndex,
|
|
8636
|
+
canvasSize,
|
|
8637
|
+
slideSizeEmu,
|
|
8586
8638
|
guides,
|
|
8587
8639
|
headerFooter,
|
|
8588
8640
|
presentationProperties,
|
|
@@ -8592,6 +8644,7 @@ function useSerialize(input) {
|
|
|
8592
8644
|
appProperties,
|
|
8593
8645
|
customProperties,
|
|
8594
8646
|
tagCollections,
|
|
8647
|
+
slideMasters,
|
|
8595
8648
|
notesMaster,
|
|
8596
8649
|
handoutMaster,
|
|
8597
8650
|
handlerRef,
|
|
@@ -8612,13 +8665,13 @@ function useSerialize(input) {
|
|
|
8612
8665
|
let processedSlide = slide;
|
|
8613
8666
|
if (pendingEditId) {
|
|
8614
8667
|
const updatedElements = slide.elements.map((el) => {
|
|
8615
|
-
if (el.id !== pendingEditId || !
|
|
8668
|
+
if (el.id !== pendingEditId || !chunkWVDM36ZM_js.hasTextProperties(el)) {
|
|
8616
8669
|
return el;
|
|
8617
8670
|
}
|
|
8618
8671
|
return {
|
|
8619
8672
|
...el,
|
|
8620
8673
|
text: pendingEditText,
|
|
8621
|
-
textSegments:
|
|
8674
|
+
textSegments: chunkWVDM36ZM_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8622
8675
|
};
|
|
8623
8676
|
});
|
|
8624
8677
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8631,15 +8684,19 @@ function useSerialize(input) {
|
|
|
8631
8684
|
const pptxGuides = guides.map((g) => ({
|
|
8632
8685
|
id: g.id,
|
|
8633
8686
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8634
|
-
positionEmu:
|
|
8687
|
+
positionEmu: chunkWVDM36ZM_js.guidePxToEmu(g.position)
|
|
8635
8688
|
}));
|
|
8636
8689
|
return {
|
|
8637
8690
|
...processedSlide,
|
|
8638
8691
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8639
8692
|
};
|
|
8640
8693
|
});
|
|
8641
|
-
const slidesToSave =
|
|
8694
|
+
const slidesToSave = chunkWVDM36ZM_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8642
8695
|
const saveOptions = {
|
|
8696
|
+
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
8697
|
+
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
8698
|
+
// slide-size edit reaches the file.
|
|
8699
|
+
slideSize: chunkWVDM36ZM_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
8643
8700
|
headerFooter,
|
|
8644
8701
|
presentationProperties,
|
|
8645
8702
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -8648,14 +8705,17 @@ function useSerialize(input) {
|
|
|
8648
8705
|
appProperties,
|
|
8649
8706
|
customProperties: customProperties.length > 0 ? customProperties : void 0,
|
|
8650
8707
|
tags: tagCollections.length > 0 ? tagCollections : void 0,
|
|
8708
|
+
slideMasters,
|
|
8651
8709
|
notesMaster,
|
|
8652
8710
|
handoutMaster,
|
|
8653
|
-
...
|
|
8711
|
+
...chunkWVDM36ZM_js.embeddedFontSaveOptions(embedFonts)
|
|
8654
8712
|
};
|
|
8655
|
-
return
|
|
8713
|
+
return chunkWVDM36ZM_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
|
|
8656
8714
|
}, [
|
|
8657
8715
|
slides,
|
|
8658
8716
|
templateElementsBySlideId,
|
|
8717
|
+
canvasSize,
|
|
8718
|
+
slideSizeEmu,
|
|
8659
8719
|
headerFooter,
|
|
8660
8720
|
presentationProperties,
|
|
8661
8721
|
customShows,
|
|
@@ -8664,6 +8724,7 @@ function useSerialize(input) {
|
|
|
8664
8724
|
appProperties,
|
|
8665
8725
|
customProperties,
|
|
8666
8726
|
tagCollections,
|
|
8727
|
+
slideMasters,
|
|
8667
8728
|
notesMaster,
|
|
8668
8729
|
handoutMaster,
|
|
8669
8730
|
guides,
|
|
@@ -8789,7 +8850,8 @@ function usePresentationSetup(input) {
|
|
|
8789
8850
|
history,
|
|
8790
8851
|
endWithBlackSlide = true,
|
|
8791
8852
|
promptKeepInkAnnotations = true,
|
|
8792
|
-
popupToolbarEnabled = true
|
|
8853
|
+
popupToolbarEnabled = true,
|
|
8854
|
+
onToggleSubtitles
|
|
8793
8855
|
} = input;
|
|
8794
8856
|
const actionSoundHandlerRef = react.useRef(null);
|
|
8795
8857
|
const [, setShowKeepAnnotationsDialog] = react.useState(false);
|
|
@@ -8807,7 +8869,7 @@ function usePresentationSetup(input) {
|
|
|
8807
8869
|
containerRef,
|
|
8808
8870
|
content,
|
|
8809
8871
|
onSetMode: (nextMode) => {
|
|
8810
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8872
|
+
if (mode === "present" && nextMode !== "present" && !chunkWVDM36ZM_js.mayLeaveSlideShow()) {
|
|
8811
8873
|
return;
|
|
8812
8874
|
}
|
|
8813
8875
|
if (mode === "present" && nextMode !== "present" && annotations.hasAnyAnnotations && promptKeepInkAnnotations) {
|
|
@@ -8815,7 +8877,7 @@ function usePresentationSetup(input) {
|
|
|
8815
8877
|
setShowKeepAnnotationsDialog(true);
|
|
8816
8878
|
} else {
|
|
8817
8879
|
if (mode === "present" && nextMode !== "present") {
|
|
8818
|
-
|
|
8880
|
+
chunkWVDM36ZM_js.stopAllPersistentAudio();
|
|
8819
8881
|
stopAnimationSound();
|
|
8820
8882
|
}
|
|
8821
8883
|
setMode(nextMode);
|
|
@@ -8868,11 +8930,12 @@ function usePresentationSetup(input) {
|
|
|
8868
8930
|
onEraseAnnotations: () => annotations.clearAnnotations(),
|
|
8869
8931
|
onToggleInkMarkup: () => annotations.setInkMarkupVisible(!annotations.inkMarkupVisible),
|
|
8870
8932
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8933
|
+
onToggleSubtitles,
|
|
8871
8934
|
onSaveRehearsalTimings: (timings) => {
|
|
8872
|
-
setSlides((prev) =>
|
|
8935
|
+
setSlides((prev) => chunkWVDM36ZM_js.applyRehearsalTimings(prev, timings));
|
|
8873
8936
|
history.markDirty();
|
|
8874
8937
|
},
|
|
8875
|
-
loopContinuously:
|
|
8938
|
+
loopContinuously: chunkWVDM36ZM_js.shouldLoopContinuously(presentationProperties),
|
|
8876
8939
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8877
8940
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8878
8941
|
endWithBlackSlide
|
|
@@ -9065,7 +9128,7 @@ function useEditorOperations(input) {
|
|
|
9065
9128
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
9066
9129
|
react.useEffect(() => {
|
|
9067
9130
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9068
|
-
copiedFormatRef.current =
|
|
9131
|
+
copiedFormatRef.current = chunkWVDM36ZM_js.copyFormatFromElement(selectedElement);
|
|
9069
9132
|
} else if (!formatPainterActive) {
|
|
9070
9133
|
copiedFormatRef.current = null;
|
|
9071
9134
|
}
|
|
@@ -9091,12 +9154,12 @@ function useEditorOperations(input) {
|
|
|
9091
9154
|
e.stopPropagation();
|
|
9092
9155
|
const element = elementLookup.get(elementId);
|
|
9093
9156
|
if (element) {
|
|
9094
|
-
const updated =
|
|
9157
|
+
const updated = chunkWVDM36ZM_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
9095
9158
|
const updates = {};
|
|
9096
|
-
if (
|
|
9159
|
+
if (chunkWVDM36ZM_js.hasShapeProperties(updated)) {
|
|
9097
9160
|
updates.shapeStyle = updated.shapeStyle;
|
|
9098
9161
|
}
|
|
9099
|
-
if (
|
|
9162
|
+
if (chunkWVDM36ZM_js.hasTextProperties(updated)) {
|
|
9100
9163
|
updates.textStyle = updated.textStyle;
|
|
9101
9164
|
}
|
|
9102
9165
|
ops.updateElementById(elementId, updates);
|
|
@@ -9167,12 +9230,14 @@ function useIOHandlers(input) {
|
|
|
9167
9230
|
appProperties: state.appProperties ?? null,
|
|
9168
9231
|
customProperties: state.customProperties,
|
|
9169
9232
|
tagCollections: state.tagCollections,
|
|
9233
|
+
slideMasters: state.slideMasters,
|
|
9170
9234
|
notesMaster: state.notesMaster,
|
|
9171
9235
|
handoutMaster: state.handoutMaster,
|
|
9172
9236
|
guides: state.guides,
|
|
9173
9237
|
activeSlideIndexForGuides: state.activeSlideIndex,
|
|
9174
9238
|
theme: state.theme,
|
|
9175
9239
|
canvasSize,
|
|
9240
|
+
slideSizeEmu: state.slideSizeEmu,
|
|
9176
9241
|
password
|
|
9177
9242
|
});
|
|
9178
9243
|
const printHandlers = usePrintHandlers({
|
|
@@ -9248,7 +9313,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
9248
9313
|
const families = /* @__PURE__ */ new Set();
|
|
9249
9314
|
for (const slide of slides) {
|
|
9250
9315
|
for (const el of slide.elements) {
|
|
9251
|
-
if (
|
|
9316
|
+
if (chunkWVDM36ZM_js.hasTextProperties(el) && el.textSegments) {
|
|
9252
9317
|
for (const seg of el.textSegments) {
|
|
9253
9318
|
if (seg.style.fontFamily) {
|
|
9254
9319
|
families.add(seg.style.fontFamily);
|
|
@@ -9397,6 +9462,7 @@ function useContentLifecycle(input) {
|
|
|
9397
9462
|
setTemplateElementsBySlideId: state.setTemplateElementsBySlideId,
|
|
9398
9463
|
mediaDataUrls: state.mediaDataUrls,
|
|
9399
9464
|
setCanvasSize: state.setCanvasSize,
|
|
9465
|
+
setSlideSizeEmu: state.setSlideSizeEmu,
|
|
9400
9466
|
setHeaderFooter: state.setHeaderFooter,
|
|
9401
9467
|
setLayoutOptions: state.setLayoutOptions,
|
|
9402
9468
|
setSlideMasters: state.setSlideMasters,
|
|
@@ -9404,6 +9470,7 @@ function useContentLifecycle(input) {
|
|
|
9404
9470
|
setTableStyleMap: state.setTableStyleMap,
|
|
9405
9471
|
setThemeOptions: state.setThemeOptions,
|
|
9406
9472
|
setCustomShows: state.setCustomShows,
|
|
9473
|
+
setActiveCustomShowId: state.setActiveCustomShowId,
|
|
9407
9474
|
setSections: state.setSections,
|
|
9408
9475
|
setPresentationProperties: state.setPresentationProperties,
|
|
9409
9476
|
setNotesMaster: state.setNotesMaster,
|
|
@@ -9433,6 +9500,8 @@ function useContentLifecycle(input) {
|
|
|
9433
9500
|
slides,
|
|
9434
9501
|
templateElementsBySlideId: state.templateElementsBySlideId,
|
|
9435
9502
|
activeSlideIndex: state.activeSlideIndex,
|
|
9503
|
+
canvasSize: state.canvasSize,
|
|
9504
|
+
slideSizeEmu: state.slideSizeEmu,
|
|
9436
9505
|
guides: state.guides,
|
|
9437
9506
|
headerFooter: state.headerFooter,
|
|
9438
9507
|
presentationProperties: state.presentationProperties,
|
|
@@ -9442,6 +9511,7 @@ function useContentLifecycle(input) {
|
|
|
9442
9511
|
appProperties: state.appProperties,
|
|
9443
9512
|
customProperties: state.customProperties,
|
|
9444
9513
|
tagCollections: state.tagCollections,
|
|
9514
|
+
slideMasters: state.slideMasters,
|
|
9445
9515
|
notesMaster: state.notesMaster,
|
|
9446
9516
|
handoutMaster: state.handoutMaster,
|
|
9447
9517
|
handlerRef,
|
|
@@ -9457,7 +9527,31 @@ function useContentLifecycle(input) {
|
|
|
9457
9527
|
filePath,
|
|
9458
9528
|
serializeSlides: serializeForRecovery,
|
|
9459
9529
|
enabled: autosaveEnabled,
|
|
9460
|
-
...autosaveIntervalSeconds === void 0 ? {} : { intervalSeconds: autosaveIntervalSeconds }
|
|
9530
|
+
...autosaveIntervalSeconds === void 0 ? {} : { intervalSeconds: autosaveIntervalSeconds },
|
|
9531
|
+
// Everything `serializeForRecovery` reads that changes by REASSIGNMENT,
|
|
9532
|
+
// so a poll that finds all of them unchanged can skip re-serializing a
|
|
9533
|
+
// deck it has already snapshotted. The two refs are read by `.current`
|
|
9534
|
+
// because an inline edit in progress lives there and nowhere else yet.
|
|
9535
|
+
getChangeSources: () => [
|
|
9536
|
+
slides,
|
|
9537
|
+
state.templateElementsBySlideId,
|
|
9538
|
+
state.guides,
|
|
9539
|
+
state.headerFooter,
|
|
9540
|
+
state.presentationProperties,
|
|
9541
|
+
state.customShows,
|
|
9542
|
+
state.sections,
|
|
9543
|
+
state.coreProperties,
|
|
9544
|
+
state.appProperties,
|
|
9545
|
+
state.customProperties,
|
|
9546
|
+
state.tagCollections,
|
|
9547
|
+
state.notesMaster,
|
|
9548
|
+
state.handoutMaster,
|
|
9549
|
+
state.embeddedFonts,
|
|
9550
|
+
embedFonts,
|
|
9551
|
+
password,
|
|
9552
|
+
state.inlineEditingElementIdRef.current,
|
|
9553
|
+
state.inlineEditingTextRef.current
|
|
9554
|
+
]
|
|
9461
9555
|
});
|
|
9462
9556
|
return { handlerRef, serializeSlides, serializeForRecovery, autosaveStatus };
|
|
9463
9557
|
}
|
|
@@ -9466,13 +9560,20 @@ function useKeyboardShortcuts(input) {
|
|
|
9466
9560
|
inputRef.current = input;
|
|
9467
9561
|
const handleKeyDown = react.useCallback((e) => {
|
|
9468
9562
|
const current = inputRef.current;
|
|
9469
|
-
const { action, dx, dy } =
|
|
9563
|
+
const { action, dx, dy } = chunkWVDM36ZM_js.mapEditorKey(e, {
|
|
9470
9564
|
canEdit: current.canEdit,
|
|
9471
|
-
|
|
9565
|
+
// The Slide Master view is an editing surface, not a viewing one.
|
|
9566
|
+
// Gating on `mode !== 'edit'` alone made `mapEditorKey` return
|
|
9567
|
+
// NO_ACTION there, so Delete, the arrow-key nudges and the clipboard
|
|
9568
|
+
// keys were all inert over a master shape even though the write path
|
|
9569
|
+
// behind them routes to the owning part correctly. Svelte and
|
|
9570
|
+
// vanilla, which render the master into their ordinary editable
|
|
9571
|
+
// stage, never had the gap.
|
|
9572
|
+
isPresenting: current.mode !== "edit" && current.mode !== "master",
|
|
9472
9573
|
hasSelection: current.hasSelection,
|
|
9473
9574
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9474
9575
|
isDrawing: current.activeTool !== "select",
|
|
9475
|
-
isTextInputTarget:
|
|
9576
|
+
isTextInputTarget: chunkWVDM36ZM_js.isEditorTextInputTarget(e.target)
|
|
9476
9577
|
});
|
|
9477
9578
|
if (action === null) {
|
|
9478
9579
|
return;
|
|
@@ -9515,6 +9616,9 @@ function useKeyboardShortcuts(input) {
|
|
|
9515
9616
|
case "toggleShortcuts":
|
|
9516
9617
|
current.onToggleShortcuts?.();
|
|
9517
9618
|
break;
|
|
9619
|
+
case "find":
|
|
9620
|
+
current.onFind?.();
|
|
9621
|
+
break;
|
|
9518
9622
|
case "nudge":
|
|
9519
9623
|
current.onNudge(dx ?? 0, dy ?? 0);
|
|
9520
9624
|
break;
|
|
@@ -9773,7 +9877,7 @@ function useViewerIntegration(input) {
|
|
|
9773
9877
|
return zoom.scale;
|
|
9774
9878
|
},
|
|
9775
9879
|
setZoom(level) {
|
|
9776
|
-
zoom.setScale(
|
|
9880
|
+
zoom.setScale(chunkWVDM36ZM_js.clampZoomScale(level));
|
|
9777
9881
|
},
|
|
9778
9882
|
zoomIn() {
|
|
9779
9883
|
zoom.handleZoomIn();
|
|
@@ -9988,7 +10092,7 @@ function useReducedMotion() {
|
|
|
9988
10092
|
}
|
|
9989
10093
|
function useViewerOptions() {
|
|
9990
10094
|
const storeRef = react.useRef(null);
|
|
9991
|
-
storeRef.current ??=
|
|
10095
|
+
storeRef.current ??= chunkWVDM36ZM_js.createViewerOptionsStore();
|
|
9992
10096
|
const store = storeRef.current;
|
|
9993
10097
|
const options = react.useSyncExternalStore(
|
|
9994
10098
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -9997,9 +10101,9 @@ function useViewerOptions() {
|
|
|
9997
10101
|
);
|
|
9998
10102
|
return { optionsStore: store, options };
|
|
9999
10103
|
}
|
|
10000
|
-
var KNOWN_TAB_IDS = new Set(
|
|
10104
|
+
var KNOWN_TAB_IDS = new Set(chunkWVDM36ZM_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
10001
10105
|
function computeToolbarVisibility(hiddenActions) {
|
|
10002
|
-
const isHidden = (id) =>
|
|
10106
|
+
const isHidden = (id) => chunkWVDM36ZM_js.isActionHidden(id, hiddenActions);
|
|
10003
10107
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
10004
10108
|
return { isHidden, isTabVisible };
|
|
10005
10109
|
}
|
|
@@ -10084,12 +10188,12 @@ function useYjsDocumentSync({
|
|
|
10084
10188
|
return;
|
|
10085
10189
|
}
|
|
10086
10190
|
try {
|
|
10087
|
-
const handler = new
|
|
10191
|
+
const handler = new chunkWVDM36ZM_js.PptxHandler();
|
|
10088
10192
|
await handler.load(sourceBytes.buffer);
|
|
10089
|
-
const currentSlides =
|
|
10193
|
+
const currentSlides = chunkWVDM36ZM_js.readSlidesFromYDoc(
|
|
10090
10194
|
doc
|
|
10091
10195
|
);
|
|
10092
|
-
const slidesToSave =
|
|
10196
|
+
const slidesToSave = chunkWVDM36ZM_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10093
10197
|
const bytes = await handler.save(slidesToSave);
|
|
10094
10198
|
config.onWriteBack(bytes);
|
|
10095
10199
|
} catch {
|
|
@@ -10104,7 +10208,7 @@ function useYjsDocumentSync({
|
|
|
10104
10208
|
if (!doc || !isConnected) {
|
|
10105
10209
|
return;
|
|
10106
10210
|
}
|
|
10107
|
-
const docSlides =
|
|
10211
|
+
const docSlides = chunkWVDM36ZM_js.readSlidesFromYDoc(
|
|
10108
10212
|
doc
|
|
10109
10213
|
);
|
|
10110
10214
|
if (docSlides.length === 0) {
|
|
@@ -10126,11 +10230,11 @@ function useYjsDocumentSync({
|
|
|
10126
10230
|
lastSyncedRef.current = serialized;
|
|
10127
10231
|
void (async () => {
|
|
10128
10232
|
const factories = await getFactories();
|
|
10129
|
-
|
|
10233
|
+
chunkWVDM36ZM_js.reconcileSlidesInYDoc(
|
|
10130
10234
|
slides,
|
|
10131
10235
|
doc,
|
|
10132
10236
|
factories,
|
|
10133
|
-
|
|
10237
|
+
chunkWVDM36ZM_js.LOCAL_SYNC_ORIGIN
|
|
10134
10238
|
);
|
|
10135
10239
|
scheduleWriteBack();
|
|
10136
10240
|
})();
|
|
@@ -10144,10 +10248,10 @@ function useYjsDocumentSync({
|
|
|
10144
10248
|
return;
|
|
10145
10249
|
}
|
|
10146
10250
|
const handleChange = (_events, transaction) => {
|
|
10147
|
-
if (transaction?.origin ===
|
|
10251
|
+
if (transaction?.origin === chunkWVDM36ZM_js.LOCAL_SYNC_ORIGIN) {
|
|
10148
10252
|
return;
|
|
10149
10253
|
}
|
|
10150
|
-
const remoteSlides =
|
|
10254
|
+
const remoteSlides = chunkWVDM36ZM_js.readSlidesFromYDoc(
|
|
10151
10255
|
doc
|
|
10152
10256
|
);
|
|
10153
10257
|
if (remoteSlides.length === 0) {
|
|
@@ -10163,7 +10267,7 @@ function useYjsDocumentSync({
|
|
|
10163
10267
|
isApplyingRemoteRef.current = false;
|
|
10164
10268
|
scheduleWriteBack();
|
|
10165
10269
|
};
|
|
10166
|
-
const unobserve =
|
|
10270
|
+
const unobserve = chunkWVDM36ZM_js.observeYDocSlides(
|
|
10167
10271
|
doc,
|
|
10168
10272
|
handleChange
|
|
10169
10273
|
);
|
|
@@ -10201,7 +10305,7 @@ function useBroadcastFollower({
|
|
|
10201
10305
|
if (!broadcaster) {
|
|
10202
10306
|
return;
|
|
10203
10307
|
}
|
|
10204
|
-
if (!
|
|
10308
|
+
if (!chunkWVDM36ZM_js.shouldAutoFollowBroadcaster({
|
|
10205
10309
|
localRole: collab.config.role,
|
|
10206
10310
|
broadcasterRole: broadcaster.role
|
|
10207
10311
|
})) {
|
|
@@ -10372,10 +10476,10 @@ function useTouchGestures(input) {
|
|
|
10372
10476
|
if (!el || !enabled) {
|
|
10373
10477
|
return;
|
|
10374
10478
|
}
|
|
10375
|
-
const recognizer =
|
|
10479
|
+
const recognizer = chunkWVDM36ZM_js.createTouchGestureRecognizer({
|
|
10376
10480
|
getScale: () => scaleRef.current,
|
|
10377
|
-
minScale:
|
|
10378
|
-
maxScale:
|
|
10481
|
+
minScale: chunkWVDM36ZM_js.MIN_ZOOM_SCALE,
|
|
10482
|
+
maxScale: chunkWVDM36ZM_js.MAX_ZOOM_SCALE,
|
|
10379
10483
|
callbacks: {
|
|
10380
10484
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10381
10485
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10415,7 +10519,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10415
10519
|
return;
|
|
10416
10520
|
}
|
|
10417
10521
|
const rect = active.getBoundingClientRect();
|
|
10418
|
-
const delta =
|
|
10522
|
+
const delta = chunkWVDM36ZM_js.computeScrollDelta(
|
|
10419
10523
|
{ top: rect.top, bottom: rect.bottom },
|
|
10420
10524
|
window.innerHeight,
|
|
10421
10525
|
keyboardInset
|
|
@@ -10435,8 +10539,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10435
10539
|
return;
|
|
10436
10540
|
}
|
|
10437
10541
|
const update = () => {
|
|
10438
|
-
const metrics =
|
|
10439
|
-
const inset = metrics ?
|
|
10542
|
+
const metrics = chunkWVDM36ZM_js.readViewportMetrics(window);
|
|
10543
|
+
const inset = metrics ? chunkWVDM36ZM_js.computeKeyboardInset(metrics) : 0;
|
|
10440
10544
|
setKeyboardInset(inset);
|
|
10441
10545
|
if (inset > 0) {
|
|
10442
10546
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10447,8 +10551,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10447
10551
|
vv.addEventListener("scroll", update);
|
|
10448
10552
|
const onFocusIn = () => {
|
|
10449
10553
|
window.requestAnimationFrame(() => {
|
|
10450
|
-
const metrics =
|
|
10451
|
-
const inset = metrics ?
|
|
10554
|
+
const metrics = chunkWVDM36ZM_js.readViewportMetrics(window);
|
|
10555
|
+
const inset = metrics ? chunkWVDM36ZM_js.computeKeyboardInset(metrics) : 0;
|
|
10452
10556
|
if (inset > 0) {
|
|
10453
10557
|
scrollFocusedIntoView(inset);
|
|
10454
10558
|
}
|
|
@@ -10461,7 +10565,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10461
10565
|
document.removeEventListener("focusin", onFocusIn);
|
|
10462
10566
|
};
|
|
10463
10567
|
}, [enabled]);
|
|
10464
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10568
|
+
return { keyboardInset, isKeyboardOpen: chunkWVDM36ZM_js.isKeyboardOpen(keyboardInset) };
|
|
10465
10569
|
}
|
|
10466
10570
|
|
|
10467
10571
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10488,7 +10592,7 @@ function buildCanvasProps(input) {
|
|
|
10488
10592
|
} = input;
|
|
10489
10593
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10490
10594
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10491
|
-
const fieldContext =
|
|
10595
|
+
const fieldContext = chunkWVDM36ZM_js.buildFieldSubstitutionContext({
|
|
10492
10596
|
headerFooter: s.headerFooter,
|
|
10493
10597
|
customProperties: s.customProperties,
|
|
10494
10598
|
slide: activeSlide
|
|
@@ -10498,13 +10602,13 @@ function buildCanvasProps(input) {
|
|
|
10498
10602
|
if (mode === "present") {
|
|
10499
10603
|
presentation.handlePresentationAction(action);
|
|
10500
10604
|
} else if (action.url) {
|
|
10501
|
-
|
|
10605
|
+
chunkWVDM36ZM_js.safeOpenUrl(action.url);
|
|
10502
10606
|
}
|
|
10503
10607
|
};
|
|
10504
10608
|
const handleHyperlinkClick = (url) => {
|
|
10505
|
-
if (
|
|
10609
|
+
if (chunkWVDM36ZM_js.isPpactionUrl(url)) {
|
|
10506
10610
|
if (mode === "present") {
|
|
10507
|
-
const parsed =
|
|
10611
|
+
const parsed = chunkWVDM36ZM_js.parsePpactionUrl(url);
|
|
10508
10612
|
if (parsed) {
|
|
10509
10613
|
presentation.handlePresentationAction({
|
|
10510
10614
|
action: parsed.action,
|
|
@@ -10514,7 +10618,7 @@ function buildCanvasProps(input) {
|
|
|
10514
10618
|
}
|
|
10515
10619
|
return;
|
|
10516
10620
|
}
|
|
10517
|
-
|
|
10621
|
+
chunkWVDM36ZM_js.safeOpenUrl(url);
|
|
10518
10622
|
};
|
|
10519
10623
|
return {
|
|
10520
10624
|
activeSlide: effectiveSlide,
|
|
@@ -10610,7 +10714,7 @@ function buildCanvasProps(input) {
|
|
|
10610
10714
|
|
|
10611
10715
|
// src/viewer/hooks/useScopedLayoutOptions.ts
|
|
10612
10716
|
function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
|
|
10613
|
-
return
|
|
10717
|
+
return chunkWVDM36ZM_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
|
|
10614
10718
|
}
|
|
10615
10719
|
|
|
10616
10720
|
// src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
|
|
@@ -10623,7 +10727,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10623
10727
|
const current = activeSlide.animations ?? [];
|
|
10624
10728
|
if (group === "motionPath") {
|
|
10625
10729
|
propertyHandlers.handleUpdateSlide({
|
|
10626
|
-
animations:
|
|
10730
|
+
animations: chunkWVDM36ZM_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10627
10731
|
});
|
|
10628
10732
|
return;
|
|
10629
10733
|
}
|
|
@@ -10818,7 +10922,7 @@ function buildToolbarProps(input) {
|
|
|
10818
10922
|
onOpenFile,
|
|
10819
10923
|
onOpenRecentFile,
|
|
10820
10924
|
onCreatePresentation: (templateId) => {
|
|
10821
|
-
s.setSlides(
|
|
10925
|
+
s.setSlides(chunkWVDM36ZM_js.createBackstagePresentation(templateId));
|
|
10822
10926
|
s.setActiveSlideIndex(0);
|
|
10823
10927
|
s.setSelectedElementId(null);
|
|
10824
10928
|
s.setSelectedElementIds([]);
|
|
@@ -10847,7 +10951,7 @@ function buildToolbarProps(input) {
|
|
|
10847
10951
|
loadLayoutPreviews: input.loadLayoutPreviews,
|
|
10848
10952
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
10849
10953
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
10850
|
-
templateScheme:
|
|
10954
|
+
templateScheme: chunkWVDM36ZM_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
10851
10955
|
customShows: s.customShows,
|
|
10852
10956
|
activeCustomShowId: s.activeCustomShowId,
|
|
10853
10957
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -10861,6 +10965,15 @@ function buildToolbarProps(input) {
|
|
|
10861
10965
|
onToggleVersionHistory: () => propertyHandlers.setIsVersionHistoryOpen((p) => !p),
|
|
10862
10966
|
onOpenPasswordProtection: () => dialogs.setIsPasswordDialogOpen(true),
|
|
10863
10967
|
onOpenDocumentProperties: () => dialogs.setIsDocPropsDialogOpen(true),
|
|
10968
|
+
// Design > Slide Size: the size control is the inspector's SLIDE SIZE
|
|
10969
|
+
// card, which the deck (no-selection) panel renders. Drop the selection so
|
|
10970
|
+
// that panel is what the pane shows, then open it.
|
|
10971
|
+
onOpenSlideSize: () => {
|
|
10972
|
+
s.setSelectedElementId(null);
|
|
10973
|
+
s.setSelectedElementIds([]);
|
|
10974
|
+
s.setSidebarPanelMode("properties");
|
|
10975
|
+
s.setIsInspectorPaneOpen(true);
|
|
10976
|
+
},
|
|
10864
10977
|
onOpenFontEmbedding: () => dialogs.setIsFontEmbeddingOpen(true),
|
|
10865
10978
|
onOpenDigitalSignatures: () => dialogs.setIsDigitalSigDialogOpen(true),
|
|
10866
10979
|
onEnterPresenterView,
|
|
@@ -10879,7 +10992,7 @@ function buildToolbarProps(input) {
|
|
|
10879
10992
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
10880
10993
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
10881
10994
|
formatPainterActive: s.formatPainterActive,
|
|
10882
|
-
canActivateFormatPainter:
|
|
10995
|
+
canActivateFormatPainter: chunkWVDM36ZM_js.hasCopyableFormat(selectedElement),
|
|
10883
10996
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
10884
10997
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
10885
10998
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -10987,7 +11100,12 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
10987
11100
|
setMode: state.setMode,
|
|
10988
11101
|
setActiveSlideIndex: state.setActiveSlideIndex,
|
|
10989
11102
|
setSlides: state.setSlides,
|
|
10990
|
-
history
|
|
11103
|
+
history,
|
|
11104
|
+
// PowerPoint's bare `J` during a show toggles live captions.
|
|
11105
|
+
onToggleSubtitles: () => state.setPresentationProperties((prev) => ({
|
|
11106
|
+
...prev,
|
|
11107
|
+
showSubtitles: !prev.showSubtitles
|
|
11108
|
+
}))
|
|
10991
11109
|
});
|
|
10992
11110
|
return {
|
|
10993
11111
|
state,
|
|
@@ -11162,7 +11280,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11162
11280
|
}, [incomingContent]);
|
|
11163
11281
|
const onOpenFile = react.useCallback(() => {
|
|
11164
11282
|
void (async () => {
|
|
11165
|
-
const picked = await
|
|
11283
|
+
const picked = await chunkWVDM36ZM_js.openPptxFile();
|
|
11166
11284
|
if (picked) {
|
|
11167
11285
|
setContent(picked.buffer);
|
|
11168
11286
|
}
|
|
@@ -11170,7 +11288,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11170
11288
|
}, []);
|
|
11171
11289
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11172
11290
|
void (async () => {
|
|
11173
|
-
const bytes = await
|
|
11291
|
+
const bytes = await chunkWVDM36ZM_js.readBackstageRecentFile(key);
|
|
11174
11292
|
if (bytes) {
|
|
11175
11293
|
setContent(bytes);
|
|
11176
11294
|
}
|