pptx-react-viewer 2.19.6 → 2.20.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 +23 -0
- package/README.md +1 -1
- package/dist/{AiChatPanel-IWC2BJH4.js → AiChatPanel-KOKEVIOQ.js} +24 -24
- package/dist/AiChatPanel-KOKEVIOQ.js.br +0 -0
- package/dist/AiChatPanel-KOKEVIOQ.js.gz +0 -0
- package/dist/{AiChatPanel-2VR6UFFK.mjs → AiChatPanel-S5UYFWT2.mjs} +4 -4
- package/dist/AiChatPanel-S5UYFWT2.mjs.br +0 -0
- package/dist/AiChatPanel-S5UYFWT2.mjs.gz +0 -0
- package/dist/{Model3DScene-ATRIORJV.js → Model3DScene-T5372GIJ.js} +2 -2
- package/dist/Model3DScene-T5372GIJ.js.br +0 -0
- package/dist/Model3DScene-T5372GIJ.js.gz +0 -0
- package/dist/{Model3DScene-E4T6KAJF.mjs → Model3DScene-T6QOOVLN.mjs} +1 -1
- package/dist/Model3DScene-T6QOOVLN.mjs.br +0 -0
- package/dist/Model3DScene-T6QOOVLN.mjs.gz +0 -0
- package/dist/{chunk-IWCBDKPX.mjs → chunk-2T7J57AC.mjs} +1 -1
- package/dist/chunk-2T7J57AC.mjs.br +0 -0
- package/dist/chunk-2T7J57AC.mjs.gz +0 -0
- package/dist/{chunk-MVKRI3CZ.js → chunk-6CPUGAK7.js} +2 -0
- package/dist/chunk-6CPUGAK7.js.br +0 -0
- package/dist/{chunk-MVKRI3CZ.js.gz → chunk-6CPUGAK7.js.gz} +0 -0
- package/dist/{chunk-2N2Z7WG2.js → chunk-AFAAKYYB.js} +1093 -1254
- package/dist/chunk-AFAAKYYB.js.br +0 -0
- package/dist/chunk-AFAAKYYB.js.gz +0 -0
- package/dist/{chunk-FTUGCQVY.js → chunk-BW3ZS73U.js} +178 -172
- package/dist/chunk-BW3ZS73U.js.br +0 -0
- package/dist/chunk-BW3ZS73U.js.gz +0 -0
- package/dist/{chunk-3BK53XWF.js → chunk-J56DMNSD.js} +746 -483
- package/dist/chunk-J56DMNSD.js.br +0 -0
- package/dist/chunk-J56DMNSD.js.gz +0 -0
- package/dist/{chunk-SQJBFMEX.mjs → chunk-MZOZNBRO.mjs} +2 -0
- package/dist/chunk-MZOZNBRO.mjs.br +0 -0
- package/dist/{chunk-SQJBFMEX.mjs.gz → chunk-MZOZNBRO.mjs.gz} +0 -0
- package/dist/{chunk-RQWZ7J3Z.mjs → chunk-QLELFH7A.mjs} +728 -480
- package/dist/chunk-QLELFH7A.mjs.br +0 -0
- package/dist/chunk-QLELFH7A.mjs.gz +0 -0
- package/dist/{chunk-YEEOYPFO.js → chunk-SAKMXLW2.js} +382 -379
- package/dist/chunk-SAKMXLW2.js.br +0 -0
- package/dist/chunk-SAKMXLW2.js.gz +0 -0
- package/dist/{chunk-KPNZXUKK.js → chunk-T7OUKBWK.js} +3 -3
- package/dist/chunk-T7OUKBWK.js.br +0 -0
- package/dist/chunk-T7OUKBWK.js.gz +0 -0
- package/dist/{chunk-667ZAXQN.mjs → chunk-U2UIJRSW.mjs} +25 -19
- package/dist/chunk-U2UIJRSW.mjs.br +0 -0
- package/dist/chunk-U2UIJRSW.mjs.gz +0 -0
- package/dist/{chunk-NHN6XKJV.mjs → chunk-XWCN4TGE.mjs} +67 -228
- package/dist/chunk-XWCN4TGE.mjs.br +0 -0
- package/dist/chunk-XWCN4TGE.mjs.gz +0 -0
- package/dist/{chunk-VU4RQSTI.mjs → chunk-YMNURZ22.mjs} +6 -3
- package/dist/chunk-YMNURZ22.mjs.br +0 -0
- package/dist/chunk-YMNURZ22.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/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.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-2VR6UFFK.mjs.br +0 -0
- package/dist/AiChatPanel-2VR6UFFK.mjs.gz +0 -0
- package/dist/AiChatPanel-IWC2BJH4.js.br +0 -0
- package/dist/AiChatPanel-IWC2BJH4.js.gz +0 -0
- package/dist/Model3DScene-ATRIORJV.js.br +0 -0
- package/dist/Model3DScene-ATRIORJV.js.gz +0 -0
- package/dist/Model3DScene-E4T6KAJF.mjs.br +0 -0
- package/dist/Model3DScene-E4T6KAJF.mjs.gz +0 -0
- package/dist/chunk-2N2Z7WG2.js.br +0 -0
- package/dist/chunk-2N2Z7WG2.js.gz +0 -0
- package/dist/chunk-3BK53XWF.js.br +0 -0
- package/dist/chunk-3BK53XWF.js.gz +0 -0
- package/dist/chunk-667ZAXQN.mjs.br +0 -0
- package/dist/chunk-667ZAXQN.mjs.gz +0 -0
- package/dist/chunk-FTUGCQVY.js.br +0 -0
- package/dist/chunk-FTUGCQVY.js.gz +0 -0
- package/dist/chunk-IWCBDKPX.mjs.br +0 -0
- package/dist/chunk-IWCBDKPX.mjs.gz +0 -0
- package/dist/chunk-KPNZXUKK.js.br +0 -0
- package/dist/chunk-KPNZXUKK.js.gz +0 -0
- package/dist/chunk-MVKRI3CZ.js.br +0 -0
- package/dist/chunk-NHN6XKJV.mjs.br +0 -0
- package/dist/chunk-NHN6XKJV.mjs.gz +0 -0
- package/dist/chunk-RQWZ7J3Z.mjs.br +0 -0
- package/dist/chunk-RQWZ7J3Z.mjs.gz +0 -0
- package/dist/chunk-SQJBFMEX.mjs.br +0 -0
- package/dist/chunk-VU4RQSTI.mjs.br +0 -0
- package/dist/chunk-VU4RQSTI.mjs.gz +0 -0
- package/dist/chunk-YEEOYPFO.js.br +0 -0
- package/dist/chunk-YEEOYPFO.js.gz +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkBW3ZS73U_js = require('./chunk-BW3ZS73U.js');
|
|
4
|
+
var chunk6CPUGAK7_js = require('./chunk-6CPUGAK7.js');
|
|
5
|
+
var chunkJ56DMNSD_js = require('./chunk-J56DMNSD.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 = chunkJ56DMNSD_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 = chunkJ56DMNSD_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 ??= chunkJ56DMNSD_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 >= chunkJ56DMNSD_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
|
+
}, chunkJ56DMNSD_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 = chunkJ56DMNSD_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
|
+
chunkJ56DMNSD_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 = chunkJ56DMNSD_js.validateRoomId(config.roomId);
|
|
249
249
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
250
|
-
departureRef.current =
|
|
250
|
+
departureRef.current = chunkJ56DMNSD_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 = chunkJ56DMNSD_js.validateRoomId(config.roomId);
|
|
293
|
+
const transport = config.transport ?? chunkJ56DMNSD_js.resolveTransportForServerUrl(config.serverUrl);
|
|
294
294
|
if (transport === "webrtc") {
|
|
295
295
|
await initWebrtc();
|
|
296
296
|
return;
|
|
297
297
|
}
|
|
298
|
-
if (
|
|
298
|
+
if (chunkJ56DMNSD_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 = chunkJ56DMNSD_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
|
+
chunkJ56DMNSD_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
|
+
}, chunkJ56DMNSD_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
|
+
chunkJ56DMNSD_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 = chunkJ56DMNSD_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 = chunkJ56DMNSD_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(chunkJ56DMNSD_js.cloneSlide),
|
|
536
|
+
templateElementsBySlideId: chunkJ56DMNSD_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(chunkJ56DMNSD_js.cloneSlide));
|
|
550
550
|
setTemplateElementsBySlideId(
|
|
551
|
-
|
|
551
|
+
chunkJ56DMNSD_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 = chunkBW3ZS73U_js.cloneHistorySnapshot(previousSnapshot);
|
|
591
|
+
lastHistorySnapshotRef.current = chunkBW3ZS73U_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 = chunkBW3ZS73U_js.cloneHistorySnapshot(nextSnapshot);
|
|
613
|
+
lastHistorySnapshotRef.current = chunkBW3ZS73U_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 = chunkBW3ZS73U_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 = chunkBW3ZS73U_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(chunkBW3ZS73U_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 = chunkBW3ZS73U_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(chunkJ56DMNSD_js.createWheelStepBuffer());
|
|
752
752
|
const storeRef = react.useRef(null);
|
|
753
|
-
storeRef.current ??=
|
|
753
|
+
storeRef.current ??= chunkJ56DMNSD_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 = chunkJ56DMNSD_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, chunkBW3ZS73U_js.MIN_ELEMENT_SIZE));
|
|
852
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkBW3ZS73U_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, chunkBW3ZS73U_js.MIN_ELEMENT_SIZE);
|
|
859
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkBW3ZS73U_js.MIN_ELEMENT_SIZE);
|
|
860
860
|
const availableWidth = Math.max(
|
|
861
|
-
effectiveEditorDimensions.width -
|
|
862
|
-
|
|
861
|
+
effectiveEditorDimensions.width - chunkBW3ZS73U_js.ZOOM_TO_SELECTION_PADDING,
|
|
862
|
+
chunkBW3ZS73U_js.MIN_ELEMENT_SIZE
|
|
863
863
|
);
|
|
864
864
|
const availableHeight = Math.max(
|
|
865
|
-
effectiveEditorDimensions.height -
|
|
866
|
-
|
|
865
|
+
effectiveEditorDimensions.height - chunkBW3ZS73U_js.ZOOM_TO_SELECTION_PADDING,
|
|
866
|
+
chunkBW3ZS73U_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 = chunkJ56DMNSD_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 = chunkJ56DMNSD_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: chunkJ56DMNSD_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
|
+
chunkBW3ZS73U_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 = chunkJ56DMNSD_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
|
+
chunkJ56DMNSD_js.PresentationAnimationController.collectBuildStepIds(group),
|
|
1155
1155
|
setPresentationElementStates,
|
|
1156
1156
|
buildRafRef
|
|
1157
1157
|
);
|
|
@@ -1214,7 +1214,7 @@ function useAnimationPlayback(input) {
|
|
|
1214
1214
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1215
1215
|
return;
|
|
1216
1216
|
}
|
|
1217
|
-
const controller =
|
|
1217
|
+
const controller = chunkJ56DMNSD_js.PresentationAnimationController.fromSlide(slide);
|
|
1218
1218
|
controllerRef.current = controller;
|
|
1219
1219
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1220
1220
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
@@ -1372,12 +1372,12 @@ function useAnimationPlayback(input) {
|
|
|
1372
1372
|
presentationTimersRef
|
|
1373
1373
|
};
|
|
1374
1374
|
}
|
|
1375
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1376
|
-
var AUDIENCE_HASH =
|
|
1377
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1378
|
-
var AUDIENCE_NONCE_KEY =
|
|
1375
|
+
var PRESENTER_CHANNEL_NAME = chunkJ56DMNSD_js.PRESENTATION_CHANNEL_NAME;
|
|
1376
|
+
var AUDIENCE_HASH = chunkJ56DMNSD_js.PRESENTATION_HASH;
|
|
1377
|
+
var PRESENTER_MSG_ORIGIN = chunkJ56DMNSD_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1378
|
+
var AUDIENCE_NONCE_KEY = chunkJ56DMNSD_js.PRESENTATION_NONCE_KEY;
|
|
1379
1379
|
function generateSessionId() {
|
|
1380
|
-
return
|
|
1380
|
+
return chunkJ56DMNSD_js.createPresentationSessionId();
|
|
1381
1381
|
}
|
|
1382
1382
|
function parseAudienceNonce() {
|
|
1383
1383
|
const hash = window.location.hash;
|
|
@@ -1413,7 +1413,7 @@ function usePresenterWindow(input) {
|
|
|
1413
1413
|
}, []);
|
|
1414
1414
|
const swapDisplays = react.useCallback(async () => {
|
|
1415
1415
|
const audience = audienceWindowRef.current;
|
|
1416
|
-
return audience && !audience.closed ?
|
|
1416
|
+
return audience && !audience.closed ? chunkJ56DMNSD_js.swapPresentationWindows(window, audience) : false;
|
|
1417
1417
|
}, []);
|
|
1418
1418
|
const syncSlideToAudience = react.useCallback(
|
|
1419
1419
|
(slideIndex) => {
|
|
@@ -1477,7 +1477,7 @@ function usePresenterWindow(input) {
|
|
|
1477
1477
|
pollTimerRef.current = null;
|
|
1478
1478
|
}
|
|
1479
1479
|
if (closingSessionId) {
|
|
1480
|
-
void
|
|
1480
|
+
void chunkJ56DMNSD_js.clearAudienceContent(closingSessionId);
|
|
1481
1481
|
}
|
|
1482
1482
|
}, [getChannel]);
|
|
1483
1483
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1495,10 +1495,10 @@ function usePresenterWindow(input) {
|
|
|
1495
1495
|
audienceWindowRef.current = blankWin;
|
|
1496
1496
|
const sessionId = generateSessionId();
|
|
1497
1497
|
sessionIdRef.current = sessionId;
|
|
1498
|
-
const audienceUrl =
|
|
1499
|
-
void
|
|
1498
|
+
const audienceUrl = chunkJ56DMNSD_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1499
|
+
void chunkJ56DMNSD_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1500
1500
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1501
|
-
|
|
1501
|
+
chunkJ56DMNSD_js.placeAudienceWindow(blankWin, placement);
|
|
1502
1502
|
}
|
|
1503
1503
|
return void 0;
|
|
1504
1504
|
});
|
|
@@ -1528,7 +1528,7 @@ function usePresenterWindow(input) {
|
|
|
1528
1528
|
}
|
|
1529
1529
|
};
|
|
1530
1530
|
if (content) {
|
|
1531
|
-
void
|
|
1531
|
+
void chunkJ56DMNSD_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1532
1532
|
} else {
|
|
1533
1533
|
navigateOrClose(true);
|
|
1534
1534
|
}
|
|
@@ -1554,7 +1554,7 @@ function usePresenterWindow(input) {
|
|
|
1554
1554
|
}
|
|
1555
1555
|
const handleMessage = (event) => {
|
|
1556
1556
|
const message = event.data;
|
|
1557
|
-
if (
|
|
1557
|
+
if (chunkJ56DMNSD_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1558
1558
|
syncStateToAudience(snapshotRef.current);
|
|
1559
1559
|
}
|
|
1560
1560
|
};
|
|
@@ -1583,7 +1583,7 @@ function usePresenterWindow(input) {
|
|
|
1583
1583
|
react.useEffect(() => {
|
|
1584
1584
|
const handleBeforeUnload = () => {
|
|
1585
1585
|
if (sessionIdRef.current) {
|
|
1586
|
-
void
|
|
1586
|
+
void chunkJ56DMNSD_js.clearAudienceContent(sessionIdRef.current);
|
|
1587
1587
|
}
|
|
1588
1588
|
};
|
|
1589
1589
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1645,7 +1645,7 @@ function useAudienceMode(input) {
|
|
|
1645
1645
|
}
|
|
1646
1646
|
channel.onmessage = (event) => {
|
|
1647
1647
|
const data = event.data;
|
|
1648
|
-
if (!
|
|
1648
|
+
if (!chunkJ56DMNSD_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1649
1649
|
return;
|
|
1650
1650
|
}
|
|
1651
1651
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1661,16 +1661,16 @@ function useAudienceMode(input) {
|
|
|
1661
1661
|
}
|
|
1662
1662
|
if (data.type === "presenter-exit") {
|
|
1663
1663
|
if (expectedSessionId) {
|
|
1664
|
-
void
|
|
1664
|
+
void chunkJ56DMNSD_js.clearAudienceContent(expectedSessionId);
|
|
1665
1665
|
}
|
|
1666
|
-
if (
|
|
1666
|
+
if (chunkJ56DMNSD_js.endAudienceDisplay(window)) {
|
|
1667
1667
|
handlers.onPresenterEnded?.();
|
|
1668
1668
|
}
|
|
1669
1669
|
}
|
|
1670
1670
|
};
|
|
1671
1671
|
if (expectedSessionId) {
|
|
1672
1672
|
channel.postMessage({
|
|
1673
|
-
origin:
|
|
1673
|
+
origin: chunkJ56DMNSD_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1674
1674
|
type: "audience-ready",
|
|
1675
1675
|
sessionId: expectedSessionId
|
|
1676
1676
|
});
|
|
@@ -1684,7 +1684,7 @@ function useAudienceMode(input) {
|
|
|
1684
1684
|
}, []);
|
|
1685
1685
|
}
|
|
1686
1686
|
function usePresentationKeyboard(input) {
|
|
1687
|
-
const wheelBufferRef = react.useRef(
|
|
1687
|
+
const wheelBufferRef = react.useRef(chunkJ56DMNSD_js.createWheelStepBuffer());
|
|
1688
1688
|
const {
|
|
1689
1689
|
mode,
|
|
1690
1690
|
movePresentationSlide,
|
|
@@ -1705,14 +1705,14 @@ function usePresentationKeyboard(input) {
|
|
|
1705
1705
|
presentationSlideIndex,
|
|
1706
1706
|
setShowRehearsalSummary
|
|
1707
1707
|
} = input;
|
|
1708
|
-
const keyBufferRef = react.useRef(
|
|
1708
|
+
const keyBufferRef = react.useRef(chunkJ56DMNSD_js.createPresentationKeyBuffer());
|
|
1709
1709
|
react.useEffect(() => {
|
|
1710
|
-
if (mode !== "present" || !
|
|
1711
|
-
keyBufferRef.current =
|
|
1710
|
+
if (mode !== "present" || !chunkJ56DMNSD_js.acceptsPresentationInput()) {
|
|
1711
|
+
keyBufferRef.current = chunkJ56DMNSD_js.createPresentationKeyBuffer();
|
|
1712
1712
|
return;
|
|
1713
1713
|
}
|
|
1714
1714
|
const handleKeyDown = (event) => {
|
|
1715
|
-
const mapped =
|
|
1715
|
+
const mapped = chunkJ56DMNSD_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1716
1716
|
if (mapped.action === "none") {
|
|
1717
1717
|
return;
|
|
1718
1718
|
}
|
|
@@ -1732,12 +1732,12 @@ function usePresentationKeyboard(input) {
|
|
|
1732
1732
|
movePresentationSlide(-1);
|
|
1733
1733
|
return;
|
|
1734
1734
|
case "first": {
|
|
1735
|
-
const first =
|
|
1735
|
+
const first = chunkJ56DMNSD_js.firstShowSlideIndex(showSlideIndexes);
|
|
1736
1736
|
navigateToSlide(first ?? 0);
|
|
1737
1737
|
return;
|
|
1738
1738
|
}
|
|
1739
1739
|
case "last": {
|
|
1740
|
-
const last =
|
|
1740
|
+
const last = chunkJ56DMNSD_js.lastShowSlideIndex(showSlideIndexes);
|
|
1741
1741
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1742
1742
|
return;
|
|
1743
1743
|
}
|
|
@@ -1775,10 +1775,10 @@ function usePresentationKeyboard(input) {
|
|
|
1775
1775
|
}
|
|
1776
1776
|
};
|
|
1777
1777
|
const handleWheel = (event) => {
|
|
1778
|
-
if (mode !== "present" || !
|
|
1778
|
+
if (mode !== "present" || !chunkJ56DMNSD_js.acceptsPresentationInput()) {
|
|
1779
1779
|
return;
|
|
1780
1780
|
}
|
|
1781
|
-
const mapped =
|
|
1781
|
+
const mapped = chunkJ56DMNSD_js.mapPresentationWheel(event, wheelBufferRef.current);
|
|
1782
1782
|
if (mapped.intent === "next-slide") {
|
|
1783
1783
|
event.preventDefault();
|
|
1784
1784
|
movePresentationSlide(1);
|
|
@@ -1911,7 +1911,7 @@ function useRehearsalTimings(input) {
|
|
|
1911
1911
|
|
|
1912
1912
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1913
1913
|
function handlePresentationActionImpl(action, deps) {
|
|
1914
|
-
|
|
1914
|
+
chunkJ56DMNSD_js.runPresentationAction(
|
|
1915
1915
|
action,
|
|
1916
1916
|
{ slideCount: deps.slidesLength },
|
|
1917
1917
|
{
|
|
@@ -1933,7 +1933,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1933
1933
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1934
1934
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1935
1935
|
const transition = incomingSlide?.transition;
|
|
1936
|
-
const durationMs = deps.playTransition ?
|
|
1936
|
+
const durationMs = deps.playTransition ? chunkJ56DMNSD_js.resolveTransitionDurationMs(transition) : 0;
|
|
1937
1937
|
deps.clearPresentationTimers();
|
|
1938
1938
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1939
1939
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -1992,7 +1992,7 @@ function useSlideNavigation(input) {
|
|
|
1992
1992
|
});
|
|
1993
1993
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
1994
1994
|
(slideIndex) => {
|
|
1995
|
-
const delayMs =
|
|
1995
|
+
const delayMs = chunkJ56DMNSD_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
1996
1996
|
if (delayMs === void 0) {
|
|
1997
1997
|
return;
|
|
1998
1998
|
}
|
|
@@ -2015,7 +2015,7 @@ function useSlideNavigation(input) {
|
|
|
2015
2015
|
if (availableSlideIndexes.length === 0) {
|
|
2016
2016
|
return;
|
|
2017
2017
|
}
|
|
2018
|
-
const pastLastSlide = direction === 1 && !
|
|
2018
|
+
const pastLastSlide = direction === 1 && !chunkJ56DMNSD_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
2019
2019
|
if (rehearsing && pastLastSlide) {
|
|
2020
2020
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
2021
2021
|
try {
|
|
@@ -2033,9 +2033,9 @@ function useSlideNavigation(input) {
|
|
|
2033
2033
|
onAdvancePastLastSlide();
|
|
2034
2034
|
return;
|
|
2035
2035
|
}
|
|
2036
|
-
const nextSlideIndex = direction === 1 ?
|
|
2036
|
+
const nextSlideIndex = direction === 1 ? chunkJ56DMNSD_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
2037
2037
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
2038
|
-
}) :
|
|
2038
|
+
}) : chunkJ56DMNSD_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
2039
2039
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
2040
2040
|
return;
|
|
2041
2041
|
}
|
|
@@ -2180,22 +2180,22 @@ function useZoomNavigation(input) {
|
|
|
2180
2180
|
};
|
|
2181
2181
|
}
|
|
2182
2182
|
function usePresenterConsole(slideIndex, active) {
|
|
2183
|
-
const timerRef = react.useRef(
|
|
2184
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2183
|
+
const timerRef = react.useRef(chunkJ56DMNSD_js.createPresenterTimer());
|
|
2184
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkJ56DMNSD_js.createInitialPresentationSnapshot(slideIndex));
|
|
2185
2185
|
const patch = react.useCallback((value) => {
|
|
2186
|
-
setSnapshot((current) =>
|
|
2186
|
+
setSnapshot((current) => chunkJ56DMNSD_js.mergePresentationSnapshot(current, value));
|
|
2187
2187
|
}, []);
|
|
2188
2188
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2189
2189
|
react.useEffect(() => {
|
|
2190
2190
|
if (!active) {
|
|
2191
2191
|
return;
|
|
2192
2192
|
}
|
|
2193
|
-
timerRef.current =
|
|
2193
|
+
timerRef.current = chunkJ56DMNSD_js.resetPresenterTimer();
|
|
2194
2194
|
patch({ paused: false, elapsedMs: 0 });
|
|
2195
2195
|
const timer = window.setInterval(() => {
|
|
2196
2196
|
patch({
|
|
2197
2197
|
paused: timerRef.current.paused,
|
|
2198
|
-
elapsedMs:
|
|
2198
|
+
elapsedMs: chunkJ56DMNSD_js.presenterElapsed(timerRef.current)
|
|
2199
2199
|
});
|
|
2200
2200
|
}, 1e3);
|
|
2201
2201
|
return () => window.clearInterval(timer);
|
|
@@ -2205,19 +2205,19 @@ function usePresenterConsole(slideIndex, active) {
|
|
|
2205
2205
|
applyAudienceSnapshot: setSnapshot,
|
|
2206
2206
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2207
2207
|
toggleTimer: () => {
|
|
2208
|
-
timerRef.current =
|
|
2208
|
+
timerRef.current = chunkJ56DMNSD_js.togglePresenterTimer(timerRef.current);
|
|
2209
2209
|
patch({
|
|
2210
2210
|
paused: timerRef.current.paused,
|
|
2211
|
-
elapsedMs:
|
|
2211
|
+
elapsedMs: chunkJ56DMNSD_js.presenterElapsed(timerRef.current)
|
|
2212
2212
|
});
|
|
2213
2213
|
},
|
|
2214
2214
|
resetTimer: () => {
|
|
2215
|
-
timerRef.current =
|
|
2215
|
+
timerRef.current = chunkJ56DMNSD_js.resetPresenterTimer();
|
|
2216
2216
|
patch({ paused: false, elapsedMs: 0 });
|
|
2217
2217
|
},
|
|
2218
2218
|
stepZoom: (direction) => setSnapshot(
|
|
2219
|
-
(current) =>
|
|
2220
|
-
zoom:
|
|
2219
|
+
(current) => chunkJ56DMNSD_js.mergePresentationSnapshot(current, {
|
|
2220
|
+
zoom: chunkJ56DMNSD_js.stepPresenterZoom(
|
|
2221
2221
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2222
2222
|
direction
|
|
2223
2223
|
)
|
|
@@ -2263,7 +2263,7 @@ function usePresentationMode(input) {
|
|
|
2263
2263
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2264
2264
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2265
2265
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2266
|
-
const showGuard = react.useMemo(() =>
|
|
2266
|
+
const showGuard = react.useMemo(() => chunkJ56DMNSD_js.createPresenterShowGuard(), []);
|
|
2267
2267
|
const {
|
|
2268
2268
|
presentationAnimations,
|
|
2269
2269
|
presentationElementStates,
|
|
@@ -2342,7 +2342,7 @@ function usePresentationMode(input) {
|
|
|
2342
2342
|
});
|
|
2343
2343
|
const movePresentationSlide = react.useCallback(
|
|
2344
2344
|
(direction, trigger = "explicit") => {
|
|
2345
|
-
if (!
|
|
2345
|
+
if (!chunkJ56DMNSD_js.acceptsPresentationInput()) {
|
|
2346
2346
|
return;
|
|
2347
2347
|
}
|
|
2348
2348
|
if (endOfShowVisible) {
|
|
@@ -2480,7 +2480,7 @@ function usePresentationMode(input) {
|
|
|
2480
2480
|
if (mode !== "present") {
|
|
2481
2481
|
return;
|
|
2482
2482
|
}
|
|
2483
|
-
return
|
|
2483
|
+
return chunkJ56DMNSD_js.attachPresentationVisibilityPause({
|
|
2484
2484
|
root: containerRef.current ?? void 0,
|
|
2485
2485
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2486
2486
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
@@ -2560,11 +2560,11 @@ function usePresentationMode(input) {
|
|
|
2560
2560
|
if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
|
|
2561
2561
|
return void 0;
|
|
2562
2562
|
}
|
|
2563
|
-
return
|
|
2563
|
+
return chunkJ56DMNSD_js.buildMorphTransitionPlan(
|
|
2564
2564
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2565
2565
|
slides[transitionOverlay.incomingSlideIndex],
|
|
2566
2566
|
transitionOverlay.durationMs,
|
|
2567
|
-
|
|
2567
|
+
chunkJ56DMNSD_js.morphOptionToMode(transitionOverlay.transition.morphOption)
|
|
2568
2568
|
);
|
|
2569
2569
|
}, [transitionOverlay, slides]);
|
|
2570
2570
|
const morphedElementStates = react.useMemo(() => {
|
|
@@ -2585,7 +2585,7 @@ function usePresentationMode(input) {
|
|
|
2585
2585
|
if (!morphPlan) {
|
|
2586
2586
|
return presentationKeyframesCss;
|
|
2587
2587
|
}
|
|
2588
|
-
const imageRules =
|
|
2588
|
+
const imageRules = chunkJ56DMNSD_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
|
|
2589
2589
|
return `${presentationKeyframesCss ?? ""}
|
|
2590
2590
|
${morphPlan.keyframesCss}
|
|
2591
2591
|
${imageRules}`;
|
|
@@ -2881,7 +2881,7 @@ function useFindReplace({
|
|
|
2881
2881
|
const [findResults, setFindResults] = react.useState([]);
|
|
2882
2882
|
const [findResultIndex, setFindResultIndex] = react.useState(-1);
|
|
2883
2883
|
const performFind = react.useCallback(() => {
|
|
2884
|
-
const results =
|
|
2884
|
+
const results = chunkJ56DMNSD_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
|
|
2885
2885
|
if (!findQuery) {
|
|
2886
2886
|
setFindResults([]);
|
|
2887
2887
|
setFindResultIndex(-1);
|
|
@@ -2915,7 +2915,7 @@ function useFindReplace({
|
|
|
2915
2915
|
return;
|
|
2916
2916
|
}
|
|
2917
2917
|
onUpdateSlides(
|
|
2918
|
-
(prevSlides) =>
|
|
2918
|
+
(prevSlides) => chunkJ56DMNSD_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
|
|
2919
2919
|
);
|
|
2920
2920
|
onMarkDirty();
|
|
2921
2921
|
},
|
|
@@ -2937,9 +2937,9 @@ function useFindReplace({
|
|
|
2937
2937
|
}, [findResults, applyReplacements, performFind]);
|
|
2938
2938
|
react.useEffect(() => {
|
|
2939
2939
|
const handler = (event) => {
|
|
2940
|
-
const { action } =
|
|
2940
|
+
const { action } = chunkJ56DMNSD_js.mapEditorKey(event, {
|
|
2941
2941
|
canEdit: mode === "edit",
|
|
2942
|
-
isTextInputTarget:
|
|
2942
|
+
isTextInputTarget: chunkJ56DMNSD_js.isEditorTextInputTarget(event.target)
|
|
2943
2943
|
});
|
|
2944
2944
|
if (action !== "find") {
|
|
2945
2945
|
return;
|
|
@@ -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(() => chunkJ56DMNSD_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: chunkBW3ZS73U_js.DEFAULT_CANVAS_WIDTH,
|
|
3462
|
+
height: chunkBW3ZS73U_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
|
+
chunkJ56DMNSD_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 chunkJ56DMNSD_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
|
+
chunkJ56DMNSD_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 } = chunkJ56DMNSD_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 = chunkJ56DMNSD_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 ?? chunkBW3ZS73U_js.DEFAULT_CANVAS_WIDTH,
|
|
3935
|
+
height: parsed.height ?? chunkBW3ZS73U_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
|
+
chunkJ56DMNSD_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(chunkJ56DMNSD_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 chunkJ56DMNSD_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 = chunkJ56DMNSD_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 (!chunkJ56DMNSD_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 chunkJ56DMNSD_js.saveAutosaveSnapshot(path, data);
|
|
4059
|
+
lastSnapshotRef.current = chunkJ56DMNSD_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
|
+
chunkJ56DMNSD_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
|
|
4146
4146
|
);
|
|
4147
4147
|
return;
|
|
4148
4148
|
}
|
|
4149
|
-
if (
|
|
4149
|
+
if (chunkJ56DMNSD_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 || !chunkJ56DMNSD_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 || !chunkJ56DMNSD_js.hasTextProperties(selectedElement)) {
|
|
4209
4209
|
return;
|
|
4210
4210
|
}
|
|
4211
|
-
const inlineSel =
|
|
4211
|
+
const inlineSel = chunkJ56DMNSD_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4212
4212
|
if (inlineSel && selectedElement.textSegments) {
|
|
4213
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4213
|
+
const { newSegments: newSegments2, newSelection } = chunkJ56DMNSD_js.applyStyleToSelectedSegments(
|
|
4214
4214
|
selectedElement.textSegments,
|
|
4215
4215
|
inlineSel,
|
|
4216
4216
|
updates
|
|
4217
4217
|
);
|
|
4218
|
-
|
|
4218
|
+
chunkJ56DMNSD_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 || !chunkJ56DMNSD_js.hasTextProperties(selectedElement)) {
|
|
4239
4239
|
return;
|
|
4240
4240
|
}
|
|
4241
|
-
const inlineSel =
|
|
4241
|
+
const inlineSel = chunkJ56DMNSD_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4242
4242
|
if (inlineSel && selectedElement.textSegments) {
|
|
4243
|
-
const newSegments =
|
|
4243
|
+
const newSegments = chunkJ56DMNSD_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 = chunkJ56DMNSD_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 = chunkJ56DMNSD_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 ? chunkJ56DMNSD_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
|
+
chunkJ56DMNSD_js.replaceMasterViewElements(
|
|
4279
4279
|
masterView,
|
|
4280
4280
|
masterView.target,
|
|
4281
|
-
updater(
|
|
4281
|
+
updater(chunkJ56DMNSD_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 = chunkJ56DMNSD_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 = chunkJ56DMNSD_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 = chunkJ56DMNSD_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(chunkJ56DMNSD_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(chunkJ56DMNSD_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 = chunkJ56DMNSD_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 = chunkJ56DMNSD_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: chunkBW3ZS73U_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 chunkJ56DMNSD_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkBW3ZS73U_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 = chunkJ56DMNSD_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
|
+
chunkJ56DMNSD_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, chunkBW3ZS73U_js.MIN_ELEMENT_SIZE)}px`;
|
|
4603
|
+
rs.domEl.style.height = `${Math.max(geo.height, chunkBW3ZS73U_js.MIN_ELEMENT_SIZE)}px`;
|
|
4604
4604
|
}
|
|
4605
4605
|
if (live) {
|
|
4606
|
-
|
|
4606
|
+
chunkJ56DMNSD_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, chunkBW3ZS73U_js.MIN_ELEMENT_SIZE),
|
|
4610
|
+
height: Math.max(geo.height, chunkBW3ZS73U_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 = chunkJ56DMNSD_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 = chunkJ56DMNSD_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: chunkJ56DMNSD_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 = chunkJ56DMNSD_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4724
4724
|
if (marquee.additive) {
|
|
4725
|
-
const merged =
|
|
4725
|
+
const merged = chunkJ56DMNSD_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 = chunkJ56DMNSD_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4749
|
+
return chunkJ56DMNSD_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 && chunkJ56DMNSD_js.hasTextProperties(el)) {
|
|
4907
4907
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
4908
|
-
const newSegments =
|
|
4908
|
+
const newSegments = chunkJ56DMNSD_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 (!chunkJ56DMNSD_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 && chunkJ56DMNSD_js.hasTextProperties(el) && chunkJ56DMNSD_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 (chunkJ56DMNSD_js.hasTextProperties(el) && chunkJ56DMNSD_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 = chunkJ56DMNSD_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 || !chunkJ56DMNSD_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 || !chunkJ56DMNSD_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 || !chunkJ56DMNSD_js.canInteractWithElement(el, "adjustHandle")) {
|
|
5104
5104
|
return;
|
|
5105
5105
|
}
|
|
5106
|
-
shapeAdjustmentDragStateRef.current =
|
|
5106
|
+
shapeAdjustmentDragStateRef.current = chunkJ56DMNSD_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: chunkJ56DMNSD_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: chunkJ56DMNSD_js.generateElementId(),
|
|
5165
5165
|
type: "image",
|
|
5166
5166
|
x: 100,
|
|
5167
5167
|
y: 100,
|
|
@@ -5187,7 +5187,7 @@ function createFileHandlers(deps) {
|
|
|
5187
5187
|
const elFilePath = file.path;
|
|
5188
5188
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5189
5189
|
addElement({
|
|
5190
|
-
id:
|
|
5190
|
+
id: chunkJ56DMNSD_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: chunkJ56DMNSD_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: chunkJ56DMNSD_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: chunkJ56DMNSD_js.generateElementId(),
|
|
5384
5384
|
type: "shape",
|
|
5385
5385
|
x: 120,
|
|
5386
5386
|
y: 200,
|
|
@@ -5418,6 +5418,9 @@ function createStructuredElementHandlers(deps) {
|
|
|
5418
5418
|
return;
|
|
5419
5419
|
}
|
|
5420
5420
|
const resolved = resolveHyperlinkEditResult(data);
|
|
5421
|
+
if (resolved.url && !chunkJ56DMNSD_js.isUrlSafe(resolved.url)) {
|
|
5422
|
+
return;
|
|
5423
|
+
}
|
|
5421
5424
|
const actionClick = {
|
|
5422
5425
|
url: resolved.url || void 0,
|
|
5423
5426
|
action: resolved.action,
|
|
@@ -5439,7 +5442,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5439
5442
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5440
5443
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5441
5444
|
addElement({
|
|
5442
|
-
id:
|
|
5445
|
+
id: chunkJ56DMNSD_js.generateElementId(),
|
|
5443
5446
|
type: "shape",
|
|
5444
5447
|
x: 120,
|
|
5445
5448
|
y: 200,
|
|
@@ -5461,11 +5464,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5461
5464
|
if (!activeSlide) {
|
|
5462
5465
|
return;
|
|
5463
5466
|
}
|
|
5464
|
-
const preset =
|
|
5467
|
+
const preset = chunkJ56DMNSD_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5465
5468
|
if (!preset) {
|
|
5466
5469
|
return;
|
|
5467
5470
|
}
|
|
5468
|
-
const defaultPptxAction =
|
|
5471
|
+
const defaultPptxAction = chunkJ56DMNSD_js.elementActionToPptxAction({
|
|
5469
5472
|
trigger: "click",
|
|
5470
5473
|
type: preset.defaultAction
|
|
5471
5474
|
});
|
|
@@ -5474,7 +5477,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5474
5477
|
defaultPptxAction.highlightClick = true;
|
|
5475
5478
|
}
|
|
5476
5479
|
addElement({
|
|
5477
|
-
id:
|
|
5480
|
+
id: chunkJ56DMNSD_js.generateElementId(),
|
|
5478
5481
|
type: "shape",
|
|
5479
5482
|
x: 150,
|
|
5480
5483
|
y: 150,
|
|
@@ -5541,14 +5544,14 @@ function useInsertElements(input) {
|
|
|
5541
5544
|
return;
|
|
5542
5545
|
}
|
|
5543
5546
|
addElement({
|
|
5544
|
-
id:
|
|
5547
|
+
id: chunkJ56DMNSD_js.generateElementId(),
|
|
5545
5548
|
type: "text",
|
|
5546
5549
|
x: 100,
|
|
5547
5550
|
y: 100,
|
|
5548
5551
|
width: 300,
|
|
5549
5552
|
height: 60,
|
|
5550
5553
|
text: "",
|
|
5551
|
-
textStyle: { fontSize:
|
|
5554
|
+
textStyle: { fontSize: chunkBW3ZS73U_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5552
5555
|
});
|
|
5553
5556
|
};
|
|
5554
5557
|
const handleAddShape = () => {
|
|
@@ -5556,7 +5559,7 @@ function useInsertElements(input) {
|
|
|
5556
5559
|
return;
|
|
5557
5560
|
}
|
|
5558
5561
|
addElement({
|
|
5559
|
-
id:
|
|
5562
|
+
id: chunkJ56DMNSD_js.generateElementId(),
|
|
5560
5563
|
type: "shape",
|
|
5561
5564
|
x: 150,
|
|
5562
5565
|
y: 150,
|
|
@@ -5575,15 +5578,15 @@ function useInsertElements(input) {
|
|
|
5575
5578
|
return;
|
|
5576
5579
|
}
|
|
5577
5580
|
addElement({
|
|
5578
|
-
...
|
|
5579
|
-
id:
|
|
5581
|
+
...chunkJ56DMNSD_js.newTableElement(chunkBW3ZS73U_js.DEFAULT_TABLE_ROWS, chunkBW3ZS73U_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5582
|
+
id: chunkJ56DMNSD_js.generateElementId()
|
|
5580
5583
|
});
|
|
5581
5584
|
};
|
|
5582
5585
|
const handleAddChart = (chartKind) => {
|
|
5583
5586
|
if (!activeSlide) {
|
|
5584
5587
|
return;
|
|
5585
5588
|
}
|
|
5586
|
-
addElement(
|
|
5589
|
+
addElement(chunkJ56DMNSD_js.createDefaultChartElement(chartKind));
|
|
5587
5590
|
};
|
|
5588
5591
|
const structured = createStructuredElementHandlers({
|
|
5589
5592
|
activeSlide,
|
|
@@ -5653,7 +5656,7 @@ function useClipboardHandlers(input) {
|
|
|
5653
5656
|
if (!selectedElement) {
|
|
5654
5657
|
return;
|
|
5655
5658
|
}
|
|
5656
|
-
setClipboardPayload(
|
|
5659
|
+
setClipboardPayload(chunkJ56DMNSD_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5657
5660
|
};
|
|
5658
5661
|
const handleDelete = () => {
|
|
5659
5662
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5670,7 +5673,7 @@ function useClipboardHandlers(input) {
|
|
|
5670
5673
|
handleDelete();
|
|
5671
5674
|
};
|
|
5672
5675
|
const insertClone = (source) => {
|
|
5673
|
-
const clone =
|
|
5676
|
+
const clone = chunkJ56DMNSD_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5674
5677
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5675
5678
|
ops.applySelection(clone.id);
|
|
5676
5679
|
history.markDirty();
|
|
@@ -5705,7 +5708,7 @@ function resolveShapePath(el) {
|
|
|
5705
5708
|
return el.pathData;
|
|
5706
5709
|
}
|
|
5707
5710
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5708
|
-
const clipPath =
|
|
5711
|
+
const clipPath = chunkJ56DMNSD_js.getPresetShapeClipPath(el.shapeType);
|
|
5709
5712
|
if (clipPath) {
|
|
5710
5713
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5711
5714
|
if (svgPath) {
|
|
@@ -5756,7 +5759,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5756
5759
|
return parts.join(" ");
|
|
5757
5760
|
}
|
|
5758
5761
|
function transformPathToGlobal(pathData, el) {
|
|
5759
|
-
const polys =
|
|
5762
|
+
const polys = chunkJ56DMNSD_js.svgPathToPolygons(pathData);
|
|
5760
5763
|
if (polys.length === 0) {
|
|
5761
5764
|
return pathData;
|
|
5762
5765
|
}
|
|
@@ -5776,10 +5779,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5776
5779
|
y: pt.y * scaleY + el.y
|
|
5777
5780
|
}))
|
|
5778
5781
|
);
|
|
5779
|
-
return
|
|
5782
|
+
return chunkJ56DMNSD_js.polygonsToSvgPath(transformed);
|
|
5780
5783
|
}
|
|
5781
5784
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5782
|
-
const polys =
|
|
5785
|
+
const polys = chunkJ56DMNSD_js.svgPathToPolygons(pathData);
|
|
5783
5786
|
if (polys.length === 0) {
|
|
5784
5787
|
return pathData;
|
|
5785
5788
|
}
|
|
@@ -5789,10 +5792,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5789
5792
|
y: pt.y - y
|
|
5790
5793
|
}))
|
|
5791
5794
|
);
|
|
5792
|
-
return
|
|
5795
|
+
return chunkJ56DMNSD_js.polygonsToSvgPath(transformed);
|
|
5793
5796
|
}
|
|
5794
5797
|
function pathBounds(pathData) {
|
|
5795
|
-
const polys =
|
|
5798
|
+
const polys = chunkJ56DMNSD_js.svgPathToPolygons(pathData);
|
|
5796
5799
|
let minX = Infinity;
|
|
5797
5800
|
let minY = Infinity;
|
|
5798
5801
|
let maxX = -Infinity;
|
|
@@ -5851,7 +5854,7 @@ function useMergeShapesHandler(input) {
|
|
|
5851
5854
|
let allFragments = [];
|
|
5852
5855
|
let remaining = globalPaths[0];
|
|
5853
5856
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5854
|
-
const frags =
|
|
5857
|
+
const frags = chunkJ56DMNSD_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
5855
5858
|
if (Array.isArray(frags)) {
|
|
5856
5859
|
allFragments = frags;
|
|
5857
5860
|
}
|
|
@@ -5880,7 +5883,7 @@ function useMergeShapesHandler(input) {
|
|
|
5880
5883
|
bounds.height
|
|
5881
5884
|
);
|
|
5882
5885
|
const newEl = {
|
|
5883
|
-
id:
|
|
5886
|
+
id: chunkJ56DMNSD_js.generateElementId(),
|
|
5884
5887
|
type: "shape",
|
|
5885
5888
|
x: bounds.x,
|
|
5886
5889
|
y: bounds.y,
|
|
@@ -5918,7 +5921,7 @@ function useMergeShapesHandler(input) {
|
|
|
5918
5921
|
} else {
|
|
5919
5922
|
let resultPath = globalPaths[0];
|
|
5920
5923
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5921
|
-
const result =
|
|
5924
|
+
const result = chunkJ56DMNSD_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
5922
5925
|
if (typeof result === "string") {
|
|
5923
5926
|
resultPath = result;
|
|
5924
5927
|
}
|
|
@@ -5939,7 +5942,7 @@ function useMergeShapesHandler(input) {
|
|
|
5939
5942
|
);
|
|
5940
5943
|
const primary = targets[0];
|
|
5941
5944
|
const newEl = {
|
|
5942
|
-
id:
|
|
5945
|
+
id: chunkJ56DMNSD_js.generateElementId(),
|
|
5943
5946
|
type: "shape",
|
|
5944
5947
|
x: bounds.x,
|
|
5945
5948
|
y: bounds.y,
|
|
@@ -6002,7 +6005,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6002
6005
|
if (ids.length < 2 || !activeSlide) {
|
|
6003
6006
|
return;
|
|
6004
6007
|
}
|
|
6005
|
-
const { elements, groupId } =
|
|
6008
|
+
const { elements, groupId } = chunkJ56DMNSD_js.groupElements(ops.activeElements, ids, chunkJ56DMNSD_js.generateElementId());
|
|
6006
6009
|
if (groupId === null) {
|
|
6007
6010
|
return;
|
|
6008
6011
|
}
|
|
@@ -6015,11 +6018,11 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6015
6018
|
return;
|
|
6016
6019
|
}
|
|
6017
6020
|
const group = selectedElement;
|
|
6018
|
-
const intoTemplate =
|
|
6021
|
+
const intoTemplate = chunkJ56DMNSD_js.isTemplateElementId(group.id);
|
|
6019
6022
|
const childIds = group.children.map(
|
|
6020
|
-
(child) => intoTemplate ?
|
|
6023
|
+
(child) => intoTemplate ? chunkJ56DMNSD_js.makeCloneId(true, child.id || group.id) : child.id || chunkJ56DMNSD_js.generateElementId()
|
|
6021
6024
|
);
|
|
6022
|
-
const { elements, childIds: usedIds } =
|
|
6025
|
+
const { elements, childIds: usedIds } = chunkJ56DMNSD_js.ungroupElements(
|
|
6023
6026
|
ops.activeElements,
|
|
6024
6027
|
group.id,
|
|
6025
6028
|
childIds,
|
|
@@ -6048,7 +6051,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6048
6051
|
if (!edge) {
|
|
6049
6052
|
return;
|
|
6050
6053
|
}
|
|
6051
|
-
const positions =
|
|
6054
|
+
const positions = chunkJ56DMNSD_js.alignElements(selectedElements, edge);
|
|
6052
6055
|
for (const [id, pos] of positions) {
|
|
6053
6056
|
const el = elementLookup.get(id);
|
|
6054
6057
|
if (!el) {
|
|
@@ -6066,7 +6069,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6066
6069
|
if (!distAxis) {
|
|
6067
6070
|
return;
|
|
6068
6071
|
}
|
|
6069
|
-
const positions =
|
|
6072
|
+
const positions = chunkJ56DMNSD_js.distributeElements(selectedElements, distAxis);
|
|
6070
6073
|
for (const [id, pos] of positions) {
|
|
6071
6074
|
const el = elementLookup.get(id);
|
|
6072
6075
|
if (!el) {
|
|
@@ -6083,7 +6086,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6083
6086
|
}
|
|
6084
6087
|
const id = selectedElement.id;
|
|
6085
6088
|
ops.updateActiveElements(
|
|
6086
|
-
(els) => direction === "forward" ?
|
|
6089
|
+
(els) => direction === "forward" ? chunkJ56DMNSD_js.bringForward(els, id) : direction === "backward" ? chunkJ56DMNSD_js.sendBackward(els, id) : els
|
|
6087
6090
|
);
|
|
6088
6091
|
history.markDirty();
|
|
6089
6092
|
};
|
|
@@ -6093,7 +6096,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6093
6096
|
}
|
|
6094
6097
|
const id = selectedElement.id;
|
|
6095
6098
|
ops.updateActiveElements(
|
|
6096
|
-
(els) => direction === "front" ?
|
|
6099
|
+
(els) => direction === "front" ? chunkJ56DMNSD_js.bringToFront(els, id) : chunkJ56DMNSD_js.sendToBack(els, id)
|
|
6097
6100
|
);
|
|
6098
6101
|
history.markDirty();
|
|
6099
6102
|
};
|
|
@@ -6224,7 +6227,7 @@ function useSlideManagement(input) {
|
|
|
6224
6227
|
theme
|
|
6225
6228
|
} = input;
|
|
6226
6229
|
const handleAddSlide = () => {
|
|
6227
|
-
const newSlide =
|
|
6230
|
+
const newSlide = chunkJ56DMNSD_js.createBlankSlide(slides.length + 1);
|
|
6228
6231
|
ops.updateSlides((prev) => {
|
|
6229
6232
|
const next = [...prev];
|
|
6230
6233
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6287,7 +6290,7 @@ function useSlideManagement(input) {
|
|
|
6287
6290
|
}
|
|
6288
6291
|
const clone = {
|
|
6289
6292
|
...src,
|
|
6290
|
-
id:
|
|
6293
|
+
id: chunkJ56DMNSD_js.makeSlideId(),
|
|
6291
6294
|
elements: src.elements.map((el) => ({
|
|
6292
6295
|
...el,
|
|
6293
6296
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6319,7 +6322,7 @@ function useSlideManagement(input) {
|
|
|
6319
6322
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6320
6323
|
const insertAt = activeSlideIndex + 1;
|
|
6321
6324
|
const draft = {
|
|
6322
|
-
...
|
|
6325
|
+
...chunkJ56DMNSD_js.createBlankSlide(slides.length + 1),
|
|
6323
6326
|
layoutPath,
|
|
6324
6327
|
...layoutName ? { layoutName } : {}
|
|
6325
6328
|
};
|
|
@@ -6352,9 +6355,9 @@ function useSlideManagement(input) {
|
|
|
6352
6355
|
};
|
|
6353
6356
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6354
6357
|
const insertAt = activeSlideIndex + 1;
|
|
6355
|
-
const draft =
|
|
6358
|
+
const draft = chunkJ56DMNSD_js.buildSlideTemplateSlide(templateId, chunkJ56DMNSD_js.makeSlideId(), slides.length + 1, {
|
|
6356
6359
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6357
|
-
scheme:
|
|
6360
|
+
scheme: chunkJ56DMNSD_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6358
6361
|
});
|
|
6359
6362
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6360
6363
|
setActiveSlideIndex(insertAt);
|
|
@@ -6391,7 +6394,7 @@ function createTableMergeHandlers(input) {
|
|
|
6391
6394
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6392
6395
|
return;
|
|
6393
6396
|
}
|
|
6394
|
-
const newTableData =
|
|
6397
|
+
const newTableData = chunkJ56DMNSD_js.mergeCells(
|
|
6395
6398
|
[
|
|
6396
6399
|
{ row: rowIndex, col: columnIndex },
|
|
6397
6400
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6399,7 +6402,7 @@ function createTableMergeHandlers(input) {
|
|
|
6399
6402
|
td
|
|
6400
6403
|
);
|
|
6401
6404
|
const updates = { tableData: newTableData };
|
|
6402
|
-
const newRawXml =
|
|
6405
|
+
const newRawXml = chunkJ56DMNSD_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6403
6406
|
if (newRawXml) {
|
|
6404
6407
|
updates.rawXml = newRawXml;
|
|
6405
6408
|
}
|
|
@@ -6425,7 +6428,7 @@ function createTableMergeHandlers(input) {
|
|
|
6425
6428
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6426
6429
|
return;
|
|
6427
6430
|
}
|
|
6428
|
-
const newTableData =
|
|
6431
|
+
const newTableData = chunkJ56DMNSD_js.mergeCells(
|
|
6429
6432
|
[
|
|
6430
6433
|
{ row: rowIndex, col: columnIndex },
|
|
6431
6434
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6433,7 +6436,7 @@ function createTableMergeHandlers(input) {
|
|
|
6433
6436
|
td
|
|
6434
6437
|
);
|
|
6435
6438
|
const updates = { tableData: newTableData };
|
|
6436
|
-
const newRawXml =
|
|
6439
|
+
const newRawXml = chunkJ56DMNSD_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6437
6440
|
if (newRawXml) {
|
|
6438
6441
|
updates.rawXml = newRawXml;
|
|
6439
6442
|
}
|
|
@@ -6448,9 +6451,9 @@ function createTableMergeHandlers(input) {
|
|
|
6448
6451
|
return;
|
|
6449
6452
|
}
|
|
6450
6453
|
const td = selectedElement.tableData;
|
|
6451
|
-
const newTableData =
|
|
6454
|
+
const newTableData = chunkJ56DMNSD_js.mergeCells(ts.selectedCells, td);
|
|
6452
6455
|
const updates = { tableData: newTableData };
|
|
6453
|
-
const newRawXml =
|
|
6456
|
+
const newRawXml = chunkJ56DMNSD_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6454
6457
|
if (newRawXml) {
|
|
6455
6458
|
updates.rawXml = newRawXml;
|
|
6456
6459
|
}
|
|
@@ -6467,9 +6470,9 @@ function createTableMergeHandlers(input) {
|
|
|
6467
6470
|
}
|
|
6468
6471
|
const { rowIndex, columnIndex } = ts;
|
|
6469
6472
|
const td = selectedElement.tableData;
|
|
6470
|
-
const newTableData =
|
|
6473
|
+
const newTableData = chunkJ56DMNSD_js.splitCell(rowIndex, columnIndex, td);
|
|
6471
6474
|
const updates = { tableData: newTableData };
|
|
6472
|
-
const newRawXml =
|
|
6475
|
+
const newRawXml = chunkJ56DMNSD_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6473
6476
|
if (newRawXml) {
|
|
6474
6477
|
updates.rawXml = newRawXml;
|
|
6475
6478
|
}
|
|
@@ -6501,10 +6504,10 @@ function createTableStructHandlers(input) {
|
|
|
6501
6504
|
}
|
|
6502
6505
|
const updates = {};
|
|
6503
6506
|
if (el.tableData) {
|
|
6504
|
-
updates.tableData =
|
|
6507
|
+
updates.tableData = chunkJ56DMNSD_js.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
6505
6508
|
}
|
|
6506
6509
|
if (el.rawXml) {
|
|
6507
|
-
const newRawXml =
|
|
6510
|
+
const newRawXml = chunkJ56DMNSD_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6508
6511
|
if (newRawXml) {
|
|
6509
6512
|
updates.rawXml = newRawXml;
|
|
6510
6513
|
}
|
|
@@ -6528,7 +6531,7 @@ function createTableStructHandlers(input) {
|
|
|
6528
6531
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6529
6532
|
const updates = {};
|
|
6530
6533
|
if (selectedElement.rawXml) {
|
|
6531
|
-
const newRawXml =
|
|
6534
|
+
const newRawXml = chunkJ56DMNSD_js.updateCellTextStyleInRawXml(
|
|
6532
6535
|
selectedElement,
|
|
6533
6536
|
rowIndex,
|
|
6534
6537
|
colIndex,
|
|
@@ -6592,9 +6595,9 @@ function createTableStructHandlers(input) {
|
|
|
6592
6595
|
return;
|
|
6593
6596
|
}
|
|
6594
6597
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6595
|
-
const newTableData =
|
|
6598
|
+
const newTableData = chunkJ56DMNSD_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6596
6599
|
const updates = { tableData: newTableData };
|
|
6597
|
-
const newRawXml =
|
|
6600
|
+
const newRawXml = chunkJ56DMNSD_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6598
6601
|
if (newRawXml) {
|
|
6599
6602
|
updates.rawXml = newRawXml;
|
|
6600
6603
|
}
|
|
@@ -6607,12 +6610,12 @@ function createTableStructHandlers(input) {
|
|
|
6607
6610
|
}
|
|
6608
6611
|
const td = selectedElement.tableData;
|
|
6609
6612
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6610
|
-
const newTableData =
|
|
6613
|
+
const newTableData = chunkJ56DMNSD_js.deleteTableRow(td, rowIdx);
|
|
6611
6614
|
if (newTableData === td) {
|
|
6612
6615
|
return;
|
|
6613
6616
|
}
|
|
6614
6617
|
const updates = { tableData: newTableData };
|
|
6615
|
-
const newRawXml =
|
|
6618
|
+
const newRawXml = chunkJ56DMNSD_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6616
6619
|
if (newRawXml) {
|
|
6617
6620
|
updates.rawXml = newRawXml;
|
|
6618
6621
|
}
|
|
@@ -6624,9 +6627,9 @@ function createTableStructHandlers(input) {
|
|
|
6624
6627
|
return;
|
|
6625
6628
|
}
|
|
6626
6629
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6627
|
-
const newTableData =
|
|
6630
|
+
const newTableData = chunkJ56DMNSD_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6628
6631
|
const updates = { tableData: newTableData };
|
|
6629
|
-
const newRawXml =
|
|
6632
|
+
const newRawXml = chunkJ56DMNSD_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6630
6633
|
if (newRawXml) {
|
|
6631
6634
|
updates.rawXml = newRawXml;
|
|
6632
6635
|
}
|
|
@@ -6639,12 +6642,12 @@ function createTableStructHandlers(input) {
|
|
|
6639
6642
|
}
|
|
6640
6643
|
const td = selectedElement.tableData;
|
|
6641
6644
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6642
|
-
const newTableData =
|
|
6645
|
+
const newTableData = chunkJ56DMNSD_js.deleteTableColumn(td, colIdx);
|
|
6643
6646
|
if (newTableData === td) {
|
|
6644
6647
|
return;
|
|
6645
6648
|
}
|
|
6646
6649
|
const updates = { tableData: newTableData };
|
|
6647
|
-
const newRawXml =
|
|
6650
|
+
const newRawXml = chunkJ56DMNSD_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6648
6651
|
if (newRawXml) {
|
|
6649
6652
|
updates.rawXml = newRawXml;
|
|
6650
6653
|
}
|
|
@@ -6680,8 +6683,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6680
6683
|
return html2canvasPro(element, {
|
|
6681
6684
|
...options,
|
|
6682
6685
|
onclone: async (doc, clonedEl) => {
|
|
6683
|
-
await
|
|
6684
|
-
|
|
6686
|
+
await chunkJ56DMNSD_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6687
|
+
chunkJ56DMNSD_js.preprocessCssForCapture(clonedEl);
|
|
6685
6688
|
if (typeof userOnClone === "function") {
|
|
6686
6689
|
userOnClone(doc, clonedEl);
|
|
6687
6690
|
}
|
|
@@ -6737,7 +6740,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
6737
6740
|
}
|
|
6738
6741
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
6739
6742
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
6740
|
-
|
|
6743
|
+
chunkJ56DMNSD_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
6741
6744
|
}
|
|
6742
6745
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
6743
6746
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -6759,15 +6762,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6759
6762
|
continue;
|
|
6760
6763
|
}
|
|
6761
6764
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
6762
|
-
images.push(
|
|
6765
|
+
images.push(chunkJ56DMNSD_js.canvasToJpegData(canvas));
|
|
6763
6766
|
}
|
|
6764
6767
|
onProgress?.(totalSlides, totalSlides);
|
|
6765
6768
|
setActiveSlide(currentSlideIndex);
|
|
6766
6769
|
if (images.length === 0) {
|
|
6767
|
-
throw new Error(
|
|
6770
|
+
throw new Error(chunk6CPUGAK7_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
6768
6771
|
}
|
|
6769
|
-
const pdfBlobUrl =
|
|
6770
|
-
|
|
6772
|
+
const pdfBlobUrl = chunkBW3ZS73U_js.buildPdfFromImageData(images);
|
|
6773
|
+
chunkJ56DMNSD_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
6771
6774
|
}
|
|
6772
6775
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
6773
6776
|
const { scale = 2, onProgress } = options;
|
|
@@ -6813,10 +6816,10 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
6813
6816
|
onProgress?.(totalSlides, totalSlides);
|
|
6814
6817
|
setActiveSlide(currentSlideIndex);
|
|
6815
6818
|
if (pages.length === 0) {
|
|
6816
|
-
throw new Error(
|
|
6819
|
+
throw new Error(chunk6CPUGAK7_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
6817
6820
|
}
|
|
6818
|
-
const pdfDataUrl =
|
|
6819
|
-
|
|
6821
|
+
const pdfDataUrl = chunkBW3ZS73U_js.buildNotesPdf(pages);
|
|
6822
|
+
chunkJ56DMNSD_js.downloadDataUrl(pdfDataUrl, filename);
|
|
6820
6823
|
}
|
|
6821
6824
|
|
|
6822
6825
|
// src/viewer/utils/export-video.ts
|
|
@@ -6847,7 +6850,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6847
6850
|
}
|
|
6848
6851
|
setActiveSlide(currentSlideIndex);
|
|
6849
6852
|
if (slideCanvases.length === 0) {
|
|
6850
|
-
throw new Error(
|
|
6853
|
+
throw new Error(chunk6CPUGAK7_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
|
|
6851
6854
|
}
|
|
6852
6855
|
const firstCanvas = slideCanvases[0];
|
|
6853
6856
|
const recordingCanvas = document.createElement("canvas");
|
|
@@ -6855,12 +6858,12 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6855
6858
|
recordingCanvas.height = firstCanvas.height;
|
|
6856
6859
|
const ctx = recordingCanvas.getContext("2d");
|
|
6857
6860
|
if (!ctx) {
|
|
6858
|
-
throw new Error(
|
|
6861
|
+
throw new Error(chunk6CPUGAK7_js.translationsEn["pptx.export.errorNo2dContext"]);
|
|
6859
6862
|
}
|
|
6860
6863
|
const fps = 30;
|
|
6861
6864
|
const stream = recordingCanvas.captureStream(fps);
|
|
6862
6865
|
const recorder = new MediaRecorder(stream, {
|
|
6863
|
-
mimeType:
|
|
6866
|
+
mimeType: chunkJ56DMNSD_js.pickSupportedMimeType([...chunkJ56DMNSD_js.WEBM_MIME_CANDIDATES]),
|
|
6864
6867
|
videoBitsPerSecond: 5e6
|
|
6865
6868
|
});
|
|
6866
6869
|
const chunks = [];
|
|
@@ -6883,8 +6886,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6883
6886
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
6884
6887
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
6885
6888
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
6886
|
-
const frameInterval =
|
|
6887
|
-
const framesNeeded =
|
|
6889
|
+
const frameInterval = chunkJ56DMNSD_js.fpsToFrameIntervalMs(fps);
|
|
6890
|
+
const framesNeeded = chunkJ56DMNSD_js.segmentFrameCount(duration, fps);
|
|
6888
6891
|
for (let f = 0; f < framesNeeded; f++) {
|
|
6889
6892
|
if (signal?.aborted) {
|
|
6890
6893
|
recorder.stop();
|
|
@@ -6931,9 +6934,9 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6931
6934
|
}
|
|
6932
6935
|
setActiveSlide(currentSlideIndex);
|
|
6933
6936
|
if (frames.length === 0) {
|
|
6934
|
-
throw new Error(
|
|
6937
|
+
throw new Error(chunk6CPUGAK7_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
6935
6938
|
}
|
|
6936
|
-
const gifBytes =
|
|
6939
|
+
const gifBytes = chunkJ56DMNSD_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
6937
6940
|
onProgress?.(totalSlides, totalSlides);
|
|
6938
6941
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
6939
6942
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -6987,7 +6990,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
6987
6990
|
continue;
|
|
6988
6991
|
}
|
|
6989
6992
|
onProgress?.(processedCount, data.slides.length);
|
|
6990
|
-
let svg =
|
|
6993
|
+
let svg = chunkJ56DMNSD_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
6991
6994
|
if (embedFonts && fontFaces?.length) {
|
|
6992
6995
|
svg = injectFontFaces(svg, fontFaces);
|
|
6993
6996
|
}
|
|
@@ -7045,13 +7048,13 @@ function useExportSaveAs(input) {
|
|
|
7045
7048
|
setExportProgress(10);
|
|
7046
7049
|
setExportStatusMessage("Adding presentation...");
|
|
7047
7050
|
const pptxData = await serializeSlides();
|
|
7048
|
-
const pptxFilename =
|
|
7051
|
+
const pptxFilename = chunkJ56DMNSD_js.savedPresentationFileName(filePath);
|
|
7049
7052
|
if (pptxData) {
|
|
7050
7053
|
pkgFolder.file(pptxFilename, pptxData);
|
|
7051
7054
|
}
|
|
7052
7055
|
setExportProgress(70);
|
|
7053
7056
|
setExportStatusMessage("Writing README...");
|
|
7054
|
-
const readme =
|
|
7057
|
+
const readme = chunkJ56DMNSD_js.generatePackageReadme(pptxFilename);
|
|
7055
7058
|
pkgFolder.file("README.txt", readme);
|
|
7056
7059
|
if (abortCtrl.signal.aborted) {
|
|
7057
7060
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -7061,7 +7064,7 @@ function useExportSaveAs(input) {
|
|
|
7061
7064
|
const zipBlob = await zip.generateAsync({ type: "blob" });
|
|
7062
7065
|
setExportProgress(95);
|
|
7063
7066
|
setExportStatusMessage("Downloading...");
|
|
7064
|
-
|
|
7067
|
+
chunkJ56DMNSD_js.downloadBlob(zipBlob, `${chunkJ56DMNSD_js.presentationBaseName(pptxFilename)}-package.zip`);
|
|
7065
7068
|
setExportProgress(100);
|
|
7066
7069
|
} catch (err) {
|
|
7067
7070
|
if (err.name !== "AbortError") {
|
|
@@ -7077,13 +7080,13 @@ function useExportSaveAs(input) {
|
|
|
7077
7080
|
if (!handler) {
|
|
7078
7081
|
return;
|
|
7079
7082
|
}
|
|
7080
|
-
const downloadName =
|
|
7083
|
+
const downloadName = chunkJ56DMNSD_js.savedPresentationFileName(filePath, format);
|
|
7081
7084
|
try {
|
|
7082
7085
|
const data = await buildSaveAsData(handler, format);
|
|
7083
7086
|
const blob = new Blob([data], {
|
|
7084
7087
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
7085
7088
|
});
|
|
7086
|
-
|
|
7089
|
+
chunkJ56DMNSD_js.downloadBlob(blob, downloadName);
|
|
7087
7090
|
} catch (err) {
|
|
7088
7091
|
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
7089
7092
|
}
|
|
@@ -7096,18 +7099,18 @@ function useExportSaveAs(input) {
|
|
|
7096
7099
|
const pptxGuides = guides.map((g) => ({
|
|
7097
7100
|
id: g.id,
|
|
7098
7101
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
7099
|
-
positionEmu:
|
|
7102
|
+
positionEmu: chunkJ56DMNSD_js.guidePxToEmu(g.position)
|
|
7100
7103
|
}));
|
|
7101
7104
|
return {
|
|
7102
7105
|
...slide,
|
|
7103
7106
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
7104
7107
|
};
|
|
7105
7108
|
});
|
|
7106
|
-
const slidesToSave =
|
|
7109
|
+
const slidesToSave = chunkJ56DMNSD_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
7107
7110
|
const saveOptions = {
|
|
7108
7111
|
// Save As shares Save's slide-size decision; leaving it out here is how
|
|
7109
7112
|
// a preset picked in the inspector reached one save path and not the other.
|
|
7110
|
-
slideSize:
|
|
7113
|
+
slideSize: chunkJ56DMNSD_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
7111
7114
|
headerFooter,
|
|
7112
7115
|
presentationProperties,
|
|
7113
7116
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -7121,13 +7124,13 @@ function useExportSaveAs(input) {
|
|
|
7121
7124
|
handoutMaster,
|
|
7122
7125
|
outputFormat: format
|
|
7123
7126
|
};
|
|
7124
|
-
return
|
|
7127
|
+
return chunkJ56DMNSD_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
|
|
7125
7128
|
};
|
|
7126
7129
|
const handleExportJson = () => {
|
|
7127
7130
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7128
|
-
const slideSize =
|
|
7131
|
+
const slideSize = chunkJ56DMNSD_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
7129
7132
|
const data = {
|
|
7130
|
-
slides:
|
|
7133
|
+
slides: chunkJ56DMNSD_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7131
7134
|
width: canvasSize.width,
|
|
7132
7135
|
height: canvasSize.height,
|
|
7133
7136
|
widthEmu: slideSize.widthEmu,
|
|
@@ -7146,7 +7149,7 @@ function useExportSaveAs(input) {
|
|
|
7146
7149
|
handoutMaster
|
|
7147
7150
|
};
|
|
7148
7151
|
try {
|
|
7149
|
-
|
|
7152
|
+
chunkJ56DMNSD_js.exportDeckJson(data, sourceName);
|
|
7150
7153
|
} catch (err) {
|
|
7151
7154
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7152
7155
|
}
|
|
@@ -7186,7 +7189,7 @@ function safeConfirm(message) {
|
|
|
7186
7189
|
}
|
|
7187
7190
|
}
|
|
7188
7191
|
function downloadBlob2(blob, filename) {
|
|
7189
|
-
|
|
7192
|
+
chunkJ56DMNSD_js.downloadBlob(blob, chunkJ56DMNSD_js.sanitizeDownloadFilename(filename));
|
|
7190
7193
|
}
|
|
7191
7194
|
|
|
7192
7195
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -7296,21 +7299,21 @@ function useExportHandlers(input) {
|
|
|
7296
7299
|
{
|
|
7297
7300
|
scale: 2,
|
|
7298
7301
|
onProgress: (current, total) => {
|
|
7299
|
-
setExportProgress(
|
|
7300
|
-
setExportStatusMessage(
|
|
7302
|
+
setExportProgress(chunkJ56DMNSD_js.slideProgressPercent(current, total));
|
|
7303
|
+
setExportStatusMessage(chunkJ56DMNSD_js.slideStatusLabel("Rendering", current, total));
|
|
7301
7304
|
},
|
|
7302
7305
|
signal: abortCtrl.signal
|
|
7303
7306
|
}
|
|
7304
7307
|
);
|
|
7305
|
-
setExportProgress(
|
|
7308
|
+
setExportProgress(chunkJ56DMNSD_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7306
7309
|
setExportStatusMessage("Building PDF...");
|
|
7307
7310
|
await new Promise((r) => {
|
|
7308
7311
|
setTimeout(r, 100);
|
|
7309
7312
|
});
|
|
7310
|
-
setExportProgress(
|
|
7313
|
+
setExportProgress(chunkJ56DMNSD_js.EXPORT_DONE_PERCENT);
|
|
7311
7314
|
setExportStatusMessage("Done!");
|
|
7312
7315
|
} catch (err) {
|
|
7313
|
-
if (!
|
|
7316
|
+
if (!chunkJ56DMNSD_js.isExportAbortError(err)) {
|
|
7314
7317
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7315
7318
|
}
|
|
7316
7319
|
} finally {
|
|
@@ -7340,21 +7343,21 @@ function useExportHandlers(input) {
|
|
|
7340
7343
|
{
|
|
7341
7344
|
scale: 2,
|
|
7342
7345
|
onProgress: (current, total) => {
|
|
7343
|
-
setExportProgress(
|
|
7344
|
-
setExportStatusMessage(
|
|
7346
|
+
setExportProgress(chunkJ56DMNSD_js.slideProgressPercent(current, total));
|
|
7347
|
+
setExportStatusMessage(chunkJ56DMNSD_js.slideStatusLabel("Rendering", current, total));
|
|
7345
7348
|
},
|
|
7346
7349
|
signal: abortCtrl.signal
|
|
7347
7350
|
}
|
|
7348
7351
|
);
|
|
7349
|
-
setExportProgress(
|
|
7352
|
+
setExportProgress(chunkJ56DMNSD_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7350
7353
|
setExportStatusMessage("Building PDF...");
|
|
7351
7354
|
await new Promise((r) => {
|
|
7352
7355
|
setTimeout(r, 100);
|
|
7353
7356
|
});
|
|
7354
|
-
setExportProgress(
|
|
7357
|
+
setExportProgress(chunkJ56DMNSD_js.EXPORT_DONE_PERCENT);
|
|
7355
7358
|
setExportStatusMessage("Done!");
|
|
7356
7359
|
} catch (err) {
|
|
7357
|
-
if (!
|
|
7360
|
+
if (!chunkJ56DMNSD_js.isExportAbortError(err)) {
|
|
7358
7361
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7359
7362
|
}
|
|
7360
7363
|
} finally {
|
|
@@ -7395,22 +7398,22 @@ function useExportHandlers(input) {
|
|
|
7395
7398
|
scale: 1,
|
|
7396
7399
|
slideDurationMs: 3e3,
|
|
7397
7400
|
onProgress: (current, total) => {
|
|
7398
|
-
setExportProgress(
|
|
7399
|
-
setExportStatusMessage(
|
|
7401
|
+
setExportProgress(chunkJ56DMNSD_js.slideProgressPercent(current, total, 45));
|
|
7402
|
+
setExportStatusMessage(chunkJ56DMNSD_js.slideStatusLabel("Capturing", current, total));
|
|
7400
7403
|
},
|
|
7401
7404
|
onRecordProgress: (current, total) => {
|
|
7402
|
-
setExportProgress(
|
|
7403
|
-
setExportStatusMessage(
|
|
7405
|
+
setExportProgress(chunkJ56DMNSD_js.recordProgressPercent(current, total));
|
|
7406
|
+
setExportStatusMessage(chunkJ56DMNSD_js.slideStatusLabel("Recording", current, total));
|
|
7404
7407
|
},
|
|
7405
7408
|
signal: abortCtrl.signal
|
|
7406
7409
|
}
|
|
7407
7410
|
);
|
|
7408
|
-
setExportProgress(
|
|
7411
|
+
setExportProgress(chunkJ56DMNSD_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7409
7412
|
setExportStatusMessage("Saving file...");
|
|
7410
7413
|
downloadBlob2(blob, "presentation.webm");
|
|
7411
|
-
setExportProgress(
|
|
7414
|
+
setExportProgress(chunkJ56DMNSD_js.EXPORT_DONE_PERCENT);
|
|
7412
7415
|
} catch (err) {
|
|
7413
|
-
if (!
|
|
7416
|
+
if (!chunkJ56DMNSD_js.isExportAbortError(err)) {
|
|
7414
7417
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7415
7418
|
}
|
|
7416
7419
|
} finally {
|
|
@@ -7438,18 +7441,18 @@ function useExportHandlers(input) {
|
|
|
7438
7441
|
scale: 0.5,
|
|
7439
7442
|
slideDurationMs: 2e3,
|
|
7440
7443
|
onProgress: (current, total) => {
|
|
7441
|
-
setExportProgress(
|
|
7442
|
-
setExportStatusMessage(
|
|
7444
|
+
setExportProgress(chunkJ56DMNSD_js.slideProgressPercent(current, total));
|
|
7445
|
+
setExportStatusMessage(chunkJ56DMNSD_js.slideStatusLabel("Encoding", current, total));
|
|
7443
7446
|
},
|
|
7444
7447
|
signal: abortCtrl.signal
|
|
7445
7448
|
}
|
|
7446
7449
|
);
|
|
7447
|
-
setExportProgress(
|
|
7450
|
+
setExportProgress(chunkJ56DMNSD_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7448
7451
|
setExportStatusMessage("Saving file...");
|
|
7449
7452
|
downloadBlob2(blob, "presentation.gif");
|
|
7450
|
-
setExportProgress(
|
|
7453
|
+
setExportProgress(chunkJ56DMNSD_js.EXPORT_DONE_PERCENT);
|
|
7451
7454
|
} catch (err) {
|
|
7452
|
-
if (!
|
|
7455
|
+
if (!chunkJ56DMNSD_js.isExportAbortError(err)) {
|
|
7453
7456
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7454
7457
|
}
|
|
7455
7458
|
} finally {
|
|
@@ -7490,7 +7493,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
7490
7493
|
}
|
|
7491
7494
|
printWindow.document.open();
|
|
7492
7495
|
printWindow.document.write(
|
|
7493
|
-
|
|
7496
|
+
chunkJ56DMNSD_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
7494
7497
|
);
|
|
7495
7498
|
printWindow.document.close();
|
|
7496
7499
|
printWindow.focus();
|
|
@@ -7551,7 +7554,7 @@ function usePrintHandlers(input) {
|
|
|
7551
7554
|
if (svgs.length === 0) {
|
|
7552
7555
|
return;
|
|
7553
7556
|
}
|
|
7554
|
-
const printDoc =
|
|
7557
|
+
const printDoc = chunkJ56DMNSD_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7555
7558
|
title: "Slides (Vector)",
|
|
7556
7559
|
orientation: settings.orientation,
|
|
7557
7560
|
colorFilter
|
|
@@ -7587,7 +7590,7 @@ function usePrintHandlers(input) {
|
|
|
7587
7590
|
if (settings.printWhat === "outline") {
|
|
7588
7591
|
openPrintWindow(
|
|
7589
7592
|
"Outline",
|
|
7590
|
-
`<div class="outline-page">${
|
|
7593
|
+
`<div class="outline-page">${chunkJ56DMNSD_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7591
7594
|
settings.orientation,
|
|
7592
7595
|
colorFilter,
|
|
7593
7596
|
settings.frameSlides
|
|
@@ -7612,7 +7615,7 @@ function usePrintHandlers(input) {
|
|
|
7612
7615
|
if (settings.printWhat === "slides") {
|
|
7613
7616
|
openPrintWindow(
|
|
7614
7617
|
"Slides",
|
|
7615
|
-
|
|
7618
|
+
chunkJ56DMNSD_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7616
7619
|
settings.orientation,
|
|
7617
7620
|
colorFilter,
|
|
7618
7621
|
settings.frameSlides
|
|
@@ -7622,7 +7625,7 @@ function usePrintHandlers(input) {
|
|
|
7622
7625
|
if (settings.printWhat === "notes") {
|
|
7623
7626
|
openPrintWindow(
|
|
7624
7627
|
"Notes Pages",
|
|
7625
|
-
|
|
7628
|
+
chunkJ56DMNSD_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7626
7629
|
"portrait",
|
|
7627
7630
|
colorFilter,
|
|
7628
7631
|
settings.frameSlides
|
|
@@ -7633,7 +7636,7 @@ function usePrintHandlers(input) {
|
|
|
7633
7636
|
const spp = settings.slidesPerPage;
|
|
7634
7637
|
openPrintWindow(
|
|
7635
7638
|
`Handout ${spp} per page`,
|
|
7636
|
-
|
|
7639
|
+
chunkJ56DMNSD_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
7637
7640
|
"portrait",
|
|
7638
7641
|
colorFilter,
|
|
7639
7642
|
settings.frameSlides
|
|
@@ -7697,8 +7700,8 @@ function useThemeHandlers(input) {
|
|
|
7697
7700
|
return;
|
|
7698
7701
|
}
|
|
7699
7702
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7700
|
-
const previousMap = theme?.colorScheme ?
|
|
7701
|
-
setSlides((prev) =>
|
|
7703
|
+
const previousMap = theme?.colorScheme ? chunkJ56DMNSD_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7704
|
+
setSlides((prev) => chunkJ56DMNSD_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7702
7705
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7703
7706
|
bumpHistory();
|
|
7704
7707
|
history.markDirty();
|
|
@@ -7803,7 +7806,7 @@ function useThemeSwitching(input) {
|
|
|
7803
7806
|
}
|
|
7804
7807
|
try {
|
|
7805
7808
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7806
|
-
const newData =
|
|
7809
|
+
const newData = chunkJ56DMNSD_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7807
7810
|
onDataChange(newData);
|
|
7808
7811
|
onThemeChanged?.(preset);
|
|
7809
7812
|
} catch (error) {
|
|
@@ -7820,7 +7823,7 @@ function useThemeSwitching(input) {
|
|
|
7820
7823
|
}
|
|
7821
7824
|
try {
|
|
7822
7825
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7823
|
-
const newData =
|
|
7826
|
+
const newData = chunkJ56DMNSD_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7824
7827
|
onDataChange(newData);
|
|
7825
7828
|
} catch (error) {
|
|
7826
7829
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7832,12 +7835,12 @@ function useThemeSwitching(input) {
|
|
|
7832
7835
|
if (!data?.theme?.colorScheme) {
|
|
7833
7836
|
return void 0;
|
|
7834
7837
|
}
|
|
7835
|
-
return
|
|
7836
|
-
(p) =>
|
|
7838
|
+
return chunkJ56DMNSD_js.THEME_PRESETS.find(
|
|
7839
|
+
(p) => chunkJ56DMNSD_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7837
7840
|
);
|
|
7838
7841
|
}, [data?.theme?.colorScheme]);
|
|
7839
7842
|
return {
|
|
7840
|
-
presets:
|
|
7843
|
+
presets: chunkJ56DMNSD_js.THEME_PRESETS,
|
|
7841
7844
|
switchToPreset,
|
|
7842
7845
|
switchToCustom,
|
|
7843
7846
|
currentPreset
|
|
@@ -7912,7 +7915,7 @@ function usePropertyHandlers(input) {
|
|
|
7912
7915
|
}
|
|
7913
7916
|
try {
|
|
7914
7917
|
const ab = await file.arrayBuffer();
|
|
7915
|
-
const h = new
|
|
7918
|
+
const h = new chunkJ56DMNSD_js.PptxHandler();
|
|
7916
7919
|
const other = await h.load(ab);
|
|
7917
7920
|
if (!other) {
|
|
7918
7921
|
return;
|
|
@@ -7922,7 +7925,7 @@ function usePropertyHandlers(input) {
|
|
|
7922
7925
|
width: canvasSize.width,
|
|
7923
7926
|
height: canvasSize.height
|
|
7924
7927
|
};
|
|
7925
|
-
setCompareResult(
|
|
7928
|
+
setCompareResult(chunkJ56DMNSD_js.comparePresentation(cur, other));
|
|
7926
7929
|
setIsComparePanelOpen(true);
|
|
7927
7930
|
} catch (err) {
|
|
7928
7931
|
console.warn("Compare failed:", err);
|
|
@@ -7939,7 +7942,7 @@ function usePropertyHandlers(input) {
|
|
|
7939
7942
|
if (!diff || diff.status === "unchanged") {
|
|
7940
7943
|
return;
|
|
7941
7944
|
}
|
|
7942
|
-
setSlides((prev) =>
|
|
7945
|
+
setSlides((prev) => chunkJ56DMNSD_js.applyAcceptSlide(prev, diff));
|
|
7943
7946
|
setIsDirty(true);
|
|
7944
7947
|
},
|
|
7945
7948
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -7950,10 +7953,10 @@ function usePropertyHandlers(input) {
|
|
|
7950
7953
|
if (!compareResult) {
|
|
7951
7954
|
return;
|
|
7952
7955
|
}
|
|
7953
|
-
setSlides((prev) =>
|
|
7956
|
+
setSlides((prev) => chunkJ56DMNSD_js.applyAcceptAllSlides(prev, compareResult));
|
|
7954
7957
|
setIsDirty(true);
|
|
7955
7958
|
}, [compareResult, setSlides, setIsDirty]);
|
|
7956
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
7959
|
+
const usedFontFamilies = react.useMemo(() => chunkJ56DMNSD_js.collectUsedFonts(slides), [slides]);
|
|
7957
7960
|
return {
|
|
7958
7961
|
handleUpdateNotes,
|
|
7959
7962
|
handleUpdateSlide,
|
|
@@ -8072,7 +8075,7 @@ function useIsMobile(input) {
|
|
|
8072
8075
|
const containerRef = input?.containerRef;
|
|
8073
8076
|
const isTouchDevice = react.useSyncExternalStore(
|
|
8074
8077
|
subscribeTouchCapability,
|
|
8075
|
-
|
|
8078
|
+
chunkJ56DMNSD_js.detectTouchDevice,
|
|
8076
8079
|
() => false
|
|
8077
8080
|
// server snapshot
|
|
8078
8081
|
);
|
|
@@ -8088,7 +8091,7 @@ function useIsMobile(input) {
|
|
|
8088
8091
|
}
|
|
8089
8092
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
8090
8093
|
});
|
|
8091
|
-
const [orientation, setOrientation] = react.useState(
|
|
8094
|
+
const [orientation, setOrientation] = react.useState(chunkJ56DMNSD_js.detectOrientation);
|
|
8092
8095
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
8093
8096
|
const [initialViewportHeight] = react.useState(
|
|
8094
8097
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -8132,7 +8135,7 @@ function useIsMobile(input) {
|
|
|
8132
8135
|
return;
|
|
8133
8136
|
}
|
|
8134
8137
|
const handleOrientationChange = () => {
|
|
8135
|
-
setOrientation(
|
|
8138
|
+
setOrientation(chunkJ56DMNSD_js.detectOrientation());
|
|
8136
8139
|
};
|
|
8137
8140
|
if (screen.orientation) {
|
|
8138
8141
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -8162,9 +8165,9 @@ function useIsMobile(input) {
|
|
|
8162
8165
|
window.addEventListener("resize", handleResize);
|
|
8163
8166
|
return () => window.removeEventListener("resize", handleResize);
|
|
8164
8167
|
}, [isTouchDevice, initialViewportHeight]);
|
|
8165
|
-
const isMobile =
|
|
8166
|
-
const isTablet = !isMobile && containerWidth >=
|
|
8167
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
8168
|
+
const isMobile = chunkJ56DMNSD_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
8169
|
+
const isTablet = !isMobile && containerWidth >= chunkJ56DMNSD_js.MOBILE_BREAKPOINT && containerWidth < chunkJ56DMNSD_js.TABLET_BREAKPOINT;
|
|
8170
|
+
const isDesktop = !isMobile && containerWidth >= chunkJ56DMNSD_js.TABLET_BREAKPOINT;
|
|
8168
8171
|
return {
|
|
8169
8172
|
isMobile,
|
|
8170
8173
|
isTablet,
|
|
@@ -8226,7 +8229,7 @@ function useViewerDialogs(input) {
|
|
|
8226
8229
|
);
|
|
8227
8230
|
const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
|
|
8228
8231
|
const fontEmbedding = react.useMemo(
|
|
8229
|
-
() =>
|
|
8232
|
+
() => chunkJ56DMNSD_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
|
|
8230
8233
|
[embeddedFontKey]
|
|
8231
8234
|
);
|
|
8232
8235
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
|
|
@@ -8234,11 +8237,11 @@ function useViewerDialogs(input) {
|
|
|
8234
8237
|
setEmbedFontsEnabled(fontEmbedding.initialEnabled);
|
|
8235
8238
|
}, [fontEmbedding]);
|
|
8236
8239
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8237
|
-
() => typeof window !== "undefined" ?
|
|
8240
|
+
() => typeof window !== "undefined" ? chunkJ56DMNSD_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8238
8241
|
);
|
|
8239
8242
|
react.useEffect(() => {
|
|
8240
8243
|
const handleWindow = () => setIsNarrowViewport(
|
|
8241
|
-
|
|
8244
|
+
chunkJ56DMNSD_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8242
8245
|
);
|
|
8243
8246
|
let observer = null;
|
|
8244
8247
|
let raf = 0;
|
|
@@ -8252,12 +8255,12 @@ function useViewerDialogs(input) {
|
|
|
8252
8255
|
const entry = entries[0];
|
|
8253
8256
|
if (entry) {
|
|
8254
8257
|
setIsNarrowViewport(
|
|
8255
|
-
|
|
8258
|
+
chunkJ56DMNSD_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
8256
8259
|
);
|
|
8257
8260
|
}
|
|
8258
8261
|
});
|
|
8259
8262
|
observer.observe(el);
|
|
8260
|
-
setIsNarrowViewport(
|
|
8263
|
+
setIsNarrowViewport(chunkJ56DMNSD_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
8261
8264
|
};
|
|
8262
8265
|
attach();
|
|
8263
8266
|
window.addEventListener("resize", handleWindow);
|
|
@@ -8416,20 +8419,20 @@ function useViewerDialogs(input) {
|
|
|
8416
8419
|
}
|
|
8417
8420
|
function computeGridSpacingPx(presentationGridSpacing) {
|
|
8418
8421
|
if (presentationGridSpacing) {
|
|
8419
|
-
const px = Math.round(presentationGridSpacing.cx /
|
|
8422
|
+
const px = Math.round(presentationGridSpacing.cx / chunkBW3ZS73U_js.EMU_PER_PX);
|
|
8420
8423
|
if (px > 0) {
|
|
8421
8424
|
return px;
|
|
8422
8425
|
}
|
|
8423
8426
|
}
|
|
8424
|
-
return
|
|
8427
|
+
return chunkBW3ZS73U_js.GRID_SIZE;
|
|
8425
8428
|
}
|
|
8426
8429
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8427
8430
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8428
|
-
return
|
|
8431
|
+
return chunkJ56DMNSD_js.resolveShowSlideIndexes(slides, activeShow);
|
|
8429
8432
|
}
|
|
8430
8433
|
function computeSlideSectionGroups(slides, sections) {
|
|
8431
|
-
return
|
|
8432
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8434
|
+
return chunkJ56DMNSD_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8435
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkBW3ZS73U_js.UNGROUPED_SECTION_ID : chunkBW3ZS73U_js.DEFAULT_SECTION_GROUP_ID),
|
|
8433
8436
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8434
8437
|
slideIndexes: group.slideIndexes,
|
|
8435
8438
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8441,7 +8444,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
|
8441
8444
|
return void 0;
|
|
8442
8445
|
}
|
|
8443
8446
|
const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
|
|
8444
|
-
return
|
|
8447
|
+
return chunkJ56DMNSD_js.masterViewPseudoSlide(document2, {
|
|
8445
8448
|
tab: "slides",
|
|
8446
8449
|
masterIndex: 0,
|
|
8447
8450
|
layoutIndex: activeLayout ? 0 : null
|
|
@@ -8469,10 +8472,10 @@ function useDerivedSlideState(input) {
|
|
|
8469
8472
|
);
|
|
8470
8473
|
const slideSectionGroups = react.useMemo(
|
|
8471
8474
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8472
|
-
if (group.id ===
|
|
8475
|
+
if (group.id === chunkBW3ZS73U_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8473
8476
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8474
8477
|
}
|
|
8475
|
-
if (group.id ===
|
|
8478
|
+
if (group.id === chunkBW3ZS73U_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
8476
8479
|
return { ...group, label: t("pptx.sections.slides") };
|
|
8477
8480
|
}
|
|
8478
8481
|
return group;
|
|
@@ -8572,13 +8575,13 @@ function useAnnotationHandlers(input) {
|
|
|
8572
8575
|
}, [annotations, setMode, setSlides, history]);
|
|
8573
8576
|
const handleSetMode = react.useCallback(
|
|
8574
8577
|
(nextMode) => {
|
|
8575
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8578
|
+
if (mode === "present" && nextMode !== "present" && !chunkJ56DMNSD_js.mayLeaveSlideShow()) {
|
|
8576
8579
|
return;
|
|
8577
8580
|
}
|
|
8578
8581
|
if (nextMode === "present") {
|
|
8579
8582
|
presentation.enterPresentMode();
|
|
8580
8583
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8581
|
-
|
|
8584
|
+
chunkJ56DMNSD_js.stopAllPersistentAudio();
|
|
8582
8585
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8583
8586
|
if (promptKeepInkAnnotations) {
|
|
8584
8587
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8587,7 +8590,7 @@ function useAnnotationHandlers(input) {
|
|
|
8587
8590
|
}
|
|
8588
8591
|
} else {
|
|
8589
8592
|
if (mode === "present") {
|
|
8590
|
-
|
|
8593
|
+
chunkJ56DMNSD_js.stopAllPersistentAudio();
|
|
8591
8594
|
}
|
|
8592
8595
|
setMode(nextMode);
|
|
8593
8596
|
}
|
|
@@ -8658,13 +8661,13 @@ function useSerialize(input) {
|
|
|
8658
8661
|
let processedSlide = slide;
|
|
8659
8662
|
if (pendingEditId) {
|
|
8660
8663
|
const updatedElements = slide.elements.map((el) => {
|
|
8661
|
-
if (el.id !== pendingEditId || !
|
|
8664
|
+
if (el.id !== pendingEditId || !chunkJ56DMNSD_js.hasTextProperties(el)) {
|
|
8662
8665
|
return el;
|
|
8663
8666
|
}
|
|
8664
8667
|
return {
|
|
8665
8668
|
...el,
|
|
8666
8669
|
text: pendingEditText,
|
|
8667
|
-
textSegments:
|
|
8670
|
+
textSegments: chunkJ56DMNSD_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8668
8671
|
};
|
|
8669
8672
|
});
|
|
8670
8673
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8677,19 +8680,19 @@ function useSerialize(input) {
|
|
|
8677
8680
|
const pptxGuides = guides.map((g) => ({
|
|
8678
8681
|
id: g.id,
|
|
8679
8682
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8680
|
-
positionEmu:
|
|
8683
|
+
positionEmu: chunkJ56DMNSD_js.guidePxToEmu(g.position)
|
|
8681
8684
|
}));
|
|
8682
8685
|
return {
|
|
8683
8686
|
...processedSlide,
|
|
8684
8687
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8685
8688
|
};
|
|
8686
8689
|
});
|
|
8687
|
-
const slidesToSave =
|
|
8690
|
+
const slidesToSave = chunkJ56DMNSD_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8688
8691
|
const saveOptions = {
|
|
8689
8692
|
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
8690
8693
|
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
8691
8694
|
// slide-size edit reaches the file.
|
|
8692
|
-
slideSize:
|
|
8695
|
+
slideSize: chunkJ56DMNSD_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
8693
8696
|
headerFooter,
|
|
8694
8697
|
presentationProperties,
|
|
8695
8698
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -8701,9 +8704,9 @@ function useSerialize(input) {
|
|
|
8701
8704
|
slideMasters,
|
|
8702
8705
|
notesMaster,
|
|
8703
8706
|
handoutMaster,
|
|
8704
|
-
...
|
|
8707
|
+
...chunkJ56DMNSD_js.embeddedFontSaveOptions(embedFonts)
|
|
8705
8708
|
};
|
|
8706
|
-
return
|
|
8709
|
+
return chunkJ56DMNSD_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
|
|
8707
8710
|
}, [
|
|
8708
8711
|
slides,
|
|
8709
8712
|
templateElementsBySlideId,
|
|
@@ -8738,7 +8741,7 @@ function useRecoveryDetection(input) {
|
|
|
8738
8741
|
const onRestore = input.onRestore;
|
|
8739
8742
|
const openVersionHistory = input.openVersionHistory;
|
|
8740
8743
|
react.useEffect(() => {
|
|
8741
|
-
if (!
|
|
8744
|
+
if (!chunkJ56DMNSD_js.shouldProbeAutosaveRecovery({
|
|
8742
8745
|
alreadyChecked: recoveryCheckedRef.current,
|
|
8743
8746
|
filePath,
|
|
8744
8747
|
loading,
|
|
@@ -8750,7 +8753,7 @@ function useRecoveryDetection(input) {
|
|
|
8750
8753
|
}
|
|
8751
8754
|
recoveryCheckedRef.current = true;
|
|
8752
8755
|
void (async () => {
|
|
8753
|
-
const offer = await
|
|
8756
|
+
const offer = await chunkJ56DMNSD_js.probeAutosaveRecovery(filePath);
|
|
8754
8757
|
if (!offer) {
|
|
8755
8758
|
return;
|
|
8756
8759
|
}
|
|
@@ -8763,7 +8766,7 @@ function useRecoveryDetection(input) {
|
|
|
8763
8766
|
const record = recordRef.current;
|
|
8764
8767
|
setPrompt(null);
|
|
8765
8768
|
if (record && onRestore) {
|
|
8766
|
-
onRestore(
|
|
8769
|
+
onRestore(chunkJ56DMNSD_js.acceptAutosaveRecovery(record));
|
|
8767
8770
|
}
|
|
8768
8771
|
recordRef.current = null;
|
|
8769
8772
|
}, [onRestore]);
|
|
@@ -8772,7 +8775,7 @@ function useRecoveryDetection(input) {
|
|
|
8772
8775
|
setPrompt(null);
|
|
8773
8776
|
recordRef.current = null;
|
|
8774
8777
|
if (record) {
|
|
8775
|
-
void
|
|
8778
|
+
void chunkJ56DMNSD_js.discardAutosaveRecovery(record);
|
|
8776
8779
|
}
|
|
8777
8780
|
}, []);
|
|
8778
8781
|
return { prompt, restore, discard };
|
|
@@ -8812,7 +8815,7 @@ function usePresentationSetup(input) {
|
|
|
8812
8815
|
containerRef,
|
|
8813
8816
|
content,
|
|
8814
8817
|
onSetMode: (nextMode) => {
|
|
8815
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8818
|
+
if (mode === "present" && nextMode !== "present" && !chunkJ56DMNSD_js.mayLeaveSlideShow()) {
|
|
8816
8819
|
return;
|
|
8817
8820
|
}
|
|
8818
8821
|
if (mode === "present" && nextMode !== "present" && annotations.hasAnyAnnotations && promptKeepInkAnnotations) {
|
|
@@ -8820,7 +8823,7 @@ function usePresentationSetup(input) {
|
|
|
8820
8823
|
setShowKeepAnnotationsDialog(true);
|
|
8821
8824
|
} else {
|
|
8822
8825
|
if (mode === "present" && nextMode !== "present") {
|
|
8823
|
-
|
|
8826
|
+
chunkJ56DMNSD_js.stopAllPersistentAudio();
|
|
8824
8827
|
stopAnimationSound();
|
|
8825
8828
|
}
|
|
8826
8829
|
setMode(nextMode);
|
|
@@ -8875,10 +8878,10 @@ function usePresentationSetup(input) {
|
|
|
8875
8878
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8876
8879
|
onToggleSubtitles,
|
|
8877
8880
|
onSaveRehearsalTimings: (timings) => {
|
|
8878
|
-
setSlides((prev) =>
|
|
8881
|
+
setSlides((prev) => chunkJ56DMNSD_js.applyRehearsalTimings(prev, timings));
|
|
8879
8882
|
history.markDirty();
|
|
8880
8883
|
},
|
|
8881
|
-
loopContinuously:
|
|
8884
|
+
loopContinuously: chunkJ56DMNSD_js.shouldLoopContinuously(presentationProperties),
|
|
8882
8885
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8883
8886
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8884
8887
|
endWithBlackSlide
|
|
@@ -9071,7 +9074,7 @@ function useEditorOperations(input) {
|
|
|
9071
9074
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
9072
9075
|
react.useEffect(() => {
|
|
9073
9076
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9074
|
-
copiedFormatRef.current =
|
|
9077
|
+
copiedFormatRef.current = chunkJ56DMNSD_js.copyFormatFromElement(selectedElement);
|
|
9075
9078
|
} else if (!formatPainterActive) {
|
|
9076
9079
|
copiedFormatRef.current = null;
|
|
9077
9080
|
}
|
|
@@ -9097,12 +9100,12 @@ function useEditorOperations(input) {
|
|
|
9097
9100
|
e.stopPropagation();
|
|
9098
9101
|
const element = elementLookup.get(elementId);
|
|
9099
9102
|
if (element) {
|
|
9100
|
-
const updated =
|
|
9103
|
+
const updated = chunkJ56DMNSD_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
9101
9104
|
const updates = {};
|
|
9102
|
-
if (
|
|
9105
|
+
if (chunkJ56DMNSD_js.hasShapeProperties(updated)) {
|
|
9103
9106
|
updates.shapeStyle = updated.shapeStyle;
|
|
9104
9107
|
}
|
|
9105
|
-
if (
|
|
9108
|
+
if (chunkJ56DMNSD_js.hasTextProperties(updated)) {
|
|
9106
9109
|
updates.textStyle = updated.textStyle;
|
|
9107
9110
|
}
|
|
9108
9111
|
ops.updateElementById(elementId, updates);
|
|
@@ -9256,7 +9259,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
9256
9259
|
const families = /* @__PURE__ */ new Set();
|
|
9257
9260
|
for (const slide of slides) {
|
|
9258
9261
|
for (const el of slide.elements) {
|
|
9259
|
-
if (
|
|
9262
|
+
if (chunkJ56DMNSD_js.hasTextProperties(el) && el.textSegments) {
|
|
9260
9263
|
for (const seg of el.textSegments) {
|
|
9261
9264
|
if (seg.style.fontFamily) {
|
|
9262
9265
|
families.add(seg.style.fontFamily);
|
|
@@ -9503,7 +9506,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9503
9506
|
inputRef.current = input;
|
|
9504
9507
|
const handleKeyDown = react.useCallback((e) => {
|
|
9505
9508
|
const current = inputRef.current;
|
|
9506
|
-
const { action, dx, dy } =
|
|
9509
|
+
const { action, dx, dy } = chunkJ56DMNSD_js.mapEditorKey(e, {
|
|
9507
9510
|
canEdit: current.canEdit,
|
|
9508
9511
|
// The Slide Master view is an editing surface, not a viewing one.
|
|
9509
9512
|
// Gating on `mode !== 'edit'` alone made `mapEditorKey` return
|
|
@@ -9516,7 +9519,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9516
9519
|
hasSelection: current.hasSelection,
|
|
9517
9520
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9518
9521
|
isDrawing: current.activeTool !== "select",
|
|
9519
|
-
isTextInputTarget:
|
|
9522
|
+
isTextInputTarget: chunkJ56DMNSD_js.isEditorTextInputTarget(e.target)
|
|
9520
9523
|
});
|
|
9521
9524
|
if (action === null) {
|
|
9522
9525
|
return;
|
|
@@ -9822,7 +9825,7 @@ function useViewerIntegration(input) {
|
|
|
9822
9825
|
return zoom.scale;
|
|
9823
9826
|
},
|
|
9824
9827
|
setZoom(level) {
|
|
9825
|
-
zoom.setScale(
|
|
9828
|
+
zoom.setScale(chunkJ56DMNSD_js.clampZoomScale(level));
|
|
9826
9829
|
},
|
|
9827
9830
|
zoomIn() {
|
|
9828
9831
|
zoom.handleZoomIn();
|
|
@@ -10038,7 +10041,7 @@ function useReducedMotion() {
|
|
|
10038
10041
|
}
|
|
10039
10042
|
function useViewerOptions() {
|
|
10040
10043
|
const storeRef = react.useRef(null);
|
|
10041
|
-
storeRef.current ??=
|
|
10044
|
+
storeRef.current ??= chunkJ56DMNSD_js.createViewerOptionsStore();
|
|
10042
10045
|
const store = storeRef.current;
|
|
10043
10046
|
const options = react.useSyncExternalStore(
|
|
10044
10047
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -10047,9 +10050,9 @@ function useViewerOptions() {
|
|
|
10047
10050
|
);
|
|
10048
10051
|
return { optionsStore: store, options };
|
|
10049
10052
|
}
|
|
10050
|
-
var KNOWN_TAB_IDS = new Set(
|
|
10053
|
+
var KNOWN_TAB_IDS = new Set(chunkJ56DMNSD_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
10051
10054
|
function computeToolbarVisibility(hiddenActions) {
|
|
10052
|
-
const isHidden = (id) =>
|
|
10055
|
+
const isHidden = (id) => chunkJ56DMNSD_js.isActionHidden(id, hiddenActions);
|
|
10053
10056
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
10054
10057
|
return { isHidden, isTabVisible };
|
|
10055
10058
|
}
|
|
@@ -10135,12 +10138,12 @@ function useYjsDocumentSync({
|
|
|
10135
10138
|
return;
|
|
10136
10139
|
}
|
|
10137
10140
|
try {
|
|
10138
|
-
const handler = new
|
|
10141
|
+
const handler = new chunkJ56DMNSD_js.PptxHandler();
|
|
10139
10142
|
await handler.load(sourceBytes.buffer);
|
|
10140
|
-
const currentSlides =
|
|
10143
|
+
const currentSlides = chunkJ56DMNSD_js.readSlidesFromYDoc(
|
|
10141
10144
|
doc
|
|
10142
10145
|
);
|
|
10143
|
-
const slidesToSave =
|
|
10146
|
+
const slidesToSave = chunkJ56DMNSD_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10144
10147
|
const bytes = await handler.save(slidesToSave);
|
|
10145
10148
|
config.onWriteBack(bytes);
|
|
10146
10149
|
} catch {
|
|
@@ -10155,10 +10158,10 @@ function useYjsDocumentSync({
|
|
|
10155
10158
|
if (!doc || !isConnected) {
|
|
10156
10159
|
return;
|
|
10157
10160
|
}
|
|
10158
|
-
const docSlides =
|
|
10161
|
+
const docSlides = chunkJ56DMNSD_js.readSlidesFromYDoc(
|
|
10159
10162
|
doc
|
|
10160
10163
|
);
|
|
10161
|
-
if (!
|
|
10164
|
+
if (!chunkJ56DMNSD_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
|
|
10162
10165
|
return;
|
|
10163
10166
|
}
|
|
10164
10167
|
lastSyncedRef.current = JSON.stringify(docSlides);
|
|
@@ -10177,11 +10180,11 @@ function useYjsDocumentSync({
|
|
|
10177
10180
|
lastSyncedRef.current = serialized;
|
|
10178
10181
|
void (async () => {
|
|
10179
10182
|
const factories = await getFactories();
|
|
10180
|
-
|
|
10183
|
+
chunkJ56DMNSD_js.reconcileSlidesInYDoc(
|
|
10181
10184
|
slides,
|
|
10182
10185
|
doc,
|
|
10183
10186
|
factories,
|
|
10184
|
-
|
|
10187
|
+
chunkJ56DMNSD_js.LOCAL_SYNC_ORIGIN
|
|
10185
10188
|
);
|
|
10186
10189
|
scheduleWriteBack();
|
|
10187
10190
|
})();
|
|
@@ -10195,10 +10198,10 @@ function useYjsDocumentSync({
|
|
|
10195
10198
|
return;
|
|
10196
10199
|
}
|
|
10197
10200
|
const handleChange = (_events, transaction) => {
|
|
10198
|
-
if (transaction?.origin ===
|
|
10201
|
+
if (transaction?.origin === chunkJ56DMNSD_js.LOCAL_SYNC_ORIGIN) {
|
|
10199
10202
|
return;
|
|
10200
10203
|
}
|
|
10201
|
-
const remoteSlides =
|
|
10204
|
+
const remoteSlides = chunkJ56DMNSD_js.readSlidesFromYDoc(
|
|
10202
10205
|
doc
|
|
10203
10206
|
);
|
|
10204
10207
|
if (remoteSlides.length === 0) {
|
|
@@ -10214,7 +10217,7 @@ function useYjsDocumentSync({
|
|
|
10214
10217
|
isApplyingRemoteRef.current = false;
|
|
10215
10218
|
scheduleWriteBack();
|
|
10216
10219
|
};
|
|
10217
|
-
const unobserve =
|
|
10220
|
+
const unobserve = chunkJ56DMNSD_js.observeYDocSlides(
|
|
10218
10221
|
doc,
|
|
10219
10222
|
handleChange
|
|
10220
10223
|
);
|
|
@@ -10252,7 +10255,7 @@ function useBroadcastFollower({
|
|
|
10252
10255
|
if (!broadcaster) {
|
|
10253
10256
|
return;
|
|
10254
10257
|
}
|
|
10255
|
-
if (!
|
|
10258
|
+
if (!chunkJ56DMNSD_js.shouldAutoFollowBroadcaster({
|
|
10256
10259
|
localRole: collab.config.role,
|
|
10257
10260
|
broadcasterRole: broadcaster.role
|
|
10258
10261
|
})) {
|
|
@@ -10423,10 +10426,10 @@ function useTouchGestures(input) {
|
|
|
10423
10426
|
if (!el || !enabled) {
|
|
10424
10427
|
return;
|
|
10425
10428
|
}
|
|
10426
|
-
const recognizer =
|
|
10429
|
+
const recognizer = chunkJ56DMNSD_js.createTouchGestureRecognizer({
|
|
10427
10430
|
getScale: () => scaleRef.current,
|
|
10428
|
-
minScale:
|
|
10429
|
-
maxScale:
|
|
10431
|
+
minScale: chunkJ56DMNSD_js.MIN_ZOOM_SCALE,
|
|
10432
|
+
maxScale: chunkJ56DMNSD_js.MAX_ZOOM_SCALE,
|
|
10430
10433
|
callbacks: {
|
|
10431
10434
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10432
10435
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10466,7 +10469,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10466
10469
|
return;
|
|
10467
10470
|
}
|
|
10468
10471
|
const rect = active.getBoundingClientRect();
|
|
10469
|
-
const delta =
|
|
10472
|
+
const delta = chunkJ56DMNSD_js.computeScrollDelta(
|
|
10470
10473
|
{ top: rect.top, bottom: rect.bottom },
|
|
10471
10474
|
window.innerHeight,
|
|
10472
10475
|
keyboardInset
|
|
@@ -10486,8 +10489,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10486
10489
|
return;
|
|
10487
10490
|
}
|
|
10488
10491
|
const update = () => {
|
|
10489
|
-
const metrics =
|
|
10490
|
-
const inset = metrics ?
|
|
10492
|
+
const metrics = chunkJ56DMNSD_js.readViewportMetrics(window);
|
|
10493
|
+
const inset = metrics ? chunkJ56DMNSD_js.computeKeyboardInset(metrics) : 0;
|
|
10491
10494
|
setKeyboardInset(inset);
|
|
10492
10495
|
if (inset > 0) {
|
|
10493
10496
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10498,8 +10501,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10498
10501
|
vv.addEventListener("scroll", update);
|
|
10499
10502
|
const onFocusIn = () => {
|
|
10500
10503
|
window.requestAnimationFrame(() => {
|
|
10501
|
-
const metrics =
|
|
10502
|
-
const inset = metrics ?
|
|
10504
|
+
const metrics = chunkJ56DMNSD_js.readViewportMetrics(window);
|
|
10505
|
+
const inset = metrics ? chunkJ56DMNSD_js.computeKeyboardInset(metrics) : 0;
|
|
10503
10506
|
if (inset > 0) {
|
|
10504
10507
|
scrollFocusedIntoView(inset);
|
|
10505
10508
|
}
|
|
@@ -10512,7 +10515,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10512
10515
|
document.removeEventListener("focusin", onFocusIn);
|
|
10513
10516
|
};
|
|
10514
10517
|
}, [enabled]);
|
|
10515
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10518
|
+
return { keyboardInset, isKeyboardOpen: chunkJ56DMNSD_js.isKeyboardOpen(keyboardInset) };
|
|
10516
10519
|
}
|
|
10517
10520
|
|
|
10518
10521
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10539,7 +10542,7 @@ function buildCanvasProps(input) {
|
|
|
10539
10542
|
} = input;
|
|
10540
10543
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10541
10544
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10542
|
-
const fieldContext =
|
|
10545
|
+
const fieldContext = chunkJ56DMNSD_js.buildFieldSubstitutionContext({
|
|
10543
10546
|
headerFooter: s.headerFooter,
|
|
10544
10547
|
customProperties: s.customProperties,
|
|
10545
10548
|
slide: activeSlide
|
|
@@ -10549,13 +10552,13 @@ function buildCanvasProps(input) {
|
|
|
10549
10552
|
if (mode === "present") {
|
|
10550
10553
|
presentation.handlePresentationAction(action);
|
|
10551
10554
|
} else if (action.url) {
|
|
10552
|
-
|
|
10555
|
+
chunkJ56DMNSD_js.safeOpenUrl(action.url);
|
|
10553
10556
|
}
|
|
10554
10557
|
};
|
|
10555
10558
|
const handleHyperlinkClick = (url) => {
|
|
10556
|
-
if (
|
|
10559
|
+
if (chunkJ56DMNSD_js.isPpactionUrl(url)) {
|
|
10557
10560
|
if (mode === "present") {
|
|
10558
|
-
const parsed =
|
|
10561
|
+
const parsed = chunkJ56DMNSD_js.parsePpactionUrl(url);
|
|
10559
10562
|
if (parsed) {
|
|
10560
10563
|
presentation.handlePresentationAction({
|
|
10561
10564
|
action: parsed.action,
|
|
@@ -10565,7 +10568,7 @@ function buildCanvasProps(input) {
|
|
|
10565
10568
|
}
|
|
10566
10569
|
return;
|
|
10567
10570
|
}
|
|
10568
|
-
|
|
10571
|
+
chunkJ56DMNSD_js.safeOpenUrl(url);
|
|
10569
10572
|
};
|
|
10570
10573
|
return {
|
|
10571
10574
|
activeSlide: effectiveSlide,
|
|
@@ -10661,7 +10664,7 @@ function buildCanvasProps(input) {
|
|
|
10661
10664
|
|
|
10662
10665
|
// src/viewer/hooks/useScopedLayoutOptions.ts
|
|
10663
10666
|
function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
|
|
10664
|
-
return
|
|
10667
|
+
return chunkJ56DMNSD_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
|
|
10665
10668
|
}
|
|
10666
10669
|
|
|
10667
10670
|
// src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
|
|
@@ -10674,7 +10677,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10674
10677
|
const current = activeSlide.animations ?? [];
|
|
10675
10678
|
if (group === "motionPath") {
|
|
10676
10679
|
propertyHandlers.handleUpdateSlide({
|
|
10677
|
-
animations:
|
|
10680
|
+
animations: chunkJ56DMNSD_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10678
10681
|
});
|
|
10679
10682
|
return;
|
|
10680
10683
|
}
|
|
@@ -10869,7 +10872,7 @@ function buildToolbarProps(input) {
|
|
|
10869
10872
|
onOpenFile,
|
|
10870
10873
|
onOpenRecentFile,
|
|
10871
10874
|
onCreatePresentation: (templateId) => {
|
|
10872
|
-
s.setSlides(
|
|
10875
|
+
s.setSlides(chunkJ56DMNSD_js.createBackstagePresentation(templateId));
|
|
10873
10876
|
s.setActiveSlideIndex(0);
|
|
10874
10877
|
s.setSelectedElementId(null);
|
|
10875
10878
|
s.setSelectedElementIds([]);
|
|
@@ -10898,7 +10901,7 @@ function buildToolbarProps(input) {
|
|
|
10898
10901
|
loadLayoutPreviews: input.loadLayoutPreviews,
|
|
10899
10902
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
10900
10903
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
10901
|
-
templateScheme:
|
|
10904
|
+
templateScheme: chunkJ56DMNSD_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
10902
10905
|
customShows: s.customShows,
|
|
10903
10906
|
activeCustomShowId: s.activeCustomShowId,
|
|
10904
10907
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -10939,7 +10942,7 @@ function buildToolbarProps(input) {
|
|
|
10939
10942
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
10940
10943
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
10941
10944
|
formatPainterActive: s.formatPainterActive,
|
|
10942
|
-
canActivateFormatPainter:
|
|
10945
|
+
canActivateFormatPainter: chunkJ56DMNSD_js.hasCopyableFormat(selectedElement),
|
|
10943
10946
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
10944
10947
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
10945
10948
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -11227,7 +11230,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11227
11230
|
}, [incomingContent]);
|
|
11228
11231
|
const onOpenFile = react.useCallback(() => {
|
|
11229
11232
|
void (async () => {
|
|
11230
|
-
const picked = await
|
|
11233
|
+
const picked = await chunkJ56DMNSD_js.openPptxFile();
|
|
11231
11234
|
if (picked) {
|
|
11232
11235
|
setContent(picked.buffer);
|
|
11233
11236
|
}
|
|
@@ -11235,7 +11238,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11235
11238
|
}, []);
|
|
11236
11239
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11237
11240
|
void (async () => {
|
|
11238
|
-
const bytes = await
|
|
11241
|
+
const bytes = await chunkJ56DMNSD_js.readBackstageRecentFile(key);
|
|
11239
11242
|
if (bytes) {
|
|
11240
11243
|
setContent(bytes);
|
|
11241
11244
|
}
|