pptx-react-viewer 2.16.3 → 2.16.4
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 +12 -0
- package/dist/{AiChatPanel-RGIINA3S.mjs → AiChatPanel-7DDN4QUA.mjs} +3 -3
- package/dist/AiChatPanel-7DDN4QUA.mjs.br +0 -0
- package/dist/AiChatPanel-7DDN4QUA.mjs.gz +0 -0
- package/dist/{AiChatPanel-2WWE5U3X.js → AiChatPanel-KEORKCTT.js} +22 -22
- package/dist/AiChatPanel-KEORKCTT.js.br +0 -0
- package/dist/AiChatPanel-KEORKCTT.js.gz +0 -0
- package/dist/{Model3DScene-2ZP3V2P2.mjs → Model3DScene-DEAQMMUS.mjs} +1 -1
- package/dist/Model3DScene-DEAQMMUS.mjs.br +0 -0
- package/dist/Model3DScene-DEAQMMUS.mjs.gz +0 -0
- package/dist/{Model3DScene-D2ZJ5XGR.js → Model3DScene-SBUYEWHL.js} +2 -2
- package/dist/Model3DScene-SBUYEWHL.js.br +0 -0
- package/dist/Model3DScene-SBUYEWHL.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-DWQ3IP5C.js → SurfaceChart3DScene-I5D54YQ3.js} +2 -2
- package/dist/SurfaceChart3DScene-I5D54YQ3.js.br +0 -0
- package/dist/SurfaceChart3DScene-I5D54YQ3.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-L7YPNZ7X.mjs → SurfaceChart3DScene-TXGS2PBK.mjs} +1 -1
- package/dist/SurfaceChart3DScene-TXGS2PBK.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-TXGS2PBK.mjs.gz +0 -0
- package/dist/{chunk-KMT3SLZC.mjs → chunk-23WSCMWN.mjs} +91 -19
- package/dist/chunk-23WSCMWN.mjs.br +0 -0
- package/dist/{chunk-KMT3SLZC.mjs.gz → chunk-23WSCMWN.mjs.gz} +0 -0
- package/dist/{chunk-ZYBVQXLR.js → chunk-FQ3FTNKV.js} +1054 -1054
- package/dist/chunk-FQ3FTNKV.js.br +0 -0
- package/dist/chunk-FQ3FTNKV.js.gz +0 -0
- package/dist/{chunk-FVWVEWUG.mjs → chunk-GSAOP4Z4.mjs} +7 -7
- package/dist/chunk-GSAOP4Z4.mjs.br +0 -0
- package/dist/chunk-GSAOP4Z4.mjs.gz +0 -0
- package/dist/{chunk-LBP6BUD4.js → chunk-GZ2V3PWN.js} +3 -3
- package/dist/chunk-GZ2V3PWN.js.br +0 -0
- package/dist/chunk-GZ2V3PWN.js.gz +0 -0
- package/dist/{chunk-KTWK3D6O.js → chunk-HAQDKQ52.js} +255 -255
- package/dist/chunk-HAQDKQ52.js.br +0 -0
- package/dist/chunk-HAQDKQ52.js.gz +0 -0
- package/dist/{chunk-JHDAOYRQ.mjs → chunk-J4QZVO3S.mjs} +1 -1
- package/dist/chunk-J4QZVO3S.mjs.br +0 -0
- package/dist/chunk-J4QZVO3S.mjs.gz +0 -0
- package/dist/{chunk-OZ3HGL6E.mjs → chunk-LLTUDPRE.mjs} +2 -2
- package/dist/chunk-LLTUDPRE.mjs.br +0 -0
- package/dist/{chunk-OZ3HGL6E.mjs.gz → chunk-LLTUDPRE.mjs.gz} +0 -0
- package/dist/{chunk-2UVKMKRP.js → chunk-MZ47MV52.js} +91 -19
- package/dist/chunk-MZ47MV52.js.br +0 -0
- package/dist/{chunk-2UVKMKRP.js.gz → chunk-MZ47MV52.js.gz} +0 -0
- package/dist/{chunk-EBLFH3R2.mjs → chunk-PLBS7OL2.mjs} +2 -2
- package/dist/chunk-PLBS7OL2.mjs.br +0 -0
- package/dist/chunk-PLBS7OL2.mjs.gz +0 -0
- package/dist/{chunk-U7SASWG4.js → chunk-RBQUSVYR.js} +340 -340
- package/dist/chunk-RBQUSVYR.js.br +0 -0
- package/dist/chunk-RBQUSVYR.js.gz +0 -0
- package/dist/index.js +39 -39
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.js +78 -78
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +3 -3
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/viewer/index.js +26 -26
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +5 -5
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +2 -2
- package/dist/AiChatPanel-2WWE5U3X.js.br +0 -0
- package/dist/AiChatPanel-2WWE5U3X.js.gz +0 -0
- package/dist/AiChatPanel-RGIINA3S.mjs.br +0 -0
- package/dist/AiChatPanel-RGIINA3S.mjs.gz +0 -0
- package/dist/Model3DScene-2ZP3V2P2.mjs.br +0 -0
- package/dist/Model3DScene-2ZP3V2P2.mjs.gz +0 -0
- package/dist/Model3DScene-D2ZJ5XGR.js.br +0 -0
- package/dist/Model3DScene-D2ZJ5XGR.js.gz +0 -0
- package/dist/SurfaceChart3DScene-DWQ3IP5C.js.br +0 -0
- package/dist/SurfaceChart3DScene-DWQ3IP5C.js.gz +0 -0
- package/dist/SurfaceChart3DScene-L7YPNZ7X.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-L7YPNZ7X.mjs.gz +0 -0
- package/dist/chunk-2UVKMKRP.js.br +0 -0
- package/dist/chunk-EBLFH3R2.mjs.br +0 -0
- package/dist/chunk-EBLFH3R2.mjs.gz +0 -0
- package/dist/chunk-FVWVEWUG.mjs.br +0 -0
- package/dist/chunk-FVWVEWUG.mjs.gz +0 -0
- package/dist/chunk-JHDAOYRQ.mjs.br +0 -0
- package/dist/chunk-JHDAOYRQ.mjs.gz +0 -0
- package/dist/chunk-KMT3SLZC.mjs.br +0 -0
- package/dist/chunk-KTWK3D6O.js.br +0 -0
- package/dist/chunk-KTWK3D6O.js.gz +0 -0
- package/dist/chunk-LBP6BUD4.js.br +0 -0
- package/dist/chunk-LBP6BUD4.js.gz +0 -0
- package/dist/chunk-OZ3HGL6E.mjs.br +0 -0
- package/dist/chunk-U7SASWG4.js.br +0 -0
- package/dist/chunk-U7SASWG4.js.gz +0 -0
- package/dist/chunk-ZYBVQXLR.js.br +0 -0
- package/dist/chunk-ZYBVQXLR.js.gz +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkHAQDKQ52_js = require('./chunk-HAQDKQ52.js');
|
|
4
4
|
var chunkDVZF4ARG_js = require('./chunk-DVZF4ARG.js');
|
|
5
|
-
var
|
|
5
|
+
var chunkMZ47MV52_js = require('./chunk-MZ47MV52.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 = chunkMZ47MV52_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 = chunkMZ47MV52_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 ??= chunkMZ47MV52_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 >= chunkMZ47MV52_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
|
+
}, chunkMZ47MV52_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 = chunkMZ47MV52_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
|
+
chunkMZ47MV52_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 = chunkMZ47MV52_js.validateRoomId(config.roomId);
|
|
249
249
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
250
|
-
departureRef.current =
|
|
250
|
+
departureRef.current = chunkMZ47MV52_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 = chunkMZ47MV52_js.validateRoomId(config.roomId);
|
|
293
|
+
const transport = config.transport ?? chunkMZ47MV52_js.resolveTransportForServerUrl(config.serverUrl);
|
|
294
294
|
if (transport === "webrtc") {
|
|
295
295
|
await initWebrtc();
|
|
296
296
|
return;
|
|
297
297
|
}
|
|
298
|
-
if (
|
|
298
|
+
if (chunkMZ47MV52_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 = chunkMZ47MV52_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
|
+
chunkMZ47MV52_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
|
+
}, chunkMZ47MV52_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
|
+
chunkMZ47MV52_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 = chunkMZ47MV52_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 = chunkMZ47MV52_js.sanitizeColor(config?.userColor, "#6366f1");
|
|
418
418
|
const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
|
|
419
419
|
const { remoteUsers, broadcastPresence } = usePresenceTracking({
|
|
420
420
|
awareness,
|
|
@@ -523,8 +523,8 @@ function useEditorHistory(input) {
|
|
|
523
523
|
width: canvasSize.width,
|
|
524
524
|
height: canvasSize.height,
|
|
525
525
|
activeSlideIndex,
|
|
526
|
-
slides: slides.map(
|
|
527
|
-
templateElementsBySlideId:
|
|
526
|
+
slides: slides.map(chunkMZ47MV52_js.cloneSlide),
|
|
527
|
+
templateElementsBySlideId: chunkMZ47MV52_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
528
528
|
...actionLabel ? { actionLabel } : {}
|
|
529
529
|
};
|
|
530
530
|
},
|
|
@@ -537,9 +537,9 @@ function useEditorHistory(input) {
|
|
|
537
537
|
width: snapshot.width,
|
|
538
538
|
height: snapshot.height
|
|
539
539
|
});
|
|
540
|
-
setSlides(snapshot.slides.map(
|
|
540
|
+
setSlides(snapshot.slides.map(chunkMZ47MV52_js.cloneSlide));
|
|
541
541
|
setTemplateElementsBySlideId(
|
|
542
|
-
|
|
542
|
+
chunkMZ47MV52_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
543
543
|
);
|
|
544
544
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
545
545
|
setSelectedElementIds([]);
|
|
@@ -573,8 +573,8 @@ function useEditorHistory(input) {
|
|
|
573
573
|
const currentSnapshot = buildHistorySnapshot();
|
|
574
574
|
historyFutureRef.current.push(currentSnapshot);
|
|
575
575
|
isApplyingHistoryRef.current = true;
|
|
576
|
-
const nextSnapshot =
|
|
577
|
-
lastHistorySnapshotRef.current =
|
|
576
|
+
const nextSnapshot = chunkHAQDKQ52_js.cloneHistorySnapshot(previousSnapshot);
|
|
577
|
+
lastHistorySnapshotRef.current = chunkHAQDKQ52_js.cloneHistorySnapshot(nextSnapshot);
|
|
578
578
|
lastHistorySerializedRef.current = JSON.stringify(nextSnapshot);
|
|
579
579
|
applyHistorySnapshot(nextSnapshot);
|
|
580
580
|
updateHistoryAvailability();
|
|
@@ -595,8 +595,8 @@ function useEditorHistory(input) {
|
|
|
595
595
|
const currentSnapshot = buildHistorySnapshot();
|
|
596
596
|
historyPastRef.current.push(currentSnapshot);
|
|
597
597
|
isApplyingHistoryRef.current = true;
|
|
598
|
-
const targetSnapshot =
|
|
599
|
-
lastHistorySnapshotRef.current =
|
|
598
|
+
const targetSnapshot = chunkHAQDKQ52_js.cloneHistorySnapshot(nextSnapshot);
|
|
599
|
+
lastHistorySnapshotRef.current = chunkHAQDKQ52_js.cloneHistorySnapshot(targetSnapshot);
|
|
600
600
|
lastHistorySerializedRef.current = JSON.stringify(targetSnapshot);
|
|
601
601
|
applyHistorySnapshot(targetSnapshot);
|
|
602
602
|
updateHistoryAvailability();
|
|
@@ -614,7 +614,7 @@ function useEditorHistory(input) {
|
|
|
614
614
|
historyPastRef.current = [];
|
|
615
615
|
historyFutureRef.current = [];
|
|
616
616
|
if (initialSnapshot) {
|
|
617
|
-
const clonedInitial =
|
|
617
|
+
const clonedInitial = chunkHAQDKQ52_js.cloneHistorySnapshot(initialSnapshot);
|
|
618
618
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
619
619
|
lastHistorySerializedRef.current = JSON.stringify(clonedInitial);
|
|
620
620
|
} else {
|
|
@@ -655,18 +655,18 @@ function useEditorHistory(input) {
|
|
|
655
655
|
}
|
|
656
656
|
const previousSnapshot = lastHistorySnapshotRef.current;
|
|
657
657
|
if (!previousSnapshot) {
|
|
658
|
-
lastHistorySnapshotRef.current =
|
|
658
|
+
lastHistorySnapshotRef.current = chunkHAQDKQ52_js.cloneHistorySnapshot(snapshot);
|
|
659
659
|
lastHistorySerializedRef.current = serialized;
|
|
660
660
|
lastCheapHashRef.current = cheapHash;
|
|
661
661
|
updateHistoryAvailability();
|
|
662
662
|
return;
|
|
663
663
|
}
|
|
664
|
-
historyPastRef.current.push(
|
|
664
|
+
historyPastRef.current.push(chunkHAQDKQ52_js.cloneHistorySnapshot(previousSnapshot));
|
|
665
665
|
while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
|
|
666
666
|
historyPastRef.current.shift();
|
|
667
667
|
}
|
|
668
668
|
historyFutureRef.current = [];
|
|
669
|
-
lastHistorySnapshotRef.current =
|
|
669
|
+
lastHistorySnapshotRef.current = chunkHAQDKQ52_js.cloneHistorySnapshot(snapshot);
|
|
670
670
|
lastHistorySerializedRef.current = serialized;
|
|
671
671
|
lastCheapHashRef.current = cheapHash;
|
|
672
672
|
updateHistoryAvailability();
|
|
@@ -726,9 +726,9 @@ function useZoomViewport({
|
|
|
726
726
|
const canvasStageRef = react.useRef(null);
|
|
727
727
|
const canvasViewportRef = react.useRef(null);
|
|
728
728
|
const renderScaleRef = react.useRef(1);
|
|
729
|
-
const wheelBufferRef = react.useRef(
|
|
729
|
+
const wheelBufferRef = react.useRef(chunkMZ47MV52_js.createWheelStepBuffer());
|
|
730
730
|
const storeRef = react.useRef(null);
|
|
731
|
-
storeRef.current ??=
|
|
731
|
+
storeRef.current ??= chunkMZ47MV52_js.createViewerZoomStore();
|
|
732
732
|
const store = storeRef.current;
|
|
733
733
|
const scale = useViewerStore(store, selectZoom);
|
|
734
734
|
const setScale = react.useCallback(
|
|
@@ -789,7 +789,7 @@ function useZoomViewport({
|
|
|
789
789
|
if (!wrapper || !canvasViewport) {
|
|
790
790
|
return;
|
|
791
791
|
}
|
|
792
|
-
const boundedScale =
|
|
792
|
+
const boundedScale = chunkMZ47MV52_js.clampZoomScale(nextScale);
|
|
793
793
|
const nextEditorScale = fitScale * boundedScale;
|
|
794
794
|
const centerX = (bounds.minX + bounds.maxX) / 2;
|
|
795
795
|
const centerY = (bounds.minY + bounds.maxY) / 2;
|
|
@@ -826,29 +826,29 @@ function useZoomViewport({
|
|
|
826
826
|
selectedElements.forEach((element) => {
|
|
827
827
|
minX = Math.min(minX, element.x);
|
|
828
828
|
minY = Math.min(minY, element.y);
|
|
829
|
-
maxX = Math.max(maxX, element.x + Math.max(element.width,
|
|
830
|
-
maxY = Math.max(maxY, element.y + Math.max(element.height,
|
|
829
|
+
maxX = Math.max(maxX, element.x + Math.max(element.width, chunkHAQDKQ52_js.MIN_ELEMENT_SIZE));
|
|
830
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkHAQDKQ52_js.MIN_ELEMENT_SIZE));
|
|
831
831
|
});
|
|
832
832
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
833
833
|
return;
|
|
834
834
|
}
|
|
835
835
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
836
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
837
|
-
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY,
|
|
836
|
+
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkHAQDKQ52_js.MIN_ELEMENT_SIZE);
|
|
837
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkHAQDKQ52_js.MIN_ELEMENT_SIZE);
|
|
838
838
|
const availableWidth = Math.max(
|
|
839
|
-
effectiveEditorDimensions.width -
|
|
840
|
-
|
|
839
|
+
effectiveEditorDimensions.width - chunkHAQDKQ52_js.ZOOM_TO_SELECTION_PADDING,
|
|
840
|
+
chunkHAQDKQ52_js.MIN_ELEMENT_SIZE
|
|
841
841
|
);
|
|
842
842
|
const availableHeight = Math.max(
|
|
843
|
-
effectiveEditorDimensions.height -
|
|
844
|
-
|
|
843
|
+
effectiveEditorDimensions.height - chunkHAQDKQ52_js.ZOOM_TO_SELECTION_PADDING,
|
|
844
|
+
chunkHAQDKQ52_js.MIN_ELEMENT_SIZE
|
|
845
845
|
);
|
|
846
846
|
const targetEditorScale = Math.min(
|
|
847
847
|
availableWidth / boundsWidth,
|
|
848
848
|
availableHeight / boundsHeight
|
|
849
849
|
);
|
|
850
850
|
const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
|
|
851
|
-
const nextScale =
|
|
851
|
+
const nextScale = chunkMZ47MV52_js.clampZoomScale(targetEditorScale / safeFitScale);
|
|
852
852
|
setScale(nextScale);
|
|
853
853
|
window.requestAnimationFrame(() => {
|
|
854
854
|
window.requestAnimationFrame(() => {
|
|
@@ -865,14 +865,14 @@ function useZoomViewport({
|
|
|
865
865
|
]);
|
|
866
866
|
const handleWheel = react.useCallback(
|
|
867
867
|
(event) => {
|
|
868
|
-
const mapped =
|
|
868
|
+
const mapped = chunkMZ47MV52_js.mapEditingWheel(event, wheelBufferRef.current, true);
|
|
869
869
|
if (mapped.intent !== "zoom") {
|
|
870
870
|
return;
|
|
871
871
|
}
|
|
872
872
|
event.preventDefault();
|
|
873
873
|
store.dispatch({
|
|
874
874
|
type: "set-zoom",
|
|
875
|
-
zoom:
|
|
875
|
+
zoom: chunkMZ47MV52_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
|
|
876
876
|
});
|
|
877
877
|
},
|
|
878
878
|
[store]
|
|
@@ -960,7 +960,7 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
|
|
|
960
960
|
const command = step.command;
|
|
961
961
|
const timer = window.setTimeout(
|
|
962
962
|
() => {
|
|
963
|
-
|
|
963
|
+
chunkHAQDKQ52_js.executeMediaCommand(command);
|
|
964
964
|
},
|
|
965
965
|
Math.max(0, step.delayMs)
|
|
966
966
|
);
|
|
@@ -1097,7 +1097,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
|
|
|
1097
1097
|
}))
|
|
1098
1098
|
);
|
|
1099
1099
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1100
|
-
const delay =
|
|
1100
|
+
const delay = chunkMZ47MV52_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1101
1101
|
const timer = window.setTimeout(() => {
|
|
1102
1102
|
setPresentationAnimations(
|
|
1103
1103
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1129,7 +1129,7 @@ function useAnimationPlayback(input) {
|
|
|
1129
1129
|
(controller, group) => {
|
|
1130
1130
|
driveBuildReveal(
|
|
1131
1131
|
controller,
|
|
1132
|
-
|
|
1132
|
+
chunkMZ47MV52_js.PresentationAnimationController.collectBuildStepIds(group),
|
|
1133
1133
|
setPresentationElementStates,
|
|
1134
1134
|
buildRafRef
|
|
1135
1135
|
);
|
|
@@ -1192,7 +1192,7 @@ function useAnimationPlayback(input) {
|
|
|
1192
1192
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1193
1193
|
return;
|
|
1194
1194
|
}
|
|
1195
|
-
const controller =
|
|
1195
|
+
const controller = chunkMZ47MV52_js.PresentationAnimationController.fromSlide(slide);
|
|
1196
1196
|
controllerRef.current = controller;
|
|
1197
1197
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1198
1198
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
@@ -1350,12 +1350,12 @@ function useAnimationPlayback(input) {
|
|
|
1350
1350
|
presentationTimersRef
|
|
1351
1351
|
};
|
|
1352
1352
|
}
|
|
1353
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1354
|
-
var AUDIENCE_HASH =
|
|
1355
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1356
|
-
var AUDIENCE_NONCE_KEY =
|
|
1353
|
+
var PRESENTER_CHANNEL_NAME = chunkMZ47MV52_js.PRESENTATION_CHANNEL_NAME;
|
|
1354
|
+
var AUDIENCE_HASH = chunkMZ47MV52_js.PRESENTATION_HASH;
|
|
1355
|
+
var PRESENTER_MSG_ORIGIN = chunkMZ47MV52_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1356
|
+
var AUDIENCE_NONCE_KEY = chunkMZ47MV52_js.PRESENTATION_NONCE_KEY;
|
|
1357
1357
|
function generateSessionId() {
|
|
1358
|
-
return
|
|
1358
|
+
return chunkMZ47MV52_js.createPresentationSessionId();
|
|
1359
1359
|
}
|
|
1360
1360
|
function parseAudienceNonce() {
|
|
1361
1361
|
const hash = window.location.hash;
|
|
@@ -1391,7 +1391,7 @@ function usePresenterWindow(input) {
|
|
|
1391
1391
|
}, []);
|
|
1392
1392
|
const swapDisplays = react.useCallback(async () => {
|
|
1393
1393
|
const audience = audienceWindowRef.current;
|
|
1394
|
-
return audience && !audience.closed ?
|
|
1394
|
+
return audience && !audience.closed ? chunkMZ47MV52_js.swapPresentationWindows(window, audience) : false;
|
|
1395
1395
|
}, []);
|
|
1396
1396
|
const syncSlideToAudience = react.useCallback(
|
|
1397
1397
|
(slideIndex) => {
|
|
@@ -1455,7 +1455,7 @@ function usePresenterWindow(input) {
|
|
|
1455
1455
|
pollTimerRef.current = null;
|
|
1456
1456
|
}
|
|
1457
1457
|
if (closingSessionId) {
|
|
1458
|
-
void
|
|
1458
|
+
void chunkMZ47MV52_js.clearAudienceContent(closingSessionId);
|
|
1459
1459
|
}
|
|
1460
1460
|
}, [getChannel]);
|
|
1461
1461
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1473,10 +1473,10 @@ function usePresenterWindow(input) {
|
|
|
1473
1473
|
audienceWindowRef.current = blankWin;
|
|
1474
1474
|
const sessionId = generateSessionId();
|
|
1475
1475
|
sessionIdRef.current = sessionId;
|
|
1476
|
-
const audienceUrl =
|
|
1477
|
-
void
|
|
1476
|
+
const audienceUrl = chunkMZ47MV52_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1477
|
+
void chunkMZ47MV52_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1478
1478
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1479
|
-
|
|
1479
|
+
chunkMZ47MV52_js.placeAudienceWindow(blankWin, placement);
|
|
1480
1480
|
}
|
|
1481
1481
|
return void 0;
|
|
1482
1482
|
});
|
|
@@ -1506,7 +1506,7 @@ function usePresenterWindow(input) {
|
|
|
1506
1506
|
}
|
|
1507
1507
|
};
|
|
1508
1508
|
if (content) {
|
|
1509
|
-
void
|
|
1509
|
+
void chunkMZ47MV52_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1510
1510
|
} else {
|
|
1511
1511
|
navigateOrClose(true);
|
|
1512
1512
|
}
|
|
@@ -1532,7 +1532,7 @@ function usePresenterWindow(input) {
|
|
|
1532
1532
|
}
|
|
1533
1533
|
const handleMessage = (event) => {
|
|
1534
1534
|
const message = event.data;
|
|
1535
|
-
if (
|
|
1535
|
+
if (chunkMZ47MV52_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1536
1536
|
syncStateToAudience(snapshotRef.current);
|
|
1537
1537
|
}
|
|
1538
1538
|
};
|
|
@@ -1561,7 +1561,7 @@ function usePresenterWindow(input) {
|
|
|
1561
1561
|
react.useEffect(() => {
|
|
1562
1562
|
const handleBeforeUnload = () => {
|
|
1563
1563
|
if (sessionIdRef.current) {
|
|
1564
|
-
void
|
|
1564
|
+
void chunkMZ47MV52_js.clearAudienceContent(sessionIdRef.current);
|
|
1565
1565
|
}
|
|
1566
1566
|
};
|
|
1567
1567
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1623,7 +1623,7 @@ function useAudienceMode(input) {
|
|
|
1623
1623
|
}
|
|
1624
1624
|
channel.onmessage = (event) => {
|
|
1625
1625
|
const data = event.data;
|
|
1626
|
-
if (!
|
|
1626
|
+
if (!chunkMZ47MV52_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1627
1627
|
return;
|
|
1628
1628
|
}
|
|
1629
1629
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1639,16 +1639,16 @@ function useAudienceMode(input) {
|
|
|
1639
1639
|
}
|
|
1640
1640
|
if (data.type === "presenter-exit") {
|
|
1641
1641
|
if (expectedSessionId) {
|
|
1642
|
-
void
|
|
1642
|
+
void chunkMZ47MV52_js.clearAudienceContent(expectedSessionId);
|
|
1643
1643
|
}
|
|
1644
|
-
if (
|
|
1644
|
+
if (chunkMZ47MV52_js.endAudienceDisplay(window)) {
|
|
1645
1645
|
handlers.onPresenterEnded?.();
|
|
1646
1646
|
}
|
|
1647
1647
|
}
|
|
1648
1648
|
};
|
|
1649
1649
|
if (expectedSessionId) {
|
|
1650
1650
|
channel.postMessage({
|
|
1651
|
-
origin:
|
|
1651
|
+
origin: chunkMZ47MV52_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1652
1652
|
type: "audience-ready",
|
|
1653
1653
|
sessionId: expectedSessionId
|
|
1654
1654
|
});
|
|
@@ -1662,7 +1662,7 @@ function useAudienceMode(input) {
|
|
|
1662
1662
|
}, []);
|
|
1663
1663
|
}
|
|
1664
1664
|
function usePresentationKeyboard(input) {
|
|
1665
|
-
const wheelBufferRef = react.useRef(
|
|
1665
|
+
const wheelBufferRef = react.useRef(chunkMZ47MV52_js.createWheelStepBuffer());
|
|
1666
1666
|
const {
|
|
1667
1667
|
mode,
|
|
1668
1668
|
movePresentationSlide,
|
|
@@ -1682,14 +1682,14 @@ function usePresentationKeyboard(input) {
|
|
|
1682
1682
|
presentationSlideIndex,
|
|
1683
1683
|
setShowRehearsalSummary
|
|
1684
1684
|
} = input;
|
|
1685
|
-
const keyBufferRef = react.useRef(
|
|
1685
|
+
const keyBufferRef = react.useRef(chunkMZ47MV52_js.createPresentationKeyBuffer());
|
|
1686
1686
|
react.useEffect(() => {
|
|
1687
|
-
if (mode !== "present" || !
|
|
1688
|
-
keyBufferRef.current =
|
|
1687
|
+
if (mode !== "present" || !chunkMZ47MV52_js.acceptsPresentationInput()) {
|
|
1688
|
+
keyBufferRef.current = chunkMZ47MV52_js.createPresentationKeyBuffer();
|
|
1689
1689
|
return;
|
|
1690
1690
|
}
|
|
1691
1691
|
const handleKeyDown = (event) => {
|
|
1692
|
-
const mapped =
|
|
1692
|
+
const mapped = chunkMZ47MV52_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1693
1693
|
if (mapped.action === "none") {
|
|
1694
1694
|
return;
|
|
1695
1695
|
}
|
|
@@ -1709,12 +1709,12 @@ function usePresentationKeyboard(input) {
|
|
|
1709
1709
|
movePresentationSlide(-1);
|
|
1710
1710
|
return;
|
|
1711
1711
|
case "first": {
|
|
1712
|
-
const first =
|
|
1712
|
+
const first = chunkMZ47MV52_js.firstShowSlideIndex(showSlideIndexes);
|
|
1713
1713
|
navigateToSlide(first ?? 0);
|
|
1714
1714
|
return;
|
|
1715
1715
|
}
|
|
1716
1716
|
case "last": {
|
|
1717
|
-
const last =
|
|
1717
|
+
const last = chunkMZ47MV52_js.lastShowSlideIndex(showSlideIndexes);
|
|
1718
1718
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1719
1719
|
return;
|
|
1720
1720
|
}
|
|
@@ -1749,10 +1749,10 @@ function usePresentationKeyboard(input) {
|
|
|
1749
1749
|
}
|
|
1750
1750
|
};
|
|
1751
1751
|
const handleWheel = (event) => {
|
|
1752
|
-
if (mode !== "present" || !
|
|
1752
|
+
if (mode !== "present" || !chunkMZ47MV52_js.acceptsPresentationInput()) {
|
|
1753
1753
|
return;
|
|
1754
1754
|
}
|
|
1755
|
-
const mapped =
|
|
1755
|
+
const mapped = chunkMZ47MV52_js.mapPresentationWheel(event, wheelBufferRef.current);
|
|
1756
1756
|
if (mapped.intent === "next-slide") {
|
|
1757
1757
|
event.preventDefault();
|
|
1758
1758
|
movePresentationSlide(1);
|
|
@@ -1884,7 +1884,7 @@ function useRehearsalTimings(input) {
|
|
|
1884
1884
|
|
|
1885
1885
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1886
1886
|
function handlePresentationActionImpl(action, deps) {
|
|
1887
|
-
|
|
1887
|
+
chunkMZ47MV52_js.runPresentationAction(
|
|
1888
1888
|
action,
|
|
1889
1889
|
{ slideCount: deps.slidesLength },
|
|
1890
1890
|
{
|
|
@@ -1906,7 +1906,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1906
1906
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1907
1907
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1908
1908
|
const transition = incomingSlide?.transition;
|
|
1909
|
-
const durationMs = deps.playTransition ?
|
|
1909
|
+
const durationMs = deps.playTransition ? chunkMZ47MV52_js.resolveTransitionDurationMs(transition) : 0;
|
|
1910
1910
|
deps.clearPresentationTimers();
|
|
1911
1911
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1912
1912
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -1965,7 +1965,7 @@ function useSlideNavigation(input) {
|
|
|
1965
1965
|
});
|
|
1966
1966
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
1967
1967
|
(slideIndex) => {
|
|
1968
|
-
const delayMs =
|
|
1968
|
+
const delayMs = chunkMZ47MV52_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
1969
1969
|
if (delayMs === void 0) {
|
|
1970
1970
|
return;
|
|
1971
1971
|
}
|
|
@@ -1988,7 +1988,7 @@ function useSlideNavigation(input) {
|
|
|
1988
1988
|
if (availableSlideIndexes.length === 0) {
|
|
1989
1989
|
return;
|
|
1990
1990
|
}
|
|
1991
|
-
const pastLastSlide = direction === 1 && !
|
|
1991
|
+
const pastLastSlide = direction === 1 && !chunkMZ47MV52_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
1992
1992
|
if (rehearsing && pastLastSlide) {
|
|
1993
1993
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
1994
1994
|
try {
|
|
@@ -2006,9 +2006,9 @@ function useSlideNavigation(input) {
|
|
|
2006
2006
|
onAdvancePastLastSlide();
|
|
2007
2007
|
return;
|
|
2008
2008
|
}
|
|
2009
|
-
const nextSlideIndex = direction === 1 ?
|
|
2009
|
+
const nextSlideIndex = direction === 1 ? chunkMZ47MV52_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
2010
2010
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
2011
|
-
}) :
|
|
2011
|
+
}) : chunkMZ47MV52_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
2012
2012
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
2013
2013
|
return;
|
|
2014
2014
|
}
|
|
@@ -2153,22 +2153,22 @@ function useZoomNavigation(input) {
|
|
|
2153
2153
|
};
|
|
2154
2154
|
}
|
|
2155
2155
|
function usePresenterConsole(slideIndex, active) {
|
|
2156
|
-
const timerRef = react.useRef(
|
|
2157
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2156
|
+
const timerRef = react.useRef(chunkMZ47MV52_js.createPresenterTimer());
|
|
2157
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkMZ47MV52_js.createInitialPresentationSnapshot(slideIndex));
|
|
2158
2158
|
const patch = react.useCallback((value) => {
|
|
2159
|
-
setSnapshot((current) =>
|
|
2159
|
+
setSnapshot((current) => chunkMZ47MV52_js.mergePresentationSnapshot(current, value));
|
|
2160
2160
|
}, []);
|
|
2161
2161
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2162
2162
|
react.useEffect(() => {
|
|
2163
2163
|
if (!active) {
|
|
2164
2164
|
return;
|
|
2165
2165
|
}
|
|
2166
|
-
timerRef.current =
|
|
2166
|
+
timerRef.current = chunkMZ47MV52_js.resetPresenterTimer();
|
|
2167
2167
|
patch({ paused: false, elapsedMs: 0 });
|
|
2168
2168
|
const timer = window.setInterval(() => {
|
|
2169
2169
|
patch({
|
|
2170
2170
|
paused: timerRef.current.paused,
|
|
2171
|
-
elapsedMs:
|
|
2171
|
+
elapsedMs: chunkMZ47MV52_js.presenterElapsed(timerRef.current)
|
|
2172
2172
|
});
|
|
2173
2173
|
}, 1e3);
|
|
2174
2174
|
return () => window.clearInterval(timer);
|
|
@@ -2178,19 +2178,19 @@ function usePresenterConsole(slideIndex, active) {
|
|
|
2178
2178
|
applyAudienceSnapshot: setSnapshot,
|
|
2179
2179
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2180
2180
|
toggleTimer: () => {
|
|
2181
|
-
timerRef.current =
|
|
2181
|
+
timerRef.current = chunkMZ47MV52_js.togglePresenterTimer(timerRef.current);
|
|
2182
2182
|
patch({
|
|
2183
2183
|
paused: timerRef.current.paused,
|
|
2184
|
-
elapsedMs:
|
|
2184
|
+
elapsedMs: chunkMZ47MV52_js.presenterElapsed(timerRef.current)
|
|
2185
2185
|
});
|
|
2186
2186
|
},
|
|
2187
2187
|
resetTimer: () => {
|
|
2188
|
-
timerRef.current =
|
|
2188
|
+
timerRef.current = chunkMZ47MV52_js.resetPresenterTimer();
|
|
2189
2189
|
patch({ paused: false, elapsedMs: 0 });
|
|
2190
2190
|
},
|
|
2191
2191
|
stepZoom: (direction) => setSnapshot(
|
|
2192
|
-
(current) =>
|
|
2193
|
-
zoom:
|
|
2192
|
+
(current) => chunkMZ47MV52_js.mergePresentationSnapshot(current, {
|
|
2193
|
+
zoom: chunkMZ47MV52_js.stepPresenterZoom(
|
|
2194
2194
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2195
2195
|
direction
|
|
2196
2196
|
)
|
|
@@ -2235,7 +2235,7 @@ function usePresentationMode(input) {
|
|
|
2235
2235
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2236
2236
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2237
2237
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2238
|
-
const showGuard = react.useMemo(() =>
|
|
2238
|
+
const showGuard = react.useMemo(() => chunkMZ47MV52_js.createPresenterShowGuard(), []);
|
|
2239
2239
|
const {
|
|
2240
2240
|
presentationAnimations,
|
|
2241
2241
|
presentationElementStates,
|
|
@@ -2314,7 +2314,7 @@ function usePresentationMode(input) {
|
|
|
2314
2314
|
});
|
|
2315
2315
|
const movePresentationSlide = react.useCallback(
|
|
2316
2316
|
(direction, trigger = "explicit") => {
|
|
2317
|
-
if (!
|
|
2317
|
+
if (!chunkMZ47MV52_js.acceptsPresentationInput()) {
|
|
2318
2318
|
return;
|
|
2319
2319
|
}
|
|
2320
2320
|
if (endOfShowVisible) {
|
|
@@ -2451,7 +2451,7 @@ function usePresentationMode(input) {
|
|
|
2451
2451
|
if (mode !== "present") {
|
|
2452
2452
|
return;
|
|
2453
2453
|
}
|
|
2454
|
-
return
|
|
2454
|
+
return chunkMZ47MV52_js.attachPresentationVisibilityPause({
|
|
2455
2455
|
root: containerRef.current ?? void 0,
|
|
2456
2456
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2457
2457
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
@@ -2531,11 +2531,11 @@ function usePresentationMode(input) {
|
|
|
2531
2531
|
if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
|
|
2532
2532
|
return void 0;
|
|
2533
2533
|
}
|
|
2534
|
-
return
|
|
2534
|
+
return chunkMZ47MV52_js.buildMorphTransitionPlan(
|
|
2535
2535
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2536
2536
|
slides[transitionOverlay.incomingSlideIndex],
|
|
2537
2537
|
transitionOverlay.durationMs,
|
|
2538
|
-
|
|
2538
|
+
chunkMZ47MV52_js.morphOptionToMode(transitionOverlay.transition.morphOption)
|
|
2539
2539
|
);
|
|
2540
2540
|
}, [transitionOverlay, slides]);
|
|
2541
2541
|
const morphedElementStates = react.useMemo(() => {
|
|
@@ -2556,7 +2556,7 @@ function usePresentationMode(input) {
|
|
|
2556
2556
|
if (!morphPlan) {
|
|
2557
2557
|
return presentationKeyframesCss;
|
|
2558
2558
|
}
|
|
2559
|
-
const imageRules =
|
|
2559
|
+
const imageRules = chunkMZ47MV52_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
|
|
2560
2560
|
return `${presentationKeyframesCss ?? ""}
|
|
2561
2561
|
${morphPlan.keyframesCss}
|
|
2562
2562
|
${imageRules}`;
|
|
@@ -2845,7 +2845,7 @@ function findInSlides(slides, findQuery, findMatchCase) {
|
|
|
2845
2845
|
const normalised = findMatchCase ? findQuery : findQuery.toLowerCase();
|
|
2846
2846
|
slides.forEach((slide, slideIndex) => {
|
|
2847
2847
|
for (const element of slide.elements || []) {
|
|
2848
|
-
if (!
|
|
2848
|
+
if (!chunkMZ47MV52_js.hasTextProperties(element)) {
|
|
2849
2849
|
continue;
|
|
2850
2850
|
}
|
|
2851
2851
|
const segments = element.textSegments ?? [];
|
|
@@ -2896,7 +2896,7 @@ function applyFindReplacements(slides, toReplace, replaceQuery) {
|
|
|
2896
2896
|
continue;
|
|
2897
2897
|
}
|
|
2898
2898
|
const element = slide.elements[elIdx];
|
|
2899
|
-
if (!
|
|
2899
|
+
if (!chunkMZ47MV52_js.hasTextProperties(element)) {
|
|
2900
2900
|
continue;
|
|
2901
2901
|
}
|
|
2902
2902
|
const segments = [...element.textSegments ?? []];
|
|
@@ -3495,7 +3495,7 @@ function useViewerCoreState(_input) {
|
|
|
3495
3495
|
const marqueeStateRef = react.useRef(null);
|
|
3496
3496
|
const isDrawingRef = react.useRef(false);
|
|
3497
3497
|
const justInteractedRef = react.useRef(false);
|
|
3498
|
-
const livePatcher = react.useMemo(() =>
|
|
3498
|
+
const livePatcher = react.useMemo(() => chunkMZ47MV52_js.createCollaborationLivePatcher(), []);
|
|
3499
3499
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3500
3500
|
const slidesRef = react.useRef([]);
|
|
3501
3501
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3504,8 +3504,8 @@ function useViewerCoreState(_input) {
|
|
|
3504
3504
|
const [slides, setSlides] = react.useState([]);
|
|
3505
3505
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3506
3506
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3507
|
-
width:
|
|
3508
|
-
height:
|
|
3507
|
+
width: chunkHAQDKQ52_js.DEFAULT_CANVAS_WIDTH,
|
|
3508
|
+
height: chunkHAQDKQ52_js.DEFAULT_CANVAS_HEIGHT
|
|
3509
3509
|
});
|
|
3510
3510
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
3511
3511
|
const [selectedElementId, setSelectedElementId] = react.useState(null);
|
|
@@ -3525,7 +3525,7 @@ function useViewerCoreState(_input) {
|
|
|
3525
3525
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3526
3526
|
inlineEditingTextRef.current = resolved;
|
|
3527
3527
|
setInlineEditingTextBase(value);
|
|
3528
|
-
|
|
3528
|
+
chunkMZ47MV52_js.publishLiveInlineText(
|
|
3529
3529
|
livePatcher,
|
|
3530
3530
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3531
3531
|
inlineEditingElementIdRef.current,
|
|
@@ -3860,7 +3860,7 @@ function useLoadContent({
|
|
|
3860
3860
|
);
|
|
3861
3861
|
}
|
|
3862
3862
|
const previousHandler = handlerRef.current;
|
|
3863
|
-
const handler = new
|
|
3863
|
+
const handler = new chunkMZ47MV52_js.PptxHandler();
|
|
3864
3864
|
const parsed = await handler.load(buffer);
|
|
3865
3865
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3866
3866
|
handler.dispose();
|
|
@@ -3872,7 +3872,7 @@ function useLoadContent({
|
|
|
3872
3872
|
handlerRef.current = null;
|
|
3873
3873
|
const mediaElements = [];
|
|
3874
3874
|
for (const slide of parsed.slides) {
|
|
3875
|
-
|
|
3875
|
+
chunkMZ47MV52_js.collectMediaElements(slide.elements, mediaElements);
|
|
3876
3876
|
}
|
|
3877
3877
|
for (const url of mediaDataUrls.values()) {
|
|
3878
3878
|
if (url.startsWith("blob:")) {
|
|
@@ -3913,7 +3913,7 @@ function useLoadContent({
|
|
|
3913
3913
|
}
|
|
3914
3914
|
})
|
|
3915
3915
|
);
|
|
3916
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3916
|
+
const { paths: imagePaths, refs: imageRefs } = chunkMZ47MV52_js.collectImagePaths(parsed.slides);
|
|
3917
3917
|
let nextSlides = parsed.slides;
|
|
3918
3918
|
if (imagePaths.size > 0) {
|
|
3919
3919
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3968,12 +3968,12 @@ function useLoadContent({
|
|
|
3968
3968
|
}
|
|
3969
3969
|
}
|
|
3970
3970
|
handlerRef.current = handler;
|
|
3971
|
-
const partition =
|
|
3971
|
+
const partition = chunkHAQDKQ52_js.partitionTemplateElements(nextSlides);
|
|
3972
3972
|
setSlides(partition.slides);
|
|
3973
3973
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
3974
3974
|
setCanvasSize({
|
|
3975
|
-
width: parsed.width ??
|
|
3976
|
-
height: parsed.height ??
|
|
3975
|
+
width: parsed.width ?? chunkHAQDKQ52_js.DEFAULT_CANVAS_WIDTH,
|
|
3976
|
+
height: parsed.height ?? chunkHAQDKQ52_js.DEFAULT_CANVAS_HEIGHT
|
|
3977
3977
|
});
|
|
3978
3978
|
setHeaderFooter(parsed.headerFooter ?? {});
|
|
3979
3979
|
setLayoutOptions(parsed.layoutOptions ?? []);
|
|
@@ -4002,7 +4002,7 @@ function useLoadContent({
|
|
|
4002
4002
|
setHasMacros(parsed.hasMacros === true);
|
|
4003
4003
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
4004
4004
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
4005
|
-
setGuides(
|
|
4005
|
+
setGuides(chunkMZ47MV52_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
4006
4006
|
setActiveSlideIndex(0);
|
|
4007
4007
|
clearSelection();
|
|
4008
4008
|
setIsDirty(false);
|
|
@@ -4010,7 +4010,7 @@ function useLoadContent({
|
|
|
4010
4010
|
onContentApplied?.();
|
|
4011
4011
|
} catch (err) {
|
|
4012
4012
|
if (!cancelled && token === renderTokenRef.current) {
|
|
4013
|
-
if (err instanceof
|
|
4013
|
+
if (err instanceof chunkMZ47MV52_js.EncryptedFileError) {
|
|
4014
4014
|
setIsEncrypted(true);
|
|
4015
4015
|
} else {
|
|
4016
4016
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -4087,7 +4087,7 @@ function useAutosave(input) {
|
|
|
4087
4087
|
isSavingRef.current = false;
|
|
4088
4088
|
return;
|
|
4089
4089
|
}
|
|
4090
|
-
await
|
|
4090
|
+
await chunkMZ47MV52_js.saveAutosaveSnapshot(filePathRef.current, data);
|
|
4091
4091
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4092
4092
|
} catch (err) {
|
|
4093
4093
|
setAutosaveStatus({
|
|
@@ -4152,7 +4152,7 @@ function useElementOperations(input) {
|
|
|
4152
4152
|
}, [applySelection, setInlineEditingElementId, setContextMenuState]);
|
|
4153
4153
|
const updateElementById = react.useCallback(
|
|
4154
4154
|
(elementId, updates) => {
|
|
4155
|
-
if (
|
|
4155
|
+
if (chunkMZ47MV52_js.isTemplateElementId(elementId)) {
|
|
4156
4156
|
const slideId = activeSlide?.id;
|
|
4157
4157
|
if (slideId) {
|
|
4158
4158
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4192,7 +4192,7 @@ function useElementOperations(input) {
|
|
|
4192
4192
|
);
|
|
4193
4193
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4194
4194
|
(updates) => {
|
|
4195
|
-
if (!selectedElement || !
|
|
4195
|
+
if (!selectedElement || !chunkMZ47MV52_js.hasShapeProperties(selectedElement)) {
|
|
4196
4196
|
return;
|
|
4197
4197
|
}
|
|
4198
4198
|
updateSelectedElement({
|
|
@@ -4203,17 +4203,17 @@ function useElementOperations(input) {
|
|
|
4203
4203
|
);
|
|
4204
4204
|
const updateSelectedTextStyle = react.useCallback(
|
|
4205
4205
|
(updates) => {
|
|
4206
|
-
if (!selectedElement || !
|
|
4206
|
+
if (!selectedElement || !chunkMZ47MV52_js.hasTextProperties(selectedElement)) {
|
|
4207
4207
|
return;
|
|
4208
4208
|
}
|
|
4209
|
-
const inlineSel =
|
|
4209
|
+
const inlineSel = chunkMZ47MV52_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4210
4210
|
if (inlineSel && selectedElement.textSegments) {
|
|
4211
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4211
|
+
const { newSegments: newSegments2, newSelection } = chunkMZ47MV52_js.applyStyleToSelectedSegments(
|
|
4212
4212
|
selectedElement.textSegments,
|
|
4213
4213
|
inlineSel,
|
|
4214
4214
|
updates
|
|
4215
4215
|
);
|
|
4216
|
-
|
|
4216
|
+
chunkMZ47MV52_js.setPendingSelectionRestore(newSelection);
|
|
4217
4217
|
updateSelectedElement({
|
|
4218
4218
|
textSegments: newSegments2
|
|
4219
4219
|
});
|
|
@@ -4233,12 +4233,12 @@ function useElementOperations(input) {
|
|
|
4233
4233
|
);
|
|
4234
4234
|
const updateSelectedTextCase = react.useCallback(
|
|
4235
4235
|
(mode) => {
|
|
4236
|
-
if (!selectedElement || !
|
|
4236
|
+
if (!selectedElement || !chunkMZ47MV52_js.hasTextProperties(selectedElement)) {
|
|
4237
4237
|
return;
|
|
4238
4238
|
}
|
|
4239
|
-
const inlineSel =
|
|
4239
|
+
const inlineSel = chunkMZ47MV52_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4240
4240
|
if (inlineSel && selectedElement.textSegments) {
|
|
4241
|
-
const newSegments =
|
|
4241
|
+
const newSegments = chunkMZ47MV52_js.applyCaseTransformToSegments(
|
|
4242
4242
|
selectedElement.textSegments,
|
|
4243
4243
|
inlineSel,
|
|
4244
4244
|
mode
|
|
@@ -4248,14 +4248,14 @@ function useElementOperations(input) {
|
|
|
4248
4248
|
}
|
|
4249
4249
|
const updates = {};
|
|
4250
4250
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
4251
|
-
updates.textSegments =
|
|
4251
|
+
updates.textSegments = chunkMZ47MV52_js.applyCaseTransformToSegments(
|
|
4252
4252
|
selectedElement.textSegments,
|
|
4253
4253
|
null,
|
|
4254
4254
|
mode
|
|
4255
4255
|
);
|
|
4256
4256
|
}
|
|
4257
4257
|
if (typeof selectedElement.text === "string") {
|
|
4258
|
-
updates.text =
|
|
4258
|
+
updates.text = chunkMZ47MV52_js.transformTextCase(selectedElement.text, mode);
|
|
4259
4259
|
}
|
|
4260
4260
|
updateSelectedElement(updates);
|
|
4261
4261
|
},
|
|
@@ -4310,7 +4310,7 @@ function useSectionOperations(input) {
|
|
|
4310
4310
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4311
4311
|
const addSection2 = react.useCallback(
|
|
4312
4312
|
(name, afterSlideIndex) => {
|
|
4313
|
-
const result =
|
|
4313
|
+
const result = chunkMZ47MV52_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4314
4314
|
setSlides(result.slides);
|
|
4315
4315
|
setSections(result.sections);
|
|
4316
4316
|
markDirty();
|
|
@@ -4319,7 +4319,7 @@ function useSectionOperations(input) {
|
|
|
4319
4319
|
);
|
|
4320
4320
|
const renameSection2 = react.useCallback(
|
|
4321
4321
|
(sectionId, newName) => {
|
|
4322
|
-
const result =
|
|
4322
|
+
const result = chunkMZ47MV52_js.renameSection(sections, slides, sectionId, newName);
|
|
4323
4323
|
setSections(result.sections);
|
|
4324
4324
|
setSlides(result.slides);
|
|
4325
4325
|
markDirty();
|
|
@@ -4328,7 +4328,7 @@ function useSectionOperations(input) {
|
|
|
4328
4328
|
);
|
|
4329
4329
|
const deleteSection2 = react.useCallback(
|
|
4330
4330
|
(sectionId) => {
|
|
4331
|
-
const result =
|
|
4331
|
+
const result = chunkMZ47MV52_js.deleteSection(sections, slides, sectionId);
|
|
4332
4332
|
setSections(result.sections);
|
|
4333
4333
|
setSlides(result.slides);
|
|
4334
4334
|
markDirty();
|
|
@@ -4337,21 +4337,21 @@ function useSectionOperations(input) {
|
|
|
4337
4337
|
);
|
|
4338
4338
|
const moveSectionUp2 = react.useCallback(
|
|
4339
4339
|
(sectionId) => {
|
|
4340
|
-
setSections(
|
|
4340
|
+
setSections(chunkMZ47MV52_js.moveSectionUp(sections, sectionId));
|
|
4341
4341
|
markDirty();
|
|
4342
4342
|
},
|
|
4343
4343
|
[sections, setSections, markDirty]
|
|
4344
4344
|
);
|
|
4345
4345
|
const moveSectionDown2 = react.useCallback(
|
|
4346
4346
|
(sectionId) => {
|
|
4347
|
-
setSections(
|
|
4347
|
+
setSections(chunkMZ47MV52_js.moveSectionDown(sections, sectionId));
|
|
4348
4348
|
markDirty();
|
|
4349
4349
|
},
|
|
4350
4350
|
[sections, setSections, markDirty]
|
|
4351
4351
|
);
|
|
4352
4352
|
const moveSlidesToSection2 = react.useCallback(
|
|
4353
4353
|
(slideIndexes, targetSectionId) => {
|
|
4354
|
-
const result =
|
|
4354
|
+
const result = chunkMZ47MV52_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4355
4355
|
setSlides(result.slides);
|
|
4356
4356
|
setSections(result.sections);
|
|
4357
4357
|
markDirty();
|
|
@@ -4370,19 +4370,19 @@ function useSectionOperations(input) {
|
|
|
4370
4370
|
|
|
4371
4371
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4372
4372
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
4373
|
-
const resized =
|
|
4373
|
+
const resized = chunkMZ47MV52_js.applyResize(
|
|
4374
4374
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
4375
4375
|
handle,
|
|
4376
4376
|
dx,
|
|
4377
4377
|
dy,
|
|
4378
4378
|
1,
|
|
4379
|
-
{ minSize:
|
|
4379
|
+
{ minSize: chunkHAQDKQ52_js.MIN_ELEMENT_SIZE }
|
|
4380
4380
|
);
|
|
4381
4381
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4382
4382
|
if (!snapToGrid) {
|
|
4383
4383
|
return box;
|
|
4384
4384
|
}
|
|
4385
|
-
return
|
|
4385
|
+
return chunkMZ47MV52_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkHAQDKQ52_js.MIN_ELEMENT_SIZE);
|
|
4386
4386
|
}
|
|
4387
4387
|
function computeAdjustmentValue(startAdjustment, dx, startWidth) {
|
|
4388
4388
|
const range = startWidth || 200;
|
|
@@ -4500,7 +4500,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4500
4500
|
width: el.width,
|
|
4501
4501
|
height: el.height
|
|
4502
4502
|
}));
|
|
4503
|
-
const snapResult =
|
|
4503
|
+
const snapResult = chunkMZ47MV52_js.computeSnapToShape(
|
|
4504
4504
|
targetX,
|
|
4505
4505
|
targetY,
|
|
4506
4506
|
primaryEl.width,
|
|
@@ -4539,7 +4539,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4539
4539
|
if (live) {
|
|
4540
4540
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4541
4541
|
const start = drag.startPositionsById[id];
|
|
4542
|
-
|
|
4542
|
+
chunkMZ47MV52_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4543
4543
|
x: start.x + appliedDx,
|
|
4544
4544
|
y: start.y + appliedDy
|
|
4545
4545
|
});
|
|
@@ -4573,15 +4573,15 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4573
4573
|
if (rs.domEl) {
|
|
4574
4574
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4575
4575
|
rs.domEl.style.top = `${geo.y}px`;
|
|
4576
|
-
rs.domEl.style.width = `${Math.max(geo.width,
|
|
4577
|
-
rs.domEl.style.height = `${Math.max(geo.height,
|
|
4576
|
+
rs.domEl.style.width = `${Math.max(geo.width, chunkHAQDKQ52_js.MIN_ELEMENT_SIZE)}px`;
|
|
4577
|
+
rs.domEl.style.height = `${Math.max(geo.height, chunkHAQDKQ52_js.MIN_ELEMENT_SIZE)}px`;
|
|
4578
4578
|
}
|
|
4579
4579
|
if (live) {
|
|
4580
|
-
|
|
4580
|
+
chunkMZ47MV52_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4581
4581
|
x: geo.x,
|
|
4582
4582
|
y: geo.y,
|
|
4583
|
-
width: Math.max(geo.width,
|
|
4584
|
-
height: Math.max(geo.height,
|
|
4583
|
+
width: Math.max(geo.width, chunkHAQDKQ52_js.MIN_ELEMENT_SIZE),
|
|
4584
|
+
height: Math.max(geo.height, chunkHAQDKQ52_js.MIN_ELEMENT_SIZE)
|
|
4585
4585
|
});
|
|
4586
4586
|
}
|
|
4587
4587
|
}
|
|
@@ -4662,13 +4662,13 @@ function processPointerUp(input) {
|
|
|
4662
4662
|
if (i !== activeSlideIndex) {
|
|
4663
4663
|
return s;
|
|
4664
4664
|
}
|
|
4665
|
-
const rerouted =
|
|
4665
|
+
const rerouted = chunkMZ47MV52_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4666
4666
|
if (rerouted.length === 0) {
|
|
4667
4667
|
return s;
|
|
4668
4668
|
}
|
|
4669
4669
|
return {
|
|
4670
4670
|
...s,
|
|
4671
|
-
elements:
|
|
4671
|
+
elements: chunkMZ47MV52_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4672
4672
|
};
|
|
4673
4673
|
})
|
|
4674
4674
|
);
|
|
@@ -4693,9 +4693,9 @@ function processPointerUp(input) {
|
|
|
4693
4693
|
}
|
|
4694
4694
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4695
4695
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4696
|
-
const hitIds =
|
|
4696
|
+
const hitIds = chunkMZ47MV52_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4697
4697
|
if (marquee.additive) {
|
|
4698
|
-
const merged =
|
|
4698
|
+
const merged = chunkMZ47MV52_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4699
4699
|
if (merged.length > 0) {
|
|
4700
4700
|
applySelection(merged[0], merged);
|
|
4701
4701
|
} else {
|
|
@@ -4718,8 +4718,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4718
4718
|
}
|
|
4719
4719
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4720
4720
|
});
|
|
4721
|
-
const rerouted =
|
|
4722
|
-
return
|
|
4721
|
+
const rerouted = chunkMZ47MV52_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4722
|
+
return chunkMZ47MV52_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4723
4723
|
};
|
|
4724
4724
|
if (editTemplateMode) {
|
|
4725
4725
|
const slideId = activeSlide?.id;
|
|
@@ -4876,9 +4876,9 @@ function useCanvasInteractions(input) {
|
|
|
4876
4876
|
return;
|
|
4877
4877
|
}
|
|
4878
4878
|
const el = elementLookup.get(editId);
|
|
4879
|
-
if (el &&
|
|
4879
|
+
if (el && chunkMZ47MV52_js.hasTextProperties(el)) {
|
|
4880
4880
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
4881
|
-
const newSegments =
|
|
4881
|
+
const newSegments = chunkMZ47MV52_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
4882
4882
|
ops.updateElementById(editId, {
|
|
4883
4883
|
text: committedText,
|
|
4884
4884
|
textSegments: newSegments
|
|
@@ -4889,7 +4889,7 @@ function useCanvasInteractions(input) {
|
|
|
4889
4889
|
setInlineEditingText("");
|
|
4890
4890
|
};
|
|
4891
4891
|
const openEquationEditorForElement = (el) => {
|
|
4892
|
-
if (!
|
|
4892
|
+
if (!chunkMZ47MV52_js.hasTextProperties(el)) {
|
|
4893
4893
|
return false;
|
|
4894
4894
|
}
|
|
4895
4895
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -4919,7 +4919,7 @@ function useCanvasInteractions(input) {
|
|
|
4919
4919
|
justInteractedRef.current = false;
|
|
4920
4920
|
} else {
|
|
4921
4921
|
const el = elementLookup.get(elementId);
|
|
4922
|
-
if (el &&
|
|
4922
|
+
if (el && chunkMZ47MV52_js.hasTextProperties(el) && !el.locks?.noTextEdit) {
|
|
4923
4923
|
if (!openEquationEditorForElement(el)) {
|
|
4924
4924
|
setInlineEditingElementId(elementId);
|
|
4925
4925
|
setInlineEditingText(el.text ?? "");
|
|
@@ -4938,7 +4938,7 @@ function useCanvasInteractions(input) {
|
|
|
4938
4938
|
if (openEquationEditorForElement(el)) {
|
|
4939
4939
|
return;
|
|
4940
4940
|
}
|
|
4941
|
-
if (
|
|
4941
|
+
if (chunkMZ47MV52_js.hasTextProperties(el)) {
|
|
4942
4942
|
setInlineEditingElementId(elementId);
|
|
4943
4943
|
setInlineEditingText(el.text ?? "");
|
|
4944
4944
|
}
|
|
@@ -5131,7 +5131,7 @@ function createFileHandlers(deps) {
|
|
|
5131
5131
|
h = Math.round(h * scale);
|
|
5132
5132
|
}
|
|
5133
5133
|
addElement({
|
|
5134
|
-
id:
|
|
5134
|
+
id: chunkMZ47MV52_js.generateElementId(),
|
|
5135
5135
|
type: "image",
|
|
5136
5136
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5137
5137
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5142,7 +5142,7 @@ function createFileHandlers(deps) {
|
|
|
5142
5142
|
};
|
|
5143
5143
|
img.onerror = () => {
|
|
5144
5144
|
addElement({
|
|
5145
|
-
id:
|
|
5145
|
+
id: chunkMZ47MV52_js.generateElementId(),
|
|
5146
5146
|
type: "image",
|
|
5147
5147
|
x: 100,
|
|
5148
5148
|
y: 100,
|
|
@@ -5168,7 +5168,7 @@ function createFileHandlers(deps) {
|
|
|
5168
5168
|
const elFilePath = file.path;
|
|
5169
5169
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5170
5170
|
addElement({
|
|
5171
|
-
id:
|
|
5171
|
+
id: chunkMZ47MV52_js.generateElementId(),
|
|
5172
5172
|
type: "media",
|
|
5173
5173
|
mediaType,
|
|
5174
5174
|
mediaMimeType: file.type || void 0,
|
|
@@ -5343,13 +5343,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5343
5343
|
return;
|
|
5344
5344
|
}
|
|
5345
5345
|
addElement({
|
|
5346
|
-
id:
|
|
5346
|
+
id: chunkMZ47MV52_js.generateElementId(),
|
|
5347
5347
|
type: "smartArt",
|
|
5348
5348
|
x: 100,
|
|
5349
5349
|
y: 120,
|
|
5350
5350
|
width: 600,
|
|
5351
5351
|
height: 340,
|
|
5352
|
-
smartArtData:
|
|
5352
|
+
smartArtData: chunkMZ47MV52_js.buildSmartArtPresetData(
|
|
5353
5353
|
layout,
|
|
5354
5354
|
defaultItems,
|
|
5355
5355
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5361,7 +5361,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5361
5361
|
return;
|
|
5362
5362
|
}
|
|
5363
5363
|
addElement({
|
|
5364
|
-
id:
|
|
5364
|
+
id: chunkMZ47MV52_js.generateElementId(),
|
|
5365
5365
|
type: "shape",
|
|
5366
5366
|
x: 120,
|
|
5367
5367
|
y: 200,
|
|
@@ -5420,7 +5420,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5420
5420
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5421
5421
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5422
5422
|
addElement({
|
|
5423
|
-
id:
|
|
5423
|
+
id: chunkMZ47MV52_js.generateElementId(),
|
|
5424
5424
|
type: "shape",
|
|
5425
5425
|
x: 120,
|
|
5426
5426
|
y: 200,
|
|
@@ -5442,11 +5442,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5442
5442
|
if (!activeSlide) {
|
|
5443
5443
|
return;
|
|
5444
5444
|
}
|
|
5445
|
-
const preset =
|
|
5445
|
+
const preset = chunkMZ47MV52_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5446
5446
|
if (!preset) {
|
|
5447
5447
|
return;
|
|
5448
5448
|
}
|
|
5449
|
-
const defaultPptxAction =
|
|
5449
|
+
const defaultPptxAction = chunkMZ47MV52_js.elementActionToPptxAction({
|
|
5450
5450
|
trigger: "click",
|
|
5451
5451
|
type: preset.defaultAction
|
|
5452
5452
|
});
|
|
@@ -5455,7 +5455,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5455
5455
|
defaultPptxAction.highlightClick = true;
|
|
5456
5456
|
}
|
|
5457
5457
|
addElement({
|
|
5458
|
-
id:
|
|
5458
|
+
id: chunkMZ47MV52_js.generateElementId(),
|
|
5459
5459
|
type: "shape",
|
|
5460
5460
|
x: 150,
|
|
5461
5461
|
y: 150,
|
|
@@ -5522,14 +5522,14 @@ function useInsertElements(input) {
|
|
|
5522
5522
|
return;
|
|
5523
5523
|
}
|
|
5524
5524
|
addElement({
|
|
5525
|
-
id:
|
|
5525
|
+
id: chunkMZ47MV52_js.generateElementId(),
|
|
5526
5526
|
type: "text",
|
|
5527
5527
|
x: 100,
|
|
5528
5528
|
y: 100,
|
|
5529
5529
|
width: 300,
|
|
5530
5530
|
height: 60,
|
|
5531
5531
|
text: "",
|
|
5532
|
-
textStyle: { fontSize:
|
|
5532
|
+
textStyle: { fontSize: chunkHAQDKQ52_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5533
5533
|
});
|
|
5534
5534
|
};
|
|
5535
5535
|
const handleAddShape = () => {
|
|
@@ -5537,7 +5537,7 @@ function useInsertElements(input) {
|
|
|
5537
5537
|
return;
|
|
5538
5538
|
}
|
|
5539
5539
|
addElement({
|
|
5540
|
-
id:
|
|
5540
|
+
id: chunkMZ47MV52_js.generateElementId(),
|
|
5541
5541
|
type: "shape",
|
|
5542
5542
|
x: 150,
|
|
5543
5543
|
y: 150,
|
|
@@ -5556,15 +5556,15 @@ function useInsertElements(input) {
|
|
|
5556
5556
|
return;
|
|
5557
5557
|
}
|
|
5558
5558
|
addElement({
|
|
5559
|
-
...
|
|
5560
|
-
id:
|
|
5559
|
+
...chunkMZ47MV52_js.newTableElement(chunkHAQDKQ52_js.DEFAULT_TABLE_ROWS, chunkHAQDKQ52_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5560
|
+
id: chunkMZ47MV52_js.generateElementId()
|
|
5561
5561
|
});
|
|
5562
5562
|
};
|
|
5563
5563
|
const handleAddChart = (chartKind) => {
|
|
5564
5564
|
if (!activeSlide) {
|
|
5565
5565
|
return;
|
|
5566
5566
|
}
|
|
5567
|
-
addElement(
|
|
5567
|
+
addElement(chunkMZ47MV52_js.createDefaultChartElement(chartKind));
|
|
5568
5568
|
};
|
|
5569
5569
|
const structured = createStructuredElementHandlers({
|
|
5570
5570
|
activeSlide,
|
|
@@ -5634,7 +5634,7 @@ function useClipboardHandlers(input) {
|
|
|
5634
5634
|
if (!selectedElement) {
|
|
5635
5635
|
return;
|
|
5636
5636
|
}
|
|
5637
|
-
setClipboardPayload(
|
|
5637
|
+
setClipboardPayload(chunkMZ47MV52_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5638
5638
|
};
|
|
5639
5639
|
const handleDelete = () => {
|
|
5640
5640
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5651,7 +5651,7 @@ function useClipboardHandlers(input) {
|
|
|
5651
5651
|
handleDelete();
|
|
5652
5652
|
};
|
|
5653
5653
|
const insertClone = (source) => {
|
|
5654
|
-
const clone =
|
|
5654
|
+
const clone = chunkMZ47MV52_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5655
5655
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5656
5656
|
ops.applySelection(clone.id);
|
|
5657
5657
|
history.markDirty();
|
|
@@ -5686,7 +5686,7 @@ function resolveShapePath(el) {
|
|
|
5686
5686
|
return el.pathData;
|
|
5687
5687
|
}
|
|
5688
5688
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5689
|
-
const clipPath =
|
|
5689
|
+
const clipPath = chunkMZ47MV52_js.getPresetShapeClipPath(el.shapeType);
|
|
5690
5690
|
if (clipPath) {
|
|
5691
5691
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5692
5692
|
if (svgPath) {
|
|
@@ -5737,7 +5737,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5737
5737
|
return parts.join(" ");
|
|
5738
5738
|
}
|
|
5739
5739
|
function transformPathToGlobal(pathData, el) {
|
|
5740
|
-
const polys =
|
|
5740
|
+
const polys = chunkMZ47MV52_js.svgPathToPolygons(pathData);
|
|
5741
5741
|
if (polys.length === 0) {
|
|
5742
5742
|
return pathData;
|
|
5743
5743
|
}
|
|
@@ -5757,10 +5757,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5757
5757
|
y: pt.y * scaleY + el.y
|
|
5758
5758
|
}))
|
|
5759
5759
|
);
|
|
5760
|
-
return
|
|
5760
|
+
return chunkMZ47MV52_js.polygonsToSvgPath(transformed);
|
|
5761
5761
|
}
|
|
5762
5762
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5763
|
-
const polys =
|
|
5763
|
+
const polys = chunkMZ47MV52_js.svgPathToPolygons(pathData);
|
|
5764
5764
|
if (polys.length === 0) {
|
|
5765
5765
|
return pathData;
|
|
5766
5766
|
}
|
|
@@ -5770,10 +5770,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5770
5770
|
y: pt.y - y
|
|
5771
5771
|
}))
|
|
5772
5772
|
);
|
|
5773
|
-
return
|
|
5773
|
+
return chunkMZ47MV52_js.polygonsToSvgPath(transformed);
|
|
5774
5774
|
}
|
|
5775
5775
|
function pathBounds(pathData) {
|
|
5776
|
-
const polys =
|
|
5776
|
+
const polys = chunkMZ47MV52_js.svgPathToPolygons(pathData);
|
|
5777
5777
|
let minX = Infinity;
|
|
5778
5778
|
let minY = Infinity;
|
|
5779
5779
|
let maxX = -Infinity;
|
|
@@ -5832,7 +5832,7 @@ function useMergeShapesHandler(input) {
|
|
|
5832
5832
|
let allFragments = [];
|
|
5833
5833
|
let remaining = globalPaths[0];
|
|
5834
5834
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5835
|
-
const frags =
|
|
5835
|
+
const frags = chunkMZ47MV52_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
5836
5836
|
if (Array.isArray(frags)) {
|
|
5837
5837
|
allFragments = frags;
|
|
5838
5838
|
}
|
|
@@ -5861,7 +5861,7 @@ function useMergeShapesHandler(input) {
|
|
|
5861
5861
|
bounds.height
|
|
5862
5862
|
);
|
|
5863
5863
|
const newEl = {
|
|
5864
|
-
id:
|
|
5864
|
+
id: chunkMZ47MV52_js.generateElementId(),
|
|
5865
5865
|
type: "shape",
|
|
5866
5866
|
x: bounds.x,
|
|
5867
5867
|
y: bounds.y,
|
|
@@ -5899,7 +5899,7 @@ function useMergeShapesHandler(input) {
|
|
|
5899
5899
|
} else {
|
|
5900
5900
|
let resultPath = globalPaths[0];
|
|
5901
5901
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5902
|
-
const result =
|
|
5902
|
+
const result = chunkMZ47MV52_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
5903
5903
|
if (typeof result === "string") {
|
|
5904
5904
|
resultPath = result;
|
|
5905
5905
|
}
|
|
@@ -5920,7 +5920,7 @@ function useMergeShapesHandler(input) {
|
|
|
5920
5920
|
);
|
|
5921
5921
|
const primary = targets[0];
|
|
5922
5922
|
const newEl = {
|
|
5923
|
-
id:
|
|
5923
|
+
id: chunkMZ47MV52_js.generateElementId(),
|
|
5924
5924
|
type: "shape",
|
|
5925
5925
|
x: bounds.x,
|
|
5926
5926
|
y: bounds.y,
|
|
@@ -5983,7 +5983,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5983
5983
|
if (ids.length < 2 || !activeSlide) {
|
|
5984
5984
|
return;
|
|
5985
5985
|
}
|
|
5986
|
-
const { elements, groupId } =
|
|
5986
|
+
const { elements, groupId } = chunkMZ47MV52_js.groupElements(ops.activeElements, ids, chunkMZ47MV52_js.generateElementId());
|
|
5987
5987
|
if (groupId === null) {
|
|
5988
5988
|
return;
|
|
5989
5989
|
}
|
|
@@ -5996,12 +5996,12 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5996
5996
|
return;
|
|
5997
5997
|
}
|
|
5998
5998
|
const group = selectedElement;
|
|
5999
|
-
const intoTemplate =
|
|
5999
|
+
const intoTemplate = chunkMZ47MV52_js.isTemplateElementId(group.id);
|
|
6000
6000
|
const ungrouped = group.children.map((child) => ({
|
|
6001
6001
|
...structuredClone(child),
|
|
6002
6002
|
// Keep child ids in the same store as the group so later edits route
|
|
6003
6003
|
// correctly: template groups yield template-prefixed child ids.
|
|
6004
|
-
id: intoTemplate ?
|
|
6004
|
+
id: intoTemplate ? chunkMZ47MV52_js.makeCloneId(true, child.id || group.id) : child.id || chunkMZ47MV52_js.generateElementId(),
|
|
6005
6005
|
x: child.x + group.x,
|
|
6006
6006
|
y: child.y + group.y
|
|
6007
6007
|
}));
|
|
@@ -6025,7 +6025,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6025
6025
|
if (!edge) {
|
|
6026
6026
|
return;
|
|
6027
6027
|
}
|
|
6028
|
-
const positions =
|
|
6028
|
+
const positions = chunkMZ47MV52_js.alignElements(selectedElements, edge);
|
|
6029
6029
|
for (const [id, pos] of positions) {
|
|
6030
6030
|
const el = elementLookup.get(id);
|
|
6031
6031
|
if (!el) {
|
|
@@ -6043,7 +6043,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6043
6043
|
if (!distAxis) {
|
|
6044
6044
|
return;
|
|
6045
6045
|
}
|
|
6046
|
-
const positions =
|
|
6046
|
+
const positions = chunkMZ47MV52_js.distributeElements(selectedElements, distAxis);
|
|
6047
6047
|
for (const [id, pos] of positions) {
|
|
6048
6048
|
const el = elementLookup.get(id);
|
|
6049
6049
|
if (!el) {
|
|
@@ -6060,7 +6060,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6060
6060
|
}
|
|
6061
6061
|
const id = selectedElement.id;
|
|
6062
6062
|
ops.updateActiveElements(
|
|
6063
|
-
(els) => direction === "forward" ?
|
|
6063
|
+
(els) => direction === "forward" ? chunkMZ47MV52_js.bringForward(els, id) : direction === "backward" ? chunkMZ47MV52_js.sendBackward(els, id) : els
|
|
6064
6064
|
);
|
|
6065
6065
|
history.markDirty();
|
|
6066
6066
|
};
|
|
@@ -6070,7 +6070,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6070
6070
|
}
|
|
6071
6071
|
const id = selectedElement.id;
|
|
6072
6072
|
ops.updateActiveElements(
|
|
6073
|
-
(els) => direction === "front" ?
|
|
6073
|
+
(els) => direction === "front" ? chunkMZ47MV52_js.bringToFront(els, id) : chunkMZ47MV52_js.sendToBack(els, id)
|
|
6074
6074
|
);
|
|
6075
6075
|
history.markDirty();
|
|
6076
6076
|
};
|
|
@@ -6201,7 +6201,7 @@ function useSlideManagement(input) {
|
|
|
6201
6201
|
theme
|
|
6202
6202
|
} = input;
|
|
6203
6203
|
const handleAddSlide = () => {
|
|
6204
|
-
const newSlide =
|
|
6204
|
+
const newSlide = chunkMZ47MV52_js.createBlankSlide(slides.length + 1);
|
|
6205
6205
|
ops.updateSlides((prev) => {
|
|
6206
6206
|
const next = [...prev];
|
|
6207
6207
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6264,7 +6264,7 @@ function useSlideManagement(input) {
|
|
|
6264
6264
|
}
|
|
6265
6265
|
const clone = {
|
|
6266
6266
|
...src,
|
|
6267
|
-
id:
|
|
6267
|
+
id: chunkMZ47MV52_js.makeSlideId(),
|
|
6268
6268
|
elements: src.elements.map((el) => ({
|
|
6269
6269
|
...el,
|
|
6270
6270
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6296,7 +6296,7 @@ function useSlideManagement(input) {
|
|
|
6296
6296
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6297
6297
|
const insertAt = activeSlideIndex + 1;
|
|
6298
6298
|
const draft = {
|
|
6299
|
-
...
|
|
6299
|
+
...chunkMZ47MV52_js.createBlankSlide(slides.length + 1),
|
|
6300
6300
|
layoutPath,
|
|
6301
6301
|
...layoutName ? { layoutName } : {}
|
|
6302
6302
|
};
|
|
@@ -6329,9 +6329,9 @@ function useSlideManagement(input) {
|
|
|
6329
6329
|
};
|
|
6330
6330
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6331
6331
|
const insertAt = activeSlideIndex + 1;
|
|
6332
|
-
const draft =
|
|
6332
|
+
const draft = chunkMZ47MV52_js.buildSlideTemplateSlide(templateId, chunkMZ47MV52_js.makeSlideId(), slides.length + 1, {
|
|
6333
6333
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6334
|
-
scheme:
|
|
6334
|
+
scheme: chunkMZ47MV52_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6335
6335
|
});
|
|
6336
6336
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6337
6337
|
setActiveSlideIndex(insertAt);
|
|
@@ -6368,7 +6368,7 @@ function createTableMergeHandlers(input) {
|
|
|
6368
6368
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6369
6369
|
return;
|
|
6370
6370
|
}
|
|
6371
|
-
const newTableData =
|
|
6371
|
+
const newTableData = chunkMZ47MV52_js.mergeCells(
|
|
6372
6372
|
[
|
|
6373
6373
|
{ row: rowIndex, col: columnIndex },
|
|
6374
6374
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6376,7 +6376,7 @@ function createTableMergeHandlers(input) {
|
|
|
6376
6376
|
td
|
|
6377
6377
|
);
|
|
6378
6378
|
const updates = { tableData: newTableData };
|
|
6379
|
-
const newRawXml =
|
|
6379
|
+
const newRawXml = chunkMZ47MV52_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6380
6380
|
if (newRawXml) {
|
|
6381
6381
|
updates.rawXml = newRawXml;
|
|
6382
6382
|
}
|
|
@@ -6402,7 +6402,7 @@ function createTableMergeHandlers(input) {
|
|
|
6402
6402
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6403
6403
|
return;
|
|
6404
6404
|
}
|
|
6405
|
-
const newTableData =
|
|
6405
|
+
const newTableData = chunkMZ47MV52_js.mergeCells(
|
|
6406
6406
|
[
|
|
6407
6407
|
{ row: rowIndex, col: columnIndex },
|
|
6408
6408
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6410,7 +6410,7 @@ function createTableMergeHandlers(input) {
|
|
|
6410
6410
|
td
|
|
6411
6411
|
);
|
|
6412
6412
|
const updates = { tableData: newTableData };
|
|
6413
|
-
const newRawXml =
|
|
6413
|
+
const newRawXml = chunkMZ47MV52_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6414
6414
|
if (newRawXml) {
|
|
6415
6415
|
updates.rawXml = newRawXml;
|
|
6416
6416
|
}
|
|
@@ -6425,9 +6425,9 @@ function createTableMergeHandlers(input) {
|
|
|
6425
6425
|
return;
|
|
6426
6426
|
}
|
|
6427
6427
|
const td = selectedElement.tableData;
|
|
6428
|
-
const newTableData =
|
|
6428
|
+
const newTableData = chunkMZ47MV52_js.mergeCells(ts.selectedCells, td);
|
|
6429
6429
|
const updates = { tableData: newTableData };
|
|
6430
|
-
const newRawXml =
|
|
6430
|
+
const newRawXml = chunkMZ47MV52_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6431
6431
|
if (newRawXml) {
|
|
6432
6432
|
updates.rawXml = newRawXml;
|
|
6433
6433
|
}
|
|
@@ -6444,9 +6444,9 @@ function createTableMergeHandlers(input) {
|
|
|
6444
6444
|
}
|
|
6445
6445
|
const { rowIndex, columnIndex } = ts;
|
|
6446
6446
|
const td = selectedElement.tableData;
|
|
6447
|
-
const newTableData =
|
|
6447
|
+
const newTableData = chunkMZ47MV52_js.splitCell(rowIndex, columnIndex, td);
|
|
6448
6448
|
const updates = { tableData: newTableData };
|
|
6449
|
-
const newRawXml =
|
|
6449
|
+
const newRawXml = chunkMZ47MV52_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6450
6450
|
if (newRawXml) {
|
|
6451
6451
|
updates.rawXml = newRawXml;
|
|
6452
6452
|
}
|
|
@@ -6490,7 +6490,7 @@ function createTableStructHandlers(input) {
|
|
|
6490
6490
|
updates.tableData = { ...el.tableData, rows: newRows };
|
|
6491
6491
|
}
|
|
6492
6492
|
if (el.rawXml) {
|
|
6493
|
-
const newRawXml =
|
|
6493
|
+
const newRawXml = chunkMZ47MV52_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6494
6494
|
if (newRawXml) {
|
|
6495
6495
|
updates.rawXml = newRawXml;
|
|
6496
6496
|
}
|
|
@@ -6514,7 +6514,7 @@ function createTableStructHandlers(input) {
|
|
|
6514
6514
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6515
6515
|
const updates = {};
|
|
6516
6516
|
if (selectedElement.rawXml) {
|
|
6517
|
-
const newRawXml =
|
|
6517
|
+
const newRawXml = chunkMZ47MV52_js.updateCellTextStyleInRawXml(
|
|
6518
6518
|
selectedElement,
|
|
6519
6519
|
rowIndex,
|
|
6520
6520
|
colIndex,
|
|
@@ -6578,9 +6578,9 @@ function createTableStructHandlers(input) {
|
|
|
6578
6578
|
return;
|
|
6579
6579
|
}
|
|
6580
6580
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6581
|
-
const newTableData =
|
|
6581
|
+
const newTableData = chunkMZ47MV52_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6582
6582
|
const updates = { tableData: newTableData };
|
|
6583
|
-
const newRawXml =
|
|
6583
|
+
const newRawXml = chunkMZ47MV52_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6584
6584
|
if (newRawXml) {
|
|
6585
6585
|
updates.rawXml = newRawXml;
|
|
6586
6586
|
}
|
|
@@ -6593,12 +6593,12 @@ function createTableStructHandlers(input) {
|
|
|
6593
6593
|
}
|
|
6594
6594
|
const td = selectedElement.tableData;
|
|
6595
6595
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6596
|
-
const newTableData =
|
|
6596
|
+
const newTableData = chunkMZ47MV52_js.deleteTableRow(td, rowIdx);
|
|
6597
6597
|
if (newTableData === td) {
|
|
6598
6598
|
return;
|
|
6599
6599
|
}
|
|
6600
6600
|
const updates = { tableData: newTableData };
|
|
6601
|
-
const newRawXml =
|
|
6601
|
+
const newRawXml = chunkMZ47MV52_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6602
6602
|
if (newRawXml) {
|
|
6603
6603
|
updates.rawXml = newRawXml;
|
|
6604
6604
|
}
|
|
@@ -6610,9 +6610,9 @@ function createTableStructHandlers(input) {
|
|
|
6610
6610
|
return;
|
|
6611
6611
|
}
|
|
6612
6612
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6613
|
-
const newTableData =
|
|
6613
|
+
const newTableData = chunkMZ47MV52_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6614
6614
|
const updates = { tableData: newTableData };
|
|
6615
|
-
const newRawXml =
|
|
6615
|
+
const newRawXml = chunkMZ47MV52_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6616
6616
|
if (newRawXml) {
|
|
6617
6617
|
updates.rawXml = newRawXml;
|
|
6618
6618
|
}
|
|
@@ -6625,12 +6625,12 @@ function createTableStructHandlers(input) {
|
|
|
6625
6625
|
}
|
|
6626
6626
|
const td = selectedElement.tableData;
|
|
6627
6627
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6628
|
-
const newTableData =
|
|
6628
|
+
const newTableData = chunkMZ47MV52_js.deleteTableColumn(td, colIdx);
|
|
6629
6629
|
if (newTableData === td) {
|
|
6630
6630
|
return;
|
|
6631
6631
|
}
|
|
6632
6632
|
const updates = { tableData: newTableData };
|
|
6633
|
-
const newRawXml =
|
|
6633
|
+
const newRawXml = chunkMZ47MV52_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6634
6634
|
if (newRawXml) {
|
|
6635
6635
|
updates.rawXml = newRawXml;
|
|
6636
6636
|
}
|
|
@@ -6666,8 +6666,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6666
6666
|
return html2canvasPro(element, {
|
|
6667
6667
|
...options,
|
|
6668
6668
|
onclone: async (doc, clonedEl) => {
|
|
6669
|
-
await
|
|
6670
|
-
|
|
6669
|
+
await chunkMZ47MV52_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6670
|
+
chunkMZ47MV52_js.preprocessCssForCapture(clonedEl);
|
|
6671
6671
|
if (typeof userOnClone === "function") {
|
|
6672
6672
|
userOnClone(doc, clonedEl);
|
|
6673
6673
|
}
|
|
@@ -6723,7 +6723,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
6723
6723
|
}
|
|
6724
6724
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
6725
6725
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
6726
|
-
|
|
6726
|
+
chunkMZ47MV52_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
6727
6727
|
}
|
|
6728
6728
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
6729
6729
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -6745,15 +6745,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6745
6745
|
continue;
|
|
6746
6746
|
}
|
|
6747
6747
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
6748
|
-
images.push(
|
|
6748
|
+
images.push(chunkMZ47MV52_js.canvasToJpegData(canvas));
|
|
6749
6749
|
}
|
|
6750
6750
|
onProgress?.(totalSlides, totalSlides);
|
|
6751
6751
|
setActiveSlide(currentSlideIndex);
|
|
6752
6752
|
if (images.length === 0) {
|
|
6753
6753
|
throw new Error(chunkDVZF4ARG_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
6754
6754
|
}
|
|
6755
|
-
const pdfBlobUrl =
|
|
6756
|
-
|
|
6755
|
+
const pdfBlobUrl = chunkHAQDKQ52_js.buildPdfFromImageData(images);
|
|
6756
|
+
chunkMZ47MV52_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
6757
6757
|
}
|
|
6758
6758
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
6759
6759
|
const { scale = 2, onProgress } = options;
|
|
@@ -6801,8 +6801,8 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
6801
6801
|
if (pages.length === 0) {
|
|
6802
6802
|
throw new Error(chunkDVZF4ARG_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
6803
6803
|
}
|
|
6804
|
-
const pdfDataUrl =
|
|
6805
|
-
|
|
6804
|
+
const pdfDataUrl = chunkHAQDKQ52_js.buildNotesPdf(pages);
|
|
6805
|
+
chunkMZ47MV52_js.downloadDataUrl(pdfDataUrl, filename);
|
|
6806
6806
|
}
|
|
6807
6807
|
|
|
6808
6808
|
// src/viewer/utils/export-video.ts
|
|
@@ -6846,7 +6846,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6846
6846
|
const fps = 30;
|
|
6847
6847
|
const stream = recordingCanvas.captureStream(fps);
|
|
6848
6848
|
const recorder = new MediaRecorder(stream, {
|
|
6849
|
-
mimeType:
|
|
6849
|
+
mimeType: chunkMZ47MV52_js.pickSupportedMimeType([...chunkMZ47MV52_js.WEBM_MIME_CANDIDATES]),
|
|
6850
6850
|
videoBitsPerSecond: 5e6
|
|
6851
6851
|
});
|
|
6852
6852
|
const chunks = [];
|
|
@@ -6869,8 +6869,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6869
6869
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
6870
6870
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
6871
6871
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
6872
|
-
const frameInterval =
|
|
6873
|
-
const framesNeeded =
|
|
6872
|
+
const frameInterval = chunkMZ47MV52_js.fpsToFrameIntervalMs(fps);
|
|
6873
|
+
const framesNeeded = chunkMZ47MV52_js.segmentFrameCount(duration, fps);
|
|
6874
6874
|
for (let f = 0; f < framesNeeded; f++) {
|
|
6875
6875
|
if (signal?.aborted) {
|
|
6876
6876
|
recorder.stop();
|
|
@@ -6919,7 +6919,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6919
6919
|
if (frames.length === 0) {
|
|
6920
6920
|
throw new Error(chunkDVZF4ARG_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
6921
6921
|
}
|
|
6922
|
-
const gifBytes =
|
|
6922
|
+
const gifBytes = chunkMZ47MV52_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
6923
6923
|
onProgress?.(totalSlides, totalSlides);
|
|
6924
6924
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
6925
6925
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -6973,7 +6973,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
6973
6973
|
continue;
|
|
6974
6974
|
}
|
|
6975
6975
|
onProgress?.(processedCount, data.slides.length);
|
|
6976
|
-
let svg =
|
|
6976
|
+
let svg = chunkMZ47MV52_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
6977
6977
|
if (embedFonts && fontFaces?.length) {
|
|
6978
6978
|
svg = injectFontFaces(svg, fontFaces);
|
|
6979
6979
|
}
|
|
@@ -7035,7 +7035,7 @@ function useExportSaveAs(input) {
|
|
|
7035
7035
|
}
|
|
7036
7036
|
setExportProgress(70);
|
|
7037
7037
|
setExportStatusMessage("Writing README...");
|
|
7038
|
-
const readme =
|
|
7038
|
+
const readme = chunkMZ47MV52_js.generatePackageReadme(pptxFilename);
|
|
7039
7039
|
pkgFolder.file("README.txt", readme);
|
|
7040
7040
|
if (abortCtrl.signal.aborted) {
|
|
7041
7041
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -7046,7 +7046,7 @@ function useExportSaveAs(input) {
|
|
|
7046
7046
|
setExportProgress(95);
|
|
7047
7047
|
setExportStatusMessage("Downloading...");
|
|
7048
7048
|
const baseName = pptxFilename.replace(/\.[^.]+$/u, "");
|
|
7049
|
-
|
|
7049
|
+
chunkMZ47MV52_js.downloadBlob(zipBlob, `${baseName}-package.zip`);
|
|
7050
7050
|
setExportProgress(100);
|
|
7051
7051
|
} catch (err) {
|
|
7052
7052
|
if (err.name !== "AbortError") {
|
|
@@ -7069,7 +7069,7 @@ function useExportSaveAs(input) {
|
|
|
7069
7069
|
const blob = new Blob([data], {
|
|
7070
7070
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
7071
7071
|
});
|
|
7072
|
-
|
|
7072
|
+
chunkMZ47MV52_js.downloadBlob(blob, `${baseName}.${ext}`);
|
|
7073
7073
|
} catch (err) {
|
|
7074
7074
|
console.error(`[PowerPointViewer] Save as .${ext} failed:`, err);
|
|
7075
7075
|
}
|
|
@@ -7082,14 +7082,14 @@ function useExportSaveAs(input) {
|
|
|
7082
7082
|
const pptxGuides = guides.map((g) => ({
|
|
7083
7083
|
id: g.id,
|
|
7084
7084
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
7085
|
-
positionEmu:
|
|
7085
|
+
positionEmu: chunkMZ47MV52_js.guidePxToEmu(g.position)
|
|
7086
7086
|
}));
|
|
7087
7087
|
return {
|
|
7088
7088
|
...slide,
|
|
7089
7089
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
7090
7090
|
};
|
|
7091
7091
|
});
|
|
7092
|
-
const slidesToSave =
|
|
7092
|
+
const slidesToSave = chunkHAQDKQ52_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
7093
7093
|
const saveOptions = {
|
|
7094
7094
|
headerFooter,
|
|
7095
7095
|
presentationProperties,
|
|
@@ -7115,11 +7115,11 @@ function useExportSaveAs(input) {
|
|
|
7115
7115
|
const handleExportJson = () => {
|
|
7116
7116
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7117
7117
|
const data = {
|
|
7118
|
-
slides:
|
|
7118
|
+
slides: chunkHAQDKQ52_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7119
7119
|
width: canvasSize.width,
|
|
7120
7120
|
height: canvasSize.height,
|
|
7121
|
-
widthEmu:
|
|
7122
|
-
heightEmu:
|
|
7121
|
+
widthEmu: chunkMZ47MV52_js.guidePxToEmu(canvasSize.width),
|
|
7122
|
+
heightEmu: chunkMZ47MV52_js.guidePxToEmu(canvasSize.height),
|
|
7123
7123
|
theme,
|
|
7124
7124
|
headerFooter,
|
|
7125
7125
|
presentationProperties,
|
|
@@ -7133,7 +7133,7 @@ function useExportSaveAs(input) {
|
|
|
7133
7133
|
handoutMaster
|
|
7134
7134
|
};
|
|
7135
7135
|
try {
|
|
7136
|
-
|
|
7136
|
+
chunkMZ47MV52_js.exportDeckJson(data, sourceName);
|
|
7137
7137
|
} catch (err) {
|
|
7138
7138
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7139
7139
|
}
|
|
@@ -7173,7 +7173,7 @@ function safeConfirm(message) {
|
|
|
7173
7173
|
}
|
|
7174
7174
|
}
|
|
7175
7175
|
function downloadBlob2(blob, filename) {
|
|
7176
|
-
|
|
7176
|
+
chunkMZ47MV52_js.downloadBlob(blob, chunkMZ47MV52_js.sanitizeDownloadFilename(filename));
|
|
7177
7177
|
}
|
|
7178
7178
|
|
|
7179
7179
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -7279,21 +7279,21 @@ function useExportHandlers(input) {
|
|
|
7279
7279
|
{
|
|
7280
7280
|
scale: 2,
|
|
7281
7281
|
onProgress: (current, total) => {
|
|
7282
|
-
setExportProgress(
|
|
7283
|
-
setExportStatusMessage(
|
|
7282
|
+
setExportProgress(chunkMZ47MV52_js.slideProgressPercent(current, total));
|
|
7283
|
+
setExportStatusMessage(chunkMZ47MV52_js.slideStatusLabel("Rendering", current, total));
|
|
7284
7284
|
},
|
|
7285
7285
|
signal: abortCtrl.signal
|
|
7286
7286
|
}
|
|
7287
7287
|
);
|
|
7288
|
-
setExportProgress(
|
|
7288
|
+
setExportProgress(chunkMZ47MV52_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7289
7289
|
setExportStatusMessage("Building PDF...");
|
|
7290
7290
|
await new Promise((r) => {
|
|
7291
7291
|
setTimeout(r, 100);
|
|
7292
7292
|
});
|
|
7293
|
-
setExportProgress(
|
|
7293
|
+
setExportProgress(chunkMZ47MV52_js.EXPORT_DONE_PERCENT);
|
|
7294
7294
|
setExportStatusMessage("Done!");
|
|
7295
7295
|
} catch (err) {
|
|
7296
|
-
if (!
|
|
7296
|
+
if (!chunkMZ47MV52_js.isExportAbortError(err)) {
|
|
7297
7297
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7298
7298
|
}
|
|
7299
7299
|
} finally {
|
|
@@ -7323,21 +7323,21 @@ function useExportHandlers(input) {
|
|
|
7323
7323
|
{
|
|
7324
7324
|
scale: 2,
|
|
7325
7325
|
onProgress: (current, total) => {
|
|
7326
|
-
setExportProgress(
|
|
7327
|
-
setExportStatusMessage(
|
|
7326
|
+
setExportProgress(chunkMZ47MV52_js.slideProgressPercent(current, total));
|
|
7327
|
+
setExportStatusMessage(chunkMZ47MV52_js.slideStatusLabel("Rendering", current, total));
|
|
7328
7328
|
},
|
|
7329
7329
|
signal: abortCtrl.signal
|
|
7330
7330
|
}
|
|
7331
7331
|
);
|
|
7332
|
-
setExportProgress(
|
|
7332
|
+
setExportProgress(chunkMZ47MV52_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7333
7333
|
setExportStatusMessage("Building PDF...");
|
|
7334
7334
|
await new Promise((r) => {
|
|
7335
7335
|
setTimeout(r, 100);
|
|
7336
7336
|
});
|
|
7337
|
-
setExportProgress(
|
|
7337
|
+
setExportProgress(chunkMZ47MV52_js.EXPORT_DONE_PERCENT);
|
|
7338
7338
|
setExportStatusMessage("Done!");
|
|
7339
7339
|
} catch (err) {
|
|
7340
|
-
if (!
|
|
7340
|
+
if (!chunkMZ47MV52_js.isExportAbortError(err)) {
|
|
7341
7341
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7342
7342
|
}
|
|
7343
7343
|
} finally {
|
|
@@ -7378,22 +7378,22 @@ function useExportHandlers(input) {
|
|
|
7378
7378
|
scale: 1,
|
|
7379
7379
|
slideDurationMs: 3e3,
|
|
7380
7380
|
onProgress: (current, total) => {
|
|
7381
|
-
setExportProgress(
|
|
7382
|
-
setExportStatusMessage(
|
|
7381
|
+
setExportProgress(chunkMZ47MV52_js.slideProgressPercent(current, total, 45));
|
|
7382
|
+
setExportStatusMessage(chunkMZ47MV52_js.slideStatusLabel("Capturing", current, total));
|
|
7383
7383
|
},
|
|
7384
7384
|
onRecordProgress: (current, total) => {
|
|
7385
|
-
setExportProgress(
|
|
7386
|
-
setExportStatusMessage(
|
|
7385
|
+
setExportProgress(chunkMZ47MV52_js.recordProgressPercent(current, total));
|
|
7386
|
+
setExportStatusMessage(chunkMZ47MV52_js.slideStatusLabel("Recording", current, total));
|
|
7387
7387
|
},
|
|
7388
7388
|
signal: abortCtrl.signal
|
|
7389
7389
|
}
|
|
7390
7390
|
);
|
|
7391
|
-
setExportProgress(
|
|
7391
|
+
setExportProgress(chunkMZ47MV52_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7392
7392
|
setExportStatusMessage("Saving file...");
|
|
7393
7393
|
downloadBlob2(blob, "presentation.webm");
|
|
7394
|
-
setExportProgress(
|
|
7394
|
+
setExportProgress(chunkMZ47MV52_js.EXPORT_DONE_PERCENT);
|
|
7395
7395
|
} catch (err) {
|
|
7396
|
-
if (!
|
|
7396
|
+
if (!chunkMZ47MV52_js.isExportAbortError(err)) {
|
|
7397
7397
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7398
7398
|
}
|
|
7399
7399
|
} finally {
|
|
@@ -7421,18 +7421,18 @@ function useExportHandlers(input) {
|
|
|
7421
7421
|
scale: 0.5,
|
|
7422
7422
|
slideDurationMs: 2e3,
|
|
7423
7423
|
onProgress: (current, total) => {
|
|
7424
|
-
setExportProgress(
|
|
7425
|
-
setExportStatusMessage(
|
|
7424
|
+
setExportProgress(chunkMZ47MV52_js.slideProgressPercent(current, total));
|
|
7425
|
+
setExportStatusMessage(chunkMZ47MV52_js.slideStatusLabel("Encoding", current, total));
|
|
7426
7426
|
},
|
|
7427
7427
|
signal: abortCtrl.signal
|
|
7428
7428
|
}
|
|
7429
7429
|
);
|
|
7430
|
-
setExportProgress(
|
|
7430
|
+
setExportProgress(chunkMZ47MV52_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7431
7431
|
setExportStatusMessage("Saving file...");
|
|
7432
7432
|
downloadBlob2(blob, "presentation.gif");
|
|
7433
|
-
setExportProgress(
|
|
7433
|
+
setExportProgress(chunkMZ47MV52_js.EXPORT_DONE_PERCENT);
|
|
7434
7434
|
} catch (err) {
|
|
7435
|
-
if (!
|
|
7435
|
+
if (!chunkMZ47MV52_js.isExportAbortError(err)) {
|
|
7436
7436
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7437
7437
|
}
|
|
7438
7438
|
} finally {
|
|
@@ -7473,7 +7473,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
7473
7473
|
}
|
|
7474
7474
|
printWindow.document.open();
|
|
7475
7475
|
printWindow.document.write(
|
|
7476
|
-
|
|
7476
|
+
chunkMZ47MV52_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
7477
7477
|
);
|
|
7478
7478
|
printWindow.document.close();
|
|
7479
7479
|
printWindow.focus();
|
|
@@ -7534,7 +7534,7 @@ function usePrintHandlers(input) {
|
|
|
7534
7534
|
if (svgs.length === 0) {
|
|
7535
7535
|
return;
|
|
7536
7536
|
}
|
|
7537
|
-
const printDoc =
|
|
7537
|
+
const printDoc = chunkMZ47MV52_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7538
7538
|
title: "Slides (Vector)",
|
|
7539
7539
|
orientation: settings.orientation,
|
|
7540
7540
|
colorFilter
|
|
@@ -7570,7 +7570,7 @@ function usePrintHandlers(input) {
|
|
|
7570
7570
|
if (settings.printWhat === "outline") {
|
|
7571
7571
|
openPrintWindow(
|
|
7572
7572
|
"Outline",
|
|
7573
|
-
`<div class="outline-page">${
|
|
7573
|
+
`<div class="outline-page">${chunkMZ47MV52_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7574
7574
|
settings.orientation,
|
|
7575
7575
|
colorFilter,
|
|
7576
7576
|
settings.frameSlides
|
|
@@ -7595,7 +7595,7 @@ function usePrintHandlers(input) {
|
|
|
7595
7595
|
if (settings.printWhat === "slides") {
|
|
7596
7596
|
openPrintWindow(
|
|
7597
7597
|
"Slides",
|
|
7598
|
-
|
|
7598
|
+
chunkMZ47MV52_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7599
7599
|
settings.orientation,
|
|
7600
7600
|
colorFilter,
|
|
7601
7601
|
settings.frameSlides
|
|
@@ -7605,7 +7605,7 @@ function usePrintHandlers(input) {
|
|
|
7605
7605
|
if (settings.printWhat === "notes") {
|
|
7606
7606
|
openPrintWindow(
|
|
7607
7607
|
"Notes Pages",
|
|
7608
|
-
|
|
7608
|
+
chunkMZ47MV52_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7609
7609
|
"portrait",
|
|
7610
7610
|
colorFilter,
|
|
7611
7611
|
settings.frameSlides
|
|
@@ -7616,7 +7616,7 @@ function usePrintHandlers(input) {
|
|
|
7616
7616
|
const spp = settings.slidesPerPage;
|
|
7617
7617
|
openPrintWindow(
|
|
7618
7618
|
`Handout ${spp} per page`,
|
|
7619
|
-
|
|
7619
|
+
chunkMZ47MV52_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
7620
7620
|
"portrait",
|
|
7621
7621
|
colorFilter,
|
|
7622
7622
|
settings.frameSlides
|
|
@@ -7680,8 +7680,8 @@ function useThemeHandlers(input) {
|
|
|
7680
7680
|
return;
|
|
7681
7681
|
}
|
|
7682
7682
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7683
|
-
const previousMap = theme?.colorScheme ?
|
|
7684
|
-
setSlides((prev) =>
|
|
7683
|
+
const previousMap = theme?.colorScheme ? chunkMZ47MV52_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7684
|
+
setSlides((prev) => chunkMZ47MV52_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7685
7685
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7686
7686
|
bumpHistory();
|
|
7687
7687
|
history.markDirty();
|
|
@@ -7786,7 +7786,7 @@ function useThemeSwitching(input) {
|
|
|
7786
7786
|
}
|
|
7787
7787
|
try {
|
|
7788
7788
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7789
|
-
const newData =
|
|
7789
|
+
const newData = chunkMZ47MV52_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7790
7790
|
onDataChange(newData);
|
|
7791
7791
|
onThemeChanged?.(preset);
|
|
7792
7792
|
} catch (error) {
|
|
@@ -7803,7 +7803,7 @@ function useThemeSwitching(input) {
|
|
|
7803
7803
|
}
|
|
7804
7804
|
try {
|
|
7805
7805
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7806
|
-
const newData =
|
|
7806
|
+
const newData = chunkMZ47MV52_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7807
7807
|
onDataChange(newData);
|
|
7808
7808
|
} catch (error) {
|
|
7809
7809
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7815,12 +7815,12 @@ function useThemeSwitching(input) {
|
|
|
7815
7815
|
if (!data?.theme?.colorScheme) {
|
|
7816
7816
|
return void 0;
|
|
7817
7817
|
}
|
|
7818
|
-
return
|
|
7819
|
-
(p) =>
|
|
7818
|
+
return chunkMZ47MV52_js.THEME_PRESETS.find(
|
|
7819
|
+
(p) => chunkMZ47MV52_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7820
7820
|
);
|
|
7821
7821
|
}, [data?.theme?.colorScheme]);
|
|
7822
7822
|
return {
|
|
7823
|
-
presets:
|
|
7823
|
+
presets: chunkMZ47MV52_js.THEME_PRESETS,
|
|
7824
7824
|
switchToPreset,
|
|
7825
7825
|
switchToCustom,
|
|
7826
7826
|
currentPreset
|
|
@@ -7895,7 +7895,7 @@ function usePropertyHandlers(input) {
|
|
|
7895
7895
|
}
|
|
7896
7896
|
try {
|
|
7897
7897
|
const ab = await file.arrayBuffer();
|
|
7898
|
-
const h = new
|
|
7898
|
+
const h = new chunkMZ47MV52_js.PptxHandler();
|
|
7899
7899
|
const other = await h.load(ab);
|
|
7900
7900
|
if (!other) {
|
|
7901
7901
|
return;
|
|
@@ -7905,7 +7905,7 @@ function usePropertyHandlers(input) {
|
|
|
7905
7905
|
width: canvasSize.width,
|
|
7906
7906
|
height: canvasSize.height
|
|
7907
7907
|
};
|
|
7908
|
-
setCompareResult(
|
|
7908
|
+
setCompareResult(chunkMZ47MV52_js.comparePresentation(cur, other));
|
|
7909
7909
|
setIsComparePanelOpen(true);
|
|
7910
7910
|
} catch (err) {
|
|
7911
7911
|
console.warn("Compare failed:", err);
|
|
@@ -7922,7 +7922,7 @@ function usePropertyHandlers(input) {
|
|
|
7922
7922
|
if (!diff || diff.status === "unchanged") {
|
|
7923
7923
|
return;
|
|
7924
7924
|
}
|
|
7925
|
-
setSlides((prev) =>
|
|
7925
|
+
setSlides((prev) => chunkMZ47MV52_js.applyAcceptSlide(prev, diff));
|
|
7926
7926
|
setIsDirty(true);
|
|
7927
7927
|
},
|
|
7928
7928
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -7933,10 +7933,10 @@ function usePropertyHandlers(input) {
|
|
|
7933
7933
|
if (!compareResult) {
|
|
7934
7934
|
return;
|
|
7935
7935
|
}
|
|
7936
|
-
setSlides((prev) =>
|
|
7936
|
+
setSlides((prev) => chunkMZ47MV52_js.applyAcceptAllSlides(prev, compareResult));
|
|
7937
7937
|
setIsDirty(true);
|
|
7938
7938
|
}, [compareResult, setSlides, setIsDirty]);
|
|
7939
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
7939
|
+
const usedFontFamilies = react.useMemo(() => chunkMZ47MV52_js.collectUsedFonts(slides), [slides]);
|
|
7940
7940
|
return {
|
|
7941
7941
|
handleUpdateNotes,
|
|
7942
7942
|
handleUpdateSlide,
|
|
@@ -8055,7 +8055,7 @@ function useIsMobile(input) {
|
|
|
8055
8055
|
const containerRef = input?.containerRef;
|
|
8056
8056
|
const isTouchDevice = react.useSyncExternalStore(
|
|
8057
8057
|
subscribeTouchCapability,
|
|
8058
|
-
|
|
8058
|
+
chunkMZ47MV52_js.detectTouchDevice,
|
|
8059
8059
|
() => false
|
|
8060
8060
|
// server snapshot
|
|
8061
8061
|
);
|
|
@@ -8071,7 +8071,7 @@ function useIsMobile(input) {
|
|
|
8071
8071
|
}
|
|
8072
8072
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
8073
8073
|
});
|
|
8074
|
-
const [orientation, setOrientation] = react.useState(
|
|
8074
|
+
const [orientation, setOrientation] = react.useState(chunkMZ47MV52_js.detectOrientation);
|
|
8075
8075
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
8076
8076
|
const [initialViewportHeight] = react.useState(
|
|
8077
8077
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -8115,7 +8115,7 @@ function useIsMobile(input) {
|
|
|
8115
8115
|
return;
|
|
8116
8116
|
}
|
|
8117
8117
|
const handleOrientationChange = () => {
|
|
8118
|
-
setOrientation(
|
|
8118
|
+
setOrientation(chunkMZ47MV52_js.detectOrientation());
|
|
8119
8119
|
};
|
|
8120
8120
|
if (screen.orientation) {
|
|
8121
8121
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -8145,9 +8145,9 @@ function useIsMobile(input) {
|
|
|
8145
8145
|
window.addEventListener("resize", handleResize);
|
|
8146
8146
|
return () => window.removeEventListener("resize", handleResize);
|
|
8147
8147
|
}, [isTouchDevice, initialViewportHeight]);
|
|
8148
|
-
const isMobile =
|
|
8149
|
-
const isTablet = !isMobile && containerWidth >=
|
|
8150
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
8148
|
+
const isMobile = chunkMZ47MV52_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
8149
|
+
const isTablet = !isMobile && containerWidth >= chunkMZ47MV52_js.MOBILE_BREAKPOINT && containerWidth < chunkMZ47MV52_js.TABLET_BREAKPOINT;
|
|
8150
|
+
const isDesktop = !isMobile && containerWidth >= chunkMZ47MV52_js.TABLET_BREAKPOINT;
|
|
8151
8151
|
return {
|
|
8152
8152
|
isMobile,
|
|
8153
8153
|
isTablet,
|
|
@@ -8208,11 +8208,11 @@ function useViewerDialogs(input) {
|
|
|
8208
8208
|
);
|
|
8209
8209
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(false);
|
|
8210
8210
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8211
|
-
() => typeof window !== "undefined" ?
|
|
8211
|
+
() => typeof window !== "undefined" ? chunkMZ47MV52_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8212
8212
|
);
|
|
8213
8213
|
react.useEffect(() => {
|
|
8214
8214
|
const handleWindow = () => setIsNarrowViewport(
|
|
8215
|
-
|
|
8215
|
+
chunkMZ47MV52_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8216
8216
|
);
|
|
8217
8217
|
let observer = null;
|
|
8218
8218
|
let raf = 0;
|
|
@@ -8226,12 +8226,12 @@ function useViewerDialogs(input) {
|
|
|
8226
8226
|
const entry = entries[0];
|
|
8227
8227
|
if (entry) {
|
|
8228
8228
|
setIsNarrowViewport(
|
|
8229
|
-
|
|
8229
|
+
chunkMZ47MV52_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
8230
8230
|
);
|
|
8231
8231
|
}
|
|
8232
8232
|
});
|
|
8233
8233
|
observer.observe(el);
|
|
8234
|
-
setIsNarrowViewport(
|
|
8234
|
+
setIsNarrowViewport(chunkMZ47MV52_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
8235
8235
|
};
|
|
8236
8236
|
attach();
|
|
8237
8237
|
window.addEventListener("resize", handleWindow);
|
|
@@ -8389,20 +8389,20 @@ function useViewerDialogs(input) {
|
|
|
8389
8389
|
}
|
|
8390
8390
|
function computeGridSpacingPx(presentationGridSpacing) {
|
|
8391
8391
|
if (presentationGridSpacing) {
|
|
8392
|
-
const px = Math.round(presentationGridSpacing.cx /
|
|
8392
|
+
const px = Math.round(presentationGridSpacing.cx / chunkHAQDKQ52_js.EMU_PER_PX);
|
|
8393
8393
|
if (px > 0) {
|
|
8394
8394
|
return px;
|
|
8395
8395
|
}
|
|
8396
8396
|
}
|
|
8397
|
-
return
|
|
8397
|
+
return chunkHAQDKQ52_js.GRID_SIZE;
|
|
8398
8398
|
}
|
|
8399
8399
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8400
8400
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8401
|
-
return
|
|
8401
|
+
return chunkMZ47MV52_js.resolveShowSlideIndexes(slides, activeShow);
|
|
8402
8402
|
}
|
|
8403
8403
|
function computeSlideSectionGroups(slides, sections) {
|
|
8404
|
-
return
|
|
8405
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8404
|
+
return chunkMZ47MV52_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8405
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkHAQDKQ52_js.UNGROUPED_SECTION_ID : "default"),
|
|
8406
8406
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8407
8407
|
slideIndexes: group.slideIndexes,
|
|
8408
8408
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8457,7 +8457,7 @@ function useDerivedSlideState(input) {
|
|
|
8457
8457
|
);
|
|
8458
8458
|
const slideSectionGroups = react.useMemo(
|
|
8459
8459
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8460
|
-
if (group.id ===
|
|
8460
|
+
if (group.id === chunkHAQDKQ52_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8461
8461
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8462
8462
|
}
|
|
8463
8463
|
if (group.id === "default" && group.label === "Slides") {
|
|
@@ -8560,13 +8560,13 @@ function useAnnotationHandlers(input) {
|
|
|
8560
8560
|
}, [annotations, setMode, setSlides, history]);
|
|
8561
8561
|
const handleSetMode = react.useCallback(
|
|
8562
8562
|
(nextMode) => {
|
|
8563
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8563
|
+
if (mode === "present" && nextMode !== "present" && !chunkMZ47MV52_js.mayLeaveSlideShow()) {
|
|
8564
8564
|
return;
|
|
8565
8565
|
}
|
|
8566
8566
|
if (nextMode === "present") {
|
|
8567
8567
|
presentation.enterPresentMode();
|
|
8568
8568
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8569
|
-
|
|
8569
|
+
chunkMZ47MV52_js.stopAllPersistentAudio();
|
|
8570
8570
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8571
8571
|
if (promptKeepInkAnnotations) {
|
|
8572
8572
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8575,7 +8575,7 @@ function useAnnotationHandlers(input) {
|
|
|
8575
8575
|
}
|
|
8576
8576
|
} else {
|
|
8577
8577
|
if (mode === "present") {
|
|
8578
|
-
|
|
8578
|
+
chunkMZ47MV52_js.stopAllPersistentAudio();
|
|
8579
8579
|
}
|
|
8580
8580
|
setMode(nextMode);
|
|
8581
8581
|
}
|
|
@@ -8641,13 +8641,13 @@ function useSerialize(input) {
|
|
|
8641
8641
|
let processedSlide = slide;
|
|
8642
8642
|
if (pendingEditId) {
|
|
8643
8643
|
const updatedElements = slide.elements.map((el) => {
|
|
8644
|
-
if (el.id !== pendingEditId || !
|
|
8644
|
+
if (el.id !== pendingEditId || !chunkMZ47MV52_js.hasTextProperties(el)) {
|
|
8645
8645
|
return el;
|
|
8646
8646
|
}
|
|
8647
8647
|
return {
|
|
8648
8648
|
...el,
|
|
8649
8649
|
text: pendingEditText,
|
|
8650
|
-
textSegments:
|
|
8650
|
+
textSegments: chunkMZ47MV52_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8651
8651
|
};
|
|
8652
8652
|
});
|
|
8653
8653
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8660,14 +8660,14 @@ function useSerialize(input) {
|
|
|
8660
8660
|
const pptxGuides = guides.map((g) => ({
|
|
8661
8661
|
id: g.id,
|
|
8662
8662
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8663
|
-
positionEmu:
|
|
8663
|
+
positionEmu: chunkMZ47MV52_js.guidePxToEmu(g.position)
|
|
8664
8664
|
}));
|
|
8665
8665
|
return {
|
|
8666
8666
|
...processedSlide,
|
|
8667
8667
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8668
8668
|
};
|
|
8669
8669
|
});
|
|
8670
|
-
const slidesToSave =
|
|
8670
|
+
const slidesToSave = chunkHAQDKQ52_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8671
8671
|
const saveOptions = {
|
|
8672
8672
|
headerFooter,
|
|
8673
8673
|
presentationProperties,
|
|
@@ -8836,7 +8836,7 @@ function usePresentationSetup(input) {
|
|
|
8836
8836
|
containerRef,
|
|
8837
8837
|
content,
|
|
8838
8838
|
onSetMode: (nextMode) => {
|
|
8839
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8839
|
+
if (mode === "present" && nextMode !== "present" && !chunkMZ47MV52_js.mayLeaveSlideShow()) {
|
|
8840
8840
|
return;
|
|
8841
8841
|
}
|
|
8842
8842
|
if (mode === "present" && nextMode !== "present" && annotations.hasAnyAnnotations && promptKeepInkAnnotations) {
|
|
@@ -8844,7 +8844,7 @@ function usePresentationSetup(input) {
|
|
|
8844
8844
|
setShowKeepAnnotationsDialog(true);
|
|
8845
8845
|
} else {
|
|
8846
8846
|
if (mode === "present" && nextMode !== "present") {
|
|
8847
|
-
|
|
8847
|
+
chunkMZ47MV52_js.stopAllPersistentAudio();
|
|
8848
8848
|
stopAnimationSound();
|
|
8849
8849
|
}
|
|
8850
8850
|
setMode(nextMode);
|
|
@@ -8898,10 +8898,10 @@ function usePresentationSetup(input) {
|
|
|
8898
8898
|
onToggleInkMarkup: () => annotations.setInkMarkupVisible(!annotations.inkMarkupVisible),
|
|
8899
8899
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8900
8900
|
onSaveRehearsalTimings: (timings) => {
|
|
8901
|
-
setSlides((prev) =>
|
|
8901
|
+
setSlides((prev) => chunkMZ47MV52_js.applyRehearsalTimings(prev, timings));
|
|
8902
8902
|
history.markDirty();
|
|
8903
8903
|
},
|
|
8904
|
-
loopContinuously:
|
|
8904
|
+
loopContinuously: chunkMZ47MV52_js.shouldLoopContinuously(presentationProperties),
|
|
8905
8905
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8906
8906
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8907
8907
|
endWithBlackSlide
|
|
@@ -9066,7 +9066,7 @@ function useEditorOperations(input) {
|
|
|
9066
9066
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
9067
9067
|
react.useEffect(() => {
|
|
9068
9068
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9069
|
-
copiedFormatRef.current =
|
|
9069
|
+
copiedFormatRef.current = chunkMZ47MV52_js.copyFormatFromElement(selectedElement);
|
|
9070
9070
|
} else if (!formatPainterActive) {
|
|
9071
9071
|
copiedFormatRef.current = null;
|
|
9072
9072
|
}
|
|
@@ -9092,12 +9092,12 @@ function useEditorOperations(input) {
|
|
|
9092
9092
|
e.stopPropagation();
|
|
9093
9093
|
const element = elementLookup.get(elementId);
|
|
9094
9094
|
if (element) {
|
|
9095
|
-
const updated =
|
|
9095
|
+
const updated = chunkMZ47MV52_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
9096
9096
|
const updates = {};
|
|
9097
|
-
if (
|
|
9097
|
+
if (chunkMZ47MV52_js.hasShapeProperties(updated)) {
|
|
9098
9098
|
updates.shapeStyle = updated.shapeStyle;
|
|
9099
9099
|
}
|
|
9100
|
-
if (
|
|
9100
|
+
if (chunkMZ47MV52_js.hasTextProperties(updated)) {
|
|
9101
9101
|
updates.textStyle = updated.textStyle;
|
|
9102
9102
|
}
|
|
9103
9103
|
ops.updateElementById(elementId, updates);
|
|
@@ -9246,7 +9246,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
9246
9246
|
const families = /* @__PURE__ */ new Set();
|
|
9247
9247
|
for (const slide of slides) {
|
|
9248
9248
|
for (const el of slide.elements) {
|
|
9249
|
-
if (
|
|
9249
|
+
if (chunkMZ47MV52_js.hasTextProperties(el) && el.textSegments) {
|
|
9250
9250
|
for (const seg of el.textSegments) {
|
|
9251
9251
|
if (seg.style.fontFamily) {
|
|
9252
9252
|
families.add(seg.style.fontFamily);
|
|
@@ -9458,13 +9458,13 @@ function useKeyboardShortcuts(input) {
|
|
|
9458
9458
|
inputRef.current = input;
|
|
9459
9459
|
const handleKeyDown = react.useCallback((e) => {
|
|
9460
9460
|
const current = inputRef.current;
|
|
9461
|
-
const { action, dx, dy } =
|
|
9461
|
+
const { action, dx, dy } = chunkMZ47MV52_js.mapEditorKey(e, {
|
|
9462
9462
|
canEdit: current.canEdit,
|
|
9463
9463
|
isPresenting: current.mode !== "edit",
|
|
9464
9464
|
hasSelection: current.hasSelection,
|
|
9465
9465
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9466
9466
|
isDrawing: current.activeTool !== "select",
|
|
9467
|
-
isTextInputTarget:
|
|
9467
|
+
isTextInputTarget: chunkMZ47MV52_js.isEditorTextInputTarget(e.target)
|
|
9468
9468
|
});
|
|
9469
9469
|
if (action === null) {
|
|
9470
9470
|
return;
|
|
@@ -9758,7 +9758,7 @@ function useViewerIntegration(input) {
|
|
|
9758
9758
|
return zoom.scale;
|
|
9759
9759
|
},
|
|
9760
9760
|
setZoom(level) {
|
|
9761
|
-
zoom.setScale(
|
|
9761
|
+
zoom.setScale(chunkMZ47MV52_js.clampZoomScale(level));
|
|
9762
9762
|
},
|
|
9763
9763
|
zoomIn() {
|
|
9764
9764
|
zoom.handleZoomIn();
|
|
@@ -9973,7 +9973,7 @@ function useReducedMotion() {
|
|
|
9973
9973
|
}
|
|
9974
9974
|
function useViewerOptions() {
|
|
9975
9975
|
const storeRef = react.useRef(null);
|
|
9976
|
-
storeRef.current ??=
|
|
9976
|
+
storeRef.current ??= chunkMZ47MV52_js.createViewerOptionsStore();
|
|
9977
9977
|
const store = storeRef.current;
|
|
9978
9978
|
const options = react.useSyncExternalStore(
|
|
9979
9979
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -9982,9 +9982,9 @@ function useViewerOptions() {
|
|
|
9982
9982
|
);
|
|
9983
9983
|
return { optionsStore: store, options };
|
|
9984
9984
|
}
|
|
9985
|
-
var KNOWN_TAB_IDS = new Set(
|
|
9985
|
+
var KNOWN_TAB_IDS = new Set(chunkMZ47MV52_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
9986
9986
|
function computeToolbarVisibility(hiddenActions) {
|
|
9987
|
-
const isHidden = (id) =>
|
|
9987
|
+
const isHidden = (id) => chunkMZ47MV52_js.isActionHidden(id, hiddenActions);
|
|
9988
9988
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
9989
9989
|
return { isHidden, isTabVisible };
|
|
9990
9990
|
}
|
|
@@ -10069,12 +10069,12 @@ function useYjsDocumentSync({
|
|
|
10069
10069
|
return;
|
|
10070
10070
|
}
|
|
10071
10071
|
try {
|
|
10072
|
-
const handler = new
|
|
10072
|
+
const handler = new chunkMZ47MV52_js.PptxHandler();
|
|
10073
10073
|
await handler.load(sourceBytes.buffer);
|
|
10074
|
-
const currentSlides =
|
|
10074
|
+
const currentSlides = chunkMZ47MV52_js.readSlidesFromYDoc(
|
|
10075
10075
|
doc
|
|
10076
10076
|
);
|
|
10077
|
-
const slidesToSave =
|
|
10077
|
+
const slidesToSave = chunkHAQDKQ52_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10078
10078
|
const bytes = await handler.save(slidesToSave);
|
|
10079
10079
|
config.onWriteBack(bytes);
|
|
10080
10080
|
} catch {
|
|
@@ -10089,7 +10089,7 @@ function useYjsDocumentSync({
|
|
|
10089
10089
|
if (!doc || !isConnected) {
|
|
10090
10090
|
return;
|
|
10091
10091
|
}
|
|
10092
|
-
const docSlides =
|
|
10092
|
+
const docSlides = chunkMZ47MV52_js.readSlidesFromYDoc(
|
|
10093
10093
|
doc
|
|
10094
10094
|
);
|
|
10095
10095
|
if (docSlides.length === 0) {
|
|
@@ -10111,11 +10111,11 @@ function useYjsDocumentSync({
|
|
|
10111
10111
|
lastSyncedRef.current = serialized;
|
|
10112
10112
|
void (async () => {
|
|
10113
10113
|
const factories = await getFactories();
|
|
10114
|
-
|
|
10114
|
+
chunkMZ47MV52_js.reconcileSlidesInYDoc(
|
|
10115
10115
|
slides,
|
|
10116
10116
|
doc,
|
|
10117
10117
|
factories,
|
|
10118
|
-
|
|
10118
|
+
chunkMZ47MV52_js.LOCAL_SYNC_ORIGIN
|
|
10119
10119
|
);
|
|
10120
10120
|
scheduleWriteBack();
|
|
10121
10121
|
})();
|
|
@@ -10129,10 +10129,10 @@ function useYjsDocumentSync({
|
|
|
10129
10129
|
return;
|
|
10130
10130
|
}
|
|
10131
10131
|
const handleChange = (_events, transaction) => {
|
|
10132
|
-
if (transaction?.origin ===
|
|
10132
|
+
if (transaction?.origin === chunkMZ47MV52_js.LOCAL_SYNC_ORIGIN) {
|
|
10133
10133
|
return;
|
|
10134
10134
|
}
|
|
10135
|
-
const remoteSlides =
|
|
10135
|
+
const remoteSlides = chunkMZ47MV52_js.readSlidesFromYDoc(
|
|
10136
10136
|
doc
|
|
10137
10137
|
);
|
|
10138
10138
|
if (remoteSlides.length === 0) {
|
|
@@ -10148,7 +10148,7 @@ function useYjsDocumentSync({
|
|
|
10148
10148
|
isApplyingRemoteRef.current = false;
|
|
10149
10149
|
scheduleWriteBack();
|
|
10150
10150
|
};
|
|
10151
|
-
const unobserve =
|
|
10151
|
+
const unobserve = chunkMZ47MV52_js.observeYDocSlides(
|
|
10152
10152
|
doc,
|
|
10153
10153
|
handleChange
|
|
10154
10154
|
);
|
|
@@ -10186,7 +10186,7 @@ function useBroadcastFollower({
|
|
|
10186
10186
|
if (!broadcaster) {
|
|
10187
10187
|
return;
|
|
10188
10188
|
}
|
|
10189
|
-
if (!
|
|
10189
|
+
if (!chunkMZ47MV52_js.shouldAutoFollowBroadcaster({
|
|
10190
10190
|
localRole: collab.config.role,
|
|
10191
10191
|
broadcasterRole: broadcaster.role
|
|
10192
10192
|
})) {
|
|
@@ -10346,10 +10346,10 @@ function useTouchGestures(input) {
|
|
|
10346
10346
|
if (!el || !enabled) {
|
|
10347
10347
|
return;
|
|
10348
10348
|
}
|
|
10349
|
-
const recognizer =
|
|
10349
|
+
const recognizer = chunkMZ47MV52_js.createTouchGestureRecognizer({
|
|
10350
10350
|
getScale: () => scaleRef.current,
|
|
10351
|
-
minScale:
|
|
10352
|
-
maxScale:
|
|
10351
|
+
minScale: chunkMZ47MV52_js.MIN_ZOOM_SCALE,
|
|
10352
|
+
maxScale: chunkMZ47MV52_js.MAX_ZOOM_SCALE,
|
|
10353
10353
|
callbacks: {
|
|
10354
10354
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10355
10355
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10389,7 +10389,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10389
10389
|
return;
|
|
10390
10390
|
}
|
|
10391
10391
|
const rect = active.getBoundingClientRect();
|
|
10392
|
-
const delta =
|
|
10392
|
+
const delta = chunkMZ47MV52_js.computeScrollDelta(
|
|
10393
10393
|
{ top: rect.top, bottom: rect.bottom },
|
|
10394
10394
|
window.innerHeight,
|
|
10395
10395
|
keyboardInset
|
|
@@ -10409,8 +10409,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10409
10409
|
return;
|
|
10410
10410
|
}
|
|
10411
10411
|
const update = () => {
|
|
10412
|
-
const metrics =
|
|
10413
|
-
const inset = metrics ?
|
|
10412
|
+
const metrics = chunkMZ47MV52_js.readViewportMetrics(window);
|
|
10413
|
+
const inset = metrics ? chunkMZ47MV52_js.computeKeyboardInset(metrics) : 0;
|
|
10414
10414
|
setKeyboardInset(inset);
|
|
10415
10415
|
if (inset > 0) {
|
|
10416
10416
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10421,8 +10421,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10421
10421
|
vv.addEventListener("scroll", update);
|
|
10422
10422
|
const onFocusIn = () => {
|
|
10423
10423
|
window.requestAnimationFrame(() => {
|
|
10424
|
-
const metrics =
|
|
10425
|
-
const inset = metrics ?
|
|
10424
|
+
const metrics = chunkMZ47MV52_js.readViewportMetrics(window);
|
|
10425
|
+
const inset = metrics ? chunkMZ47MV52_js.computeKeyboardInset(metrics) : 0;
|
|
10426
10426
|
if (inset > 0) {
|
|
10427
10427
|
scrollFocusedIntoView(inset);
|
|
10428
10428
|
}
|
|
@@ -10435,7 +10435,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10435
10435
|
document.removeEventListener("focusin", onFocusIn);
|
|
10436
10436
|
};
|
|
10437
10437
|
}, [enabled]);
|
|
10438
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10438
|
+
return { keyboardInset, isKeyboardOpen: chunkMZ47MV52_js.isKeyboardOpen(keyboardInset) };
|
|
10439
10439
|
}
|
|
10440
10440
|
|
|
10441
10441
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10462,7 +10462,7 @@ function buildCanvasProps(input) {
|
|
|
10462
10462
|
} = input;
|
|
10463
10463
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10464
10464
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10465
|
-
const fieldContext =
|
|
10465
|
+
const fieldContext = chunkMZ47MV52_js.buildFieldSubstitutionContext({
|
|
10466
10466
|
headerFooter: s.headerFooter,
|
|
10467
10467
|
customProperties: s.customProperties,
|
|
10468
10468
|
slide: activeSlide
|
|
@@ -10472,13 +10472,13 @@ function buildCanvasProps(input) {
|
|
|
10472
10472
|
if (mode === "present") {
|
|
10473
10473
|
presentation.handlePresentationAction(action);
|
|
10474
10474
|
} else if (action.url) {
|
|
10475
|
-
|
|
10475
|
+
chunkMZ47MV52_js.safeOpenUrl(action.url);
|
|
10476
10476
|
}
|
|
10477
10477
|
};
|
|
10478
10478
|
const handleHyperlinkClick = (url) => {
|
|
10479
|
-
if (
|
|
10479
|
+
if (chunkMZ47MV52_js.isPpactionUrl(url)) {
|
|
10480
10480
|
if (mode === "present") {
|
|
10481
|
-
const parsed =
|
|
10481
|
+
const parsed = chunkMZ47MV52_js.parsePpactionUrl(url);
|
|
10482
10482
|
if (parsed) {
|
|
10483
10483
|
presentation.handlePresentationAction({
|
|
10484
10484
|
action: parsed.action,
|
|
@@ -10488,7 +10488,7 @@ function buildCanvasProps(input) {
|
|
|
10488
10488
|
}
|
|
10489
10489
|
return;
|
|
10490
10490
|
}
|
|
10491
|
-
|
|
10491
|
+
chunkMZ47MV52_js.safeOpenUrl(url);
|
|
10492
10492
|
};
|
|
10493
10493
|
return {
|
|
10494
10494
|
activeSlide: effectiveSlide,
|
|
@@ -10631,7 +10631,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10631
10631
|
const current = activeSlide.animations ?? [];
|
|
10632
10632
|
if (group === "motionPath") {
|
|
10633
10633
|
propertyHandlers.handleUpdateSlide({
|
|
10634
|
-
animations:
|
|
10634
|
+
animations: chunkMZ47MV52_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10635
10635
|
});
|
|
10636
10636
|
return;
|
|
10637
10637
|
}
|
|
@@ -10826,7 +10826,7 @@ function buildToolbarProps(input) {
|
|
|
10826
10826
|
onOpenFile,
|
|
10827
10827
|
onOpenRecentFile,
|
|
10828
10828
|
onCreatePresentation: (templateId) => {
|
|
10829
|
-
s.setSlides(
|
|
10829
|
+
s.setSlides(chunkMZ47MV52_js.createBackstagePresentation(templateId));
|
|
10830
10830
|
s.setActiveSlideIndex(0);
|
|
10831
10831
|
s.setSelectedElementId(null);
|
|
10832
10832
|
s.setSelectedElementIds([]);
|
|
@@ -10853,7 +10853,7 @@ function buildToolbarProps(input) {
|
|
|
10853
10853
|
layoutOptions: scopedLayoutOptions,
|
|
10854
10854
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
10855
10855
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
10856
|
-
templateScheme:
|
|
10856
|
+
templateScheme: chunkMZ47MV52_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
10857
10857
|
customShows: s.customShows,
|
|
10858
10858
|
activeCustomShowId: s.activeCustomShowId,
|
|
10859
10859
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -10885,7 +10885,7 @@ function buildToolbarProps(input) {
|
|
|
10885
10885
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
10886
10886
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
10887
10887
|
formatPainterActive: s.formatPainterActive,
|
|
10888
|
-
canActivateFormatPainter:
|
|
10888
|
+
canActivateFormatPainter: chunkMZ47MV52_js.hasCopyableFormat(selectedElement),
|
|
10889
10889
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
10890
10890
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
10891
10891
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -11154,7 +11154,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11154
11154
|
}, [incomingContent]);
|
|
11155
11155
|
const onOpenFile = react.useCallback(() => {
|
|
11156
11156
|
void (async () => {
|
|
11157
|
-
const picked = await
|
|
11157
|
+
const picked = await chunkMZ47MV52_js.openPptxFile();
|
|
11158
11158
|
if (picked) {
|
|
11159
11159
|
setContent(picked.buffer);
|
|
11160
11160
|
}
|
|
@@ -11162,7 +11162,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11162
11162
|
}, []);
|
|
11163
11163
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11164
11164
|
void (async () => {
|
|
11165
|
-
const bytes = await
|
|
11165
|
+
const bytes = await chunkMZ47MV52_js.readBackstageRecentFile(key);
|
|
11166
11166
|
if (bytes) {
|
|
11167
11167
|
setContent(bytes);
|
|
11168
11168
|
}
|