pptx-react-viewer 2.20.5 → 2.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/{AiChatPanel-3H5WGSM5.js → AiChatPanel-BD6NR2AU.js} +24 -24
- package/dist/AiChatPanel-BD6NR2AU.js.br +0 -0
- package/dist/AiChatPanel-BD6NR2AU.js.gz +0 -0
- package/dist/{AiChatPanel-AYS6SCSC.mjs → AiChatPanel-XMRQE2GY.mjs} +4 -4
- package/dist/AiChatPanel-XMRQE2GY.mjs.br +0 -0
- package/dist/AiChatPanel-XMRQE2GY.mjs.gz +0 -0
- package/dist/{Model3DScene-QQQEABW7.mjs → Model3DScene-HAJKICLT.mjs} +1 -1
- package/dist/Model3DScene-HAJKICLT.mjs.br +0 -0
- package/dist/Model3DScene-HAJKICLT.mjs.gz +0 -0
- package/dist/{Model3DScene-6OVVKUSF.js → Model3DScene-UXWNLRNQ.js} +2 -2
- package/dist/Model3DScene-UXWNLRNQ.js.br +0 -0
- package/dist/Model3DScene-UXWNLRNQ.js.gz +0 -0
- package/dist/{chunk-2LOKAZHT.js → chunk-3ILDZ7MD.js} +3 -3
- package/dist/chunk-3ILDZ7MD.js.br +0 -0
- package/dist/chunk-3ILDZ7MD.js.gz +0 -0
- package/dist/{chunk-ULBSTLY3.mjs → chunk-5W2W46LY.mjs} +47 -4
- package/dist/chunk-5W2W46LY.mjs.br +0 -0
- package/dist/{chunk-ULBSTLY3.mjs.gz → chunk-5W2W46LY.mjs.gz} +0 -0
- package/dist/{chunk-ZVFTYICH.mjs → chunk-6PRFUWZA.mjs} +7 -10
- package/dist/chunk-6PRFUWZA.mjs.br +0 -0
- package/dist/chunk-6PRFUWZA.mjs.gz +0 -0
- package/dist/{chunk-BQJU7ZG6.js → chunk-F7SX4EUT.js} +49 -5
- package/dist/chunk-F7SX4EUT.js.br +0 -0
- package/dist/{chunk-BQJU7ZG6.js.gz → chunk-F7SX4EUT.js.gz} +0 -0
- package/dist/{chunk-PBFNE5X5.mjs → chunk-GNY4FD3V.mjs} +2 -2
- package/dist/chunk-GNY4FD3V.mjs.br +0 -0
- package/dist/chunk-GNY4FD3V.mjs.gz +0 -0
- package/dist/{chunk-62EM4JYP.js → chunk-HLUJOKES.js} +391 -395
- package/dist/chunk-HLUJOKES.js.br +0 -0
- package/dist/chunk-HLUJOKES.js.gz +0 -0
- package/dist/{chunk-DIJWZ6ZS.mjs → chunk-II5SCD5L.mjs} +1 -1
- package/dist/chunk-II5SCD5L.mjs.br +0 -0
- package/dist/chunk-II5SCD5L.mjs.gz +0 -0
- package/dist/{chunk-MZOZNBRO.mjs → chunk-L5MNLIQF.mjs} +3 -0
- package/dist/chunk-L5MNLIQF.mjs.br +0 -0
- package/dist/chunk-L5MNLIQF.mjs.gz +0 -0
- package/dist/{chunk-ETJBX4YT.js → chunk-SUNSC3Z5.js} +156 -156
- package/dist/chunk-SUNSC3Z5.js.br +0 -0
- package/dist/chunk-SUNSC3Z5.js.gz +0 -0
- package/dist/{chunk-6CPUGAK7.js → chunk-U6A5FWWE.js} +3 -0
- package/dist/chunk-U6A5FWWE.js.br +0 -0
- package/dist/chunk-U6A5FWWE.js.gz +0 -0
- package/dist/{chunk-JYVQ2MTO.js → chunk-W3Y3X4AT.js} +1072 -1098
- package/dist/chunk-W3Y3X4AT.js.br +0 -0
- package/dist/chunk-W3Y3X4AT.js.gz +0 -0
- package/dist/{chunk-BSOTRNVG.mjs → chunk-Y67QVETX.mjs} +34 -60
- package/dist/chunk-Y67QVETX.mjs.br +0 -0
- package/dist/chunk-Y67QVETX.mjs.gz +0 -0
- package/dist/i18n.js +4 -4
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.js +47 -47
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.js +79 -79
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +4 -4
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/viewer/index.js +27 -27
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +6 -6
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-3H5WGSM5.js.br +0 -0
- package/dist/AiChatPanel-3H5WGSM5.js.gz +0 -0
- package/dist/AiChatPanel-AYS6SCSC.mjs.br +0 -0
- package/dist/AiChatPanel-AYS6SCSC.mjs.gz +0 -0
- package/dist/Model3DScene-6OVVKUSF.js.br +0 -0
- package/dist/Model3DScene-6OVVKUSF.js.gz +0 -0
- package/dist/Model3DScene-QQQEABW7.mjs.br +0 -0
- package/dist/Model3DScene-QQQEABW7.mjs.gz +0 -0
- package/dist/chunk-2LOKAZHT.js.br +0 -0
- package/dist/chunk-2LOKAZHT.js.gz +0 -0
- package/dist/chunk-62EM4JYP.js.br +0 -0
- package/dist/chunk-62EM4JYP.js.gz +0 -0
- package/dist/chunk-6CPUGAK7.js.br +0 -0
- package/dist/chunk-6CPUGAK7.js.gz +0 -0
- package/dist/chunk-BQJU7ZG6.js.br +0 -0
- package/dist/chunk-BSOTRNVG.mjs.br +0 -0
- package/dist/chunk-BSOTRNVG.mjs.gz +0 -0
- package/dist/chunk-DIJWZ6ZS.mjs.br +0 -0
- package/dist/chunk-DIJWZ6ZS.mjs.gz +0 -0
- package/dist/chunk-ETJBX4YT.js.br +0 -0
- package/dist/chunk-ETJBX4YT.js.gz +0 -0
- package/dist/chunk-JYVQ2MTO.js.br +0 -0
- package/dist/chunk-JYVQ2MTO.js.gz +0 -0
- package/dist/chunk-MZOZNBRO.mjs.br +0 -0
- package/dist/chunk-MZOZNBRO.mjs.gz +0 -0
- package/dist/chunk-PBFNE5X5.mjs.br +0 -0
- package/dist/chunk-PBFNE5X5.mjs.gz +0 -0
- package/dist/chunk-ULBSTLY3.mjs.br +0 -0
- package/dist/chunk-ZVFTYICH.mjs.br +0 -0
- package/dist/chunk-ZVFTYICH.mjs.gz +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkSUNSC3Z5_js = require('./chunk-SUNSC3Z5.js');
|
|
4
|
+
var chunkU6A5FWWE_js = require('./chunk-U6A5FWWE.js');
|
|
5
|
+
var chunkF7SX4EUT_js = require('./chunk-F7SX4EUT.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 = chunkF7SX4EUT_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 = chunkF7SX4EUT_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 ??= chunkF7SX4EUT_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 >= chunkF7SX4EUT_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
|
+
}, chunkF7SX4EUT_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 = chunkF7SX4EUT_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
|
+
chunkF7SX4EUT_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 = chunkF7SX4EUT_js.validateRoomId(config.roomId);
|
|
249
249
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
250
|
-
departureRef.current =
|
|
250
|
+
departureRef.current = chunkF7SX4EUT_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 = chunkF7SX4EUT_js.validateRoomId(config.roomId);
|
|
293
|
+
const transport = config.transport ?? chunkF7SX4EUT_js.resolveTransportForServerUrl(config.serverUrl);
|
|
294
294
|
if (transport === "webrtc") {
|
|
295
295
|
await initWebrtc();
|
|
296
296
|
return;
|
|
297
297
|
}
|
|
298
|
-
if (
|
|
298
|
+
if (chunkF7SX4EUT_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 = chunkF7SX4EUT_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
|
+
chunkF7SX4EUT_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
|
+
}, chunkF7SX4EUT_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
|
+
chunkF7SX4EUT_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 = chunkF7SX4EUT_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 = chunkF7SX4EUT_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,
|
|
@@ -532,8 +532,8 @@ function useEditorHistory(input) {
|
|
|
532
532
|
width: canvasSize.width,
|
|
533
533
|
height: canvasSize.height,
|
|
534
534
|
activeSlideIndex,
|
|
535
|
-
slides: slides.map(
|
|
536
|
-
templateElementsBySlideId:
|
|
535
|
+
slides: slides.map(chunkF7SX4EUT_js.cloneSlide),
|
|
536
|
+
templateElementsBySlideId: chunkF7SX4EUT_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
537
537
|
...actionLabel ? { actionLabel } : {}
|
|
538
538
|
};
|
|
539
539
|
},
|
|
@@ -546,9 +546,9 @@ function useEditorHistory(input) {
|
|
|
546
546
|
width: snapshot.width,
|
|
547
547
|
height: snapshot.height
|
|
548
548
|
});
|
|
549
|
-
setSlides(snapshot.slides.map(
|
|
549
|
+
setSlides(snapshot.slides.map(chunkF7SX4EUT_js.cloneSlide));
|
|
550
550
|
setTemplateElementsBySlideId(
|
|
551
|
-
|
|
551
|
+
chunkF7SX4EUT_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
552
552
|
);
|
|
553
553
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
554
554
|
setSelectedElementIds([]);
|
|
@@ -587,8 +587,8 @@ function useEditorHistory(input) {
|
|
|
587
587
|
const currentSnapshot = buildHistorySnapshot();
|
|
588
588
|
historyFutureRef.current.push(currentSnapshot);
|
|
589
589
|
isApplyingHistoryRef.current = true;
|
|
590
|
-
const nextSnapshot =
|
|
591
|
-
lastHistorySnapshotRef.current =
|
|
590
|
+
const nextSnapshot = chunkSUNSC3Z5_js.cloneHistorySnapshot(previousSnapshot);
|
|
591
|
+
lastHistorySnapshotRef.current = chunkSUNSC3Z5_js.cloneHistorySnapshot(nextSnapshot);
|
|
592
592
|
lastHistorySerializedRef.current = serializeDocument(nextSnapshot);
|
|
593
593
|
applyHistorySnapshot(nextSnapshot);
|
|
594
594
|
updateHistoryAvailability();
|
|
@@ -609,8 +609,8 @@ function useEditorHistory(input) {
|
|
|
609
609
|
const currentSnapshot = buildHistorySnapshot();
|
|
610
610
|
historyPastRef.current.push(currentSnapshot);
|
|
611
611
|
isApplyingHistoryRef.current = true;
|
|
612
|
-
const targetSnapshot =
|
|
613
|
-
lastHistorySnapshotRef.current =
|
|
612
|
+
const targetSnapshot = chunkSUNSC3Z5_js.cloneHistorySnapshot(nextSnapshot);
|
|
613
|
+
lastHistorySnapshotRef.current = chunkSUNSC3Z5_js.cloneHistorySnapshot(targetSnapshot);
|
|
614
614
|
lastHistorySerializedRef.current = serializeDocument(targetSnapshot);
|
|
615
615
|
applyHistorySnapshot(targetSnapshot);
|
|
616
616
|
updateHistoryAvailability();
|
|
@@ -628,7 +628,7 @@ function useEditorHistory(input) {
|
|
|
628
628
|
historyPastRef.current = [];
|
|
629
629
|
historyFutureRef.current = [];
|
|
630
630
|
if (initialSnapshot) {
|
|
631
|
-
const clonedInitial =
|
|
631
|
+
const clonedInitial = chunkSUNSC3Z5_js.cloneHistorySnapshot(initialSnapshot);
|
|
632
632
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
633
633
|
lastHistorySerializedRef.current = serializeDocument(clonedInitial);
|
|
634
634
|
} else {
|
|
@@ -676,19 +676,19 @@ function useEditorHistory(input) {
|
|
|
676
676
|
}
|
|
677
677
|
const previousSnapshot = lastHistorySnapshotRef.current;
|
|
678
678
|
if (!previousSnapshot) {
|
|
679
|
-
lastHistorySnapshotRef.current =
|
|
679
|
+
lastHistorySnapshotRef.current = chunkSUNSC3Z5_js.cloneHistorySnapshot(snapshot);
|
|
680
680
|
lastHistorySerializedRef.current = serialized;
|
|
681
681
|
lastCheapHashRef.current = cheapHash;
|
|
682
682
|
updateHistoryAvailability();
|
|
683
683
|
return;
|
|
684
684
|
}
|
|
685
685
|
onDirtyRef.current?.();
|
|
686
|
-
historyPastRef.current.push(
|
|
686
|
+
historyPastRef.current.push(chunkSUNSC3Z5_js.cloneHistorySnapshot(previousSnapshot));
|
|
687
687
|
while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
|
|
688
688
|
historyPastRef.current.shift();
|
|
689
689
|
}
|
|
690
690
|
historyFutureRef.current = [];
|
|
691
|
-
lastHistorySnapshotRef.current =
|
|
691
|
+
lastHistorySnapshotRef.current = chunkSUNSC3Z5_js.cloneHistorySnapshot(snapshot);
|
|
692
692
|
lastHistorySerializedRef.current = serialized;
|
|
693
693
|
lastCheapHashRef.current = cheapHash;
|
|
694
694
|
updateHistoryAvailability();
|
|
@@ -748,9 +748,9 @@ function useZoomViewport({
|
|
|
748
748
|
const canvasStageRef = react.useRef(null);
|
|
749
749
|
const canvasViewportRef = react.useRef(null);
|
|
750
750
|
const renderScaleRef = react.useRef(1);
|
|
751
|
-
const wheelBufferRef = react.useRef(
|
|
751
|
+
const wheelBufferRef = react.useRef(chunkF7SX4EUT_js.createWheelStepBuffer());
|
|
752
752
|
const storeRef = react.useRef(null);
|
|
753
|
-
storeRef.current ??=
|
|
753
|
+
storeRef.current ??= chunkF7SX4EUT_js.createViewerZoomStore();
|
|
754
754
|
const store = storeRef.current;
|
|
755
755
|
const scale = useViewerStore(store, selectZoom);
|
|
756
756
|
const setScale = react.useCallback(
|
|
@@ -811,7 +811,7 @@ function useZoomViewport({
|
|
|
811
811
|
if (!wrapper || !canvasViewport) {
|
|
812
812
|
return;
|
|
813
813
|
}
|
|
814
|
-
const boundedScale =
|
|
814
|
+
const boundedScale = chunkF7SX4EUT_js.clampZoomScale(nextScale);
|
|
815
815
|
const nextEditorScale = fitScale * boundedScale;
|
|
816
816
|
const centerX = (bounds.minX + bounds.maxX) / 2;
|
|
817
817
|
const centerY = (bounds.minY + bounds.maxY) / 2;
|
|
@@ -848,29 +848,29 @@ function useZoomViewport({
|
|
|
848
848
|
selectedElements.forEach((element) => {
|
|
849
849
|
minX = Math.min(minX, element.x);
|
|
850
850
|
minY = Math.min(minY, element.y);
|
|
851
|
-
maxX = Math.max(maxX, element.x + Math.max(element.width,
|
|
852
|
-
maxY = Math.max(maxY, element.y + Math.max(element.height,
|
|
851
|
+
maxX = Math.max(maxX, element.x + Math.max(element.width, chunkSUNSC3Z5_js.MIN_ELEMENT_SIZE));
|
|
852
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkSUNSC3Z5_js.MIN_ELEMENT_SIZE));
|
|
853
853
|
});
|
|
854
854
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
855
855
|
return;
|
|
856
856
|
}
|
|
857
857
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
858
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
859
|
-
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY,
|
|
858
|
+
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkSUNSC3Z5_js.MIN_ELEMENT_SIZE);
|
|
859
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkSUNSC3Z5_js.MIN_ELEMENT_SIZE);
|
|
860
860
|
const availableWidth = Math.max(
|
|
861
|
-
effectiveEditorDimensions.width -
|
|
862
|
-
|
|
861
|
+
effectiveEditorDimensions.width - chunkSUNSC3Z5_js.ZOOM_TO_SELECTION_PADDING,
|
|
862
|
+
chunkSUNSC3Z5_js.MIN_ELEMENT_SIZE
|
|
863
863
|
);
|
|
864
864
|
const availableHeight = Math.max(
|
|
865
|
-
effectiveEditorDimensions.height -
|
|
866
|
-
|
|
865
|
+
effectiveEditorDimensions.height - chunkSUNSC3Z5_js.ZOOM_TO_SELECTION_PADDING,
|
|
866
|
+
chunkSUNSC3Z5_js.MIN_ELEMENT_SIZE
|
|
867
867
|
);
|
|
868
868
|
const targetEditorScale = Math.min(
|
|
869
869
|
availableWidth / boundsWidth,
|
|
870
870
|
availableHeight / boundsHeight
|
|
871
871
|
);
|
|
872
872
|
const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
|
|
873
|
-
const nextScale =
|
|
873
|
+
const nextScale = chunkF7SX4EUT_js.clampZoomScale(targetEditorScale / safeFitScale);
|
|
874
874
|
setScale(nextScale);
|
|
875
875
|
window.requestAnimationFrame(() => {
|
|
876
876
|
window.requestAnimationFrame(() => {
|
|
@@ -887,14 +887,14 @@ function useZoomViewport({
|
|
|
887
887
|
]);
|
|
888
888
|
const handleWheel = react.useCallback(
|
|
889
889
|
(event) => {
|
|
890
|
-
const mapped =
|
|
890
|
+
const mapped = chunkF7SX4EUT_js.mapEditingWheel(event, wheelBufferRef.current, true);
|
|
891
891
|
if (mapped.intent !== "zoom") {
|
|
892
892
|
return;
|
|
893
893
|
}
|
|
894
894
|
event.preventDefault();
|
|
895
895
|
store.dispatch({
|
|
896
896
|
type: "set-zoom",
|
|
897
|
-
zoom:
|
|
897
|
+
zoom: chunkF7SX4EUT_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
|
|
898
898
|
});
|
|
899
899
|
},
|
|
900
900
|
[store]
|
|
@@ -982,7 +982,7 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
|
|
|
982
982
|
const command = step.command;
|
|
983
983
|
const timer = window.setTimeout(
|
|
984
984
|
() => {
|
|
985
|
-
|
|
985
|
+
chunkSUNSC3Z5_js.executeMediaCommand(command);
|
|
986
986
|
},
|
|
987
987
|
Math.max(0, step.delayMs)
|
|
988
988
|
);
|
|
@@ -1119,7 +1119,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
|
|
|
1119
1119
|
}))
|
|
1120
1120
|
);
|
|
1121
1121
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1122
|
-
const delay =
|
|
1122
|
+
const delay = chunkF7SX4EUT_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1123
1123
|
const timer = window.setTimeout(() => {
|
|
1124
1124
|
setPresentationAnimations(
|
|
1125
1125
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1151,7 +1151,7 @@ function useAnimationPlayback(input) {
|
|
|
1151
1151
|
(controller, group) => {
|
|
1152
1152
|
driveBuildReveal(
|
|
1153
1153
|
controller,
|
|
1154
|
-
|
|
1154
|
+
chunkF7SX4EUT_js.PresentationAnimationController.collectBuildStepIds(group),
|
|
1155
1155
|
setPresentationElementStates,
|
|
1156
1156
|
buildRafRef
|
|
1157
1157
|
);
|
|
@@ -1220,7 +1220,7 @@ function useAnimationPlayback(input) {
|
|
|
1220
1220
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1221
1221
|
return;
|
|
1222
1222
|
}
|
|
1223
|
-
const controller =
|
|
1223
|
+
const controller = chunkF7SX4EUT_js.PresentationAnimationController.fromSlide(slide);
|
|
1224
1224
|
controllerRef.current = controller;
|
|
1225
1225
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1226
1226
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
@@ -1378,12 +1378,12 @@ function useAnimationPlayback(input) {
|
|
|
1378
1378
|
presentationTimersRef
|
|
1379
1379
|
};
|
|
1380
1380
|
}
|
|
1381
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1382
|
-
var AUDIENCE_HASH =
|
|
1383
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1384
|
-
var AUDIENCE_NONCE_KEY =
|
|
1381
|
+
var PRESENTER_CHANNEL_NAME = chunkF7SX4EUT_js.PRESENTATION_CHANNEL_NAME;
|
|
1382
|
+
var AUDIENCE_HASH = chunkF7SX4EUT_js.PRESENTATION_HASH;
|
|
1383
|
+
var PRESENTER_MSG_ORIGIN = chunkF7SX4EUT_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1384
|
+
var AUDIENCE_NONCE_KEY = chunkF7SX4EUT_js.PRESENTATION_NONCE_KEY;
|
|
1385
1385
|
function generateSessionId() {
|
|
1386
|
-
return
|
|
1386
|
+
return chunkF7SX4EUT_js.createPresentationSessionId();
|
|
1387
1387
|
}
|
|
1388
1388
|
function parseAudienceNonce() {
|
|
1389
1389
|
const hash = window.location.hash;
|
|
@@ -1419,7 +1419,7 @@ function usePresenterWindow(input) {
|
|
|
1419
1419
|
}, []);
|
|
1420
1420
|
const swapDisplays = react.useCallback(async () => {
|
|
1421
1421
|
const audience = audienceWindowRef.current;
|
|
1422
|
-
return audience && !audience.closed ?
|
|
1422
|
+
return audience && !audience.closed ? chunkF7SX4EUT_js.swapPresentationWindows(window, audience) : false;
|
|
1423
1423
|
}, []);
|
|
1424
1424
|
const syncSlideToAudience = react.useCallback(
|
|
1425
1425
|
(slideIndex) => {
|
|
@@ -1483,7 +1483,7 @@ function usePresenterWindow(input) {
|
|
|
1483
1483
|
pollTimerRef.current = null;
|
|
1484
1484
|
}
|
|
1485
1485
|
if (closingSessionId) {
|
|
1486
|
-
void
|
|
1486
|
+
void chunkF7SX4EUT_js.clearAudienceContent(closingSessionId);
|
|
1487
1487
|
}
|
|
1488
1488
|
}, [getChannel]);
|
|
1489
1489
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1501,10 +1501,10 @@ function usePresenterWindow(input) {
|
|
|
1501
1501
|
audienceWindowRef.current = blankWin;
|
|
1502
1502
|
const sessionId = generateSessionId();
|
|
1503
1503
|
sessionIdRef.current = sessionId;
|
|
1504
|
-
const audienceUrl =
|
|
1505
|
-
void
|
|
1504
|
+
const audienceUrl = chunkF7SX4EUT_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1505
|
+
void chunkF7SX4EUT_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1506
1506
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1507
|
-
|
|
1507
|
+
chunkF7SX4EUT_js.placeAudienceWindow(blankWin, placement);
|
|
1508
1508
|
}
|
|
1509
1509
|
return void 0;
|
|
1510
1510
|
});
|
|
@@ -1534,7 +1534,7 @@ function usePresenterWindow(input) {
|
|
|
1534
1534
|
}
|
|
1535
1535
|
};
|
|
1536
1536
|
if (content) {
|
|
1537
|
-
void
|
|
1537
|
+
void chunkF7SX4EUT_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1538
1538
|
} else {
|
|
1539
1539
|
navigateOrClose(true);
|
|
1540
1540
|
}
|
|
@@ -1560,7 +1560,7 @@ function usePresenterWindow(input) {
|
|
|
1560
1560
|
}
|
|
1561
1561
|
const handleMessage = (event) => {
|
|
1562
1562
|
const message = event.data;
|
|
1563
|
-
if (
|
|
1563
|
+
if (chunkF7SX4EUT_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1564
1564
|
syncStateToAudience(snapshotRef.current);
|
|
1565
1565
|
}
|
|
1566
1566
|
};
|
|
@@ -1589,7 +1589,7 @@ function usePresenterWindow(input) {
|
|
|
1589
1589
|
react.useEffect(() => {
|
|
1590
1590
|
const handleBeforeUnload = () => {
|
|
1591
1591
|
if (sessionIdRef.current) {
|
|
1592
|
-
void
|
|
1592
|
+
void chunkF7SX4EUT_js.clearAudienceContent(sessionIdRef.current);
|
|
1593
1593
|
}
|
|
1594
1594
|
};
|
|
1595
1595
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1651,7 +1651,7 @@ function useAudienceMode(input) {
|
|
|
1651
1651
|
}
|
|
1652
1652
|
channel.onmessage = (event) => {
|
|
1653
1653
|
const data = event.data;
|
|
1654
|
-
if (!
|
|
1654
|
+
if (!chunkF7SX4EUT_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1655
1655
|
return;
|
|
1656
1656
|
}
|
|
1657
1657
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1667,16 +1667,16 @@ function useAudienceMode(input) {
|
|
|
1667
1667
|
}
|
|
1668
1668
|
if (data.type === "presenter-exit") {
|
|
1669
1669
|
if (expectedSessionId) {
|
|
1670
|
-
void
|
|
1670
|
+
void chunkF7SX4EUT_js.clearAudienceContent(expectedSessionId);
|
|
1671
1671
|
}
|
|
1672
|
-
if (
|
|
1672
|
+
if (chunkF7SX4EUT_js.endAudienceDisplay(window)) {
|
|
1673
1673
|
handlers.onPresenterEnded?.();
|
|
1674
1674
|
}
|
|
1675
1675
|
}
|
|
1676
1676
|
};
|
|
1677
1677
|
if (expectedSessionId) {
|
|
1678
1678
|
channel.postMessage({
|
|
1679
|
-
origin:
|
|
1679
|
+
origin: chunkF7SX4EUT_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1680
1680
|
type: "audience-ready",
|
|
1681
1681
|
sessionId: expectedSessionId
|
|
1682
1682
|
});
|
|
@@ -1690,7 +1690,7 @@ function useAudienceMode(input) {
|
|
|
1690
1690
|
}, []);
|
|
1691
1691
|
}
|
|
1692
1692
|
function usePresentationKeyboard(input) {
|
|
1693
|
-
const wheelBufferRef = react.useRef(
|
|
1693
|
+
const wheelBufferRef = react.useRef(chunkF7SX4EUT_js.createWheelStepBuffer());
|
|
1694
1694
|
const {
|
|
1695
1695
|
mode,
|
|
1696
1696
|
movePresentationSlide,
|
|
@@ -1711,14 +1711,14 @@ function usePresentationKeyboard(input) {
|
|
|
1711
1711
|
presentationSlideIndex,
|
|
1712
1712
|
setShowRehearsalSummary
|
|
1713
1713
|
} = input;
|
|
1714
|
-
const keyBufferRef = react.useRef(
|
|
1714
|
+
const keyBufferRef = react.useRef(chunkF7SX4EUT_js.createPresentationKeyBuffer());
|
|
1715
1715
|
react.useEffect(() => {
|
|
1716
|
-
if (mode !== "present" || !
|
|
1717
|
-
keyBufferRef.current =
|
|
1716
|
+
if (mode !== "present" || !chunkF7SX4EUT_js.acceptsPresentationInput()) {
|
|
1717
|
+
keyBufferRef.current = chunkF7SX4EUT_js.createPresentationKeyBuffer();
|
|
1718
1718
|
return;
|
|
1719
1719
|
}
|
|
1720
1720
|
const handleKeyDown = (event) => {
|
|
1721
|
-
const mapped =
|
|
1721
|
+
const mapped = chunkF7SX4EUT_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1722
1722
|
if (mapped.action === "none") {
|
|
1723
1723
|
return;
|
|
1724
1724
|
}
|
|
@@ -1738,12 +1738,12 @@ function usePresentationKeyboard(input) {
|
|
|
1738
1738
|
movePresentationSlide(-1);
|
|
1739
1739
|
return;
|
|
1740
1740
|
case "first": {
|
|
1741
|
-
const first =
|
|
1741
|
+
const first = chunkF7SX4EUT_js.firstShowSlideIndex(showSlideIndexes);
|
|
1742
1742
|
navigateToSlide(first ?? 0);
|
|
1743
1743
|
return;
|
|
1744
1744
|
}
|
|
1745
1745
|
case "last": {
|
|
1746
|
-
const last =
|
|
1746
|
+
const last = chunkF7SX4EUT_js.lastShowSlideIndex(showSlideIndexes);
|
|
1747
1747
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1748
1748
|
return;
|
|
1749
1749
|
}
|
|
@@ -1781,10 +1781,10 @@ function usePresentationKeyboard(input) {
|
|
|
1781
1781
|
}
|
|
1782
1782
|
};
|
|
1783
1783
|
const handleWheel = (event) => {
|
|
1784
|
-
if (mode !== "present" || !
|
|
1784
|
+
if (mode !== "present" || !chunkF7SX4EUT_js.acceptsPresentationInput()) {
|
|
1785
1785
|
return;
|
|
1786
1786
|
}
|
|
1787
|
-
const mapped =
|
|
1787
|
+
const mapped = chunkF7SX4EUT_js.mapPresentationWheel(event, wheelBufferRef.current);
|
|
1788
1788
|
if (mapped.intent === "next-slide") {
|
|
1789
1789
|
event.preventDefault();
|
|
1790
1790
|
movePresentationSlide(1);
|
|
@@ -1917,7 +1917,7 @@ function useRehearsalTimings(input) {
|
|
|
1917
1917
|
|
|
1918
1918
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1919
1919
|
function handlePresentationActionImpl(action, deps) {
|
|
1920
|
-
|
|
1920
|
+
chunkF7SX4EUT_js.runPresentationAction(
|
|
1921
1921
|
action,
|
|
1922
1922
|
{ slideCount: deps.slidesLength },
|
|
1923
1923
|
{
|
|
@@ -1939,7 +1939,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1939
1939
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1940
1940
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1941
1941
|
const transition = incomingSlide?.transition;
|
|
1942
|
-
const durationMs = deps.playTransition ?
|
|
1942
|
+
const durationMs = deps.playTransition ? chunkF7SX4EUT_js.resolveTransitionDurationMs(transition) : 0;
|
|
1943
1943
|
deps.clearPresentationTimers();
|
|
1944
1944
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1945
1945
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -1998,7 +1998,7 @@ function useSlideNavigation(input) {
|
|
|
1998
1998
|
});
|
|
1999
1999
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
2000
2000
|
(slideIndex) => {
|
|
2001
|
-
const delayMs =
|
|
2001
|
+
const delayMs = chunkF7SX4EUT_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
2002
2002
|
if (delayMs === void 0) {
|
|
2003
2003
|
return;
|
|
2004
2004
|
}
|
|
@@ -2021,7 +2021,7 @@ function useSlideNavigation(input) {
|
|
|
2021
2021
|
if (availableSlideIndexes.length === 0) {
|
|
2022
2022
|
return;
|
|
2023
2023
|
}
|
|
2024
|
-
const pastLastSlide = direction === 1 && !
|
|
2024
|
+
const pastLastSlide = direction === 1 && !chunkF7SX4EUT_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
2025
2025
|
if (rehearsing && pastLastSlide) {
|
|
2026
2026
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
2027
2027
|
try {
|
|
@@ -2039,9 +2039,9 @@ function useSlideNavigation(input) {
|
|
|
2039
2039
|
onAdvancePastLastSlide();
|
|
2040
2040
|
return;
|
|
2041
2041
|
}
|
|
2042
|
-
const nextSlideIndex = direction === 1 ?
|
|
2042
|
+
const nextSlideIndex = direction === 1 ? chunkF7SX4EUT_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
2043
2043
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
2044
|
-
}) :
|
|
2044
|
+
}) : chunkF7SX4EUT_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
2045
2045
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
2046
2046
|
return;
|
|
2047
2047
|
}
|
|
@@ -2186,22 +2186,22 @@ function useZoomNavigation(input) {
|
|
|
2186
2186
|
};
|
|
2187
2187
|
}
|
|
2188
2188
|
function usePresenterConsole(slideIndex, active) {
|
|
2189
|
-
const timerRef = react.useRef(
|
|
2190
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2189
|
+
const timerRef = react.useRef(chunkF7SX4EUT_js.createPresenterTimer());
|
|
2190
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkF7SX4EUT_js.createInitialPresentationSnapshot(slideIndex));
|
|
2191
2191
|
const patch = react.useCallback((value) => {
|
|
2192
|
-
setSnapshot((current) =>
|
|
2192
|
+
setSnapshot((current) => chunkF7SX4EUT_js.mergePresentationSnapshot(current, value));
|
|
2193
2193
|
}, []);
|
|
2194
2194
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2195
2195
|
react.useEffect(() => {
|
|
2196
2196
|
if (!active) {
|
|
2197
2197
|
return;
|
|
2198
2198
|
}
|
|
2199
|
-
timerRef.current =
|
|
2199
|
+
timerRef.current = chunkF7SX4EUT_js.resetPresenterTimer();
|
|
2200
2200
|
patch({ paused: false, elapsedMs: 0 });
|
|
2201
2201
|
const timer = window.setInterval(() => {
|
|
2202
2202
|
patch({
|
|
2203
2203
|
paused: timerRef.current.paused,
|
|
2204
|
-
elapsedMs:
|
|
2204
|
+
elapsedMs: chunkF7SX4EUT_js.presenterElapsed(timerRef.current)
|
|
2205
2205
|
});
|
|
2206
2206
|
}, 1e3);
|
|
2207
2207
|
return () => window.clearInterval(timer);
|
|
@@ -2211,19 +2211,19 @@ function usePresenterConsole(slideIndex, active) {
|
|
|
2211
2211
|
applyAudienceSnapshot: setSnapshot,
|
|
2212
2212
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2213
2213
|
toggleTimer: () => {
|
|
2214
|
-
timerRef.current =
|
|
2214
|
+
timerRef.current = chunkF7SX4EUT_js.togglePresenterTimer(timerRef.current);
|
|
2215
2215
|
patch({
|
|
2216
2216
|
paused: timerRef.current.paused,
|
|
2217
|
-
elapsedMs:
|
|
2217
|
+
elapsedMs: chunkF7SX4EUT_js.presenterElapsed(timerRef.current)
|
|
2218
2218
|
});
|
|
2219
2219
|
},
|
|
2220
2220
|
resetTimer: () => {
|
|
2221
|
-
timerRef.current =
|
|
2221
|
+
timerRef.current = chunkF7SX4EUT_js.resetPresenterTimer();
|
|
2222
2222
|
patch({ paused: false, elapsedMs: 0 });
|
|
2223
2223
|
},
|
|
2224
2224
|
stepZoom: (direction) => setSnapshot(
|
|
2225
|
-
(current) =>
|
|
2226
|
-
zoom:
|
|
2225
|
+
(current) => chunkF7SX4EUT_js.mergePresentationSnapshot(current, {
|
|
2226
|
+
zoom: chunkF7SX4EUT_js.stepPresenterZoom(
|
|
2227
2227
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2228
2228
|
direction
|
|
2229
2229
|
)
|
|
@@ -2269,7 +2269,7 @@ function usePresentationMode(input) {
|
|
|
2269
2269
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2270
2270
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2271
2271
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2272
|
-
const showGuard = react.useMemo(() =>
|
|
2272
|
+
const showGuard = react.useMemo(() => chunkF7SX4EUT_js.createPresenterShowGuard(), []);
|
|
2273
2273
|
const {
|
|
2274
2274
|
presentationAnimations,
|
|
2275
2275
|
presentationElementStates,
|
|
@@ -2348,7 +2348,7 @@ function usePresentationMode(input) {
|
|
|
2348
2348
|
});
|
|
2349
2349
|
const movePresentationSlide = react.useCallback(
|
|
2350
2350
|
(direction, trigger = "explicit") => {
|
|
2351
|
-
if (!
|
|
2351
|
+
if (!chunkF7SX4EUT_js.acceptsPresentationInput()) {
|
|
2352
2352
|
return;
|
|
2353
2353
|
}
|
|
2354
2354
|
if (endOfShowVisible) {
|
|
@@ -2486,7 +2486,7 @@ function usePresentationMode(input) {
|
|
|
2486
2486
|
if (mode !== "present") {
|
|
2487
2487
|
return;
|
|
2488
2488
|
}
|
|
2489
|
-
return
|
|
2489
|
+
return chunkF7SX4EUT_js.attachPresentationVisibilityPause({
|
|
2490
2490
|
root: containerRef.current ?? void 0,
|
|
2491
2491
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2492
2492
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
@@ -2566,11 +2566,11 @@ function usePresentationMode(input) {
|
|
|
2566
2566
|
if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
|
|
2567
2567
|
return void 0;
|
|
2568
2568
|
}
|
|
2569
|
-
return
|
|
2569
|
+
return chunkF7SX4EUT_js.buildMorphTransitionPlan(
|
|
2570
2570
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2571
2571
|
slides[transitionOverlay.incomingSlideIndex],
|
|
2572
2572
|
transitionOverlay.durationMs,
|
|
2573
|
-
|
|
2573
|
+
chunkF7SX4EUT_js.morphOptionToMode(transitionOverlay.transition.morphOption)
|
|
2574
2574
|
);
|
|
2575
2575
|
}, [transitionOverlay, slides]);
|
|
2576
2576
|
const morphedElementStates = react.useMemo(() => {
|
|
@@ -2591,7 +2591,7 @@ function usePresentationMode(input) {
|
|
|
2591
2591
|
if (!morphPlan) {
|
|
2592
2592
|
return presentationKeyframesCss;
|
|
2593
2593
|
}
|
|
2594
|
-
const imageRules =
|
|
2594
|
+
const imageRules = chunkF7SX4EUT_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
|
|
2595
2595
|
return `${presentationKeyframesCss ?? ""}
|
|
2596
2596
|
${morphPlan.keyframesCss}
|
|
2597
2597
|
${imageRules}`;
|
|
@@ -2887,7 +2887,7 @@ function useFindReplace({
|
|
|
2887
2887
|
const [findResults, setFindResults] = react.useState([]);
|
|
2888
2888
|
const [findResultIndex, setFindResultIndex] = react.useState(-1);
|
|
2889
2889
|
const performFind = react.useCallback(() => {
|
|
2890
|
-
const results =
|
|
2890
|
+
const results = chunkF7SX4EUT_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
|
|
2891
2891
|
if (!findQuery) {
|
|
2892
2892
|
setFindResults([]);
|
|
2893
2893
|
setFindResultIndex(-1);
|
|
@@ -2921,7 +2921,7 @@ function useFindReplace({
|
|
|
2921
2921
|
return;
|
|
2922
2922
|
}
|
|
2923
2923
|
onUpdateSlides(
|
|
2924
|
-
(prevSlides) =>
|
|
2924
|
+
(prevSlides) => chunkF7SX4EUT_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
|
|
2925
2925
|
);
|
|
2926
2926
|
onMarkDirty();
|
|
2927
2927
|
},
|
|
@@ -2943,9 +2943,9 @@ function useFindReplace({
|
|
|
2943
2943
|
}, [findResults, applyReplacements, performFind]);
|
|
2944
2944
|
react.useEffect(() => {
|
|
2945
2945
|
const handler = (event) => {
|
|
2946
|
-
const { action } =
|
|
2946
|
+
const { action } = chunkF7SX4EUT_js.mapEditorKey(event, {
|
|
2947
2947
|
canEdit: mode === "edit",
|
|
2948
|
-
isTextInputTarget:
|
|
2948
|
+
isTextInputTarget: chunkF7SX4EUT_js.isEditorTextInputTarget(event.target)
|
|
2949
2949
|
});
|
|
2950
2950
|
if (action !== "find") {
|
|
2951
2951
|
return;
|
|
@@ -3024,7 +3024,7 @@ function addCommentToSlide(slides, slideIndex, text, authorName, elementId) {
|
|
|
3024
3024
|
if (!slide) {
|
|
3025
3025
|
return { slides, didAdd: false };
|
|
3026
3026
|
}
|
|
3027
|
-
const next =
|
|
3027
|
+
const next = chunkF7SX4EUT_js.addCommentToList(
|
|
3028
3028
|
slide.comments || [],
|
|
3029
3029
|
text,
|
|
3030
3030
|
authorName,
|
|
@@ -3042,7 +3042,7 @@ function removeCommentFromSlide(slides, slideIndex, commentId) {
|
|
|
3042
3042
|
if (!slide) {
|
|
3043
3043
|
return { slides, didDelete: false };
|
|
3044
3044
|
}
|
|
3045
|
-
const next =
|
|
3045
|
+
const next = chunkF7SX4EUT_js.removeCommentFromList(slide.comments || [], commentId);
|
|
3046
3046
|
if (!next) {
|
|
3047
3047
|
return { slides, didDelete: false };
|
|
3048
3048
|
}
|
|
@@ -3053,7 +3053,7 @@ function editCommentInSlide(slides, slideIndex, commentId, newText) {
|
|
|
3053
3053
|
if (!slide) {
|
|
3054
3054
|
return { slides, didUpdate: false };
|
|
3055
3055
|
}
|
|
3056
|
-
const next =
|
|
3056
|
+
const next = chunkF7SX4EUT_js.editCommentInList(slide.comments || [], commentId, newText);
|
|
3057
3057
|
if (!next) {
|
|
3058
3058
|
return { slides, didUpdate: false };
|
|
3059
3059
|
}
|
|
@@ -3064,7 +3064,7 @@ function toggleResolvedInSlide(slides, slideIndex, commentId) {
|
|
|
3064
3064
|
if (!slide) {
|
|
3065
3065
|
return { slides, didUpdate: false };
|
|
3066
3066
|
}
|
|
3067
|
-
const next =
|
|
3067
|
+
const next = chunkF7SX4EUT_js.toggleCommentResolvedInList(slide.comments || [], commentId);
|
|
3068
3068
|
if (!next) {
|
|
3069
3069
|
return { slides, didUpdate: false };
|
|
3070
3070
|
}
|
|
@@ -3075,7 +3075,7 @@ function addReplyToSlide(slides, slideIndex, parentId, text, authorName) {
|
|
|
3075
3075
|
if (!slide) {
|
|
3076
3076
|
return { slides, didAdd: false };
|
|
3077
3077
|
}
|
|
3078
|
-
const next =
|
|
3078
|
+
const next = chunkF7SX4EUT_js.replyToCommentInList(slide.comments || [], parentId, text, authorName);
|
|
3079
3079
|
if (!next) {
|
|
3080
3080
|
return { slides, didAdd: false };
|
|
3081
3081
|
}
|
|
@@ -3449,7 +3449,7 @@ function useViewerCoreState(_input) {
|
|
|
3449
3449
|
const marqueeStateRef = react.useRef(null);
|
|
3450
3450
|
const isDrawingRef = react.useRef(false);
|
|
3451
3451
|
const justInteractedRef = react.useRef(false);
|
|
3452
|
-
const livePatcher = react.useMemo(() =>
|
|
3452
|
+
const livePatcher = react.useMemo(() => chunkF7SX4EUT_js.createCollaborationLivePatcher(), []);
|
|
3453
3453
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3454
3454
|
const slidesRef = react.useRef([]);
|
|
3455
3455
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3458,8 +3458,8 @@ function useViewerCoreState(_input) {
|
|
|
3458
3458
|
const [slides, setSlides] = react.useState([]);
|
|
3459
3459
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3460
3460
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3461
|
-
width:
|
|
3462
|
-
height:
|
|
3461
|
+
width: chunkSUNSC3Z5_js.DEFAULT_CANVAS_WIDTH,
|
|
3462
|
+
height: chunkSUNSC3Z5_js.DEFAULT_CANVAS_HEIGHT
|
|
3463
3463
|
});
|
|
3464
3464
|
const [slideSizeEmu, setSlideSizeEmu] = react.useState();
|
|
3465
3465
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
@@ -3480,7 +3480,7 @@ function useViewerCoreState(_input) {
|
|
|
3480
3480
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3481
3481
|
inlineEditingTextRef.current = resolved;
|
|
3482
3482
|
setInlineEditingTextBase(value);
|
|
3483
|
-
|
|
3483
|
+
chunkF7SX4EUT_js.publishLiveInlineText(
|
|
3484
3484
|
livePatcher,
|
|
3485
3485
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3486
3486
|
inlineEditingElementIdRef.current,
|
|
@@ -3819,7 +3819,7 @@ function useLoadContent({
|
|
|
3819
3819
|
);
|
|
3820
3820
|
}
|
|
3821
3821
|
const previousHandler = handlerRef.current;
|
|
3822
|
-
const handler = new
|
|
3822
|
+
const handler = new chunkF7SX4EUT_js.PptxHandler();
|
|
3823
3823
|
const parsed = await handler.load(buffer);
|
|
3824
3824
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3825
3825
|
handler.dispose();
|
|
@@ -3831,7 +3831,7 @@ function useLoadContent({
|
|
|
3831
3831
|
handlerRef.current = null;
|
|
3832
3832
|
const mediaElements = [];
|
|
3833
3833
|
for (const slide of parsed.slides) {
|
|
3834
|
-
|
|
3834
|
+
chunkF7SX4EUT_js.collectMediaElements(slide.elements, mediaElements);
|
|
3835
3835
|
}
|
|
3836
3836
|
for (const url of mediaDataUrls.values()) {
|
|
3837
3837
|
if (url.startsWith("blob:")) {
|
|
@@ -3872,7 +3872,7 @@ function useLoadContent({
|
|
|
3872
3872
|
}
|
|
3873
3873
|
})
|
|
3874
3874
|
);
|
|
3875
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3875
|
+
const { paths: imagePaths, refs: imageRefs } = chunkF7SX4EUT_js.collectImagePaths(parsed.slides);
|
|
3876
3876
|
let nextSlides = parsed.slides;
|
|
3877
3877
|
if (imagePaths.size > 0) {
|
|
3878
3878
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3927,12 +3927,12 @@ function useLoadContent({
|
|
|
3927
3927
|
}
|
|
3928
3928
|
}
|
|
3929
3929
|
handlerRef.current = handler;
|
|
3930
|
-
const partition =
|
|
3930
|
+
const partition = chunkF7SX4EUT_js.partitionTemplateElements(nextSlides);
|
|
3931
3931
|
setSlides(partition.slides);
|
|
3932
3932
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
3933
3933
|
setCanvasSize({
|
|
3934
|
-
width: parsed.width ??
|
|
3935
|
-
height: parsed.height ??
|
|
3934
|
+
width: parsed.width ?? chunkSUNSC3Z5_js.DEFAULT_CANVAS_WIDTH,
|
|
3935
|
+
height: parsed.height ?? chunkSUNSC3Z5_js.DEFAULT_CANVAS_HEIGHT
|
|
3936
3936
|
});
|
|
3937
3937
|
setSlideSizeEmu(
|
|
3938
3938
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -3949,7 +3949,7 @@ function useLoadContent({
|
|
|
3949
3949
|
setThemeOptions(parsed.themeOptions ?? []);
|
|
3950
3950
|
setCustomShows(parsed.customShows ?? []);
|
|
3951
3951
|
setActiveCustomShowId(
|
|
3952
|
-
|
|
3952
|
+
chunkF7SX4EUT_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
|
|
3953
3953
|
);
|
|
3954
3954
|
setSections(parsed.sections ?? []);
|
|
3955
3955
|
setPresentationProperties(parsed.presentationProperties ?? {});
|
|
@@ -3971,7 +3971,7 @@ function useLoadContent({
|
|
|
3971
3971
|
setHasMacros(parsed.hasMacros === true);
|
|
3972
3972
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
3973
3973
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
3974
|
-
setGuides(
|
|
3974
|
+
setGuides(chunkF7SX4EUT_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
3975
3975
|
setActiveSlideIndex(0);
|
|
3976
3976
|
clearSelection();
|
|
3977
3977
|
setIsDirty(false);
|
|
@@ -3979,7 +3979,7 @@ function useLoadContent({
|
|
|
3979
3979
|
onContentApplied?.();
|
|
3980
3980
|
} catch (err) {
|
|
3981
3981
|
if (!cancelled && token === renderTokenRef.current) {
|
|
3982
|
-
if (err instanceof
|
|
3982
|
+
if (err instanceof chunkF7SX4EUT_js.EncryptedFileError) {
|
|
3983
3983
|
setIsEncrypted(true);
|
|
3984
3984
|
} else {
|
|
3985
3985
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -4006,7 +4006,7 @@ function useLoadContent({
|
|
|
4006
4006
|
}
|
|
4007
4007
|
function useAutosave(input) {
|
|
4008
4008
|
const { isDirty, filePath, serializeSlides, enabled = true, getChangeSources } = input;
|
|
4009
|
-
const intervalMs =
|
|
4009
|
+
const intervalMs = chunkF7SX4EUT_js.resolveAutosaveIntervalMs({
|
|
4010
4010
|
hostIntervalMs: input.intervalMs,
|
|
4011
4011
|
optionsIntervalSeconds: input.intervalSeconds
|
|
4012
4012
|
});
|
|
@@ -4037,7 +4037,7 @@ function useAutosave(input) {
|
|
|
4037
4037
|
return;
|
|
4038
4038
|
}
|
|
4039
4039
|
const sources = changeSourcesRef.current?.() ?? [];
|
|
4040
|
-
if (!
|
|
4040
|
+
if (!chunkF7SX4EUT_js.shouldWriteAutosaveSnapshot({
|
|
4041
4041
|
filePath: path,
|
|
4042
4042
|
isDirty: isDirtyRef.current,
|
|
4043
4043
|
saving: isSavingRef.current,
|
|
@@ -4055,8 +4055,8 @@ function useAutosave(input) {
|
|
|
4055
4055
|
isSavingRef.current = false;
|
|
4056
4056
|
return;
|
|
4057
4057
|
}
|
|
4058
|
-
await
|
|
4059
|
-
lastSnapshotRef.current =
|
|
4058
|
+
await chunkF7SX4EUT_js.saveAutosaveSnapshot(path, data);
|
|
4059
|
+
lastSnapshotRef.current = chunkF7SX4EUT_js.autosaveSnapshotMark(path, sources);
|
|
4060
4060
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4061
4061
|
} catch (err) {
|
|
4062
4062
|
setAutosaveStatus({
|
|
@@ -4142,11 +4142,11 @@ function useElementOperations(input) {
|
|
|
4142
4142
|
(elementId, updates) => {
|
|
4143
4143
|
if (masterView?.target) {
|
|
4144
4144
|
applyMasterViewWrite(
|
|
4145
|
-
|
|
4145
|
+
chunkF7SX4EUT_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
|
|
4146
4146
|
);
|
|
4147
4147
|
return;
|
|
4148
4148
|
}
|
|
4149
|
-
if (
|
|
4149
|
+
if (chunkF7SX4EUT_js.isTemplateElementId(elementId)) {
|
|
4150
4150
|
const slideId = activeSlide?.id;
|
|
4151
4151
|
if (slideId) {
|
|
4152
4152
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4194,7 +4194,7 @@ function useElementOperations(input) {
|
|
|
4194
4194
|
);
|
|
4195
4195
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4196
4196
|
(updates) => {
|
|
4197
|
-
if (!selectedElement || !
|
|
4197
|
+
if (!selectedElement || !chunkF7SX4EUT_js.hasShapeProperties(selectedElement)) {
|
|
4198
4198
|
return;
|
|
4199
4199
|
}
|
|
4200
4200
|
updateSelectedElement({
|
|
@@ -4205,17 +4205,17 @@ function useElementOperations(input) {
|
|
|
4205
4205
|
);
|
|
4206
4206
|
const updateSelectedTextStyle = react.useCallback(
|
|
4207
4207
|
(updates) => {
|
|
4208
|
-
if (!selectedElement || !
|
|
4208
|
+
if (!selectedElement || !chunkF7SX4EUT_js.hasTextProperties(selectedElement)) {
|
|
4209
4209
|
return;
|
|
4210
4210
|
}
|
|
4211
|
-
const inlineSel =
|
|
4211
|
+
const inlineSel = chunkF7SX4EUT_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4212
4212
|
if (inlineSel && selectedElement.textSegments) {
|
|
4213
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4213
|
+
const { newSegments: newSegments2, newSelection } = chunkF7SX4EUT_js.applyStyleToSelectedSegments(
|
|
4214
4214
|
selectedElement.textSegments,
|
|
4215
4215
|
inlineSel,
|
|
4216
4216
|
updates
|
|
4217
4217
|
);
|
|
4218
|
-
|
|
4218
|
+
chunkF7SX4EUT_js.setPendingSelectionRestore(newSelection);
|
|
4219
4219
|
updateSelectedElement({
|
|
4220
4220
|
textSegments: newSegments2
|
|
4221
4221
|
});
|
|
@@ -4235,12 +4235,12 @@ function useElementOperations(input) {
|
|
|
4235
4235
|
);
|
|
4236
4236
|
const updateSelectedTextCase = react.useCallback(
|
|
4237
4237
|
(mode) => {
|
|
4238
|
-
if (!selectedElement || !
|
|
4238
|
+
if (!selectedElement || !chunkF7SX4EUT_js.hasTextProperties(selectedElement)) {
|
|
4239
4239
|
return;
|
|
4240
4240
|
}
|
|
4241
|
-
const inlineSel =
|
|
4241
|
+
const inlineSel = chunkF7SX4EUT_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4242
4242
|
if (inlineSel && selectedElement.textSegments) {
|
|
4243
|
-
const newSegments =
|
|
4243
|
+
const newSegments = chunkF7SX4EUT_js.applyCaseTransformToSegments(
|
|
4244
4244
|
selectedElement.textSegments,
|
|
4245
4245
|
inlineSel,
|
|
4246
4246
|
mode
|
|
@@ -4250,14 +4250,14 @@ function useElementOperations(input) {
|
|
|
4250
4250
|
}
|
|
4251
4251
|
const updates = {};
|
|
4252
4252
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
4253
|
-
updates.textSegments =
|
|
4253
|
+
updates.textSegments = chunkF7SX4EUT_js.applyCaseTransformToSegments(
|
|
4254
4254
|
selectedElement.textSegments,
|
|
4255
4255
|
null,
|
|
4256
4256
|
mode
|
|
4257
4257
|
);
|
|
4258
4258
|
}
|
|
4259
4259
|
if (typeof selectedElement.text === "string") {
|
|
4260
|
-
updates.text =
|
|
4260
|
+
updates.text = chunkF7SX4EUT_js.transformTextCase(selectedElement.text, mode);
|
|
4261
4261
|
}
|
|
4262
4262
|
updateSelectedElement(updates);
|
|
4263
4263
|
},
|
|
@@ -4270,15 +4270,15 @@ function useElementOperations(input) {
|
|
|
4270
4270
|
[setSlides]
|
|
4271
4271
|
);
|
|
4272
4272
|
const masterViewTarget = masterView?.target ?? null;
|
|
4273
|
-
const activeElements = masterViewTarget ?
|
|
4273
|
+
const activeElements = masterViewTarget ? chunkF7SX4EUT_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4274
4274
|
const updateActiveElements = react.useCallback(
|
|
4275
4275
|
(updater) => {
|
|
4276
4276
|
if (masterView?.target) {
|
|
4277
4277
|
applyMasterViewWrite(
|
|
4278
|
-
|
|
4278
|
+
chunkF7SX4EUT_js.replaceMasterViewElements(
|
|
4279
4279
|
masterView,
|
|
4280
4280
|
masterView.target,
|
|
4281
|
-
updater(
|
|
4281
|
+
updater(chunkF7SX4EUT_js.masterViewElements(masterView, masterView.target))
|
|
4282
4282
|
)
|
|
4283
4283
|
);
|
|
4284
4284
|
return;
|
|
@@ -4331,7 +4331,7 @@ function useSectionOperations(input) {
|
|
|
4331
4331
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4332
4332
|
const addSection2 = react.useCallback(
|
|
4333
4333
|
(name, afterSlideIndex) => {
|
|
4334
|
-
const result =
|
|
4334
|
+
const result = chunkF7SX4EUT_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4335
4335
|
setSlides(result.slides);
|
|
4336
4336
|
setSections(result.sections);
|
|
4337
4337
|
markDirty();
|
|
@@ -4340,7 +4340,7 @@ function useSectionOperations(input) {
|
|
|
4340
4340
|
);
|
|
4341
4341
|
const renameSection2 = react.useCallback(
|
|
4342
4342
|
(sectionId, newName) => {
|
|
4343
|
-
const result =
|
|
4343
|
+
const result = chunkF7SX4EUT_js.renameSection(sections, slides, sectionId, newName);
|
|
4344
4344
|
setSections(result.sections);
|
|
4345
4345
|
setSlides(result.slides);
|
|
4346
4346
|
markDirty();
|
|
@@ -4349,7 +4349,7 @@ function useSectionOperations(input) {
|
|
|
4349
4349
|
);
|
|
4350
4350
|
const deleteSection2 = react.useCallback(
|
|
4351
4351
|
(sectionId) => {
|
|
4352
|
-
const result =
|
|
4352
|
+
const result = chunkF7SX4EUT_js.deleteSection(sections, slides, sectionId);
|
|
4353
4353
|
setSections(result.sections);
|
|
4354
4354
|
setSlides(result.slides);
|
|
4355
4355
|
markDirty();
|
|
@@ -4358,21 +4358,21 @@ function useSectionOperations(input) {
|
|
|
4358
4358
|
);
|
|
4359
4359
|
const moveSectionUp2 = react.useCallback(
|
|
4360
4360
|
(sectionId) => {
|
|
4361
|
-
setSections(
|
|
4361
|
+
setSections(chunkF7SX4EUT_js.moveSectionUp(sections, sectionId));
|
|
4362
4362
|
markDirty();
|
|
4363
4363
|
},
|
|
4364
4364
|
[sections, setSections, markDirty]
|
|
4365
4365
|
);
|
|
4366
4366
|
const moveSectionDown2 = react.useCallback(
|
|
4367
4367
|
(sectionId) => {
|
|
4368
|
-
setSections(
|
|
4368
|
+
setSections(chunkF7SX4EUT_js.moveSectionDown(sections, sectionId));
|
|
4369
4369
|
markDirty();
|
|
4370
4370
|
},
|
|
4371
4371
|
[sections, setSections, markDirty]
|
|
4372
4372
|
);
|
|
4373
4373
|
const moveSlidesToSection2 = react.useCallback(
|
|
4374
4374
|
(slideIndexes, targetSectionId) => {
|
|
4375
|
-
const result =
|
|
4375
|
+
const result = chunkF7SX4EUT_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4376
4376
|
setSlides(result.slides);
|
|
4377
4377
|
setSections(result.sections);
|
|
4378
4378
|
markDirty();
|
|
@@ -4401,19 +4401,19 @@ function useSectionOperations(input) {
|
|
|
4401
4401
|
|
|
4402
4402
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4403
4403
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
4404
|
-
const resized =
|
|
4404
|
+
const resized = chunkF7SX4EUT_js.applyResize(
|
|
4405
4405
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
4406
4406
|
handle,
|
|
4407
4407
|
dx,
|
|
4408
4408
|
dy,
|
|
4409
4409
|
1,
|
|
4410
|
-
{ minSize:
|
|
4410
|
+
{ minSize: chunkSUNSC3Z5_js.MIN_ELEMENT_SIZE }
|
|
4411
4411
|
);
|
|
4412
4412
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4413
4413
|
if (!snapToGrid) {
|
|
4414
4414
|
return box;
|
|
4415
4415
|
}
|
|
4416
|
-
return
|
|
4416
|
+
return chunkF7SX4EUT_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkSUNSC3Z5_js.MIN_ELEMENT_SIZE);
|
|
4417
4417
|
}
|
|
4418
4418
|
function resolveLiveTarget(input) {
|
|
4419
4419
|
const { livePatcher, editTemplateMode, activeSlide } = input;
|
|
@@ -4526,7 +4526,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4526
4526
|
width: el.width,
|
|
4527
4527
|
height: el.height
|
|
4528
4528
|
}));
|
|
4529
|
-
const snapResult =
|
|
4529
|
+
const snapResult = chunkF7SX4EUT_js.computeSnapToShape(
|
|
4530
4530
|
targetX,
|
|
4531
4531
|
targetY,
|
|
4532
4532
|
primaryEl.width,
|
|
@@ -4565,7 +4565,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4565
4565
|
if (live) {
|
|
4566
4566
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4567
4567
|
const start = drag.startPositionsById[id];
|
|
4568
|
-
|
|
4568
|
+
chunkF7SX4EUT_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4569
4569
|
x: start.x + appliedDx,
|
|
4570
4570
|
y: start.y + appliedDy
|
|
4571
4571
|
});
|
|
@@ -4599,22 +4599,22 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4599
4599
|
if (rs.domEl) {
|
|
4600
4600
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4601
4601
|
rs.domEl.style.top = `${geo.y}px`;
|
|
4602
|
-
rs.domEl.style.width = `${Math.max(geo.width,
|
|
4603
|
-
rs.domEl.style.height = `${Math.max(geo.height,
|
|
4602
|
+
rs.domEl.style.width = `${Math.max(geo.width, chunkSUNSC3Z5_js.MIN_ELEMENT_SIZE)}px`;
|
|
4603
|
+
rs.domEl.style.height = `${Math.max(geo.height, chunkSUNSC3Z5_js.MIN_ELEMENT_SIZE)}px`;
|
|
4604
4604
|
}
|
|
4605
4605
|
if (live) {
|
|
4606
|
-
|
|
4606
|
+
chunkF7SX4EUT_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4607
4607
|
x: geo.x,
|
|
4608
4608
|
y: geo.y,
|
|
4609
|
-
width: Math.max(geo.width,
|
|
4610
|
-
height: Math.max(geo.height,
|
|
4609
|
+
width: Math.max(geo.width, chunkSUNSC3Z5_js.MIN_ELEMENT_SIZE),
|
|
4610
|
+
height: Math.max(geo.height, chunkSUNSC3Z5_js.MIN_ELEMENT_SIZE)
|
|
4611
4611
|
});
|
|
4612
4612
|
}
|
|
4613
4613
|
}
|
|
4614
4614
|
function processAdjustmentMove(e, adj, editorScale, updateElementById) {
|
|
4615
4615
|
const dx = (e.clientX - adj.startClientX) / editorScale;
|
|
4616
4616
|
const dy = (e.clientY - adj.startClientY) / editorScale;
|
|
4617
|
-
const adjustments =
|
|
4617
|
+
const adjustments = chunkF7SX4EUT_js.getDraggedShapeAdjustments(adj, dx, dy);
|
|
4618
4618
|
if (!adj.moved && Math.hypot(dx, dy) > 2) {
|
|
4619
4619
|
adj.moved = true;
|
|
4620
4620
|
}
|
|
@@ -4689,13 +4689,13 @@ function processPointerUp(input) {
|
|
|
4689
4689
|
if (i !== activeSlideIndex) {
|
|
4690
4690
|
return s;
|
|
4691
4691
|
}
|
|
4692
|
-
const rerouted =
|
|
4692
|
+
const rerouted = chunkF7SX4EUT_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4693
4693
|
if (rerouted.length === 0) {
|
|
4694
4694
|
return s;
|
|
4695
4695
|
}
|
|
4696
4696
|
return {
|
|
4697
4697
|
...s,
|
|
4698
|
-
elements:
|
|
4698
|
+
elements: chunkF7SX4EUT_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4699
4699
|
};
|
|
4700
4700
|
})
|
|
4701
4701
|
);
|
|
@@ -4720,9 +4720,9 @@ function processPointerUp(input) {
|
|
|
4720
4720
|
}
|
|
4721
4721
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4722
4722
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4723
|
-
const hitIds =
|
|
4723
|
+
const hitIds = chunkF7SX4EUT_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4724
4724
|
if (marquee.additive) {
|
|
4725
|
-
const merged =
|
|
4725
|
+
const merged = chunkF7SX4EUT_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4726
4726
|
if (merged.length > 0) {
|
|
4727
4727
|
applySelection(merged[0], merged);
|
|
4728
4728
|
} else {
|
|
@@ -4745,8 +4745,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4745
4745
|
}
|
|
4746
4746
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4747
4747
|
});
|
|
4748
|
-
const rerouted =
|
|
4749
|
-
return
|
|
4748
|
+
const rerouted = chunkF7SX4EUT_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4749
|
+
return chunkF7SX4EUT_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4750
4750
|
};
|
|
4751
4751
|
if (editTemplateMode) {
|
|
4752
4752
|
const slideId = activeSlide?.id;
|
|
@@ -4903,9 +4903,9 @@ function useCanvasInteractions(input) {
|
|
|
4903
4903
|
return;
|
|
4904
4904
|
}
|
|
4905
4905
|
const el = elementLookup.get(editId);
|
|
4906
|
-
if (el &&
|
|
4906
|
+
if (el && chunkF7SX4EUT_js.hasTextProperties(el)) {
|
|
4907
4907
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
4908
|
-
const newSegments =
|
|
4908
|
+
const newSegments = chunkF7SX4EUT_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
4909
4909
|
ops.updateElementById(editId, {
|
|
4910
4910
|
text: committedText,
|
|
4911
4911
|
textSegments: newSegments
|
|
@@ -4916,7 +4916,7 @@ function useCanvasInteractions(input) {
|
|
|
4916
4916
|
setInlineEditingText("");
|
|
4917
4917
|
};
|
|
4918
4918
|
const openEquationEditorForElement = (el) => {
|
|
4919
|
-
if (!
|
|
4919
|
+
if (!chunkF7SX4EUT_js.hasTextProperties(el)) {
|
|
4920
4920
|
return false;
|
|
4921
4921
|
}
|
|
4922
4922
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -4946,7 +4946,7 @@ function useCanvasInteractions(input) {
|
|
|
4946
4946
|
justInteractedRef.current = false;
|
|
4947
4947
|
} else {
|
|
4948
4948
|
const el = elementLookup.get(elementId);
|
|
4949
|
-
if (el &&
|
|
4949
|
+
if (el && chunkF7SX4EUT_js.hasTextProperties(el) && chunkF7SX4EUT_js.canInteractWithElement(el, "textEdit")) {
|
|
4950
4950
|
if (!openEquationEditorForElement(el)) {
|
|
4951
4951
|
setInlineEditingElementId(elementId);
|
|
4952
4952
|
setInlineEditingText(el.text ?? "");
|
|
@@ -4965,7 +4965,7 @@ function useCanvasInteractions(input) {
|
|
|
4965
4965
|
if (openEquationEditorForElement(el)) {
|
|
4966
4966
|
return;
|
|
4967
4967
|
}
|
|
4968
|
-
if (
|
|
4968
|
+
if (chunkF7SX4EUT_js.hasTextProperties(el) && chunkF7SX4EUT_js.canInteractWithElement(el, "textEdit")) {
|
|
4969
4969
|
setInlineEditingElementId(elementId);
|
|
4970
4970
|
setInlineEditingText(el.text ?? "");
|
|
4971
4971
|
}
|
|
@@ -4988,7 +4988,7 @@ function useCanvasInteractions(input) {
|
|
|
4988
4988
|
justSelectedRef.current = false;
|
|
4989
4989
|
}
|
|
4990
4990
|
const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
|
|
4991
|
-
const movableIds =
|
|
4991
|
+
const movableIds = chunkF7SX4EUT_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
|
|
4992
4992
|
if (movableIds.length === 0) {
|
|
4993
4993
|
return;
|
|
4994
4994
|
}
|
|
@@ -5058,7 +5058,7 @@ function useCanvasInteractions(input) {
|
|
|
5058
5058
|
const handleResizePointerDown = (elementId, e, handle) => {
|
|
5059
5059
|
e.stopPropagation();
|
|
5060
5060
|
const el = elementLookup.get(elementId);
|
|
5061
|
-
if (!el || !
|
|
5061
|
+
if (!el || !chunkF7SX4EUT_js.canInteractWithElement(el, "resize")) {
|
|
5062
5062
|
return;
|
|
5063
5063
|
}
|
|
5064
5064
|
resizeStateRef.current = {
|
|
@@ -5080,7 +5080,7 @@ function useCanvasInteractions(input) {
|
|
|
5080
5080
|
};
|
|
5081
5081
|
const handleRotate = (elementId, rotationDeg) => {
|
|
5082
5082
|
const el = elementLookup.get(elementId);
|
|
5083
|
-
if (!el || !
|
|
5083
|
+
if (!el || !chunkF7SX4EUT_js.canInteractWithElement(el, "rotate")) {
|
|
5084
5084
|
return;
|
|
5085
5085
|
}
|
|
5086
5086
|
ops.updateElementById(elementId, { rotation: rotationDeg });
|
|
@@ -5100,10 +5100,10 @@ function useCanvasInteractions(input) {
|
|
|
5100
5100
|
const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
|
|
5101
5101
|
e.stopPropagation();
|
|
5102
5102
|
const el = elementLookup.get(elementId);
|
|
5103
|
-
if (!el || !
|
|
5103
|
+
if (!el || !chunkF7SX4EUT_js.canInteractWithElement(el, "adjustHandle")) {
|
|
5104
5104
|
return;
|
|
5105
5105
|
}
|
|
5106
|
-
shapeAdjustmentDragStateRef.current =
|
|
5106
|
+
shapeAdjustmentDragStateRef.current = chunkF7SX4EUT_js.beginShapeAdjustment(
|
|
5107
5107
|
el,
|
|
5108
5108
|
descriptor,
|
|
5109
5109
|
e.clientX,
|
|
@@ -5150,7 +5150,7 @@ function createFileHandlers(deps) {
|
|
|
5150
5150
|
h = Math.round(h * scale);
|
|
5151
5151
|
}
|
|
5152
5152
|
addElement({
|
|
5153
|
-
id:
|
|
5153
|
+
id: chunkF7SX4EUT_js.generateElementId(),
|
|
5154
5154
|
type: "image",
|
|
5155
5155
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5156
5156
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5161,7 +5161,7 @@ function createFileHandlers(deps) {
|
|
|
5161
5161
|
};
|
|
5162
5162
|
img.onerror = () => {
|
|
5163
5163
|
addElement({
|
|
5164
|
-
id:
|
|
5164
|
+
id: chunkF7SX4EUT_js.generateElementId(),
|
|
5165
5165
|
type: "image",
|
|
5166
5166
|
x: 100,
|
|
5167
5167
|
y: 100,
|
|
@@ -5180,14 +5180,14 @@ function createFileHandlers(deps) {
|
|
|
5180
5180
|
return;
|
|
5181
5181
|
}
|
|
5182
5182
|
e.target.value = "";
|
|
5183
|
-
const mediaType =
|
|
5183
|
+
const mediaType = chunkF7SX4EUT_js.classifyMediaType(file.type);
|
|
5184
5184
|
if (!mediaType) {
|
|
5185
5185
|
return;
|
|
5186
5186
|
}
|
|
5187
5187
|
const elFilePath = file.path;
|
|
5188
5188
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5189
5189
|
addElement({
|
|
5190
|
-
id:
|
|
5190
|
+
id: chunkF7SX4EUT_js.generateElementId(),
|
|
5191
5191
|
type: "media",
|
|
5192
5192
|
mediaType,
|
|
5193
5193
|
mediaMimeType: file.type || void 0,
|
|
@@ -5362,13 +5362,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5362
5362
|
return;
|
|
5363
5363
|
}
|
|
5364
5364
|
addElement({
|
|
5365
|
-
id:
|
|
5365
|
+
id: chunkF7SX4EUT_js.generateElementId(),
|
|
5366
5366
|
type: "smartArt",
|
|
5367
5367
|
x: 100,
|
|
5368
5368
|
y: 120,
|
|
5369
5369
|
width: 600,
|
|
5370
5370
|
height: 340,
|
|
5371
|
-
smartArtData:
|
|
5371
|
+
smartArtData: chunkF7SX4EUT_js.buildSmartArtPresetData(
|
|
5372
5372
|
layout,
|
|
5373
5373
|
defaultItems,
|
|
5374
5374
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5380,7 +5380,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5380
5380
|
return;
|
|
5381
5381
|
}
|
|
5382
5382
|
addElement({
|
|
5383
|
-
id:
|
|
5383
|
+
id: chunkF7SX4EUT_js.generateElementId(),
|
|
5384
5384
|
type: "shape",
|
|
5385
5385
|
x: 120,
|
|
5386
5386
|
y: 200,
|
|
@@ -5418,7 +5418,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5418
5418
|
return;
|
|
5419
5419
|
}
|
|
5420
5420
|
const resolved = resolveHyperlinkEditResult(data);
|
|
5421
|
-
if (resolved.url && !
|
|
5421
|
+
if (resolved.url && !chunkF7SX4EUT_js.isUrlSafe(resolved.url)) {
|
|
5422
5422
|
return;
|
|
5423
5423
|
}
|
|
5424
5424
|
const actionClick = {
|
|
@@ -5442,7 +5442,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5442
5442
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5443
5443
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5444
5444
|
addElement({
|
|
5445
|
-
id:
|
|
5445
|
+
id: chunkF7SX4EUT_js.generateElementId(),
|
|
5446
5446
|
type: "shape",
|
|
5447
5447
|
x: 120,
|
|
5448
5448
|
y: 200,
|
|
@@ -5464,11 +5464,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5464
5464
|
if (!activeSlide) {
|
|
5465
5465
|
return;
|
|
5466
5466
|
}
|
|
5467
|
-
const preset =
|
|
5467
|
+
const preset = chunkF7SX4EUT_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5468
5468
|
if (!preset) {
|
|
5469
5469
|
return;
|
|
5470
5470
|
}
|
|
5471
|
-
const defaultPptxAction =
|
|
5471
|
+
const defaultPptxAction = chunkF7SX4EUT_js.elementActionToPptxAction({
|
|
5472
5472
|
trigger: "click",
|
|
5473
5473
|
type: preset.defaultAction
|
|
5474
5474
|
});
|
|
@@ -5477,7 +5477,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5477
5477
|
defaultPptxAction.highlightClick = true;
|
|
5478
5478
|
}
|
|
5479
5479
|
addElement({
|
|
5480
|
-
id:
|
|
5480
|
+
id: chunkF7SX4EUT_js.generateElementId(),
|
|
5481
5481
|
type: "shape",
|
|
5482
5482
|
x: 150,
|
|
5483
5483
|
y: 150,
|
|
@@ -5544,14 +5544,14 @@ function useInsertElements(input) {
|
|
|
5544
5544
|
return;
|
|
5545
5545
|
}
|
|
5546
5546
|
addElement({
|
|
5547
|
-
id:
|
|
5547
|
+
id: chunkF7SX4EUT_js.generateElementId(),
|
|
5548
5548
|
type: "text",
|
|
5549
5549
|
x: 100,
|
|
5550
5550
|
y: 100,
|
|
5551
5551
|
width: 300,
|
|
5552
5552
|
height: 60,
|
|
5553
5553
|
text: "",
|
|
5554
|
-
textStyle: { fontSize:
|
|
5554
|
+
textStyle: { fontSize: chunkSUNSC3Z5_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5555
5555
|
});
|
|
5556
5556
|
};
|
|
5557
5557
|
const handleAddShape = () => {
|
|
@@ -5559,7 +5559,7 @@ function useInsertElements(input) {
|
|
|
5559
5559
|
return;
|
|
5560
5560
|
}
|
|
5561
5561
|
addElement({
|
|
5562
|
-
id:
|
|
5562
|
+
id: chunkF7SX4EUT_js.generateElementId(),
|
|
5563
5563
|
type: "shape",
|
|
5564
5564
|
x: 150,
|
|
5565
5565
|
y: 150,
|
|
@@ -5578,15 +5578,15 @@ function useInsertElements(input) {
|
|
|
5578
5578
|
return;
|
|
5579
5579
|
}
|
|
5580
5580
|
addElement({
|
|
5581
|
-
...
|
|
5582
|
-
id:
|
|
5581
|
+
...chunkF7SX4EUT_js.newTableElement(chunkSUNSC3Z5_js.DEFAULT_TABLE_ROWS, chunkSUNSC3Z5_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5582
|
+
id: chunkF7SX4EUT_js.generateElementId()
|
|
5583
5583
|
});
|
|
5584
5584
|
};
|
|
5585
5585
|
const handleAddChart = (chartKind) => {
|
|
5586
5586
|
if (!activeSlide) {
|
|
5587
5587
|
return;
|
|
5588
5588
|
}
|
|
5589
|
-
addElement(
|
|
5589
|
+
addElement(chunkF7SX4EUT_js.createDefaultChartElement(chartKind));
|
|
5590
5590
|
};
|
|
5591
5591
|
const structured = createStructuredElementHandlers({
|
|
5592
5592
|
activeSlide,
|
|
@@ -5656,7 +5656,7 @@ function useClipboardHandlers(input) {
|
|
|
5656
5656
|
if (!selectedElement) {
|
|
5657
5657
|
return;
|
|
5658
5658
|
}
|
|
5659
|
-
setClipboardPayload(
|
|
5659
|
+
setClipboardPayload(chunkF7SX4EUT_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5660
5660
|
};
|
|
5661
5661
|
const handleDelete = () => {
|
|
5662
5662
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5673,7 +5673,7 @@ function useClipboardHandlers(input) {
|
|
|
5673
5673
|
handleDelete();
|
|
5674
5674
|
};
|
|
5675
5675
|
const insertClone = (source) => {
|
|
5676
|
-
const clone =
|
|
5676
|
+
const clone = chunkF7SX4EUT_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5677
5677
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5678
5678
|
ops.applySelection(clone.id);
|
|
5679
5679
|
history.markDirty();
|
|
@@ -5708,7 +5708,7 @@ function resolveShapePath(el) {
|
|
|
5708
5708
|
return el.pathData;
|
|
5709
5709
|
}
|
|
5710
5710
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5711
|
-
const clipPath =
|
|
5711
|
+
const clipPath = chunkF7SX4EUT_js.getPresetShapeClipPath(el.shapeType);
|
|
5712
5712
|
if (clipPath) {
|
|
5713
5713
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5714
5714
|
if (svgPath) {
|
|
@@ -5759,7 +5759,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5759
5759
|
return parts.join(" ");
|
|
5760
5760
|
}
|
|
5761
5761
|
function transformPathToGlobal(pathData, el) {
|
|
5762
|
-
const polys =
|
|
5762
|
+
const polys = chunkF7SX4EUT_js.svgPathToPolygons(pathData);
|
|
5763
5763
|
if (polys.length === 0) {
|
|
5764
5764
|
return pathData;
|
|
5765
5765
|
}
|
|
@@ -5779,10 +5779,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5779
5779
|
y: pt.y * scaleY + el.y
|
|
5780
5780
|
}))
|
|
5781
5781
|
);
|
|
5782
|
-
return
|
|
5782
|
+
return chunkF7SX4EUT_js.polygonsToSvgPath(transformed);
|
|
5783
5783
|
}
|
|
5784
5784
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5785
|
-
const polys =
|
|
5785
|
+
const polys = chunkF7SX4EUT_js.svgPathToPolygons(pathData);
|
|
5786
5786
|
if (polys.length === 0) {
|
|
5787
5787
|
return pathData;
|
|
5788
5788
|
}
|
|
@@ -5792,10 +5792,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5792
5792
|
y: pt.y - y
|
|
5793
5793
|
}))
|
|
5794
5794
|
);
|
|
5795
|
-
return
|
|
5795
|
+
return chunkF7SX4EUT_js.polygonsToSvgPath(transformed);
|
|
5796
5796
|
}
|
|
5797
5797
|
function pathBounds(pathData) {
|
|
5798
|
-
const polys =
|
|
5798
|
+
const polys = chunkF7SX4EUT_js.svgPathToPolygons(pathData);
|
|
5799
5799
|
let minX = Infinity;
|
|
5800
5800
|
let minY = Infinity;
|
|
5801
5801
|
let maxX = -Infinity;
|
|
@@ -5854,7 +5854,7 @@ function useMergeShapesHandler(input) {
|
|
|
5854
5854
|
let allFragments = [];
|
|
5855
5855
|
let remaining = globalPaths[0];
|
|
5856
5856
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5857
|
-
const frags =
|
|
5857
|
+
const frags = chunkF7SX4EUT_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
5858
5858
|
if (Array.isArray(frags)) {
|
|
5859
5859
|
allFragments = frags;
|
|
5860
5860
|
}
|
|
@@ -5883,7 +5883,7 @@ function useMergeShapesHandler(input) {
|
|
|
5883
5883
|
bounds.height
|
|
5884
5884
|
);
|
|
5885
5885
|
const newEl = {
|
|
5886
|
-
id:
|
|
5886
|
+
id: chunkF7SX4EUT_js.generateElementId(),
|
|
5887
5887
|
type: "shape",
|
|
5888
5888
|
x: bounds.x,
|
|
5889
5889
|
y: bounds.y,
|
|
@@ -5921,7 +5921,7 @@ function useMergeShapesHandler(input) {
|
|
|
5921
5921
|
} else {
|
|
5922
5922
|
let resultPath = globalPaths[0];
|
|
5923
5923
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5924
|
-
const result =
|
|
5924
|
+
const result = chunkF7SX4EUT_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
5925
5925
|
if (typeof result === "string") {
|
|
5926
5926
|
resultPath = result;
|
|
5927
5927
|
}
|
|
@@ -5942,7 +5942,7 @@ function useMergeShapesHandler(input) {
|
|
|
5942
5942
|
);
|
|
5943
5943
|
const primary = targets[0];
|
|
5944
5944
|
const newEl = {
|
|
5945
|
-
id:
|
|
5945
|
+
id: chunkF7SX4EUT_js.generateElementId(),
|
|
5946
5946
|
type: "shape",
|
|
5947
5947
|
x: bounds.x,
|
|
5948
5948
|
y: bounds.y,
|
|
@@ -6005,7 +6005,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6005
6005
|
if (ids.length < 2 || !activeSlide) {
|
|
6006
6006
|
return;
|
|
6007
6007
|
}
|
|
6008
|
-
const { elements, groupId } =
|
|
6008
|
+
const { elements, groupId } = chunkF7SX4EUT_js.groupElements(ops.activeElements, ids, chunkF7SX4EUT_js.generateElementId());
|
|
6009
6009
|
if (groupId === null) {
|
|
6010
6010
|
return;
|
|
6011
6011
|
}
|
|
@@ -6018,11 +6018,11 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6018
6018
|
return;
|
|
6019
6019
|
}
|
|
6020
6020
|
const group = selectedElement;
|
|
6021
|
-
const intoTemplate =
|
|
6021
|
+
const intoTemplate = chunkF7SX4EUT_js.isTemplateElementId(group.id);
|
|
6022
6022
|
const childIds = group.children.map(
|
|
6023
|
-
(child) => intoTemplate ?
|
|
6023
|
+
(child) => intoTemplate ? chunkF7SX4EUT_js.makeCloneId(true, child.id || group.id) : child.id || chunkF7SX4EUT_js.generateElementId()
|
|
6024
6024
|
);
|
|
6025
|
-
const { elements, childIds: usedIds } =
|
|
6025
|
+
const { elements, childIds: usedIds } = chunkF7SX4EUT_js.ungroupElements(
|
|
6026
6026
|
ops.activeElements,
|
|
6027
6027
|
group.id,
|
|
6028
6028
|
childIds,
|
|
@@ -6051,7 +6051,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6051
6051
|
if (!edge) {
|
|
6052
6052
|
return;
|
|
6053
6053
|
}
|
|
6054
|
-
const positions =
|
|
6054
|
+
const positions = chunkF7SX4EUT_js.alignElements(selectedElements, edge);
|
|
6055
6055
|
for (const [id, pos] of positions) {
|
|
6056
6056
|
const el = elementLookup.get(id);
|
|
6057
6057
|
if (!el) {
|
|
@@ -6069,7 +6069,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6069
6069
|
if (!distAxis) {
|
|
6070
6070
|
return;
|
|
6071
6071
|
}
|
|
6072
|
-
const positions =
|
|
6072
|
+
const positions = chunkF7SX4EUT_js.distributeElements(selectedElements, distAxis);
|
|
6073
6073
|
for (const [id, pos] of positions) {
|
|
6074
6074
|
const el = elementLookup.get(id);
|
|
6075
6075
|
if (!el) {
|
|
@@ -6086,7 +6086,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6086
6086
|
}
|
|
6087
6087
|
const id = selectedElement.id;
|
|
6088
6088
|
ops.updateActiveElements(
|
|
6089
|
-
(els) => direction === "forward" ?
|
|
6089
|
+
(els) => direction === "forward" ? chunkF7SX4EUT_js.bringForward(els, id) : direction === "backward" ? chunkF7SX4EUT_js.sendBackward(els, id) : els
|
|
6090
6090
|
);
|
|
6091
6091
|
history.markDirty();
|
|
6092
6092
|
};
|
|
@@ -6096,7 +6096,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6096
6096
|
}
|
|
6097
6097
|
const id = selectedElement.id;
|
|
6098
6098
|
ops.updateActiveElements(
|
|
6099
|
-
(els) => direction === "front" ?
|
|
6099
|
+
(els) => direction === "front" ? chunkF7SX4EUT_js.bringToFront(els, id) : chunkF7SX4EUT_js.sendToBack(els, id)
|
|
6100
6100
|
);
|
|
6101
6101
|
history.markDirty();
|
|
6102
6102
|
};
|
|
@@ -6227,7 +6227,7 @@ function useSlideManagement(input) {
|
|
|
6227
6227
|
theme
|
|
6228
6228
|
} = input;
|
|
6229
6229
|
const handleAddSlide = () => {
|
|
6230
|
-
const newSlide =
|
|
6230
|
+
const newSlide = chunkF7SX4EUT_js.createBlankSlide(slides.length + 1);
|
|
6231
6231
|
ops.updateSlides((prev) => {
|
|
6232
6232
|
const next = [...prev];
|
|
6233
6233
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6290,7 +6290,7 @@ function useSlideManagement(input) {
|
|
|
6290
6290
|
}
|
|
6291
6291
|
const clone = {
|
|
6292
6292
|
...src,
|
|
6293
|
-
id:
|
|
6293
|
+
id: chunkF7SX4EUT_js.makeSlideId(),
|
|
6294
6294
|
elements: src.elements.map((el) => ({
|
|
6295
6295
|
...el,
|
|
6296
6296
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6322,7 +6322,7 @@ function useSlideManagement(input) {
|
|
|
6322
6322
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6323
6323
|
const insertAt = activeSlideIndex + 1;
|
|
6324
6324
|
const draft = {
|
|
6325
|
-
...
|
|
6325
|
+
...chunkF7SX4EUT_js.createBlankSlide(slides.length + 1),
|
|
6326
6326
|
layoutPath,
|
|
6327
6327
|
...layoutName ? { layoutName } : {}
|
|
6328
6328
|
};
|
|
@@ -6355,9 +6355,9 @@ function useSlideManagement(input) {
|
|
|
6355
6355
|
};
|
|
6356
6356
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6357
6357
|
const insertAt = activeSlideIndex + 1;
|
|
6358
|
-
const draft =
|
|
6358
|
+
const draft = chunkF7SX4EUT_js.buildSlideTemplateSlide(templateId, chunkF7SX4EUT_js.makeSlideId(), slides.length + 1, {
|
|
6359
6359
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6360
|
-
scheme:
|
|
6360
|
+
scheme: chunkF7SX4EUT_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6361
6361
|
});
|
|
6362
6362
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6363
6363
|
setActiveSlideIndex(insertAt);
|
|
@@ -6394,7 +6394,7 @@ function createTableMergeHandlers(input) {
|
|
|
6394
6394
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6395
6395
|
return;
|
|
6396
6396
|
}
|
|
6397
|
-
const newTableData =
|
|
6397
|
+
const newTableData = chunkF7SX4EUT_js.mergeCells(
|
|
6398
6398
|
[
|
|
6399
6399
|
{ row: rowIndex, col: columnIndex },
|
|
6400
6400
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6402,7 +6402,7 @@ function createTableMergeHandlers(input) {
|
|
|
6402
6402
|
td
|
|
6403
6403
|
);
|
|
6404
6404
|
const updates = { tableData: newTableData };
|
|
6405
|
-
const newRawXml =
|
|
6405
|
+
const newRawXml = chunkF7SX4EUT_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6406
6406
|
if (newRawXml) {
|
|
6407
6407
|
updates.rawXml = newRawXml;
|
|
6408
6408
|
}
|
|
@@ -6428,7 +6428,7 @@ function createTableMergeHandlers(input) {
|
|
|
6428
6428
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6429
6429
|
return;
|
|
6430
6430
|
}
|
|
6431
|
-
const newTableData =
|
|
6431
|
+
const newTableData = chunkF7SX4EUT_js.mergeCells(
|
|
6432
6432
|
[
|
|
6433
6433
|
{ row: rowIndex, col: columnIndex },
|
|
6434
6434
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6436,7 +6436,7 @@ function createTableMergeHandlers(input) {
|
|
|
6436
6436
|
td
|
|
6437
6437
|
);
|
|
6438
6438
|
const updates = { tableData: newTableData };
|
|
6439
|
-
const newRawXml =
|
|
6439
|
+
const newRawXml = chunkF7SX4EUT_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6440
6440
|
if (newRawXml) {
|
|
6441
6441
|
updates.rawXml = newRawXml;
|
|
6442
6442
|
}
|
|
@@ -6451,9 +6451,9 @@ function createTableMergeHandlers(input) {
|
|
|
6451
6451
|
return;
|
|
6452
6452
|
}
|
|
6453
6453
|
const td = selectedElement.tableData;
|
|
6454
|
-
const newTableData =
|
|
6454
|
+
const newTableData = chunkF7SX4EUT_js.mergeCells(ts.selectedCells, td);
|
|
6455
6455
|
const updates = { tableData: newTableData };
|
|
6456
|
-
const newRawXml =
|
|
6456
|
+
const newRawXml = chunkF7SX4EUT_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6457
6457
|
if (newRawXml) {
|
|
6458
6458
|
updates.rawXml = newRawXml;
|
|
6459
6459
|
}
|
|
@@ -6470,9 +6470,9 @@ function createTableMergeHandlers(input) {
|
|
|
6470
6470
|
}
|
|
6471
6471
|
const { rowIndex, columnIndex } = ts;
|
|
6472
6472
|
const td = selectedElement.tableData;
|
|
6473
|
-
const newTableData =
|
|
6473
|
+
const newTableData = chunkF7SX4EUT_js.splitCell(rowIndex, columnIndex, td);
|
|
6474
6474
|
const updates = { tableData: newTableData };
|
|
6475
|
-
const newRawXml =
|
|
6475
|
+
const newRawXml = chunkF7SX4EUT_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6476
6476
|
if (newRawXml) {
|
|
6477
6477
|
updates.rawXml = newRawXml;
|
|
6478
6478
|
}
|
|
@@ -6504,10 +6504,10 @@ function createTableStructHandlers(input) {
|
|
|
6504
6504
|
}
|
|
6505
6505
|
const updates = {};
|
|
6506
6506
|
if (el.tableData) {
|
|
6507
|
-
updates.tableData =
|
|
6507
|
+
updates.tableData = chunkF7SX4EUT_js.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
6508
6508
|
}
|
|
6509
6509
|
if (el.rawXml) {
|
|
6510
|
-
const newRawXml =
|
|
6510
|
+
const newRawXml = chunkF7SX4EUT_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6511
6511
|
if (newRawXml) {
|
|
6512
6512
|
updates.rawXml = newRawXml;
|
|
6513
6513
|
}
|
|
@@ -6531,7 +6531,7 @@ function createTableStructHandlers(input) {
|
|
|
6531
6531
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6532
6532
|
const updates = {};
|
|
6533
6533
|
if (selectedElement.rawXml) {
|
|
6534
|
-
const newRawXml =
|
|
6534
|
+
const newRawXml = chunkF7SX4EUT_js.updateCellTextStyleInRawXml(
|
|
6535
6535
|
selectedElement,
|
|
6536
6536
|
rowIndex,
|
|
6537
6537
|
colIndex,
|
|
@@ -6595,9 +6595,9 @@ function createTableStructHandlers(input) {
|
|
|
6595
6595
|
return;
|
|
6596
6596
|
}
|
|
6597
6597
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6598
|
-
const newTableData =
|
|
6598
|
+
const newTableData = chunkF7SX4EUT_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6599
6599
|
const updates = { tableData: newTableData };
|
|
6600
|
-
const newRawXml =
|
|
6600
|
+
const newRawXml = chunkF7SX4EUT_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6601
6601
|
if (newRawXml) {
|
|
6602
6602
|
updates.rawXml = newRawXml;
|
|
6603
6603
|
}
|
|
@@ -6610,12 +6610,12 @@ function createTableStructHandlers(input) {
|
|
|
6610
6610
|
}
|
|
6611
6611
|
const td = selectedElement.tableData;
|
|
6612
6612
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6613
|
-
const newTableData =
|
|
6613
|
+
const newTableData = chunkF7SX4EUT_js.deleteTableRow(td, rowIdx);
|
|
6614
6614
|
if (newTableData === td) {
|
|
6615
6615
|
return;
|
|
6616
6616
|
}
|
|
6617
6617
|
const updates = { tableData: newTableData };
|
|
6618
|
-
const newRawXml =
|
|
6618
|
+
const newRawXml = chunkF7SX4EUT_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6619
6619
|
if (newRawXml) {
|
|
6620
6620
|
updates.rawXml = newRawXml;
|
|
6621
6621
|
}
|
|
@@ -6627,9 +6627,9 @@ function createTableStructHandlers(input) {
|
|
|
6627
6627
|
return;
|
|
6628
6628
|
}
|
|
6629
6629
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6630
|
-
const newTableData =
|
|
6630
|
+
const newTableData = chunkF7SX4EUT_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6631
6631
|
const updates = { tableData: newTableData };
|
|
6632
|
-
const newRawXml =
|
|
6632
|
+
const newRawXml = chunkF7SX4EUT_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6633
6633
|
if (newRawXml) {
|
|
6634
6634
|
updates.rawXml = newRawXml;
|
|
6635
6635
|
}
|
|
@@ -6642,12 +6642,12 @@ function createTableStructHandlers(input) {
|
|
|
6642
6642
|
}
|
|
6643
6643
|
const td = selectedElement.tableData;
|
|
6644
6644
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6645
|
-
const newTableData =
|
|
6645
|
+
const newTableData = chunkF7SX4EUT_js.deleteTableColumn(td, colIdx);
|
|
6646
6646
|
if (newTableData === td) {
|
|
6647
6647
|
return;
|
|
6648
6648
|
}
|
|
6649
6649
|
const updates = { tableData: newTableData };
|
|
6650
|
-
const newRawXml =
|
|
6650
|
+
const newRawXml = chunkF7SX4EUT_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6651
6651
|
if (newRawXml) {
|
|
6652
6652
|
updates.rawXml = newRawXml;
|
|
6653
6653
|
}
|
|
@@ -6683,8 +6683,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6683
6683
|
return html2canvasPro(element, {
|
|
6684
6684
|
...options,
|
|
6685
6685
|
onclone: async (doc, clonedEl) => {
|
|
6686
|
-
await
|
|
6687
|
-
|
|
6686
|
+
await chunkF7SX4EUT_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6687
|
+
chunkF7SX4EUT_js.preprocessCssForCapture(clonedEl);
|
|
6688
6688
|
if (typeof userOnClone === "function") {
|
|
6689
6689
|
userOnClone(doc, clonedEl);
|
|
6690
6690
|
}
|
|
@@ -6740,7 +6740,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
6740
6740
|
}
|
|
6741
6741
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
6742
6742
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
6743
|
-
|
|
6743
|
+
chunkF7SX4EUT_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
6744
6744
|
}
|
|
6745
6745
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
6746
6746
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -6762,15 +6762,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6762
6762
|
continue;
|
|
6763
6763
|
}
|
|
6764
6764
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
6765
|
-
images.push(
|
|
6765
|
+
images.push(chunkF7SX4EUT_js.canvasToJpegData(canvas));
|
|
6766
6766
|
}
|
|
6767
6767
|
onProgress?.(totalSlides, totalSlides);
|
|
6768
6768
|
setActiveSlide(currentSlideIndex);
|
|
6769
6769
|
if (images.length === 0) {
|
|
6770
|
-
throw new Error(
|
|
6770
|
+
throw new Error(chunkU6A5FWWE_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
6771
6771
|
}
|
|
6772
|
-
const pdfBlobUrl =
|
|
6773
|
-
|
|
6772
|
+
const pdfBlobUrl = chunkSUNSC3Z5_js.buildPdfFromImageData(images);
|
|
6773
|
+
chunkF7SX4EUT_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
6774
6774
|
}
|
|
6775
6775
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
6776
6776
|
const { scale = 2, onProgress } = options;
|
|
@@ -6816,10 +6816,10 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
6816
6816
|
onProgress?.(totalSlides, totalSlides);
|
|
6817
6817
|
setActiveSlide(currentSlideIndex);
|
|
6818
6818
|
if (pages.length === 0) {
|
|
6819
|
-
throw new Error(
|
|
6819
|
+
throw new Error(chunkU6A5FWWE_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
6820
6820
|
}
|
|
6821
|
-
const pdfDataUrl =
|
|
6822
|
-
|
|
6821
|
+
const pdfDataUrl = chunkSUNSC3Z5_js.buildNotesPdf(pages);
|
|
6822
|
+
chunkF7SX4EUT_js.downloadDataUrl(pdfDataUrl, filename);
|
|
6823
6823
|
}
|
|
6824
6824
|
|
|
6825
6825
|
// src/viewer/utils/export-video.ts
|
|
@@ -6850,7 +6850,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6850
6850
|
}
|
|
6851
6851
|
setActiveSlide(currentSlideIndex);
|
|
6852
6852
|
if (slideCanvases.length === 0) {
|
|
6853
|
-
throw new Error(
|
|
6853
|
+
throw new Error(chunkU6A5FWWE_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
|
|
6854
6854
|
}
|
|
6855
6855
|
const firstCanvas = slideCanvases[0];
|
|
6856
6856
|
const recordingCanvas = document.createElement("canvas");
|
|
@@ -6858,12 +6858,12 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6858
6858
|
recordingCanvas.height = firstCanvas.height;
|
|
6859
6859
|
const ctx = recordingCanvas.getContext("2d");
|
|
6860
6860
|
if (!ctx) {
|
|
6861
|
-
throw new Error(
|
|
6861
|
+
throw new Error(chunkU6A5FWWE_js.translationsEn["pptx.export.errorNo2dContext"]);
|
|
6862
6862
|
}
|
|
6863
6863
|
const fps = 30;
|
|
6864
6864
|
const stream = recordingCanvas.captureStream(fps);
|
|
6865
6865
|
const recorder = new MediaRecorder(stream, {
|
|
6866
|
-
mimeType:
|
|
6866
|
+
mimeType: chunkF7SX4EUT_js.pickSupportedMimeType([...chunkF7SX4EUT_js.WEBM_MIME_CANDIDATES]),
|
|
6867
6867
|
videoBitsPerSecond: 5e6
|
|
6868
6868
|
});
|
|
6869
6869
|
const chunks = [];
|
|
@@ -6886,8 +6886,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6886
6886
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
6887
6887
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
6888
6888
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
6889
|
-
const frameInterval =
|
|
6890
|
-
const framesNeeded =
|
|
6889
|
+
const frameInterval = chunkF7SX4EUT_js.fpsToFrameIntervalMs(fps);
|
|
6890
|
+
const framesNeeded = chunkF7SX4EUT_js.segmentFrameCount(duration, fps);
|
|
6891
6891
|
for (let f = 0; f < framesNeeded; f++) {
|
|
6892
6892
|
if (signal?.aborted) {
|
|
6893
6893
|
recorder.stop();
|
|
@@ -6934,9 +6934,9 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6934
6934
|
}
|
|
6935
6935
|
setActiveSlide(currentSlideIndex);
|
|
6936
6936
|
if (frames.length === 0) {
|
|
6937
|
-
throw new Error(
|
|
6937
|
+
throw new Error(chunkU6A5FWWE_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
6938
6938
|
}
|
|
6939
|
-
const gifBytes =
|
|
6939
|
+
const gifBytes = chunkF7SX4EUT_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
6940
6940
|
onProgress?.(totalSlides, totalSlides);
|
|
6941
6941
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
6942
6942
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -6990,7 +6990,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
6990
6990
|
continue;
|
|
6991
6991
|
}
|
|
6992
6992
|
onProgress?.(processedCount, data.slides.length);
|
|
6993
|
-
let svg =
|
|
6993
|
+
let svg = chunkF7SX4EUT_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
6994
6994
|
if (embedFonts && fontFaces?.length) {
|
|
6995
6995
|
svg = injectFontFaces(svg, fontFaces);
|
|
6996
6996
|
}
|
|
@@ -7048,13 +7048,13 @@ function useExportSaveAs(input) {
|
|
|
7048
7048
|
setExportProgress(10);
|
|
7049
7049
|
setExportStatusMessage("Adding presentation...");
|
|
7050
7050
|
const pptxData = await serializeSlides();
|
|
7051
|
-
const pptxFilename =
|
|
7051
|
+
const pptxFilename = chunkF7SX4EUT_js.savedPresentationFileName(filePath);
|
|
7052
7052
|
if (pptxData) {
|
|
7053
7053
|
pkgFolder.file(pptxFilename, pptxData);
|
|
7054
7054
|
}
|
|
7055
7055
|
setExportProgress(70);
|
|
7056
7056
|
setExportStatusMessage("Writing README...");
|
|
7057
|
-
const readme =
|
|
7057
|
+
const readme = chunkF7SX4EUT_js.generatePackageReadme(pptxFilename);
|
|
7058
7058
|
pkgFolder.file("README.txt", readme);
|
|
7059
7059
|
if (abortCtrl.signal.aborted) {
|
|
7060
7060
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -7064,7 +7064,7 @@ function useExportSaveAs(input) {
|
|
|
7064
7064
|
const zipBlob = await zip.generateAsync({ type: "blob" });
|
|
7065
7065
|
setExportProgress(95);
|
|
7066
7066
|
setExportStatusMessage("Downloading...");
|
|
7067
|
-
|
|
7067
|
+
chunkF7SX4EUT_js.downloadBlob(zipBlob, `${chunkF7SX4EUT_js.presentationBaseName(pptxFilename)}-package.zip`);
|
|
7068
7068
|
setExportProgress(100);
|
|
7069
7069
|
} catch (err) {
|
|
7070
7070
|
if (err.name !== "AbortError") {
|
|
@@ -7080,13 +7080,13 @@ function useExportSaveAs(input) {
|
|
|
7080
7080
|
if (!handler) {
|
|
7081
7081
|
return;
|
|
7082
7082
|
}
|
|
7083
|
-
const downloadName =
|
|
7083
|
+
const downloadName = chunkF7SX4EUT_js.savedPresentationFileName(filePath, format);
|
|
7084
7084
|
try {
|
|
7085
7085
|
const data = await buildSaveAsData(handler, format);
|
|
7086
7086
|
const blob = new Blob([data], {
|
|
7087
7087
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
7088
7088
|
});
|
|
7089
|
-
|
|
7089
|
+
chunkF7SX4EUT_js.downloadBlob(blob, downloadName);
|
|
7090
7090
|
} catch (err) {
|
|
7091
7091
|
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
7092
7092
|
}
|
|
@@ -7099,18 +7099,18 @@ function useExportSaveAs(input) {
|
|
|
7099
7099
|
const pptxGuides = guides.map((g) => ({
|
|
7100
7100
|
id: g.id,
|
|
7101
7101
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
7102
|
-
positionEmu:
|
|
7102
|
+
positionEmu: chunkF7SX4EUT_js.guidePxToEmu(g.position)
|
|
7103
7103
|
}));
|
|
7104
7104
|
return {
|
|
7105
7105
|
...slide,
|
|
7106
7106
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
7107
7107
|
};
|
|
7108
7108
|
});
|
|
7109
|
-
const slidesToSave =
|
|
7109
|
+
const slidesToSave = chunkF7SX4EUT_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
7110
7110
|
const saveOptions = {
|
|
7111
7111
|
// Save As shares Save's slide-size decision; leaving it out here is how
|
|
7112
7112
|
// a preset picked in the inspector reached one save path and not the other.
|
|
7113
|
-
slideSize:
|
|
7113
|
+
slideSize: chunkF7SX4EUT_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
7114
7114
|
headerFooter,
|
|
7115
7115
|
presentationProperties,
|
|
7116
7116
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -7124,13 +7124,13 @@ function useExportSaveAs(input) {
|
|
|
7124
7124
|
handoutMaster,
|
|
7125
7125
|
outputFormat: format
|
|
7126
7126
|
};
|
|
7127
|
-
return
|
|
7127
|
+
return chunkF7SX4EUT_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
|
|
7128
7128
|
};
|
|
7129
7129
|
const handleExportJson = () => {
|
|
7130
7130
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7131
|
-
const slideSize =
|
|
7131
|
+
const slideSize = chunkF7SX4EUT_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
7132
7132
|
const data = {
|
|
7133
|
-
slides:
|
|
7133
|
+
slides: chunkF7SX4EUT_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7134
7134
|
width: canvasSize.width,
|
|
7135
7135
|
height: canvasSize.height,
|
|
7136
7136
|
widthEmu: slideSize.widthEmu,
|
|
@@ -7149,7 +7149,7 @@ function useExportSaveAs(input) {
|
|
|
7149
7149
|
handoutMaster
|
|
7150
7150
|
};
|
|
7151
7151
|
try {
|
|
7152
|
-
|
|
7152
|
+
chunkF7SX4EUT_js.exportDeckJson(data, sourceName);
|
|
7153
7153
|
} catch (err) {
|
|
7154
7154
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7155
7155
|
}
|
|
@@ -7188,9 +7188,6 @@ function safeConfirm(message) {
|
|
|
7188
7188
|
return false;
|
|
7189
7189
|
}
|
|
7190
7190
|
}
|
|
7191
|
-
function downloadBlob2(blob, filename) {
|
|
7192
|
-
chunkBQJU7ZG6_js.downloadBlob(blob, chunkBQJU7ZG6_js.sanitizeDownloadFilename(filename));
|
|
7193
|
-
}
|
|
7194
7191
|
|
|
7195
7192
|
// src/viewer/hooks/useExportHandlers.ts
|
|
7196
7193
|
function useExportHandlers(input) {
|
|
@@ -7299,21 +7296,21 @@ function useExportHandlers(input) {
|
|
|
7299
7296
|
{
|
|
7300
7297
|
scale: 2,
|
|
7301
7298
|
onProgress: (current, total) => {
|
|
7302
|
-
setExportProgress(
|
|
7303
|
-
setExportStatusMessage(
|
|
7299
|
+
setExportProgress(chunkF7SX4EUT_js.slideProgressPercent(current, total));
|
|
7300
|
+
setExportStatusMessage(chunkF7SX4EUT_js.slideStatusLabel("Rendering", current, total));
|
|
7304
7301
|
},
|
|
7305
7302
|
signal: abortCtrl.signal
|
|
7306
7303
|
}
|
|
7307
7304
|
);
|
|
7308
|
-
setExportProgress(
|
|
7305
|
+
setExportProgress(chunkF7SX4EUT_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7309
7306
|
setExportStatusMessage("Building PDF...");
|
|
7310
7307
|
await new Promise((r) => {
|
|
7311
7308
|
setTimeout(r, 100);
|
|
7312
7309
|
});
|
|
7313
|
-
setExportProgress(
|
|
7310
|
+
setExportProgress(chunkF7SX4EUT_js.EXPORT_DONE_PERCENT);
|
|
7314
7311
|
setExportStatusMessage("Done!");
|
|
7315
7312
|
} catch (err) {
|
|
7316
|
-
if (!
|
|
7313
|
+
if (!chunkF7SX4EUT_js.isExportAbortError(err)) {
|
|
7317
7314
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7318
7315
|
}
|
|
7319
7316
|
} finally {
|
|
@@ -7343,21 +7340,21 @@ function useExportHandlers(input) {
|
|
|
7343
7340
|
{
|
|
7344
7341
|
scale: 2,
|
|
7345
7342
|
onProgress: (current, total) => {
|
|
7346
|
-
setExportProgress(
|
|
7347
|
-
setExportStatusMessage(
|
|
7343
|
+
setExportProgress(chunkF7SX4EUT_js.slideProgressPercent(current, total));
|
|
7344
|
+
setExportStatusMessage(chunkF7SX4EUT_js.slideStatusLabel("Rendering", current, total));
|
|
7348
7345
|
},
|
|
7349
7346
|
signal: abortCtrl.signal
|
|
7350
7347
|
}
|
|
7351
7348
|
);
|
|
7352
|
-
setExportProgress(
|
|
7349
|
+
setExportProgress(chunkF7SX4EUT_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7353
7350
|
setExportStatusMessage("Building PDF...");
|
|
7354
7351
|
await new Promise((r) => {
|
|
7355
7352
|
setTimeout(r, 100);
|
|
7356
7353
|
});
|
|
7357
|
-
setExportProgress(
|
|
7354
|
+
setExportProgress(chunkF7SX4EUT_js.EXPORT_DONE_PERCENT);
|
|
7358
7355
|
setExportStatusMessage("Done!");
|
|
7359
7356
|
} catch (err) {
|
|
7360
|
-
if (!
|
|
7357
|
+
if (!chunkF7SX4EUT_js.isExportAbortError(err)) {
|
|
7361
7358
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7362
7359
|
}
|
|
7363
7360
|
} finally {
|
|
@@ -7398,22 +7395,22 @@ function useExportHandlers(input) {
|
|
|
7398
7395
|
scale: 1,
|
|
7399
7396
|
slideDurationMs: 3e3,
|
|
7400
7397
|
onProgress: (current, total) => {
|
|
7401
|
-
setExportProgress(
|
|
7402
|
-
setExportStatusMessage(
|
|
7398
|
+
setExportProgress(chunkF7SX4EUT_js.slideProgressPercent(current, total, 45));
|
|
7399
|
+
setExportStatusMessage(chunkF7SX4EUT_js.slideStatusLabel("Capturing", current, total));
|
|
7403
7400
|
},
|
|
7404
7401
|
onRecordProgress: (current, total) => {
|
|
7405
|
-
setExportProgress(
|
|
7406
|
-
setExportStatusMessage(
|
|
7402
|
+
setExportProgress(chunkF7SX4EUT_js.recordProgressPercent(current, total));
|
|
7403
|
+
setExportStatusMessage(chunkF7SX4EUT_js.slideStatusLabel("Recording", current, total));
|
|
7407
7404
|
},
|
|
7408
7405
|
signal: abortCtrl.signal
|
|
7409
7406
|
}
|
|
7410
7407
|
);
|
|
7411
|
-
setExportProgress(
|
|
7408
|
+
setExportProgress(chunkF7SX4EUT_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7412
7409
|
setExportStatusMessage("Saving file...");
|
|
7413
|
-
|
|
7414
|
-
setExportProgress(
|
|
7410
|
+
chunkF7SX4EUT_js.downloadBlob(blob, "presentation.webm");
|
|
7411
|
+
setExportProgress(chunkF7SX4EUT_js.EXPORT_DONE_PERCENT);
|
|
7415
7412
|
} catch (err) {
|
|
7416
|
-
if (!
|
|
7413
|
+
if (!chunkF7SX4EUT_js.isExportAbortError(err)) {
|
|
7417
7414
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7418
7415
|
}
|
|
7419
7416
|
} finally {
|
|
@@ -7441,18 +7438,18 @@ function useExportHandlers(input) {
|
|
|
7441
7438
|
scale: 0.5,
|
|
7442
7439
|
slideDurationMs: 2e3,
|
|
7443
7440
|
onProgress: (current, total) => {
|
|
7444
|
-
setExportProgress(
|
|
7445
|
-
setExportStatusMessage(
|
|
7441
|
+
setExportProgress(chunkF7SX4EUT_js.slideProgressPercent(current, total));
|
|
7442
|
+
setExportStatusMessage(chunkF7SX4EUT_js.slideStatusLabel("Encoding", current, total));
|
|
7446
7443
|
},
|
|
7447
7444
|
signal: abortCtrl.signal
|
|
7448
7445
|
}
|
|
7449
7446
|
);
|
|
7450
|
-
setExportProgress(
|
|
7447
|
+
setExportProgress(chunkF7SX4EUT_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7451
7448
|
setExportStatusMessage("Saving file...");
|
|
7452
|
-
|
|
7453
|
-
setExportProgress(
|
|
7449
|
+
chunkF7SX4EUT_js.downloadBlob(blob, "presentation.gif");
|
|
7450
|
+
setExportProgress(chunkF7SX4EUT_js.EXPORT_DONE_PERCENT);
|
|
7454
7451
|
} catch (err) {
|
|
7455
|
-
if (!
|
|
7452
|
+
if (!chunkF7SX4EUT_js.isExportAbortError(err)) {
|
|
7456
7453
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7457
7454
|
}
|
|
7458
7455
|
} finally {
|
|
@@ -7493,7 +7490,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
7493
7490
|
}
|
|
7494
7491
|
printWindow.document.open();
|
|
7495
7492
|
printWindow.document.write(
|
|
7496
|
-
|
|
7493
|
+
chunkF7SX4EUT_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
7497
7494
|
);
|
|
7498
7495
|
printWindow.document.close();
|
|
7499
7496
|
printWindow.focus();
|
|
@@ -7527,8 +7524,8 @@ function usePrintHandlers(input) {
|
|
|
7527
7524
|
if (!pptxData || settings.printWhat !== "slides") {
|
|
7528
7525
|
return handlePrintWithSettings(settings);
|
|
7529
7526
|
}
|
|
7530
|
-
const colorFilter =
|
|
7531
|
-
const slideIndices =
|
|
7527
|
+
const colorFilter = chunkF7SX4EUT_js.computeColorFilter(settings.colorMode);
|
|
7528
|
+
const slideIndices = chunkF7SX4EUT_js.computeSlideIndices(
|
|
7532
7529
|
settings.slideRange,
|
|
7533
7530
|
activeSlideIndex,
|
|
7534
7531
|
slides.length,
|
|
@@ -7542,7 +7539,7 @@ function usePrintHandlers(input) {
|
|
|
7542
7539
|
if (svgs.length === 0) {
|
|
7543
7540
|
return;
|
|
7544
7541
|
}
|
|
7545
|
-
const printDoc =
|
|
7542
|
+
const printDoc = chunkF7SX4EUT_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7546
7543
|
title: "Slides (Vector)",
|
|
7547
7544
|
orientation: settings.orientation,
|
|
7548
7545
|
colorFilter
|
|
@@ -7555,8 +7552,8 @@ function usePrintHandlers(input) {
|
|
|
7555
7552
|
};
|
|
7556
7553
|
const handlePrintWithSettings = async (settings) => {
|
|
7557
7554
|
setIsPrintDialogOpen(false);
|
|
7558
|
-
const colorFilter =
|
|
7559
|
-
const slideIndices =
|
|
7555
|
+
const colorFilter = chunkF7SX4EUT_js.computeColorFilter(settings.colorMode);
|
|
7556
|
+
const slideIndices = chunkF7SX4EUT_js.computeSlideIndices(
|
|
7560
7557
|
settings.slideRange,
|
|
7561
7558
|
activeSlideIndex,
|
|
7562
7559
|
slides.length,
|
|
@@ -7566,7 +7563,7 @@ function usePrintHandlers(input) {
|
|
|
7566
7563
|
if (settings.printWhat === "outline") {
|
|
7567
7564
|
openPrintWindow(
|
|
7568
7565
|
"Outline",
|
|
7569
|
-
`<div class="outline-page">${
|
|
7566
|
+
`<div class="outline-page">${chunkF7SX4EUT_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7570
7567
|
settings.orientation,
|
|
7571
7568
|
colorFilter,
|
|
7572
7569
|
settings.frameSlides
|
|
@@ -7591,7 +7588,7 @@ function usePrintHandlers(input) {
|
|
|
7591
7588
|
if (settings.printWhat === "slides") {
|
|
7592
7589
|
openPrintWindow(
|
|
7593
7590
|
"Slides",
|
|
7594
|
-
|
|
7591
|
+
chunkF7SX4EUT_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7595
7592
|
settings.orientation,
|
|
7596
7593
|
colorFilter,
|
|
7597
7594
|
settings.frameSlides
|
|
@@ -7601,7 +7598,7 @@ function usePrintHandlers(input) {
|
|
|
7601
7598
|
if (settings.printWhat === "notes") {
|
|
7602
7599
|
openPrintWindow(
|
|
7603
7600
|
"Notes Pages",
|
|
7604
|
-
|
|
7601
|
+
chunkF7SX4EUT_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7605
7602
|
"portrait",
|
|
7606
7603
|
colorFilter,
|
|
7607
7604
|
settings.frameSlides
|
|
@@ -7612,7 +7609,7 @@ function usePrintHandlers(input) {
|
|
|
7612
7609
|
const spp = settings.slidesPerPage;
|
|
7613
7610
|
openPrintWindow(
|
|
7614
7611
|
`Handout ${spp} per page`,
|
|
7615
|
-
|
|
7612
|
+
chunkF7SX4EUT_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
7616
7613
|
"portrait",
|
|
7617
7614
|
colorFilter,
|
|
7618
7615
|
settings.frameSlides
|
|
@@ -7676,8 +7673,8 @@ function useThemeHandlers(input) {
|
|
|
7676
7673
|
return;
|
|
7677
7674
|
}
|
|
7678
7675
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7679
|
-
const previousMap = theme?.colorScheme ?
|
|
7680
|
-
setSlides((prev) =>
|
|
7676
|
+
const previousMap = theme?.colorScheme ? chunkF7SX4EUT_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7677
|
+
setSlides((prev) => chunkF7SX4EUT_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7681
7678
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7682
7679
|
bumpHistory();
|
|
7683
7680
|
history.markDirty();
|
|
@@ -7782,7 +7779,7 @@ function useThemeSwitching(input) {
|
|
|
7782
7779
|
}
|
|
7783
7780
|
try {
|
|
7784
7781
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7785
|
-
const newData =
|
|
7782
|
+
const newData = chunkF7SX4EUT_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7786
7783
|
onDataChange(newData);
|
|
7787
7784
|
onThemeChanged?.(preset);
|
|
7788
7785
|
} catch (error) {
|
|
@@ -7799,7 +7796,7 @@ function useThemeSwitching(input) {
|
|
|
7799
7796
|
}
|
|
7800
7797
|
try {
|
|
7801
7798
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7802
|
-
const newData =
|
|
7799
|
+
const newData = chunkF7SX4EUT_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7803
7800
|
onDataChange(newData);
|
|
7804
7801
|
} catch (error) {
|
|
7805
7802
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7811,12 +7808,12 @@ function useThemeSwitching(input) {
|
|
|
7811
7808
|
if (!data?.theme?.colorScheme) {
|
|
7812
7809
|
return void 0;
|
|
7813
7810
|
}
|
|
7814
|
-
return
|
|
7815
|
-
(p) =>
|
|
7811
|
+
return chunkF7SX4EUT_js.THEME_PRESETS.find(
|
|
7812
|
+
(p) => chunkF7SX4EUT_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7816
7813
|
);
|
|
7817
7814
|
}, [data?.theme?.colorScheme]);
|
|
7818
7815
|
return {
|
|
7819
|
-
presets:
|
|
7816
|
+
presets: chunkF7SX4EUT_js.THEME_PRESETS,
|
|
7820
7817
|
switchToPreset,
|
|
7821
7818
|
switchToCustom,
|
|
7822
7819
|
currentPreset
|
|
@@ -7891,7 +7888,7 @@ function usePropertyHandlers(input) {
|
|
|
7891
7888
|
}
|
|
7892
7889
|
try {
|
|
7893
7890
|
const ab = await file.arrayBuffer();
|
|
7894
|
-
const h = new
|
|
7891
|
+
const h = new chunkF7SX4EUT_js.PptxHandler();
|
|
7895
7892
|
const other = await h.load(ab);
|
|
7896
7893
|
if (!other) {
|
|
7897
7894
|
return;
|
|
@@ -7901,7 +7898,7 @@ function usePropertyHandlers(input) {
|
|
|
7901
7898
|
width: canvasSize.width,
|
|
7902
7899
|
height: canvasSize.height
|
|
7903
7900
|
};
|
|
7904
|
-
setCompareResult(
|
|
7901
|
+
setCompareResult(chunkF7SX4EUT_js.comparePresentation(cur, other));
|
|
7905
7902
|
setIsComparePanelOpen(true);
|
|
7906
7903
|
} catch (err) {
|
|
7907
7904
|
console.warn("Compare failed:", err);
|
|
@@ -7918,7 +7915,7 @@ function usePropertyHandlers(input) {
|
|
|
7918
7915
|
if (!diff || diff.status === "unchanged") {
|
|
7919
7916
|
return;
|
|
7920
7917
|
}
|
|
7921
|
-
setSlides((prev) =>
|
|
7918
|
+
setSlides((prev) => chunkF7SX4EUT_js.applyAcceptSlide(prev, diff));
|
|
7922
7919
|
setIsDirty(true);
|
|
7923
7920
|
},
|
|
7924
7921
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -7929,10 +7926,10 @@ function usePropertyHandlers(input) {
|
|
|
7929
7926
|
if (!compareResult) {
|
|
7930
7927
|
return;
|
|
7931
7928
|
}
|
|
7932
|
-
setSlides((prev) =>
|
|
7929
|
+
setSlides((prev) => chunkF7SX4EUT_js.applyAcceptAllSlides(prev, compareResult));
|
|
7933
7930
|
setIsDirty(true);
|
|
7934
7931
|
}, [compareResult, setSlides, setIsDirty]);
|
|
7935
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
7932
|
+
const usedFontFamilies = react.useMemo(() => chunkF7SX4EUT_js.collectUsedFonts(slides), [slides]);
|
|
7936
7933
|
return {
|
|
7937
7934
|
handleUpdateNotes,
|
|
7938
7935
|
handleUpdateSlide,
|
|
@@ -8051,7 +8048,7 @@ function useIsMobile(input) {
|
|
|
8051
8048
|
const containerRef = input?.containerRef;
|
|
8052
8049
|
const isTouchDevice = react.useSyncExternalStore(
|
|
8053
8050
|
subscribeTouchCapability,
|
|
8054
|
-
|
|
8051
|
+
chunkF7SX4EUT_js.detectTouchDevice,
|
|
8055
8052
|
() => false
|
|
8056
8053
|
// server snapshot
|
|
8057
8054
|
);
|
|
@@ -8067,7 +8064,7 @@ function useIsMobile(input) {
|
|
|
8067
8064
|
}
|
|
8068
8065
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
8069
8066
|
});
|
|
8070
|
-
const [orientation, setOrientation] = react.useState(
|
|
8067
|
+
const [orientation, setOrientation] = react.useState(chunkF7SX4EUT_js.detectOrientation);
|
|
8071
8068
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
8072
8069
|
const [initialViewportHeight] = react.useState(
|
|
8073
8070
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -8111,7 +8108,7 @@ function useIsMobile(input) {
|
|
|
8111
8108
|
return;
|
|
8112
8109
|
}
|
|
8113
8110
|
const handleOrientationChange = () => {
|
|
8114
|
-
setOrientation(
|
|
8111
|
+
setOrientation(chunkF7SX4EUT_js.detectOrientation());
|
|
8115
8112
|
};
|
|
8116
8113
|
if (screen.orientation) {
|
|
8117
8114
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -8141,9 +8138,9 @@ function useIsMobile(input) {
|
|
|
8141
8138
|
window.addEventListener("resize", handleResize);
|
|
8142
8139
|
return () => window.removeEventListener("resize", handleResize);
|
|
8143
8140
|
}, [isTouchDevice, initialViewportHeight]);
|
|
8144
|
-
const isMobile =
|
|
8145
|
-
const isTablet = !isMobile && containerWidth >=
|
|
8146
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
8141
|
+
const isMobile = chunkF7SX4EUT_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
8142
|
+
const isTablet = !isMobile && containerWidth >= chunkF7SX4EUT_js.MOBILE_BREAKPOINT && containerWidth < chunkF7SX4EUT_js.TABLET_BREAKPOINT;
|
|
8143
|
+
const isDesktop = !isMobile && containerWidth >= chunkF7SX4EUT_js.TABLET_BREAKPOINT;
|
|
8147
8144
|
return {
|
|
8148
8145
|
isMobile,
|
|
8149
8146
|
isTablet,
|
|
@@ -8205,7 +8202,7 @@ function useViewerDialogs(input) {
|
|
|
8205
8202
|
);
|
|
8206
8203
|
const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
|
|
8207
8204
|
const fontEmbedding = react.useMemo(
|
|
8208
|
-
() =>
|
|
8205
|
+
() => chunkF7SX4EUT_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
|
|
8209
8206
|
[embeddedFontKey]
|
|
8210
8207
|
);
|
|
8211
8208
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
|
|
@@ -8213,11 +8210,11 @@ function useViewerDialogs(input) {
|
|
|
8213
8210
|
setEmbedFontsEnabled(fontEmbedding.initialEnabled);
|
|
8214
8211
|
}, [fontEmbedding]);
|
|
8215
8212
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8216
|
-
() => typeof window !== "undefined" ?
|
|
8213
|
+
() => typeof window !== "undefined" ? chunkF7SX4EUT_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8217
8214
|
);
|
|
8218
8215
|
react.useEffect(() => {
|
|
8219
8216
|
const handleWindow = () => setIsNarrowViewport(
|
|
8220
|
-
|
|
8217
|
+
chunkF7SX4EUT_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8221
8218
|
);
|
|
8222
8219
|
let observer = null;
|
|
8223
8220
|
let raf = 0;
|
|
@@ -8231,12 +8228,12 @@ function useViewerDialogs(input) {
|
|
|
8231
8228
|
const entry = entries[0];
|
|
8232
8229
|
if (entry) {
|
|
8233
8230
|
setIsNarrowViewport(
|
|
8234
|
-
|
|
8231
|
+
chunkF7SX4EUT_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
8235
8232
|
);
|
|
8236
8233
|
}
|
|
8237
8234
|
});
|
|
8238
8235
|
observer.observe(el);
|
|
8239
|
-
setIsNarrowViewport(
|
|
8236
|
+
setIsNarrowViewport(chunkF7SX4EUT_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
8240
8237
|
};
|
|
8241
8238
|
attach();
|
|
8242
8239
|
window.addEventListener("resize", handleWindow);
|
|
@@ -8395,20 +8392,20 @@ function useViewerDialogs(input) {
|
|
|
8395
8392
|
}
|
|
8396
8393
|
function computeGridSpacingPx(presentationGridSpacing) {
|
|
8397
8394
|
if (presentationGridSpacing) {
|
|
8398
|
-
const px = Math.round(presentationGridSpacing.cx /
|
|
8395
|
+
const px = Math.round(presentationGridSpacing.cx / chunkSUNSC3Z5_js.EMU_PER_PX);
|
|
8399
8396
|
if (px > 0) {
|
|
8400
8397
|
return px;
|
|
8401
8398
|
}
|
|
8402
8399
|
}
|
|
8403
|
-
return
|
|
8400
|
+
return chunkSUNSC3Z5_js.GRID_SIZE;
|
|
8404
8401
|
}
|
|
8405
8402
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8406
8403
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8407
|
-
return
|
|
8404
|
+
return chunkF7SX4EUT_js.resolveShowSlideIndexes(slides, activeShow);
|
|
8408
8405
|
}
|
|
8409
8406
|
function computeSlideSectionGroups(slides, sections) {
|
|
8410
|
-
return
|
|
8411
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8407
|
+
return chunkF7SX4EUT_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8408
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkSUNSC3Z5_js.UNGROUPED_SECTION_ID : chunkSUNSC3Z5_js.DEFAULT_SECTION_GROUP_ID),
|
|
8412
8409
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8413
8410
|
slideIndexes: group.slideIndexes,
|
|
8414
8411
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8420,7 +8417,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
|
8420
8417
|
return void 0;
|
|
8421
8418
|
}
|
|
8422
8419
|
const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
|
|
8423
|
-
return
|
|
8420
|
+
return chunkF7SX4EUT_js.masterViewPseudoSlide(document2, {
|
|
8424
8421
|
tab: "slides",
|
|
8425
8422
|
masterIndex: 0,
|
|
8426
8423
|
layoutIndex: activeLayout ? 0 : null
|
|
@@ -8448,10 +8445,10 @@ function useDerivedSlideState(input) {
|
|
|
8448
8445
|
);
|
|
8449
8446
|
const slideSectionGroups = react.useMemo(
|
|
8450
8447
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8451
|
-
if (group.id ===
|
|
8448
|
+
if (group.id === chunkSUNSC3Z5_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8452
8449
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8453
8450
|
}
|
|
8454
|
-
if (group.id ===
|
|
8451
|
+
if (group.id === chunkSUNSC3Z5_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
8455
8452
|
return { ...group, label: t("pptx.sections.slides") };
|
|
8456
8453
|
}
|
|
8457
8454
|
return group;
|
|
@@ -8551,13 +8548,13 @@ function useAnnotationHandlers(input) {
|
|
|
8551
8548
|
}, [annotations, setMode, setSlides, history]);
|
|
8552
8549
|
const handleSetMode = react.useCallback(
|
|
8553
8550
|
(nextMode) => {
|
|
8554
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8551
|
+
if (mode === "present" && nextMode !== "present" && !chunkF7SX4EUT_js.mayLeaveSlideShow()) {
|
|
8555
8552
|
return;
|
|
8556
8553
|
}
|
|
8557
8554
|
if (nextMode === "present") {
|
|
8558
8555
|
presentation.enterPresentMode();
|
|
8559
8556
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8560
|
-
|
|
8557
|
+
chunkF7SX4EUT_js.stopAllPersistentAudio();
|
|
8561
8558
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8562
8559
|
if (promptKeepInkAnnotations) {
|
|
8563
8560
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8566,7 +8563,7 @@ function useAnnotationHandlers(input) {
|
|
|
8566
8563
|
}
|
|
8567
8564
|
} else {
|
|
8568
8565
|
if (mode === "present") {
|
|
8569
|
-
|
|
8566
|
+
chunkF7SX4EUT_js.stopAllPersistentAudio();
|
|
8570
8567
|
}
|
|
8571
8568
|
setMode(nextMode);
|
|
8572
8569
|
}
|
|
@@ -8637,13 +8634,13 @@ function useSerialize(input) {
|
|
|
8637
8634
|
let processedSlide = slide;
|
|
8638
8635
|
if (pendingEditId) {
|
|
8639
8636
|
const updatedElements = slide.elements.map((el) => {
|
|
8640
|
-
if (el.id !== pendingEditId || !
|
|
8637
|
+
if (el.id !== pendingEditId || !chunkF7SX4EUT_js.hasTextProperties(el)) {
|
|
8641
8638
|
return el;
|
|
8642
8639
|
}
|
|
8643
8640
|
return {
|
|
8644
8641
|
...el,
|
|
8645
8642
|
text: pendingEditText,
|
|
8646
|
-
textSegments:
|
|
8643
|
+
textSegments: chunkF7SX4EUT_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8647
8644
|
};
|
|
8648
8645
|
});
|
|
8649
8646
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8656,19 +8653,19 @@ function useSerialize(input) {
|
|
|
8656
8653
|
const pptxGuides = guides.map((g) => ({
|
|
8657
8654
|
id: g.id,
|
|
8658
8655
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8659
|
-
positionEmu:
|
|
8656
|
+
positionEmu: chunkF7SX4EUT_js.guidePxToEmu(g.position)
|
|
8660
8657
|
}));
|
|
8661
8658
|
return {
|
|
8662
8659
|
...processedSlide,
|
|
8663
8660
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8664
8661
|
};
|
|
8665
8662
|
});
|
|
8666
|
-
const slidesToSave =
|
|
8663
|
+
const slidesToSave = chunkF7SX4EUT_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8667
8664
|
const saveOptions = {
|
|
8668
8665
|
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
8669
8666
|
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
8670
8667
|
// slide-size edit reaches the file.
|
|
8671
|
-
slideSize:
|
|
8668
|
+
slideSize: chunkF7SX4EUT_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
8672
8669
|
headerFooter,
|
|
8673
8670
|
presentationProperties,
|
|
8674
8671
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -8680,9 +8677,9 @@ function useSerialize(input) {
|
|
|
8680
8677
|
slideMasters,
|
|
8681
8678
|
notesMaster,
|
|
8682
8679
|
handoutMaster,
|
|
8683
|
-
...
|
|
8680
|
+
...chunkF7SX4EUT_js.embeddedFontSaveOptions(embedFonts)
|
|
8684
8681
|
};
|
|
8685
|
-
return
|
|
8682
|
+
return chunkF7SX4EUT_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
|
|
8686
8683
|
}, [
|
|
8687
8684
|
slides,
|
|
8688
8685
|
templateElementsBySlideId,
|
|
@@ -8717,7 +8714,7 @@ function useRecoveryDetection(input) {
|
|
|
8717
8714
|
const onRestore = input.onRestore;
|
|
8718
8715
|
const openVersionHistory = input.openVersionHistory;
|
|
8719
8716
|
react.useEffect(() => {
|
|
8720
|
-
if (!
|
|
8717
|
+
if (!chunkF7SX4EUT_js.shouldProbeAutosaveRecovery({
|
|
8721
8718
|
alreadyChecked: recoveryCheckedRef.current,
|
|
8722
8719
|
filePath,
|
|
8723
8720
|
loading,
|
|
@@ -8729,7 +8726,7 @@ function useRecoveryDetection(input) {
|
|
|
8729
8726
|
}
|
|
8730
8727
|
recoveryCheckedRef.current = true;
|
|
8731
8728
|
void (async () => {
|
|
8732
|
-
const offer = await
|
|
8729
|
+
const offer = await chunkF7SX4EUT_js.probeAutosaveRecovery(filePath);
|
|
8733
8730
|
if (!offer) {
|
|
8734
8731
|
return;
|
|
8735
8732
|
}
|
|
@@ -8742,7 +8739,7 @@ function useRecoveryDetection(input) {
|
|
|
8742
8739
|
const record = recordRef.current;
|
|
8743
8740
|
setPrompt(null);
|
|
8744
8741
|
if (record && onRestore) {
|
|
8745
|
-
onRestore(
|
|
8742
|
+
onRestore(chunkF7SX4EUT_js.acceptAutosaveRecovery(record));
|
|
8746
8743
|
}
|
|
8747
8744
|
recordRef.current = null;
|
|
8748
8745
|
}, [onRestore]);
|
|
@@ -8751,7 +8748,7 @@ function useRecoveryDetection(input) {
|
|
|
8751
8748
|
setPrompt(null);
|
|
8752
8749
|
recordRef.current = null;
|
|
8753
8750
|
if (record) {
|
|
8754
|
-
void
|
|
8751
|
+
void chunkF7SX4EUT_js.discardAutosaveRecovery(record);
|
|
8755
8752
|
}
|
|
8756
8753
|
}, []);
|
|
8757
8754
|
return { prompt, restore, discard };
|
|
@@ -8791,7 +8788,7 @@ function usePresentationSetup(input) {
|
|
|
8791
8788
|
containerRef,
|
|
8792
8789
|
content,
|
|
8793
8790
|
onSetMode: (nextMode) => {
|
|
8794
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8791
|
+
if (mode === "present" && nextMode !== "present" && !chunkF7SX4EUT_js.mayLeaveSlideShow()) {
|
|
8795
8792
|
return;
|
|
8796
8793
|
}
|
|
8797
8794
|
if (mode === "present" && nextMode !== "present" && annotations.hasAnyAnnotations && promptKeepInkAnnotations) {
|
|
@@ -8799,7 +8796,7 @@ function usePresentationSetup(input) {
|
|
|
8799
8796
|
setShowKeepAnnotationsDialog(true);
|
|
8800
8797
|
} else {
|
|
8801
8798
|
if (mode === "present" && nextMode !== "present") {
|
|
8802
|
-
|
|
8799
|
+
chunkF7SX4EUT_js.stopAllPersistentAudio();
|
|
8803
8800
|
stopAnimationSound();
|
|
8804
8801
|
}
|
|
8805
8802
|
setMode(nextMode);
|
|
@@ -8854,10 +8851,10 @@ function usePresentationSetup(input) {
|
|
|
8854
8851
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8855
8852
|
onToggleSubtitles,
|
|
8856
8853
|
onSaveRehearsalTimings: (timings) => {
|
|
8857
|
-
setSlides((prev) =>
|
|
8854
|
+
setSlides((prev) => chunkF7SX4EUT_js.applyRehearsalTimings(prev, timings));
|
|
8858
8855
|
history.markDirty();
|
|
8859
8856
|
},
|
|
8860
|
-
loopContinuously:
|
|
8857
|
+
loopContinuously: chunkF7SX4EUT_js.shouldLoopContinuously(presentationProperties),
|
|
8861
8858
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8862
8859
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8863
8860
|
endWithBlackSlide
|
|
@@ -9050,7 +9047,7 @@ function useEditorOperations(input) {
|
|
|
9050
9047
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
9051
9048
|
react.useEffect(() => {
|
|
9052
9049
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9053
|
-
copiedFormatRef.current =
|
|
9050
|
+
copiedFormatRef.current = chunkF7SX4EUT_js.copyFormatFromElement(selectedElement);
|
|
9054
9051
|
} else if (!formatPainterActive) {
|
|
9055
9052
|
copiedFormatRef.current = null;
|
|
9056
9053
|
}
|
|
@@ -9076,12 +9073,12 @@ function useEditorOperations(input) {
|
|
|
9076
9073
|
e.stopPropagation();
|
|
9077
9074
|
const element = elementLookup.get(elementId);
|
|
9078
9075
|
if (element) {
|
|
9079
|
-
const updated =
|
|
9076
|
+
const updated = chunkF7SX4EUT_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
9080
9077
|
const updates = {};
|
|
9081
|
-
if (
|
|
9078
|
+
if (chunkF7SX4EUT_js.hasShapeProperties(updated)) {
|
|
9082
9079
|
updates.shapeStyle = updated.shapeStyle;
|
|
9083
9080
|
}
|
|
9084
|
-
if (
|
|
9081
|
+
if (chunkF7SX4EUT_js.hasTextProperties(updated)) {
|
|
9085
9082
|
updates.textStyle = updated.textStyle;
|
|
9086
9083
|
}
|
|
9087
9084
|
ops.updateElementById(elementId, updates);
|
|
@@ -9235,7 +9232,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
9235
9232
|
const families = /* @__PURE__ */ new Set();
|
|
9236
9233
|
for (const slide of slides) {
|
|
9237
9234
|
for (const el of slide.elements) {
|
|
9238
|
-
if (
|
|
9235
|
+
if (chunkF7SX4EUT_js.hasTextProperties(el) && el.textSegments) {
|
|
9239
9236
|
for (const seg of el.textSegments) {
|
|
9240
9237
|
if (seg.style.fontFamily) {
|
|
9241
9238
|
families.add(seg.style.fontFamily);
|
|
@@ -9482,7 +9479,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9482
9479
|
inputRef.current = input;
|
|
9483
9480
|
const handleKeyDown = react.useCallback((e) => {
|
|
9484
9481
|
const current = inputRef.current;
|
|
9485
|
-
const { action, dx, dy } =
|
|
9482
|
+
const { action, dx, dy } = chunkF7SX4EUT_js.mapEditorKey(e, {
|
|
9486
9483
|
canEdit: current.canEdit,
|
|
9487
9484
|
// The Slide Master view is an editing surface, not a viewing one.
|
|
9488
9485
|
// Gating on `mode !== 'edit'` alone made `mapEditorKey` return
|
|
@@ -9495,7 +9492,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9495
9492
|
hasSelection: current.hasSelection,
|
|
9496
9493
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9497
9494
|
isDrawing: current.activeTool !== "select",
|
|
9498
|
-
isTextInputTarget:
|
|
9495
|
+
isTextInputTarget: chunkF7SX4EUT_js.isEditorTextInputTarget(e.target)
|
|
9499
9496
|
});
|
|
9500
9497
|
if (action === null) {
|
|
9501
9498
|
return;
|
|
@@ -9801,7 +9798,7 @@ function useViewerIntegration(input) {
|
|
|
9801
9798
|
return zoom.scale;
|
|
9802
9799
|
},
|
|
9803
9800
|
setZoom(level) {
|
|
9804
|
-
zoom.setScale(
|
|
9801
|
+
zoom.setScale(chunkF7SX4EUT_js.clampZoomScale(level));
|
|
9805
9802
|
},
|
|
9806
9803
|
zoomIn() {
|
|
9807
9804
|
zoom.handleZoomIn();
|
|
@@ -10017,7 +10014,7 @@ function useReducedMotion() {
|
|
|
10017
10014
|
}
|
|
10018
10015
|
function useViewerOptions() {
|
|
10019
10016
|
const storeRef = react.useRef(null);
|
|
10020
|
-
storeRef.current ??=
|
|
10017
|
+
storeRef.current ??= chunkF7SX4EUT_js.createViewerOptionsStore();
|
|
10021
10018
|
const store = storeRef.current;
|
|
10022
10019
|
const options = react.useSyncExternalStore(
|
|
10023
10020
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -10026,9 +10023,9 @@ function useViewerOptions() {
|
|
|
10026
10023
|
);
|
|
10027
10024
|
return { optionsStore: store, options };
|
|
10028
10025
|
}
|
|
10029
|
-
var KNOWN_TAB_IDS = new Set(
|
|
10026
|
+
var KNOWN_TAB_IDS = new Set(chunkF7SX4EUT_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
10030
10027
|
function computeToolbarVisibility(hiddenActions) {
|
|
10031
|
-
const isHidden = (id) =>
|
|
10028
|
+
const isHidden = (id) => chunkF7SX4EUT_js.isActionHidden(id, hiddenActions);
|
|
10032
10029
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
10033
10030
|
return { isHidden, isTabVisible };
|
|
10034
10031
|
}
|
|
@@ -10114,12 +10111,12 @@ function useYjsDocumentSync({
|
|
|
10114
10111
|
return;
|
|
10115
10112
|
}
|
|
10116
10113
|
try {
|
|
10117
|
-
const handler = new
|
|
10114
|
+
const handler = new chunkF7SX4EUT_js.PptxHandler();
|
|
10118
10115
|
await handler.load(sourceBytes.buffer);
|
|
10119
|
-
const currentSlides =
|
|
10116
|
+
const currentSlides = chunkF7SX4EUT_js.readSlidesFromYDoc(
|
|
10120
10117
|
doc
|
|
10121
10118
|
);
|
|
10122
|
-
const slidesToSave =
|
|
10119
|
+
const slidesToSave = chunkF7SX4EUT_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10123
10120
|
const bytes = await handler.save(slidesToSave);
|
|
10124
10121
|
config.onWriteBack(bytes);
|
|
10125
10122
|
} catch {
|
|
@@ -10134,10 +10131,10 @@ function useYjsDocumentSync({
|
|
|
10134
10131
|
if (!doc || !isConnected) {
|
|
10135
10132
|
return;
|
|
10136
10133
|
}
|
|
10137
|
-
const docSlides =
|
|
10134
|
+
const docSlides = chunkF7SX4EUT_js.readSlidesFromYDoc(
|
|
10138
10135
|
doc
|
|
10139
10136
|
);
|
|
10140
|
-
if (!
|
|
10137
|
+
if (!chunkF7SX4EUT_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
|
|
10141
10138
|
return;
|
|
10142
10139
|
}
|
|
10143
10140
|
lastSyncedRef.current = JSON.stringify(docSlides);
|
|
@@ -10156,11 +10153,11 @@ function useYjsDocumentSync({
|
|
|
10156
10153
|
lastSyncedRef.current = serialized;
|
|
10157
10154
|
void (async () => {
|
|
10158
10155
|
const factories = await getFactories();
|
|
10159
|
-
|
|
10156
|
+
chunkF7SX4EUT_js.reconcileSlidesInYDoc(
|
|
10160
10157
|
slides,
|
|
10161
10158
|
doc,
|
|
10162
10159
|
factories,
|
|
10163
|
-
|
|
10160
|
+
chunkF7SX4EUT_js.LOCAL_SYNC_ORIGIN
|
|
10164
10161
|
);
|
|
10165
10162
|
scheduleWriteBack();
|
|
10166
10163
|
})();
|
|
@@ -10174,10 +10171,10 @@ function useYjsDocumentSync({
|
|
|
10174
10171
|
return;
|
|
10175
10172
|
}
|
|
10176
10173
|
const handleChange = (_events, transaction) => {
|
|
10177
|
-
if (transaction?.origin ===
|
|
10174
|
+
if (transaction?.origin === chunkF7SX4EUT_js.LOCAL_SYNC_ORIGIN) {
|
|
10178
10175
|
return;
|
|
10179
10176
|
}
|
|
10180
|
-
const remoteSlides =
|
|
10177
|
+
const remoteSlides = chunkF7SX4EUT_js.readSlidesFromYDoc(
|
|
10181
10178
|
doc
|
|
10182
10179
|
);
|
|
10183
10180
|
if (remoteSlides.length === 0) {
|
|
@@ -10193,7 +10190,7 @@ function useYjsDocumentSync({
|
|
|
10193
10190
|
isApplyingRemoteRef.current = false;
|
|
10194
10191
|
scheduleWriteBack();
|
|
10195
10192
|
};
|
|
10196
|
-
const unobserve =
|
|
10193
|
+
const unobserve = chunkF7SX4EUT_js.observeYDocSlides(
|
|
10197
10194
|
doc,
|
|
10198
10195
|
handleChange
|
|
10199
10196
|
);
|
|
@@ -10231,7 +10228,7 @@ function useBroadcastFollower({
|
|
|
10231
10228
|
if (!broadcaster) {
|
|
10232
10229
|
return;
|
|
10233
10230
|
}
|
|
10234
|
-
if (!
|
|
10231
|
+
if (!chunkF7SX4EUT_js.shouldAutoFollowBroadcaster({
|
|
10235
10232
|
localRole: collab.config.role,
|
|
10236
10233
|
broadcasterRole: broadcaster.role
|
|
10237
10234
|
})) {
|
|
@@ -10406,10 +10403,10 @@ function useTouchGestures(input) {
|
|
|
10406
10403
|
if (!el || !enabled) {
|
|
10407
10404
|
return;
|
|
10408
10405
|
}
|
|
10409
|
-
const recognizer =
|
|
10406
|
+
const recognizer = chunkF7SX4EUT_js.createTouchGestureRecognizer({
|
|
10410
10407
|
getScale: () => scaleRef.current,
|
|
10411
|
-
minScale:
|
|
10412
|
-
maxScale:
|
|
10408
|
+
minScale: chunkF7SX4EUT_js.MIN_ZOOM_SCALE,
|
|
10409
|
+
maxScale: chunkF7SX4EUT_js.MAX_ZOOM_SCALE,
|
|
10413
10410
|
callbacks: {
|
|
10414
10411
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10415
10412
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10449,7 +10446,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10449
10446
|
return;
|
|
10450
10447
|
}
|
|
10451
10448
|
const rect = active.getBoundingClientRect();
|
|
10452
|
-
const delta =
|
|
10449
|
+
const delta = chunkF7SX4EUT_js.computeScrollDelta(
|
|
10453
10450
|
{ top: rect.top, bottom: rect.bottom },
|
|
10454
10451
|
window.innerHeight,
|
|
10455
10452
|
keyboardInset
|
|
@@ -10469,8 +10466,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10469
10466
|
return;
|
|
10470
10467
|
}
|
|
10471
10468
|
const update = () => {
|
|
10472
|
-
const metrics =
|
|
10473
|
-
const inset = metrics ?
|
|
10469
|
+
const metrics = chunkF7SX4EUT_js.readViewportMetrics(window);
|
|
10470
|
+
const inset = metrics ? chunkF7SX4EUT_js.computeKeyboardInset(metrics) : 0;
|
|
10474
10471
|
setKeyboardInset(inset);
|
|
10475
10472
|
if (inset > 0) {
|
|
10476
10473
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10481,8 +10478,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10481
10478
|
vv.addEventListener("scroll", update);
|
|
10482
10479
|
const onFocusIn = () => {
|
|
10483
10480
|
window.requestAnimationFrame(() => {
|
|
10484
|
-
const metrics =
|
|
10485
|
-
const inset = metrics ?
|
|
10481
|
+
const metrics = chunkF7SX4EUT_js.readViewportMetrics(window);
|
|
10482
|
+
const inset = metrics ? chunkF7SX4EUT_js.computeKeyboardInset(metrics) : 0;
|
|
10486
10483
|
if (inset > 0) {
|
|
10487
10484
|
scrollFocusedIntoView(inset);
|
|
10488
10485
|
}
|
|
@@ -10495,7 +10492,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10495
10492
|
document.removeEventListener("focusin", onFocusIn);
|
|
10496
10493
|
};
|
|
10497
10494
|
}, [enabled]);
|
|
10498
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10495
|
+
return { keyboardInset, isKeyboardOpen: chunkF7SX4EUT_js.isKeyboardOpen(keyboardInset) };
|
|
10499
10496
|
}
|
|
10500
10497
|
|
|
10501
10498
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10522,7 +10519,7 @@ function buildCanvasProps(input) {
|
|
|
10522
10519
|
} = input;
|
|
10523
10520
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10524
10521
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10525
|
-
const fieldContext =
|
|
10522
|
+
const fieldContext = chunkF7SX4EUT_js.buildFieldSubstitutionContext({
|
|
10526
10523
|
headerFooter: s.headerFooter,
|
|
10527
10524
|
customProperties: s.customProperties,
|
|
10528
10525
|
slide: activeSlide
|
|
@@ -10532,13 +10529,13 @@ function buildCanvasProps(input) {
|
|
|
10532
10529
|
if (mode === "present") {
|
|
10533
10530
|
presentation.handlePresentationAction(action);
|
|
10534
10531
|
} else if (action.url) {
|
|
10535
|
-
|
|
10532
|
+
chunkF7SX4EUT_js.safeOpenUrl(action.url);
|
|
10536
10533
|
}
|
|
10537
10534
|
};
|
|
10538
10535
|
const handleHyperlinkClick = (url) => {
|
|
10539
|
-
if (
|
|
10536
|
+
if (chunkF7SX4EUT_js.isPpactionUrl(url)) {
|
|
10540
10537
|
if (mode === "present") {
|
|
10541
|
-
const parsed =
|
|
10538
|
+
const parsed = chunkF7SX4EUT_js.parsePpactionUrl(url);
|
|
10542
10539
|
if (parsed) {
|
|
10543
10540
|
presentation.handlePresentationAction({
|
|
10544
10541
|
action: parsed.action,
|
|
@@ -10548,7 +10545,7 @@ function buildCanvasProps(input) {
|
|
|
10548
10545
|
}
|
|
10549
10546
|
return;
|
|
10550
10547
|
}
|
|
10551
|
-
|
|
10548
|
+
chunkF7SX4EUT_js.safeOpenUrl(url);
|
|
10552
10549
|
};
|
|
10553
10550
|
return {
|
|
10554
10551
|
activeSlide: effectiveSlide,
|
|
@@ -10644,7 +10641,7 @@ function buildCanvasProps(input) {
|
|
|
10644
10641
|
|
|
10645
10642
|
// src/viewer/hooks/useScopedLayoutOptions.ts
|
|
10646
10643
|
function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
|
|
10647
|
-
return
|
|
10644
|
+
return chunkF7SX4EUT_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
|
|
10648
10645
|
}
|
|
10649
10646
|
|
|
10650
10647
|
// src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
|
|
@@ -10657,7 +10654,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10657
10654
|
const current = activeSlide.animations ?? [];
|
|
10658
10655
|
if (group === "motionPath") {
|
|
10659
10656
|
propertyHandlers.handleUpdateSlide({
|
|
10660
|
-
animations:
|
|
10657
|
+
animations: chunkF7SX4EUT_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10661
10658
|
});
|
|
10662
10659
|
return;
|
|
10663
10660
|
}
|
|
@@ -10852,7 +10849,7 @@ function buildToolbarProps(input) {
|
|
|
10852
10849
|
onOpenFile,
|
|
10853
10850
|
onOpenRecentFile,
|
|
10854
10851
|
onCreatePresentation: (templateId) => {
|
|
10855
|
-
s.setSlides(
|
|
10852
|
+
s.setSlides(chunkF7SX4EUT_js.createBackstagePresentation(templateId));
|
|
10856
10853
|
s.setActiveSlideIndex(0);
|
|
10857
10854
|
s.setSelectedElementId(null);
|
|
10858
10855
|
s.setSelectedElementIds([]);
|
|
@@ -10881,7 +10878,7 @@ function buildToolbarProps(input) {
|
|
|
10881
10878
|
loadLayoutPreviews: input.loadLayoutPreviews,
|
|
10882
10879
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
10883
10880
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
10884
|
-
templateScheme:
|
|
10881
|
+
templateScheme: chunkF7SX4EUT_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
10885
10882
|
customShows: s.customShows,
|
|
10886
10883
|
activeCustomShowId: s.activeCustomShowId,
|
|
10887
10884
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -10922,7 +10919,7 @@ function buildToolbarProps(input) {
|
|
|
10922
10919
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
10923
10920
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
10924
10921
|
formatPainterActive: s.formatPainterActive,
|
|
10925
|
-
canActivateFormatPainter:
|
|
10922
|
+
canActivateFormatPainter: chunkF7SX4EUT_js.hasCopyableFormat(selectedElement),
|
|
10926
10923
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
10927
10924
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
10928
10925
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -11210,7 +11207,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11210
11207
|
}, [incomingContent]);
|
|
11211
11208
|
const onOpenFile = react.useCallback(() => {
|
|
11212
11209
|
void (async () => {
|
|
11213
|
-
const picked = await
|
|
11210
|
+
const picked = await chunkF7SX4EUT_js.openPptxFile();
|
|
11214
11211
|
if (picked) {
|
|
11215
11212
|
setContent(picked.buffer);
|
|
11216
11213
|
}
|
|
@@ -11218,7 +11215,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11218
11215
|
}, []);
|
|
11219
11216
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11220
11217
|
void (async () => {
|
|
11221
|
-
const bytes = await
|
|
11218
|
+
const bytes = await chunkF7SX4EUT_js.readBackstageRecentFile(key);
|
|
11222
11219
|
if (bytes) {
|
|
11223
11220
|
setContent(bytes);
|
|
11224
11221
|
}
|
|
@@ -11392,7 +11389,6 @@ exports.ACTION_VERB_MAP = ACTION_VERB_MAP;
|
|
|
11392
11389
|
exports.MIN_TOUCH_TARGET = MIN_TOUCH_TARGET;
|
|
11393
11390
|
exports.computeToolbarVisibility = computeToolbarVisibility;
|
|
11394
11391
|
exports.detectTargetType = detectTargetType;
|
|
11395
|
-
exports.downloadBlob = downloadBlob2;
|
|
11396
11392
|
exports.isAudienceTab = isAudienceTab;
|
|
11397
11393
|
exports.parseAudienceNonce = parseAudienceNonce;
|
|
11398
11394
|
exports.parseEmailUrl = parseEmailUrl;
|