pptx-react-viewer 2.20.2 → 2.20.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-ZSVNVRM5.js → AiChatPanel-C3PLXWFZ.js} +23 -23
- package/dist/AiChatPanel-C3PLXWFZ.js.br +0 -0
- package/dist/AiChatPanel-C3PLXWFZ.js.gz +0 -0
- package/dist/{AiChatPanel-NRWACXJ7.mjs → AiChatPanel-Y4BQX3TL.mjs} +3 -3
- package/dist/AiChatPanel-Y4BQX3TL.mjs.br +0 -0
- package/dist/AiChatPanel-Y4BQX3TL.mjs.gz +0 -0
- package/dist/{Model3DScene-IFYFOD6F.mjs → Model3DScene-QJL5F67G.mjs} +1 -1
- package/dist/Model3DScene-QJL5F67G.mjs.br +0 -0
- package/dist/Model3DScene-QJL5F67G.mjs.gz +0 -0
- package/dist/{Model3DScene-3HGARMTA.js → Model3DScene-Z4JPG2NB.js} +2 -2
- package/dist/Model3DScene-Z4JPG2NB.js.br +0 -0
- package/dist/Model3DScene-Z4JPG2NB.js.gz +0 -0
- package/dist/{chunk-LLZ25OVR.js → chunk-7HF5DSE4.js} +154 -148
- package/dist/chunk-7HF5DSE4.js.br +0 -0
- package/dist/chunk-7HF5DSE4.js.gz +0 -0
- package/dist/{chunk-RJ26DQIM.mjs → chunk-ADWJUL4F.mjs} +1 -1
- package/dist/chunk-ADWJUL4F.mjs.br +0 -0
- package/dist/{chunk-RJ26DQIM.mjs.gz → chunk-ADWJUL4F.mjs.gz} +0 -0
- package/dist/{chunk-GUKUV7D4.js → chunk-BDMESP3M.js} +1132 -1118
- package/dist/chunk-BDMESP3M.js.br +0 -0
- package/dist/chunk-BDMESP3M.js.gz +0 -0
- package/dist/{chunk-GKOJO67G.js → chunk-BKBYURH5.js} +393 -383
- package/dist/chunk-BKBYURH5.js.br +0 -0
- package/dist/chunk-BKBYURH5.js.gz +0 -0
- package/dist/{chunk-2MENHAYJ.mjs → chunk-HXFPEJA4.mjs} +434 -385
- package/dist/chunk-HXFPEJA4.mjs.br +0 -0
- package/dist/chunk-HXFPEJA4.mjs.gz +0 -0
- package/dist/{chunk-O5BR276S.mjs → chunk-JL3GWABW.mjs} +8 -2
- package/dist/chunk-JL3GWABW.mjs.br +0 -0
- package/dist/chunk-JL3GWABW.mjs.gz +0 -0
- package/dist/{chunk-QJJX2E6I.js → chunk-KEGEDUJV.js} +3 -3
- package/dist/chunk-KEGEDUJV.js.br +0 -0
- package/dist/chunk-KEGEDUJV.js.gz +0 -0
- package/dist/{chunk-SZJLZWEX.mjs → chunk-KXHYUJI7.mjs} +12 -2
- package/dist/chunk-KXHYUJI7.mjs.br +0 -0
- package/dist/chunk-KXHYUJI7.mjs.gz +0 -0
- package/dist/{chunk-4Z4HEIP5.js → chunk-LBSMBRSD.js} +434 -385
- package/dist/chunk-LBSMBRSD.js.br +0 -0
- package/dist/chunk-LBSMBRSD.js.gz +0 -0
- package/dist/{chunk-EDJ4TZML.mjs → chunk-YHEASDGN.mjs} +98 -84
- package/dist/chunk-YHEASDGN.mjs.br +0 -0
- package/dist/chunk-YHEASDGN.mjs.gz +0 -0
- package/dist/index.js +45 -45
- 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-NRWACXJ7.mjs.br +0 -0
- package/dist/AiChatPanel-NRWACXJ7.mjs.gz +0 -0
- package/dist/AiChatPanel-ZSVNVRM5.js.br +0 -0
- package/dist/AiChatPanel-ZSVNVRM5.js.gz +0 -0
- package/dist/Model3DScene-3HGARMTA.js.br +0 -0
- package/dist/Model3DScene-3HGARMTA.js.gz +0 -0
- package/dist/Model3DScene-IFYFOD6F.mjs.br +0 -0
- package/dist/Model3DScene-IFYFOD6F.mjs.gz +0 -0
- package/dist/chunk-2MENHAYJ.mjs.br +0 -0
- package/dist/chunk-2MENHAYJ.mjs.gz +0 -0
- package/dist/chunk-4Z4HEIP5.js.br +0 -0
- package/dist/chunk-4Z4HEIP5.js.gz +0 -0
- package/dist/chunk-EDJ4TZML.mjs.br +0 -0
- package/dist/chunk-EDJ4TZML.mjs.gz +0 -0
- package/dist/chunk-GKOJO67G.js.br +0 -0
- package/dist/chunk-GKOJO67G.js.gz +0 -0
- package/dist/chunk-GUKUV7D4.js.br +0 -0
- package/dist/chunk-GUKUV7D4.js.gz +0 -0
- package/dist/chunk-LLZ25OVR.js.br +0 -0
- package/dist/chunk-LLZ25OVR.js.gz +0 -0
- package/dist/chunk-O5BR276S.mjs.br +0 -0
- package/dist/chunk-O5BR276S.mjs.gz +0 -0
- package/dist/chunk-QJJX2E6I.js.br +0 -0
- package/dist/chunk-QJJX2E6I.js.gz +0 -0
- package/dist/chunk-RJ26DQIM.mjs.br +0 -0
- package/dist/chunk-SZJLZWEX.mjs.br +0 -0
- package/dist/chunk-SZJLZWEX.mjs.gz +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk7HF5DSE4_js = require('./chunk-7HF5DSE4.js');
|
|
4
4
|
var chunk6CPUGAK7_js = require('./chunk-6CPUGAK7.js');
|
|
5
|
-
var
|
|
5
|
+
var chunkLBSMBRSD_js = require('./chunk-LBSMBRSD.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 = chunkLBSMBRSD_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 = chunkLBSMBRSD_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 ??= chunkLBSMBRSD_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 >= chunkLBSMBRSD_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
|
+
}, chunkLBSMBRSD_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 = chunkLBSMBRSD_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
|
+
chunkLBSMBRSD_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 = chunkLBSMBRSD_js.validateRoomId(config.roomId);
|
|
249
249
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
250
|
-
departureRef.current =
|
|
250
|
+
departureRef.current = chunkLBSMBRSD_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 = chunkLBSMBRSD_js.validateRoomId(config.roomId);
|
|
293
|
+
const transport = config.transport ?? chunkLBSMBRSD_js.resolveTransportForServerUrl(config.serverUrl);
|
|
294
294
|
if (transport === "webrtc") {
|
|
295
295
|
await initWebrtc();
|
|
296
296
|
return;
|
|
297
297
|
}
|
|
298
|
-
if (
|
|
298
|
+
if (chunkLBSMBRSD_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 = chunkLBSMBRSD_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
|
+
chunkLBSMBRSD_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
|
+
}, chunkLBSMBRSD_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
|
+
chunkLBSMBRSD_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 = chunkLBSMBRSD_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 = chunkLBSMBRSD_js.sanitizeColor(config?.userColor, "#6366f1");
|
|
418
418
|
const { status, awareness, doc, clientId, synced, retry } = useYjsProvider({ config });
|
|
419
419
|
const { remoteUsers, broadcastPresence } = usePresenceTracking({
|
|
420
420
|
awareness,
|
|
@@ -532,8 +532,8 @@ function useEditorHistory(input) {
|
|
|
532
532
|
width: canvasSize.width,
|
|
533
533
|
height: canvasSize.height,
|
|
534
534
|
activeSlideIndex,
|
|
535
|
-
slides: slides.map(
|
|
536
|
-
templateElementsBySlideId:
|
|
535
|
+
slides: slides.map(chunkLBSMBRSD_js.cloneSlide),
|
|
536
|
+
templateElementsBySlideId: chunkLBSMBRSD_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
537
537
|
...actionLabel ? { actionLabel } : {}
|
|
538
538
|
};
|
|
539
539
|
},
|
|
@@ -546,9 +546,9 @@ function useEditorHistory(input) {
|
|
|
546
546
|
width: snapshot.width,
|
|
547
547
|
height: snapshot.height
|
|
548
548
|
});
|
|
549
|
-
setSlides(snapshot.slides.map(
|
|
549
|
+
setSlides(snapshot.slides.map(chunkLBSMBRSD_js.cloneSlide));
|
|
550
550
|
setTemplateElementsBySlideId(
|
|
551
|
-
|
|
551
|
+
chunkLBSMBRSD_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
552
552
|
);
|
|
553
553
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
554
554
|
setSelectedElementIds([]);
|
|
@@ -587,8 +587,8 @@ function useEditorHistory(input) {
|
|
|
587
587
|
const currentSnapshot = buildHistorySnapshot();
|
|
588
588
|
historyFutureRef.current.push(currentSnapshot);
|
|
589
589
|
isApplyingHistoryRef.current = true;
|
|
590
|
-
const nextSnapshot =
|
|
591
|
-
lastHistorySnapshotRef.current =
|
|
590
|
+
const nextSnapshot = chunk7HF5DSE4_js.cloneHistorySnapshot(previousSnapshot);
|
|
591
|
+
lastHistorySnapshotRef.current = chunk7HF5DSE4_js.cloneHistorySnapshot(nextSnapshot);
|
|
592
592
|
lastHistorySerializedRef.current = serializeDocument(nextSnapshot);
|
|
593
593
|
applyHistorySnapshot(nextSnapshot);
|
|
594
594
|
updateHistoryAvailability();
|
|
@@ -609,8 +609,8 @@ function useEditorHistory(input) {
|
|
|
609
609
|
const currentSnapshot = buildHistorySnapshot();
|
|
610
610
|
historyPastRef.current.push(currentSnapshot);
|
|
611
611
|
isApplyingHistoryRef.current = true;
|
|
612
|
-
const targetSnapshot =
|
|
613
|
-
lastHistorySnapshotRef.current =
|
|
612
|
+
const targetSnapshot = chunk7HF5DSE4_js.cloneHistorySnapshot(nextSnapshot);
|
|
613
|
+
lastHistorySnapshotRef.current = chunk7HF5DSE4_js.cloneHistorySnapshot(targetSnapshot);
|
|
614
614
|
lastHistorySerializedRef.current = serializeDocument(targetSnapshot);
|
|
615
615
|
applyHistorySnapshot(targetSnapshot);
|
|
616
616
|
updateHistoryAvailability();
|
|
@@ -628,7 +628,7 @@ function useEditorHistory(input) {
|
|
|
628
628
|
historyPastRef.current = [];
|
|
629
629
|
historyFutureRef.current = [];
|
|
630
630
|
if (initialSnapshot) {
|
|
631
|
-
const clonedInitial =
|
|
631
|
+
const clonedInitial = chunk7HF5DSE4_js.cloneHistorySnapshot(initialSnapshot);
|
|
632
632
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
633
633
|
lastHistorySerializedRef.current = serializeDocument(clonedInitial);
|
|
634
634
|
} else {
|
|
@@ -676,19 +676,19 @@ function useEditorHistory(input) {
|
|
|
676
676
|
}
|
|
677
677
|
const previousSnapshot = lastHistorySnapshotRef.current;
|
|
678
678
|
if (!previousSnapshot) {
|
|
679
|
-
lastHistorySnapshotRef.current =
|
|
679
|
+
lastHistorySnapshotRef.current = chunk7HF5DSE4_js.cloneHistorySnapshot(snapshot);
|
|
680
680
|
lastHistorySerializedRef.current = serialized;
|
|
681
681
|
lastCheapHashRef.current = cheapHash;
|
|
682
682
|
updateHistoryAvailability();
|
|
683
683
|
return;
|
|
684
684
|
}
|
|
685
685
|
onDirtyRef.current?.();
|
|
686
|
-
historyPastRef.current.push(
|
|
686
|
+
historyPastRef.current.push(chunk7HF5DSE4_js.cloneHistorySnapshot(previousSnapshot));
|
|
687
687
|
while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
|
|
688
688
|
historyPastRef.current.shift();
|
|
689
689
|
}
|
|
690
690
|
historyFutureRef.current = [];
|
|
691
|
-
lastHistorySnapshotRef.current =
|
|
691
|
+
lastHistorySnapshotRef.current = chunk7HF5DSE4_js.cloneHistorySnapshot(snapshot);
|
|
692
692
|
lastHistorySerializedRef.current = serialized;
|
|
693
693
|
lastCheapHashRef.current = cheapHash;
|
|
694
694
|
updateHistoryAvailability();
|
|
@@ -748,9 +748,9 @@ function useZoomViewport({
|
|
|
748
748
|
const canvasStageRef = react.useRef(null);
|
|
749
749
|
const canvasViewportRef = react.useRef(null);
|
|
750
750
|
const renderScaleRef = react.useRef(1);
|
|
751
|
-
const wheelBufferRef = react.useRef(
|
|
751
|
+
const wheelBufferRef = react.useRef(chunkLBSMBRSD_js.createWheelStepBuffer());
|
|
752
752
|
const storeRef = react.useRef(null);
|
|
753
|
-
storeRef.current ??=
|
|
753
|
+
storeRef.current ??= chunkLBSMBRSD_js.createViewerZoomStore();
|
|
754
754
|
const store = storeRef.current;
|
|
755
755
|
const scale = useViewerStore(store, selectZoom);
|
|
756
756
|
const setScale = react.useCallback(
|
|
@@ -811,7 +811,7 @@ function useZoomViewport({
|
|
|
811
811
|
if (!wrapper || !canvasViewport) {
|
|
812
812
|
return;
|
|
813
813
|
}
|
|
814
|
-
const boundedScale =
|
|
814
|
+
const boundedScale = chunkLBSMBRSD_js.clampZoomScale(nextScale);
|
|
815
815
|
const nextEditorScale = fitScale * boundedScale;
|
|
816
816
|
const centerX = (bounds.minX + bounds.maxX) / 2;
|
|
817
817
|
const centerY = (bounds.minY + bounds.maxY) / 2;
|
|
@@ -848,29 +848,29 @@ function useZoomViewport({
|
|
|
848
848
|
selectedElements.forEach((element) => {
|
|
849
849
|
minX = Math.min(minX, element.x);
|
|
850
850
|
minY = Math.min(minY, element.y);
|
|
851
|
-
maxX = Math.max(maxX, element.x + Math.max(element.width,
|
|
852
|
-
maxY = Math.max(maxY, element.y + Math.max(element.height,
|
|
851
|
+
maxX = Math.max(maxX, element.x + Math.max(element.width, chunk7HF5DSE4_js.MIN_ELEMENT_SIZE));
|
|
852
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunk7HF5DSE4_js.MIN_ELEMENT_SIZE));
|
|
853
853
|
});
|
|
854
854
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
855
855
|
return;
|
|
856
856
|
}
|
|
857
857
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
858
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
859
|
-
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY,
|
|
858
|
+
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunk7HF5DSE4_js.MIN_ELEMENT_SIZE);
|
|
859
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunk7HF5DSE4_js.MIN_ELEMENT_SIZE);
|
|
860
860
|
const availableWidth = Math.max(
|
|
861
|
-
effectiveEditorDimensions.width -
|
|
862
|
-
|
|
861
|
+
effectiveEditorDimensions.width - chunk7HF5DSE4_js.ZOOM_TO_SELECTION_PADDING,
|
|
862
|
+
chunk7HF5DSE4_js.MIN_ELEMENT_SIZE
|
|
863
863
|
);
|
|
864
864
|
const availableHeight = Math.max(
|
|
865
|
-
effectiveEditorDimensions.height -
|
|
866
|
-
|
|
865
|
+
effectiveEditorDimensions.height - chunk7HF5DSE4_js.ZOOM_TO_SELECTION_PADDING,
|
|
866
|
+
chunk7HF5DSE4_js.MIN_ELEMENT_SIZE
|
|
867
867
|
);
|
|
868
868
|
const targetEditorScale = Math.min(
|
|
869
869
|
availableWidth / boundsWidth,
|
|
870
870
|
availableHeight / boundsHeight
|
|
871
871
|
);
|
|
872
872
|
const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
|
|
873
|
-
const nextScale =
|
|
873
|
+
const nextScale = chunkLBSMBRSD_js.clampZoomScale(targetEditorScale / safeFitScale);
|
|
874
874
|
setScale(nextScale);
|
|
875
875
|
window.requestAnimationFrame(() => {
|
|
876
876
|
window.requestAnimationFrame(() => {
|
|
@@ -887,14 +887,14 @@ function useZoomViewport({
|
|
|
887
887
|
]);
|
|
888
888
|
const handleWheel = react.useCallback(
|
|
889
889
|
(event) => {
|
|
890
|
-
const mapped =
|
|
890
|
+
const mapped = chunkLBSMBRSD_js.mapEditingWheel(event, wheelBufferRef.current, true);
|
|
891
891
|
if (mapped.intent !== "zoom") {
|
|
892
892
|
return;
|
|
893
893
|
}
|
|
894
894
|
event.preventDefault();
|
|
895
895
|
store.dispatch({
|
|
896
896
|
type: "set-zoom",
|
|
897
|
-
zoom:
|
|
897
|
+
zoom: chunkLBSMBRSD_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
|
|
898
898
|
});
|
|
899
899
|
},
|
|
900
900
|
[store]
|
|
@@ -982,7 +982,7 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
|
|
|
982
982
|
const command = step.command;
|
|
983
983
|
const timer = window.setTimeout(
|
|
984
984
|
() => {
|
|
985
|
-
|
|
985
|
+
chunk7HF5DSE4_js.executeMediaCommand(command);
|
|
986
986
|
},
|
|
987
987
|
Math.max(0, step.delayMs)
|
|
988
988
|
);
|
|
@@ -1119,7 +1119,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
|
|
|
1119
1119
|
}))
|
|
1120
1120
|
);
|
|
1121
1121
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1122
|
-
const delay =
|
|
1122
|
+
const delay = chunkLBSMBRSD_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1123
1123
|
const timer = window.setTimeout(() => {
|
|
1124
1124
|
setPresentationAnimations(
|
|
1125
1125
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1151,7 +1151,7 @@ function useAnimationPlayback(input) {
|
|
|
1151
1151
|
(controller, group) => {
|
|
1152
1152
|
driveBuildReveal(
|
|
1153
1153
|
controller,
|
|
1154
|
-
|
|
1154
|
+
chunkLBSMBRSD_js.PresentationAnimationController.collectBuildStepIds(group),
|
|
1155
1155
|
setPresentationElementStates,
|
|
1156
1156
|
buildRafRef
|
|
1157
1157
|
);
|
|
@@ -1200,6 +1200,12 @@ function useAnimationPlayback(input) {
|
|
|
1200
1200
|
);
|
|
1201
1201
|
presentationTimersRef.current.push(timer);
|
|
1202
1202
|
},
|
|
1203
|
+
// `scheduleAutoAdvanceChain` recursively calls itself (line 190) to walk the
|
|
1204
|
+
// auto-advance chain; it can't list itself as its own dependency (the const
|
|
1205
|
+
// isn't assigned yet when the array is evaluated). The recursive call still
|
|
1206
|
+
// resolves correctly because the setTimeout callback only reads the binding
|
|
1207
|
+
// once the outer const has been assigned.
|
|
1208
|
+
// oxlint-disable-next-line react/memo-dependencies -- see comment above
|
|
1203
1209
|
[onPlayActionSound, startBuildReveal]
|
|
1204
1210
|
);
|
|
1205
1211
|
const resetSlideTimeline = react.useCallback(
|
|
@@ -1214,7 +1220,7 @@ function useAnimationPlayback(input) {
|
|
|
1214
1220
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1215
1221
|
return;
|
|
1216
1222
|
}
|
|
1217
|
-
const controller =
|
|
1223
|
+
const controller = chunkLBSMBRSD_js.PresentationAnimationController.fromSlide(slide);
|
|
1218
1224
|
controllerRef.current = controller;
|
|
1219
1225
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1220
1226
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
@@ -1372,12 +1378,12 @@ function useAnimationPlayback(input) {
|
|
|
1372
1378
|
presentationTimersRef
|
|
1373
1379
|
};
|
|
1374
1380
|
}
|
|
1375
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1376
|
-
var AUDIENCE_HASH =
|
|
1377
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1378
|
-
var AUDIENCE_NONCE_KEY =
|
|
1381
|
+
var PRESENTER_CHANNEL_NAME = chunkLBSMBRSD_js.PRESENTATION_CHANNEL_NAME;
|
|
1382
|
+
var AUDIENCE_HASH = chunkLBSMBRSD_js.PRESENTATION_HASH;
|
|
1383
|
+
var PRESENTER_MSG_ORIGIN = chunkLBSMBRSD_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1384
|
+
var AUDIENCE_NONCE_KEY = chunkLBSMBRSD_js.PRESENTATION_NONCE_KEY;
|
|
1379
1385
|
function generateSessionId() {
|
|
1380
|
-
return
|
|
1386
|
+
return chunkLBSMBRSD_js.createPresentationSessionId();
|
|
1381
1387
|
}
|
|
1382
1388
|
function parseAudienceNonce() {
|
|
1383
1389
|
const hash = window.location.hash;
|
|
@@ -1413,7 +1419,7 @@ function usePresenterWindow(input) {
|
|
|
1413
1419
|
}, []);
|
|
1414
1420
|
const swapDisplays = react.useCallback(async () => {
|
|
1415
1421
|
const audience = audienceWindowRef.current;
|
|
1416
|
-
return audience && !audience.closed ?
|
|
1422
|
+
return audience && !audience.closed ? chunkLBSMBRSD_js.swapPresentationWindows(window, audience) : false;
|
|
1417
1423
|
}, []);
|
|
1418
1424
|
const syncSlideToAudience = react.useCallback(
|
|
1419
1425
|
(slideIndex) => {
|
|
@@ -1477,7 +1483,7 @@ function usePresenterWindow(input) {
|
|
|
1477
1483
|
pollTimerRef.current = null;
|
|
1478
1484
|
}
|
|
1479
1485
|
if (closingSessionId) {
|
|
1480
|
-
void
|
|
1486
|
+
void chunkLBSMBRSD_js.clearAudienceContent(closingSessionId);
|
|
1481
1487
|
}
|
|
1482
1488
|
}, [getChannel]);
|
|
1483
1489
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1495,10 +1501,10 @@ function usePresenterWindow(input) {
|
|
|
1495
1501
|
audienceWindowRef.current = blankWin;
|
|
1496
1502
|
const sessionId = generateSessionId();
|
|
1497
1503
|
sessionIdRef.current = sessionId;
|
|
1498
|
-
const audienceUrl =
|
|
1499
|
-
void
|
|
1504
|
+
const audienceUrl = chunkLBSMBRSD_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1505
|
+
void chunkLBSMBRSD_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1500
1506
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1501
|
-
|
|
1507
|
+
chunkLBSMBRSD_js.placeAudienceWindow(blankWin, placement);
|
|
1502
1508
|
}
|
|
1503
1509
|
return void 0;
|
|
1504
1510
|
});
|
|
@@ -1528,7 +1534,7 @@ function usePresenterWindow(input) {
|
|
|
1528
1534
|
}
|
|
1529
1535
|
};
|
|
1530
1536
|
if (content) {
|
|
1531
|
-
void
|
|
1537
|
+
void chunkLBSMBRSD_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1532
1538
|
} else {
|
|
1533
1539
|
navigateOrClose(true);
|
|
1534
1540
|
}
|
|
@@ -1554,7 +1560,7 @@ function usePresenterWindow(input) {
|
|
|
1554
1560
|
}
|
|
1555
1561
|
const handleMessage = (event) => {
|
|
1556
1562
|
const message = event.data;
|
|
1557
|
-
if (
|
|
1563
|
+
if (chunkLBSMBRSD_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1558
1564
|
syncStateToAudience(snapshotRef.current);
|
|
1559
1565
|
}
|
|
1560
1566
|
};
|
|
@@ -1583,7 +1589,7 @@ function usePresenterWindow(input) {
|
|
|
1583
1589
|
react.useEffect(() => {
|
|
1584
1590
|
const handleBeforeUnload = () => {
|
|
1585
1591
|
if (sessionIdRef.current) {
|
|
1586
|
-
void
|
|
1592
|
+
void chunkLBSMBRSD_js.clearAudienceContent(sessionIdRef.current);
|
|
1587
1593
|
}
|
|
1588
1594
|
};
|
|
1589
1595
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1645,7 +1651,7 @@ function useAudienceMode(input) {
|
|
|
1645
1651
|
}
|
|
1646
1652
|
channel.onmessage = (event) => {
|
|
1647
1653
|
const data = event.data;
|
|
1648
|
-
if (!
|
|
1654
|
+
if (!chunkLBSMBRSD_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1649
1655
|
return;
|
|
1650
1656
|
}
|
|
1651
1657
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1661,16 +1667,16 @@ function useAudienceMode(input) {
|
|
|
1661
1667
|
}
|
|
1662
1668
|
if (data.type === "presenter-exit") {
|
|
1663
1669
|
if (expectedSessionId) {
|
|
1664
|
-
void
|
|
1670
|
+
void chunkLBSMBRSD_js.clearAudienceContent(expectedSessionId);
|
|
1665
1671
|
}
|
|
1666
|
-
if (
|
|
1672
|
+
if (chunkLBSMBRSD_js.endAudienceDisplay(window)) {
|
|
1667
1673
|
handlers.onPresenterEnded?.();
|
|
1668
1674
|
}
|
|
1669
1675
|
}
|
|
1670
1676
|
};
|
|
1671
1677
|
if (expectedSessionId) {
|
|
1672
1678
|
channel.postMessage({
|
|
1673
|
-
origin:
|
|
1679
|
+
origin: chunkLBSMBRSD_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1674
1680
|
type: "audience-ready",
|
|
1675
1681
|
sessionId: expectedSessionId
|
|
1676
1682
|
});
|
|
@@ -1684,7 +1690,7 @@ function useAudienceMode(input) {
|
|
|
1684
1690
|
}, []);
|
|
1685
1691
|
}
|
|
1686
1692
|
function usePresentationKeyboard(input) {
|
|
1687
|
-
const wheelBufferRef = react.useRef(
|
|
1693
|
+
const wheelBufferRef = react.useRef(chunkLBSMBRSD_js.createWheelStepBuffer());
|
|
1688
1694
|
const {
|
|
1689
1695
|
mode,
|
|
1690
1696
|
movePresentationSlide,
|
|
@@ -1705,14 +1711,14 @@ function usePresentationKeyboard(input) {
|
|
|
1705
1711
|
presentationSlideIndex,
|
|
1706
1712
|
setShowRehearsalSummary
|
|
1707
1713
|
} = input;
|
|
1708
|
-
const keyBufferRef = react.useRef(
|
|
1714
|
+
const keyBufferRef = react.useRef(chunkLBSMBRSD_js.createPresentationKeyBuffer());
|
|
1709
1715
|
react.useEffect(() => {
|
|
1710
|
-
if (mode !== "present" || !
|
|
1711
|
-
keyBufferRef.current =
|
|
1716
|
+
if (mode !== "present" || !chunkLBSMBRSD_js.acceptsPresentationInput()) {
|
|
1717
|
+
keyBufferRef.current = chunkLBSMBRSD_js.createPresentationKeyBuffer();
|
|
1712
1718
|
return;
|
|
1713
1719
|
}
|
|
1714
1720
|
const handleKeyDown = (event) => {
|
|
1715
|
-
const mapped =
|
|
1721
|
+
const mapped = chunkLBSMBRSD_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1716
1722
|
if (mapped.action === "none") {
|
|
1717
1723
|
return;
|
|
1718
1724
|
}
|
|
@@ -1732,12 +1738,12 @@ function usePresentationKeyboard(input) {
|
|
|
1732
1738
|
movePresentationSlide(-1);
|
|
1733
1739
|
return;
|
|
1734
1740
|
case "first": {
|
|
1735
|
-
const first =
|
|
1741
|
+
const first = chunkLBSMBRSD_js.firstShowSlideIndex(showSlideIndexes);
|
|
1736
1742
|
navigateToSlide(first ?? 0);
|
|
1737
1743
|
return;
|
|
1738
1744
|
}
|
|
1739
1745
|
case "last": {
|
|
1740
|
-
const last =
|
|
1746
|
+
const last = chunkLBSMBRSD_js.lastShowSlideIndex(showSlideIndexes);
|
|
1741
1747
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1742
1748
|
return;
|
|
1743
1749
|
}
|
|
@@ -1775,10 +1781,10 @@ function usePresentationKeyboard(input) {
|
|
|
1775
1781
|
}
|
|
1776
1782
|
};
|
|
1777
1783
|
const handleWheel = (event) => {
|
|
1778
|
-
if (mode !== "present" || !
|
|
1784
|
+
if (mode !== "present" || !chunkLBSMBRSD_js.acceptsPresentationInput()) {
|
|
1779
1785
|
return;
|
|
1780
1786
|
}
|
|
1781
|
-
const mapped =
|
|
1787
|
+
const mapped = chunkLBSMBRSD_js.mapPresentationWheel(event, wheelBufferRef.current);
|
|
1782
1788
|
if (mapped.intent === "next-slide") {
|
|
1783
1789
|
event.preventDefault();
|
|
1784
1790
|
movePresentationSlide(1);
|
|
@@ -1911,7 +1917,7 @@ function useRehearsalTimings(input) {
|
|
|
1911
1917
|
|
|
1912
1918
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1913
1919
|
function handlePresentationActionImpl(action, deps) {
|
|
1914
|
-
|
|
1920
|
+
chunkLBSMBRSD_js.runPresentationAction(
|
|
1915
1921
|
action,
|
|
1916
1922
|
{ slideCount: deps.slidesLength },
|
|
1917
1923
|
{
|
|
@@ -1933,7 +1939,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1933
1939
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1934
1940
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1935
1941
|
const transition = incomingSlide?.transition;
|
|
1936
|
-
const durationMs = deps.playTransition ?
|
|
1942
|
+
const durationMs = deps.playTransition ? chunkLBSMBRSD_js.resolveTransitionDurationMs(transition) : 0;
|
|
1937
1943
|
deps.clearPresentationTimers();
|
|
1938
1944
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1939
1945
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -1992,7 +1998,7 @@ function useSlideNavigation(input) {
|
|
|
1992
1998
|
});
|
|
1993
1999
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
1994
2000
|
(slideIndex) => {
|
|
1995
|
-
const delayMs =
|
|
2001
|
+
const delayMs = chunkLBSMBRSD_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
1996
2002
|
if (delayMs === void 0) {
|
|
1997
2003
|
return;
|
|
1998
2004
|
}
|
|
@@ -2015,7 +2021,7 @@ function useSlideNavigation(input) {
|
|
|
2015
2021
|
if (availableSlideIndexes.length === 0) {
|
|
2016
2022
|
return;
|
|
2017
2023
|
}
|
|
2018
|
-
const pastLastSlide = direction === 1 && !
|
|
2024
|
+
const pastLastSlide = direction === 1 && !chunkLBSMBRSD_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
2019
2025
|
if (rehearsing && pastLastSlide) {
|
|
2020
2026
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
2021
2027
|
try {
|
|
@@ -2033,9 +2039,9 @@ function useSlideNavigation(input) {
|
|
|
2033
2039
|
onAdvancePastLastSlide();
|
|
2034
2040
|
return;
|
|
2035
2041
|
}
|
|
2036
|
-
const nextSlideIndex = direction === 1 ?
|
|
2042
|
+
const nextSlideIndex = direction === 1 ? chunkLBSMBRSD_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
2037
2043
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
2038
|
-
}) :
|
|
2044
|
+
}) : chunkLBSMBRSD_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
2039
2045
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
2040
2046
|
return;
|
|
2041
2047
|
}
|
|
@@ -2180,22 +2186,22 @@ function useZoomNavigation(input) {
|
|
|
2180
2186
|
};
|
|
2181
2187
|
}
|
|
2182
2188
|
function usePresenterConsole(slideIndex, active) {
|
|
2183
|
-
const timerRef = react.useRef(
|
|
2184
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2189
|
+
const timerRef = react.useRef(chunkLBSMBRSD_js.createPresenterTimer());
|
|
2190
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkLBSMBRSD_js.createInitialPresentationSnapshot(slideIndex));
|
|
2185
2191
|
const patch = react.useCallback((value) => {
|
|
2186
|
-
setSnapshot((current) =>
|
|
2192
|
+
setSnapshot((current) => chunkLBSMBRSD_js.mergePresentationSnapshot(current, value));
|
|
2187
2193
|
}, []);
|
|
2188
2194
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2189
2195
|
react.useEffect(() => {
|
|
2190
2196
|
if (!active) {
|
|
2191
2197
|
return;
|
|
2192
2198
|
}
|
|
2193
|
-
timerRef.current =
|
|
2199
|
+
timerRef.current = chunkLBSMBRSD_js.resetPresenterTimer();
|
|
2194
2200
|
patch({ paused: false, elapsedMs: 0 });
|
|
2195
2201
|
const timer = window.setInterval(() => {
|
|
2196
2202
|
patch({
|
|
2197
2203
|
paused: timerRef.current.paused,
|
|
2198
|
-
elapsedMs:
|
|
2204
|
+
elapsedMs: chunkLBSMBRSD_js.presenterElapsed(timerRef.current)
|
|
2199
2205
|
});
|
|
2200
2206
|
}, 1e3);
|
|
2201
2207
|
return () => window.clearInterval(timer);
|
|
@@ -2205,19 +2211,19 @@ function usePresenterConsole(slideIndex, active) {
|
|
|
2205
2211
|
applyAudienceSnapshot: setSnapshot,
|
|
2206
2212
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2207
2213
|
toggleTimer: () => {
|
|
2208
|
-
timerRef.current =
|
|
2214
|
+
timerRef.current = chunkLBSMBRSD_js.togglePresenterTimer(timerRef.current);
|
|
2209
2215
|
patch({
|
|
2210
2216
|
paused: timerRef.current.paused,
|
|
2211
|
-
elapsedMs:
|
|
2217
|
+
elapsedMs: chunkLBSMBRSD_js.presenterElapsed(timerRef.current)
|
|
2212
2218
|
});
|
|
2213
2219
|
},
|
|
2214
2220
|
resetTimer: () => {
|
|
2215
|
-
timerRef.current =
|
|
2221
|
+
timerRef.current = chunkLBSMBRSD_js.resetPresenterTimer();
|
|
2216
2222
|
patch({ paused: false, elapsedMs: 0 });
|
|
2217
2223
|
},
|
|
2218
2224
|
stepZoom: (direction) => setSnapshot(
|
|
2219
|
-
(current) =>
|
|
2220
|
-
zoom:
|
|
2225
|
+
(current) => chunkLBSMBRSD_js.mergePresentationSnapshot(current, {
|
|
2226
|
+
zoom: chunkLBSMBRSD_js.stepPresenterZoom(
|
|
2221
2227
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2222
2228
|
direction
|
|
2223
2229
|
)
|
|
@@ -2263,7 +2269,7 @@ function usePresentationMode(input) {
|
|
|
2263
2269
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2264
2270
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2265
2271
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2266
|
-
const showGuard = react.useMemo(() =>
|
|
2272
|
+
const showGuard = react.useMemo(() => chunkLBSMBRSD_js.createPresenterShowGuard(), []);
|
|
2267
2273
|
const {
|
|
2268
2274
|
presentationAnimations,
|
|
2269
2275
|
presentationElementStates,
|
|
@@ -2342,7 +2348,7 @@ function usePresentationMode(input) {
|
|
|
2342
2348
|
});
|
|
2343
2349
|
const movePresentationSlide = react.useCallback(
|
|
2344
2350
|
(direction, trigger = "explicit") => {
|
|
2345
|
-
if (!
|
|
2351
|
+
if (!chunkLBSMBRSD_js.acceptsPresentationInput()) {
|
|
2346
2352
|
return;
|
|
2347
2353
|
}
|
|
2348
2354
|
if (endOfShowVisible) {
|
|
@@ -2480,7 +2486,7 @@ function usePresentationMode(input) {
|
|
|
2480
2486
|
if (mode !== "present") {
|
|
2481
2487
|
return;
|
|
2482
2488
|
}
|
|
2483
|
-
return
|
|
2489
|
+
return chunkLBSMBRSD_js.attachPresentationVisibilityPause({
|
|
2484
2490
|
root: containerRef.current ?? void 0,
|
|
2485
2491
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2486
2492
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
@@ -2560,11 +2566,11 @@ function usePresentationMode(input) {
|
|
|
2560
2566
|
if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
|
|
2561
2567
|
return void 0;
|
|
2562
2568
|
}
|
|
2563
|
-
return
|
|
2569
|
+
return chunkLBSMBRSD_js.buildMorphTransitionPlan(
|
|
2564
2570
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2565
2571
|
slides[transitionOverlay.incomingSlideIndex],
|
|
2566
2572
|
transitionOverlay.durationMs,
|
|
2567
|
-
|
|
2573
|
+
chunkLBSMBRSD_js.morphOptionToMode(transitionOverlay.transition.morphOption)
|
|
2568
2574
|
);
|
|
2569
2575
|
}, [transitionOverlay, slides]);
|
|
2570
2576
|
const morphedElementStates = react.useMemo(() => {
|
|
@@ -2585,7 +2591,7 @@ function usePresentationMode(input) {
|
|
|
2585
2591
|
if (!morphPlan) {
|
|
2586
2592
|
return presentationKeyframesCss;
|
|
2587
2593
|
}
|
|
2588
|
-
const imageRules =
|
|
2594
|
+
const imageRules = chunkLBSMBRSD_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
|
|
2589
2595
|
return `${presentationKeyframesCss ?? ""}
|
|
2590
2596
|
${morphPlan.keyframesCss}
|
|
2591
2597
|
${imageRules}`;
|
|
@@ -2881,7 +2887,7 @@ function useFindReplace({
|
|
|
2881
2887
|
const [findResults, setFindResults] = react.useState([]);
|
|
2882
2888
|
const [findResultIndex, setFindResultIndex] = react.useState(-1);
|
|
2883
2889
|
const performFind = react.useCallback(() => {
|
|
2884
|
-
const results =
|
|
2890
|
+
const results = chunkLBSMBRSD_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
|
|
2885
2891
|
if (!findQuery) {
|
|
2886
2892
|
setFindResults([]);
|
|
2887
2893
|
setFindResultIndex(-1);
|
|
@@ -2915,7 +2921,7 @@ function useFindReplace({
|
|
|
2915
2921
|
return;
|
|
2916
2922
|
}
|
|
2917
2923
|
onUpdateSlides(
|
|
2918
|
-
(prevSlides) =>
|
|
2924
|
+
(prevSlides) => chunkLBSMBRSD_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
|
|
2919
2925
|
);
|
|
2920
2926
|
onMarkDirty();
|
|
2921
2927
|
},
|
|
@@ -2937,9 +2943,9 @@ function useFindReplace({
|
|
|
2937
2943
|
}, [findResults, applyReplacements, performFind]);
|
|
2938
2944
|
react.useEffect(() => {
|
|
2939
2945
|
const handler = (event) => {
|
|
2940
|
-
const { action } =
|
|
2946
|
+
const { action } = chunkLBSMBRSD_js.mapEditorKey(event, {
|
|
2941
2947
|
canEdit: mode === "edit",
|
|
2942
|
-
isTextInputTarget:
|
|
2948
|
+
isTextInputTarget: chunkLBSMBRSD_js.isEditorTextInputTarget(event.target)
|
|
2943
2949
|
});
|
|
2944
2950
|
if (action !== "find") {
|
|
2945
2951
|
return;
|
|
@@ -3018,7 +3024,7 @@ function addCommentToSlide(slides, slideIndex, text, authorName, elementId) {
|
|
|
3018
3024
|
if (!slide) {
|
|
3019
3025
|
return { slides, didAdd: false };
|
|
3020
3026
|
}
|
|
3021
|
-
const next =
|
|
3027
|
+
const next = chunkLBSMBRSD_js.addCommentToList(
|
|
3022
3028
|
slide.comments || [],
|
|
3023
3029
|
text,
|
|
3024
3030
|
authorName,
|
|
@@ -3036,7 +3042,7 @@ function removeCommentFromSlide(slides, slideIndex, commentId) {
|
|
|
3036
3042
|
if (!slide) {
|
|
3037
3043
|
return { slides, didDelete: false };
|
|
3038
3044
|
}
|
|
3039
|
-
const next =
|
|
3045
|
+
const next = chunkLBSMBRSD_js.removeCommentFromList(slide.comments || [], commentId);
|
|
3040
3046
|
if (!next) {
|
|
3041
3047
|
return { slides, didDelete: false };
|
|
3042
3048
|
}
|
|
@@ -3047,7 +3053,7 @@ function editCommentInSlide(slides, slideIndex, commentId, newText) {
|
|
|
3047
3053
|
if (!slide) {
|
|
3048
3054
|
return { slides, didUpdate: false };
|
|
3049
3055
|
}
|
|
3050
|
-
const next =
|
|
3056
|
+
const next = chunkLBSMBRSD_js.editCommentInList(slide.comments || [], commentId, newText);
|
|
3051
3057
|
if (!next) {
|
|
3052
3058
|
return { slides, didUpdate: false };
|
|
3053
3059
|
}
|
|
@@ -3058,7 +3064,7 @@ function toggleResolvedInSlide(slides, slideIndex, commentId) {
|
|
|
3058
3064
|
if (!slide) {
|
|
3059
3065
|
return { slides, didUpdate: false };
|
|
3060
3066
|
}
|
|
3061
|
-
const next =
|
|
3067
|
+
const next = chunkLBSMBRSD_js.toggleCommentResolvedInList(slide.comments || [], commentId);
|
|
3062
3068
|
if (!next) {
|
|
3063
3069
|
return { slides, didUpdate: false };
|
|
3064
3070
|
}
|
|
@@ -3069,7 +3075,7 @@ function addReplyToSlide(slides, slideIndex, parentId, text, authorName) {
|
|
|
3069
3075
|
if (!slide) {
|
|
3070
3076
|
return { slides, didAdd: false };
|
|
3071
3077
|
}
|
|
3072
|
-
const next =
|
|
3078
|
+
const next = chunkLBSMBRSD_js.replyToCommentInList(slide.comments || [], parentId, text, authorName);
|
|
3073
3079
|
if (!next) {
|
|
3074
3080
|
return { slides, didAdd: false };
|
|
3075
3081
|
}
|
|
@@ -3443,7 +3449,7 @@ function useViewerCoreState(_input) {
|
|
|
3443
3449
|
const marqueeStateRef = react.useRef(null);
|
|
3444
3450
|
const isDrawingRef = react.useRef(false);
|
|
3445
3451
|
const justInteractedRef = react.useRef(false);
|
|
3446
|
-
const livePatcher = react.useMemo(() =>
|
|
3452
|
+
const livePatcher = react.useMemo(() => chunkLBSMBRSD_js.createCollaborationLivePatcher(), []);
|
|
3447
3453
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3448
3454
|
const slidesRef = react.useRef([]);
|
|
3449
3455
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3452,8 +3458,8 @@ function useViewerCoreState(_input) {
|
|
|
3452
3458
|
const [slides, setSlides] = react.useState([]);
|
|
3453
3459
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3454
3460
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3455
|
-
width:
|
|
3456
|
-
height:
|
|
3461
|
+
width: chunk7HF5DSE4_js.DEFAULT_CANVAS_WIDTH,
|
|
3462
|
+
height: chunk7HF5DSE4_js.DEFAULT_CANVAS_HEIGHT
|
|
3457
3463
|
});
|
|
3458
3464
|
const [slideSizeEmu, setSlideSizeEmu] = react.useState();
|
|
3459
3465
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
@@ -3474,7 +3480,7 @@ function useViewerCoreState(_input) {
|
|
|
3474
3480
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3475
3481
|
inlineEditingTextRef.current = resolved;
|
|
3476
3482
|
setInlineEditingTextBase(value);
|
|
3477
|
-
|
|
3483
|
+
chunkLBSMBRSD_js.publishLiveInlineText(
|
|
3478
3484
|
livePatcher,
|
|
3479
3485
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3480
3486
|
inlineEditingElementIdRef.current,
|
|
@@ -3813,7 +3819,7 @@ function useLoadContent({
|
|
|
3813
3819
|
);
|
|
3814
3820
|
}
|
|
3815
3821
|
const previousHandler = handlerRef.current;
|
|
3816
|
-
const handler = new
|
|
3822
|
+
const handler = new chunkLBSMBRSD_js.PptxHandler();
|
|
3817
3823
|
const parsed = await handler.load(buffer);
|
|
3818
3824
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3819
3825
|
handler.dispose();
|
|
@@ -3825,7 +3831,7 @@ function useLoadContent({
|
|
|
3825
3831
|
handlerRef.current = null;
|
|
3826
3832
|
const mediaElements = [];
|
|
3827
3833
|
for (const slide of parsed.slides) {
|
|
3828
|
-
|
|
3834
|
+
chunkLBSMBRSD_js.collectMediaElements(slide.elements, mediaElements);
|
|
3829
3835
|
}
|
|
3830
3836
|
for (const url of mediaDataUrls.values()) {
|
|
3831
3837
|
if (url.startsWith("blob:")) {
|
|
@@ -3866,7 +3872,7 @@ function useLoadContent({
|
|
|
3866
3872
|
}
|
|
3867
3873
|
})
|
|
3868
3874
|
);
|
|
3869
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3875
|
+
const { paths: imagePaths, refs: imageRefs } = chunkLBSMBRSD_js.collectImagePaths(parsed.slides);
|
|
3870
3876
|
let nextSlides = parsed.slides;
|
|
3871
3877
|
if (imagePaths.size > 0) {
|
|
3872
3878
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3921,12 +3927,12 @@ function useLoadContent({
|
|
|
3921
3927
|
}
|
|
3922
3928
|
}
|
|
3923
3929
|
handlerRef.current = handler;
|
|
3924
|
-
const partition =
|
|
3930
|
+
const partition = chunkLBSMBRSD_js.partitionTemplateElements(nextSlides);
|
|
3925
3931
|
setSlides(partition.slides);
|
|
3926
3932
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
3927
3933
|
setCanvasSize({
|
|
3928
|
-
width: parsed.width ??
|
|
3929
|
-
height: parsed.height ??
|
|
3934
|
+
width: parsed.width ?? chunk7HF5DSE4_js.DEFAULT_CANVAS_WIDTH,
|
|
3935
|
+
height: parsed.height ?? chunk7HF5DSE4_js.DEFAULT_CANVAS_HEIGHT
|
|
3930
3936
|
});
|
|
3931
3937
|
setSlideSizeEmu(
|
|
3932
3938
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -3943,7 +3949,7 @@ function useLoadContent({
|
|
|
3943
3949
|
setThemeOptions(parsed.themeOptions ?? []);
|
|
3944
3950
|
setCustomShows(parsed.customShows ?? []);
|
|
3945
3951
|
setActiveCustomShowId(
|
|
3946
|
-
|
|
3952
|
+
chunkLBSMBRSD_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
|
|
3947
3953
|
);
|
|
3948
3954
|
setSections(parsed.sections ?? []);
|
|
3949
3955
|
setPresentationProperties(parsed.presentationProperties ?? {});
|
|
@@ -3965,7 +3971,7 @@ function useLoadContent({
|
|
|
3965
3971
|
setHasMacros(parsed.hasMacros === true);
|
|
3966
3972
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
3967
3973
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
3968
|
-
setGuides(
|
|
3974
|
+
setGuides(chunkLBSMBRSD_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
3969
3975
|
setActiveSlideIndex(0);
|
|
3970
3976
|
clearSelection();
|
|
3971
3977
|
setIsDirty(false);
|
|
@@ -3973,7 +3979,7 @@ function useLoadContent({
|
|
|
3973
3979
|
onContentApplied?.();
|
|
3974
3980
|
} catch (err) {
|
|
3975
3981
|
if (!cancelled && token === renderTokenRef.current) {
|
|
3976
|
-
if (err instanceof
|
|
3982
|
+
if (err instanceof chunkLBSMBRSD_js.EncryptedFileError) {
|
|
3977
3983
|
setIsEncrypted(true);
|
|
3978
3984
|
} else {
|
|
3979
3985
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -4000,7 +4006,7 @@ function useLoadContent({
|
|
|
4000
4006
|
}
|
|
4001
4007
|
function useAutosave(input) {
|
|
4002
4008
|
const { isDirty, filePath, serializeSlides, enabled = true, getChangeSources } = input;
|
|
4003
|
-
const intervalMs =
|
|
4009
|
+
const intervalMs = chunkLBSMBRSD_js.resolveAutosaveIntervalMs({
|
|
4004
4010
|
hostIntervalMs: input.intervalMs,
|
|
4005
4011
|
optionsIntervalSeconds: input.intervalSeconds
|
|
4006
4012
|
});
|
|
@@ -4031,7 +4037,7 @@ function useAutosave(input) {
|
|
|
4031
4037
|
return;
|
|
4032
4038
|
}
|
|
4033
4039
|
const sources = changeSourcesRef.current?.() ?? [];
|
|
4034
|
-
if (!
|
|
4040
|
+
if (!chunkLBSMBRSD_js.shouldWriteAutosaveSnapshot({
|
|
4035
4041
|
filePath: path,
|
|
4036
4042
|
isDirty: isDirtyRef.current,
|
|
4037
4043
|
saving: isSavingRef.current,
|
|
@@ -4049,8 +4055,8 @@ function useAutosave(input) {
|
|
|
4049
4055
|
isSavingRef.current = false;
|
|
4050
4056
|
return;
|
|
4051
4057
|
}
|
|
4052
|
-
await
|
|
4053
|
-
lastSnapshotRef.current =
|
|
4058
|
+
await chunkLBSMBRSD_js.saveAutosaveSnapshot(path, data);
|
|
4059
|
+
lastSnapshotRef.current = chunkLBSMBRSD_js.autosaveSnapshotMark(path, sources);
|
|
4054
4060
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4055
4061
|
} catch (err) {
|
|
4056
4062
|
setAutosaveStatus({
|
|
@@ -4136,11 +4142,11 @@ function useElementOperations(input) {
|
|
|
4136
4142
|
(elementId, updates) => {
|
|
4137
4143
|
if (masterView?.target) {
|
|
4138
4144
|
applyMasterViewWrite(
|
|
4139
|
-
|
|
4145
|
+
chunkLBSMBRSD_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
|
|
4140
4146
|
);
|
|
4141
4147
|
return;
|
|
4142
4148
|
}
|
|
4143
|
-
if (
|
|
4149
|
+
if (chunkLBSMBRSD_js.isTemplateElementId(elementId)) {
|
|
4144
4150
|
const slideId = activeSlide?.id;
|
|
4145
4151
|
if (slideId) {
|
|
4146
4152
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4188,7 +4194,7 @@ function useElementOperations(input) {
|
|
|
4188
4194
|
);
|
|
4189
4195
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4190
4196
|
(updates) => {
|
|
4191
|
-
if (!selectedElement || !
|
|
4197
|
+
if (!selectedElement || !chunkLBSMBRSD_js.hasShapeProperties(selectedElement)) {
|
|
4192
4198
|
return;
|
|
4193
4199
|
}
|
|
4194
4200
|
updateSelectedElement({
|
|
@@ -4199,17 +4205,17 @@ function useElementOperations(input) {
|
|
|
4199
4205
|
);
|
|
4200
4206
|
const updateSelectedTextStyle = react.useCallback(
|
|
4201
4207
|
(updates) => {
|
|
4202
|
-
if (!selectedElement || !
|
|
4208
|
+
if (!selectedElement || !chunkLBSMBRSD_js.hasTextProperties(selectedElement)) {
|
|
4203
4209
|
return;
|
|
4204
4210
|
}
|
|
4205
|
-
const inlineSel =
|
|
4211
|
+
const inlineSel = chunkLBSMBRSD_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4206
4212
|
if (inlineSel && selectedElement.textSegments) {
|
|
4207
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4213
|
+
const { newSegments: newSegments2, newSelection } = chunkLBSMBRSD_js.applyStyleToSelectedSegments(
|
|
4208
4214
|
selectedElement.textSegments,
|
|
4209
4215
|
inlineSel,
|
|
4210
4216
|
updates
|
|
4211
4217
|
);
|
|
4212
|
-
|
|
4218
|
+
chunkLBSMBRSD_js.setPendingSelectionRestore(newSelection);
|
|
4213
4219
|
updateSelectedElement({
|
|
4214
4220
|
textSegments: newSegments2
|
|
4215
4221
|
});
|
|
@@ -4229,12 +4235,12 @@ function useElementOperations(input) {
|
|
|
4229
4235
|
);
|
|
4230
4236
|
const updateSelectedTextCase = react.useCallback(
|
|
4231
4237
|
(mode) => {
|
|
4232
|
-
if (!selectedElement || !
|
|
4238
|
+
if (!selectedElement || !chunkLBSMBRSD_js.hasTextProperties(selectedElement)) {
|
|
4233
4239
|
return;
|
|
4234
4240
|
}
|
|
4235
|
-
const inlineSel =
|
|
4241
|
+
const inlineSel = chunkLBSMBRSD_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4236
4242
|
if (inlineSel && selectedElement.textSegments) {
|
|
4237
|
-
const newSegments =
|
|
4243
|
+
const newSegments = chunkLBSMBRSD_js.applyCaseTransformToSegments(
|
|
4238
4244
|
selectedElement.textSegments,
|
|
4239
4245
|
inlineSel,
|
|
4240
4246
|
mode
|
|
@@ -4244,14 +4250,14 @@ function useElementOperations(input) {
|
|
|
4244
4250
|
}
|
|
4245
4251
|
const updates = {};
|
|
4246
4252
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
4247
|
-
updates.textSegments =
|
|
4253
|
+
updates.textSegments = chunkLBSMBRSD_js.applyCaseTransformToSegments(
|
|
4248
4254
|
selectedElement.textSegments,
|
|
4249
4255
|
null,
|
|
4250
4256
|
mode
|
|
4251
4257
|
);
|
|
4252
4258
|
}
|
|
4253
4259
|
if (typeof selectedElement.text === "string") {
|
|
4254
|
-
updates.text =
|
|
4260
|
+
updates.text = chunkLBSMBRSD_js.transformTextCase(selectedElement.text, mode);
|
|
4255
4261
|
}
|
|
4256
4262
|
updateSelectedElement(updates);
|
|
4257
4263
|
},
|
|
@@ -4264,15 +4270,15 @@ function useElementOperations(input) {
|
|
|
4264
4270
|
[setSlides]
|
|
4265
4271
|
);
|
|
4266
4272
|
const masterViewTarget = masterView?.target ?? null;
|
|
4267
|
-
const activeElements = masterViewTarget ?
|
|
4273
|
+
const activeElements = masterViewTarget ? chunkLBSMBRSD_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4268
4274
|
const updateActiveElements = react.useCallback(
|
|
4269
4275
|
(updater) => {
|
|
4270
4276
|
if (masterView?.target) {
|
|
4271
4277
|
applyMasterViewWrite(
|
|
4272
|
-
|
|
4278
|
+
chunkLBSMBRSD_js.replaceMasterViewElements(
|
|
4273
4279
|
masterView,
|
|
4274
4280
|
masterView.target,
|
|
4275
|
-
updater(
|
|
4281
|
+
updater(chunkLBSMBRSD_js.masterViewElements(masterView, masterView.target))
|
|
4276
4282
|
)
|
|
4277
4283
|
);
|
|
4278
4284
|
return;
|
|
@@ -4325,7 +4331,7 @@ function useSectionOperations(input) {
|
|
|
4325
4331
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4326
4332
|
const addSection2 = react.useCallback(
|
|
4327
4333
|
(name, afterSlideIndex) => {
|
|
4328
|
-
const result =
|
|
4334
|
+
const result = chunkLBSMBRSD_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4329
4335
|
setSlides(result.slides);
|
|
4330
4336
|
setSections(result.sections);
|
|
4331
4337
|
markDirty();
|
|
@@ -4334,7 +4340,7 @@ function useSectionOperations(input) {
|
|
|
4334
4340
|
);
|
|
4335
4341
|
const renameSection2 = react.useCallback(
|
|
4336
4342
|
(sectionId, newName) => {
|
|
4337
|
-
const result =
|
|
4343
|
+
const result = chunkLBSMBRSD_js.renameSection(sections, slides, sectionId, newName);
|
|
4338
4344
|
setSections(result.sections);
|
|
4339
4345
|
setSlides(result.slides);
|
|
4340
4346
|
markDirty();
|
|
@@ -4343,7 +4349,7 @@ function useSectionOperations(input) {
|
|
|
4343
4349
|
);
|
|
4344
4350
|
const deleteSection2 = react.useCallback(
|
|
4345
4351
|
(sectionId) => {
|
|
4346
|
-
const result =
|
|
4352
|
+
const result = chunkLBSMBRSD_js.deleteSection(sections, slides, sectionId);
|
|
4347
4353
|
setSections(result.sections);
|
|
4348
4354
|
setSlides(result.slides);
|
|
4349
4355
|
markDirty();
|
|
@@ -4352,21 +4358,21 @@ function useSectionOperations(input) {
|
|
|
4352
4358
|
);
|
|
4353
4359
|
const moveSectionUp2 = react.useCallback(
|
|
4354
4360
|
(sectionId) => {
|
|
4355
|
-
setSections(
|
|
4361
|
+
setSections(chunkLBSMBRSD_js.moveSectionUp(sections, sectionId));
|
|
4356
4362
|
markDirty();
|
|
4357
4363
|
},
|
|
4358
4364
|
[sections, setSections, markDirty]
|
|
4359
4365
|
);
|
|
4360
4366
|
const moveSectionDown2 = react.useCallback(
|
|
4361
4367
|
(sectionId) => {
|
|
4362
|
-
setSections(
|
|
4368
|
+
setSections(chunkLBSMBRSD_js.moveSectionDown(sections, sectionId));
|
|
4363
4369
|
markDirty();
|
|
4364
4370
|
},
|
|
4365
4371
|
[sections, setSections, markDirty]
|
|
4366
4372
|
);
|
|
4367
4373
|
const moveSlidesToSection2 = react.useCallback(
|
|
4368
4374
|
(slideIndexes, targetSectionId) => {
|
|
4369
|
-
const result =
|
|
4375
|
+
const result = chunkLBSMBRSD_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4370
4376
|
setSlides(result.slides);
|
|
4371
4377
|
setSections(result.sections);
|
|
4372
4378
|
markDirty();
|
|
@@ -4395,19 +4401,19 @@ function useSectionOperations(input) {
|
|
|
4395
4401
|
|
|
4396
4402
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4397
4403
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
4398
|
-
const resized =
|
|
4404
|
+
const resized = chunkLBSMBRSD_js.applyResize(
|
|
4399
4405
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
4400
4406
|
handle,
|
|
4401
4407
|
dx,
|
|
4402
4408
|
dy,
|
|
4403
4409
|
1,
|
|
4404
|
-
{ minSize:
|
|
4410
|
+
{ minSize: chunk7HF5DSE4_js.MIN_ELEMENT_SIZE }
|
|
4405
4411
|
);
|
|
4406
4412
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4407
4413
|
if (!snapToGrid) {
|
|
4408
4414
|
return box;
|
|
4409
4415
|
}
|
|
4410
|
-
return
|
|
4416
|
+
return chunkLBSMBRSD_js.snapBoxToGrid(box, handle, gridSpacingPx, chunk7HF5DSE4_js.MIN_ELEMENT_SIZE);
|
|
4411
4417
|
}
|
|
4412
4418
|
function resolveLiveTarget(input) {
|
|
4413
4419
|
const { livePatcher, editTemplateMode, activeSlide } = input;
|
|
@@ -4520,7 +4526,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4520
4526
|
width: el.width,
|
|
4521
4527
|
height: el.height
|
|
4522
4528
|
}));
|
|
4523
|
-
const snapResult =
|
|
4529
|
+
const snapResult = chunkLBSMBRSD_js.computeSnapToShape(
|
|
4524
4530
|
targetX,
|
|
4525
4531
|
targetY,
|
|
4526
4532
|
primaryEl.width,
|
|
@@ -4559,7 +4565,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4559
4565
|
if (live) {
|
|
4560
4566
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4561
4567
|
const start = drag.startPositionsById[id];
|
|
4562
|
-
|
|
4568
|
+
chunkLBSMBRSD_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4563
4569
|
x: start.x + appliedDx,
|
|
4564
4570
|
y: start.y + appliedDy
|
|
4565
4571
|
});
|
|
@@ -4593,22 +4599,22 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4593
4599
|
if (rs.domEl) {
|
|
4594
4600
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4595
4601
|
rs.domEl.style.top = `${geo.y}px`;
|
|
4596
|
-
rs.domEl.style.width = `${Math.max(geo.width,
|
|
4597
|
-
rs.domEl.style.height = `${Math.max(geo.height,
|
|
4602
|
+
rs.domEl.style.width = `${Math.max(geo.width, chunk7HF5DSE4_js.MIN_ELEMENT_SIZE)}px`;
|
|
4603
|
+
rs.domEl.style.height = `${Math.max(geo.height, chunk7HF5DSE4_js.MIN_ELEMENT_SIZE)}px`;
|
|
4598
4604
|
}
|
|
4599
4605
|
if (live) {
|
|
4600
|
-
|
|
4606
|
+
chunkLBSMBRSD_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4601
4607
|
x: geo.x,
|
|
4602
4608
|
y: geo.y,
|
|
4603
|
-
width: Math.max(geo.width,
|
|
4604
|
-
height: Math.max(geo.height,
|
|
4609
|
+
width: Math.max(geo.width, chunk7HF5DSE4_js.MIN_ELEMENT_SIZE),
|
|
4610
|
+
height: Math.max(geo.height, chunk7HF5DSE4_js.MIN_ELEMENT_SIZE)
|
|
4605
4611
|
});
|
|
4606
4612
|
}
|
|
4607
4613
|
}
|
|
4608
4614
|
function processAdjustmentMove(e, adj, editorScale, updateElementById) {
|
|
4609
4615
|
const dx = (e.clientX - adj.startClientX) / editorScale;
|
|
4610
4616
|
const dy = (e.clientY - adj.startClientY) / editorScale;
|
|
4611
|
-
const adjustments =
|
|
4617
|
+
const adjustments = chunkLBSMBRSD_js.getDraggedShapeAdjustments(adj, dx, dy);
|
|
4612
4618
|
if (!adj.moved && Math.hypot(dx, dy) > 2) {
|
|
4613
4619
|
adj.moved = true;
|
|
4614
4620
|
}
|
|
@@ -4683,13 +4689,13 @@ function processPointerUp(input) {
|
|
|
4683
4689
|
if (i !== activeSlideIndex) {
|
|
4684
4690
|
return s;
|
|
4685
4691
|
}
|
|
4686
|
-
const rerouted =
|
|
4692
|
+
const rerouted = chunkLBSMBRSD_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4687
4693
|
if (rerouted.length === 0) {
|
|
4688
4694
|
return s;
|
|
4689
4695
|
}
|
|
4690
4696
|
return {
|
|
4691
4697
|
...s,
|
|
4692
|
-
elements:
|
|
4698
|
+
elements: chunkLBSMBRSD_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4693
4699
|
};
|
|
4694
4700
|
})
|
|
4695
4701
|
);
|
|
@@ -4714,9 +4720,9 @@ function processPointerUp(input) {
|
|
|
4714
4720
|
}
|
|
4715
4721
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4716
4722
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4717
|
-
const hitIds =
|
|
4723
|
+
const hitIds = chunkLBSMBRSD_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4718
4724
|
if (marquee.additive) {
|
|
4719
|
-
const merged =
|
|
4725
|
+
const merged = chunkLBSMBRSD_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4720
4726
|
if (merged.length > 0) {
|
|
4721
4727
|
applySelection(merged[0], merged);
|
|
4722
4728
|
} else {
|
|
@@ -4739,8 +4745,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4739
4745
|
}
|
|
4740
4746
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4741
4747
|
});
|
|
4742
|
-
const rerouted =
|
|
4743
|
-
return
|
|
4748
|
+
const rerouted = chunkLBSMBRSD_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4749
|
+
return chunkLBSMBRSD_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4744
4750
|
};
|
|
4745
4751
|
if (editTemplateMode) {
|
|
4746
4752
|
const slideId = activeSlide?.id;
|
|
@@ -4897,9 +4903,9 @@ function useCanvasInteractions(input) {
|
|
|
4897
4903
|
return;
|
|
4898
4904
|
}
|
|
4899
4905
|
const el = elementLookup.get(editId);
|
|
4900
|
-
if (el &&
|
|
4906
|
+
if (el && chunkLBSMBRSD_js.hasTextProperties(el)) {
|
|
4901
4907
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
4902
|
-
const newSegments =
|
|
4908
|
+
const newSegments = chunkLBSMBRSD_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
4903
4909
|
ops.updateElementById(editId, {
|
|
4904
4910
|
text: committedText,
|
|
4905
4911
|
textSegments: newSegments
|
|
@@ -4910,7 +4916,7 @@ function useCanvasInteractions(input) {
|
|
|
4910
4916
|
setInlineEditingText("");
|
|
4911
4917
|
};
|
|
4912
4918
|
const openEquationEditorForElement = (el) => {
|
|
4913
|
-
if (!
|
|
4919
|
+
if (!chunkLBSMBRSD_js.hasTextProperties(el)) {
|
|
4914
4920
|
return false;
|
|
4915
4921
|
}
|
|
4916
4922
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -4940,7 +4946,7 @@ function useCanvasInteractions(input) {
|
|
|
4940
4946
|
justInteractedRef.current = false;
|
|
4941
4947
|
} else {
|
|
4942
4948
|
const el = elementLookup.get(elementId);
|
|
4943
|
-
if (el &&
|
|
4949
|
+
if (el && chunkLBSMBRSD_js.hasTextProperties(el) && chunkLBSMBRSD_js.canInteractWithElement(el, "textEdit")) {
|
|
4944
4950
|
if (!openEquationEditorForElement(el)) {
|
|
4945
4951
|
setInlineEditingElementId(elementId);
|
|
4946
4952
|
setInlineEditingText(el.text ?? "");
|
|
@@ -4959,7 +4965,7 @@ function useCanvasInteractions(input) {
|
|
|
4959
4965
|
if (openEquationEditorForElement(el)) {
|
|
4960
4966
|
return;
|
|
4961
4967
|
}
|
|
4962
|
-
if (
|
|
4968
|
+
if (chunkLBSMBRSD_js.hasTextProperties(el) && chunkLBSMBRSD_js.canInteractWithElement(el, "textEdit")) {
|
|
4963
4969
|
setInlineEditingElementId(elementId);
|
|
4964
4970
|
setInlineEditingText(el.text ?? "");
|
|
4965
4971
|
}
|
|
@@ -4982,7 +4988,7 @@ function useCanvasInteractions(input) {
|
|
|
4982
4988
|
justSelectedRef.current = false;
|
|
4983
4989
|
}
|
|
4984
4990
|
const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
|
|
4985
|
-
const movableIds =
|
|
4991
|
+
const movableIds = chunkLBSMBRSD_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
|
|
4986
4992
|
if (movableIds.length === 0) {
|
|
4987
4993
|
return;
|
|
4988
4994
|
}
|
|
@@ -5052,7 +5058,7 @@ function useCanvasInteractions(input) {
|
|
|
5052
5058
|
const handleResizePointerDown = (elementId, e, handle) => {
|
|
5053
5059
|
e.stopPropagation();
|
|
5054
5060
|
const el = elementLookup.get(elementId);
|
|
5055
|
-
if (!el || !
|
|
5061
|
+
if (!el || !chunkLBSMBRSD_js.canInteractWithElement(el, "resize")) {
|
|
5056
5062
|
return;
|
|
5057
5063
|
}
|
|
5058
5064
|
resizeStateRef.current = {
|
|
@@ -5074,7 +5080,7 @@ function useCanvasInteractions(input) {
|
|
|
5074
5080
|
};
|
|
5075
5081
|
const handleRotate = (elementId, rotationDeg) => {
|
|
5076
5082
|
const el = elementLookup.get(elementId);
|
|
5077
|
-
if (!el || !
|
|
5083
|
+
if (!el || !chunkLBSMBRSD_js.canInteractWithElement(el, "rotate")) {
|
|
5078
5084
|
return;
|
|
5079
5085
|
}
|
|
5080
5086
|
ops.updateElementById(elementId, { rotation: rotationDeg });
|
|
@@ -5094,10 +5100,10 @@ function useCanvasInteractions(input) {
|
|
|
5094
5100
|
const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
|
|
5095
5101
|
e.stopPropagation();
|
|
5096
5102
|
const el = elementLookup.get(elementId);
|
|
5097
|
-
if (!el || !
|
|
5103
|
+
if (!el || !chunkLBSMBRSD_js.canInteractWithElement(el, "adjustHandle")) {
|
|
5098
5104
|
return;
|
|
5099
5105
|
}
|
|
5100
|
-
shapeAdjustmentDragStateRef.current =
|
|
5106
|
+
shapeAdjustmentDragStateRef.current = chunkLBSMBRSD_js.beginShapeAdjustment(
|
|
5101
5107
|
el,
|
|
5102
5108
|
descriptor,
|
|
5103
5109
|
e.clientX,
|
|
@@ -5144,7 +5150,7 @@ function createFileHandlers(deps) {
|
|
|
5144
5150
|
h = Math.round(h * scale);
|
|
5145
5151
|
}
|
|
5146
5152
|
addElement({
|
|
5147
|
-
id:
|
|
5153
|
+
id: chunkLBSMBRSD_js.generateElementId(),
|
|
5148
5154
|
type: "image",
|
|
5149
5155
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5150
5156
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5155,7 +5161,7 @@ function createFileHandlers(deps) {
|
|
|
5155
5161
|
};
|
|
5156
5162
|
img.onerror = () => {
|
|
5157
5163
|
addElement({
|
|
5158
|
-
id:
|
|
5164
|
+
id: chunkLBSMBRSD_js.generateElementId(),
|
|
5159
5165
|
type: "image",
|
|
5160
5166
|
x: 100,
|
|
5161
5167
|
y: 100,
|
|
@@ -5181,7 +5187,7 @@ function createFileHandlers(deps) {
|
|
|
5181
5187
|
const elFilePath = file.path;
|
|
5182
5188
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5183
5189
|
addElement({
|
|
5184
|
-
id:
|
|
5190
|
+
id: chunkLBSMBRSD_js.generateElementId(),
|
|
5185
5191
|
type: "media",
|
|
5186
5192
|
mediaType,
|
|
5187
5193
|
mediaMimeType: file.type || void 0,
|
|
@@ -5356,13 +5362,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5356
5362
|
return;
|
|
5357
5363
|
}
|
|
5358
5364
|
addElement({
|
|
5359
|
-
id:
|
|
5365
|
+
id: chunkLBSMBRSD_js.generateElementId(),
|
|
5360
5366
|
type: "smartArt",
|
|
5361
5367
|
x: 100,
|
|
5362
5368
|
y: 120,
|
|
5363
5369
|
width: 600,
|
|
5364
5370
|
height: 340,
|
|
5365
|
-
smartArtData:
|
|
5371
|
+
smartArtData: chunkLBSMBRSD_js.buildSmartArtPresetData(
|
|
5366
5372
|
layout,
|
|
5367
5373
|
defaultItems,
|
|
5368
5374
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5374,7 +5380,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5374
5380
|
return;
|
|
5375
5381
|
}
|
|
5376
5382
|
addElement({
|
|
5377
|
-
id:
|
|
5383
|
+
id: chunkLBSMBRSD_js.generateElementId(),
|
|
5378
5384
|
type: "shape",
|
|
5379
5385
|
x: 120,
|
|
5380
5386
|
y: 200,
|
|
@@ -5412,7 +5418,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5412
5418
|
return;
|
|
5413
5419
|
}
|
|
5414
5420
|
const resolved = resolveHyperlinkEditResult(data);
|
|
5415
|
-
if (resolved.url && !
|
|
5421
|
+
if (resolved.url && !chunkLBSMBRSD_js.isUrlSafe(resolved.url)) {
|
|
5416
5422
|
return;
|
|
5417
5423
|
}
|
|
5418
5424
|
const actionClick = {
|
|
@@ -5436,7 +5442,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5436
5442
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5437
5443
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5438
5444
|
addElement({
|
|
5439
|
-
id:
|
|
5445
|
+
id: chunkLBSMBRSD_js.generateElementId(),
|
|
5440
5446
|
type: "shape",
|
|
5441
5447
|
x: 120,
|
|
5442
5448
|
y: 200,
|
|
@@ -5458,11 +5464,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5458
5464
|
if (!activeSlide) {
|
|
5459
5465
|
return;
|
|
5460
5466
|
}
|
|
5461
|
-
const preset =
|
|
5467
|
+
const preset = chunkLBSMBRSD_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5462
5468
|
if (!preset) {
|
|
5463
5469
|
return;
|
|
5464
5470
|
}
|
|
5465
|
-
const defaultPptxAction =
|
|
5471
|
+
const defaultPptxAction = chunkLBSMBRSD_js.elementActionToPptxAction({
|
|
5466
5472
|
trigger: "click",
|
|
5467
5473
|
type: preset.defaultAction
|
|
5468
5474
|
});
|
|
@@ -5471,7 +5477,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5471
5477
|
defaultPptxAction.highlightClick = true;
|
|
5472
5478
|
}
|
|
5473
5479
|
addElement({
|
|
5474
|
-
id:
|
|
5480
|
+
id: chunkLBSMBRSD_js.generateElementId(),
|
|
5475
5481
|
type: "shape",
|
|
5476
5482
|
x: 150,
|
|
5477
5483
|
y: 150,
|
|
@@ -5538,14 +5544,14 @@ function useInsertElements(input) {
|
|
|
5538
5544
|
return;
|
|
5539
5545
|
}
|
|
5540
5546
|
addElement({
|
|
5541
|
-
id:
|
|
5547
|
+
id: chunkLBSMBRSD_js.generateElementId(),
|
|
5542
5548
|
type: "text",
|
|
5543
5549
|
x: 100,
|
|
5544
5550
|
y: 100,
|
|
5545
5551
|
width: 300,
|
|
5546
5552
|
height: 60,
|
|
5547
5553
|
text: "",
|
|
5548
|
-
textStyle: { fontSize:
|
|
5554
|
+
textStyle: { fontSize: chunk7HF5DSE4_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5549
5555
|
});
|
|
5550
5556
|
};
|
|
5551
5557
|
const handleAddShape = () => {
|
|
@@ -5553,7 +5559,7 @@ function useInsertElements(input) {
|
|
|
5553
5559
|
return;
|
|
5554
5560
|
}
|
|
5555
5561
|
addElement({
|
|
5556
|
-
id:
|
|
5562
|
+
id: chunkLBSMBRSD_js.generateElementId(),
|
|
5557
5563
|
type: "shape",
|
|
5558
5564
|
x: 150,
|
|
5559
5565
|
y: 150,
|
|
@@ -5572,15 +5578,15 @@ function useInsertElements(input) {
|
|
|
5572
5578
|
return;
|
|
5573
5579
|
}
|
|
5574
5580
|
addElement({
|
|
5575
|
-
...
|
|
5576
|
-
id:
|
|
5581
|
+
...chunkLBSMBRSD_js.newTableElement(chunk7HF5DSE4_js.DEFAULT_TABLE_ROWS, chunk7HF5DSE4_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5582
|
+
id: chunkLBSMBRSD_js.generateElementId()
|
|
5577
5583
|
});
|
|
5578
5584
|
};
|
|
5579
5585
|
const handleAddChart = (chartKind) => {
|
|
5580
5586
|
if (!activeSlide) {
|
|
5581
5587
|
return;
|
|
5582
5588
|
}
|
|
5583
|
-
addElement(
|
|
5589
|
+
addElement(chunkLBSMBRSD_js.createDefaultChartElement(chartKind));
|
|
5584
5590
|
};
|
|
5585
5591
|
const structured = createStructuredElementHandlers({
|
|
5586
5592
|
activeSlide,
|
|
@@ -5650,7 +5656,7 @@ function useClipboardHandlers(input) {
|
|
|
5650
5656
|
if (!selectedElement) {
|
|
5651
5657
|
return;
|
|
5652
5658
|
}
|
|
5653
|
-
setClipboardPayload(
|
|
5659
|
+
setClipboardPayload(chunkLBSMBRSD_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5654
5660
|
};
|
|
5655
5661
|
const handleDelete = () => {
|
|
5656
5662
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5667,7 +5673,7 @@ function useClipboardHandlers(input) {
|
|
|
5667
5673
|
handleDelete();
|
|
5668
5674
|
};
|
|
5669
5675
|
const insertClone = (source) => {
|
|
5670
|
-
const clone =
|
|
5676
|
+
const clone = chunkLBSMBRSD_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5671
5677
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5672
5678
|
ops.applySelection(clone.id);
|
|
5673
5679
|
history.markDirty();
|
|
@@ -5702,7 +5708,7 @@ function resolveShapePath(el) {
|
|
|
5702
5708
|
return el.pathData;
|
|
5703
5709
|
}
|
|
5704
5710
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5705
|
-
const clipPath =
|
|
5711
|
+
const clipPath = chunkLBSMBRSD_js.getPresetShapeClipPath(el.shapeType);
|
|
5706
5712
|
if (clipPath) {
|
|
5707
5713
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5708
5714
|
if (svgPath) {
|
|
@@ -5753,7 +5759,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5753
5759
|
return parts.join(" ");
|
|
5754
5760
|
}
|
|
5755
5761
|
function transformPathToGlobal(pathData, el) {
|
|
5756
|
-
const polys =
|
|
5762
|
+
const polys = chunkLBSMBRSD_js.svgPathToPolygons(pathData);
|
|
5757
5763
|
if (polys.length === 0) {
|
|
5758
5764
|
return pathData;
|
|
5759
5765
|
}
|
|
@@ -5773,10 +5779,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5773
5779
|
y: pt.y * scaleY + el.y
|
|
5774
5780
|
}))
|
|
5775
5781
|
);
|
|
5776
|
-
return
|
|
5782
|
+
return chunkLBSMBRSD_js.polygonsToSvgPath(transformed);
|
|
5777
5783
|
}
|
|
5778
5784
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5779
|
-
const polys =
|
|
5785
|
+
const polys = chunkLBSMBRSD_js.svgPathToPolygons(pathData);
|
|
5780
5786
|
if (polys.length === 0) {
|
|
5781
5787
|
return pathData;
|
|
5782
5788
|
}
|
|
@@ -5786,10 +5792,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5786
5792
|
y: pt.y - y
|
|
5787
5793
|
}))
|
|
5788
5794
|
);
|
|
5789
|
-
return
|
|
5795
|
+
return chunkLBSMBRSD_js.polygonsToSvgPath(transformed);
|
|
5790
5796
|
}
|
|
5791
5797
|
function pathBounds(pathData) {
|
|
5792
|
-
const polys =
|
|
5798
|
+
const polys = chunkLBSMBRSD_js.svgPathToPolygons(pathData);
|
|
5793
5799
|
let minX = Infinity;
|
|
5794
5800
|
let minY = Infinity;
|
|
5795
5801
|
let maxX = -Infinity;
|
|
@@ -5848,7 +5854,7 @@ function useMergeShapesHandler(input) {
|
|
|
5848
5854
|
let allFragments = [];
|
|
5849
5855
|
let remaining = globalPaths[0];
|
|
5850
5856
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5851
|
-
const frags =
|
|
5857
|
+
const frags = chunkLBSMBRSD_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
5852
5858
|
if (Array.isArray(frags)) {
|
|
5853
5859
|
allFragments = frags;
|
|
5854
5860
|
}
|
|
@@ -5877,7 +5883,7 @@ function useMergeShapesHandler(input) {
|
|
|
5877
5883
|
bounds.height
|
|
5878
5884
|
);
|
|
5879
5885
|
const newEl = {
|
|
5880
|
-
id:
|
|
5886
|
+
id: chunkLBSMBRSD_js.generateElementId(),
|
|
5881
5887
|
type: "shape",
|
|
5882
5888
|
x: bounds.x,
|
|
5883
5889
|
y: bounds.y,
|
|
@@ -5915,7 +5921,7 @@ function useMergeShapesHandler(input) {
|
|
|
5915
5921
|
} else {
|
|
5916
5922
|
let resultPath = globalPaths[0];
|
|
5917
5923
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5918
|
-
const result =
|
|
5924
|
+
const result = chunkLBSMBRSD_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
5919
5925
|
if (typeof result === "string") {
|
|
5920
5926
|
resultPath = result;
|
|
5921
5927
|
}
|
|
@@ -5936,7 +5942,7 @@ function useMergeShapesHandler(input) {
|
|
|
5936
5942
|
);
|
|
5937
5943
|
const primary = targets[0];
|
|
5938
5944
|
const newEl = {
|
|
5939
|
-
id:
|
|
5945
|
+
id: chunkLBSMBRSD_js.generateElementId(),
|
|
5940
5946
|
type: "shape",
|
|
5941
5947
|
x: bounds.x,
|
|
5942
5948
|
y: bounds.y,
|
|
@@ -5999,7 +6005,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5999
6005
|
if (ids.length < 2 || !activeSlide) {
|
|
6000
6006
|
return;
|
|
6001
6007
|
}
|
|
6002
|
-
const { elements, groupId } =
|
|
6008
|
+
const { elements, groupId } = chunkLBSMBRSD_js.groupElements(ops.activeElements, ids, chunkLBSMBRSD_js.generateElementId());
|
|
6003
6009
|
if (groupId === null) {
|
|
6004
6010
|
return;
|
|
6005
6011
|
}
|
|
@@ -6012,11 +6018,11 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6012
6018
|
return;
|
|
6013
6019
|
}
|
|
6014
6020
|
const group = selectedElement;
|
|
6015
|
-
const intoTemplate =
|
|
6021
|
+
const intoTemplate = chunkLBSMBRSD_js.isTemplateElementId(group.id);
|
|
6016
6022
|
const childIds = group.children.map(
|
|
6017
|
-
(child) => intoTemplate ?
|
|
6023
|
+
(child) => intoTemplate ? chunkLBSMBRSD_js.makeCloneId(true, child.id || group.id) : child.id || chunkLBSMBRSD_js.generateElementId()
|
|
6018
6024
|
);
|
|
6019
|
-
const { elements, childIds: usedIds } =
|
|
6025
|
+
const { elements, childIds: usedIds } = chunkLBSMBRSD_js.ungroupElements(
|
|
6020
6026
|
ops.activeElements,
|
|
6021
6027
|
group.id,
|
|
6022
6028
|
childIds,
|
|
@@ -6045,7 +6051,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6045
6051
|
if (!edge) {
|
|
6046
6052
|
return;
|
|
6047
6053
|
}
|
|
6048
|
-
const positions =
|
|
6054
|
+
const positions = chunkLBSMBRSD_js.alignElements(selectedElements, edge);
|
|
6049
6055
|
for (const [id, pos] of positions) {
|
|
6050
6056
|
const el = elementLookup.get(id);
|
|
6051
6057
|
if (!el) {
|
|
@@ -6063,7 +6069,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6063
6069
|
if (!distAxis) {
|
|
6064
6070
|
return;
|
|
6065
6071
|
}
|
|
6066
|
-
const positions =
|
|
6072
|
+
const positions = chunkLBSMBRSD_js.distributeElements(selectedElements, distAxis);
|
|
6067
6073
|
for (const [id, pos] of positions) {
|
|
6068
6074
|
const el = elementLookup.get(id);
|
|
6069
6075
|
if (!el) {
|
|
@@ -6080,7 +6086,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6080
6086
|
}
|
|
6081
6087
|
const id = selectedElement.id;
|
|
6082
6088
|
ops.updateActiveElements(
|
|
6083
|
-
(els) => direction === "forward" ?
|
|
6089
|
+
(els) => direction === "forward" ? chunkLBSMBRSD_js.bringForward(els, id) : direction === "backward" ? chunkLBSMBRSD_js.sendBackward(els, id) : els
|
|
6084
6090
|
);
|
|
6085
6091
|
history.markDirty();
|
|
6086
6092
|
};
|
|
@@ -6090,7 +6096,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6090
6096
|
}
|
|
6091
6097
|
const id = selectedElement.id;
|
|
6092
6098
|
ops.updateActiveElements(
|
|
6093
|
-
(els) => direction === "front" ?
|
|
6099
|
+
(els) => direction === "front" ? chunkLBSMBRSD_js.bringToFront(els, id) : chunkLBSMBRSD_js.sendToBack(els, id)
|
|
6094
6100
|
);
|
|
6095
6101
|
history.markDirty();
|
|
6096
6102
|
};
|
|
@@ -6221,7 +6227,7 @@ function useSlideManagement(input) {
|
|
|
6221
6227
|
theme
|
|
6222
6228
|
} = input;
|
|
6223
6229
|
const handleAddSlide = () => {
|
|
6224
|
-
const newSlide =
|
|
6230
|
+
const newSlide = chunkLBSMBRSD_js.createBlankSlide(slides.length + 1);
|
|
6225
6231
|
ops.updateSlides((prev) => {
|
|
6226
6232
|
const next = [...prev];
|
|
6227
6233
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6284,7 +6290,7 @@ function useSlideManagement(input) {
|
|
|
6284
6290
|
}
|
|
6285
6291
|
const clone = {
|
|
6286
6292
|
...src,
|
|
6287
|
-
id:
|
|
6293
|
+
id: chunkLBSMBRSD_js.makeSlideId(),
|
|
6288
6294
|
elements: src.elements.map((el) => ({
|
|
6289
6295
|
...el,
|
|
6290
6296
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6316,7 +6322,7 @@ function useSlideManagement(input) {
|
|
|
6316
6322
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6317
6323
|
const insertAt = activeSlideIndex + 1;
|
|
6318
6324
|
const draft = {
|
|
6319
|
-
...
|
|
6325
|
+
...chunkLBSMBRSD_js.createBlankSlide(slides.length + 1),
|
|
6320
6326
|
layoutPath,
|
|
6321
6327
|
...layoutName ? { layoutName } : {}
|
|
6322
6328
|
};
|
|
@@ -6349,9 +6355,9 @@ function useSlideManagement(input) {
|
|
|
6349
6355
|
};
|
|
6350
6356
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6351
6357
|
const insertAt = activeSlideIndex + 1;
|
|
6352
|
-
const draft =
|
|
6358
|
+
const draft = chunkLBSMBRSD_js.buildSlideTemplateSlide(templateId, chunkLBSMBRSD_js.makeSlideId(), slides.length + 1, {
|
|
6353
6359
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6354
|
-
scheme:
|
|
6360
|
+
scheme: chunkLBSMBRSD_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6355
6361
|
});
|
|
6356
6362
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6357
6363
|
setActiveSlideIndex(insertAt);
|
|
@@ -6388,7 +6394,7 @@ function createTableMergeHandlers(input) {
|
|
|
6388
6394
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6389
6395
|
return;
|
|
6390
6396
|
}
|
|
6391
|
-
const newTableData =
|
|
6397
|
+
const newTableData = chunkLBSMBRSD_js.mergeCells(
|
|
6392
6398
|
[
|
|
6393
6399
|
{ row: rowIndex, col: columnIndex },
|
|
6394
6400
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6396,7 +6402,7 @@ function createTableMergeHandlers(input) {
|
|
|
6396
6402
|
td
|
|
6397
6403
|
);
|
|
6398
6404
|
const updates = { tableData: newTableData };
|
|
6399
|
-
const newRawXml =
|
|
6405
|
+
const newRawXml = chunkLBSMBRSD_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6400
6406
|
if (newRawXml) {
|
|
6401
6407
|
updates.rawXml = newRawXml;
|
|
6402
6408
|
}
|
|
@@ -6422,7 +6428,7 @@ function createTableMergeHandlers(input) {
|
|
|
6422
6428
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6423
6429
|
return;
|
|
6424
6430
|
}
|
|
6425
|
-
const newTableData =
|
|
6431
|
+
const newTableData = chunkLBSMBRSD_js.mergeCells(
|
|
6426
6432
|
[
|
|
6427
6433
|
{ row: rowIndex, col: columnIndex },
|
|
6428
6434
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6430,7 +6436,7 @@ function createTableMergeHandlers(input) {
|
|
|
6430
6436
|
td
|
|
6431
6437
|
);
|
|
6432
6438
|
const updates = { tableData: newTableData };
|
|
6433
|
-
const newRawXml =
|
|
6439
|
+
const newRawXml = chunkLBSMBRSD_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6434
6440
|
if (newRawXml) {
|
|
6435
6441
|
updates.rawXml = newRawXml;
|
|
6436
6442
|
}
|
|
@@ -6445,9 +6451,9 @@ function createTableMergeHandlers(input) {
|
|
|
6445
6451
|
return;
|
|
6446
6452
|
}
|
|
6447
6453
|
const td = selectedElement.tableData;
|
|
6448
|
-
const newTableData =
|
|
6454
|
+
const newTableData = chunkLBSMBRSD_js.mergeCells(ts.selectedCells, td);
|
|
6449
6455
|
const updates = { tableData: newTableData };
|
|
6450
|
-
const newRawXml =
|
|
6456
|
+
const newRawXml = chunkLBSMBRSD_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6451
6457
|
if (newRawXml) {
|
|
6452
6458
|
updates.rawXml = newRawXml;
|
|
6453
6459
|
}
|
|
@@ -6464,9 +6470,9 @@ function createTableMergeHandlers(input) {
|
|
|
6464
6470
|
}
|
|
6465
6471
|
const { rowIndex, columnIndex } = ts;
|
|
6466
6472
|
const td = selectedElement.tableData;
|
|
6467
|
-
const newTableData =
|
|
6473
|
+
const newTableData = chunkLBSMBRSD_js.splitCell(rowIndex, columnIndex, td);
|
|
6468
6474
|
const updates = { tableData: newTableData };
|
|
6469
|
-
const newRawXml =
|
|
6475
|
+
const newRawXml = chunkLBSMBRSD_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6470
6476
|
if (newRawXml) {
|
|
6471
6477
|
updates.rawXml = newRawXml;
|
|
6472
6478
|
}
|
|
@@ -6498,10 +6504,10 @@ function createTableStructHandlers(input) {
|
|
|
6498
6504
|
}
|
|
6499
6505
|
const updates = {};
|
|
6500
6506
|
if (el.tableData) {
|
|
6501
|
-
updates.tableData =
|
|
6507
|
+
updates.tableData = chunkLBSMBRSD_js.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
6502
6508
|
}
|
|
6503
6509
|
if (el.rawXml) {
|
|
6504
|
-
const newRawXml =
|
|
6510
|
+
const newRawXml = chunkLBSMBRSD_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6505
6511
|
if (newRawXml) {
|
|
6506
6512
|
updates.rawXml = newRawXml;
|
|
6507
6513
|
}
|
|
@@ -6525,7 +6531,7 @@ function createTableStructHandlers(input) {
|
|
|
6525
6531
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6526
6532
|
const updates = {};
|
|
6527
6533
|
if (selectedElement.rawXml) {
|
|
6528
|
-
const newRawXml =
|
|
6534
|
+
const newRawXml = chunkLBSMBRSD_js.updateCellTextStyleInRawXml(
|
|
6529
6535
|
selectedElement,
|
|
6530
6536
|
rowIndex,
|
|
6531
6537
|
colIndex,
|
|
@@ -6589,9 +6595,9 @@ function createTableStructHandlers(input) {
|
|
|
6589
6595
|
return;
|
|
6590
6596
|
}
|
|
6591
6597
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6592
|
-
const newTableData =
|
|
6598
|
+
const newTableData = chunkLBSMBRSD_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6593
6599
|
const updates = { tableData: newTableData };
|
|
6594
|
-
const newRawXml =
|
|
6600
|
+
const newRawXml = chunkLBSMBRSD_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6595
6601
|
if (newRawXml) {
|
|
6596
6602
|
updates.rawXml = newRawXml;
|
|
6597
6603
|
}
|
|
@@ -6604,12 +6610,12 @@ function createTableStructHandlers(input) {
|
|
|
6604
6610
|
}
|
|
6605
6611
|
const td = selectedElement.tableData;
|
|
6606
6612
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6607
|
-
const newTableData =
|
|
6613
|
+
const newTableData = chunkLBSMBRSD_js.deleteTableRow(td, rowIdx);
|
|
6608
6614
|
if (newTableData === td) {
|
|
6609
6615
|
return;
|
|
6610
6616
|
}
|
|
6611
6617
|
const updates = { tableData: newTableData };
|
|
6612
|
-
const newRawXml =
|
|
6618
|
+
const newRawXml = chunkLBSMBRSD_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6613
6619
|
if (newRawXml) {
|
|
6614
6620
|
updates.rawXml = newRawXml;
|
|
6615
6621
|
}
|
|
@@ -6621,9 +6627,9 @@ function createTableStructHandlers(input) {
|
|
|
6621
6627
|
return;
|
|
6622
6628
|
}
|
|
6623
6629
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6624
|
-
const newTableData =
|
|
6630
|
+
const newTableData = chunkLBSMBRSD_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6625
6631
|
const updates = { tableData: newTableData };
|
|
6626
|
-
const newRawXml =
|
|
6632
|
+
const newRawXml = chunkLBSMBRSD_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6627
6633
|
if (newRawXml) {
|
|
6628
6634
|
updates.rawXml = newRawXml;
|
|
6629
6635
|
}
|
|
@@ -6636,12 +6642,12 @@ function createTableStructHandlers(input) {
|
|
|
6636
6642
|
}
|
|
6637
6643
|
const td = selectedElement.tableData;
|
|
6638
6644
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6639
|
-
const newTableData =
|
|
6645
|
+
const newTableData = chunkLBSMBRSD_js.deleteTableColumn(td, colIdx);
|
|
6640
6646
|
if (newTableData === td) {
|
|
6641
6647
|
return;
|
|
6642
6648
|
}
|
|
6643
6649
|
const updates = { tableData: newTableData };
|
|
6644
|
-
const newRawXml =
|
|
6650
|
+
const newRawXml = chunkLBSMBRSD_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6645
6651
|
if (newRawXml) {
|
|
6646
6652
|
updates.rawXml = newRawXml;
|
|
6647
6653
|
}
|
|
@@ -6677,8 +6683,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6677
6683
|
return html2canvasPro(element, {
|
|
6678
6684
|
...options,
|
|
6679
6685
|
onclone: async (doc, clonedEl) => {
|
|
6680
|
-
await
|
|
6681
|
-
|
|
6686
|
+
await chunkLBSMBRSD_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6687
|
+
chunkLBSMBRSD_js.preprocessCssForCapture(clonedEl);
|
|
6682
6688
|
if (typeof userOnClone === "function") {
|
|
6683
6689
|
userOnClone(doc, clonedEl);
|
|
6684
6690
|
}
|
|
@@ -6734,7 +6740,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
6734
6740
|
}
|
|
6735
6741
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
6736
6742
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
6737
|
-
|
|
6743
|
+
chunkLBSMBRSD_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
6738
6744
|
}
|
|
6739
6745
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
6740
6746
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -6756,15 +6762,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6756
6762
|
continue;
|
|
6757
6763
|
}
|
|
6758
6764
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
6759
|
-
images.push(
|
|
6765
|
+
images.push(chunkLBSMBRSD_js.canvasToJpegData(canvas));
|
|
6760
6766
|
}
|
|
6761
6767
|
onProgress?.(totalSlides, totalSlides);
|
|
6762
6768
|
setActiveSlide(currentSlideIndex);
|
|
6763
6769
|
if (images.length === 0) {
|
|
6764
6770
|
throw new Error(chunk6CPUGAK7_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
6765
6771
|
}
|
|
6766
|
-
const pdfBlobUrl =
|
|
6767
|
-
|
|
6772
|
+
const pdfBlobUrl = chunk7HF5DSE4_js.buildPdfFromImageData(images);
|
|
6773
|
+
chunkLBSMBRSD_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
6768
6774
|
}
|
|
6769
6775
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
6770
6776
|
const { scale = 2, onProgress } = options;
|
|
@@ -6812,8 +6818,8 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
6812
6818
|
if (pages.length === 0) {
|
|
6813
6819
|
throw new Error(chunk6CPUGAK7_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
6814
6820
|
}
|
|
6815
|
-
const pdfDataUrl =
|
|
6816
|
-
|
|
6821
|
+
const pdfDataUrl = chunk7HF5DSE4_js.buildNotesPdf(pages);
|
|
6822
|
+
chunkLBSMBRSD_js.downloadDataUrl(pdfDataUrl, filename);
|
|
6817
6823
|
}
|
|
6818
6824
|
|
|
6819
6825
|
// src/viewer/utils/export-video.ts
|
|
@@ -6857,7 +6863,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6857
6863
|
const fps = 30;
|
|
6858
6864
|
const stream = recordingCanvas.captureStream(fps);
|
|
6859
6865
|
const recorder = new MediaRecorder(stream, {
|
|
6860
|
-
mimeType:
|
|
6866
|
+
mimeType: chunkLBSMBRSD_js.pickSupportedMimeType([...chunkLBSMBRSD_js.WEBM_MIME_CANDIDATES]),
|
|
6861
6867
|
videoBitsPerSecond: 5e6
|
|
6862
6868
|
});
|
|
6863
6869
|
const chunks = [];
|
|
@@ -6880,8 +6886,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6880
6886
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
6881
6887
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
6882
6888
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
6883
|
-
const frameInterval =
|
|
6884
|
-
const framesNeeded =
|
|
6889
|
+
const frameInterval = chunkLBSMBRSD_js.fpsToFrameIntervalMs(fps);
|
|
6890
|
+
const framesNeeded = chunkLBSMBRSD_js.segmentFrameCount(duration, fps);
|
|
6885
6891
|
for (let f = 0; f < framesNeeded; f++) {
|
|
6886
6892
|
if (signal?.aborted) {
|
|
6887
6893
|
recorder.stop();
|
|
@@ -6930,7 +6936,7 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6930
6936
|
if (frames.length === 0) {
|
|
6931
6937
|
throw new Error(chunk6CPUGAK7_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
6932
6938
|
}
|
|
6933
|
-
const gifBytes =
|
|
6939
|
+
const gifBytes = chunkLBSMBRSD_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
6934
6940
|
onProgress?.(totalSlides, totalSlides);
|
|
6935
6941
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
6936
6942
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -6984,7 +6990,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
6984
6990
|
continue;
|
|
6985
6991
|
}
|
|
6986
6992
|
onProgress?.(processedCount, data.slides.length);
|
|
6987
|
-
let svg =
|
|
6993
|
+
let svg = chunkLBSMBRSD_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
6988
6994
|
if (embedFonts && fontFaces?.length) {
|
|
6989
6995
|
svg = injectFontFaces(svg, fontFaces);
|
|
6990
6996
|
}
|
|
@@ -7042,13 +7048,13 @@ function useExportSaveAs(input) {
|
|
|
7042
7048
|
setExportProgress(10);
|
|
7043
7049
|
setExportStatusMessage("Adding presentation...");
|
|
7044
7050
|
const pptxData = await serializeSlides();
|
|
7045
|
-
const pptxFilename =
|
|
7051
|
+
const pptxFilename = chunkLBSMBRSD_js.savedPresentationFileName(filePath);
|
|
7046
7052
|
if (pptxData) {
|
|
7047
7053
|
pkgFolder.file(pptxFilename, pptxData);
|
|
7048
7054
|
}
|
|
7049
7055
|
setExportProgress(70);
|
|
7050
7056
|
setExportStatusMessage("Writing README...");
|
|
7051
|
-
const readme =
|
|
7057
|
+
const readme = chunkLBSMBRSD_js.generatePackageReadme(pptxFilename);
|
|
7052
7058
|
pkgFolder.file("README.txt", readme);
|
|
7053
7059
|
if (abortCtrl.signal.aborted) {
|
|
7054
7060
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -7058,7 +7064,7 @@ function useExportSaveAs(input) {
|
|
|
7058
7064
|
const zipBlob = await zip.generateAsync({ type: "blob" });
|
|
7059
7065
|
setExportProgress(95);
|
|
7060
7066
|
setExportStatusMessage("Downloading...");
|
|
7061
|
-
|
|
7067
|
+
chunkLBSMBRSD_js.downloadBlob(zipBlob, `${chunkLBSMBRSD_js.presentationBaseName(pptxFilename)}-package.zip`);
|
|
7062
7068
|
setExportProgress(100);
|
|
7063
7069
|
} catch (err) {
|
|
7064
7070
|
if (err.name !== "AbortError") {
|
|
@@ -7074,13 +7080,13 @@ function useExportSaveAs(input) {
|
|
|
7074
7080
|
if (!handler) {
|
|
7075
7081
|
return;
|
|
7076
7082
|
}
|
|
7077
|
-
const downloadName =
|
|
7083
|
+
const downloadName = chunkLBSMBRSD_js.savedPresentationFileName(filePath, format);
|
|
7078
7084
|
try {
|
|
7079
7085
|
const data = await buildSaveAsData(handler, format);
|
|
7080
7086
|
const blob = new Blob([data], {
|
|
7081
7087
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
7082
7088
|
});
|
|
7083
|
-
|
|
7089
|
+
chunkLBSMBRSD_js.downloadBlob(blob, downloadName);
|
|
7084
7090
|
} catch (err) {
|
|
7085
7091
|
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
7086
7092
|
}
|
|
@@ -7093,18 +7099,18 @@ function useExportSaveAs(input) {
|
|
|
7093
7099
|
const pptxGuides = guides.map((g) => ({
|
|
7094
7100
|
id: g.id,
|
|
7095
7101
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
7096
|
-
positionEmu:
|
|
7102
|
+
positionEmu: chunkLBSMBRSD_js.guidePxToEmu(g.position)
|
|
7097
7103
|
}));
|
|
7098
7104
|
return {
|
|
7099
7105
|
...slide,
|
|
7100
7106
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
7101
7107
|
};
|
|
7102
7108
|
});
|
|
7103
|
-
const slidesToSave =
|
|
7109
|
+
const slidesToSave = chunkLBSMBRSD_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
7104
7110
|
const saveOptions = {
|
|
7105
7111
|
// Save As shares Save's slide-size decision; leaving it out here is how
|
|
7106
7112
|
// a preset picked in the inspector reached one save path and not the other.
|
|
7107
|
-
slideSize:
|
|
7113
|
+
slideSize: chunkLBSMBRSD_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
7108
7114
|
headerFooter,
|
|
7109
7115
|
presentationProperties,
|
|
7110
7116
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -7118,13 +7124,13 @@ function useExportSaveAs(input) {
|
|
|
7118
7124
|
handoutMaster,
|
|
7119
7125
|
outputFormat: format
|
|
7120
7126
|
};
|
|
7121
|
-
return
|
|
7127
|
+
return chunkLBSMBRSD_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
|
|
7122
7128
|
};
|
|
7123
7129
|
const handleExportJson = () => {
|
|
7124
7130
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7125
|
-
const slideSize =
|
|
7131
|
+
const slideSize = chunkLBSMBRSD_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
7126
7132
|
const data = {
|
|
7127
|
-
slides:
|
|
7133
|
+
slides: chunkLBSMBRSD_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7128
7134
|
width: canvasSize.width,
|
|
7129
7135
|
height: canvasSize.height,
|
|
7130
7136
|
widthEmu: slideSize.widthEmu,
|
|
@@ -7143,7 +7149,7 @@ function useExportSaveAs(input) {
|
|
|
7143
7149
|
handoutMaster
|
|
7144
7150
|
};
|
|
7145
7151
|
try {
|
|
7146
|
-
|
|
7152
|
+
chunkLBSMBRSD_js.exportDeckJson(data, sourceName);
|
|
7147
7153
|
} catch (err) {
|
|
7148
7154
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7149
7155
|
}
|
|
@@ -7183,7 +7189,7 @@ function safeConfirm(message) {
|
|
|
7183
7189
|
}
|
|
7184
7190
|
}
|
|
7185
7191
|
function downloadBlob2(blob, filename) {
|
|
7186
|
-
|
|
7192
|
+
chunkLBSMBRSD_js.downloadBlob(blob, chunkLBSMBRSD_js.sanitizeDownloadFilename(filename));
|
|
7187
7193
|
}
|
|
7188
7194
|
|
|
7189
7195
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -7293,21 +7299,21 @@ function useExportHandlers(input) {
|
|
|
7293
7299
|
{
|
|
7294
7300
|
scale: 2,
|
|
7295
7301
|
onProgress: (current, total) => {
|
|
7296
|
-
setExportProgress(
|
|
7297
|
-
setExportStatusMessage(
|
|
7302
|
+
setExportProgress(chunkLBSMBRSD_js.slideProgressPercent(current, total));
|
|
7303
|
+
setExportStatusMessage(chunkLBSMBRSD_js.slideStatusLabel("Rendering", current, total));
|
|
7298
7304
|
},
|
|
7299
7305
|
signal: abortCtrl.signal
|
|
7300
7306
|
}
|
|
7301
7307
|
);
|
|
7302
|
-
setExportProgress(
|
|
7308
|
+
setExportProgress(chunkLBSMBRSD_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7303
7309
|
setExportStatusMessage("Building PDF...");
|
|
7304
7310
|
await new Promise((r) => {
|
|
7305
7311
|
setTimeout(r, 100);
|
|
7306
7312
|
});
|
|
7307
|
-
setExportProgress(
|
|
7313
|
+
setExportProgress(chunkLBSMBRSD_js.EXPORT_DONE_PERCENT);
|
|
7308
7314
|
setExportStatusMessage("Done!");
|
|
7309
7315
|
} catch (err) {
|
|
7310
|
-
if (!
|
|
7316
|
+
if (!chunkLBSMBRSD_js.isExportAbortError(err)) {
|
|
7311
7317
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7312
7318
|
}
|
|
7313
7319
|
} finally {
|
|
@@ -7337,21 +7343,21 @@ function useExportHandlers(input) {
|
|
|
7337
7343
|
{
|
|
7338
7344
|
scale: 2,
|
|
7339
7345
|
onProgress: (current, total) => {
|
|
7340
|
-
setExportProgress(
|
|
7341
|
-
setExportStatusMessage(
|
|
7346
|
+
setExportProgress(chunkLBSMBRSD_js.slideProgressPercent(current, total));
|
|
7347
|
+
setExportStatusMessage(chunkLBSMBRSD_js.slideStatusLabel("Rendering", current, total));
|
|
7342
7348
|
},
|
|
7343
7349
|
signal: abortCtrl.signal
|
|
7344
7350
|
}
|
|
7345
7351
|
);
|
|
7346
|
-
setExportProgress(
|
|
7352
|
+
setExportProgress(chunkLBSMBRSD_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7347
7353
|
setExportStatusMessage("Building PDF...");
|
|
7348
7354
|
await new Promise((r) => {
|
|
7349
7355
|
setTimeout(r, 100);
|
|
7350
7356
|
});
|
|
7351
|
-
setExportProgress(
|
|
7357
|
+
setExportProgress(chunkLBSMBRSD_js.EXPORT_DONE_PERCENT);
|
|
7352
7358
|
setExportStatusMessage("Done!");
|
|
7353
7359
|
} catch (err) {
|
|
7354
|
-
if (!
|
|
7360
|
+
if (!chunkLBSMBRSD_js.isExportAbortError(err)) {
|
|
7355
7361
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7356
7362
|
}
|
|
7357
7363
|
} finally {
|
|
@@ -7392,22 +7398,22 @@ function useExportHandlers(input) {
|
|
|
7392
7398
|
scale: 1,
|
|
7393
7399
|
slideDurationMs: 3e3,
|
|
7394
7400
|
onProgress: (current, total) => {
|
|
7395
|
-
setExportProgress(
|
|
7396
|
-
setExportStatusMessage(
|
|
7401
|
+
setExportProgress(chunkLBSMBRSD_js.slideProgressPercent(current, total, 45));
|
|
7402
|
+
setExportStatusMessage(chunkLBSMBRSD_js.slideStatusLabel("Capturing", current, total));
|
|
7397
7403
|
},
|
|
7398
7404
|
onRecordProgress: (current, total) => {
|
|
7399
|
-
setExportProgress(
|
|
7400
|
-
setExportStatusMessage(
|
|
7405
|
+
setExportProgress(chunkLBSMBRSD_js.recordProgressPercent(current, total));
|
|
7406
|
+
setExportStatusMessage(chunkLBSMBRSD_js.slideStatusLabel("Recording", current, total));
|
|
7401
7407
|
},
|
|
7402
7408
|
signal: abortCtrl.signal
|
|
7403
7409
|
}
|
|
7404
7410
|
);
|
|
7405
|
-
setExportProgress(
|
|
7411
|
+
setExportProgress(chunkLBSMBRSD_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7406
7412
|
setExportStatusMessage("Saving file...");
|
|
7407
7413
|
downloadBlob2(blob, "presentation.webm");
|
|
7408
|
-
setExportProgress(
|
|
7414
|
+
setExportProgress(chunkLBSMBRSD_js.EXPORT_DONE_PERCENT);
|
|
7409
7415
|
} catch (err) {
|
|
7410
|
-
if (!
|
|
7416
|
+
if (!chunkLBSMBRSD_js.isExportAbortError(err)) {
|
|
7411
7417
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7412
7418
|
}
|
|
7413
7419
|
} finally {
|
|
@@ -7435,18 +7441,18 @@ function useExportHandlers(input) {
|
|
|
7435
7441
|
scale: 0.5,
|
|
7436
7442
|
slideDurationMs: 2e3,
|
|
7437
7443
|
onProgress: (current, total) => {
|
|
7438
|
-
setExportProgress(
|
|
7439
|
-
setExportStatusMessage(
|
|
7444
|
+
setExportProgress(chunkLBSMBRSD_js.slideProgressPercent(current, total));
|
|
7445
|
+
setExportStatusMessage(chunkLBSMBRSD_js.slideStatusLabel("Encoding", current, total));
|
|
7440
7446
|
},
|
|
7441
7447
|
signal: abortCtrl.signal
|
|
7442
7448
|
}
|
|
7443
7449
|
);
|
|
7444
|
-
setExportProgress(
|
|
7450
|
+
setExportProgress(chunkLBSMBRSD_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7445
7451
|
setExportStatusMessage("Saving file...");
|
|
7446
7452
|
downloadBlob2(blob, "presentation.gif");
|
|
7447
|
-
setExportProgress(
|
|
7453
|
+
setExportProgress(chunkLBSMBRSD_js.EXPORT_DONE_PERCENT);
|
|
7448
7454
|
} catch (err) {
|
|
7449
|
-
if (!
|
|
7455
|
+
if (!chunkLBSMBRSD_js.isExportAbortError(err)) {
|
|
7450
7456
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7451
7457
|
}
|
|
7452
7458
|
} finally {
|
|
@@ -7487,7 +7493,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
7487
7493
|
}
|
|
7488
7494
|
printWindow.document.open();
|
|
7489
7495
|
printWindow.document.write(
|
|
7490
|
-
|
|
7496
|
+
chunkLBSMBRSD_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
7491
7497
|
);
|
|
7492
7498
|
printWindow.document.close();
|
|
7493
7499
|
printWindow.focus();
|
|
@@ -7521,8 +7527,8 @@ function usePrintHandlers(input) {
|
|
|
7521
7527
|
if (!pptxData || settings.printWhat !== "slides") {
|
|
7522
7528
|
return handlePrintWithSettings(settings);
|
|
7523
7529
|
}
|
|
7524
|
-
const colorFilter =
|
|
7525
|
-
const slideIndices =
|
|
7530
|
+
const colorFilter = chunkLBSMBRSD_js.computeColorFilter(settings.colorMode);
|
|
7531
|
+
const slideIndices = chunkLBSMBRSD_js.computeSlideIndices(
|
|
7526
7532
|
settings.slideRange,
|
|
7527
7533
|
activeSlideIndex,
|
|
7528
7534
|
slides.length,
|
|
@@ -7536,7 +7542,7 @@ function usePrintHandlers(input) {
|
|
|
7536
7542
|
if (svgs.length === 0) {
|
|
7537
7543
|
return;
|
|
7538
7544
|
}
|
|
7539
|
-
const printDoc =
|
|
7545
|
+
const printDoc = chunkLBSMBRSD_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7540
7546
|
title: "Slides (Vector)",
|
|
7541
7547
|
orientation: settings.orientation,
|
|
7542
7548
|
colorFilter
|
|
@@ -7549,8 +7555,8 @@ function usePrintHandlers(input) {
|
|
|
7549
7555
|
};
|
|
7550
7556
|
const handlePrintWithSettings = async (settings) => {
|
|
7551
7557
|
setIsPrintDialogOpen(false);
|
|
7552
|
-
const colorFilter =
|
|
7553
|
-
const slideIndices =
|
|
7558
|
+
const colorFilter = chunkLBSMBRSD_js.computeColorFilter(settings.colorMode);
|
|
7559
|
+
const slideIndices = chunkLBSMBRSD_js.computeSlideIndices(
|
|
7554
7560
|
settings.slideRange,
|
|
7555
7561
|
activeSlideIndex,
|
|
7556
7562
|
slides.length,
|
|
@@ -7560,7 +7566,7 @@ function usePrintHandlers(input) {
|
|
|
7560
7566
|
if (settings.printWhat === "outline") {
|
|
7561
7567
|
openPrintWindow(
|
|
7562
7568
|
"Outline",
|
|
7563
|
-
`<div class="outline-page">${
|
|
7569
|
+
`<div class="outline-page">${chunkLBSMBRSD_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7564
7570
|
settings.orientation,
|
|
7565
7571
|
colorFilter,
|
|
7566
7572
|
settings.frameSlides
|
|
@@ -7585,7 +7591,7 @@ function usePrintHandlers(input) {
|
|
|
7585
7591
|
if (settings.printWhat === "slides") {
|
|
7586
7592
|
openPrintWindow(
|
|
7587
7593
|
"Slides",
|
|
7588
|
-
|
|
7594
|
+
chunkLBSMBRSD_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7589
7595
|
settings.orientation,
|
|
7590
7596
|
colorFilter,
|
|
7591
7597
|
settings.frameSlides
|
|
@@ -7595,7 +7601,7 @@ function usePrintHandlers(input) {
|
|
|
7595
7601
|
if (settings.printWhat === "notes") {
|
|
7596
7602
|
openPrintWindow(
|
|
7597
7603
|
"Notes Pages",
|
|
7598
|
-
|
|
7604
|
+
chunkLBSMBRSD_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7599
7605
|
"portrait",
|
|
7600
7606
|
colorFilter,
|
|
7601
7607
|
settings.frameSlides
|
|
@@ -7606,7 +7612,7 @@ function usePrintHandlers(input) {
|
|
|
7606
7612
|
const spp = settings.slidesPerPage;
|
|
7607
7613
|
openPrintWindow(
|
|
7608
7614
|
`Handout ${spp} per page`,
|
|
7609
|
-
|
|
7615
|
+
chunkLBSMBRSD_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
7610
7616
|
"portrait",
|
|
7611
7617
|
colorFilter,
|
|
7612
7618
|
settings.frameSlides
|
|
@@ -7670,8 +7676,8 @@ function useThemeHandlers(input) {
|
|
|
7670
7676
|
return;
|
|
7671
7677
|
}
|
|
7672
7678
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7673
|
-
const previousMap = theme?.colorScheme ?
|
|
7674
|
-
setSlides((prev) =>
|
|
7679
|
+
const previousMap = theme?.colorScheme ? chunkLBSMBRSD_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7680
|
+
setSlides((prev) => chunkLBSMBRSD_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7675
7681
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7676
7682
|
bumpHistory();
|
|
7677
7683
|
history.markDirty();
|
|
@@ -7776,7 +7782,7 @@ function useThemeSwitching(input) {
|
|
|
7776
7782
|
}
|
|
7777
7783
|
try {
|
|
7778
7784
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7779
|
-
const newData =
|
|
7785
|
+
const newData = chunkLBSMBRSD_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7780
7786
|
onDataChange(newData);
|
|
7781
7787
|
onThemeChanged?.(preset);
|
|
7782
7788
|
} catch (error) {
|
|
@@ -7793,7 +7799,7 @@ function useThemeSwitching(input) {
|
|
|
7793
7799
|
}
|
|
7794
7800
|
try {
|
|
7795
7801
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7796
|
-
const newData =
|
|
7802
|
+
const newData = chunkLBSMBRSD_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7797
7803
|
onDataChange(newData);
|
|
7798
7804
|
} catch (error) {
|
|
7799
7805
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7805,12 +7811,12 @@ function useThemeSwitching(input) {
|
|
|
7805
7811
|
if (!data?.theme?.colorScheme) {
|
|
7806
7812
|
return void 0;
|
|
7807
7813
|
}
|
|
7808
|
-
return
|
|
7809
|
-
(p) =>
|
|
7814
|
+
return chunkLBSMBRSD_js.THEME_PRESETS.find(
|
|
7815
|
+
(p) => chunkLBSMBRSD_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7810
7816
|
);
|
|
7811
7817
|
}, [data?.theme?.colorScheme]);
|
|
7812
7818
|
return {
|
|
7813
|
-
presets:
|
|
7819
|
+
presets: chunkLBSMBRSD_js.THEME_PRESETS,
|
|
7814
7820
|
switchToPreset,
|
|
7815
7821
|
switchToCustom,
|
|
7816
7822
|
currentPreset
|
|
@@ -7885,7 +7891,7 @@ function usePropertyHandlers(input) {
|
|
|
7885
7891
|
}
|
|
7886
7892
|
try {
|
|
7887
7893
|
const ab = await file.arrayBuffer();
|
|
7888
|
-
const h = new
|
|
7894
|
+
const h = new chunkLBSMBRSD_js.PptxHandler();
|
|
7889
7895
|
const other = await h.load(ab);
|
|
7890
7896
|
if (!other) {
|
|
7891
7897
|
return;
|
|
@@ -7895,7 +7901,7 @@ function usePropertyHandlers(input) {
|
|
|
7895
7901
|
width: canvasSize.width,
|
|
7896
7902
|
height: canvasSize.height
|
|
7897
7903
|
};
|
|
7898
|
-
setCompareResult(
|
|
7904
|
+
setCompareResult(chunkLBSMBRSD_js.comparePresentation(cur, other));
|
|
7899
7905
|
setIsComparePanelOpen(true);
|
|
7900
7906
|
} catch (err) {
|
|
7901
7907
|
console.warn("Compare failed:", err);
|
|
@@ -7912,7 +7918,7 @@ function usePropertyHandlers(input) {
|
|
|
7912
7918
|
if (!diff || diff.status === "unchanged") {
|
|
7913
7919
|
return;
|
|
7914
7920
|
}
|
|
7915
|
-
setSlides((prev) =>
|
|
7921
|
+
setSlides((prev) => chunkLBSMBRSD_js.applyAcceptSlide(prev, diff));
|
|
7916
7922
|
setIsDirty(true);
|
|
7917
7923
|
},
|
|
7918
7924
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -7923,10 +7929,10 @@ function usePropertyHandlers(input) {
|
|
|
7923
7929
|
if (!compareResult) {
|
|
7924
7930
|
return;
|
|
7925
7931
|
}
|
|
7926
|
-
setSlides((prev) =>
|
|
7932
|
+
setSlides((prev) => chunkLBSMBRSD_js.applyAcceptAllSlides(prev, compareResult));
|
|
7927
7933
|
setIsDirty(true);
|
|
7928
7934
|
}, [compareResult, setSlides, setIsDirty]);
|
|
7929
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
7935
|
+
const usedFontFamilies = react.useMemo(() => chunkLBSMBRSD_js.collectUsedFonts(slides), [slides]);
|
|
7930
7936
|
return {
|
|
7931
7937
|
handleUpdateNotes,
|
|
7932
7938
|
handleUpdateSlide,
|
|
@@ -8045,7 +8051,7 @@ function useIsMobile(input) {
|
|
|
8045
8051
|
const containerRef = input?.containerRef;
|
|
8046
8052
|
const isTouchDevice = react.useSyncExternalStore(
|
|
8047
8053
|
subscribeTouchCapability,
|
|
8048
|
-
|
|
8054
|
+
chunkLBSMBRSD_js.detectTouchDevice,
|
|
8049
8055
|
() => false
|
|
8050
8056
|
// server snapshot
|
|
8051
8057
|
);
|
|
@@ -8061,7 +8067,7 @@ function useIsMobile(input) {
|
|
|
8061
8067
|
}
|
|
8062
8068
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
8063
8069
|
});
|
|
8064
|
-
const [orientation, setOrientation] = react.useState(
|
|
8070
|
+
const [orientation, setOrientation] = react.useState(chunkLBSMBRSD_js.detectOrientation);
|
|
8065
8071
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
8066
8072
|
const [initialViewportHeight] = react.useState(
|
|
8067
8073
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -8105,7 +8111,7 @@ function useIsMobile(input) {
|
|
|
8105
8111
|
return;
|
|
8106
8112
|
}
|
|
8107
8113
|
const handleOrientationChange = () => {
|
|
8108
|
-
setOrientation(
|
|
8114
|
+
setOrientation(chunkLBSMBRSD_js.detectOrientation());
|
|
8109
8115
|
};
|
|
8110
8116
|
if (screen.orientation) {
|
|
8111
8117
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -8135,9 +8141,9 @@ function useIsMobile(input) {
|
|
|
8135
8141
|
window.addEventListener("resize", handleResize);
|
|
8136
8142
|
return () => window.removeEventListener("resize", handleResize);
|
|
8137
8143
|
}, [isTouchDevice, initialViewportHeight]);
|
|
8138
|
-
const isMobile =
|
|
8139
|
-
const isTablet = !isMobile && containerWidth >=
|
|
8140
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
8144
|
+
const isMobile = chunkLBSMBRSD_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
8145
|
+
const isTablet = !isMobile && containerWidth >= chunkLBSMBRSD_js.MOBILE_BREAKPOINT && containerWidth < chunkLBSMBRSD_js.TABLET_BREAKPOINT;
|
|
8146
|
+
const isDesktop = !isMobile && containerWidth >= chunkLBSMBRSD_js.TABLET_BREAKPOINT;
|
|
8141
8147
|
return {
|
|
8142
8148
|
isMobile,
|
|
8143
8149
|
isTablet,
|
|
@@ -8199,7 +8205,7 @@ function useViewerDialogs(input) {
|
|
|
8199
8205
|
);
|
|
8200
8206
|
const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
|
|
8201
8207
|
const fontEmbedding = react.useMemo(
|
|
8202
|
-
() =>
|
|
8208
|
+
() => chunkLBSMBRSD_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
|
|
8203
8209
|
[embeddedFontKey]
|
|
8204
8210
|
);
|
|
8205
8211
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
|
|
@@ -8207,11 +8213,11 @@ function useViewerDialogs(input) {
|
|
|
8207
8213
|
setEmbedFontsEnabled(fontEmbedding.initialEnabled);
|
|
8208
8214
|
}, [fontEmbedding]);
|
|
8209
8215
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8210
|
-
() => typeof window !== "undefined" ?
|
|
8216
|
+
() => typeof window !== "undefined" ? chunkLBSMBRSD_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8211
8217
|
);
|
|
8212
8218
|
react.useEffect(() => {
|
|
8213
8219
|
const handleWindow = () => setIsNarrowViewport(
|
|
8214
|
-
|
|
8220
|
+
chunkLBSMBRSD_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8215
8221
|
);
|
|
8216
8222
|
let observer = null;
|
|
8217
8223
|
let raf = 0;
|
|
@@ -8225,12 +8231,12 @@ function useViewerDialogs(input) {
|
|
|
8225
8231
|
const entry = entries[0];
|
|
8226
8232
|
if (entry) {
|
|
8227
8233
|
setIsNarrowViewport(
|
|
8228
|
-
|
|
8234
|
+
chunkLBSMBRSD_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
8229
8235
|
);
|
|
8230
8236
|
}
|
|
8231
8237
|
});
|
|
8232
8238
|
observer.observe(el);
|
|
8233
|
-
setIsNarrowViewport(
|
|
8239
|
+
setIsNarrowViewport(chunkLBSMBRSD_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
8234
8240
|
};
|
|
8235
8241
|
attach();
|
|
8236
8242
|
window.addEventListener("resize", handleWindow);
|
|
@@ -8389,20 +8395,20 @@ function useViewerDialogs(input) {
|
|
|
8389
8395
|
}
|
|
8390
8396
|
function computeGridSpacingPx(presentationGridSpacing) {
|
|
8391
8397
|
if (presentationGridSpacing) {
|
|
8392
|
-
const px = Math.round(presentationGridSpacing.cx /
|
|
8398
|
+
const px = Math.round(presentationGridSpacing.cx / chunk7HF5DSE4_js.EMU_PER_PX);
|
|
8393
8399
|
if (px > 0) {
|
|
8394
8400
|
return px;
|
|
8395
8401
|
}
|
|
8396
8402
|
}
|
|
8397
|
-
return
|
|
8403
|
+
return chunk7HF5DSE4_js.GRID_SIZE;
|
|
8398
8404
|
}
|
|
8399
8405
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8400
8406
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8401
|
-
return
|
|
8407
|
+
return chunkLBSMBRSD_js.resolveShowSlideIndexes(slides, activeShow);
|
|
8402
8408
|
}
|
|
8403
8409
|
function computeSlideSectionGroups(slides, sections) {
|
|
8404
|
-
return
|
|
8405
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8410
|
+
return chunkLBSMBRSD_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8411
|
+
id: group.section?.id ?? (sections.length > 0 ? chunk7HF5DSE4_js.UNGROUPED_SECTION_ID : chunk7HF5DSE4_js.DEFAULT_SECTION_GROUP_ID),
|
|
8406
8412
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8407
8413
|
slideIndexes: group.slideIndexes,
|
|
8408
8414
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8414,7 +8420,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
|
8414
8420
|
return void 0;
|
|
8415
8421
|
}
|
|
8416
8422
|
const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
|
|
8417
|
-
return
|
|
8423
|
+
return chunkLBSMBRSD_js.masterViewPseudoSlide(document2, {
|
|
8418
8424
|
tab: "slides",
|
|
8419
8425
|
masterIndex: 0,
|
|
8420
8426
|
layoutIndex: activeLayout ? 0 : null
|
|
@@ -8442,10 +8448,10 @@ function useDerivedSlideState(input) {
|
|
|
8442
8448
|
);
|
|
8443
8449
|
const slideSectionGroups = react.useMemo(
|
|
8444
8450
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8445
|
-
if (group.id ===
|
|
8451
|
+
if (group.id === chunk7HF5DSE4_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8446
8452
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8447
8453
|
}
|
|
8448
|
-
if (group.id ===
|
|
8454
|
+
if (group.id === chunk7HF5DSE4_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
8449
8455
|
return { ...group, label: t("pptx.sections.slides") };
|
|
8450
8456
|
}
|
|
8451
8457
|
return group;
|
|
@@ -8545,13 +8551,13 @@ function useAnnotationHandlers(input) {
|
|
|
8545
8551
|
}, [annotations, setMode, setSlides, history]);
|
|
8546
8552
|
const handleSetMode = react.useCallback(
|
|
8547
8553
|
(nextMode) => {
|
|
8548
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8554
|
+
if (mode === "present" && nextMode !== "present" && !chunkLBSMBRSD_js.mayLeaveSlideShow()) {
|
|
8549
8555
|
return;
|
|
8550
8556
|
}
|
|
8551
8557
|
if (nextMode === "present") {
|
|
8552
8558
|
presentation.enterPresentMode();
|
|
8553
8559
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8554
|
-
|
|
8560
|
+
chunkLBSMBRSD_js.stopAllPersistentAudio();
|
|
8555
8561
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8556
8562
|
if (promptKeepInkAnnotations) {
|
|
8557
8563
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8560,7 +8566,7 @@ function useAnnotationHandlers(input) {
|
|
|
8560
8566
|
}
|
|
8561
8567
|
} else {
|
|
8562
8568
|
if (mode === "present") {
|
|
8563
|
-
|
|
8569
|
+
chunkLBSMBRSD_js.stopAllPersistentAudio();
|
|
8564
8570
|
}
|
|
8565
8571
|
setMode(nextMode);
|
|
8566
8572
|
}
|
|
@@ -8631,13 +8637,13 @@ function useSerialize(input) {
|
|
|
8631
8637
|
let processedSlide = slide;
|
|
8632
8638
|
if (pendingEditId) {
|
|
8633
8639
|
const updatedElements = slide.elements.map((el) => {
|
|
8634
|
-
if (el.id !== pendingEditId || !
|
|
8640
|
+
if (el.id !== pendingEditId || !chunkLBSMBRSD_js.hasTextProperties(el)) {
|
|
8635
8641
|
return el;
|
|
8636
8642
|
}
|
|
8637
8643
|
return {
|
|
8638
8644
|
...el,
|
|
8639
8645
|
text: pendingEditText,
|
|
8640
|
-
textSegments:
|
|
8646
|
+
textSegments: chunkLBSMBRSD_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8641
8647
|
};
|
|
8642
8648
|
});
|
|
8643
8649
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8650,19 +8656,19 @@ function useSerialize(input) {
|
|
|
8650
8656
|
const pptxGuides = guides.map((g) => ({
|
|
8651
8657
|
id: g.id,
|
|
8652
8658
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8653
|
-
positionEmu:
|
|
8659
|
+
positionEmu: chunkLBSMBRSD_js.guidePxToEmu(g.position)
|
|
8654
8660
|
}));
|
|
8655
8661
|
return {
|
|
8656
8662
|
...processedSlide,
|
|
8657
8663
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8658
8664
|
};
|
|
8659
8665
|
});
|
|
8660
|
-
const slidesToSave =
|
|
8666
|
+
const slidesToSave = chunkLBSMBRSD_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8661
8667
|
const saveOptions = {
|
|
8662
8668
|
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
8663
8669
|
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
8664
8670
|
// slide-size edit reaches the file.
|
|
8665
|
-
slideSize:
|
|
8671
|
+
slideSize: chunkLBSMBRSD_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
8666
8672
|
headerFooter,
|
|
8667
8673
|
presentationProperties,
|
|
8668
8674
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -8674,9 +8680,9 @@ function useSerialize(input) {
|
|
|
8674
8680
|
slideMasters,
|
|
8675
8681
|
notesMaster,
|
|
8676
8682
|
handoutMaster,
|
|
8677
|
-
...
|
|
8683
|
+
...chunkLBSMBRSD_js.embeddedFontSaveOptions(embedFonts)
|
|
8678
8684
|
};
|
|
8679
|
-
return
|
|
8685
|
+
return chunkLBSMBRSD_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
|
|
8680
8686
|
}, [
|
|
8681
8687
|
slides,
|
|
8682
8688
|
templateElementsBySlideId,
|
|
@@ -8711,7 +8717,7 @@ function useRecoveryDetection(input) {
|
|
|
8711
8717
|
const onRestore = input.onRestore;
|
|
8712
8718
|
const openVersionHistory = input.openVersionHistory;
|
|
8713
8719
|
react.useEffect(() => {
|
|
8714
|
-
if (!
|
|
8720
|
+
if (!chunkLBSMBRSD_js.shouldProbeAutosaveRecovery({
|
|
8715
8721
|
alreadyChecked: recoveryCheckedRef.current,
|
|
8716
8722
|
filePath,
|
|
8717
8723
|
loading,
|
|
@@ -8723,7 +8729,7 @@ function useRecoveryDetection(input) {
|
|
|
8723
8729
|
}
|
|
8724
8730
|
recoveryCheckedRef.current = true;
|
|
8725
8731
|
void (async () => {
|
|
8726
|
-
const offer = await
|
|
8732
|
+
const offer = await chunkLBSMBRSD_js.probeAutosaveRecovery(filePath);
|
|
8727
8733
|
if (!offer) {
|
|
8728
8734
|
return;
|
|
8729
8735
|
}
|
|
@@ -8736,7 +8742,7 @@ function useRecoveryDetection(input) {
|
|
|
8736
8742
|
const record = recordRef.current;
|
|
8737
8743
|
setPrompt(null);
|
|
8738
8744
|
if (record && onRestore) {
|
|
8739
|
-
onRestore(
|
|
8745
|
+
onRestore(chunkLBSMBRSD_js.acceptAutosaveRecovery(record));
|
|
8740
8746
|
}
|
|
8741
8747
|
recordRef.current = null;
|
|
8742
8748
|
}, [onRestore]);
|
|
@@ -8745,7 +8751,7 @@ function useRecoveryDetection(input) {
|
|
|
8745
8751
|
setPrompt(null);
|
|
8746
8752
|
recordRef.current = null;
|
|
8747
8753
|
if (record) {
|
|
8748
|
-
void
|
|
8754
|
+
void chunkLBSMBRSD_js.discardAutosaveRecovery(record);
|
|
8749
8755
|
}
|
|
8750
8756
|
}, []);
|
|
8751
8757
|
return { prompt, restore, discard };
|
|
@@ -8785,7 +8791,7 @@ function usePresentationSetup(input) {
|
|
|
8785
8791
|
containerRef,
|
|
8786
8792
|
content,
|
|
8787
8793
|
onSetMode: (nextMode) => {
|
|
8788
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8794
|
+
if (mode === "present" && nextMode !== "present" && !chunkLBSMBRSD_js.mayLeaveSlideShow()) {
|
|
8789
8795
|
return;
|
|
8790
8796
|
}
|
|
8791
8797
|
if (mode === "present" && nextMode !== "present" && annotations.hasAnyAnnotations && promptKeepInkAnnotations) {
|
|
@@ -8793,7 +8799,7 @@ function usePresentationSetup(input) {
|
|
|
8793
8799
|
setShowKeepAnnotationsDialog(true);
|
|
8794
8800
|
} else {
|
|
8795
8801
|
if (mode === "present" && nextMode !== "present") {
|
|
8796
|
-
|
|
8802
|
+
chunkLBSMBRSD_js.stopAllPersistentAudio();
|
|
8797
8803
|
stopAnimationSound();
|
|
8798
8804
|
}
|
|
8799
8805
|
setMode(nextMode);
|
|
@@ -8848,10 +8854,10 @@ function usePresentationSetup(input) {
|
|
|
8848
8854
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8849
8855
|
onToggleSubtitles,
|
|
8850
8856
|
onSaveRehearsalTimings: (timings) => {
|
|
8851
|
-
setSlides((prev) =>
|
|
8857
|
+
setSlides((prev) => chunkLBSMBRSD_js.applyRehearsalTimings(prev, timings));
|
|
8852
8858
|
history.markDirty();
|
|
8853
8859
|
},
|
|
8854
|
-
loopContinuously:
|
|
8860
|
+
loopContinuously: chunkLBSMBRSD_js.shouldLoopContinuously(presentationProperties),
|
|
8855
8861
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8856
8862
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8857
8863
|
endWithBlackSlide
|
|
@@ -9044,7 +9050,7 @@ function useEditorOperations(input) {
|
|
|
9044
9050
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
9045
9051
|
react.useEffect(() => {
|
|
9046
9052
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9047
|
-
copiedFormatRef.current =
|
|
9053
|
+
copiedFormatRef.current = chunkLBSMBRSD_js.copyFormatFromElement(selectedElement);
|
|
9048
9054
|
} else if (!formatPainterActive) {
|
|
9049
9055
|
copiedFormatRef.current = null;
|
|
9050
9056
|
}
|
|
@@ -9070,12 +9076,12 @@ function useEditorOperations(input) {
|
|
|
9070
9076
|
e.stopPropagation();
|
|
9071
9077
|
const element = elementLookup.get(elementId);
|
|
9072
9078
|
if (element) {
|
|
9073
|
-
const updated =
|
|
9079
|
+
const updated = chunkLBSMBRSD_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
9074
9080
|
const updates = {};
|
|
9075
|
-
if (
|
|
9081
|
+
if (chunkLBSMBRSD_js.hasShapeProperties(updated)) {
|
|
9076
9082
|
updates.shapeStyle = updated.shapeStyle;
|
|
9077
9083
|
}
|
|
9078
|
-
if (
|
|
9084
|
+
if (chunkLBSMBRSD_js.hasTextProperties(updated)) {
|
|
9079
9085
|
updates.textStyle = updated.textStyle;
|
|
9080
9086
|
}
|
|
9081
9087
|
ops.updateElementById(elementId, updates);
|
|
@@ -9229,7 +9235,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
9229
9235
|
const families = /* @__PURE__ */ new Set();
|
|
9230
9236
|
for (const slide of slides) {
|
|
9231
9237
|
for (const el of slide.elements) {
|
|
9232
|
-
if (
|
|
9238
|
+
if (chunkLBSMBRSD_js.hasTextProperties(el) && el.textSegments) {
|
|
9233
9239
|
for (const seg of el.textSegments) {
|
|
9234
9240
|
if (seg.style.fontFamily) {
|
|
9235
9241
|
families.add(seg.style.fontFamily);
|
|
@@ -9476,7 +9482,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9476
9482
|
inputRef.current = input;
|
|
9477
9483
|
const handleKeyDown = react.useCallback((e) => {
|
|
9478
9484
|
const current = inputRef.current;
|
|
9479
|
-
const { action, dx, dy } =
|
|
9485
|
+
const { action, dx, dy } = chunkLBSMBRSD_js.mapEditorKey(e, {
|
|
9480
9486
|
canEdit: current.canEdit,
|
|
9481
9487
|
// The Slide Master view is an editing surface, not a viewing one.
|
|
9482
9488
|
// Gating on `mode !== 'edit'` alone made `mapEditorKey` return
|
|
@@ -9489,7 +9495,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9489
9495
|
hasSelection: current.hasSelection,
|
|
9490
9496
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9491
9497
|
isDrawing: current.activeTool !== "select",
|
|
9492
|
-
isTextInputTarget:
|
|
9498
|
+
isTextInputTarget: chunkLBSMBRSD_js.isEditorTextInputTarget(e.target)
|
|
9493
9499
|
});
|
|
9494
9500
|
if (action === null) {
|
|
9495
9501
|
return;
|
|
@@ -9795,7 +9801,7 @@ function useViewerIntegration(input) {
|
|
|
9795
9801
|
return zoom.scale;
|
|
9796
9802
|
},
|
|
9797
9803
|
setZoom(level) {
|
|
9798
|
-
zoom.setScale(
|
|
9804
|
+
zoom.setScale(chunkLBSMBRSD_js.clampZoomScale(level));
|
|
9799
9805
|
},
|
|
9800
9806
|
zoomIn() {
|
|
9801
9807
|
zoom.handleZoomIn();
|
|
@@ -10011,7 +10017,7 @@ function useReducedMotion() {
|
|
|
10011
10017
|
}
|
|
10012
10018
|
function useViewerOptions() {
|
|
10013
10019
|
const storeRef = react.useRef(null);
|
|
10014
|
-
storeRef.current ??=
|
|
10020
|
+
storeRef.current ??= chunkLBSMBRSD_js.createViewerOptionsStore();
|
|
10015
10021
|
const store = storeRef.current;
|
|
10016
10022
|
const options = react.useSyncExternalStore(
|
|
10017
10023
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -10020,9 +10026,9 @@ function useViewerOptions() {
|
|
|
10020
10026
|
);
|
|
10021
10027
|
return { optionsStore: store, options };
|
|
10022
10028
|
}
|
|
10023
|
-
var KNOWN_TAB_IDS = new Set(
|
|
10029
|
+
var KNOWN_TAB_IDS = new Set(chunkLBSMBRSD_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
10024
10030
|
function computeToolbarVisibility(hiddenActions) {
|
|
10025
|
-
const isHidden = (id) =>
|
|
10031
|
+
const isHidden = (id) => chunkLBSMBRSD_js.isActionHidden(id, hiddenActions);
|
|
10026
10032
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
10027
10033
|
return { isHidden, isTabVisible };
|
|
10028
10034
|
}
|
|
@@ -10108,12 +10114,12 @@ function useYjsDocumentSync({
|
|
|
10108
10114
|
return;
|
|
10109
10115
|
}
|
|
10110
10116
|
try {
|
|
10111
|
-
const handler = new
|
|
10117
|
+
const handler = new chunkLBSMBRSD_js.PptxHandler();
|
|
10112
10118
|
await handler.load(sourceBytes.buffer);
|
|
10113
|
-
const currentSlides =
|
|
10119
|
+
const currentSlides = chunkLBSMBRSD_js.readSlidesFromYDoc(
|
|
10114
10120
|
doc
|
|
10115
10121
|
);
|
|
10116
|
-
const slidesToSave =
|
|
10122
|
+
const slidesToSave = chunkLBSMBRSD_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10117
10123
|
const bytes = await handler.save(slidesToSave);
|
|
10118
10124
|
config.onWriteBack(bytes);
|
|
10119
10125
|
} catch {
|
|
@@ -10128,10 +10134,10 @@ function useYjsDocumentSync({
|
|
|
10128
10134
|
if (!doc || !isConnected) {
|
|
10129
10135
|
return;
|
|
10130
10136
|
}
|
|
10131
|
-
const docSlides =
|
|
10137
|
+
const docSlides = chunkLBSMBRSD_js.readSlidesFromYDoc(
|
|
10132
10138
|
doc
|
|
10133
10139
|
);
|
|
10134
|
-
if (!
|
|
10140
|
+
if (!chunkLBSMBRSD_js.shouldRoomSlidesReplaceLoad(loadOrigin, docSlides.length)) {
|
|
10135
10141
|
return;
|
|
10136
10142
|
}
|
|
10137
10143
|
lastSyncedRef.current = JSON.stringify(docSlides);
|
|
@@ -10150,11 +10156,11 @@ function useYjsDocumentSync({
|
|
|
10150
10156
|
lastSyncedRef.current = serialized;
|
|
10151
10157
|
void (async () => {
|
|
10152
10158
|
const factories = await getFactories();
|
|
10153
|
-
|
|
10159
|
+
chunkLBSMBRSD_js.reconcileSlidesInYDoc(
|
|
10154
10160
|
slides,
|
|
10155
10161
|
doc,
|
|
10156
10162
|
factories,
|
|
10157
|
-
|
|
10163
|
+
chunkLBSMBRSD_js.LOCAL_SYNC_ORIGIN
|
|
10158
10164
|
);
|
|
10159
10165
|
scheduleWriteBack();
|
|
10160
10166
|
})();
|
|
@@ -10168,10 +10174,10 @@ function useYjsDocumentSync({
|
|
|
10168
10174
|
return;
|
|
10169
10175
|
}
|
|
10170
10176
|
const handleChange = (_events, transaction) => {
|
|
10171
|
-
if (transaction?.origin ===
|
|
10177
|
+
if (transaction?.origin === chunkLBSMBRSD_js.LOCAL_SYNC_ORIGIN) {
|
|
10172
10178
|
return;
|
|
10173
10179
|
}
|
|
10174
|
-
const remoteSlides =
|
|
10180
|
+
const remoteSlides = chunkLBSMBRSD_js.readSlidesFromYDoc(
|
|
10175
10181
|
doc
|
|
10176
10182
|
);
|
|
10177
10183
|
if (remoteSlides.length === 0) {
|
|
@@ -10187,7 +10193,7 @@ function useYjsDocumentSync({
|
|
|
10187
10193
|
isApplyingRemoteRef.current = false;
|
|
10188
10194
|
scheduleWriteBack();
|
|
10189
10195
|
};
|
|
10190
|
-
const unobserve =
|
|
10196
|
+
const unobserve = chunkLBSMBRSD_js.observeYDocSlides(
|
|
10191
10197
|
doc,
|
|
10192
10198
|
handleChange
|
|
10193
10199
|
);
|
|
@@ -10225,7 +10231,7 @@ function useBroadcastFollower({
|
|
|
10225
10231
|
if (!broadcaster) {
|
|
10226
10232
|
return;
|
|
10227
10233
|
}
|
|
10228
|
-
if (!
|
|
10234
|
+
if (!chunkLBSMBRSD_js.shouldAutoFollowBroadcaster({
|
|
10229
10235
|
localRole: collab.config.role,
|
|
10230
10236
|
broadcasterRole: broadcaster.role
|
|
10231
10237
|
})) {
|
|
@@ -10364,6 +10370,10 @@ function useLayoutSwitching(input) {
|
|
|
10364
10370
|
setIsLoading(false);
|
|
10365
10371
|
}
|
|
10366
10372
|
},
|
|
10373
|
+
// `activeSlideIndex` IS read above (inside the `try`), but the analyzer
|
|
10374
|
+
// doesn't see through an `await` call wrapped in try/finally and flags it
|
|
10375
|
+
// as unused; verified as a false positive with a minimal repro.
|
|
10376
|
+
// oxlint-disable-next-line react/memo-dependencies -- see comment above
|
|
10367
10377
|
[handler, activeSlideIndex, ops, history, onTemplateElementsChanged]
|
|
10368
10378
|
);
|
|
10369
10379
|
const loadLayoutPreviews = react.useCallback(
|
|
@@ -10396,10 +10406,10 @@ function useTouchGestures(input) {
|
|
|
10396
10406
|
if (!el || !enabled) {
|
|
10397
10407
|
return;
|
|
10398
10408
|
}
|
|
10399
|
-
const recognizer =
|
|
10409
|
+
const recognizer = chunkLBSMBRSD_js.createTouchGestureRecognizer({
|
|
10400
10410
|
getScale: () => scaleRef.current,
|
|
10401
|
-
minScale:
|
|
10402
|
-
maxScale:
|
|
10411
|
+
minScale: chunkLBSMBRSD_js.MIN_ZOOM_SCALE,
|
|
10412
|
+
maxScale: chunkLBSMBRSD_js.MAX_ZOOM_SCALE,
|
|
10403
10413
|
callbacks: {
|
|
10404
10414
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10405
10415
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10439,7 +10449,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10439
10449
|
return;
|
|
10440
10450
|
}
|
|
10441
10451
|
const rect = active.getBoundingClientRect();
|
|
10442
|
-
const delta =
|
|
10452
|
+
const delta = chunkLBSMBRSD_js.computeScrollDelta(
|
|
10443
10453
|
{ top: rect.top, bottom: rect.bottom },
|
|
10444
10454
|
window.innerHeight,
|
|
10445
10455
|
keyboardInset
|
|
@@ -10459,8 +10469,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10459
10469
|
return;
|
|
10460
10470
|
}
|
|
10461
10471
|
const update = () => {
|
|
10462
|
-
const metrics =
|
|
10463
|
-
const inset = metrics ?
|
|
10472
|
+
const metrics = chunkLBSMBRSD_js.readViewportMetrics(window);
|
|
10473
|
+
const inset = metrics ? chunkLBSMBRSD_js.computeKeyboardInset(metrics) : 0;
|
|
10464
10474
|
setKeyboardInset(inset);
|
|
10465
10475
|
if (inset > 0) {
|
|
10466
10476
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10471,8 +10481,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10471
10481
|
vv.addEventListener("scroll", update);
|
|
10472
10482
|
const onFocusIn = () => {
|
|
10473
10483
|
window.requestAnimationFrame(() => {
|
|
10474
|
-
const metrics =
|
|
10475
|
-
const inset = metrics ?
|
|
10484
|
+
const metrics = chunkLBSMBRSD_js.readViewportMetrics(window);
|
|
10485
|
+
const inset = metrics ? chunkLBSMBRSD_js.computeKeyboardInset(metrics) : 0;
|
|
10476
10486
|
if (inset > 0) {
|
|
10477
10487
|
scrollFocusedIntoView(inset);
|
|
10478
10488
|
}
|
|
@@ -10485,7 +10495,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10485
10495
|
document.removeEventListener("focusin", onFocusIn);
|
|
10486
10496
|
};
|
|
10487
10497
|
}, [enabled]);
|
|
10488
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10498
|
+
return { keyboardInset, isKeyboardOpen: chunkLBSMBRSD_js.isKeyboardOpen(keyboardInset) };
|
|
10489
10499
|
}
|
|
10490
10500
|
|
|
10491
10501
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10512,7 +10522,7 @@ function buildCanvasProps(input) {
|
|
|
10512
10522
|
} = input;
|
|
10513
10523
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10514
10524
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10515
|
-
const fieldContext =
|
|
10525
|
+
const fieldContext = chunkLBSMBRSD_js.buildFieldSubstitutionContext({
|
|
10516
10526
|
headerFooter: s.headerFooter,
|
|
10517
10527
|
customProperties: s.customProperties,
|
|
10518
10528
|
slide: activeSlide
|
|
@@ -10522,13 +10532,13 @@ function buildCanvasProps(input) {
|
|
|
10522
10532
|
if (mode === "present") {
|
|
10523
10533
|
presentation.handlePresentationAction(action);
|
|
10524
10534
|
} else if (action.url) {
|
|
10525
|
-
|
|
10535
|
+
chunkLBSMBRSD_js.safeOpenUrl(action.url);
|
|
10526
10536
|
}
|
|
10527
10537
|
};
|
|
10528
10538
|
const handleHyperlinkClick = (url) => {
|
|
10529
|
-
if (
|
|
10539
|
+
if (chunkLBSMBRSD_js.isPpactionUrl(url)) {
|
|
10530
10540
|
if (mode === "present") {
|
|
10531
|
-
const parsed =
|
|
10541
|
+
const parsed = chunkLBSMBRSD_js.parsePpactionUrl(url);
|
|
10532
10542
|
if (parsed) {
|
|
10533
10543
|
presentation.handlePresentationAction({
|
|
10534
10544
|
action: parsed.action,
|
|
@@ -10538,7 +10548,7 @@ function buildCanvasProps(input) {
|
|
|
10538
10548
|
}
|
|
10539
10549
|
return;
|
|
10540
10550
|
}
|
|
10541
|
-
|
|
10551
|
+
chunkLBSMBRSD_js.safeOpenUrl(url);
|
|
10542
10552
|
};
|
|
10543
10553
|
return {
|
|
10544
10554
|
activeSlide: effectiveSlide,
|
|
@@ -10634,7 +10644,7 @@ function buildCanvasProps(input) {
|
|
|
10634
10644
|
|
|
10635
10645
|
// src/viewer/hooks/useScopedLayoutOptions.ts
|
|
10636
10646
|
function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
|
|
10637
|
-
return
|
|
10647
|
+
return chunkLBSMBRSD_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
|
|
10638
10648
|
}
|
|
10639
10649
|
|
|
10640
10650
|
// src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
|
|
@@ -10647,7 +10657,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10647
10657
|
const current = activeSlide.animations ?? [];
|
|
10648
10658
|
if (group === "motionPath") {
|
|
10649
10659
|
propertyHandlers.handleUpdateSlide({
|
|
10650
|
-
animations:
|
|
10660
|
+
animations: chunkLBSMBRSD_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10651
10661
|
});
|
|
10652
10662
|
return;
|
|
10653
10663
|
}
|
|
@@ -10842,7 +10852,7 @@ function buildToolbarProps(input) {
|
|
|
10842
10852
|
onOpenFile,
|
|
10843
10853
|
onOpenRecentFile,
|
|
10844
10854
|
onCreatePresentation: (templateId) => {
|
|
10845
|
-
s.setSlides(
|
|
10855
|
+
s.setSlides(chunkLBSMBRSD_js.createBackstagePresentation(templateId));
|
|
10846
10856
|
s.setActiveSlideIndex(0);
|
|
10847
10857
|
s.setSelectedElementId(null);
|
|
10848
10858
|
s.setSelectedElementIds([]);
|
|
@@ -10871,7 +10881,7 @@ function buildToolbarProps(input) {
|
|
|
10871
10881
|
loadLayoutPreviews: input.loadLayoutPreviews,
|
|
10872
10882
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
10873
10883
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
10874
|
-
templateScheme:
|
|
10884
|
+
templateScheme: chunkLBSMBRSD_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
10875
10885
|
customShows: s.customShows,
|
|
10876
10886
|
activeCustomShowId: s.activeCustomShowId,
|
|
10877
10887
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -10912,7 +10922,7 @@ function buildToolbarProps(input) {
|
|
|
10912
10922
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
10913
10923
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
10914
10924
|
formatPainterActive: s.formatPainterActive,
|
|
10915
|
-
canActivateFormatPainter:
|
|
10925
|
+
canActivateFormatPainter: chunkLBSMBRSD_js.hasCopyableFormat(selectedElement),
|
|
10916
10926
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
10917
10927
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
10918
10928
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -11200,7 +11210,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11200
11210
|
}, [incomingContent]);
|
|
11201
11211
|
const onOpenFile = react.useCallback(() => {
|
|
11202
11212
|
void (async () => {
|
|
11203
|
-
const picked = await
|
|
11213
|
+
const picked = await chunkLBSMBRSD_js.openPptxFile();
|
|
11204
11214
|
if (picked) {
|
|
11205
11215
|
setContent(picked.buffer);
|
|
11206
11216
|
}
|
|
@@ -11208,7 +11218,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11208
11218
|
}, []);
|
|
11209
11219
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11210
11220
|
void (async () => {
|
|
11211
|
-
const bytes = await
|
|
11221
|
+
const bytes = await chunkLBSMBRSD_js.readBackstageRecentFile(key);
|
|
11212
11222
|
if (bytes) {
|
|
11213
11223
|
setContent(bytes);
|
|
11214
11224
|
}
|