pptx-react-viewer 2.16.6 → 2.16.8
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 +4 -0
- package/dist/{AiChatPanel-NQFSMKIJ.mjs → AiChatPanel-FR55MUQF.mjs} +3 -9
- package/dist/AiChatPanel-FR55MUQF.mjs.br +0 -0
- package/dist/AiChatPanel-FR55MUQF.mjs.gz +0 -0
- package/dist/{AiChatPanel-T6UN6LME.js → AiChatPanel-VNHHHM2S.js} +23 -29
- package/dist/AiChatPanel-VNHHHM2S.js.br +0 -0
- package/dist/AiChatPanel-VNHHHM2S.js.gz +0 -0
- package/dist/{Model3DScene-SIST7CIH.js → Model3DScene-KVYGN53Y.js} +2 -2
- package/dist/Model3DScene-KVYGN53Y.js.br +0 -0
- package/dist/Model3DScene-KVYGN53Y.js.gz +0 -0
- package/dist/{Model3DScene-4D4GSRIB.mjs → Model3DScene-LYWXBJMA.mjs} +1 -1
- package/dist/Model3DScene-LYWXBJMA.mjs.br +0 -0
- package/dist/Model3DScene-LYWXBJMA.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-GRM24VBC.js → SurfaceChart3DScene-E2PSO2FF.js} +2 -2
- package/dist/SurfaceChart3DScene-E2PSO2FF.js.br +0 -0
- package/dist/SurfaceChart3DScene-E2PSO2FF.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-ZT7L27U4.mjs → SurfaceChart3DScene-Z4IIOBDM.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-ZT7L27U4.mjs.br → SurfaceChart3DScene-Z4IIOBDM.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-Z4IIOBDM.mjs.gz +0 -0
- package/dist/{chunk-VDQD3ZOU.mjs → chunk-4OWZJUAI.mjs} +7 -2
- package/dist/chunk-4OWZJUAI.mjs.br +0 -0
- package/dist/chunk-4OWZJUAI.mjs.gz +0 -0
- package/dist/{chunk-6F76GHPE.mjs → chunk-ACCX43JJ.mjs} +15 -1410
- package/dist/chunk-ACCX43JJ.mjs.br +0 -0
- package/dist/chunk-ACCX43JJ.mjs.gz +0 -0
- package/dist/{chunk-YZHBUMVU.mjs → chunk-EPYWIXP7.mjs} +1114 -527
- package/dist/chunk-EPYWIXP7.mjs.br +0 -0
- package/dist/chunk-EPYWIXP7.mjs.gz +0 -0
- package/dist/{chunk-GUDJDY4J.js → chunk-LYOEX3FB.js} +342 -427
- package/dist/chunk-LYOEX3FB.js.br +0 -0
- package/dist/chunk-LYOEX3FB.js.gz +0 -0
- package/dist/{chunk-NI5GSVZU.mjs → chunk-NAMV6PRF.mjs} +6 -91
- package/dist/chunk-NAMV6PRF.mjs.br +0 -0
- package/dist/chunk-NAMV6PRF.mjs.gz +0 -0
- package/dist/{chunk-H36QL5T5.js → chunk-QBRZ3VIC.js} +258 -1683
- package/dist/chunk-QBRZ3VIC.js.br +0 -0
- package/dist/chunk-QBRZ3VIC.js.gz +0 -0
- package/dist/{chunk-RZYOOWZN.js → chunk-SADF35N7.js} +1165 -13
- package/dist/chunk-SADF35N7.js.br +0 -0
- package/dist/chunk-SADF35N7.js.gz +0 -0
- package/dist/{chunk-DYGKE2LY.js → chunk-SGJP2EUI.js} +2128 -1541
- package/dist/chunk-SGJP2EUI.js.br +0 -0
- package/dist/chunk-SGJP2EUI.js.gz +0 -0
- package/dist/{chunk-PUBYHZYJ.mjs → chunk-SKQCLCBF.mjs} +1132 -6
- package/dist/chunk-SKQCLCBF.mjs.br +0 -0
- package/dist/chunk-SKQCLCBF.mjs.gz +0 -0
- package/dist/{chunk-YDYAOW6D.js → chunk-YT25W6IR.js} +9 -3
- package/dist/chunk-YT25W6IR.js.br +0 -0
- package/dist/chunk-YT25W6IR.js.gz +0 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +39 -39
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +27 -7
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +78 -78
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +3 -3
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/{useViewerBuildingBlocks-DpzU8NZ_.d.ts → useViewerBuildingBlocks-Xddn6SFj.d.ts} +13 -1
- package/dist/useViewerBuildingBlocks-Xddn6SFj.d.ts.map +1 -0
- package/dist/viewer/index.js +26 -26
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +5 -5
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-NQFSMKIJ.mjs.br +0 -0
- package/dist/AiChatPanel-NQFSMKIJ.mjs.gz +0 -0
- package/dist/AiChatPanel-T6UN6LME.js.br +0 -0
- package/dist/AiChatPanel-T6UN6LME.js.gz +0 -0
- package/dist/Model3DScene-4D4GSRIB.mjs.br +0 -0
- package/dist/Model3DScene-4D4GSRIB.mjs.gz +0 -0
- package/dist/Model3DScene-SIST7CIH.js.br +0 -0
- package/dist/Model3DScene-SIST7CIH.js.gz +0 -0
- package/dist/SurfaceChart3DScene-GRM24VBC.js.br +0 -0
- package/dist/SurfaceChart3DScene-GRM24VBC.js.gz +0 -0
- package/dist/SurfaceChart3DScene-ZT7L27U4.mjs.gz +0 -0
- package/dist/chunk-6F76GHPE.mjs.br +0 -0
- package/dist/chunk-6F76GHPE.mjs.gz +0 -0
- package/dist/chunk-DYGKE2LY.js.br +0 -0
- package/dist/chunk-DYGKE2LY.js.gz +0 -0
- package/dist/chunk-GUDJDY4J.js.br +0 -0
- package/dist/chunk-GUDJDY4J.js.gz +0 -0
- package/dist/chunk-H36QL5T5.js.br +0 -0
- package/dist/chunk-H36QL5T5.js.gz +0 -0
- package/dist/chunk-NI5GSVZU.mjs.br +0 -0
- package/dist/chunk-NI5GSVZU.mjs.gz +0 -0
- package/dist/chunk-PUBYHZYJ.mjs.br +0 -0
- package/dist/chunk-PUBYHZYJ.mjs.gz +0 -0
- package/dist/chunk-RZYOOWZN.js.br +0 -0
- package/dist/chunk-RZYOOWZN.js.gz +0 -0
- package/dist/chunk-VDQD3ZOU.mjs.br +0 -0
- package/dist/chunk-VDQD3ZOU.mjs.gz +0 -0
- package/dist/chunk-YDYAOW6D.js.br +0 -0
- package/dist/chunk-YDYAOW6D.js.gz +0 -0
- package/dist/chunk-YZHBUMVU.mjs.br +0 -0
- package/dist/chunk-YZHBUMVU.mjs.gz +0 -0
- package/dist/useViewerBuildingBlocks-DpzU8NZ_.d.ts.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkQBRZ3VIC_js = require('./chunk-QBRZ3VIC.js');
|
|
4
4
|
var chunkDVZF4ARG_js = require('./chunk-DVZF4ARG.js');
|
|
5
|
-
var
|
|
5
|
+
var chunkSADF35N7_js = require('./chunk-SADF35N7.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 = chunkSADF35N7_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 = chunkSADF35N7_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 ??= chunkSADF35N7_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 >= chunkSADF35N7_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
|
+
}, chunkSADF35N7_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 = chunkSADF35N7_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
|
+
chunkSADF35N7_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 = chunkSADF35N7_js.validateRoomId(config.roomId);
|
|
249
249
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
250
|
-
departureRef.current =
|
|
250
|
+
departureRef.current = chunkSADF35N7_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 = chunkSADF35N7_js.validateRoomId(config.roomId);
|
|
293
|
+
const transport = config.transport ?? chunkSADF35N7_js.resolveTransportForServerUrl(config.serverUrl);
|
|
294
294
|
if (transport === "webrtc") {
|
|
295
295
|
await initWebrtc();
|
|
296
296
|
return;
|
|
297
297
|
}
|
|
298
|
-
if (
|
|
298
|
+
if (chunkSADF35N7_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 = chunkSADF35N7_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
|
+
chunkSADF35N7_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
|
+
}, chunkSADF35N7_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
|
+
chunkSADF35N7_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 = chunkSADF35N7_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 = chunkSADF35N7_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,
|
|
@@ -523,8 +523,8 @@ function useEditorHistory(input) {
|
|
|
523
523
|
width: canvasSize.width,
|
|
524
524
|
height: canvasSize.height,
|
|
525
525
|
activeSlideIndex,
|
|
526
|
-
slides: slides.map(
|
|
527
|
-
templateElementsBySlideId:
|
|
526
|
+
slides: slides.map(chunkSADF35N7_js.cloneSlide),
|
|
527
|
+
templateElementsBySlideId: chunkSADF35N7_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
528
528
|
...actionLabel ? { actionLabel } : {}
|
|
529
529
|
};
|
|
530
530
|
},
|
|
@@ -537,9 +537,9 @@ function useEditorHistory(input) {
|
|
|
537
537
|
width: snapshot.width,
|
|
538
538
|
height: snapshot.height
|
|
539
539
|
});
|
|
540
|
-
setSlides(snapshot.slides.map(
|
|
540
|
+
setSlides(snapshot.slides.map(chunkSADF35N7_js.cloneSlide));
|
|
541
541
|
setTemplateElementsBySlideId(
|
|
542
|
-
|
|
542
|
+
chunkSADF35N7_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
543
543
|
);
|
|
544
544
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
545
545
|
setSelectedElementIds([]);
|
|
@@ -573,8 +573,8 @@ function useEditorHistory(input) {
|
|
|
573
573
|
const currentSnapshot = buildHistorySnapshot();
|
|
574
574
|
historyFutureRef.current.push(currentSnapshot);
|
|
575
575
|
isApplyingHistoryRef.current = true;
|
|
576
|
-
const nextSnapshot =
|
|
577
|
-
lastHistorySnapshotRef.current =
|
|
576
|
+
const nextSnapshot = chunkQBRZ3VIC_js.cloneHistorySnapshot(previousSnapshot);
|
|
577
|
+
lastHistorySnapshotRef.current = chunkQBRZ3VIC_js.cloneHistorySnapshot(nextSnapshot);
|
|
578
578
|
lastHistorySerializedRef.current = JSON.stringify(nextSnapshot);
|
|
579
579
|
applyHistorySnapshot(nextSnapshot);
|
|
580
580
|
updateHistoryAvailability();
|
|
@@ -595,8 +595,8 @@ function useEditorHistory(input) {
|
|
|
595
595
|
const currentSnapshot = buildHistorySnapshot();
|
|
596
596
|
historyPastRef.current.push(currentSnapshot);
|
|
597
597
|
isApplyingHistoryRef.current = true;
|
|
598
|
-
const targetSnapshot =
|
|
599
|
-
lastHistorySnapshotRef.current =
|
|
598
|
+
const targetSnapshot = chunkQBRZ3VIC_js.cloneHistorySnapshot(nextSnapshot);
|
|
599
|
+
lastHistorySnapshotRef.current = chunkQBRZ3VIC_js.cloneHistorySnapshot(targetSnapshot);
|
|
600
600
|
lastHistorySerializedRef.current = JSON.stringify(targetSnapshot);
|
|
601
601
|
applyHistorySnapshot(targetSnapshot);
|
|
602
602
|
updateHistoryAvailability();
|
|
@@ -614,7 +614,7 @@ function useEditorHistory(input) {
|
|
|
614
614
|
historyPastRef.current = [];
|
|
615
615
|
historyFutureRef.current = [];
|
|
616
616
|
if (initialSnapshot) {
|
|
617
|
-
const clonedInitial =
|
|
617
|
+
const clonedInitial = chunkQBRZ3VIC_js.cloneHistorySnapshot(initialSnapshot);
|
|
618
618
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
619
619
|
lastHistorySerializedRef.current = JSON.stringify(clonedInitial);
|
|
620
620
|
} else {
|
|
@@ -655,18 +655,18 @@ function useEditorHistory(input) {
|
|
|
655
655
|
}
|
|
656
656
|
const previousSnapshot = lastHistorySnapshotRef.current;
|
|
657
657
|
if (!previousSnapshot) {
|
|
658
|
-
lastHistorySnapshotRef.current =
|
|
658
|
+
lastHistorySnapshotRef.current = chunkQBRZ3VIC_js.cloneHistorySnapshot(snapshot);
|
|
659
659
|
lastHistorySerializedRef.current = serialized;
|
|
660
660
|
lastCheapHashRef.current = cheapHash;
|
|
661
661
|
updateHistoryAvailability();
|
|
662
662
|
return;
|
|
663
663
|
}
|
|
664
|
-
historyPastRef.current.push(
|
|
664
|
+
historyPastRef.current.push(chunkQBRZ3VIC_js.cloneHistorySnapshot(previousSnapshot));
|
|
665
665
|
while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
|
|
666
666
|
historyPastRef.current.shift();
|
|
667
667
|
}
|
|
668
668
|
historyFutureRef.current = [];
|
|
669
|
-
lastHistorySnapshotRef.current =
|
|
669
|
+
lastHistorySnapshotRef.current = chunkQBRZ3VIC_js.cloneHistorySnapshot(snapshot);
|
|
670
670
|
lastHistorySerializedRef.current = serialized;
|
|
671
671
|
lastCheapHashRef.current = cheapHash;
|
|
672
672
|
updateHistoryAvailability();
|
|
@@ -726,9 +726,9 @@ function useZoomViewport({
|
|
|
726
726
|
const canvasStageRef = react.useRef(null);
|
|
727
727
|
const canvasViewportRef = react.useRef(null);
|
|
728
728
|
const renderScaleRef = react.useRef(1);
|
|
729
|
-
const wheelBufferRef = react.useRef(
|
|
729
|
+
const wheelBufferRef = react.useRef(chunkSADF35N7_js.createWheelStepBuffer());
|
|
730
730
|
const storeRef = react.useRef(null);
|
|
731
|
-
storeRef.current ??=
|
|
731
|
+
storeRef.current ??= chunkSADF35N7_js.createViewerZoomStore();
|
|
732
732
|
const store = storeRef.current;
|
|
733
733
|
const scale = useViewerStore(store, selectZoom);
|
|
734
734
|
const setScale = react.useCallback(
|
|
@@ -789,7 +789,7 @@ function useZoomViewport({
|
|
|
789
789
|
if (!wrapper || !canvasViewport) {
|
|
790
790
|
return;
|
|
791
791
|
}
|
|
792
|
-
const boundedScale =
|
|
792
|
+
const boundedScale = chunkSADF35N7_js.clampZoomScale(nextScale);
|
|
793
793
|
const nextEditorScale = fitScale * boundedScale;
|
|
794
794
|
const centerX = (bounds.minX + bounds.maxX) / 2;
|
|
795
795
|
const centerY = (bounds.minY + bounds.maxY) / 2;
|
|
@@ -826,29 +826,29 @@ function useZoomViewport({
|
|
|
826
826
|
selectedElements.forEach((element) => {
|
|
827
827
|
minX = Math.min(minX, element.x);
|
|
828
828
|
minY = Math.min(minY, element.y);
|
|
829
|
-
maxX = Math.max(maxX, element.x + Math.max(element.width,
|
|
830
|
-
maxY = Math.max(maxY, element.y + Math.max(element.height,
|
|
829
|
+
maxX = Math.max(maxX, element.x + Math.max(element.width, chunkQBRZ3VIC_js.MIN_ELEMENT_SIZE));
|
|
830
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkQBRZ3VIC_js.MIN_ELEMENT_SIZE));
|
|
831
831
|
});
|
|
832
832
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
833
833
|
return;
|
|
834
834
|
}
|
|
835
835
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
836
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
837
|
-
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY,
|
|
836
|
+
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkQBRZ3VIC_js.MIN_ELEMENT_SIZE);
|
|
837
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkQBRZ3VIC_js.MIN_ELEMENT_SIZE);
|
|
838
838
|
const availableWidth = Math.max(
|
|
839
|
-
effectiveEditorDimensions.width -
|
|
840
|
-
|
|
839
|
+
effectiveEditorDimensions.width - chunkQBRZ3VIC_js.ZOOM_TO_SELECTION_PADDING,
|
|
840
|
+
chunkQBRZ3VIC_js.MIN_ELEMENT_SIZE
|
|
841
841
|
);
|
|
842
842
|
const availableHeight = Math.max(
|
|
843
|
-
effectiveEditorDimensions.height -
|
|
844
|
-
|
|
843
|
+
effectiveEditorDimensions.height - chunkQBRZ3VIC_js.ZOOM_TO_SELECTION_PADDING,
|
|
844
|
+
chunkQBRZ3VIC_js.MIN_ELEMENT_SIZE
|
|
845
845
|
);
|
|
846
846
|
const targetEditorScale = Math.min(
|
|
847
847
|
availableWidth / boundsWidth,
|
|
848
848
|
availableHeight / boundsHeight
|
|
849
849
|
);
|
|
850
850
|
const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
|
|
851
|
-
const nextScale =
|
|
851
|
+
const nextScale = chunkSADF35N7_js.clampZoomScale(targetEditorScale / safeFitScale);
|
|
852
852
|
setScale(nextScale);
|
|
853
853
|
window.requestAnimationFrame(() => {
|
|
854
854
|
window.requestAnimationFrame(() => {
|
|
@@ -865,14 +865,14 @@ function useZoomViewport({
|
|
|
865
865
|
]);
|
|
866
866
|
const handleWheel = react.useCallback(
|
|
867
867
|
(event) => {
|
|
868
|
-
const mapped =
|
|
868
|
+
const mapped = chunkSADF35N7_js.mapEditingWheel(event, wheelBufferRef.current, true);
|
|
869
869
|
if (mapped.intent !== "zoom") {
|
|
870
870
|
return;
|
|
871
871
|
}
|
|
872
872
|
event.preventDefault();
|
|
873
873
|
store.dispatch({
|
|
874
874
|
type: "set-zoom",
|
|
875
|
-
zoom:
|
|
875
|
+
zoom: chunkSADF35N7_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
|
|
876
876
|
});
|
|
877
877
|
},
|
|
878
878
|
[store]
|
|
@@ -960,7 +960,7 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
|
|
|
960
960
|
const command = step.command;
|
|
961
961
|
const timer = window.setTimeout(
|
|
962
962
|
() => {
|
|
963
|
-
|
|
963
|
+
chunkQBRZ3VIC_js.executeMediaCommand(command);
|
|
964
964
|
},
|
|
965
965
|
Math.max(0, step.delayMs)
|
|
966
966
|
);
|
|
@@ -1097,7 +1097,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
|
|
|
1097
1097
|
}))
|
|
1098
1098
|
);
|
|
1099
1099
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1100
|
-
const delay =
|
|
1100
|
+
const delay = chunkSADF35N7_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1101
1101
|
const timer = window.setTimeout(() => {
|
|
1102
1102
|
setPresentationAnimations(
|
|
1103
1103
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1129,7 +1129,7 @@ function useAnimationPlayback(input) {
|
|
|
1129
1129
|
(controller, group) => {
|
|
1130
1130
|
driveBuildReveal(
|
|
1131
1131
|
controller,
|
|
1132
|
-
|
|
1132
|
+
chunkSADF35N7_js.PresentationAnimationController.collectBuildStepIds(group),
|
|
1133
1133
|
setPresentationElementStates,
|
|
1134
1134
|
buildRafRef
|
|
1135
1135
|
);
|
|
@@ -1192,7 +1192,7 @@ function useAnimationPlayback(input) {
|
|
|
1192
1192
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1193
1193
|
return;
|
|
1194
1194
|
}
|
|
1195
|
-
const controller =
|
|
1195
|
+
const controller = chunkSADF35N7_js.PresentationAnimationController.fromSlide(slide);
|
|
1196
1196
|
controllerRef.current = controller;
|
|
1197
1197
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1198
1198
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
@@ -1350,12 +1350,12 @@ function useAnimationPlayback(input) {
|
|
|
1350
1350
|
presentationTimersRef
|
|
1351
1351
|
};
|
|
1352
1352
|
}
|
|
1353
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1354
|
-
var AUDIENCE_HASH =
|
|
1355
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1356
|
-
var AUDIENCE_NONCE_KEY =
|
|
1353
|
+
var PRESENTER_CHANNEL_NAME = chunkSADF35N7_js.PRESENTATION_CHANNEL_NAME;
|
|
1354
|
+
var AUDIENCE_HASH = chunkSADF35N7_js.PRESENTATION_HASH;
|
|
1355
|
+
var PRESENTER_MSG_ORIGIN = chunkSADF35N7_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1356
|
+
var AUDIENCE_NONCE_KEY = chunkSADF35N7_js.PRESENTATION_NONCE_KEY;
|
|
1357
1357
|
function generateSessionId() {
|
|
1358
|
-
return
|
|
1358
|
+
return chunkSADF35N7_js.createPresentationSessionId();
|
|
1359
1359
|
}
|
|
1360
1360
|
function parseAudienceNonce() {
|
|
1361
1361
|
const hash = window.location.hash;
|
|
@@ -1391,7 +1391,7 @@ function usePresenterWindow(input) {
|
|
|
1391
1391
|
}, []);
|
|
1392
1392
|
const swapDisplays = react.useCallback(async () => {
|
|
1393
1393
|
const audience = audienceWindowRef.current;
|
|
1394
|
-
return audience && !audience.closed ?
|
|
1394
|
+
return audience && !audience.closed ? chunkSADF35N7_js.swapPresentationWindows(window, audience) : false;
|
|
1395
1395
|
}, []);
|
|
1396
1396
|
const syncSlideToAudience = react.useCallback(
|
|
1397
1397
|
(slideIndex) => {
|
|
@@ -1455,7 +1455,7 @@ function usePresenterWindow(input) {
|
|
|
1455
1455
|
pollTimerRef.current = null;
|
|
1456
1456
|
}
|
|
1457
1457
|
if (closingSessionId) {
|
|
1458
|
-
void
|
|
1458
|
+
void chunkSADF35N7_js.clearAudienceContent(closingSessionId);
|
|
1459
1459
|
}
|
|
1460
1460
|
}, [getChannel]);
|
|
1461
1461
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1473,10 +1473,10 @@ function usePresenterWindow(input) {
|
|
|
1473
1473
|
audienceWindowRef.current = blankWin;
|
|
1474
1474
|
const sessionId = generateSessionId();
|
|
1475
1475
|
sessionIdRef.current = sessionId;
|
|
1476
|
-
const audienceUrl =
|
|
1477
|
-
void
|
|
1476
|
+
const audienceUrl = chunkSADF35N7_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1477
|
+
void chunkSADF35N7_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1478
1478
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1479
|
-
|
|
1479
|
+
chunkSADF35N7_js.placeAudienceWindow(blankWin, placement);
|
|
1480
1480
|
}
|
|
1481
1481
|
return void 0;
|
|
1482
1482
|
});
|
|
@@ -1506,7 +1506,7 @@ function usePresenterWindow(input) {
|
|
|
1506
1506
|
}
|
|
1507
1507
|
};
|
|
1508
1508
|
if (content) {
|
|
1509
|
-
void
|
|
1509
|
+
void chunkSADF35N7_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1510
1510
|
} else {
|
|
1511
1511
|
navigateOrClose(true);
|
|
1512
1512
|
}
|
|
@@ -1532,7 +1532,7 @@ function usePresenterWindow(input) {
|
|
|
1532
1532
|
}
|
|
1533
1533
|
const handleMessage = (event) => {
|
|
1534
1534
|
const message = event.data;
|
|
1535
|
-
if (
|
|
1535
|
+
if (chunkSADF35N7_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1536
1536
|
syncStateToAudience(snapshotRef.current);
|
|
1537
1537
|
}
|
|
1538
1538
|
};
|
|
@@ -1561,7 +1561,7 @@ function usePresenterWindow(input) {
|
|
|
1561
1561
|
react.useEffect(() => {
|
|
1562
1562
|
const handleBeforeUnload = () => {
|
|
1563
1563
|
if (sessionIdRef.current) {
|
|
1564
|
-
void
|
|
1564
|
+
void chunkSADF35N7_js.clearAudienceContent(sessionIdRef.current);
|
|
1565
1565
|
}
|
|
1566
1566
|
};
|
|
1567
1567
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1623,7 +1623,7 @@ function useAudienceMode(input) {
|
|
|
1623
1623
|
}
|
|
1624
1624
|
channel.onmessage = (event) => {
|
|
1625
1625
|
const data = event.data;
|
|
1626
|
-
if (!
|
|
1626
|
+
if (!chunkSADF35N7_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1627
1627
|
return;
|
|
1628
1628
|
}
|
|
1629
1629
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1639,16 +1639,16 @@ function useAudienceMode(input) {
|
|
|
1639
1639
|
}
|
|
1640
1640
|
if (data.type === "presenter-exit") {
|
|
1641
1641
|
if (expectedSessionId) {
|
|
1642
|
-
void
|
|
1642
|
+
void chunkSADF35N7_js.clearAudienceContent(expectedSessionId);
|
|
1643
1643
|
}
|
|
1644
|
-
if (
|
|
1644
|
+
if (chunkSADF35N7_js.endAudienceDisplay(window)) {
|
|
1645
1645
|
handlers.onPresenterEnded?.();
|
|
1646
1646
|
}
|
|
1647
1647
|
}
|
|
1648
1648
|
};
|
|
1649
1649
|
if (expectedSessionId) {
|
|
1650
1650
|
channel.postMessage({
|
|
1651
|
-
origin:
|
|
1651
|
+
origin: chunkSADF35N7_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1652
1652
|
type: "audience-ready",
|
|
1653
1653
|
sessionId: expectedSessionId
|
|
1654
1654
|
});
|
|
@@ -1662,7 +1662,7 @@ function useAudienceMode(input) {
|
|
|
1662
1662
|
}, []);
|
|
1663
1663
|
}
|
|
1664
1664
|
function usePresentationKeyboard(input) {
|
|
1665
|
-
const wheelBufferRef = react.useRef(
|
|
1665
|
+
const wheelBufferRef = react.useRef(chunkSADF35N7_js.createWheelStepBuffer());
|
|
1666
1666
|
const {
|
|
1667
1667
|
mode,
|
|
1668
1668
|
movePresentationSlide,
|
|
@@ -1682,14 +1682,14 @@ function usePresentationKeyboard(input) {
|
|
|
1682
1682
|
presentationSlideIndex,
|
|
1683
1683
|
setShowRehearsalSummary
|
|
1684
1684
|
} = input;
|
|
1685
|
-
const keyBufferRef = react.useRef(
|
|
1685
|
+
const keyBufferRef = react.useRef(chunkSADF35N7_js.createPresentationKeyBuffer());
|
|
1686
1686
|
react.useEffect(() => {
|
|
1687
|
-
if (mode !== "present" || !
|
|
1688
|
-
keyBufferRef.current =
|
|
1687
|
+
if (mode !== "present" || !chunkSADF35N7_js.acceptsPresentationInput()) {
|
|
1688
|
+
keyBufferRef.current = chunkSADF35N7_js.createPresentationKeyBuffer();
|
|
1689
1689
|
return;
|
|
1690
1690
|
}
|
|
1691
1691
|
const handleKeyDown = (event) => {
|
|
1692
|
-
const mapped =
|
|
1692
|
+
const mapped = chunkSADF35N7_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1693
1693
|
if (mapped.action === "none") {
|
|
1694
1694
|
return;
|
|
1695
1695
|
}
|
|
@@ -1709,12 +1709,12 @@ function usePresentationKeyboard(input) {
|
|
|
1709
1709
|
movePresentationSlide(-1);
|
|
1710
1710
|
return;
|
|
1711
1711
|
case "first": {
|
|
1712
|
-
const first =
|
|
1712
|
+
const first = chunkSADF35N7_js.firstShowSlideIndex(showSlideIndexes);
|
|
1713
1713
|
navigateToSlide(first ?? 0);
|
|
1714
1714
|
return;
|
|
1715
1715
|
}
|
|
1716
1716
|
case "last": {
|
|
1717
|
-
const last =
|
|
1717
|
+
const last = chunkSADF35N7_js.lastShowSlideIndex(showSlideIndexes);
|
|
1718
1718
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1719
1719
|
return;
|
|
1720
1720
|
}
|
|
@@ -1749,10 +1749,10 @@ function usePresentationKeyboard(input) {
|
|
|
1749
1749
|
}
|
|
1750
1750
|
};
|
|
1751
1751
|
const handleWheel = (event) => {
|
|
1752
|
-
if (mode !== "present" || !
|
|
1752
|
+
if (mode !== "present" || !chunkSADF35N7_js.acceptsPresentationInput()) {
|
|
1753
1753
|
return;
|
|
1754
1754
|
}
|
|
1755
|
-
const mapped =
|
|
1755
|
+
const mapped = chunkSADF35N7_js.mapPresentationWheel(event, wheelBufferRef.current);
|
|
1756
1756
|
if (mapped.intent === "next-slide") {
|
|
1757
1757
|
event.preventDefault();
|
|
1758
1758
|
movePresentationSlide(1);
|
|
@@ -1884,7 +1884,7 @@ function useRehearsalTimings(input) {
|
|
|
1884
1884
|
|
|
1885
1885
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1886
1886
|
function handlePresentationActionImpl(action, deps) {
|
|
1887
|
-
|
|
1887
|
+
chunkSADF35N7_js.runPresentationAction(
|
|
1888
1888
|
action,
|
|
1889
1889
|
{ slideCount: deps.slidesLength },
|
|
1890
1890
|
{
|
|
@@ -1906,7 +1906,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1906
1906
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1907
1907
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1908
1908
|
const transition = incomingSlide?.transition;
|
|
1909
|
-
const durationMs = deps.playTransition ?
|
|
1909
|
+
const durationMs = deps.playTransition ? chunkSADF35N7_js.resolveTransitionDurationMs(transition) : 0;
|
|
1910
1910
|
deps.clearPresentationTimers();
|
|
1911
1911
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1912
1912
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -1965,7 +1965,7 @@ function useSlideNavigation(input) {
|
|
|
1965
1965
|
});
|
|
1966
1966
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
1967
1967
|
(slideIndex) => {
|
|
1968
|
-
const delayMs =
|
|
1968
|
+
const delayMs = chunkSADF35N7_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
1969
1969
|
if (delayMs === void 0) {
|
|
1970
1970
|
return;
|
|
1971
1971
|
}
|
|
@@ -1988,7 +1988,7 @@ function useSlideNavigation(input) {
|
|
|
1988
1988
|
if (availableSlideIndexes.length === 0) {
|
|
1989
1989
|
return;
|
|
1990
1990
|
}
|
|
1991
|
-
const pastLastSlide = direction === 1 && !
|
|
1991
|
+
const pastLastSlide = direction === 1 && !chunkSADF35N7_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
1992
1992
|
if (rehearsing && pastLastSlide) {
|
|
1993
1993
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
1994
1994
|
try {
|
|
@@ -2006,9 +2006,9 @@ function useSlideNavigation(input) {
|
|
|
2006
2006
|
onAdvancePastLastSlide();
|
|
2007
2007
|
return;
|
|
2008
2008
|
}
|
|
2009
|
-
const nextSlideIndex = direction === 1 ?
|
|
2009
|
+
const nextSlideIndex = direction === 1 ? chunkSADF35N7_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
2010
2010
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
2011
|
-
}) :
|
|
2011
|
+
}) : chunkSADF35N7_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
2012
2012
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
2013
2013
|
return;
|
|
2014
2014
|
}
|
|
@@ -2153,22 +2153,22 @@ function useZoomNavigation(input) {
|
|
|
2153
2153
|
};
|
|
2154
2154
|
}
|
|
2155
2155
|
function usePresenterConsole(slideIndex, active) {
|
|
2156
|
-
const timerRef = react.useRef(
|
|
2157
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2156
|
+
const timerRef = react.useRef(chunkSADF35N7_js.createPresenterTimer());
|
|
2157
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkSADF35N7_js.createInitialPresentationSnapshot(slideIndex));
|
|
2158
2158
|
const patch = react.useCallback((value) => {
|
|
2159
|
-
setSnapshot((current) =>
|
|
2159
|
+
setSnapshot((current) => chunkSADF35N7_js.mergePresentationSnapshot(current, value));
|
|
2160
2160
|
}, []);
|
|
2161
2161
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2162
2162
|
react.useEffect(() => {
|
|
2163
2163
|
if (!active) {
|
|
2164
2164
|
return;
|
|
2165
2165
|
}
|
|
2166
|
-
timerRef.current =
|
|
2166
|
+
timerRef.current = chunkSADF35N7_js.resetPresenterTimer();
|
|
2167
2167
|
patch({ paused: false, elapsedMs: 0 });
|
|
2168
2168
|
const timer = window.setInterval(() => {
|
|
2169
2169
|
patch({
|
|
2170
2170
|
paused: timerRef.current.paused,
|
|
2171
|
-
elapsedMs:
|
|
2171
|
+
elapsedMs: chunkSADF35N7_js.presenterElapsed(timerRef.current)
|
|
2172
2172
|
});
|
|
2173
2173
|
}, 1e3);
|
|
2174
2174
|
return () => window.clearInterval(timer);
|
|
@@ -2178,19 +2178,19 @@ function usePresenterConsole(slideIndex, active) {
|
|
|
2178
2178
|
applyAudienceSnapshot: setSnapshot,
|
|
2179
2179
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2180
2180
|
toggleTimer: () => {
|
|
2181
|
-
timerRef.current =
|
|
2181
|
+
timerRef.current = chunkSADF35N7_js.togglePresenterTimer(timerRef.current);
|
|
2182
2182
|
patch({
|
|
2183
2183
|
paused: timerRef.current.paused,
|
|
2184
|
-
elapsedMs:
|
|
2184
|
+
elapsedMs: chunkSADF35N7_js.presenterElapsed(timerRef.current)
|
|
2185
2185
|
});
|
|
2186
2186
|
},
|
|
2187
2187
|
resetTimer: () => {
|
|
2188
|
-
timerRef.current =
|
|
2188
|
+
timerRef.current = chunkSADF35N7_js.resetPresenterTimer();
|
|
2189
2189
|
patch({ paused: false, elapsedMs: 0 });
|
|
2190
2190
|
},
|
|
2191
2191
|
stepZoom: (direction) => setSnapshot(
|
|
2192
|
-
(current) =>
|
|
2193
|
-
zoom:
|
|
2192
|
+
(current) => chunkSADF35N7_js.mergePresentationSnapshot(current, {
|
|
2193
|
+
zoom: chunkSADF35N7_js.stepPresenterZoom(
|
|
2194
2194
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2195
2195
|
direction
|
|
2196
2196
|
)
|
|
@@ -2235,7 +2235,7 @@ function usePresentationMode(input) {
|
|
|
2235
2235
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2236
2236
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2237
2237
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2238
|
-
const showGuard = react.useMemo(() =>
|
|
2238
|
+
const showGuard = react.useMemo(() => chunkSADF35N7_js.createPresenterShowGuard(), []);
|
|
2239
2239
|
const {
|
|
2240
2240
|
presentationAnimations,
|
|
2241
2241
|
presentationElementStates,
|
|
@@ -2314,7 +2314,7 @@ function usePresentationMode(input) {
|
|
|
2314
2314
|
});
|
|
2315
2315
|
const movePresentationSlide = react.useCallback(
|
|
2316
2316
|
(direction, trigger = "explicit") => {
|
|
2317
|
-
if (!
|
|
2317
|
+
if (!chunkSADF35N7_js.acceptsPresentationInput()) {
|
|
2318
2318
|
return;
|
|
2319
2319
|
}
|
|
2320
2320
|
if (endOfShowVisible) {
|
|
@@ -2451,7 +2451,7 @@ function usePresentationMode(input) {
|
|
|
2451
2451
|
if (mode !== "present") {
|
|
2452
2452
|
return;
|
|
2453
2453
|
}
|
|
2454
|
-
return
|
|
2454
|
+
return chunkSADF35N7_js.attachPresentationVisibilityPause({
|
|
2455
2455
|
root: containerRef.current ?? void 0,
|
|
2456
2456
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2457
2457
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
@@ -2531,11 +2531,11 @@ function usePresentationMode(input) {
|
|
|
2531
2531
|
if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
|
|
2532
2532
|
return void 0;
|
|
2533
2533
|
}
|
|
2534
|
-
return
|
|
2534
|
+
return chunkSADF35N7_js.buildMorphTransitionPlan(
|
|
2535
2535
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2536
2536
|
slides[transitionOverlay.incomingSlideIndex],
|
|
2537
2537
|
transitionOverlay.durationMs,
|
|
2538
|
-
|
|
2538
|
+
chunkSADF35N7_js.morphOptionToMode(transitionOverlay.transition.morphOption)
|
|
2539
2539
|
);
|
|
2540
2540
|
}, [transitionOverlay, slides]);
|
|
2541
2541
|
const morphedElementStates = react.useMemo(() => {
|
|
@@ -2556,7 +2556,7 @@ function usePresentationMode(input) {
|
|
|
2556
2556
|
if (!morphPlan) {
|
|
2557
2557
|
return presentationKeyframesCss;
|
|
2558
2558
|
}
|
|
2559
|
-
const imageRules =
|
|
2559
|
+
const imageRules = chunkSADF35N7_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
|
|
2560
2560
|
return `${presentationKeyframesCss ?? ""}
|
|
2561
2561
|
${morphPlan.keyframesCss}
|
|
2562
2562
|
${imageRules}`;
|
|
@@ -2837,93 +2837,6 @@ function usePresentationAnnotations(input) {
|
|
|
2837
2837
|
clearAllAnnotations
|
|
2838
2838
|
};
|
|
2839
2839
|
}
|
|
2840
|
-
function findInSlides(slides, findQuery, findMatchCase) {
|
|
2841
|
-
if (!findQuery) {
|
|
2842
|
-
return [];
|
|
2843
|
-
}
|
|
2844
|
-
const results = [];
|
|
2845
|
-
const normalised = findMatchCase ? findQuery : findQuery.toLowerCase();
|
|
2846
|
-
slides.forEach((slide, slideIndex) => {
|
|
2847
|
-
for (const element of slide.elements || []) {
|
|
2848
|
-
if (!chunkRZYOOWZN_js.hasTextProperties(element)) {
|
|
2849
|
-
continue;
|
|
2850
|
-
}
|
|
2851
|
-
const segments = element.textSegments ?? [];
|
|
2852
|
-
segments.forEach((seg, segIndex) => {
|
|
2853
|
-
const text = findMatchCase ? seg.text : (seg.text || "").toLowerCase();
|
|
2854
|
-
let offset = 0;
|
|
2855
|
-
while (offset < text.length) {
|
|
2856
|
-
const pos = text.indexOf(normalised, offset);
|
|
2857
|
-
if (pos === -1) {
|
|
2858
|
-
break;
|
|
2859
|
-
}
|
|
2860
|
-
results.push({
|
|
2861
|
-
slideIndex,
|
|
2862
|
-
elementId: element.id,
|
|
2863
|
-
segmentIndex: segIndex,
|
|
2864
|
-
startOffset: pos,
|
|
2865
|
-
length: findQuery.length
|
|
2866
|
-
});
|
|
2867
|
-
offset = pos + 1;
|
|
2868
|
-
}
|
|
2869
|
-
});
|
|
2870
|
-
}
|
|
2871
|
-
});
|
|
2872
|
-
return results;
|
|
2873
|
-
}
|
|
2874
|
-
function applyFindReplacements(slides, toReplace, replaceQuery) {
|
|
2875
|
-
if (toReplace.length === 0) {
|
|
2876
|
-
return slides;
|
|
2877
|
-
}
|
|
2878
|
-
const nextSlides = [...slides];
|
|
2879
|
-
const grouped = /* @__PURE__ */ new Map();
|
|
2880
|
-
for (const match of toReplace) {
|
|
2881
|
-
const key = `${match.slideIndex}::${match.elementId}::${match.segmentIndex}`;
|
|
2882
|
-
if (!grouped.has(key)) {
|
|
2883
|
-
grouped.set(key, []);
|
|
2884
|
-
}
|
|
2885
|
-
grouped.get(key).push(match);
|
|
2886
|
-
}
|
|
2887
|
-
for (const [, matches] of grouped) {
|
|
2888
|
-
const sorted = [...matches].sort((a, b) => b.startOffset - a.startOffset);
|
|
2889
|
-
for (const match of sorted) {
|
|
2890
|
-
const slide = nextSlides[match.slideIndex];
|
|
2891
|
-
if (!slide) {
|
|
2892
|
-
continue;
|
|
2893
|
-
}
|
|
2894
|
-
const elIdx = (slide.elements || []).findIndex((e) => e.id === match.elementId);
|
|
2895
|
-
if (elIdx === -1) {
|
|
2896
|
-
continue;
|
|
2897
|
-
}
|
|
2898
|
-
const element = slide.elements[elIdx];
|
|
2899
|
-
if (!chunkRZYOOWZN_js.hasTextProperties(element)) {
|
|
2900
|
-
continue;
|
|
2901
|
-
}
|
|
2902
|
-
const segments = [...element.textSegments ?? []];
|
|
2903
|
-
const seg = segments[match.segmentIndex];
|
|
2904
|
-
if (!seg) {
|
|
2905
|
-
continue;
|
|
2906
|
-
}
|
|
2907
|
-
const before = seg.text.slice(0, match.startOffset);
|
|
2908
|
-
const after = seg.text.slice(match.startOffset + match.length);
|
|
2909
|
-
segments[match.segmentIndex] = {
|
|
2910
|
-
...seg,
|
|
2911
|
-
text: before + replaceQuery + after
|
|
2912
|
-
};
|
|
2913
|
-
const nextElements = [...slide.elements];
|
|
2914
|
-
nextElements[elIdx] = {
|
|
2915
|
-
...element,
|
|
2916
|
-
text: segments.map((s) => s.text).join(""),
|
|
2917
|
-
textSegments: segments
|
|
2918
|
-
};
|
|
2919
|
-
nextSlides[match.slideIndex] = {
|
|
2920
|
-
...slide,
|
|
2921
|
-
elements: nextElements
|
|
2922
|
-
};
|
|
2923
|
-
}
|
|
2924
|
-
}
|
|
2925
|
-
return nextSlides;
|
|
2926
|
-
}
|
|
2927
2840
|
function useFindReplace({
|
|
2928
2841
|
slides,
|
|
2929
2842
|
mode,
|
|
@@ -2939,7 +2852,7 @@ function useFindReplace({
|
|
|
2939
2852
|
const [findResults, setFindResults] = react.useState([]);
|
|
2940
2853
|
const [findResultIndex, setFindResultIndex] = react.useState(-1);
|
|
2941
2854
|
const performFind = react.useCallback(() => {
|
|
2942
|
-
const results = findInSlides(slides, findQuery, findMatchCase);
|
|
2855
|
+
const results = chunkSADF35N7_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
|
|
2943
2856
|
if (!findQuery) {
|
|
2944
2857
|
setFindResults([]);
|
|
2945
2858
|
setFindResultIndex(-1);
|
|
@@ -2972,7 +2885,9 @@ function useFindReplace({
|
|
|
2972
2885
|
if (toReplace.length === 0) {
|
|
2973
2886
|
return;
|
|
2974
2887
|
}
|
|
2975
|
-
onUpdateSlides(
|
|
2888
|
+
onUpdateSlides(
|
|
2889
|
+
(prevSlides) => chunkSADF35N7_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
|
|
2890
|
+
);
|
|
2976
2891
|
onMarkDirty();
|
|
2977
2892
|
},
|
|
2978
2893
|
[replaceQuery, onUpdateSlides, onMarkDirty]
|
|
@@ -3495,7 +3410,7 @@ function useViewerCoreState(_input) {
|
|
|
3495
3410
|
const marqueeStateRef = react.useRef(null);
|
|
3496
3411
|
const isDrawingRef = react.useRef(false);
|
|
3497
3412
|
const justInteractedRef = react.useRef(false);
|
|
3498
|
-
const livePatcher = react.useMemo(() =>
|
|
3413
|
+
const livePatcher = react.useMemo(() => chunkSADF35N7_js.createCollaborationLivePatcher(), []);
|
|
3499
3414
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3500
3415
|
const slidesRef = react.useRef([]);
|
|
3501
3416
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3504,8 +3419,8 @@ function useViewerCoreState(_input) {
|
|
|
3504
3419
|
const [slides, setSlides] = react.useState([]);
|
|
3505
3420
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3506
3421
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3507
|
-
width:
|
|
3508
|
-
height:
|
|
3422
|
+
width: chunkQBRZ3VIC_js.DEFAULT_CANVAS_WIDTH,
|
|
3423
|
+
height: chunkQBRZ3VIC_js.DEFAULT_CANVAS_HEIGHT
|
|
3509
3424
|
});
|
|
3510
3425
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
3511
3426
|
const [selectedElementId, setSelectedElementId] = react.useState(null);
|
|
@@ -3525,7 +3440,7 @@ function useViewerCoreState(_input) {
|
|
|
3525
3440
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3526
3441
|
inlineEditingTextRef.current = resolved;
|
|
3527
3442
|
setInlineEditingTextBase(value);
|
|
3528
|
-
|
|
3443
|
+
chunkSADF35N7_js.publishLiveInlineText(
|
|
3529
3444
|
livePatcher,
|
|
3530
3445
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3531
3446
|
inlineEditingElementIdRef.current,
|
|
@@ -3860,7 +3775,7 @@ function useLoadContent({
|
|
|
3860
3775
|
);
|
|
3861
3776
|
}
|
|
3862
3777
|
const previousHandler = handlerRef.current;
|
|
3863
|
-
const handler = new
|
|
3778
|
+
const handler = new chunkSADF35N7_js.PptxHandler();
|
|
3864
3779
|
const parsed = await handler.load(buffer);
|
|
3865
3780
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3866
3781
|
handler.dispose();
|
|
@@ -3872,7 +3787,7 @@ function useLoadContent({
|
|
|
3872
3787
|
handlerRef.current = null;
|
|
3873
3788
|
const mediaElements = [];
|
|
3874
3789
|
for (const slide of parsed.slides) {
|
|
3875
|
-
|
|
3790
|
+
chunkSADF35N7_js.collectMediaElements(slide.elements, mediaElements);
|
|
3876
3791
|
}
|
|
3877
3792
|
for (const url of mediaDataUrls.values()) {
|
|
3878
3793
|
if (url.startsWith("blob:")) {
|
|
@@ -3913,7 +3828,7 @@ function useLoadContent({
|
|
|
3913
3828
|
}
|
|
3914
3829
|
})
|
|
3915
3830
|
);
|
|
3916
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3831
|
+
const { paths: imagePaths, refs: imageRefs } = chunkSADF35N7_js.collectImagePaths(parsed.slides);
|
|
3917
3832
|
let nextSlides = parsed.slides;
|
|
3918
3833
|
if (imagePaths.size > 0) {
|
|
3919
3834
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3968,12 +3883,12 @@ function useLoadContent({
|
|
|
3968
3883
|
}
|
|
3969
3884
|
}
|
|
3970
3885
|
handlerRef.current = handler;
|
|
3971
|
-
const partition =
|
|
3886
|
+
const partition = chunkSADF35N7_js.partitionTemplateElements(nextSlides);
|
|
3972
3887
|
setSlides(partition.slides);
|
|
3973
3888
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
3974
3889
|
setCanvasSize({
|
|
3975
|
-
width: parsed.width ??
|
|
3976
|
-
height: parsed.height ??
|
|
3890
|
+
width: parsed.width ?? chunkQBRZ3VIC_js.DEFAULT_CANVAS_WIDTH,
|
|
3891
|
+
height: parsed.height ?? chunkQBRZ3VIC_js.DEFAULT_CANVAS_HEIGHT
|
|
3977
3892
|
});
|
|
3978
3893
|
setHeaderFooter(parsed.headerFooter ?? {});
|
|
3979
3894
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
@@ -4002,7 +3917,7 @@ function useLoadContent({
|
|
|
4002
3917
|
setHasMacros(parsed.hasMacros === true);
|
|
4003
3918
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
4004
3919
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
4005
|
-
setGuides(
|
|
3920
|
+
setGuides(chunkSADF35N7_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
4006
3921
|
setActiveSlideIndex(0);
|
|
4007
3922
|
clearSelection();
|
|
4008
3923
|
setIsDirty(false);
|
|
@@ -4010,7 +3925,7 @@ function useLoadContent({
|
|
|
4010
3925
|
onContentApplied?.();
|
|
4011
3926
|
} catch (err) {
|
|
4012
3927
|
if (!cancelled && token === renderTokenRef.current) {
|
|
4013
|
-
if (err instanceof
|
|
3928
|
+
if (err instanceof chunkSADF35N7_js.EncryptedFileError) {
|
|
4014
3929
|
setIsEncrypted(true);
|
|
4015
3930
|
} else {
|
|
4016
3931
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -4087,7 +4002,7 @@ function useAutosave(input) {
|
|
|
4087
4002
|
isSavingRef.current = false;
|
|
4088
4003
|
return;
|
|
4089
4004
|
}
|
|
4090
|
-
await
|
|
4005
|
+
await chunkSADF35N7_js.saveAutosaveSnapshot(filePathRef.current, data);
|
|
4091
4006
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4092
4007
|
} catch (err) {
|
|
4093
4008
|
setAutosaveStatus({
|
|
@@ -4152,7 +4067,7 @@ function useElementOperations(input) {
|
|
|
4152
4067
|
}, [applySelection, setInlineEditingElementId, setContextMenuState]);
|
|
4153
4068
|
const updateElementById = react.useCallback(
|
|
4154
4069
|
(elementId, updates) => {
|
|
4155
|
-
if (
|
|
4070
|
+
if (chunkSADF35N7_js.isTemplateElementId(elementId)) {
|
|
4156
4071
|
const slideId = activeSlide?.id;
|
|
4157
4072
|
if (slideId) {
|
|
4158
4073
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4192,7 +4107,7 @@ function useElementOperations(input) {
|
|
|
4192
4107
|
);
|
|
4193
4108
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4194
4109
|
(updates) => {
|
|
4195
|
-
if (!selectedElement || !
|
|
4110
|
+
if (!selectedElement || !chunkSADF35N7_js.hasShapeProperties(selectedElement)) {
|
|
4196
4111
|
return;
|
|
4197
4112
|
}
|
|
4198
4113
|
updateSelectedElement({
|
|
@@ -4203,17 +4118,17 @@ function useElementOperations(input) {
|
|
|
4203
4118
|
);
|
|
4204
4119
|
const updateSelectedTextStyle = react.useCallback(
|
|
4205
4120
|
(updates) => {
|
|
4206
|
-
if (!selectedElement || !
|
|
4121
|
+
if (!selectedElement || !chunkSADF35N7_js.hasTextProperties(selectedElement)) {
|
|
4207
4122
|
return;
|
|
4208
4123
|
}
|
|
4209
|
-
const inlineSel =
|
|
4124
|
+
const inlineSel = chunkSADF35N7_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4210
4125
|
if (inlineSel && selectedElement.textSegments) {
|
|
4211
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4126
|
+
const { newSegments: newSegments2, newSelection } = chunkSADF35N7_js.applyStyleToSelectedSegments(
|
|
4212
4127
|
selectedElement.textSegments,
|
|
4213
4128
|
inlineSel,
|
|
4214
4129
|
updates
|
|
4215
4130
|
);
|
|
4216
|
-
|
|
4131
|
+
chunkSADF35N7_js.setPendingSelectionRestore(newSelection);
|
|
4217
4132
|
updateSelectedElement({
|
|
4218
4133
|
textSegments: newSegments2
|
|
4219
4134
|
});
|
|
@@ -4233,12 +4148,12 @@ function useElementOperations(input) {
|
|
|
4233
4148
|
);
|
|
4234
4149
|
const updateSelectedTextCase = react.useCallback(
|
|
4235
4150
|
(mode) => {
|
|
4236
|
-
if (!selectedElement || !
|
|
4151
|
+
if (!selectedElement || !chunkSADF35N7_js.hasTextProperties(selectedElement)) {
|
|
4237
4152
|
return;
|
|
4238
4153
|
}
|
|
4239
|
-
const inlineSel =
|
|
4154
|
+
const inlineSel = chunkSADF35N7_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4240
4155
|
if (inlineSel && selectedElement.textSegments) {
|
|
4241
|
-
const newSegments =
|
|
4156
|
+
const newSegments = chunkSADF35N7_js.applyCaseTransformToSegments(
|
|
4242
4157
|
selectedElement.textSegments,
|
|
4243
4158
|
inlineSel,
|
|
4244
4159
|
mode
|
|
@@ -4248,14 +4163,14 @@ function useElementOperations(input) {
|
|
|
4248
4163
|
}
|
|
4249
4164
|
const updates = {};
|
|
4250
4165
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
4251
|
-
updates.textSegments =
|
|
4166
|
+
updates.textSegments = chunkSADF35N7_js.applyCaseTransformToSegments(
|
|
4252
4167
|
selectedElement.textSegments,
|
|
4253
4168
|
null,
|
|
4254
4169
|
mode
|
|
4255
4170
|
);
|
|
4256
4171
|
}
|
|
4257
4172
|
if (typeof selectedElement.text === "string") {
|
|
4258
|
-
updates.text =
|
|
4173
|
+
updates.text = chunkSADF35N7_js.transformTextCase(selectedElement.text, mode);
|
|
4259
4174
|
}
|
|
4260
4175
|
updateSelectedElement(updates);
|
|
4261
4176
|
},
|
|
@@ -4310,7 +4225,7 @@ function useSectionOperations(input) {
|
|
|
4310
4225
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4311
4226
|
const addSection2 = react.useCallback(
|
|
4312
4227
|
(name, afterSlideIndex) => {
|
|
4313
|
-
const result =
|
|
4228
|
+
const result = chunkSADF35N7_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4314
4229
|
setSlides(result.slides);
|
|
4315
4230
|
setSections(result.sections);
|
|
4316
4231
|
markDirty();
|
|
@@ -4319,7 +4234,7 @@ function useSectionOperations(input) {
|
|
|
4319
4234
|
);
|
|
4320
4235
|
const renameSection2 = react.useCallback(
|
|
4321
4236
|
(sectionId, newName) => {
|
|
4322
|
-
const result =
|
|
4237
|
+
const result = chunkSADF35N7_js.renameSection(sections, slides, sectionId, newName);
|
|
4323
4238
|
setSections(result.sections);
|
|
4324
4239
|
setSlides(result.slides);
|
|
4325
4240
|
markDirty();
|
|
@@ -4328,7 +4243,7 @@ function useSectionOperations(input) {
|
|
|
4328
4243
|
);
|
|
4329
4244
|
const deleteSection2 = react.useCallback(
|
|
4330
4245
|
(sectionId) => {
|
|
4331
|
-
const result =
|
|
4246
|
+
const result = chunkSADF35N7_js.deleteSection(sections, slides, sectionId);
|
|
4332
4247
|
setSections(result.sections);
|
|
4333
4248
|
setSlides(result.slides);
|
|
4334
4249
|
markDirty();
|
|
@@ -4337,21 +4252,21 @@ function useSectionOperations(input) {
|
|
|
4337
4252
|
);
|
|
4338
4253
|
const moveSectionUp2 = react.useCallback(
|
|
4339
4254
|
(sectionId) => {
|
|
4340
|
-
setSections(
|
|
4255
|
+
setSections(chunkSADF35N7_js.moveSectionUp(sections, sectionId));
|
|
4341
4256
|
markDirty();
|
|
4342
4257
|
},
|
|
4343
4258
|
[sections, setSections, markDirty]
|
|
4344
4259
|
);
|
|
4345
4260
|
const moveSectionDown2 = react.useCallback(
|
|
4346
4261
|
(sectionId) => {
|
|
4347
|
-
setSections(
|
|
4262
|
+
setSections(chunkSADF35N7_js.moveSectionDown(sections, sectionId));
|
|
4348
4263
|
markDirty();
|
|
4349
4264
|
},
|
|
4350
4265
|
[sections, setSections, markDirty]
|
|
4351
4266
|
);
|
|
4352
4267
|
const moveSlidesToSection2 = react.useCallback(
|
|
4353
4268
|
(slideIndexes, targetSectionId) => {
|
|
4354
|
-
const result =
|
|
4269
|
+
const result = chunkSADF35N7_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4355
4270
|
setSlides(result.slides);
|
|
4356
4271
|
setSections(result.sections);
|
|
4357
4272
|
markDirty();
|
|
@@ -4370,19 +4285,19 @@ function useSectionOperations(input) {
|
|
|
4370
4285
|
|
|
4371
4286
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4372
4287
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
4373
|
-
const resized =
|
|
4288
|
+
const resized = chunkSADF35N7_js.applyResize(
|
|
4374
4289
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
4375
4290
|
handle,
|
|
4376
4291
|
dx,
|
|
4377
4292
|
dy,
|
|
4378
4293
|
1,
|
|
4379
|
-
{ minSize:
|
|
4294
|
+
{ minSize: chunkQBRZ3VIC_js.MIN_ELEMENT_SIZE }
|
|
4380
4295
|
);
|
|
4381
4296
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4382
4297
|
if (!snapToGrid) {
|
|
4383
4298
|
return box;
|
|
4384
4299
|
}
|
|
4385
|
-
return
|
|
4300
|
+
return chunkSADF35N7_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkQBRZ3VIC_js.MIN_ELEMENT_SIZE);
|
|
4386
4301
|
}
|
|
4387
4302
|
function computeAdjustmentValue(startAdjustment, dx, startWidth) {
|
|
4388
4303
|
const range = startWidth || 200;
|
|
@@ -4500,7 +4415,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4500
4415
|
width: el.width,
|
|
4501
4416
|
height: el.height
|
|
4502
4417
|
}));
|
|
4503
|
-
const snapResult =
|
|
4418
|
+
const snapResult = chunkSADF35N7_js.computeSnapToShape(
|
|
4504
4419
|
targetX,
|
|
4505
4420
|
targetY,
|
|
4506
4421
|
primaryEl.width,
|
|
@@ -4539,7 +4454,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4539
4454
|
if (live) {
|
|
4540
4455
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4541
4456
|
const start = drag.startPositionsById[id];
|
|
4542
|
-
|
|
4457
|
+
chunkSADF35N7_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4543
4458
|
x: start.x + appliedDx,
|
|
4544
4459
|
y: start.y + appliedDy
|
|
4545
4460
|
});
|
|
@@ -4573,15 +4488,15 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4573
4488
|
if (rs.domEl) {
|
|
4574
4489
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4575
4490
|
rs.domEl.style.top = `${geo.y}px`;
|
|
4576
|
-
rs.domEl.style.width = `${Math.max(geo.width,
|
|
4577
|
-
rs.domEl.style.height = `${Math.max(geo.height,
|
|
4491
|
+
rs.domEl.style.width = `${Math.max(geo.width, chunkQBRZ3VIC_js.MIN_ELEMENT_SIZE)}px`;
|
|
4492
|
+
rs.domEl.style.height = `${Math.max(geo.height, chunkQBRZ3VIC_js.MIN_ELEMENT_SIZE)}px`;
|
|
4578
4493
|
}
|
|
4579
4494
|
if (live) {
|
|
4580
|
-
|
|
4495
|
+
chunkSADF35N7_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4581
4496
|
x: geo.x,
|
|
4582
4497
|
y: geo.y,
|
|
4583
|
-
width: Math.max(geo.width,
|
|
4584
|
-
height: Math.max(geo.height,
|
|
4498
|
+
width: Math.max(geo.width, chunkQBRZ3VIC_js.MIN_ELEMENT_SIZE),
|
|
4499
|
+
height: Math.max(geo.height, chunkQBRZ3VIC_js.MIN_ELEMENT_SIZE)
|
|
4585
4500
|
});
|
|
4586
4501
|
}
|
|
4587
4502
|
}
|
|
@@ -4662,13 +4577,13 @@ function processPointerUp(input) {
|
|
|
4662
4577
|
if (i !== activeSlideIndex) {
|
|
4663
4578
|
return s;
|
|
4664
4579
|
}
|
|
4665
|
-
const rerouted =
|
|
4580
|
+
const rerouted = chunkSADF35N7_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4666
4581
|
if (rerouted.length === 0) {
|
|
4667
4582
|
return s;
|
|
4668
4583
|
}
|
|
4669
4584
|
return {
|
|
4670
4585
|
...s,
|
|
4671
|
-
elements:
|
|
4586
|
+
elements: chunkSADF35N7_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4672
4587
|
};
|
|
4673
4588
|
})
|
|
4674
4589
|
);
|
|
@@ -4693,9 +4608,9 @@ function processPointerUp(input) {
|
|
|
4693
4608
|
}
|
|
4694
4609
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4695
4610
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4696
|
-
const hitIds =
|
|
4611
|
+
const hitIds = chunkSADF35N7_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4697
4612
|
if (marquee.additive) {
|
|
4698
|
-
const merged =
|
|
4613
|
+
const merged = chunkSADF35N7_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4699
4614
|
if (merged.length > 0) {
|
|
4700
4615
|
applySelection(merged[0], merged);
|
|
4701
4616
|
} else {
|
|
@@ -4718,8 +4633,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4718
4633
|
}
|
|
4719
4634
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4720
4635
|
});
|
|
4721
|
-
const rerouted =
|
|
4722
|
-
return
|
|
4636
|
+
const rerouted = chunkSADF35N7_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4637
|
+
return chunkSADF35N7_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4723
4638
|
};
|
|
4724
4639
|
if (editTemplateMode) {
|
|
4725
4640
|
const slideId = activeSlide?.id;
|
|
@@ -4876,9 +4791,9 @@ function useCanvasInteractions(input) {
|
|
|
4876
4791
|
return;
|
|
4877
4792
|
}
|
|
4878
4793
|
const el = elementLookup.get(editId);
|
|
4879
|
-
if (el &&
|
|
4794
|
+
if (el && chunkSADF35N7_js.hasTextProperties(el)) {
|
|
4880
4795
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
4881
|
-
const newSegments =
|
|
4796
|
+
const newSegments = chunkSADF35N7_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
4882
4797
|
ops.updateElementById(editId, {
|
|
4883
4798
|
text: committedText,
|
|
4884
4799
|
textSegments: newSegments
|
|
@@ -4889,7 +4804,7 @@ function useCanvasInteractions(input) {
|
|
|
4889
4804
|
setInlineEditingText("");
|
|
4890
4805
|
};
|
|
4891
4806
|
const openEquationEditorForElement = (el) => {
|
|
4892
|
-
if (!
|
|
4807
|
+
if (!chunkSADF35N7_js.hasTextProperties(el)) {
|
|
4893
4808
|
return false;
|
|
4894
4809
|
}
|
|
4895
4810
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -4919,7 +4834,7 @@ function useCanvasInteractions(input) {
|
|
|
4919
4834
|
justInteractedRef.current = false;
|
|
4920
4835
|
} else {
|
|
4921
4836
|
const el = elementLookup.get(elementId);
|
|
4922
|
-
if (el &&
|
|
4837
|
+
if (el && chunkSADF35N7_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
|
|
4923
4838
|
if (!openEquationEditorForElement(el)) {
|
|
4924
4839
|
setInlineEditingElementId(elementId);
|
|
4925
4840
|
setInlineEditingText(el.text ?? "");
|
|
@@ -4938,7 +4853,7 @@ function useCanvasInteractions(input) {
|
|
|
4938
4853
|
if (openEquationEditorForElement(el)) {
|
|
4939
4854
|
return;
|
|
4940
4855
|
}
|
|
4941
|
-
if (
|
|
4856
|
+
if (chunkSADF35N7_js.hasTextProperties(el)) {
|
|
4942
4857
|
setInlineEditingElementId(elementId);
|
|
4943
4858
|
setInlineEditingText(el.text ?? "");
|
|
4944
4859
|
}
|
|
@@ -5131,7 +5046,7 @@ function createFileHandlers(deps) {
|
|
|
5131
5046
|
h = Math.round(h * scale);
|
|
5132
5047
|
}
|
|
5133
5048
|
addElement({
|
|
5134
|
-
id:
|
|
5049
|
+
id: chunkSADF35N7_js.generateElementId(),
|
|
5135
5050
|
type: "image",
|
|
5136
5051
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5137
5052
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5142,7 +5057,7 @@ function createFileHandlers(deps) {
|
|
|
5142
5057
|
};
|
|
5143
5058
|
img.onerror = () => {
|
|
5144
5059
|
addElement({
|
|
5145
|
-
id:
|
|
5060
|
+
id: chunkSADF35N7_js.generateElementId(),
|
|
5146
5061
|
type: "image",
|
|
5147
5062
|
x: 100,
|
|
5148
5063
|
y: 100,
|
|
@@ -5168,7 +5083,7 @@ function createFileHandlers(deps) {
|
|
|
5168
5083
|
const elFilePath = file.path;
|
|
5169
5084
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5170
5085
|
addElement({
|
|
5171
|
-
id:
|
|
5086
|
+
id: chunkSADF35N7_js.generateElementId(),
|
|
5172
5087
|
type: "media",
|
|
5173
5088
|
mediaType,
|
|
5174
5089
|
mediaMimeType: file.type || void 0,
|
|
@@ -5343,13 +5258,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5343
5258
|
return;
|
|
5344
5259
|
}
|
|
5345
5260
|
addElement({
|
|
5346
|
-
id:
|
|
5261
|
+
id: chunkSADF35N7_js.generateElementId(),
|
|
5347
5262
|
type: "smartArt",
|
|
5348
5263
|
x: 100,
|
|
5349
5264
|
y: 120,
|
|
5350
5265
|
width: 600,
|
|
5351
5266
|
height: 340,
|
|
5352
|
-
smartArtData:
|
|
5267
|
+
smartArtData: chunkSADF35N7_js.buildSmartArtPresetData(
|
|
5353
5268
|
layout,
|
|
5354
5269
|
defaultItems,
|
|
5355
5270
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5361,7 +5276,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5361
5276
|
return;
|
|
5362
5277
|
}
|
|
5363
5278
|
addElement({
|
|
5364
|
-
id:
|
|
5279
|
+
id: chunkSADF35N7_js.generateElementId(),
|
|
5365
5280
|
type: "shape",
|
|
5366
5281
|
x: 120,
|
|
5367
5282
|
y: 200,
|
|
@@ -5420,7 +5335,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5420
5335
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5421
5336
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5422
5337
|
addElement({
|
|
5423
|
-
id:
|
|
5338
|
+
id: chunkSADF35N7_js.generateElementId(),
|
|
5424
5339
|
type: "shape",
|
|
5425
5340
|
x: 120,
|
|
5426
5341
|
y: 200,
|
|
@@ -5442,11 +5357,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5442
5357
|
if (!activeSlide) {
|
|
5443
5358
|
return;
|
|
5444
5359
|
}
|
|
5445
|
-
const preset =
|
|
5360
|
+
const preset = chunkSADF35N7_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5446
5361
|
if (!preset) {
|
|
5447
5362
|
return;
|
|
5448
5363
|
}
|
|
5449
|
-
const defaultPptxAction =
|
|
5364
|
+
const defaultPptxAction = chunkSADF35N7_js.elementActionToPptxAction({
|
|
5450
5365
|
trigger: "click",
|
|
5451
5366
|
type: preset.defaultAction
|
|
5452
5367
|
});
|
|
@@ -5455,7 +5370,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5455
5370
|
defaultPptxAction.highlightClick = true;
|
|
5456
5371
|
}
|
|
5457
5372
|
addElement({
|
|
5458
|
-
id:
|
|
5373
|
+
id: chunkSADF35N7_js.generateElementId(),
|
|
5459
5374
|
type: "shape",
|
|
5460
5375
|
x: 150,
|
|
5461
5376
|
y: 150,
|
|
@@ -5522,14 +5437,14 @@ function useInsertElements(input) {
|
|
|
5522
5437
|
return;
|
|
5523
5438
|
}
|
|
5524
5439
|
addElement({
|
|
5525
|
-
id:
|
|
5440
|
+
id: chunkSADF35N7_js.generateElementId(),
|
|
5526
5441
|
type: "text",
|
|
5527
5442
|
x: 100,
|
|
5528
5443
|
y: 100,
|
|
5529
5444
|
width: 300,
|
|
5530
5445
|
height: 60,
|
|
5531
5446
|
text: "",
|
|
5532
|
-
textStyle: { fontSize:
|
|
5447
|
+
textStyle: { fontSize: chunkQBRZ3VIC_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5533
5448
|
});
|
|
5534
5449
|
};
|
|
5535
5450
|
const handleAddShape = () => {
|
|
@@ -5537,7 +5452,7 @@ function useInsertElements(input) {
|
|
|
5537
5452
|
return;
|
|
5538
5453
|
}
|
|
5539
5454
|
addElement({
|
|
5540
|
-
id:
|
|
5455
|
+
id: chunkSADF35N7_js.generateElementId(),
|
|
5541
5456
|
type: "shape",
|
|
5542
5457
|
x: 150,
|
|
5543
5458
|
y: 150,
|
|
@@ -5556,15 +5471,15 @@ function useInsertElements(input) {
|
|
|
5556
5471
|
return;
|
|
5557
5472
|
}
|
|
5558
5473
|
addElement({
|
|
5559
|
-
...
|
|
5560
|
-
id:
|
|
5474
|
+
...chunkSADF35N7_js.newTableElement(chunkQBRZ3VIC_js.DEFAULT_TABLE_ROWS, chunkQBRZ3VIC_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5475
|
+
id: chunkSADF35N7_js.generateElementId()
|
|
5561
5476
|
});
|
|
5562
5477
|
};
|
|
5563
5478
|
const handleAddChart = (chartKind) => {
|
|
5564
5479
|
if (!activeSlide) {
|
|
5565
5480
|
return;
|
|
5566
5481
|
}
|
|
5567
|
-
addElement(
|
|
5482
|
+
addElement(chunkSADF35N7_js.createDefaultChartElement(chartKind));
|
|
5568
5483
|
};
|
|
5569
5484
|
const structured = createStructuredElementHandlers({
|
|
5570
5485
|
activeSlide,
|
|
@@ -5634,7 +5549,7 @@ function useClipboardHandlers(input) {
|
|
|
5634
5549
|
if (!selectedElement) {
|
|
5635
5550
|
return;
|
|
5636
5551
|
}
|
|
5637
|
-
setClipboardPayload(
|
|
5552
|
+
setClipboardPayload(chunkSADF35N7_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5638
5553
|
};
|
|
5639
5554
|
const handleDelete = () => {
|
|
5640
5555
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5651,7 +5566,7 @@ function useClipboardHandlers(input) {
|
|
|
5651
5566
|
handleDelete();
|
|
5652
5567
|
};
|
|
5653
5568
|
const insertClone = (source) => {
|
|
5654
|
-
const clone =
|
|
5569
|
+
const clone = chunkSADF35N7_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5655
5570
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5656
5571
|
ops.applySelection(clone.id);
|
|
5657
5572
|
history.markDirty();
|
|
@@ -5686,7 +5601,7 @@ function resolveShapePath(el) {
|
|
|
5686
5601
|
return el.pathData;
|
|
5687
5602
|
}
|
|
5688
5603
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5689
|
-
const clipPath =
|
|
5604
|
+
const clipPath = chunkSADF35N7_js.getPresetShapeClipPath(el.shapeType);
|
|
5690
5605
|
if (clipPath) {
|
|
5691
5606
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5692
5607
|
if (svgPath) {
|
|
@@ -5737,7 +5652,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5737
5652
|
return parts.join(" ");
|
|
5738
5653
|
}
|
|
5739
5654
|
function transformPathToGlobal(pathData, el) {
|
|
5740
|
-
const polys =
|
|
5655
|
+
const polys = chunkSADF35N7_js.svgPathToPolygons(pathData);
|
|
5741
5656
|
if (polys.length === 0) {
|
|
5742
5657
|
return pathData;
|
|
5743
5658
|
}
|
|
@@ -5757,10 +5672,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5757
5672
|
y: pt.y * scaleY + el.y
|
|
5758
5673
|
}))
|
|
5759
5674
|
);
|
|
5760
|
-
return
|
|
5675
|
+
return chunkSADF35N7_js.polygonsToSvgPath(transformed);
|
|
5761
5676
|
}
|
|
5762
5677
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5763
|
-
const polys =
|
|
5678
|
+
const polys = chunkSADF35N7_js.svgPathToPolygons(pathData);
|
|
5764
5679
|
if (polys.length === 0) {
|
|
5765
5680
|
return pathData;
|
|
5766
5681
|
}
|
|
@@ -5770,10 +5685,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5770
5685
|
y: pt.y - y
|
|
5771
5686
|
}))
|
|
5772
5687
|
);
|
|
5773
|
-
return
|
|
5688
|
+
return chunkSADF35N7_js.polygonsToSvgPath(transformed);
|
|
5774
5689
|
}
|
|
5775
5690
|
function pathBounds(pathData) {
|
|
5776
|
-
const polys =
|
|
5691
|
+
const polys = chunkSADF35N7_js.svgPathToPolygons(pathData);
|
|
5777
5692
|
let minX = Infinity;
|
|
5778
5693
|
let minY = Infinity;
|
|
5779
5694
|
let maxX = -Infinity;
|
|
@@ -5832,7 +5747,7 @@ function useMergeShapesHandler(input) {
|
|
|
5832
5747
|
let allFragments = [];
|
|
5833
5748
|
let remaining = globalPaths[0];
|
|
5834
5749
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5835
|
-
const frags =
|
|
5750
|
+
const frags = chunkSADF35N7_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
5836
5751
|
if (Array.isArray(frags)) {
|
|
5837
5752
|
allFragments = frags;
|
|
5838
5753
|
}
|
|
@@ -5861,7 +5776,7 @@ function useMergeShapesHandler(input) {
|
|
|
5861
5776
|
bounds.height
|
|
5862
5777
|
);
|
|
5863
5778
|
const newEl = {
|
|
5864
|
-
id:
|
|
5779
|
+
id: chunkSADF35N7_js.generateElementId(),
|
|
5865
5780
|
type: "shape",
|
|
5866
5781
|
x: bounds.x,
|
|
5867
5782
|
y: bounds.y,
|
|
@@ -5899,7 +5814,7 @@ function useMergeShapesHandler(input) {
|
|
|
5899
5814
|
} else {
|
|
5900
5815
|
let resultPath = globalPaths[0];
|
|
5901
5816
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5902
|
-
const result =
|
|
5817
|
+
const result = chunkSADF35N7_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
5903
5818
|
if (typeof result === "string") {
|
|
5904
5819
|
resultPath = result;
|
|
5905
5820
|
}
|
|
@@ -5920,7 +5835,7 @@ function useMergeShapesHandler(input) {
|
|
|
5920
5835
|
);
|
|
5921
5836
|
const primary = targets[0];
|
|
5922
5837
|
const newEl = {
|
|
5923
|
-
id:
|
|
5838
|
+
id: chunkSADF35N7_js.generateElementId(),
|
|
5924
5839
|
type: "shape",
|
|
5925
5840
|
x: bounds.x,
|
|
5926
5841
|
y: bounds.y,
|
|
@@ -5983,7 +5898,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5983
5898
|
if (ids.length < 2 || !activeSlide) {
|
|
5984
5899
|
return;
|
|
5985
5900
|
}
|
|
5986
|
-
const { elements, groupId } =
|
|
5901
|
+
const { elements, groupId } = chunkSADF35N7_js.groupElements(ops.activeElements, ids, chunkSADF35N7_js.generateElementId());
|
|
5987
5902
|
if (groupId === null) {
|
|
5988
5903
|
return;
|
|
5989
5904
|
}
|
|
@@ -5996,12 +5911,12 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5996
5911
|
return;
|
|
5997
5912
|
}
|
|
5998
5913
|
const group = selectedElement;
|
|
5999
|
-
const intoTemplate =
|
|
5914
|
+
const intoTemplate = chunkSADF35N7_js.isTemplateElementId(group.id);
|
|
6000
5915
|
const ungrouped = group.children.map((child) => ({
|
|
6001
5916
|
...structuredClone(child),
|
|
6002
5917
|
// Keep child ids in the same store as the group so later edits route
|
|
6003
5918
|
// correctly: template groups yield template-prefixed child ids.
|
|
6004
|
-
id: intoTemplate ?
|
|
5919
|
+
id: intoTemplate ? chunkSADF35N7_js.makeCloneId(true, child.id || group.id) : child.id || chunkSADF35N7_js.generateElementId(),
|
|
6005
5920
|
x: child.x + group.x,
|
|
6006
5921
|
y: child.y + group.y
|
|
6007
5922
|
}));
|
|
@@ -6025,7 +5940,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6025
5940
|
if (!edge) {
|
|
6026
5941
|
return;
|
|
6027
5942
|
}
|
|
6028
|
-
const positions =
|
|
5943
|
+
const positions = chunkSADF35N7_js.alignElements(selectedElements, edge);
|
|
6029
5944
|
for (const [id, pos] of positions) {
|
|
6030
5945
|
const el = elementLookup.get(id);
|
|
6031
5946
|
if (!el) {
|
|
@@ -6043,7 +5958,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6043
5958
|
if (!distAxis) {
|
|
6044
5959
|
return;
|
|
6045
5960
|
}
|
|
6046
|
-
const positions =
|
|
5961
|
+
const positions = chunkSADF35N7_js.distributeElements(selectedElements, distAxis);
|
|
6047
5962
|
for (const [id, pos] of positions) {
|
|
6048
5963
|
const el = elementLookup.get(id);
|
|
6049
5964
|
if (!el) {
|
|
@@ -6060,7 +5975,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6060
5975
|
}
|
|
6061
5976
|
const id = selectedElement.id;
|
|
6062
5977
|
ops.updateActiveElements(
|
|
6063
|
-
(els) => direction === "forward" ?
|
|
5978
|
+
(els) => direction === "forward" ? chunkSADF35N7_js.bringForward(els, id) : direction === "backward" ? chunkSADF35N7_js.sendBackward(els, id) : els
|
|
6064
5979
|
);
|
|
6065
5980
|
history.markDirty();
|
|
6066
5981
|
};
|
|
@@ -6070,7 +5985,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6070
5985
|
}
|
|
6071
5986
|
const id = selectedElement.id;
|
|
6072
5987
|
ops.updateActiveElements(
|
|
6073
|
-
(els) => direction === "front" ?
|
|
5988
|
+
(els) => direction === "front" ? chunkSADF35N7_js.bringToFront(els, id) : chunkSADF35N7_js.sendToBack(els, id)
|
|
6074
5989
|
);
|
|
6075
5990
|
history.markDirty();
|
|
6076
5991
|
};
|
|
@@ -6201,7 +6116,7 @@ function useSlideManagement(input) {
|
|
|
6201
6116
|
theme
|
|
6202
6117
|
} = input;
|
|
6203
6118
|
const handleAddSlide = () => {
|
|
6204
|
-
const newSlide =
|
|
6119
|
+
const newSlide = chunkSADF35N7_js.createBlankSlide(slides.length + 1);
|
|
6205
6120
|
ops.updateSlides((prev) => {
|
|
6206
6121
|
const next = [...prev];
|
|
6207
6122
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6264,7 +6179,7 @@ function useSlideManagement(input) {
|
|
|
6264
6179
|
}
|
|
6265
6180
|
const clone = {
|
|
6266
6181
|
...src,
|
|
6267
|
-
id:
|
|
6182
|
+
id: chunkSADF35N7_js.makeSlideId(),
|
|
6268
6183
|
elements: src.elements.map((el) => ({
|
|
6269
6184
|
...el,
|
|
6270
6185
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6296,7 +6211,7 @@ function useSlideManagement(input) {
|
|
|
6296
6211
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6297
6212
|
const insertAt = activeSlideIndex + 1;
|
|
6298
6213
|
const draft = {
|
|
6299
|
-
...
|
|
6214
|
+
...chunkSADF35N7_js.createBlankSlide(slides.length + 1),
|
|
6300
6215
|
layoutPath,
|
|
6301
6216
|
...layoutName ? { layoutName } : {}
|
|
6302
6217
|
};
|
|
@@ -6329,9 +6244,9 @@ function useSlideManagement(input) {
|
|
|
6329
6244
|
};
|
|
6330
6245
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6331
6246
|
const insertAt = activeSlideIndex + 1;
|
|
6332
|
-
const draft =
|
|
6247
|
+
const draft = chunkSADF35N7_js.buildSlideTemplateSlide(templateId, chunkSADF35N7_js.makeSlideId(), slides.length + 1, {
|
|
6333
6248
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6334
|
-
scheme:
|
|
6249
|
+
scheme: chunkSADF35N7_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6335
6250
|
});
|
|
6336
6251
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6337
6252
|
setActiveSlideIndex(insertAt);
|
|
@@ -6368,7 +6283,7 @@ function createTableMergeHandlers(input) {
|
|
|
6368
6283
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6369
6284
|
return;
|
|
6370
6285
|
}
|
|
6371
|
-
const newTableData =
|
|
6286
|
+
const newTableData = chunkSADF35N7_js.mergeCells(
|
|
6372
6287
|
[
|
|
6373
6288
|
{ row: rowIndex, col: columnIndex },
|
|
6374
6289
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6376,7 +6291,7 @@ function createTableMergeHandlers(input) {
|
|
|
6376
6291
|
td
|
|
6377
6292
|
);
|
|
6378
6293
|
const updates = { tableData: newTableData };
|
|
6379
|
-
const newRawXml =
|
|
6294
|
+
const newRawXml = chunkSADF35N7_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6380
6295
|
if (newRawXml) {
|
|
6381
6296
|
updates.rawXml = newRawXml;
|
|
6382
6297
|
}
|
|
@@ -6402,7 +6317,7 @@ function createTableMergeHandlers(input) {
|
|
|
6402
6317
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6403
6318
|
return;
|
|
6404
6319
|
}
|
|
6405
|
-
const newTableData =
|
|
6320
|
+
const newTableData = chunkSADF35N7_js.mergeCells(
|
|
6406
6321
|
[
|
|
6407
6322
|
{ row: rowIndex, col: columnIndex },
|
|
6408
6323
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6410,7 +6325,7 @@ function createTableMergeHandlers(input) {
|
|
|
6410
6325
|
td
|
|
6411
6326
|
);
|
|
6412
6327
|
const updates = { tableData: newTableData };
|
|
6413
|
-
const newRawXml =
|
|
6328
|
+
const newRawXml = chunkSADF35N7_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6414
6329
|
if (newRawXml) {
|
|
6415
6330
|
updates.rawXml = newRawXml;
|
|
6416
6331
|
}
|
|
@@ -6425,9 +6340,9 @@ function createTableMergeHandlers(input) {
|
|
|
6425
6340
|
return;
|
|
6426
6341
|
}
|
|
6427
6342
|
const td = selectedElement.tableData;
|
|
6428
|
-
const newTableData =
|
|
6343
|
+
const newTableData = chunkSADF35N7_js.mergeCells(ts.selectedCells, td);
|
|
6429
6344
|
const updates = { tableData: newTableData };
|
|
6430
|
-
const newRawXml =
|
|
6345
|
+
const newRawXml = chunkSADF35N7_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6431
6346
|
if (newRawXml) {
|
|
6432
6347
|
updates.rawXml = newRawXml;
|
|
6433
6348
|
}
|
|
@@ -6444,9 +6359,9 @@ function createTableMergeHandlers(input) {
|
|
|
6444
6359
|
}
|
|
6445
6360
|
const { rowIndex, columnIndex } = ts;
|
|
6446
6361
|
const td = selectedElement.tableData;
|
|
6447
|
-
const newTableData =
|
|
6362
|
+
const newTableData = chunkSADF35N7_js.splitCell(rowIndex, columnIndex, td);
|
|
6448
6363
|
const updates = { tableData: newTableData };
|
|
6449
|
-
const newRawXml =
|
|
6364
|
+
const newRawXml = chunkSADF35N7_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6450
6365
|
if (newRawXml) {
|
|
6451
6366
|
updates.rawXml = newRawXml;
|
|
6452
6367
|
}
|
|
@@ -6490,7 +6405,7 @@ function createTableStructHandlers(input) {
|
|
|
6490
6405
|
updates.tableData = { ...el.tableData, rows: newRows };
|
|
6491
6406
|
}
|
|
6492
6407
|
if (el.rawXml) {
|
|
6493
|
-
const newRawXml =
|
|
6408
|
+
const newRawXml = chunkSADF35N7_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6494
6409
|
if (newRawXml) {
|
|
6495
6410
|
updates.rawXml = newRawXml;
|
|
6496
6411
|
}
|
|
@@ -6514,7 +6429,7 @@ function createTableStructHandlers(input) {
|
|
|
6514
6429
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6515
6430
|
const updates = {};
|
|
6516
6431
|
if (selectedElement.rawXml) {
|
|
6517
|
-
const newRawXml =
|
|
6432
|
+
const newRawXml = chunkSADF35N7_js.updateCellTextStyleInRawXml(
|
|
6518
6433
|
selectedElement,
|
|
6519
6434
|
rowIndex,
|
|
6520
6435
|
colIndex,
|
|
@@ -6578,9 +6493,9 @@ function createTableStructHandlers(input) {
|
|
|
6578
6493
|
return;
|
|
6579
6494
|
}
|
|
6580
6495
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6581
|
-
const newTableData =
|
|
6496
|
+
const newTableData = chunkSADF35N7_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6582
6497
|
const updates = { tableData: newTableData };
|
|
6583
|
-
const newRawXml =
|
|
6498
|
+
const newRawXml = chunkSADF35N7_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6584
6499
|
if (newRawXml) {
|
|
6585
6500
|
updates.rawXml = newRawXml;
|
|
6586
6501
|
}
|
|
@@ -6593,12 +6508,12 @@ function createTableStructHandlers(input) {
|
|
|
6593
6508
|
}
|
|
6594
6509
|
const td = selectedElement.tableData;
|
|
6595
6510
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6596
|
-
const newTableData =
|
|
6511
|
+
const newTableData = chunkSADF35N7_js.deleteTableRow(td, rowIdx);
|
|
6597
6512
|
if (newTableData === td) {
|
|
6598
6513
|
return;
|
|
6599
6514
|
}
|
|
6600
6515
|
const updates = { tableData: newTableData };
|
|
6601
|
-
const newRawXml =
|
|
6516
|
+
const newRawXml = chunkSADF35N7_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6602
6517
|
if (newRawXml) {
|
|
6603
6518
|
updates.rawXml = newRawXml;
|
|
6604
6519
|
}
|
|
@@ -6610,9 +6525,9 @@ function createTableStructHandlers(input) {
|
|
|
6610
6525
|
return;
|
|
6611
6526
|
}
|
|
6612
6527
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6613
|
-
const newTableData =
|
|
6528
|
+
const newTableData = chunkSADF35N7_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6614
6529
|
const updates = { tableData: newTableData };
|
|
6615
|
-
const newRawXml =
|
|
6530
|
+
const newRawXml = chunkSADF35N7_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6616
6531
|
if (newRawXml) {
|
|
6617
6532
|
updates.rawXml = newRawXml;
|
|
6618
6533
|
}
|
|
@@ -6625,12 +6540,12 @@ function createTableStructHandlers(input) {
|
|
|
6625
6540
|
}
|
|
6626
6541
|
const td = selectedElement.tableData;
|
|
6627
6542
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6628
|
-
const newTableData =
|
|
6543
|
+
const newTableData = chunkSADF35N7_js.deleteTableColumn(td, colIdx);
|
|
6629
6544
|
if (newTableData === td) {
|
|
6630
6545
|
return;
|
|
6631
6546
|
}
|
|
6632
6547
|
const updates = { tableData: newTableData };
|
|
6633
|
-
const newRawXml =
|
|
6548
|
+
const newRawXml = chunkSADF35N7_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6634
6549
|
if (newRawXml) {
|
|
6635
6550
|
updates.rawXml = newRawXml;
|
|
6636
6551
|
}
|
|
@@ -6666,8 +6581,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6666
6581
|
return html2canvasPro(element, {
|
|
6667
6582
|
...options,
|
|
6668
6583
|
onclone: async (doc, clonedEl) => {
|
|
6669
|
-
await
|
|
6670
|
-
|
|
6584
|
+
await chunkSADF35N7_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6585
|
+
chunkSADF35N7_js.preprocessCssForCapture(clonedEl);
|
|
6671
6586
|
if (typeof userOnClone === "function") {
|
|
6672
6587
|
userOnClone(doc, clonedEl);
|
|
6673
6588
|
}
|
|
@@ -6723,7 +6638,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
6723
6638
|
}
|
|
6724
6639
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
6725
6640
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
6726
|
-
|
|
6641
|
+
chunkSADF35N7_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
6727
6642
|
}
|
|
6728
6643
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
6729
6644
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -6745,15 +6660,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6745
6660
|
continue;
|
|
6746
6661
|
}
|
|
6747
6662
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
6748
|
-
images.push(
|
|
6663
|
+
images.push(chunkSADF35N7_js.canvasToJpegData(canvas));
|
|
6749
6664
|
}
|
|
6750
6665
|
onProgress?.(totalSlides, totalSlides);
|
|
6751
6666
|
setActiveSlide(currentSlideIndex);
|
|
6752
6667
|
if (images.length === 0) {
|
|
6753
6668
|
throw new Error(chunkDVZF4ARG_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
6754
6669
|
}
|
|
6755
|
-
const pdfBlobUrl =
|
|
6756
|
-
|
|
6670
|
+
const pdfBlobUrl = chunkQBRZ3VIC_js.buildPdfFromImageData(images);
|
|
6671
|
+
chunkSADF35N7_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
6757
6672
|
}
|
|
6758
6673
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
6759
6674
|
const { scale = 2, onProgress } = options;
|
|
@@ -6801,8 +6716,8 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
6801
6716
|
if (pages.length === 0) {
|
|
6802
6717
|
throw new Error(chunkDVZF4ARG_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
6803
6718
|
}
|
|
6804
|
-
const pdfDataUrl =
|
|
6805
|
-
|
|
6719
|
+
const pdfDataUrl = chunkQBRZ3VIC_js.buildNotesPdf(pages);
|
|
6720
|
+
chunkSADF35N7_js.downloadDataUrl(pdfDataUrl, filename);
|
|
6806
6721
|
}
|
|
6807
6722
|
|
|
6808
6723
|
// src/viewer/utils/export-video.ts
|
|
@@ -6846,7 +6761,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6846
6761
|
const fps = 30;
|
|
6847
6762
|
const stream = recordingCanvas.captureStream(fps);
|
|
6848
6763
|
const recorder = new MediaRecorder(stream, {
|
|
6849
|
-
mimeType:
|
|
6764
|
+
mimeType: chunkSADF35N7_js.pickSupportedMimeType([...chunkSADF35N7_js.WEBM_MIME_CANDIDATES]),
|
|
6850
6765
|
videoBitsPerSecond: 5e6
|
|
6851
6766
|
});
|
|
6852
6767
|
const chunks = [];
|
|
@@ -6869,8 +6784,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6869
6784
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
6870
6785
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
6871
6786
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
6872
|
-
const frameInterval =
|
|
6873
|
-
const framesNeeded =
|
|
6787
|
+
const frameInterval = chunkSADF35N7_js.fpsToFrameIntervalMs(fps);
|
|
6788
|
+
const framesNeeded = chunkSADF35N7_js.segmentFrameCount(duration, fps);
|
|
6874
6789
|
for (let f = 0; f < framesNeeded; f++) {
|
|
6875
6790
|
if (signal?.aborted) {
|
|
6876
6791
|
recorder.stop();
|
|
@@ -6919,7 +6834,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6919
6834
|
if (frames.length === 0) {
|
|
6920
6835
|
throw new Error(chunkDVZF4ARG_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
6921
6836
|
}
|
|
6922
|
-
const gifBytes =
|
|
6837
|
+
const gifBytes = chunkSADF35N7_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
6923
6838
|
onProgress?.(totalSlides, totalSlides);
|
|
6924
6839
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
6925
6840
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -6973,7 +6888,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
6973
6888
|
continue;
|
|
6974
6889
|
}
|
|
6975
6890
|
onProgress?.(processedCount, data.slides.length);
|
|
6976
|
-
let svg =
|
|
6891
|
+
let svg = chunkSADF35N7_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
6977
6892
|
if (embedFonts && fontFaces?.length) {
|
|
6978
6893
|
svg = injectFontFaces(svg, fontFaces);
|
|
6979
6894
|
}
|
|
@@ -7035,7 +6950,7 @@ function useExportSaveAs(input) {
|
|
|
7035
6950
|
}
|
|
7036
6951
|
setExportProgress(70);
|
|
7037
6952
|
setExportStatusMessage("Writing README...");
|
|
7038
|
-
const readme =
|
|
6953
|
+
const readme = chunkSADF35N7_js.generatePackageReadme(pptxFilename);
|
|
7039
6954
|
pkgFolder.file("README.txt", readme);
|
|
7040
6955
|
if (abortCtrl.signal.aborted) {
|
|
7041
6956
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -7046,7 +6961,7 @@ function useExportSaveAs(input) {
|
|
|
7046
6961
|
setExportProgress(95);
|
|
7047
6962
|
setExportStatusMessage("Downloading...");
|
|
7048
6963
|
const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
|
|
7049
|
-
|
|
6964
|
+
chunkSADF35N7_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
|
|
7050
6965
|
setExportProgress(100);
|
|
7051
6966
|
} catch (err) {
|
|
7052
6967
|
if (err.name !== "AbortError") {
|
|
@@ -7069,7 +6984,7 @@ function useExportSaveAs(input) {
|
|
|
7069
6984
|
const blob = new Blob([data], {
|
|
7070
6985
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
7071
6986
|
});
|
|
7072
|
-
|
|
6987
|
+
chunkSADF35N7_js.downloadBlob(blob, `${baseName}.${ext}`);
|
|
7073
6988
|
} catch (err) {
|
|
7074
6989
|
console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
|
|
7075
6990
|
}
|
|
@@ -7082,14 +6997,14 @@ function useExportSaveAs(input) {
|
|
|
7082
6997
|
const pptxGuides = guides.map((g) => ({
|
|
7083
6998
|
id: g.id,
|
|
7084
6999
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
7085
|
-
positionEmu:
|
|
7000
|
+
positionEmu: chunkSADF35N7_js.guidePxToEmu(g.position)
|
|
7086
7001
|
}));
|
|
7087
7002
|
return {
|
|
7088
7003
|
...slide,
|
|
7089
7004
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
7090
7005
|
};
|
|
7091
7006
|
});
|
|
7092
|
-
const slidesToSave =
|
|
7007
|
+
const slidesToSave = chunkSADF35N7_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
7093
7008
|
const saveOptions = {
|
|
7094
7009
|
headerFooter,
|
|
7095
7010
|
presentationProperties,
|
|
@@ -7115,11 +7030,11 @@ function useExportSaveAs(input) {
|
|
|
7115
7030
|
const handleExportJson = () => {
|
|
7116
7031
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7117
7032
|
const data = {
|
|
7118
|
-
slides:
|
|
7033
|
+
slides: chunkSADF35N7_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7119
7034
|
width: canvasSize.width,
|
|
7120
7035
|
height: canvasSize.height,
|
|
7121
|
-
widthEmu:
|
|
7122
|
-
heightEmu:
|
|
7036
|
+
widthEmu: chunkSADF35N7_js.guidePxToEmu(canvasSize.width),
|
|
7037
|
+
heightEmu: chunkSADF35N7_js.guidePxToEmu(canvasSize.height),
|
|
7123
7038
|
theme,
|
|
7124
7039
|
headerFooter,
|
|
7125
7040
|
presentationProperties,
|
|
@@ -7133,7 +7048,7 @@ function useExportSaveAs(input) {
|
|
|
7133
7048
|
handoutMaster
|
|
7134
7049
|
};
|
|
7135
7050
|
try {
|
|
7136
|
-
|
|
7051
|
+
chunkSADF35N7_js.exportDeckJson(data, sourceName);
|
|
7137
7052
|
} catch (err) {
|
|
7138
7053
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7139
7054
|
}
|
|
@@ -7173,7 +7088,7 @@ function safeConfirm(message) {
|
|
|
7173
7088
|
}
|
|
7174
7089
|
}
|
|
7175
7090
|
function downloadBlob2(blob, filename) {
|
|
7176
|
-
|
|
7091
|
+
chunkSADF35N7_js.downloadBlob(blob, chunkSADF35N7_js.sanitizeDownloadFilename(filename));
|
|
7177
7092
|
}
|
|
7178
7093
|
|
|
7179
7094
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -7279,21 +7194,21 @@ function useExportHandlers(input) {
|
|
|
7279
7194
|
{
|
|
7280
7195
|
scale: 2,
|
|
7281
7196
|
onProgress: (current, total) => {
|
|
7282
|
-
setExportProgress(
|
|
7283
|
-
setExportStatusMessage(
|
|
7197
|
+
setExportProgress(chunkSADF35N7_js.slideProgressPercent(current, total));
|
|
7198
|
+
setExportStatusMessage(chunkSADF35N7_js.slideStatusLabel("Rendering", current, total));
|
|
7284
7199
|
},
|
|
7285
7200
|
signal: abortCtrl.signal
|
|
7286
7201
|
}
|
|
7287
7202
|
);
|
|
7288
|
-
setExportProgress(
|
|
7203
|
+
setExportProgress(chunkSADF35N7_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7289
7204
|
setExportStatusMessage("Building PDF...");
|
|
7290
7205
|
await new Promise((r) => {
|
|
7291
7206
|
setTimeout(r, 100);
|
|
7292
7207
|
});
|
|
7293
|
-
setExportProgress(
|
|
7208
|
+
setExportProgress(chunkSADF35N7_js.EXPORT_DONE_PERCENT);
|
|
7294
7209
|
setExportStatusMessage("Done!");
|
|
7295
7210
|
} catch (err) {
|
|
7296
|
-
if (!
|
|
7211
|
+
if (!chunkSADF35N7_js.isExportAbortError(err)) {
|
|
7297
7212
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7298
7213
|
}
|
|
7299
7214
|
} finally {
|
|
@@ -7323,21 +7238,21 @@ function useExportHandlers(input) {
|
|
|
7323
7238
|
{
|
|
7324
7239
|
scale: 2,
|
|
7325
7240
|
onProgress: (current, total) => {
|
|
7326
|
-
setExportProgress(
|
|
7327
|
-
setExportStatusMessage(
|
|
7241
|
+
setExportProgress(chunkSADF35N7_js.slideProgressPercent(current, total));
|
|
7242
|
+
setExportStatusMessage(chunkSADF35N7_js.slideStatusLabel("Rendering", current, total));
|
|
7328
7243
|
},
|
|
7329
7244
|
signal: abortCtrl.signal
|
|
7330
7245
|
}
|
|
7331
7246
|
);
|
|
7332
|
-
setExportProgress(
|
|
7247
|
+
setExportProgress(chunkSADF35N7_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7333
7248
|
setExportStatusMessage("Building PDF...");
|
|
7334
7249
|
await new Promise((r) => {
|
|
7335
7250
|
setTimeout(r, 100);
|
|
7336
7251
|
});
|
|
7337
|
-
setExportProgress(
|
|
7252
|
+
setExportProgress(chunkSADF35N7_js.EXPORT_DONE_PERCENT);
|
|
7338
7253
|
setExportStatusMessage("Done!");
|
|
7339
7254
|
} catch (err) {
|
|
7340
|
-
if (!
|
|
7255
|
+
if (!chunkSADF35N7_js.isExportAbortError(err)) {
|
|
7341
7256
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7342
7257
|
}
|
|
7343
7258
|
} finally {
|
|
@@ -7378,22 +7293,22 @@ function useExportHandlers(input) {
|
|
|
7378
7293
|
scale: 1,
|
|
7379
7294
|
slideDurationMs: 3e3,
|
|
7380
7295
|
onProgress: (current, total) => {
|
|
7381
|
-
setExportProgress(
|
|
7382
|
-
setExportStatusMessage(
|
|
7296
|
+
setExportProgress(chunkSADF35N7_js.slideProgressPercent(current, total, 45));
|
|
7297
|
+
setExportStatusMessage(chunkSADF35N7_js.slideStatusLabel("Capturing", current, total));
|
|
7383
7298
|
},
|
|
7384
7299
|
onRecordProgress: (current, total) => {
|
|
7385
|
-
setExportProgress(
|
|
7386
|
-
setExportStatusMessage(
|
|
7300
|
+
setExportProgress(chunkSADF35N7_js.recordProgressPercent(current, total));
|
|
7301
|
+
setExportStatusMessage(chunkSADF35N7_js.slideStatusLabel("Recording", current, total));
|
|
7387
7302
|
},
|
|
7388
7303
|
signal: abortCtrl.signal
|
|
7389
7304
|
}
|
|
7390
7305
|
);
|
|
7391
|
-
setExportProgress(
|
|
7306
|
+
setExportProgress(chunkSADF35N7_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7392
7307
|
setExportStatusMessage("Saving file...");
|
|
7393
7308
|
downloadBlob2(blob, "presentation.webm");
|
|
7394
|
-
setExportProgress(
|
|
7309
|
+
setExportProgress(chunkSADF35N7_js.EXPORT_DONE_PERCENT);
|
|
7395
7310
|
} catch (err) {
|
|
7396
|
-
if (!
|
|
7311
|
+
if (!chunkSADF35N7_js.isExportAbortError(err)) {
|
|
7397
7312
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7398
7313
|
}
|
|
7399
7314
|
} finally {
|
|
@@ -7421,18 +7336,18 @@ function useExportHandlers(input) {
|
|
|
7421
7336
|
scale: 0.5,
|
|
7422
7337
|
slideDurationMs: 2e3,
|
|
7423
7338
|
onProgress: (current, total) => {
|
|
7424
|
-
setExportProgress(
|
|
7425
|
-
setExportStatusMessage(
|
|
7339
|
+
setExportProgress(chunkSADF35N7_js.slideProgressPercent(current, total));
|
|
7340
|
+
setExportStatusMessage(chunkSADF35N7_js.slideStatusLabel("Encoding", current, total));
|
|
7426
7341
|
},
|
|
7427
7342
|
signal: abortCtrl.signal
|
|
7428
7343
|
}
|
|
7429
7344
|
);
|
|
7430
|
-
setExportProgress(
|
|
7345
|
+
setExportProgress(chunkSADF35N7_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7431
7346
|
setExportStatusMessage("Saving file...");
|
|
7432
7347
|
downloadBlob2(blob, "presentation.gif");
|
|
7433
|
-
setExportProgress(
|
|
7348
|
+
setExportProgress(chunkSADF35N7_js.EXPORT_DONE_PERCENT);
|
|
7434
7349
|
} catch (err) {
|
|
7435
|
-
if (!
|
|
7350
|
+
if (!chunkSADF35N7_js.isExportAbortError(err)) {
|
|
7436
7351
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7437
7352
|
}
|
|
7438
7353
|
} finally {
|
|
@@ -7473,7 +7388,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
7473
7388
|
}
|
|
7474
7389
|
printWindow.document.open();
|
|
7475
7390
|
printWindow.document.write(
|
|
7476
|
-
|
|
7391
|
+
chunkSADF35N7_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
7477
7392
|
);
|
|
7478
7393
|
printWindow.document.close();
|
|
7479
7394
|
printWindow.focus();
|
|
@@ -7534,7 +7449,7 @@ function usePrintHandlers(input) {
|
|
|
7534
7449
|
if (svgs.length === 0) {
|
|
7535
7450
|
return;
|
|
7536
7451
|
}
|
|
7537
|
-
const printDoc =
|
|
7452
|
+
const printDoc = chunkSADF35N7_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7538
7453
|
title: "Slides (Vector)",
|
|
7539
7454
|
orientation: settings.orientation,
|
|
7540
7455
|
colorFilter
|
|
@@ -7570,7 +7485,7 @@ function usePrintHandlers(input) {
|
|
|
7570
7485
|
if (settings.printWhat === "outline") {
|
|
7571
7486
|
openPrintWindow(
|
|
7572
7487
|
"Outline",
|
|
7573
|
-
`<div class="outline-page">${
|
|
7488
|
+
`<div class="outline-page">${chunkSADF35N7_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7574
7489
|
settings.orientation,
|
|
7575
7490
|
colorFilter,
|
|
7576
7491
|
settings.frameSlides
|
|
@@ -7595,7 +7510,7 @@ function usePrintHandlers(input) {
|
|
|
7595
7510
|
if (settings.printWhat === "slides") {
|
|
7596
7511
|
openPrintWindow(
|
|
7597
7512
|
"Slides",
|
|
7598
|
-
|
|
7513
|
+
chunkSADF35N7_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7599
7514
|
settings.orientation,
|
|
7600
7515
|
colorFilter,
|
|
7601
7516
|
settings.frameSlides
|
|
@@ -7605,7 +7520,7 @@ function usePrintHandlers(input) {
|
|
|
7605
7520
|
if (settings.printWhat === "notes") {
|
|
7606
7521
|
openPrintWindow(
|
|
7607
7522
|
"Notes Pages",
|
|
7608
|
-
|
|
7523
|
+
chunkSADF35N7_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7609
7524
|
"portrait",
|
|
7610
7525
|
colorFilter,
|
|
7611
7526
|
settings.frameSlides
|
|
@@ -7616,7 +7531,7 @@ function usePrintHandlers(input) {
|
|
|
7616
7531
|
const spp = settings.slidesPerPage;
|
|
7617
7532
|
openPrintWindow(
|
|
7618
7533
|
`Handout ${spp} per page`,
|
|
7619
|
-
|
|
7534
|
+
chunkSADF35N7_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
7620
7535
|
"portrait",
|
|
7621
7536
|
colorFilter,
|
|
7622
7537
|
settings.frameSlides
|
|
@@ -7680,8 +7595,8 @@ function useThemeHandlers(input) {
|
|
|
7680
7595
|
return;
|
|
7681
7596
|
}
|
|
7682
7597
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7683
|
-
const previousMap = theme?.colorScheme ?
|
|
7684
|
-
setSlides((prev) =>
|
|
7598
|
+
const previousMap = theme?.colorScheme ? chunkSADF35N7_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7599
|
+
setSlides((prev) => chunkSADF35N7_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7685
7600
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7686
7601
|
bumpHistory();
|
|
7687
7602
|
history.markDirty();
|
|
@@ -7786,7 +7701,7 @@ function useThemeSwitching(input) {
|
|
|
7786
7701
|
}
|
|
7787
7702
|
try {
|
|
7788
7703
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7789
|
-
const newData =
|
|
7704
|
+
const newData = chunkSADF35N7_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7790
7705
|
onDataChange(newData);
|
|
7791
7706
|
onThemeChanged?.(preset);
|
|
7792
7707
|
} catch (error) {
|
|
@@ -7803,7 +7718,7 @@ function useThemeSwitching(input) {
|
|
|
7803
7718
|
}
|
|
7804
7719
|
try {
|
|
7805
7720
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7806
|
-
const newData =
|
|
7721
|
+
const newData = chunkSADF35N7_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7807
7722
|
onDataChange(newData);
|
|
7808
7723
|
} catch (error) {
|
|
7809
7724
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7815,12 +7730,12 @@ function useThemeSwitching(input) {
|
|
|
7815
7730
|
if (!data?.theme?.colorScheme) {
|
|
7816
7731
|
return void 0;
|
|
7817
7732
|
}
|
|
7818
|
-
return
|
|
7819
|
-
(p) =>
|
|
7733
|
+
return chunkSADF35N7_js.THEME_PRESETS.find(
|
|
7734
|
+
(p) => chunkSADF35N7_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7820
7735
|
);
|
|
7821
7736
|
}, [data?.theme?.colorScheme]);
|
|
7822
7737
|
return {
|
|
7823
|
-
presets:
|
|
7738
|
+
presets: chunkSADF35N7_js.THEME_PRESETS,
|
|
7824
7739
|
switchToPreset,
|
|
7825
7740
|
switchToCustom,
|
|
7826
7741
|
currentPreset
|
|
@@ -7895,7 +7810,7 @@ function usePropertyHandlers(input) {
|
|
|
7895
7810
|
}
|
|
7896
7811
|
try {
|
|
7897
7812
|
const ab = await file.arrayBuffer();
|
|
7898
|
-
const h = new
|
|
7813
|
+
const h = new chunkSADF35N7_js.PptxHandler();
|
|
7899
7814
|
const other = await h.load(ab);
|
|
7900
7815
|
if (!other) {
|
|
7901
7816
|
return;
|
|
@@ -7905,7 +7820,7 @@ function usePropertyHandlers(input) {
|
|
|
7905
7820
|
width: canvasSize.width,
|
|
7906
7821
|
height: canvasSize.height
|
|
7907
7822
|
};
|
|
7908
|
-
setCompareResult(
|
|
7823
|
+
setCompareResult(chunkSADF35N7_js.comparePresentation(cur, other));
|
|
7909
7824
|
setIsComparePanelOpen(true);
|
|
7910
7825
|
} catch (err) {
|
|
7911
7826
|
console.warn("Compare failed:", err);
|
|
@@ -7922,7 +7837,7 @@ function usePropertyHandlers(input) {
|
|
|
7922
7837
|
if (!diff || diff.status === "unchanged") {
|
|
7923
7838
|
return;
|
|
7924
7839
|
}
|
|
7925
|
-
setSlides((prev) =>
|
|
7840
|
+
setSlides((prev) => chunkSADF35N7_js.applyAcceptSlide(prev, diff));
|
|
7926
7841
|
setIsDirty(true);
|
|
7927
7842
|
},
|
|
7928
7843
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -7933,10 +7848,10 @@ function usePropertyHandlers(input) {
|
|
|
7933
7848
|
if (!compareResult) {
|
|
7934
7849
|
return;
|
|
7935
7850
|
}
|
|
7936
|
-
setSlides((prev) =>
|
|
7851
|
+
setSlides((prev) => chunkSADF35N7_js.applyAcceptAllSlides(prev, compareResult));
|
|
7937
7852
|
setIsDirty(true);
|
|
7938
7853
|
}, [compareResult, setSlides, setIsDirty]);
|
|
7939
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
7854
|
+
const usedFontFamilies = react.useMemo(() => chunkSADF35N7_js.collectUsedFonts(slides), [slides]);
|
|
7940
7855
|
return {
|
|
7941
7856
|
handleUpdateNotes,
|
|
7942
7857
|
handleUpdateSlide,
|
|
@@ -8055,7 +7970,7 @@ function useIsMobile(input) {
|
|
|
8055
7970
|
const containerRef = input?.containerRef;
|
|
8056
7971
|
const isTouchDevice = react.useSyncExternalStore(
|
|
8057
7972
|
subscribeTouchCapability,
|
|
8058
|
-
|
|
7973
|
+
chunkSADF35N7_js.detectTouchDevice,
|
|
8059
7974
|
() => false
|
|
8060
7975
|
// server snapshot
|
|
8061
7976
|
);
|
|
@@ -8071,7 +7986,7 @@ function useIsMobile(input) {
|
|
|
8071
7986
|
}
|
|
8072
7987
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
8073
7988
|
});
|
|
8074
|
-
const [orientation, setOrientation] = react.useState(
|
|
7989
|
+
const [orientation, setOrientation] = react.useState(chunkSADF35N7_js.detectOrientation);
|
|
8075
7990
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
8076
7991
|
const [initialViewportHeight] = react.useState(
|
|
8077
7992
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -8115,7 +8030,7 @@ function useIsMobile(input) {
|
|
|
8115
8030
|
return;
|
|
8116
8031
|
}
|
|
8117
8032
|
const handleOrientationChange = () => {
|
|
8118
|
-
setOrientation(
|
|
8033
|
+
setOrientation(chunkSADF35N7_js.detectOrientation());
|
|
8119
8034
|
};
|
|
8120
8035
|
if (screen.orientation) {
|
|
8121
8036
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -8145,9 +8060,9 @@ function useIsMobile(input) {
|
|
|
8145
8060
|
window.addEventListener("resize", handleResize);
|
|
8146
8061
|
return () => window.removeEventListener("resize", handleResize);
|
|
8147
8062
|
}, [isTouchDevice, initialViewportHeight]);
|
|
8148
|
-
const isMobile =
|
|
8149
|
-
const isTablet = !isMobile && containerWidth >=
|
|
8150
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
8063
|
+
const isMobile = chunkSADF35N7_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
8064
|
+
const isTablet = !isMobile && containerWidth >= chunkSADF35N7_js.MOBILE_BREAKPOINT && containerWidth < chunkSADF35N7_js.TABLET_BREAKPOINT;
|
|
8065
|
+
const isDesktop = !isMobile && containerWidth >= chunkSADF35N7_js.TABLET_BREAKPOINT;
|
|
8151
8066
|
return {
|
|
8152
8067
|
isMobile,
|
|
8153
8068
|
isTablet,
|
|
@@ -8208,11 +8123,11 @@ function useViewerDialogs(input) {
|
|
|
8208
8123
|
);
|
|
8209
8124
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(false);
|
|
8210
8125
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8211
|
-
() => typeof window !== "undefined" ?
|
|
8126
|
+
() => typeof window !== "undefined" ? chunkSADF35N7_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8212
8127
|
);
|
|
8213
8128
|
react.useEffect(() => {
|
|
8214
8129
|
const handleWindow = () => setIsNarrowViewport(
|
|
8215
|
-
|
|
8130
|
+
chunkSADF35N7_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8216
8131
|
);
|
|
8217
8132
|
let observer = null;
|
|
8218
8133
|
let raf = 0;
|
|
@@ -8226,12 +8141,12 @@ function useViewerDialogs(input) {
|
|
|
8226
8141
|
const entry = entries[0];
|
|
8227
8142
|
if (entry) {
|
|
8228
8143
|
setIsNarrowViewport(
|
|
8229
|
-
|
|
8144
|
+
chunkSADF35N7_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
8230
8145
|
);
|
|
8231
8146
|
}
|
|
8232
8147
|
});
|
|
8233
8148
|
observer.observe(el);
|
|
8234
|
-
setIsNarrowViewport(
|
|
8149
|
+
setIsNarrowViewport(chunkSADF35N7_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
8235
8150
|
};
|
|
8236
8151
|
attach();
|
|
8237
8152
|
window.addEventListener("resize", handleWindow);
|
|
@@ -8389,20 +8304,20 @@ function useViewerDialogs(input) {
|
|
|
8389
8304
|
}
|
|
8390
8305
|
function computeGridSpacingPx(presentationGridSpacing) {
|
|
8391
8306
|
if (presentationGridSpacing) {
|
|
8392
|
-
const px = Math.round(presentationGridSpacing.cx /
|
|
8307
|
+
const px = Math.round(presentationGridSpacing.cx / chunkQBRZ3VIC_js.EMU_PER_PX);
|
|
8393
8308
|
if (px > 0) {
|
|
8394
8309
|
return px;
|
|
8395
8310
|
}
|
|
8396
8311
|
}
|
|
8397
|
-
return
|
|
8312
|
+
return chunkQBRZ3VIC_js.GRID_SIZE;
|
|
8398
8313
|
}
|
|
8399
8314
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8400
8315
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8401
|
-
return
|
|
8316
|
+
return chunkSADF35N7_js.resolveShowSlideIndexes(slides, activeShow);
|
|
8402
8317
|
}
|
|
8403
8318
|
function computeSlideSectionGroups(slides, sections) {
|
|
8404
|
-
return
|
|
8405
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8319
|
+
return chunkSADF35N7_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8320
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkQBRZ3VIC_js.UNGROUPED_SECTION_ID : "default"),
|
|
8406
8321
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8407
8322
|
slideIndexes: group.slideIndexes,
|
|
8408
8323
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8457,7 +8372,7 @@ function useDerivedSlideState(input) {
|
|
|
8457
8372
|
);
|
|
8458
8373
|
const slideSectionGroups = react.useMemo(
|
|
8459
8374
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8460
|
-
if (group.id ===
|
|
8375
|
+
if (group.id === chunkQBRZ3VIC_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8461
8376
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8462
8377
|
}
|
|
8463
8378
|
if (group.id === "default" && group.label === "Slides") {
|
|
@@ -8560,13 +8475,13 @@ function useAnnotationHandlers(input) {
|
|
|
8560
8475
|
}, [annotations, setMode, setSlides, history]);
|
|
8561
8476
|
const handleSetMode = react.useCallback(
|
|
8562
8477
|
(nextMode) => {
|
|
8563
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8478
|
+
if (mode === "present" && nextMode !== "present" && !chunkSADF35N7_js.mayLeaveSlideShow()) {
|
|
8564
8479
|
return;
|
|
8565
8480
|
}
|
|
8566
8481
|
if (nextMode === "present") {
|
|
8567
8482
|
presentation.enterPresentMode();
|
|
8568
8483
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8569
|
-
|
|
8484
|
+
chunkSADF35N7_js.stopAllPersistentAudio();
|
|
8570
8485
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8571
8486
|
if (promptKeepInkAnnotations) {
|
|
8572
8487
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8575,7 +8490,7 @@ function useAnnotationHandlers(input) {
|
|
|
8575
8490
|
}
|
|
8576
8491
|
} else {
|
|
8577
8492
|
if (mode === "present") {
|
|
8578
|
-
|
|
8493
|
+
chunkSADF35N7_js.stopAllPersistentAudio();
|
|
8579
8494
|
}
|
|
8580
8495
|
setMode(nextMode);
|
|
8581
8496
|
}
|
|
@@ -8641,13 +8556,13 @@ function useSerialize(input) {
|
|
|
8641
8556
|
let processedSlide = slide;
|
|
8642
8557
|
if (pendingEditId) {
|
|
8643
8558
|
const updatedElements = slide.elements.map((el) => {
|
|
8644
|
-
if (el.id !== pendingEditId || !
|
|
8559
|
+
if (el.id !== pendingEditId || !chunkSADF35N7_js.hasTextProperties(el)) {
|
|
8645
8560
|
return el;
|
|
8646
8561
|
}
|
|
8647
8562
|
return {
|
|
8648
8563
|
...el,
|
|
8649
8564
|
text: pendingEditText,
|
|
8650
|
-
textSegments:
|
|
8565
|
+
textSegments: chunkSADF35N7_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8651
8566
|
};
|
|
8652
8567
|
});
|
|
8653
8568
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8660,14 +8575,14 @@ function useSerialize(input) {
|
|
|
8660
8575
|
const pptxGuides = guides.map((g) => ({
|
|
8661
8576
|
id: g.id,
|
|
8662
8577
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8663
|
-
positionEmu:
|
|
8578
|
+
positionEmu: chunkSADF35N7_js.guidePxToEmu(g.position)
|
|
8664
8579
|
}));
|
|
8665
8580
|
return {
|
|
8666
8581
|
...processedSlide,
|
|
8667
8582
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8668
8583
|
};
|
|
8669
8584
|
});
|
|
8670
|
-
const slidesToSave =
|
|
8585
|
+
const slidesToSave = chunkSADF35N7_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8671
8586
|
const saveOptions = {
|
|
8672
8587
|
headerFooter,
|
|
8673
8588
|
presentationProperties,
|
|
@@ -8836,7 +8751,7 @@ function usePresentationSetup(input) {
|
|
|
8836
8751
|
containerRef,
|
|
8837
8752
|
content,
|
|
8838
8753
|
onSetMode: (nextMode) => {
|
|
8839
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8754
|
+
if (mode === "present" && nextMode !== "present" && !chunkSADF35N7_js.mayLeaveSlideShow()) {
|
|
8840
8755
|
return;
|
|
8841
8756
|
}
|
|
8842
8757
|
if (mode === "present" && nextMode !== "present" && annotations.hasAnyAnnotations && promptKeepInkAnnotations) {
|
|
@@ -8844,7 +8759,7 @@ function usePresentationSetup(input) {
|
|
|
8844
8759
|
setShowKeepAnnotationsDialog(true);
|
|
8845
8760
|
} else {
|
|
8846
8761
|
if (mode === "present" && nextMode !== "present") {
|
|
8847
|
-
|
|
8762
|
+
chunkSADF35N7_js.stopAllPersistentAudio();
|
|
8848
8763
|
stopAnimationSound();
|
|
8849
8764
|
}
|
|
8850
8765
|
setMode(nextMode);
|
|
@@ -8898,10 +8813,10 @@ function usePresentationSetup(input) {
|
|
|
8898
8813
|
onToggleInkMarkup: () => annotations.setInkMarkupVisible(!annotations.inkMarkupVisible),
|
|
8899
8814
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8900
8815
|
onSaveRehearsalTimings: (timings) => {
|
|
8901
|
-
setSlides((prev) =>
|
|
8816
|
+
setSlides((prev) => chunkSADF35N7_js.applyRehearsalTimings(prev, timings));
|
|
8902
8817
|
history.markDirty();
|
|
8903
8818
|
},
|
|
8904
|
-
loopContinuously:
|
|
8819
|
+
loopContinuously: chunkSADF35N7_js.shouldLoopContinuously(presentationProperties),
|
|
8905
8820
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8906
8821
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8907
8822
|
endWithBlackSlide
|
|
@@ -9066,7 +8981,7 @@ function useEditorOperations(input) {
|
|
|
9066
8981
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
9067
8982
|
react.useEffect(() => {
|
|
9068
8983
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9069
|
-
copiedFormatRef.current =
|
|
8984
|
+
copiedFormatRef.current = chunkSADF35N7_js.copyFormatFromElement(selectedElement);
|
|
9070
8985
|
} else if (!formatPainterActive) {
|
|
9071
8986
|
copiedFormatRef.current = null;
|
|
9072
8987
|
}
|
|
@@ -9092,12 +9007,12 @@ function useEditorOperations(input) {
|
|
|
9092
9007
|
e.stopPropagation();
|
|
9093
9008
|
const element = elementLookup.get(elementId);
|
|
9094
9009
|
if (element) {
|
|
9095
|
-
const updated =
|
|
9010
|
+
const updated = chunkSADF35N7_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
9096
9011
|
const updates = {};
|
|
9097
|
-
if (
|
|
9012
|
+
if (chunkSADF35N7_js.hasShapeProperties(updated)) {
|
|
9098
9013
|
updates.shapeStyle = updated.shapeStyle;
|
|
9099
9014
|
}
|
|
9100
|
-
if (
|
|
9015
|
+
if (chunkSADF35N7_js.hasTextProperties(updated)) {
|
|
9101
9016
|
updates.textStyle = updated.textStyle;
|
|
9102
9017
|
}
|
|
9103
9018
|
ops.updateElementById(elementId, updates);
|
|
@@ -9246,7 +9161,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
9246
9161
|
const families = /* @__PURE__ */ new Set();
|
|
9247
9162
|
for (const slide of slides) {
|
|
9248
9163
|
for (const el of slide.elements) {
|
|
9249
|
-
if (
|
|
9164
|
+
if (chunkSADF35N7_js.hasTextProperties(el) && el.textSegments) {
|
|
9250
9165
|
for (const seg of el.textSegments) {
|
|
9251
9166
|
if (seg.style.fontFamily) {
|
|
9252
9167
|
families.add(seg.style.fontFamily);
|
|
@@ -9458,13 +9373,13 @@ function useKeyboardShortcuts(input) {
|
|
|
9458
9373
|
inputRef.current = input;
|
|
9459
9374
|
const handleKeyDown = react.useCallback((e) => {
|
|
9460
9375
|
const current = inputRef.current;
|
|
9461
|
-
const { action, dx, dy } =
|
|
9376
|
+
const { action, dx, dy } = chunkSADF35N7_js.mapEditorKey(e, {
|
|
9462
9377
|
canEdit: current.canEdit,
|
|
9463
9378
|
isPresenting: current.mode !== "edit",
|
|
9464
9379
|
hasSelection: current.hasSelection,
|
|
9465
9380
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9466
9381
|
isDrawing: current.activeTool !== "select",
|
|
9467
|
-
isTextInputTarget:
|
|
9382
|
+
isTextInputTarget: chunkSADF35N7_js.isEditorTextInputTarget(e.target)
|
|
9468
9383
|
});
|
|
9469
9384
|
if (action === null) {
|
|
9470
9385
|
return;
|
|
@@ -9758,7 +9673,7 @@ function useViewerIntegration(input) {
|
|
|
9758
9673
|
return zoom.scale;
|
|
9759
9674
|
},
|
|
9760
9675
|
setZoom(level) {
|
|
9761
|
-
zoom.setScale(
|
|
9676
|
+
zoom.setScale(chunkSADF35N7_js.clampZoomScale(level));
|
|
9762
9677
|
},
|
|
9763
9678
|
zoomIn() {
|
|
9764
9679
|
zoom.handleZoomIn();
|
|
@@ -9973,7 +9888,7 @@ function useReducedMotion() {
|
|
|
9973
9888
|
}
|
|
9974
9889
|
function useViewerOptions() {
|
|
9975
9890
|
const storeRef = react.useRef(null);
|
|
9976
|
-
storeRef.current ??=
|
|
9891
|
+
storeRef.current ??= chunkSADF35N7_js.createViewerOptionsStore();
|
|
9977
9892
|
const store = storeRef.current;
|
|
9978
9893
|
const options = react.useSyncExternalStore(
|
|
9979
9894
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -9982,9 +9897,9 @@ function useViewerOptions() {
|
|
|
9982
9897
|
);
|
|
9983
9898
|
return { optionsStore: store, options };
|
|
9984
9899
|
}
|
|
9985
|
-
var KNOWN_TAB_IDS = new Set(
|
|
9900
|
+
var KNOWN_TAB_IDS = new Set(chunkSADF35N7_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
9986
9901
|
function computeToolbarVisibility(hiddenActions) {
|
|
9987
|
-
const isHidden = (id) =>
|
|
9902
|
+
const isHidden = (id) => chunkSADF35N7_js.isActionHidden(id, hiddenActions);
|
|
9988
9903
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
9989
9904
|
return { isHidden, isTabVisible };
|
|
9990
9905
|
}
|
|
@@ -10069,12 +9984,12 @@ function useYjsDocumentSync({
|
|
|
10069
9984
|
return;
|
|
10070
9985
|
}
|
|
10071
9986
|
try {
|
|
10072
|
-
const handler = new
|
|
9987
|
+
const handler = new chunkSADF35N7_js.PptxHandler();
|
|
10073
9988
|
await handler.load(sourceBytes.buffer);
|
|
10074
|
-
const currentSlides =
|
|
9989
|
+
const currentSlides = chunkSADF35N7_js.readSlidesFromYDoc(
|
|
10075
9990
|
doc
|
|
10076
9991
|
);
|
|
10077
|
-
const slidesToSave =
|
|
9992
|
+
const slidesToSave = chunkSADF35N7_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10078
9993
|
const bytes = await handler.save(slidesToSave);
|
|
10079
9994
|
config.onWriteBack(bytes);
|
|
10080
9995
|
} catch {
|
|
@@ -10089,7 +10004,7 @@ function useYjsDocumentSync({
|
|
|
10089
10004
|
if (!doc || !isConnected) {
|
|
10090
10005
|
return;
|
|
10091
10006
|
}
|
|
10092
|
-
const docSlides =
|
|
10007
|
+
const docSlides = chunkSADF35N7_js.readSlidesFromYDoc(
|
|
10093
10008
|
doc
|
|
10094
10009
|
);
|
|
10095
10010
|
if (docSlides.length === 0) {
|
|
@@ -10111,11 +10026,11 @@ function useYjsDocumentSync({
|
|
|
10111
10026
|
lastSyncedRef.current = serialized;
|
|
10112
10027
|
void (async () => {
|
|
10113
10028
|
const factories = await getFactories();
|
|
10114
|
-
|
|
10029
|
+
chunkSADF35N7_js.reconcileSlidesInYDoc(
|
|
10115
10030
|
slides,
|
|
10116
10031
|
doc,
|
|
10117
10032
|
factories,
|
|
10118
|
-
|
|
10033
|
+
chunkSADF35N7_js.LOCAL_SYNC_ORIGIN
|
|
10119
10034
|
);
|
|
10120
10035
|
scheduleWriteBack();
|
|
10121
10036
|
})();
|
|
@@ -10129,10 +10044,10 @@ function useYjsDocumentSync({
|
|
|
10129
10044
|
return;
|
|
10130
10045
|
}
|
|
10131
10046
|
const handleChange = (_events, transaction) => {
|
|
10132
|
-
if (transaction?.origin ===
|
|
10047
|
+
if (transaction?.origin === chunkSADF35N7_js.LOCAL_SYNC_ORIGIN) {
|
|
10133
10048
|
return;
|
|
10134
10049
|
}
|
|
10135
|
-
const remoteSlides =
|
|
10050
|
+
const remoteSlides = chunkSADF35N7_js.readSlidesFromYDoc(
|
|
10136
10051
|
doc
|
|
10137
10052
|
);
|
|
10138
10053
|
if (remoteSlides.length === 0) {
|
|
@@ -10148,7 +10063,7 @@ function useYjsDocumentSync({
|
|
|
10148
10063
|
isApplyingRemoteRef.current = false;
|
|
10149
10064
|
scheduleWriteBack();
|
|
10150
10065
|
};
|
|
10151
|
-
const unobserve =
|
|
10066
|
+
const unobserve = chunkSADF35N7_js.observeYDocSlides(
|
|
10152
10067
|
doc,
|
|
10153
10068
|
handleChange
|
|
10154
10069
|
);
|
|
@@ -10186,7 +10101,7 @@ function useBroadcastFollower({
|
|
|
10186
10101
|
if (!broadcaster) {
|
|
10187
10102
|
return;
|
|
10188
10103
|
}
|
|
10189
|
-
if (!
|
|
10104
|
+
if (!chunkSADF35N7_js.shouldAutoFollowBroadcaster({
|
|
10190
10105
|
localRole: collab.config.role,
|
|
10191
10106
|
broadcasterRole: broadcaster.role
|
|
10192
10107
|
})) {
|
|
@@ -10352,10 +10267,10 @@ function useTouchGestures(input) {
|
|
|
10352
10267
|
if (!el || !enabled) {
|
|
10353
10268
|
return;
|
|
10354
10269
|
}
|
|
10355
|
-
const recognizer =
|
|
10270
|
+
const recognizer = chunkSADF35N7_js.createTouchGestureRecognizer({
|
|
10356
10271
|
getScale: () => scaleRef.current,
|
|
10357
|
-
minScale:
|
|
10358
|
-
maxScale:
|
|
10272
|
+
minScale: chunkSADF35N7_js.MIN_ZOOM_SCALE,
|
|
10273
|
+
maxScale: chunkSADF35N7_js.MAX_ZOOM_SCALE,
|
|
10359
10274
|
callbacks: {
|
|
10360
10275
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10361
10276
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10395,7 +10310,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10395
10310
|
return;
|
|
10396
10311
|
}
|
|
10397
10312
|
const rect = active.getBoundingClientRect();
|
|
10398
|
-
const delta =
|
|
10313
|
+
const delta = chunkSADF35N7_js.computeScrollDelta(
|
|
10399
10314
|
{ top: rect.top, bottom: rect.bottom },
|
|
10400
10315
|
window.innerHeight,
|
|
10401
10316
|
keyboardInset
|
|
@@ -10415,8 +10330,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10415
10330
|
return;
|
|
10416
10331
|
}
|
|
10417
10332
|
const update = () => {
|
|
10418
|
-
const metrics =
|
|
10419
|
-
const inset = metrics ?
|
|
10333
|
+
const metrics = chunkSADF35N7_js.readViewportMetrics(window);
|
|
10334
|
+
const inset = metrics ? chunkSADF35N7_js.computeKeyboardInset(metrics) : 0;
|
|
10420
10335
|
setKeyboardInset(inset);
|
|
10421
10336
|
if (inset > 0) {
|
|
10422
10337
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10427,8 +10342,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10427
10342
|
vv.addEventListener("scroll", update);
|
|
10428
10343
|
const onFocusIn = () => {
|
|
10429
10344
|
window.requestAnimationFrame(() => {
|
|
10430
|
-
const metrics =
|
|
10431
|
-
const inset = metrics ?
|
|
10345
|
+
const metrics = chunkSADF35N7_js.readViewportMetrics(window);
|
|
10346
|
+
const inset = metrics ? chunkSADF35N7_js.computeKeyboardInset(metrics) : 0;
|
|
10432
10347
|
if (inset > 0) {
|
|
10433
10348
|
scrollFocusedIntoView(inset);
|
|
10434
10349
|
}
|
|
@@ -10441,7 +10356,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10441
10356
|
document.removeEventListener("focusin", onFocusIn);
|
|
10442
10357
|
};
|
|
10443
10358
|
}, [enabled]);
|
|
10444
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10359
|
+
return { keyboardInset, isKeyboardOpen: chunkSADF35N7_js.isKeyboardOpen(keyboardInset) };
|
|
10445
10360
|
}
|
|
10446
10361
|
|
|
10447
10362
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10468,7 +10383,7 @@ function buildCanvasProps(input) {
|
|
|
10468
10383
|
} = input;
|
|
10469
10384
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10470
10385
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10471
|
-
const fieldContext =
|
|
10386
|
+
const fieldContext = chunkSADF35N7_js.buildFieldSubstitutionContext({
|
|
10472
10387
|
headerFooter: s.headerFooter,
|
|
10473
10388
|
customProperties: s.customProperties,
|
|
10474
10389
|
slide: activeSlide
|
|
@@ -10478,13 +10393,13 @@ function buildCanvasProps(input) {
|
|
|
10478
10393
|
if (mode === "present") {
|
|
10479
10394
|
presentation.handlePresentationAction(action);
|
|
10480
10395
|
} else if (action.url) {
|
|
10481
|
-
|
|
10396
|
+
chunkSADF35N7_js.safeOpenUrl(action.url);
|
|
10482
10397
|
}
|
|
10483
10398
|
};
|
|
10484
10399
|
const handleHyperlinkClick = (url) => {
|
|
10485
|
-
if (
|
|
10400
|
+
if (chunkSADF35N7_js.isPpactionUrl(url)) {
|
|
10486
10401
|
if (mode === "present") {
|
|
10487
|
-
const parsed =
|
|
10402
|
+
const parsed = chunkSADF35N7_js.parsePpactionUrl(url);
|
|
10488
10403
|
if (parsed) {
|
|
10489
10404
|
presentation.handlePresentationAction({
|
|
10490
10405
|
action: parsed.action,
|
|
@@ -10494,7 +10409,7 @@ function buildCanvasProps(input) {
|
|
|
10494
10409
|
}
|
|
10495
10410
|
return;
|
|
10496
10411
|
}
|
|
10497
|
-
|
|
10412
|
+
chunkSADF35N7_js.safeOpenUrl(url);
|
|
10498
10413
|
};
|
|
10499
10414
|
return {
|
|
10500
10415
|
activeSlide: effectiveSlide,
|
|
@@ -10637,7 +10552,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10637
10552
|
const current = activeSlide.animations ?? [];
|
|
10638
10553
|
if (group === "motionPath") {
|
|
10639
10554
|
propertyHandlers.handleUpdateSlide({
|
|
10640
|
-
animations:
|
|
10555
|
+
animations: chunkSADF35N7_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10641
10556
|
});
|
|
10642
10557
|
return;
|
|
10643
10558
|
}
|
|
@@ -10832,7 +10747,7 @@ function buildToolbarProps(input) {
|
|
|
10832
10747
|
onOpenFile,
|
|
10833
10748
|
onOpenRecentFile,
|
|
10834
10749
|
onCreatePresentation: (templateId) => {
|
|
10835
|
-
s.setSlides(
|
|
10750
|
+
s.setSlides(chunkSADF35N7_js.createBackstagePresentation(templateId));
|
|
10836
10751
|
s.setActiveSlideIndex(0);
|
|
10837
10752
|
s.setSelectedElementId(null);
|
|
10838
10753
|
s.setSelectedElementIds([]);
|
|
@@ -10859,7 +10774,7 @@ function buildToolbarProps(input) {
|
|
|
10859
10774
|
layoutOptions: scopedLayoutOptions,
|
|
10860
10775
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
10861
10776
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
10862
|
-
templateScheme:
|
|
10777
|
+
templateScheme: chunkSADF35N7_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
10863
10778
|
customShows: s.customShows,
|
|
10864
10779
|
activeCustomShowId: s.activeCustomShowId,
|
|
10865
10780
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -10891,7 +10806,7 @@ function buildToolbarProps(input) {
|
|
|
10891
10806
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
10892
10807
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
10893
10808
|
formatPainterActive: s.formatPainterActive,
|
|
10894
|
-
canActivateFormatPainter:
|
|
10809
|
+
canActivateFormatPainter: chunkSADF35N7_js.hasCopyableFormat(selectedElement),
|
|
10895
10810
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
10896
10811
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
10897
10812
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -11160,7 +11075,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11160
11075
|
}, [incomingContent]);
|
|
11161
11076
|
const onOpenFile = react.useCallback(() => {
|
|
11162
11077
|
void (async () => {
|
|
11163
|
-
const picked = await
|
|
11078
|
+
const picked = await chunkSADF35N7_js.openPptxFile();
|
|
11164
11079
|
if (picked) {
|
|
11165
11080
|
setContent(picked.buffer);
|
|
11166
11081
|
}
|
|
@@ -11168,7 +11083,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11168
11083
|
}, []);
|
|
11169
11084
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11170
11085
|
void (async () => {
|
|
11171
|
-
const bytes = await
|
|
11086
|
+
const bytes = await chunkSADF35N7_js.readBackstageRecentFile(key);
|
|
11172
11087
|
if (bytes) {
|
|
11173
11088
|
setContent(bytes);
|
|
11174
11089
|
}
|