pptx-react-viewer 2.18.0 → 2.19.1
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 +712 -0
- package/dist/{AiChatPanel-SSSBERWJ.mjs → AiChatPanel-GRAIPSG3.mjs} +4 -4
- package/dist/AiChatPanel-GRAIPSG3.mjs.br +0 -0
- package/dist/AiChatPanel-GRAIPSG3.mjs.gz +0 -0
- package/dist/{AiChatPanel-UN5DHPZY.js → AiChatPanel-JSTZ6W7R.js} +24 -24
- package/dist/AiChatPanel-JSTZ6W7R.js.br +0 -0
- package/dist/AiChatPanel-JSTZ6W7R.js.gz +0 -0
- package/dist/{Model3DScene-LYEESYAI.mjs → Model3DScene-FXDA7OII.mjs} +1 -1
- package/dist/Model3DScene-FXDA7OII.mjs.br +0 -0
- package/dist/Model3DScene-FXDA7OII.mjs.gz +0 -0
- package/dist/{Model3DScene-4RPYKC2I.js → Model3DScene-WLRZXJHN.js} +2 -2
- package/dist/Model3DScene-WLRZXJHN.js.br +0 -0
- package/dist/Model3DScene-WLRZXJHN.js.gz +0 -0
- package/dist/{PowerPointViewer-Cf4YHjdF.d.ts → PowerPointViewer-DVFkeluD.d.ts} +2 -2
- package/dist/PowerPointViewer-DVFkeluD.d.ts.map +1 -0
- package/dist/{audience-content-store-CyS0oP6t.d.ts → audience-content-store-ChVOSdBh.d.ts} +2 -2
- package/dist/{audience-content-store-CyS0oP6t.d.ts.map → audience-content-store-ChVOSdBh.d.ts.map} +1 -1
- package/dist/{chunk-QUB5OSKY.mjs → chunk-5ZQ3ZQ3M.mjs} +71 -125
- package/dist/chunk-5ZQ3ZQ3M.mjs.br +0 -0
- package/dist/chunk-5ZQ3ZQ3M.mjs.gz +0 -0
- package/dist/{chunk-O7FTUUXP.mjs → chunk-B55E3KXL.mjs} +210 -92
- package/dist/chunk-B55E3KXL.mjs.br +0 -0
- package/dist/chunk-B55E3KXL.mjs.gz +0 -0
- package/dist/{chunk-7XF6S4AM.mjs → chunk-KQGS6A5J.mjs} +1 -1
- package/dist/chunk-KQGS6A5J.mjs.br +0 -0
- package/dist/chunk-KQGS6A5J.mjs.gz +0 -0
- package/dist/{chunk-ASKYZ5ZY.js → chunk-LMTUC7U7.js} +440 -494
- package/dist/chunk-LMTUC7U7.js.br +0 -0
- package/dist/chunk-LMTUC7U7.js.gz +0 -0
- package/dist/{chunk-RTUGI4HQ.js → chunk-MVKRI3CZ.js} +9 -0
- package/dist/chunk-MVKRI3CZ.js.br +0 -0
- package/dist/chunk-MVKRI3CZ.js.gz +0 -0
- package/dist/{chunk-4LWGAVAP.js → chunk-PIJAFM4B.js} +197 -2425
- package/dist/chunk-PIJAFM4B.js.br +0 -0
- package/dist/chunk-PIJAFM4B.js.gz +0 -0
- package/dist/{chunk-GODW6RNR.mjs → chunk-PNR3J26S.mjs} +1173 -1051
- package/dist/chunk-PNR3J26S.mjs.br +0 -0
- package/dist/chunk-PNR3J26S.mjs.gz +0 -0
- package/dist/{chunk-MAVLV56S.js → chunk-SCGIXXN5.js} +3 -3
- package/dist/chunk-SCGIXXN5.js.br +0 -0
- package/dist/chunk-SCGIXXN5.js.gz +0 -0
- package/dist/{chunk-SNL6LBRX.mjs → chunk-SQJBFMEX.mjs} +9 -0
- package/dist/chunk-SQJBFMEX.mjs.br +0 -0
- package/dist/chunk-SQJBFMEX.mjs.gz +0 -0
- package/dist/{chunk-WVDM36ZM.js → chunk-T7BIRNE4.js} +1185 -1067
- package/dist/chunk-T7BIRNE4.js.br +0 -0
- package/dist/chunk-T7BIRNE4.js.gz +0 -0
- package/dist/{chunk-ICZDMFF2.js → chunk-TPC65IB2.js} +1219 -1101
- package/dist/chunk-TPC65IB2.js.br +0 -0
- package/dist/chunk-TPC65IB2.js.gz +0 -0
- package/dist/{chunk-BZOL6FXF.mjs → chunk-WGXQXHCS.mjs} +52 -2280
- package/dist/chunk-WGXQXHCS.mjs.br +0 -0
- package/dist/chunk-WGXQXHCS.mjs.gz +0 -0
- package/dist/i18n.js +4 -4
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.d.ts +38 -1
- package/dist/index.js +47 -47
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +102 -15
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +79 -79
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +4 -4
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/{types-C_CTI-QE.d.ts → types-TCH6icpi.d.ts} +23 -1
- package/dist/{types-C_CTI-QE.d.ts.map → types-TCH6icpi.d.ts.map} +1 -1
- package/dist/{useViewerBuildingBlocks-DItilDbP.d.ts → useViewerBuildingBlocks-BKb0qs1j.d.ts} +20 -4
- package/dist/{useViewerBuildingBlocks-DItilDbP.d.ts.map → useViewerBuildingBlocks-BKb0qs1j.d.ts.map} +1 -1
- package/dist/viewer/index.d.ts +38 -1
- package/dist/viewer/index.js +27 -27
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +6 -6
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-SSSBERWJ.mjs.br +0 -0
- package/dist/AiChatPanel-SSSBERWJ.mjs.gz +0 -0
- package/dist/AiChatPanel-UN5DHPZY.js.br +0 -0
- package/dist/AiChatPanel-UN5DHPZY.js.gz +0 -0
- package/dist/Model3DScene-4RPYKC2I.js.br +0 -0
- package/dist/Model3DScene-4RPYKC2I.js.gz +0 -0
- package/dist/Model3DScene-LYEESYAI.mjs.br +0 -0
- package/dist/Model3DScene-LYEESYAI.mjs.gz +0 -0
- package/dist/PowerPointViewer-Cf4YHjdF.d.ts.map +0 -1
- package/dist/SurfaceChart3DScene-ACPKCWLJ.js +0 -78
- package/dist/SurfaceChart3DScene-ACPKCWLJ.js.br +0 -0
- package/dist/SurfaceChart3DScene-ACPKCWLJ.js.gz +0 -0
- package/dist/SurfaceChart3DScene-JR62SOYO.mjs +0 -76
- package/dist/SurfaceChart3DScene-JR62SOYO.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-JR62SOYO.mjs.gz +0 -0
- package/dist/chunk-4LWGAVAP.js.br +0 -0
- package/dist/chunk-4LWGAVAP.js.gz +0 -0
- package/dist/chunk-7XF6S4AM.mjs.br +0 -0
- package/dist/chunk-7XF6S4AM.mjs.gz +0 -0
- package/dist/chunk-ASKYZ5ZY.js.br +0 -0
- package/dist/chunk-ASKYZ5ZY.js.gz +0 -0
- package/dist/chunk-BZOL6FXF.mjs.br +0 -0
- package/dist/chunk-BZOL6FXF.mjs.gz +0 -0
- package/dist/chunk-GODW6RNR.mjs.br +0 -0
- package/dist/chunk-GODW6RNR.mjs.gz +0 -0
- package/dist/chunk-ICZDMFF2.js.br +0 -0
- package/dist/chunk-ICZDMFF2.js.gz +0 -0
- package/dist/chunk-MAVLV56S.js.br +0 -0
- package/dist/chunk-MAVLV56S.js.gz +0 -0
- package/dist/chunk-O7FTUUXP.mjs.br +0 -0
- package/dist/chunk-O7FTUUXP.mjs.gz +0 -0
- package/dist/chunk-QUB5OSKY.mjs.br +0 -0
- package/dist/chunk-QUB5OSKY.mjs.gz +0 -0
- package/dist/chunk-RTUGI4HQ.js.br +0 -0
- package/dist/chunk-RTUGI4HQ.js.gz +0 -0
- package/dist/chunk-SNL6LBRX.mjs.br +0 -0
- package/dist/chunk-SNL6LBRX.mjs.gz +0 -0
- package/dist/chunk-WVDM36ZM.js.br +0 -0
- package/dist/chunk-WVDM36ZM.js.gz +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkPIJAFM4B_js = require('./chunk-PIJAFM4B.js');
|
|
4
|
+
var chunkMVKRI3CZ_js = require('./chunk-MVKRI3CZ.js');
|
|
5
|
+
var chunkT7BIRNE4_js = require('./chunk-T7BIRNE4.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 = chunkT7BIRNE4_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 = chunkT7BIRNE4_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 ??= chunkT7BIRNE4_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 >= chunkT7BIRNE4_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
|
+
}, chunkT7BIRNE4_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 = chunkT7BIRNE4_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
|
+
chunkT7BIRNE4_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 = chunkT7BIRNE4_js.validateRoomId(config.roomId);
|
|
249
249
|
const provider = new WebrtcProvider(roomId, yDoc, opts);
|
|
250
|
-
departureRef.current =
|
|
250
|
+
departureRef.current = chunkT7BIRNE4_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 = chunkT7BIRNE4_js.validateRoomId(config.roomId);
|
|
293
|
+
const transport = config.transport ?? chunkT7BIRNE4_js.resolveTransportForServerUrl(config.serverUrl);
|
|
294
294
|
if (transport === "webrtc") {
|
|
295
295
|
await initWebrtc();
|
|
296
296
|
return;
|
|
297
297
|
}
|
|
298
|
-
if (
|
|
298
|
+
if (chunkT7BIRNE4_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 = chunkT7BIRNE4_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
|
+
chunkT7BIRNE4_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
|
+
}, chunkT7BIRNE4_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
|
+
chunkT7BIRNE4_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 = chunkT7BIRNE4_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 = chunkT7BIRNE4_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,
|
|
@@ -479,6 +479,14 @@ function useSheetDismissDrag(onClose, threshold = 120) {
|
|
|
479
479
|
};
|
|
480
480
|
}
|
|
481
481
|
var DEFAULT_MAX_HISTORY_ENTRIES = 120;
|
|
482
|
+
function serializeDocument(snapshot) {
|
|
483
|
+
return JSON.stringify({
|
|
484
|
+
width: snapshot.width,
|
|
485
|
+
height: snapshot.height,
|
|
486
|
+
slides: snapshot.slides,
|
|
487
|
+
templateElementsBySlideId: snapshot.templateElementsBySlideId
|
|
488
|
+
});
|
|
489
|
+
}
|
|
482
490
|
function useEditorHistory(input) {
|
|
483
491
|
const {
|
|
484
492
|
slides,
|
|
@@ -524,8 +532,8 @@ function useEditorHistory(input) {
|
|
|
524
532
|
width: canvasSize.width,
|
|
525
533
|
height: canvasSize.height,
|
|
526
534
|
activeSlideIndex,
|
|
527
|
-
slides: slides.map(
|
|
528
|
-
templateElementsBySlideId:
|
|
535
|
+
slides: slides.map(chunkT7BIRNE4_js.cloneSlide),
|
|
536
|
+
templateElementsBySlideId: chunkT7BIRNE4_js.cloneTemplateElementsBySlideId(templateElementsBySlideId),
|
|
529
537
|
...actionLabel ? { actionLabel } : {}
|
|
530
538
|
};
|
|
531
539
|
},
|
|
@@ -538,9 +546,9 @@ function useEditorHistory(input) {
|
|
|
538
546
|
width: snapshot.width,
|
|
539
547
|
height: snapshot.height
|
|
540
548
|
});
|
|
541
|
-
setSlides(snapshot.slides.map(
|
|
549
|
+
setSlides(snapshot.slides.map(chunkT7BIRNE4_js.cloneSlide));
|
|
542
550
|
setTemplateElementsBySlideId(
|
|
543
|
-
|
|
551
|
+
chunkT7BIRNE4_js.cloneTemplateElementsBySlideId(snapshot.templateElementsBySlideId)
|
|
544
552
|
);
|
|
545
553
|
setActiveSlideIndex(Math.min(snapshot.activeSlideIndex, maxSlideIndex));
|
|
546
554
|
setSelectedElementIds([]);
|
|
@@ -579,9 +587,9 @@ function useEditorHistory(input) {
|
|
|
579
587
|
const currentSnapshot = buildHistorySnapshot();
|
|
580
588
|
historyFutureRef.current.push(currentSnapshot);
|
|
581
589
|
isApplyingHistoryRef.current = true;
|
|
582
|
-
const nextSnapshot =
|
|
583
|
-
lastHistorySnapshotRef.current =
|
|
584
|
-
lastHistorySerializedRef.current =
|
|
590
|
+
const nextSnapshot = chunkPIJAFM4B_js.cloneHistorySnapshot(previousSnapshot);
|
|
591
|
+
lastHistorySnapshotRef.current = chunkPIJAFM4B_js.cloneHistorySnapshot(nextSnapshot);
|
|
592
|
+
lastHistorySerializedRef.current = serializeDocument(nextSnapshot);
|
|
585
593
|
applyHistorySnapshot(nextSnapshot);
|
|
586
594
|
updateHistoryAvailability();
|
|
587
595
|
unlockHistoryTracking();
|
|
@@ -601,9 +609,9 @@ function useEditorHistory(input) {
|
|
|
601
609
|
const currentSnapshot = buildHistorySnapshot();
|
|
602
610
|
historyPastRef.current.push(currentSnapshot);
|
|
603
611
|
isApplyingHistoryRef.current = true;
|
|
604
|
-
const targetSnapshot =
|
|
605
|
-
lastHistorySnapshotRef.current =
|
|
606
|
-
lastHistorySerializedRef.current =
|
|
612
|
+
const targetSnapshot = chunkPIJAFM4B_js.cloneHistorySnapshot(nextSnapshot);
|
|
613
|
+
lastHistorySnapshotRef.current = chunkPIJAFM4B_js.cloneHistorySnapshot(targetSnapshot);
|
|
614
|
+
lastHistorySerializedRef.current = serializeDocument(targetSnapshot);
|
|
607
615
|
applyHistorySnapshot(targetSnapshot);
|
|
608
616
|
updateHistoryAvailability();
|
|
609
617
|
unlockHistoryTracking();
|
|
@@ -620,9 +628,9 @@ function useEditorHistory(input) {
|
|
|
620
628
|
historyPastRef.current = [];
|
|
621
629
|
historyFutureRef.current = [];
|
|
622
630
|
if (initialSnapshot) {
|
|
623
|
-
const clonedInitial =
|
|
631
|
+
const clonedInitial = chunkPIJAFM4B_js.cloneHistorySnapshot(initialSnapshot);
|
|
624
632
|
lastHistorySnapshotRef.current = clonedInitial;
|
|
625
|
-
lastHistorySerializedRef.current =
|
|
633
|
+
lastHistorySerializedRef.current = serializeDocument(clonedInitial);
|
|
626
634
|
} else {
|
|
627
635
|
lastHistorySnapshotRef.current = null;
|
|
628
636
|
lastHistorySerializedRef.current = "";
|
|
@@ -654,26 +662,33 @@ function useEditorHistory(input) {
|
|
|
654
662
|
return;
|
|
655
663
|
}
|
|
656
664
|
const snapshot = buildHistorySnapshot();
|
|
657
|
-
const serialized =
|
|
665
|
+
const serialized = serializeDocument(snapshot);
|
|
658
666
|
if (serialized === lastHistorySerializedRef.current) {
|
|
667
|
+
const previous = lastHistorySnapshotRef.current;
|
|
668
|
+
if (previous && previous.activeSlideIndex !== snapshot.activeSlideIndex) {
|
|
669
|
+
lastHistorySnapshotRef.current = {
|
|
670
|
+
...previous,
|
|
671
|
+
activeSlideIndex: snapshot.activeSlideIndex
|
|
672
|
+
};
|
|
673
|
+
}
|
|
659
674
|
lastCheapHashRef.current = cheapHash;
|
|
660
675
|
return;
|
|
661
676
|
}
|
|
662
677
|
const previousSnapshot = lastHistorySnapshotRef.current;
|
|
663
678
|
if (!previousSnapshot) {
|
|
664
|
-
lastHistorySnapshotRef.current =
|
|
679
|
+
lastHistorySnapshotRef.current = chunkPIJAFM4B_js.cloneHistorySnapshot(snapshot);
|
|
665
680
|
lastHistorySerializedRef.current = serialized;
|
|
666
681
|
lastCheapHashRef.current = cheapHash;
|
|
667
682
|
updateHistoryAvailability();
|
|
668
683
|
return;
|
|
669
684
|
}
|
|
670
685
|
onDirtyRef.current?.();
|
|
671
|
-
historyPastRef.current.push(
|
|
686
|
+
historyPastRef.current.push(chunkPIJAFM4B_js.cloneHistorySnapshot(previousSnapshot));
|
|
672
687
|
while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
|
|
673
688
|
historyPastRef.current.shift();
|
|
674
689
|
}
|
|
675
690
|
historyFutureRef.current = [];
|
|
676
|
-
lastHistorySnapshotRef.current =
|
|
691
|
+
lastHistorySnapshotRef.current = chunkPIJAFM4B_js.cloneHistorySnapshot(snapshot);
|
|
677
692
|
lastHistorySerializedRef.current = serialized;
|
|
678
693
|
lastCheapHashRef.current = cheapHash;
|
|
679
694
|
updateHistoryAvailability();
|
|
@@ -733,9 +748,9 @@ function useZoomViewport({
|
|
|
733
748
|
const canvasStageRef = react.useRef(null);
|
|
734
749
|
const canvasViewportRef = react.useRef(null);
|
|
735
750
|
const renderScaleRef = react.useRef(1);
|
|
736
|
-
const wheelBufferRef = react.useRef(
|
|
751
|
+
const wheelBufferRef = react.useRef(chunkT7BIRNE4_js.createWheelStepBuffer());
|
|
737
752
|
const storeRef = react.useRef(null);
|
|
738
|
-
storeRef.current ??=
|
|
753
|
+
storeRef.current ??= chunkT7BIRNE4_js.createViewerZoomStore();
|
|
739
754
|
const store = storeRef.current;
|
|
740
755
|
const scale = useViewerStore(store, selectZoom);
|
|
741
756
|
const setScale = react.useCallback(
|
|
@@ -796,7 +811,7 @@ function useZoomViewport({
|
|
|
796
811
|
if (!wrapper || !canvasViewport) {
|
|
797
812
|
return;
|
|
798
813
|
}
|
|
799
|
-
const boundedScale =
|
|
814
|
+
const boundedScale = chunkT7BIRNE4_js.clampZoomScale(nextScale);
|
|
800
815
|
const nextEditorScale = fitScale * boundedScale;
|
|
801
816
|
const centerX = (bounds.minX + bounds.maxX) / 2;
|
|
802
817
|
const centerY = (bounds.minY + bounds.maxY) / 2;
|
|
@@ -833,29 +848,29 @@ function useZoomViewport({
|
|
|
833
848
|
selectedElements.forEach((element) => {
|
|
834
849
|
minX = Math.min(minX, element.x);
|
|
835
850
|
minY = Math.min(minY, element.y);
|
|
836
|
-
maxX = Math.max(maxX, element.x + Math.max(element.width,
|
|
837
|
-
maxY = Math.max(maxY, element.y + Math.max(element.height,
|
|
851
|
+
maxX = Math.max(maxX, element.x + Math.max(element.width, chunkPIJAFM4B_js.MIN_ELEMENT_SIZE));
|
|
852
|
+
maxY = Math.max(maxY, element.y + Math.max(element.height, chunkPIJAFM4B_js.MIN_ELEMENT_SIZE));
|
|
838
853
|
});
|
|
839
854
|
if (!Number.isFinite(minX) || !Number.isFinite(minY) || !Number.isFinite(maxX) || !Number.isFinite(maxY)) {
|
|
840
855
|
return;
|
|
841
856
|
}
|
|
842
857
|
const selectionBounds = { minX, minY, maxX, maxY };
|
|
843
|
-
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX,
|
|
844
|
-
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY,
|
|
858
|
+
const boundsWidth = Math.max(selectionBounds.maxX - selectionBounds.minX, chunkPIJAFM4B_js.MIN_ELEMENT_SIZE);
|
|
859
|
+
const boundsHeight = Math.max(selectionBounds.maxY - selectionBounds.minY, chunkPIJAFM4B_js.MIN_ELEMENT_SIZE);
|
|
845
860
|
const availableWidth = Math.max(
|
|
846
|
-
effectiveEditorDimensions.width -
|
|
847
|
-
|
|
861
|
+
effectiveEditorDimensions.width - chunkPIJAFM4B_js.ZOOM_TO_SELECTION_PADDING,
|
|
862
|
+
chunkPIJAFM4B_js.MIN_ELEMENT_SIZE
|
|
848
863
|
);
|
|
849
864
|
const availableHeight = Math.max(
|
|
850
|
-
effectiveEditorDimensions.height -
|
|
851
|
-
|
|
865
|
+
effectiveEditorDimensions.height - chunkPIJAFM4B_js.ZOOM_TO_SELECTION_PADDING,
|
|
866
|
+
chunkPIJAFM4B_js.MIN_ELEMENT_SIZE
|
|
852
867
|
);
|
|
853
868
|
const targetEditorScale = Math.min(
|
|
854
869
|
availableWidth / boundsWidth,
|
|
855
870
|
availableHeight / boundsHeight
|
|
856
871
|
);
|
|
857
872
|
const safeFitScale = fitScale > Number.EPSILON ? fitScale : Number.EPSILON;
|
|
858
|
-
const nextScale =
|
|
873
|
+
const nextScale = chunkT7BIRNE4_js.clampZoomScale(targetEditorScale / safeFitScale);
|
|
859
874
|
setScale(nextScale);
|
|
860
875
|
window.requestAnimationFrame(() => {
|
|
861
876
|
window.requestAnimationFrame(() => {
|
|
@@ -872,14 +887,14 @@ function useZoomViewport({
|
|
|
872
887
|
]);
|
|
873
888
|
const handleWheel = react.useCallback(
|
|
874
889
|
(event) => {
|
|
875
|
-
const mapped =
|
|
890
|
+
const mapped = chunkT7BIRNE4_js.mapEditingWheel(event, wheelBufferRef.current, true);
|
|
876
891
|
if (mapped.intent !== "zoom") {
|
|
877
892
|
return;
|
|
878
893
|
}
|
|
879
894
|
event.preventDefault();
|
|
880
895
|
store.dispatch({
|
|
881
896
|
type: "set-zoom",
|
|
882
|
-
zoom:
|
|
897
|
+
zoom: chunkT7BIRNE4_js.clampZoomScale(store.getState().zoom + mapped.deltaScale)
|
|
883
898
|
});
|
|
884
899
|
},
|
|
885
900
|
[store]
|
|
@@ -967,7 +982,7 @@ function applyAnimationGroupSteps(group, onPlayActionSound, setPresentationEleme
|
|
|
967
982
|
const command = step.command;
|
|
968
983
|
const timer = window.setTimeout(
|
|
969
984
|
() => {
|
|
970
|
-
|
|
985
|
+
chunkPIJAFM4B_js.executeMediaCommand(command);
|
|
971
986
|
},
|
|
972
987
|
Math.max(0, step.delayMs)
|
|
973
988
|
);
|
|
@@ -1104,7 +1119,7 @@ function scheduleEntranceAnimationTimers(slide, setPresentationAnimations, prese
|
|
|
1104
1119
|
}))
|
|
1105
1120
|
);
|
|
1106
1121
|
entranceAnimations.forEach((animation, animationIndex) => {
|
|
1107
|
-
const delay =
|
|
1122
|
+
const delay = chunkT7BIRNE4_js.computeEntranceAnimationDelay(animation.delayMs, animationIndex);
|
|
1108
1123
|
const timer = window.setTimeout(() => {
|
|
1109
1124
|
setPresentationAnimations(
|
|
1110
1125
|
(previousAnimations) => previousAnimations.map(
|
|
@@ -1136,7 +1151,7 @@ function useAnimationPlayback(input) {
|
|
|
1136
1151
|
(controller, group) => {
|
|
1137
1152
|
driveBuildReveal(
|
|
1138
1153
|
controller,
|
|
1139
|
-
|
|
1154
|
+
chunkT7BIRNE4_js.PresentationAnimationController.collectBuildStepIds(group),
|
|
1140
1155
|
setPresentationElementStates,
|
|
1141
1156
|
buildRafRef
|
|
1142
1157
|
);
|
|
@@ -1199,7 +1214,7 @@ function useAnimationPlayback(input) {
|
|
|
1199
1214
|
setHoverTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
1200
1215
|
return;
|
|
1201
1216
|
}
|
|
1202
|
-
const controller =
|
|
1217
|
+
const controller = chunkT7BIRNE4_js.PresentationAnimationController.fromSlide(slide);
|
|
1203
1218
|
controllerRef.current = controller;
|
|
1204
1219
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1205
1220
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
@@ -1357,12 +1372,12 @@ function useAnimationPlayback(input) {
|
|
|
1357
1372
|
presentationTimersRef
|
|
1358
1373
|
};
|
|
1359
1374
|
}
|
|
1360
|
-
var PRESENTER_CHANNEL_NAME =
|
|
1361
|
-
var AUDIENCE_HASH =
|
|
1362
|
-
var PRESENTER_MSG_ORIGIN =
|
|
1363
|
-
var AUDIENCE_NONCE_KEY =
|
|
1375
|
+
var PRESENTER_CHANNEL_NAME = chunkT7BIRNE4_js.PRESENTATION_CHANNEL_NAME;
|
|
1376
|
+
var AUDIENCE_HASH = chunkT7BIRNE4_js.PRESENTATION_HASH;
|
|
1377
|
+
var PRESENTER_MSG_ORIGIN = chunkT7BIRNE4_js.PRESENTATION_MESSAGE_ORIGIN;
|
|
1378
|
+
var AUDIENCE_NONCE_KEY = chunkT7BIRNE4_js.PRESENTATION_NONCE_KEY;
|
|
1364
1379
|
function generateSessionId() {
|
|
1365
|
-
return
|
|
1380
|
+
return chunkT7BIRNE4_js.createPresentationSessionId();
|
|
1366
1381
|
}
|
|
1367
1382
|
function parseAudienceNonce() {
|
|
1368
1383
|
const hash = window.location.hash;
|
|
@@ -1398,7 +1413,7 @@ function usePresenterWindow(input) {
|
|
|
1398
1413
|
}, []);
|
|
1399
1414
|
const swapDisplays = react.useCallback(async () => {
|
|
1400
1415
|
const audience = audienceWindowRef.current;
|
|
1401
|
-
return audience && !audience.closed ?
|
|
1416
|
+
return audience && !audience.closed ? chunkT7BIRNE4_js.swapPresentationWindows(window, audience) : false;
|
|
1402
1417
|
}, []);
|
|
1403
1418
|
const syncSlideToAudience = react.useCallback(
|
|
1404
1419
|
(slideIndex) => {
|
|
@@ -1462,7 +1477,7 @@ function usePresenterWindow(input) {
|
|
|
1462
1477
|
pollTimerRef.current = null;
|
|
1463
1478
|
}
|
|
1464
1479
|
if (closingSessionId) {
|
|
1465
|
-
void
|
|
1480
|
+
void chunkT7BIRNE4_js.clearAudienceContent(closingSessionId);
|
|
1466
1481
|
}
|
|
1467
1482
|
}, [getChannel]);
|
|
1468
1483
|
const openAudienceWindow = react.useCallback(() => {
|
|
@@ -1480,10 +1495,10 @@ function usePresenterWindow(input) {
|
|
|
1480
1495
|
audienceWindowRef.current = blankWin;
|
|
1481
1496
|
const sessionId = generateSessionId();
|
|
1482
1497
|
sessionIdRef.current = sessionId;
|
|
1483
|
-
const audienceUrl =
|
|
1484
|
-
void
|
|
1498
|
+
const audienceUrl = chunkT7BIRNE4_js.buildPresentationAudienceUrl(window.location.href, sessionId);
|
|
1499
|
+
void chunkT7BIRNE4_js.resolveAudienceScreenPlacement(window).then((placement) => {
|
|
1485
1500
|
if (placement && audienceWindowRef.current === blankWin && !blankWin.closed) {
|
|
1486
|
-
|
|
1501
|
+
chunkT7BIRNE4_js.placeAudienceWindow(blankWin, placement);
|
|
1487
1502
|
}
|
|
1488
1503
|
return void 0;
|
|
1489
1504
|
});
|
|
@@ -1513,7 +1528,7 @@ function usePresenterWindow(input) {
|
|
|
1513
1528
|
}
|
|
1514
1529
|
};
|
|
1515
1530
|
if (content) {
|
|
1516
|
-
void
|
|
1531
|
+
void chunkT7BIRNE4_js.storeAudienceContent(content, sessionId).then(() => navigateOrClose(true)).catch(() => navigateOrClose(false));
|
|
1517
1532
|
} else {
|
|
1518
1533
|
navigateOrClose(true);
|
|
1519
1534
|
}
|
|
@@ -1539,7 +1554,7 @@ function usePresenterWindow(input) {
|
|
|
1539
1554
|
}
|
|
1540
1555
|
const handleMessage = (event) => {
|
|
1541
1556
|
const message = event.data;
|
|
1542
|
-
if (
|
|
1557
|
+
if (chunkT7BIRNE4_js.isPresentationSessionMessage(message) && message.type === "audience-ready" && message.sessionId === sessionIdRef.current) {
|
|
1543
1558
|
syncStateToAudience(snapshotRef.current);
|
|
1544
1559
|
}
|
|
1545
1560
|
};
|
|
@@ -1568,7 +1583,7 @@ function usePresenterWindow(input) {
|
|
|
1568
1583
|
react.useEffect(() => {
|
|
1569
1584
|
const handleBeforeUnload = () => {
|
|
1570
1585
|
if (sessionIdRef.current) {
|
|
1571
|
-
void
|
|
1586
|
+
void chunkT7BIRNE4_js.clearAudienceContent(sessionIdRef.current);
|
|
1572
1587
|
}
|
|
1573
1588
|
};
|
|
1574
1589
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -1630,7 +1645,7 @@ function useAudienceMode(input) {
|
|
|
1630
1645
|
}
|
|
1631
1646
|
channel.onmessage = (event) => {
|
|
1632
1647
|
const data = event.data;
|
|
1633
|
-
if (!
|
|
1648
|
+
if (!chunkT7BIRNE4_js.isPresentationSessionMessage(data) || data.origin !== PRESENTER_MSG_ORIGIN) {
|
|
1634
1649
|
return;
|
|
1635
1650
|
}
|
|
1636
1651
|
if (expectedSessionId && data.sessionId !== expectedSessionId) {
|
|
@@ -1646,16 +1661,16 @@ function useAudienceMode(input) {
|
|
|
1646
1661
|
}
|
|
1647
1662
|
if (data.type === "presenter-exit") {
|
|
1648
1663
|
if (expectedSessionId) {
|
|
1649
|
-
void
|
|
1664
|
+
void chunkT7BIRNE4_js.clearAudienceContent(expectedSessionId);
|
|
1650
1665
|
}
|
|
1651
|
-
if (
|
|
1666
|
+
if (chunkT7BIRNE4_js.endAudienceDisplay(window)) {
|
|
1652
1667
|
handlers.onPresenterEnded?.();
|
|
1653
1668
|
}
|
|
1654
1669
|
}
|
|
1655
1670
|
};
|
|
1656
1671
|
if (expectedSessionId) {
|
|
1657
1672
|
channel.postMessage({
|
|
1658
|
-
origin:
|
|
1673
|
+
origin: chunkT7BIRNE4_js.PRESENTATION_MESSAGE_ORIGIN,
|
|
1659
1674
|
type: "audience-ready",
|
|
1660
1675
|
sessionId: expectedSessionId
|
|
1661
1676
|
});
|
|
@@ -1669,7 +1684,7 @@ function useAudienceMode(input) {
|
|
|
1669
1684
|
}, []);
|
|
1670
1685
|
}
|
|
1671
1686
|
function usePresentationKeyboard(input) {
|
|
1672
|
-
const wheelBufferRef = react.useRef(
|
|
1687
|
+
const wheelBufferRef = react.useRef(chunkT7BIRNE4_js.createWheelStepBuffer());
|
|
1673
1688
|
const {
|
|
1674
1689
|
mode,
|
|
1675
1690
|
movePresentationSlide,
|
|
@@ -1690,14 +1705,14 @@ function usePresentationKeyboard(input) {
|
|
|
1690
1705
|
presentationSlideIndex,
|
|
1691
1706
|
setShowRehearsalSummary
|
|
1692
1707
|
} = input;
|
|
1693
|
-
const keyBufferRef = react.useRef(
|
|
1708
|
+
const keyBufferRef = react.useRef(chunkT7BIRNE4_js.createPresentationKeyBuffer());
|
|
1694
1709
|
react.useEffect(() => {
|
|
1695
|
-
if (mode !== "present" || !
|
|
1696
|
-
keyBufferRef.current =
|
|
1710
|
+
if (mode !== "present" || !chunkT7BIRNE4_js.acceptsPresentationInput()) {
|
|
1711
|
+
keyBufferRef.current = chunkT7BIRNE4_js.createPresentationKeyBuffer();
|
|
1697
1712
|
return;
|
|
1698
1713
|
}
|
|
1699
1714
|
const handleKeyDown = (event) => {
|
|
1700
|
-
const mapped =
|
|
1715
|
+
const mapped = chunkT7BIRNE4_js.mapPresentationKey(event, keyBufferRef.current);
|
|
1701
1716
|
if (mapped.action === "none") {
|
|
1702
1717
|
return;
|
|
1703
1718
|
}
|
|
@@ -1717,12 +1732,12 @@ function usePresentationKeyboard(input) {
|
|
|
1717
1732
|
movePresentationSlide(-1);
|
|
1718
1733
|
return;
|
|
1719
1734
|
case "first": {
|
|
1720
|
-
const first =
|
|
1735
|
+
const first = chunkT7BIRNE4_js.firstShowSlideIndex(showSlideIndexes);
|
|
1721
1736
|
navigateToSlide(first ?? 0);
|
|
1722
1737
|
return;
|
|
1723
1738
|
}
|
|
1724
1739
|
case "last": {
|
|
1725
|
-
const last =
|
|
1740
|
+
const last = chunkT7BIRNE4_js.lastShowSlideIndex(showSlideIndexes);
|
|
1726
1741
|
navigateToSlide(last ?? Math.max(0, slideCount - 1));
|
|
1727
1742
|
return;
|
|
1728
1743
|
}
|
|
@@ -1760,10 +1775,10 @@ function usePresentationKeyboard(input) {
|
|
|
1760
1775
|
}
|
|
1761
1776
|
};
|
|
1762
1777
|
const handleWheel = (event) => {
|
|
1763
|
-
if (mode !== "present" || !
|
|
1778
|
+
if (mode !== "present" || !chunkT7BIRNE4_js.acceptsPresentationInput()) {
|
|
1764
1779
|
return;
|
|
1765
1780
|
}
|
|
1766
|
-
const mapped =
|
|
1781
|
+
const mapped = chunkT7BIRNE4_js.mapPresentationWheel(event, wheelBufferRef.current);
|
|
1767
1782
|
if (mapped.intent === "next-slide") {
|
|
1768
1783
|
event.preventDefault();
|
|
1769
1784
|
movePresentationSlide(1);
|
|
@@ -1896,7 +1911,7 @@ function useRehearsalTimings(input) {
|
|
|
1896
1911
|
|
|
1897
1912
|
// src/viewer/hooks/presentation-mode/presentation-actions.ts
|
|
1898
1913
|
function handlePresentationActionImpl(action, deps) {
|
|
1899
|
-
|
|
1914
|
+
chunkT7BIRNE4_js.runPresentationAction(
|
|
1900
1915
|
action,
|
|
1901
1916
|
{ slideCount: deps.slidesLength },
|
|
1902
1917
|
{
|
|
@@ -1918,7 +1933,7 @@ function handlePresentationActionImpl(action, deps) {
|
|
|
1918
1933
|
function executeSlideTransition(nextSlideIndex, deps) {
|
|
1919
1934
|
const incomingSlide = deps.slides[nextSlideIndex];
|
|
1920
1935
|
const transition = incomingSlide?.transition;
|
|
1921
|
-
const durationMs = deps.playTransition ?
|
|
1936
|
+
const durationMs = deps.playTransition ? chunkT7BIRNE4_js.resolveTransitionDurationMs(transition) : 0;
|
|
1922
1937
|
deps.clearPresentationTimers();
|
|
1923
1938
|
deps.setPresentationSlideIndex(nextSlideIndex);
|
|
1924
1939
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
@@ -1977,7 +1992,7 @@ function useSlideNavigation(input) {
|
|
|
1977
1992
|
});
|
|
1978
1993
|
const scheduleAutoAdvanceForSlide = react.useCallback(
|
|
1979
1994
|
(slideIndex) => {
|
|
1980
|
-
const delayMs =
|
|
1995
|
+
const delayMs = chunkT7BIRNE4_js.resolveAutoAdvanceDelayMs(slides[slideIndex], { useTimings });
|
|
1981
1996
|
if (delayMs === void 0) {
|
|
1982
1997
|
return;
|
|
1983
1998
|
}
|
|
@@ -2000,7 +2015,7 @@ function useSlideNavigation(input) {
|
|
|
2000
2015
|
if (availableSlideIndexes.length === 0) {
|
|
2001
2016
|
return;
|
|
2002
2017
|
}
|
|
2003
|
-
const pastLastSlide = direction === 1 && !
|
|
2018
|
+
const pastLastSlide = direction === 1 && !chunkT7BIRNE4_js.hasShowSlideAfter(presentationSlideIndex, availableSlideIndexes);
|
|
2004
2019
|
if (rehearsing && pastLastSlide) {
|
|
2005
2020
|
recordCurrentSlideTime(presentationSlideIndex);
|
|
2006
2021
|
try {
|
|
@@ -2018,9 +2033,9 @@ function useSlideNavigation(input) {
|
|
|
2018
2033
|
onAdvancePastLastSlide();
|
|
2019
2034
|
return;
|
|
2020
2035
|
}
|
|
2021
|
-
const nextSlideIndex = direction === 1 ?
|
|
2036
|
+
const nextSlideIndex = direction === 1 ? chunkT7BIRNE4_js.nextShowSlideIndex(presentationSlideIndex, availableSlideIndexes, {
|
|
2022
2037
|
loop: Boolean(loopContinuously) && !rehearsing
|
|
2023
|
-
}) :
|
|
2038
|
+
}) : chunkT7BIRNE4_js.previousShowSlideIndex(presentationSlideIndex, availableSlideIndexes);
|
|
2024
2039
|
if (nextSlideIndex === void 0 || nextSlideIndex === presentationSlideIndex) {
|
|
2025
2040
|
return;
|
|
2026
2041
|
}
|
|
@@ -2165,22 +2180,22 @@ function useZoomNavigation(input) {
|
|
|
2165
2180
|
};
|
|
2166
2181
|
}
|
|
2167
2182
|
function usePresenterConsole(slideIndex, active) {
|
|
2168
|
-
const timerRef = react.useRef(
|
|
2169
|
-
const [snapshot, setSnapshot] = react.useState(() =>
|
|
2183
|
+
const timerRef = react.useRef(chunkT7BIRNE4_js.createPresenterTimer());
|
|
2184
|
+
const [snapshot, setSnapshot] = react.useState(() => chunkT7BIRNE4_js.createInitialPresentationSnapshot(slideIndex));
|
|
2170
2185
|
const patch = react.useCallback((value) => {
|
|
2171
|
-
setSnapshot((current) =>
|
|
2186
|
+
setSnapshot((current) => chunkT7BIRNE4_js.mergePresentationSnapshot(current, value));
|
|
2172
2187
|
}, []);
|
|
2173
2188
|
react.useEffect(() => patch({ slideIndex }), [patch, slideIndex]);
|
|
2174
2189
|
react.useEffect(() => {
|
|
2175
2190
|
if (!active) {
|
|
2176
2191
|
return;
|
|
2177
2192
|
}
|
|
2178
|
-
timerRef.current =
|
|
2193
|
+
timerRef.current = chunkT7BIRNE4_js.resetPresenterTimer();
|
|
2179
2194
|
patch({ paused: false, elapsedMs: 0 });
|
|
2180
2195
|
const timer = window.setInterval(() => {
|
|
2181
2196
|
patch({
|
|
2182
2197
|
paused: timerRef.current.paused,
|
|
2183
|
-
elapsedMs:
|
|
2198
|
+
elapsedMs: chunkT7BIRNE4_js.presenterElapsed(timerRef.current)
|
|
2184
2199
|
});
|
|
2185
2200
|
}, 1e3);
|
|
2186
2201
|
return () => window.clearInterval(timer);
|
|
@@ -2190,19 +2205,19 @@ function usePresenterConsole(slideIndex, active) {
|
|
|
2190
2205
|
applyAudienceSnapshot: setSnapshot,
|
|
2191
2206
|
setBlackout: (blackout) => patch({ blackout }),
|
|
2192
2207
|
toggleTimer: () => {
|
|
2193
|
-
timerRef.current =
|
|
2208
|
+
timerRef.current = chunkT7BIRNE4_js.togglePresenterTimer(timerRef.current);
|
|
2194
2209
|
patch({
|
|
2195
2210
|
paused: timerRef.current.paused,
|
|
2196
|
-
elapsedMs:
|
|
2211
|
+
elapsedMs: chunkT7BIRNE4_js.presenterElapsed(timerRef.current)
|
|
2197
2212
|
});
|
|
2198
2213
|
},
|
|
2199
2214
|
resetTimer: () => {
|
|
2200
|
-
timerRef.current =
|
|
2215
|
+
timerRef.current = chunkT7BIRNE4_js.resetPresenterTimer();
|
|
2201
2216
|
patch({ paused: false, elapsedMs: 0 });
|
|
2202
2217
|
},
|
|
2203
2218
|
stepZoom: (direction) => setSnapshot(
|
|
2204
|
-
(current) =>
|
|
2205
|
-
zoom:
|
|
2219
|
+
(current) => chunkT7BIRNE4_js.mergePresentationSnapshot(current, {
|
|
2220
|
+
zoom: chunkT7BIRNE4_js.stepPresenterZoom(
|
|
2206
2221
|
current.zoom ?? { scale: 1, originX: 0.5, originY: 0.5 },
|
|
2207
2222
|
direction
|
|
2208
2223
|
)
|
|
@@ -2248,7 +2263,7 @@ function usePresentationMode(input) {
|
|
|
2248
2263
|
const [allSlidesOpen, setAllSlidesOpen] = react.useState(false);
|
|
2249
2264
|
const [endOfShowVisible, setEndOfShowVisible] = react.useState(false);
|
|
2250
2265
|
const [presentationStartTime, setPresentationStartTime] = react.useState(null);
|
|
2251
|
-
const showGuard = react.useMemo(() =>
|
|
2266
|
+
const showGuard = react.useMemo(() => chunkT7BIRNE4_js.createPresenterShowGuard(), []);
|
|
2252
2267
|
const {
|
|
2253
2268
|
presentationAnimations,
|
|
2254
2269
|
presentationElementStates,
|
|
@@ -2327,7 +2342,7 @@ function usePresentationMode(input) {
|
|
|
2327
2342
|
});
|
|
2328
2343
|
const movePresentationSlide = react.useCallback(
|
|
2329
2344
|
(direction, trigger = "explicit") => {
|
|
2330
|
-
if (!
|
|
2345
|
+
if (!chunkT7BIRNE4_js.acceptsPresentationInput()) {
|
|
2331
2346
|
return;
|
|
2332
2347
|
}
|
|
2333
2348
|
if (endOfShowVisible) {
|
|
@@ -2465,7 +2480,7 @@ function usePresentationMode(input) {
|
|
|
2465
2480
|
if (mode !== "present") {
|
|
2466
2481
|
return;
|
|
2467
2482
|
}
|
|
2468
|
-
return
|
|
2483
|
+
return chunkT7BIRNE4_js.attachPresentationVisibilityPause({
|
|
2469
2484
|
root: containerRef.current ?? void 0,
|
|
2470
2485
|
onHidden: () => clearPresentationTimersRef.current(),
|
|
2471
2486
|
onVisible: () => scheduleAutoAdvanceRef.current(presentationSlideIndexRef.current)
|
|
@@ -2545,11 +2560,11 @@ function usePresentationMode(input) {
|
|
|
2545
2560
|
if (!transitionOverlay || transitionOverlay.transition.type !== "morph") {
|
|
2546
2561
|
return void 0;
|
|
2547
2562
|
}
|
|
2548
|
-
return
|
|
2563
|
+
return chunkT7BIRNE4_js.buildMorphTransitionPlan(
|
|
2549
2564
|
slides[transitionOverlay.outgoingSlideIndex],
|
|
2550
2565
|
slides[transitionOverlay.incomingSlideIndex],
|
|
2551
2566
|
transitionOverlay.durationMs,
|
|
2552
|
-
|
|
2567
|
+
chunkT7BIRNE4_js.morphOptionToMode(transitionOverlay.transition.morphOption)
|
|
2553
2568
|
);
|
|
2554
2569
|
}, [transitionOverlay, slides]);
|
|
2555
2570
|
const morphedElementStates = react.useMemo(() => {
|
|
@@ -2570,7 +2585,7 @@ function usePresentationMode(input) {
|
|
|
2570
2585
|
if (!morphPlan) {
|
|
2571
2586
|
return presentationKeyframesCss;
|
|
2572
2587
|
}
|
|
2573
|
-
const imageRules =
|
|
2588
|
+
const imageRules = chunkT7BIRNE4_js.buildMorphAnimationRules(morphPlan, "", "incoming", "image");
|
|
2574
2589
|
return `${presentationKeyframesCss ?? ""}
|
|
2575
2590
|
${morphPlan.keyframesCss}
|
|
2576
2591
|
${imageRules}`;
|
|
@@ -2866,7 +2881,7 @@ function useFindReplace({
|
|
|
2866
2881
|
const [findResults, setFindResults] = react.useState([]);
|
|
2867
2882
|
const [findResultIndex, setFindResultIndex] = react.useState(-1);
|
|
2868
2883
|
const performFind = react.useCallback(() => {
|
|
2869
|
-
const results =
|
|
2884
|
+
const results = chunkT7BIRNE4_js.findInSlides(slides, findQuery, { matchCase: findMatchCase });
|
|
2870
2885
|
if (!findQuery) {
|
|
2871
2886
|
setFindResults([]);
|
|
2872
2887
|
setFindResultIndex(-1);
|
|
@@ -2900,7 +2915,7 @@ function useFindReplace({
|
|
|
2900
2915
|
return;
|
|
2901
2916
|
}
|
|
2902
2917
|
onUpdateSlides(
|
|
2903
|
-
(prevSlides) =>
|
|
2918
|
+
(prevSlides) => chunkT7BIRNE4_js.applyFindReplacements(prevSlides, toReplace, replaceQuery).slides
|
|
2904
2919
|
);
|
|
2905
2920
|
onMarkDirty();
|
|
2906
2921
|
},
|
|
@@ -2922,9 +2937,9 @@ function useFindReplace({
|
|
|
2922
2937
|
}, [findResults, applyReplacements, performFind]);
|
|
2923
2938
|
react.useEffect(() => {
|
|
2924
2939
|
const handler = (event) => {
|
|
2925
|
-
const { action } =
|
|
2940
|
+
const { action } = chunkT7BIRNE4_js.mapEditorKey(event, {
|
|
2926
2941
|
canEdit: mode === "edit",
|
|
2927
|
-
isTextInputTarget:
|
|
2942
|
+
isTextInputTarget: chunkT7BIRNE4_js.isEditorTextInputTarget(event.target)
|
|
2928
2943
|
});
|
|
2929
2944
|
if (action !== "find") {
|
|
2930
2945
|
return;
|
|
@@ -3434,7 +3449,7 @@ function useViewerCoreState(_input) {
|
|
|
3434
3449
|
const marqueeStateRef = react.useRef(null);
|
|
3435
3450
|
const isDrawingRef = react.useRef(false);
|
|
3436
3451
|
const justInteractedRef = react.useRef(false);
|
|
3437
|
-
const livePatcher = react.useMemo(() =>
|
|
3452
|
+
const livePatcher = react.useMemo(() => chunkT7BIRNE4_js.createCollaborationLivePatcher(), []);
|
|
3438
3453
|
react.useEffect(() => () => livePatcher.dispose(), [livePatcher]);
|
|
3439
3454
|
const slidesRef = react.useRef([]);
|
|
3440
3455
|
const [mode, setMode] = react.useState("edit");
|
|
@@ -3443,8 +3458,8 @@ function useViewerCoreState(_input) {
|
|
|
3443
3458
|
const [slides, setSlides] = react.useState([]);
|
|
3444
3459
|
const [templateElementsBySlideId, setTemplateElementsBySlideId] = react.useState({});
|
|
3445
3460
|
const [canvasSize, setCanvasSize] = react.useState({
|
|
3446
|
-
width:
|
|
3447
|
-
height:
|
|
3461
|
+
width: chunkPIJAFM4B_js.DEFAULT_CANVAS_WIDTH,
|
|
3462
|
+
height: chunkPIJAFM4B_js.DEFAULT_CANVAS_HEIGHT
|
|
3448
3463
|
});
|
|
3449
3464
|
const [slideSizeEmu, setSlideSizeEmu] = react.useState();
|
|
3450
3465
|
const [activeSlideIndex, setActiveSlideIndex] = react.useState(0);
|
|
@@ -3465,7 +3480,7 @@ function useViewerCoreState(_input) {
|
|
|
3465
3480
|
const resolved = typeof value === "function" ? value(inlineEditingTextRef.current) : value;
|
|
3466
3481
|
inlineEditingTextRef.current = resolved;
|
|
3467
3482
|
setInlineEditingTextBase(value);
|
|
3468
|
-
|
|
3483
|
+
chunkT7BIRNE4_js.publishLiveInlineText(
|
|
3469
3484
|
livePatcher,
|
|
3470
3485
|
slidesRef.current[activeSlideIndexRef.current],
|
|
3471
3486
|
inlineEditingElementIdRef.current,
|
|
@@ -3804,7 +3819,7 @@ function useLoadContent({
|
|
|
3804
3819
|
);
|
|
3805
3820
|
}
|
|
3806
3821
|
const previousHandler = handlerRef.current;
|
|
3807
|
-
const handler = new
|
|
3822
|
+
const handler = new chunkT7BIRNE4_js.PptxHandler();
|
|
3808
3823
|
const parsed = await handler.load(buffer);
|
|
3809
3824
|
if (cancelled || token !== renderTokenRef.current) {
|
|
3810
3825
|
handler.dispose();
|
|
@@ -3816,7 +3831,7 @@ function useLoadContent({
|
|
|
3816
3831
|
handlerRef.current = null;
|
|
3817
3832
|
const mediaElements = [];
|
|
3818
3833
|
for (const slide of parsed.slides) {
|
|
3819
|
-
|
|
3834
|
+
chunkT7BIRNE4_js.collectMediaElements(slide.elements, mediaElements);
|
|
3820
3835
|
}
|
|
3821
3836
|
for (const url of mediaDataUrls.values()) {
|
|
3822
3837
|
if (url.startsWith("blob:")) {
|
|
@@ -3857,7 +3872,7 @@ function useLoadContent({
|
|
|
3857
3872
|
}
|
|
3858
3873
|
})
|
|
3859
3874
|
);
|
|
3860
|
-
const { paths: imagePaths, refs: imageRefs } =
|
|
3875
|
+
const { paths: imagePaths, refs: imageRefs } = chunkT7BIRNE4_js.collectImagePaths(parsed.slides);
|
|
3861
3876
|
let nextSlides = parsed.slides;
|
|
3862
3877
|
if (imagePaths.size > 0) {
|
|
3863
3878
|
const resolvedMap = /* @__PURE__ */ new Map();
|
|
@@ -3912,12 +3927,12 @@ function useLoadContent({
|
|
|
3912
3927
|
}
|
|
3913
3928
|
}
|
|
3914
3929
|
handlerRef.current = handler;
|
|
3915
|
-
const partition =
|
|
3930
|
+
const partition = chunkT7BIRNE4_js.partitionTemplateElements(nextSlides);
|
|
3916
3931
|
setSlides(partition.slides);
|
|
3917
3932
|
setTemplateElementsBySlideId(partition.templateElementsBySlideId);
|
|
3918
3933
|
setCanvasSize({
|
|
3919
|
-
width: parsed.width ??
|
|
3920
|
-
height: parsed.height ??
|
|
3934
|
+
width: parsed.width ?? chunkPIJAFM4B_js.DEFAULT_CANVAS_WIDTH,
|
|
3935
|
+
height: parsed.height ?? chunkPIJAFM4B_js.DEFAULT_CANVAS_HEIGHT
|
|
3921
3936
|
});
|
|
3922
3937
|
setSlideSizeEmu(
|
|
3923
3938
|
typeof parsed.widthEmu === "number" && typeof parsed.heightEmu === "number" && parsed.widthEmu > 0 && parsed.heightEmu > 0 ? {
|
|
@@ -3934,7 +3949,7 @@ function useLoadContent({
|
|
|
3934
3949
|
setThemeOptions(parsed.themeOptions ?? []);
|
|
3935
3950
|
setCustomShows(parsed.customShows ?? []);
|
|
3936
3951
|
setActiveCustomShowId(
|
|
3937
|
-
|
|
3952
|
+
chunkT7BIRNE4_js.resolveAuthoredCustomShowId(parsed.presentationProperties, parsed.customShows) ?? null
|
|
3938
3953
|
);
|
|
3939
3954
|
setSections(parsed.sections ?? []);
|
|
3940
3955
|
setPresentationProperties(parsed.presentationProperties ?? {});
|
|
@@ -3956,7 +3971,7 @@ function useLoadContent({
|
|
|
3956
3971
|
setHasMacros(parsed.hasMacros === true);
|
|
3957
3972
|
setHasDigitalSignatures(parsed.hasDigitalSignatures === true);
|
|
3958
3973
|
setDigitalSignatureCount(parsed.digitalSignatureCount ?? 0);
|
|
3959
|
-
setGuides(
|
|
3974
|
+
setGuides(chunkT7BIRNE4_js.buildInitialGuides(parsed.presentationGuides, parsed.slides[0]?.guides));
|
|
3960
3975
|
setActiveSlideIndex(0);
|
|
3961
3976
|
clearSelection();
|
|
3962
3977
|
setIsDirty(false);
|
|
@@ -3964,7 +3979,7 @@ function useLoadContent({
|
|
|
3964
3979
|
onContentApplied?.();
|
|
3965
3980
|
} catch (err) {
|
|
3966
3981
|
if (!cancelled && token === renderTokenRef.current) {
|
|
3967
|
-
if (err instanceof
|
|
3982
|
+
if (err instanceof chunkT7BIRNE4_js.EncryptedFileError) {
|
|
3968
3983
|
setIsEncrypted(true);
|
|
3969
3984
|
} else {
|
|
3970
3985
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -3989,24 +4004,12 @@ function useLoadContent({
|
|
|
3989
4004
|
}, [content]);
|
|
3990
4005
|
return { handlerRef };
|
|
3991
4006
|
}
|
|
3992
|
-
|
|
3993
|
-
// src/viewer/hooks/useAutosave-helpers.ts
|
|
3994
|
-
var DEFAULT_AUTOSAVE_INTERVAL_SECONDS = 120;
|
|
3995
|
-
var MIN_AUTOSAVE_INTERVAL_SECONDS = 10;
|
|
3996
|
-
function computeAutosaveIntervalMs(intervalSeconds) {
|
|
3997
|
-
return Math.max(intervalSeconds, MIN_AUTOSAVE_INTERVAL_SECONDS) * 1e3;
|
|
3998
|
-
}
|
|
3999
|
-
|
|
4000
|
-
// src/viewer/hooks/useAutosave.ts
|
|
4001
4007
|
function useAutosave(input) {
|
|
4002
|
-
const {
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
enabled = true,
|
|
4008
|
-
getChangeSources
|
|
4009
|
-
} = input;
|
|
4008
|
+
const { isDirty, filePath, serializeSlides, enabled = true, getChangeSources } = input;
|
|
4009
|
+
const intervalMs = chunkT7BIRNE4_js.resolveAutosaveIntervalMs({
|
|
4010
|
+
hostIntervalMs: input.intervalMs,
|
|
4011
|
+
optionsIntervalSeconds: input.intervalSeconds
|
|
4012
|
+
});
|
|
4010
4013
|
const [autosaveStatus, setAutosaveStatus] = react.useState({
|
|
4011
4014
|
state: "idle"
|
|
4012
4015
|
});
|
|
@@ -4034,7 +4037,7 @@ function useAutosave(input) {
|
|
|
4034
4037
|
return;
|
|
4035
4038
|
}
|
|
4036
4039
|
const sources = changeSourcesRef.current?.() ?? [];
|
|
4037
|
-
if (!
|
|
4040
|
+
if (!chunkT7BIRNE4_js.shouldWriteAutosaveSnapshot({
|
|
4038
4041
|
filePath: path,
|
|
4039
4042
|
isDirty: isDirtyRef.current,
|
|
4040
4043
|
saving: isSavingRef.current,
|
|
@@ -4052,8 +4055,8 @@ function useAutosave(input) {
|
|
|
4052
4055
|
isSavingRef.current = false;
|
|
4053
4056
|
return;
|
|
4054
4057
|
}
|
|
4055
|
-
await
|
|
4056
|
-
lastSnapshotRef.current =
|
|
4058
|
+
await chunkT7BIRNE4_js.saveAutosaveSnapshot(path, data);
|
|
4059
|
+
lastSnapshotRef.current = chunkT7BIRNE4_js.autosaveSnapshotMark(path, sources);
|
|
4057
4060
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4058
4061
|
} catch (err) {
|
|
4059
4062
|
setAutosaveStatus({
|
|
@@ -4077,12 +4080,11 @@ function useAutosave(input) {
|
|
|
4077
4080
|
return;
|
|
4078
4081
|
}
|
|
4079
4082
|
setAutosaveStatus((prev) => prev.state === "disabled" ? { state: "idle" } : prev);
|
|
4080
|
-
const ms = computeAutosaveIntervalMs(intervalSeconds);
|
|
4081
4083
|
const id = setInterval(() => {
|
|
4082
4084
|
void doAutosave({ polled: true });
|
|
4083
|
-
},
|
|
4085
|
+
}, intervalMs);
|
|
4084
4086
|
return () => clearInterval(id);
|
|
4085
|
-
}, [enabled, filePath,
|
|
4087
|
+
}, [enabled, filePath, intervalMs, doAutosave]);
|
|
4086
4088
|
return {
|
|
4087
4089
|
autosaveStatus,
|
|
4088
4090
|
triggerAutosave: () => doAutosave()
|
|
@@ -4140,11 +4142,11 @@ function useElementOperations(input) {
|
|
|
4140
4142
|
(elementId, updates) => {
|
|
4141
4143
|
if (masterView?.target) {
|
|
4142
4144
|
applyMasterViewWrite(
|
|
4143
|
-
|
|
4145
|
+
chunkT7BIRNE4_js.updateMasterViewElement(masterView, masterView.target, elementId, updates)
|
|
4144
4146
|
);
|
|
4145
4147
|
return;
|
|
4146
4148
|
}
|
|
4147
|
-
if (
|
|
4149
|
+
if (chunkT7BIRNE4_js.isTemplateElementId(elementId)) {
|
|
4148
4150
|
const slideId = activeSlide?.id;
|
|
4149
4151
|
if (slideId) {
|
|
4150
4152
|
setTemplateElementsBySlideId((prev) => ({
|
|
@@ -4192,7 +4194,7 @@ function useElementOperations(input) {
|
|
|
4192
4194
|
);
|
|
4193
4195
|
const updateSelectedShapeStyle = react.useCallback(
|
|
4194
4196
|
(updates) => {
|
|
4195
|
-
if (!selectedElement || !
|
|
4197
|
+
if (!selectedElement || !chunkT7BIRNE4_js.hasShapeProperties(selectedElement)) {
|
|
4196
4198
|
return;
|
|
4197
4199
|
}
|
|
4198
4200
|
updateSelectedElement({
|
|
@@ -4203,17 +4205,17 @@ function useElementOperations(input) {
|
|
|
4203
4205
|
);
|
|
4204
4206
|
const updateSelectedTextStyle = react.useCallback(
|
|
4205
4207
|
(updates) => {
|
|
4206
|
-
if (!selectedElement || !
|
|
4208
|
+
if (!selectedElement || !chunkT7BIRNE4_js.hasTextProperties(selectedElement)) {
|
|
4207
4209
|
return;
|
|
4208
4210
|
}
|
|
4209
|
-
const inlineSel =
|
|
4211
|
+
const inlineSel = chunkT7BIRNE4_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4210
4212
|
if (inlineSel && selectedElement.textSegments) {
|
|
4211
|
-
const { newSegments: newSegments2, newSelection } =
|
|
4213
|
+
const { newSegments: newSegments2, newSelection } = chunkT7BIRNE4_js.applyStyleToSelectedSegments(
|
|
4212
4214
|
selectedElement.textSegments,
|
|
4213
4215
|
inlineSel,
|
|
4214
4216
|
updates
|
|
4215
4217
|
);
|
|
4216
|
-
|
|
4218
|
+
chunkT7BIRNE4_js.setPendingSelectionRestore(newSelection);
|
|
4217
4219
|
updateSelectedElement({
|
|
4218
4220
|
textSegments: newSegments2
|
|
4219
4221
|
});
|
|
@@ -4233,12 +4235,12 @@ function useElementOperations(input) {
|
|
|
4233
4235
|
);
|
|
4234
4236
|
const updateSelectedTextCase = react.useCallback(
|
|
4235
4237
|
(mode) => {
|
|
4236
|
-
if (!selectedElement || !
|
|
4238
|
+
if (!selectedElement || !chunkT7BIRNE4_js.hasTextProperties(selectedElement)) {
|
|
4237
4239
|
return;
|
|
4238
4240
|
}
|
|
4239
|
-
const inlineSel =
|
|
4241
|
+
const inlineSel = chunkT7BIRNE4_js.getInlineEditorSelection(selectedElement.textSegments);
|
|
4240
4242
|
if (inlineSel && selectedElement.textSegments) {
|
|
4241
|
-
const newSegments =
|
|
4243
|
+
const newSegments = chunkT7BIRNE4_js.applyCaseTransformToSegments(
|
|
4242
4244
|
selectedElement.textSegments,
|
|
4243
4245
|
inlineSel,
|
|
4244
4246
|
mode
|
|
@@ -4248,14 +4250,14 @@ function useElementOperations(input) {
|
|
|
4248
4250
|
}
|
|
4249
4251
|
const updates = {};
|
|
4250
4252
|
if (selectedElement.textSegments && selectedElement.textSegments.length > 0) {
|
|
4251
|
-
updates.textSegments =
|
|
4253
|
+
updates.textSegments = chunkT7BIRNE4_js.applyCaseTransformToSegments(
|
|
4252
4254
|
selectedElement.textSegments,
|
|
4253
4255
|
null,
|
|
4254
4256
|
mode
|
|
4255
4257
|
);
|
|
4256
4258
|
}
|
|
4257
4259
|
if (typeof selectedElement.text === "string") {
|
|
4258
|
-
updates.text =
|
|
4260
|
+
updates.text = chunkT7BIRNE4_js.transformTextCase(selectedElement.text, mode);
|
|
4259
4261
|
}
|
|
4260
4262
|
updateSelectedElement(updates);
|
|
4261
4263
|
},
|
|
@@ -4268,15 +4270,15 @@ function useElementOperations(input) {
|
|
|
4268
4270
|
[setSlides]
|
|
4269
4271
|
);
|
|
4270
4272
|
const masterViewTarget = masterView?.target ?? null;
|
|
4271
|
-
const activeElements = masterViewTarget ?
|
|
4273
|
+
const activeElements = masterViewTarget ? chunkT7BIRNE4_js.masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4272
4274
|
const updateActiveElements = react.useCallback(
|
|
4273
4275
|
(updater) => {
|
|
4274
4276
|
if (masterView?.target) {
|
|
4275
4277
|
applyMasterViewWrite(
|
|
4276
|
-
|
|
4278
|
+
chunkT7BIRNE4_js.replaceMasterViewElements(
|
|
4277
4279
|
masterView,
|
|
4278
4280
|
masterView.target,
|
|
4279
|
-
updater(
|
|
4281
|
+
updater(chunkT7BIRNE4_js.masterViewElements(masterView, masterView.target))
|
|
4280
4282
|
)
|
|
4281
4283
|
);
|
|
4282
4284
|
return;
|
|
@@ -4329,7 +4331,7 @@ function useSectionOperations(input) {
|
|
|
4329
4331
|
const { sections, setSections, slides, setSlides, markDirty } = input;
|
|
4330
4332
|
const addSection2 = react.useCallback(
|
|
4331
4333
|
(name, afterSlideIndex) => {
|
|
4332
|
-
const result =
|
|
4334
|
+
const result = chunkT7BIRNE4_js.addSection(sections, slides, name, afterSlideIndex);
|
|
4333
4335
|
setSlides(result.slides);
|
|
4334
4336
|
setSections(result.sections);
|
|
4335
4337
|
markDirty();
|
|
@@ -4338,7 +4340,7 @@ function useSectionOperations(input) {
|
|
|
4338
4340
|
);
|
|
4339
4341
|
const renameSection2 = react.useCallback(
|
|
4340
4342
|
(sectionId, newName) => {
|
|
4341
|
-
const result =
|
|
4343
|
+
const result = chunkT7BIRNE4_js.renameSection(sections, slides, sectionId, newName);
|
|
4342
4344
|
setSections(result.sections);
|
|
4343
4345
|
setSlides(result.slides);
|
|
4344
4346
|
markDirty();
|
|
@@ -4347,7 +4349,7 @@ function useSectionOperations(input) {
|
|
|
4347
4349
|
);
|
|
4348
4350
|
const deleteSection2 = react.useCallback(
|
|
4349
4351
|
(sectionId) => {
|
|
4350
|
-
const result =
|
|
4352
|
+
const result = chunkT7BIRNE4_js.deleteSection(sections, slides, sectionId);
|
|
4351
4353
|
setSections(result.sections);
|
|
4352
4354
|
setSlides(result.slides);
|
|
4353
4355
|
markDirty();
|
|
@@ -4356,21 +4358,21 @@ function useSectionOperations(input) {
|
|
|
4356
4358
|
);
|
|
4357
4359
|
const moveSectionUp2 = react.useCallback(
|
|
4358
4360
|
(sectionId) => {
|
|
4359
|
-
setSections(
|
|
4361
|
+
setSections(chunkT7BIRNE4_js.moveSectionUp(sections, sectionId));
|
|
4360
4362
|
markDirty();
|
|
4361
4363
|
},
|
|
4362
4364
|
[sections, setSections, markDirty]
|
|
4363
4365
|
);
|
|
4364
4366
|
const moveSectionDown2 = react.useCallback(
|
|
4365
4367
|
(sectionId) => {
|
|
4366
|
-
setSections(
|
|
4368
|
+
setSections(chunkT7BIRNE4_js.moveSectionDown(sections, sectionId));
|
|
4367
4369
|
markDirty();
|
|
4368
4370
|
},
|
|
4369
4371
|
[sections, setSections, markDirty]
|
|
4370
4372
|
);
|
|
4371
4373
|
const moveSlidesToSection2 = react.useCallback(
|
|
4372
4374
|
(slideIndexes, targetSectionId) => {
|
|
4373
|
-
const result =
|
|
4375
|
+
const result = chunkT7BIRNE4_js.moveSlidesToSection(sections, slides, slideIndexes, targetSectionId);
|
|
4374
4376
|
setSlides(result.slides);
|
|
4375
4377
|
setSections(result.sections);
|
|
4376
4378
|
markDirty();
|
|
@@ -4399,19 +4401,19 @@ function useSectionOperations(input) {
|
|
|
4399
4401
|
|
|
4400
4402
|
// src/viewer/hooks/pointer-move-handlers.ts
|
|
4401
4403
|
function computeResizeGeometry(handle, startX, startY, startWidth, startHeight, dx, dy, snapToGrid, gridSpacingPx) {
|
|
4402
|
-
const resized =
|
|
4404
|
+
const resized = chunkT7BIRNE4_js.applyResize(
|
|
4403
4405
|
{ x: startX, y: startY, width: startWidth, height: startHeight },
|
|
4404
4406
|
handle,
|
|
4405
4407
|
dx,
|
|
4406
4408
|
dy,
|
|
4407
4409
|
1,
|
|
4408
|
-
{ minSize:
|
|
4410
|
+
{ minSize: chunkPIJAFM4B_js.MIN_ELEMENT_SIZE }
|
|
4409
4411
|
);
|
|
4410
4412
|
const box = { x: resized.x, y: resized.y, width: resized.width, height: resized.height };
|
|
4411
4413
|
if (!snapToGrid) {
|
|
4412
4414
|
return box;
|
|
4413
4415
|
}
|
|
4414
|
-
return
|
|
4416
|
+
return chunkT7BIRNE4_js.snapBoxToGrid(box, handle, gridSpacingPx, chunkPIJAFM4B_js.MIN_ELEMENT_SIZE);
|
|
4415
4417
|
}
|
|
4416
4418
|
function resolveLiveTarget(input) {
|
|
4417
4419
|
const { livePatcher, editTemplateMode, activeSlide } = input;
|
|
@@ -4524,7 +4526,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4524
4526
|
width: el.width,
|
|
4525
4527
|
height: el.height
|
|
4526
4528
|
}));
|
|
4527
|
-
const snapResult =
|
|
4529
|
+
const snapResult = chunkT7BIRNE4_js.computeSnapToShape(
|
|
4528
4530
|
targetX,
|
|
4529
4531
|
targetY,
|
|
4530
4532
|
primaryEl.width,
|
|
@@ -4563,7 +4565,7 @@ function processDragMove(e, drag, editorScale, snapToGrid, snapToShape, gridSpac
|
|
|
4563
4565
|
if (live) {
|
|
4564
4566
|
for (const id of Object.keys(drag.startPositionsById)) {
|
|
4565
4567
|
const start = drag.startPositionsById[id];
|
|
4566
|
-
|
|
4568
|
+
chunkT7BIRNE4_js.publishLiveGeometry(live.patcher, live.slideId, id, {
|
|
4567
4569
|
x: start.x + appliedDx,
|
|
4568
4570
|
y: start.y + appliedDy
|
|
4569
4571
|
});
|
|
@@ -4597,22 +4599,22 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4597
4599
|
if (rs.domEl) {
|
|
4598
4600
|
rs.domEl.style.left = `${geo.x}px`;
|
|
4599
4601
|
rs.domEl.style.top = `${geo.y}px`;
|
|
4600
|
-
rs.domEl.style.width = `${Math.max(geo.width,
|
|
4601
|
-
rs.domEl.style.height = `${Math.max(geo.height,
|
|
4602
|
+
rs.domEl.style.width = `${Math.max(geo.width, chunkPIJAFM4B_js.MIN_ELEMENT_SIZE)}px`;
|
|
4603
|
+
rs.domEl.style.height = `${Math.max(geo.height, chunkPIJAFM4B_js.MIN_ELEMENT_SIZE)}px`;
|
|
4602
4604
|
}
|
|
4603
4605
|
if (live) {
|
|
4604
|
-
|
|
4606
|
+
chunkT7BIRNE4_js.publishLiveGeometry(live.patcher, live.slideId, rs.elementId, {
|
|
4605
4607
|
x: geo.x,
|
|
4606
4608
|
y: geo.y,
|
|
4607
|
-
width: Math.max(geo.width,
|
|
4608
|
-
height: Math.max(geo.height,
|
|
4609
|
+
width: Math.max(geo.width, chunkPIJAFM4B_js.MIN_ELEMENT_SIZE),
|
|
4610
|
+
height: Math.max(geo.height, chunkPIJAFM4B_js.MIN_ELEMENT_SIZE)
|
|
4609
4611
|
});
|
|
4610
4612
|
}
|
|
4611
4613
|
}
|
|
4612
4614
|
function processAdjustmentMove(e, adj, editorScale, updateElementById) {
|
|
4613
4615
|
const dx = (e.clientX - adj.startClientX) / editorScale;
|
|
4614
4616
|
const dy = (e.clientY - adj.startClientY) / editorScale;
|
|
4615
|
-
const adjustments =
|
|
4617
|
+
const adjustments = chunkT7BIRNE4_js.getDraggedShapeAdjustments(adj, dx, dy);
|
|
4616
4618
|
if (!adj.moved && Math.hypot(dx, dy) > 2) {
|
|
4617
4619
|
adj.moved = true;
|
|
4618
4620
|
}
|
|
@@ -4687,13 +4689,13 @@ function processPointerUp(input) {
|
|
|
4687
4689
|
if (i !== activeSlideIndex) {
|
|
4688
4690
|
return s;
|
|
4689
4691
|
}
|
|
4690
|
-
const rerouted =
|
|
4692
|
+
const rerouted = chunkT7BIRNE4_js.rerouteConnectorsForMovedElements(s.elements, movedIds);
|
|
4691
4693
|
if (rerouted.length === 0) {
|
|
4692
4694
|
return s;
|
|
4693
4695
|
}
|
|
4694
4696
|
return {
|
|
4695
4697
|
...s,
|
|
4696
|
-
elements:
|
|
4698
|
+
elements: chunkT7BIRNE4_js.applyReroutedConnectors(s.elements, rerouted)
|
|
4697
4699
|
};
|
|
4698
4700
|
})
|
|
4699
4701
|
);
|
|
@@ -4718,9 +4720,9 @@ function processPointerUp(input) {
|
|
|
4718
4720
|
}
|
|
4719
4721
|
function commitMarquee(marquee, editTemplateMode, templateElements, activeSlide, applySelection, clearSelection) {
|
|
4720
4722
|
const sourceElements = editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4721
|
-
const hitIds =
|
|
4723
|
+
const hitIds = chunkT7BIRNE4_js.computeMarqueeHitIds(marquee, sourceElements);
|
|
4722
4724
|
if (marquee.additive) {
|
|
4723
|
-
const merged =
|
|
4725
|
+
const merged = chunkT7BIRNE4_js.mergeAdditiveSelection(marquee.baseSelectionIds, hitIds);
|
|
4724
4726
|
if (merged.length > 0) {
|
|
4725
4727
|
applySelection(merged[0], merged);
|
|
4726
4728
|
} else {
|
|
@@ -4743,8 +4745,8 @@ function commitDrag(drag, editTemplateMode, activeSlide, activeSlideIndex, setTe
|
|
|
4743
4745
|
}
|
|
4744
4746
|
return { ...el, x: start.x + dx, y: start.y + dy };
|
|
4745
4747
|
});
|
|
4746
|
-
const rerouted =
|
|
4747
|
-
return
|
|
4748
|
+
const rerouted = chunkT7BIRNE4_js.rerouteConnectorsForMovedElements(movedElements, movedIds);
|
|
4749
|
+
return chunkT7BIRNE4_js.applyReroutedConnectors(movedElements, rerouted);
|
|
4748
4750
|
};
|
|
4749
4751
|
if (editTemplateMode) {
|
|
4750
4752
|
const slideId = activeSlide?.id;
|
|
@@ -4901,9 +4903,9 @@ function useCanvasInteractions(input) {
|
|
|
4901
4903
|
return;
|
|
4902
4904
|
}
|
|
4903
4905
|
const el = elementLookup.get(editId);
|
|
4904
|
-
if (el &&
|
|
4906
|
+
if (el && chunkT7BIRNE4_js.hasTextProperties(el)) {
|
|
4905
4907
|
const committedText = transformCommittedText ? transformCommittedText(inlineEditingText) : inlineEditingText;
|
|
4906
|
-
const newSegments =
|
|
4908
|
+
const newSegments = chunkT7BIRNE4_js.remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
4907
4909
|
ops.updateElementById(editId, {
|
|
4908
4910
|
text: committedText,
|
|
4909
4911
|
textSegments: newSegments
|
|
@@ -4914,7 +4916,7 @@ function useCanvasInteractions(input) {
|
|
|
4914
4916
|
setInlineEditingText("");
|
|
4915
4917
|
};
|
|
4916
4918
|
const openEquationEditorForElement = (el) => {
|
|
4917
|
-
if (!
|
|
4919
|
+
if (!chunkT7BIRNE4_js.hasTextProperties(el)) {
|
|
4918
4920
|
return false;
|
|
4919
4921
|
}
|
|
4920
4922
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -4944,7 +4946,7 @@ function useCanvasInteractions(input) {
|
|
|
4944
4946
|
justInteractedRef.current = false;
|
|
4945
4947
|
} else {
|
|
4946
4948
|
const el = elementLookup.get(elementId);
|
|
4947
|
-
if (el &&
|
|
4949
|
+
if (el && chunkT7BIRNE4_js.hasTextProperties(el) && chunkT7BIRNE4_js.canInteractWithElement(el, "textEdit")) {
|
|
4948
4950
|
if (!openEquationEditorForElement(el)) {
|
|
4949
4951
|
setInlineEditingElementId(elementId);
|
|
4950
4952
|
setInlineEditingText(el.text ?? "");
|
|
@@ -4963,7 +4965,7 @@ function useCanvasInteractions(input) {
|
|
|
4963
4965
|
if (openEquationEditorForElement(el)) {
|
|
4964
4966
|
return;
|
|
4965
4967
|
}
|
|
4966
|
-
if (
|
|
4968
|
+
if (chunkT7BIRNE4_js.hasTextProperties(el) && chunkT7BIRNE4_js.canInteractWithElement(el, "textEdit")) {
|
|
4967
4969
|
setInlineEditingElementId(elementId);
|
|
4968
4970
|
setInlineEditingText(el.text ?? "");
|
|
4969
4971
|
}
|
|
@@ -4986,7 +4988,7 @@ function useCanvasInteractions(input) {
|
|
|
4986
4988
|
justSelectedRef.current = false;
|
|
4987
4989
|
}
|
|
4988
4990
|
const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
|
|
4989
|
-
const movableIds =
|
|
4991
|
+
const movableIds = chunkT7BIRNE4_js.filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
|
|
4990
4992
|
if (movableIds.length === 0) {
|
|
4991
4993
|
return;
|
|
4992
4994
|
}
|
|
@@ -5056,7 +5058,7 @@ function useCanvasInteractions(input) {
|
|
|
5056
5058
|
const handleResizePointerDown = (elementId, e, handle) => {
|
|
5057
5059
|
e.stopPropagation();
|
|
5058
5060
|
const el = elementLookup.get(elementId);
|
|
5059
|
-
if (!el || !
|
|
5061
|
+
if (!el || !chunkT7BIRNE4_js.canInteractWithElement(el, "resize")) {
|
|
5060
5062
|
return;
|
|
5061
5063
|
}
|
|
5062
5064
|
resizeStateRef.current = {
|
|
@@ -5078,7 +5080,7 @@ function useCanvasInteractions(input) {
|
|
|
5078
5080
|
};
|
|
5079
5081
|
const handleRotate = (elementId, rotationDeg) => {
|
|
5080
5082
|
const el = elementLookup.get(elementId);
|
|
5081
|
-
if (!el || !
|
|
5083
|
+
if (!el || !chunkT7BIRNE4_js.canInteractWithElement(el, "rotate")) {
|
|
5082
5084
|
return;
|
|
5083
5085
|
}
|
|
5084
5086
|
ops.updateElementById(elementId, { rotation: rotationDeg });
|
|
@@ -5098,10 +5100,10 @@ function useCanvasInteractions(input) {
|
|
|
5098
5100
|
const handleAdjustmentPointerDown = (elementId, e, descriptor) => {
|
|
5099
5101
|
e.stopPropagation();
|
|
5100
5102
|
const el = elementLookup.get(elementId);
|
|
5101
|
-
if (!el || !
|
|
5103
|
+
if (!el || !chunkT7BIRNE4_js.canInteractWithElement(el, "adjustHandle")) {
|
|
5102
5104
|
return;
|
|
5103
5105
|
}
|
|
5104
|
-
shapeAdjustmentDragStateRef.current =
|
|
5106
|
+
shapeAdjustmentDragStateRef.current = chunkT7BIRNE4_js.beginShapeAdjustment(
|
|
5105
5107
|
el,
|
|
5106
5108
|
descriptor,
|
|
5107
5109
|
e.clientX,
|
|
@@ -5148,7 +5150,7 @@ function createFileHandlers(deps) {
|
|
|
5148
5150
|
h = Math.round(h * scale);
|
|
5149
5151
|
}
|
|
5150
5152
|
addElement({
|
|
5151
|
-
id:
|
|
5153
|
+
id: chunkT7BIRNE4_js.generateElementId(),
|
|
5152
5154
|
type: "image",
|
|
5153
5155
|
x: Math.round((canvasSize.width - w) / 2),
|
|
5154
5156
|
y: Math.round((canvasSize.height - h) / 2),
|
|
@@ -5159,7 +5161,7 @@ function createFileHandlers(deps) {
|
|
|
5159
5161
|
};
|
|
5160
5162
|
img.onerror = () => {
|
|
5161
5163
|
addElement({
|
|
5162
|
-
id:
|
|
5164
|
+
id: chunkT7BIRNE4_js.generateElementId(),
|
|
5163
5165
|
type: "image",
|
|
5164
5166
|
x: 100,
|
|
5165
5167
|
y: 100,
|
|
@@ -5185,7 +5187,7 @@ function createFileHandlers(deps) {
|
|
|
5185
5187
|
const elFilePath = file.path;
|
|
5186
5188
|
const insertMediaElement = (mediaSourceUrl, width, height) => {
|
|
5187
5189
|
addElement({
|
|
5188
|
-
id:
|
|
5190
|
+
id: chunkT7BIRNE4_js.generateElementId(),
|
|
5189
5191
|
type: "media",
|
|
5190
5192
|
mediaType,
|
|
5191
5193
|
mediaMimeType: file.type || void 0,
|
|
@@ -5360,13 +5362,13 @@ function createStructuredElementHandlers(deps) {
|
|
|
5360
5362
|
return;
|
|
5361
5363
|
}
|
|
5362
5364
|
addElement({
|
|
5363
|
-
id:
|
|
5365
|
+
id: chunkT7BIRNE4_js.generateElementId(),
|
|
5364
5366
|
type: "smartArt",
|
|
5365
5367
|
x: 100,
|
|
5366
5368
|
y: 120,
|
|
5367
5369
|
width: 600,
|
|
5368
5370
|
height: 340,
|
|
5369
|
-
smartArtData:
|
|
5371
|
+
smartArtData: chunkT7BIRNE4_js.buildSmartArtPresetData(
|
|
5370
5372
|
layout,
|
|
5371
5373
|
defaultItems,
|
|
5372
5374
|
(i) => `node-${Date.now()}-${i}-${Math.random().toString(36).slice(2, 8)}`
|
|
@@ -5378,7 +5380,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5378
5380
|
return;
|
|
5379
5381
|
}
|
|
5380
5382
|
addElement({
|
|
5381
|
-
id:
|
|
5383
|
+
id: chunkT7BIRNE4_js.generateElementId(),
|
|
5382
5384
|
type: "shape",
|
|
5383
5385
|
x: 120,
|
|
5384
5386
|
y: 200,
|
|
@@ -5437,7 +5439,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5437
5439
|
const displayText = value || fieldTexts[fieldType] || fieldType;
|
|
5438
5440
|
const fieldGuid = `{${crypto.randomUUID().toUpperCase()}}`;
|
|
5439
5441
|
addElement({
|
|
5440
|
-
id:
|
|
5442
|
+
id: chunkT7BIRNE4_js.generateElementId(),
|
|
5441
5443
|
type: "shape",
|
|
5442
5444
|
x: 120,
|
|
5443
5445
|
y: 200,
|
|
@@ -5459,11 +5461,11 @@ function createStructuredElementHandlers(deps) {
|
|
|
5459
5461
|
if (!activeSlide) {
|
|
5460
5462
|
return;
|
|
5461
5463
|
}
|
|
5462
|
-
const preset =
|
|
5464
|
+
const preset = chunkT7BIRNE4_js.ACTION_BUTTON_PRESETS.find((p) => p.shapeType === shapeType);
|
|
5463
5465
|
if (!preset) {
|
|
5464
5466
|
return;
|
|
5465
5467
|
}
|
|
5466
|
-
const defaultPptxAction =
|
|
5468
|
+
const defaultPptxAction = chunkT7BIRNE4_js.elementActionToPptxAction({
|
|
5467
5469
|
trigger: "click",
|
|
5468
5470
|
type: preset.defaultAction
|
|
5469
5471
|
});
|
|
@@ -5472,7 +5474,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
5472
5474
|
defaultPptxAction.highlightClick = true;
|
|
5473
5475
|
}
|
|
5474
5476
|
addElement({
|
|
5475
|
-
id:
|
|
5477
|
+
id: chunkT7BIRNE4_js.generateElementId(),
|
|
5476
5478
|
type: "shape",
|
|
5477
5479
|
x: 150,
|
|
5478
5480
|
y: 150,
|
|
@@ -5539,14 +5541,14 @@ function useInsertElements(input) {
|
|
|
5539
5541
|
return;
|
|
5540
5542
|
}
|
|
5541
5543
|
addElement({
|
|
5542
|
-
id:
|
|
5544
|
+
id: chunkT7BIRNE4_js.generateElementId(),
|
|
5543
5545
|
type: "text",
|
|
5544
5546
|
x: 100,
|
|
5545
5547
|
y: 100,
|
|
5546
5548
|
width: 300,
|
|
5547
5549
|
height: 60,
|
|
5548
5550
|
text: "",
|
|
5549
|
-
textStyle: { fontSize:
|
|
5551
|
+
textStyle: { fontSize: chunkPIJAFM4B_js.DEFAULT_TEXT_FONT_SIZE }
|
|
5550
5552
|
});
|
|
5551
5553
|
};
|
|
5552
5554
|
const handleAddShape = () => {
|
|
@@ -5554,7 +5556,7 @@ function useInsertElements(input) {
|
|
|
5554
5556
|
return;
|
|
5555
5557
|
}
|
|
5556
5558
|
addElement({
|
|
5557
|
-
id:
|
|
5559
|
+
id: chunkT7BIRNE4_js.generateElementId(),
|
|
5558
5560
|
type: "shape",
|
|
5559
5561
|
x: 150,
|
|
5560
5562
|
y: 150,
|
|
@@ -5573,15 +5575,15 @@ function useInsertElements(input) {
|
|
|
5573
5575
|
return;
|
|
5574
5576
|
}
|
|
5575
5577
|
addElement({
|
|
5576
|
-
...
|
|
5577
|
-
id:
|
|
5578
|
+
...chunkT7BIRNE4_js.newTableElement(chunkPIJAFM4B_js.DEFAULT_TABLE_ROWS, chunkPIJAFM4B_js.DEFAULT_TABLE_COLUMNS, 100, 200),
|
|
5579
|
+
id: chunkT7BIRNE4_js.generateElementId()
|
|
5578
5580
|
});
|
|
5579
5581
|
};
|
|
5580
5582
|
const handleAddChart = (chartKind) => {
|
|
5581
5583
|
if (!activeSlide) {
|
|
5582
5584
|
return;
|
|
5583
5585
|
}
|
|
5584
|
-
addElement(
|
|
5586
|
+
addElement(chunkT7BIRNE4_js.createDefaultChartElement(chartKind));
|
|
5585
5587
|
};
|
|
5586
5588
|
const structured = createStructuredElementHandlers({
|
|
5587
5589
|
activeSlide,
|
|
@@ -5651,7 +5653,7 @@ function useClipboardHandlers(input) {
|
|
|
5651
5653
|
if (!selectedElement) {
|
|
5652
5654
|
return;
|
|
5653
5655
|
}
|
|
5654
|
-
setClipboardPayload(
|
|
5656
|
+
setClipboardPayload(chunkT7BIRNE4_js.buildElementClipboardPayload(selectedElement, editTemplateMode));
|
|
5655
5657
|
};
|
|
5656
5658
|
const handleDelete = () => {
|
|
5657
5659
|
const idsToDelete = effectiveSelectedIds;
|
|
@@ -5668,7 +5670,7 @@ function useClipboardHandlers(input) {
|
|
|
5668
5670
|
handleDelete();
|
|
5669
5671
|
};
|
|
5670
5672
|
const insertClone = (source) => {
|
|
5671
|
-
const clone =
|
|
5673
|
+
const clone = chunkT7BIRNE4_js.cloneElementForPaste(source, { intoTemplate: editTemplateMode });
|
|
5672
5674
|
ops.updateActiveElements((els) => [...els, clone]);
|
|
5673
5675
|
ops.applySelection(clone.id);
|
|
5674
5676
|
history.markDirty();
|
|
@@ -5703,7 +5705,7 @@ function resolveShapePath(el) {
|
|
|
5703
5705
|
return el.pathData;
|
|
5704
5706
|
}
|
|
5705
5707
|
if ("shapeType" in el && typeof el.shapeType === "string") {
|
|
5706
|
-
const clipPath =
|
|
5708
|
+
const clipPath = chunkT7BIRNE4_js.getPresetShapeClipPath(el.shapeType);
|
|
5707
5709
|
if (clipPath) {
|
|
5708
5710
|
const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
|
|
5709
5711
|
if (svgPath) {
|
|
@@ -5754,7 +5756,7 @@ function clipPathToSvgPath(clipPath, width, height) {
|
|
|
5754
5756
|
return parts.join(" ");
|
|
5755
5757
|
}
|
|
5756
5758
|
function transformPathToGlobal(pathData, el) {
|
|
5757
|
-
const polys =
|
|
5759
|
+
const polys = chunkT7BIRNE4_js.svgPathToPolygons(pathData);
|
|
5758
5760
|
if (polys.length === 0) {
|
|
5759
5761
|
return pathData;
|
|
5760
5762
|
}
|
|
@@ -5774,10 +5776,10 @@ function transformPathToGlobal(pathData, el) {
|
|
|
5774
5776
|
y: pt.y * scaleY + el.y
|
|
5775
5777
|
}))
|
|
5776
5778
|
);
|
|
5777
|
-
return
|
|
5779
|
+
return chunkT7BIRNE4_js.polygonsToSvgPath(transformed);
|
|
5778
5780
|
}
|
|
5779
5781
|
function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
5780
|
-
const polys =
|
|
5782
|
+
const polys = chunkT7BIRNE4_js.svgPathToPolygons(pathData);
|
|
5781
5783
|
if (polys.length === 0) {
|
|
5782
5784
|
return pathData;
|
|
5783
5785
|
}
|
|
@@ -5787,10 +5789,10 @@ function transformPathToLocal(pathData, x, y, _width, _height) {
|
|
|
5787
5789
|
y: pt.y - y
|
|
5788
5790
|
}))
|
|
5789
5791
|
);
|
|
5790
|
-
return
|
|
5792
|
+
return chunkT7BIRNE4_js.polygonsToSvgPath(transformed);
|
|
5791
5793
|
}
|
|
5792
5794
|
function pathBounds(pathData) {
|
|
5793
|
-
const polys =
|
|
5795
|
+
const polys = chunkT7BIRNE4_js.svgPathToPolygons(pathData);
|
|
5794
5796
|
let minX = Infinity;
|
|
5795
5797
|
let minY = Infinity;
|
|
5796
5798
|
let maxX = -Infinity;
|
|
@@ -5849,7 +5851,7 @@ function useMergeShapesHandler(input) {
|
|
|
5849
5851
|
let allFragments = [];
|
|
5850
5852
|
let remaining = globalPaths[0];
|
|
5851
5853
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5852
|
-
const frags =
|
|
5854
|
+
const frags = chunkT7BIRNE4_js.mergeShapes("fragment", remaining, globalPaths[i]);
|
|
5853
5855
|
if (Array.isArray(frags)) {
|
|
5854
5856
|
allFragments = frags;
|
|
5855
5857
|
}
|
|
@@ -5878,7 +5880,7 @@ function useMergeShapesHandler(input) {
|
|
|
5878
5880
|
bounds.height
|
|
5879
5881
|
);
|
|
5880
5882
|
const newEl = {
|
|
5881
|
-
id:
|
|
5883
|
+
id: chunkT7BIRNE4_js.generateElementId(),
|
|
5882
5884
|
type: "shape",
|
|
5883
5885
|
x: bounds.x,
|
|
5884
5886
|
y: bounds.y,
|
|
@@ -5916,7 +5918,7 @@ function useMergeShapesHandler(input) {
|
|
|
5916
5918
|
} else {
|
|
5917
5919
|
let resultPath = globalPaths[0];
|
|
5918
5920
|
for (let i = 1; i < globalPaths.length; i++) {
|
|
5919
|
-
const result =
|
|
5921
|
+
const result = chunkT7BIRNE4_js.mergeShapes(operation, resultPath, globalPaths[i]);
|
|
5920
5922
|
if (typeof result === "string") {
|
|
5921
5923
|
resultPath = result;
|
|
5922
5924
|
}
|
|
@@ -5937,7 +5939,7 @@ function useMergeShapesHandler(input) {
|
|
|
5937
5939
|
);
|
|
5938
5940
|
const primary = targets[0];
|
|
5939
5941
|
const newEl = {
|
|
5940
|
-
id:
|
|
5942
|
+
id: chunkT7BIRNE4_js.generateElementId(),
|
|
5941
5943
|
type: "shape",
|
|
5942
5944
|
x: bounds.x,
|
|
5943
5945
|
y: bounds.y,
|
|
@@ -6000,7 +6002,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6000
6002
|
if (ids.length < 2 || !activeSlide) {
|
|
6001
6003
|
return;
|
|
6002
6004
|
}
|
|
6003
|
-
const { elements, groupId } =
|
|
6005
|
+
const { elements, groupId } = chunkT7BIRNE4_js.groupElements(ops.activeElements, ids, chunkT7BIRNE4_js.generateElementId());
|
|
6004
6006
|
if (groupId === null) {
|
|
6005
6007
|
return;
|
|
6006
6008
|
}
|
|
@@ -6013,11 +6015,11 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6013
6015
|
return;
|
|
6014
6016
|
}
|
|
6015
6017
|
const group = selectedElement;
|
|
6016
|
-
const intoTemplate =
|
|
6018
|
+
const intoTemplate = chunkT7BIRNE4_js.isTemplateElementId(group.id);
|
|
6017
6019
|
const childIds = group.children.map(
|
|
6018
|
-
(child) => intoTemplate ?
|
|
6020
|
+
(child) => intoTemplate ? chunkT7BIRNE4_js.makeCloneId(true, child.id || group.id) : child.id || chunkT7BIRNE4_js.generateElementId()
|
|
6019
6021
|
);
|
|
6020
|
-
const { elements, childIds: usedIds } =
|
|
6022
|
+
const { elements, childIds: usedIds } = chunkT7BIRNE4_js.ungroupElements(
|
|
6021
6023
|
ops.activeElements,
|
|
6022
6024
|
group.id,
|
|
6023
6025
|
childIds,
|
|
@@ -6046,7 +6048,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6046
6048
|
if (!edge) {
|
|
6047
6049
|
return;
|
|
6048
6050
|
}
|
|
6049
|
-
const positions =
|
|
6051
|
+
const positions = chunkT7BIRNE4_js.alignElements(selectedElements, edge);
|
|
6050
6052
|
for (const [id, pos] of positions) {
|
|
6051
6053
|
const el = elementLookup.get(id);
|
|
6052
6054
|
if (!el) {
|
|
@@ -6064,7 +6066,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6064
6066
|
if (!distAxis) {
|
|
6065
6067
|
return;
|
|
6066
6068
|
}
|
|
6067
|
-
const positions =
|
|
6069
|
+
const positions = chunkT7BIRNE4_js.distributeElements(selectedElements, distAxis);
|
|
6068
6070
|
for (const [id, pos] of positions) {
|
|
6069
6071
|
const el = elementLookup.get(id);
|
|
6070
6072
|
if (!el) {
|
|
@@ -6081,7 +6083,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6081
6083
|
}
|
|
6082
6084
|
const id = selectedElement.id;
|
|
6083
6085
|
ops.updateActiveElements(
|
|
6084
|
-
(els) => direction === "forward" ?
|
|
6086
|
+
(els) => direction === "forward" ? chunkT7BIRNE4_js.bringForward(els, id) : direction === "backward" ? chunkT7BIRNE4_js.sendBackward(els, id) : els
|
|
6085
6087
|
);
|
|
6086
6088
|
history.markDirty();
|
|
6087
6089
|
};
|
|
@@ -6091,7 +6093,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6091
6093
|
}
|
|
6092
6094
|
const id = selectedElement.id;
|
|
6093
6095
|
ops.updateActiveElements(
|
|
6094
|
-
(els) => direction === "front" ?
|
|
6096
|
+
(els) => direction === "front" ? chunkT7BIRNE4_js.bringToFront(els, id) : chunkT7BIRNE4_js.sendToBack(els, id)
|
|
6095
6097
|
);
|
|
6096
6098
|
history.markDirty();
|
|
6097
6099
|
};
|
|
@@ -6222,7 +6224,7 @@ function useSlideManagement(input) {
|
|
|
6222
6224
|
theme
|
|
6223
6225
|
} = input;
|
|
6224
6226
|
const handleAddSlide = () => {
|
|
6225
|
-
const newSlide =
|
|
6227
|
+
const newSlide = chunkT7BIRNE4_js.createBlankSlide(slides.length + 1);
|
|
6226
6228
|
ops.updateSlides((prev) => {
|
|
6227
6229
|
const next = [...prev];
|
|
6228
6230
|
next.splice(activeSlideIndex + 1, 0, newSlide);
|
|
@@ -6285,7 +6287,7 @@ function useSlideManagement(input) {
|
|
|
6285
6287
|
}
|
|
6286
6288
|
const clone = {
|
|
6287
6289
|
...src,
|
|
6288
|
-
id:
|
|
6290
|
+
id: chunkT7BIRNE4_js.makeSlideId(),
|
|
6289
6291
|
elements: src.elements.map((el) => ({
|
|
6290
6292
|
...el,
|
|
6291
6293
|
id: `${el.id}-dup-${Math.random().toString(36).slice(2, 6)}`
|
|
@@ -6317,7 +6319,7 @@ function useSlideManagement(input) {
|
|
|
6317
6319
|
const handleInsertSlideFromLayout = (layoutPath, layoutName) => {
|
|
6318
6320
|
const insertAt = activeSlideIndex + 1;
|
|
6319
6321
|
const draft = {
|
|
6320
|
-
...
|
|
6322
|
+
...chunkT7BIRNE4_js.createBlankSlide(slides.length + 1),
|
|
6321
6323
|
layoutPath,
|
|
6322
6324
|
...layoutName ? { layoutName } : {}
|
|
6323
6325
|
};
|
|
@@ -6350,9 +6352,9 @@ function useSlideManagement(input) {
|
|
|
6350
6352
|
};
|
|
6351
6353
|
const handleInsertSlideFromTemplate = (templateId) => {
|
|
6352
6354
|
const insertAt = activeSlideIndex + 1;
|
|
6353
|
-
const draft =
|
|
6355
|
+
const draft = chunkT7BIRNE4_js.buildSlideTemplateSlide(templateId, chunkT7BIRNE4_js.makeSlideId(), slides.length + 1, {
|
|
6354
6356
|
...canvasSize ? { slideWidth: canvasSize.width, slideHeight: canvasSize.height } : {},
|
|
6355
|
-
scheme:
|
|
6357
|
+
scheme: chunkT7BIRNE4_js.templateSchemeFromTheme(theme?.colorScheme)
|
|
6356
6358
|
});
|
|
6357
6359
|
ops.updateSlides((prev) => insertSlideFromLayoutUpdater(prev, activeSlideIndex, draft));
|
|
6358
6360
|
setActiveSlideIndex(insertAt);
|
|
@@ -6389,7 +6391,7 @@ function createTableMergeHandlers(input) {
|
|
|
6389
6391
|
if (!nextCell || nextCell.hMerge || nextCell.vMerge) {
|
|
6390
6392
|
return;
|
|
6391
6393
|
}
|
|
6392
|
-
const newTableData =
|
|
6394
|
+
const newTableData = chunkT7BIRNE4_js.mergeCells(
|
|
6393
6395
|
[
|
|
6394
6396
|
{ row: rowIndex, col: columnIndex },
|
|
6395
6397
|
{ row: rowIndex, col: nextColIdx }
|
|
@@ -6397,7 +6399,7 @@ function createTableMergeHandlers(input) {
|
|
|
6397
6399
|
td
|
|
6398
6400
|
);
|
|
6399
6401
|
const updates = { tableData: newTableData };
|
|
6400
|
-
const newRawXml =
|
|
6402
|
+
const newRawXml = chunkT7BIRNE4_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6401
6403
|
if (newRawXml) {
|
|
6402
6404
|
updates.rawXml = newRawXml;
|
|
6403
6405
|
}
|
|
@@ -6423,7 +6425,7 @@ function createTableMergeHandlers(input) {
|
|
|
6423
6425
|
if (!targetNextCell || targetNextCell.hMerge || targetNextCell.vMerge) {
|
|
6424
6426
|
return;
|
|
6425
6427
|
}
|
|
6426
|
-
const newTableData =
|
|
6428
|
+
const newTableData = chunkT7BIRNE4_js.mergeCells(
|
|
6427
6429
|
[
|
|
6428
6430
|
{ row: rowIndex, col: columnIndex },
|
|
6429
6431
|
{ row: targetNextRowIdx, col: columnIndex }
|
|
@@ -6431,7 +6433,7 @@ function createTableMergeHandlers(input) {
|
|
|
6431
6433
|
td
|
|
6432
6434
|
);
|
|
6433
6435
|
const updates = { tableData: newTableData };
|
|
6434
|
-
const newRawXml =
|
|
6436
|
+
const newRawXml = chunkT7BIRNE4_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6435
6437
|
if (newRawXml) {
|
|
6436
6438
|
updates.rawXml = newRawXml;
|
|
6437
6439
|
}
|
|
@@ -6446,9 +6448,9 @@ function createTableMergeHandlers(input) {
|
|
|
6446
6448
|
return;
|
|
6447
6449
|
}
|
|
6448
6450
|
const td = selectedElement.tableData;
|
|
6449
|
-
const newTableData =
|
|
6451
|
+
const newTableData = chunkT7BIRNE4_js.mergeCells(ts.selectedCells, td);
|
|
6450
6452
|
const updates = { tableData: newTableData };
|
|
6451
|
-
const newRawXml =
|
|
6453
|
+
const newRawXml = chunkT7BIRNE4_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6452
6454
|
if (newRawXml) {
|
|
6453
6455
|
updates.rawXml = newRawXml;
|
|
6454
6456
|
}
|
|
@@ -6465,9 +6467,9 @@ function createTableMergeHandlers(input) {
|
|
|
6465
6467
|
}
|
|
6466
6468
|
const { rowIndex, columnIndex } = ts;
|
|
6467
6469
|
const td = selectedElement.tableData;
|
|
6468
|
-
const newTableData =
|
|
6470
|
+
const newTableData = chunkT7BIRNE4_js.splitCell(rowIndex, columnIndex, td);
|
|
6469
6471
|
const updates = { tableData: newTableData };
|
|
6470
|
-
const newRawXml =
|
|
6472
|
+
const newRawXml = chunkT7BIRNE4_js.updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
6471
6473
|
if (newRawXml) {
|
|
6472
6474
|
updates.rawXml = newRawXml;
|
|
6473
6475
|
}
|
|
@@ -6499,19 +6501,10 @@ function createTableStructHandlers(input) {
|
|
|
6499
6501
|
}
|
|
6500
6502
|
const updates = {};
|
|
6501
6503
|
if (el.tableData) {
|
|
6502
|
-
|
|
6503
|
-
if (ri !== rowIndex) {
|
|
6504
|
-
return row;
|
|
6505
|
-
}
|
|
6506
|
-
return {
|
|
6507
|
-
...row,
|
|
6508
|
-
cells: row.cells.map((cell, ci) => ci !== colIndex ? cell : { ...cell, text })
|
|
6509
|
-
};
|
|
6510
|
-
});
|
|
6511
|
-
updates.tableData = { ...el.tableData, rows: newRows };
|
|
6504
|
+
updates.tableData = chunkT7BIRNE4_js.setCellText(el, rowIndex, colIndex, text).tableData;
|
|
6512
6505
|
}
|
|
6513
6506
|
if (el.rawXml) {
|
|
6514
|
-
const newRawXml =
|
|
6507
|
+
const newRawXml = chunkT7BIRNE4_js.updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
6515
6508
|
if (newRawXml) {
|
|
6516
6509
|
updates.rawXml = newRawXml;
|
|
6517
6510
|
}
|
|
@@ -6535,7 +6528,7 @@ function createTableStructHandlers(input) {
|
|
|
6535
6528
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
6536
6529
|
const updates = {};
|
|
6537
6530
|
if (selectedElement.rawXml) {
|
|
6538
|
-
const newRawXml =
|
|
6531
|
+
const newRawXml = chunkT7BIRNE4_js.updateCellTextStyleInRawXml(
|
|
6539
6532
|
selectedElement,
|
|
6540
6533
|
rowIndex,
|
|
6541
6534
|
colIndex,
|
|
@@ -6599,9 +6592,9 @@ function createTableStructHandlers(input) {
|
|
|
6599
6592
|
return;
|
|
6600
6593
|
}
|
|
6601
6594
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6602
|
-
const newTableData =
|
|
6595
|
+
const newTableData = chunkT7BIRNE4_js.insertTableRow(selectedElement.tableData, rowIdx, position);
|
|
6603
6596
|
const updates = { tableData: newTableData };
|
|
6604
|
-
const newRawXml =
|
|
6597
|
+
const newRawXml = chunkT7BIRNE4_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6605
6598
|
if (newRawXml) {
|
|
6606
6599
|
updates.rawXml = newRawXml;
|
|
6607
6600
|
}
|
|
@@ -6614,12 +6607,12 @@ function createTableStructHandlers(input) {
|
|
|
6614
6607
|
}
|
|
6615
6608
|
const td = selectedElement.tableData;
|
|
6616
6609
|
const rowIdx = ts?.rowIndex ?? 0;
|
|
6617
|
-
const newTableData =
|
|
6610
|
+
const newTableData = chunkT7BIRNE4_js.deleteTableRow(td, rowIdx);
|
|
6618
6611
|
if (newTableData === td) {
|
|
6619
6612
|
return;
|
|
6620
6613
|
}
|
|
6621
6614
|
const updates = { tableData: newTableData };
|
|
6622
|
-
const newRawXml =
|
|
6615
|
+
const newRawXml = chunkT7BIRNE4_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6623
6616
|
if (newRawXml) {
|
|
6624
6617
|
updates.rawXml = newRawXml;
|
|
6625
6618
|
}
|
|
@@ -6631,9 +6624,9 @@ function createTableStructHandlers(input) {
|
|
|
6631
6624
|
return;
|
|
6632
6625
|
}
|
|
6633
6626
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6634
|
-
const newTableData =
|
|
6627
|
+
const newTableData = chunkT7BIRNE4_js.insertTableColumn(selectedElement.tableData, colIdx, position);
|
|
6635
6628
|
const updates = { tableData: newTableData };
|
|
6636
|
-
const newRawXml =
|
|
6629
|
+
const newRawXml = chunkT7BIRNE4_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6637
6630
|
if (newRawXml) {
|
|
6638
6631
|
updates.rawXml = newRawXml;
|
|
6639
6632
|
}
|
|
@@ -6646,12 +6639,12 @@ function createTableStructHandlers(input) {
|
|
|
6646
6639
|
}
|
|
6647
6640
|
const td = selectedElement.tableData;
|
|
6648
6641
|
const colIdx = ts?.columnIndex ?? 0;
|
|
6649
|
-
const newTableData =
|
|
6642
|
+
const newTableData = chunkT7BIRNE4_js.deleteTableColumn(td, colIdx);
|
|
6650
6643
|
if (newTableData === td) {
|
|
6651
6644
|
return;
|
|
6652
6645
|
}
|
|
6653
6646
|
const updates = { tableData: newTableData };
|
|
6654
|
-
const newRawXml =
|
|
6647
|
+
const newRawXml = chunkT7BIRNE4_js.rebuildTableStructureInRawXml(selectedElement, newTableData);
|
|
6655
6648
|
if (newRawXml) {
|
|
6656
6649
|
updates.rawXml = newRawXml;
|
|
6657
6650
|
}
|
|
@@ -6687,8 +6680,8 @@ async function renderToCanvas(element, options = {}) {
|
|
|
6687
6680
|
return html2canvasPro(element, {
|
|
6688
6681
|
...options,
|
|
6689
6682
|
onclone: async (doc, clonedEl) => {
|
|
6690
|
-
await
|
|
6691
|
-
|
|
6683
|
+
await chunkT7BIRNE4_js.normalizeColorsForCapture(doc, clonedEl);
|
|
6684
|
+
chunkT7BIRNE4_js.preprocessCssForCapture(clonedEl);
|
|
6692
6685
|
if (typeof userOnClone === "function") {
|
|
6693
6686
|
userOnClone(doc, clonedEl);
|
|
6694
6687
|
}
|
|
@@ -6744,7 +6737,7 @@ async function exportSlideToPngBlob(slideElement, options = {}) {
|
|
|
6744
6737
|
}
|
|
6745
6738
|
async function exportSlideAsPng(slideElement, slideIndex, options = {}) {
|
|
6746
6739
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
6747
|
-
|
|
6740
|
+
chunkT7BIRNE4_js.downloadBlob(blob, `slide-${slideIndex + 1}.png`);
|
|
6748
6741
|
}
|
|
6749
6742
|
async function copySlideToClipboard(slideElement, options = {}) {
|
|
6750
6743
|
const blob = await exportSlideToPngBlob(slideElement, options);
|
|
@@ -6766,15 +6759,15 @@ async function exportAllSlidesAsPdf(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6766
6759
|
continue;
|
|
6767
6760
|
}
|
|
6768
6761
|
const canvas = await renderElementToCanvas(stageEl, scale);
|
|
6769
|
-
images.push(
|
|
6762
|
+
images.push(chunkT7BIRNE4_js.canvasToJpegData(canvas));
|
|
6770
6763
|
}
|
|
6771
6764
|
onProgress?.(totalSlides, totalSlides);
|
|
6772
6765
|
setActiveSlide(currentSlideIndex);
|
|
6773
6766
|
if (images.length === 0) {
|
|
6774
|
-
throw new Error(
|
|
6767
|
+
throw new Error(chunkMVKRI3CZ_js.translationsEn["pptx.export.errorNoSlidesPdf"]);
|
|
6775
6768
|
}
|
|
6776
|
-
const pdfBlobUrl =
|
|
6777
|
-
|
|
6769
|
+
const pdfBlobUrl = chunkPIJAFM4B_js.buildPdfFromImageData(images);
|
|
6770
|
+
chunkT7BIRNE4_js.downloadDataUrl(pdfBlobUrl, filename);
|
|
6778
6771
|
}
|
|
6779
6772
|
async function captureAllSlidesAsPngDataUrls(slideStageRef, totalSlides, setActiveSlide, currentSlideIndex, options = {}) {
|
|
6780
6773
|
const { scale = 2, onProgress } = options;
|
|
@@ -6820,10 +6813,10 @@ async function exportAllSlidesAsNotesPdf(slideStageRef, totalSlides, setActiveSl
|
|
|
6820
6813
|
onProgress?.(totalSlides, totalSlides);
|
|
6821
6814
|
setActiveSlide(currentSlideIndex);
|
|
6822
6815
|
if (pages.length === 0) {
|
|
6823
|
-
throw new Error(
|
|
6816
|
+
throw new Error(chunkMVKRI3CZ_js.translationsEn["pptx.export.errorNoSlidesNotesPdf"]);
|
|
6824
6817
|
}
|
|
6825
|
-
const pdfDataUrl =
|
|
6826
|
-
|
|
6818
|
+
const pdfDataUrl = chunkPIJAFM4B_js.buildNotesPdf(pages);
|
|
6819
|
+
chunkT7BIRNE4_js.downloadDataUrl(pdfDataUrl, filename);
|
|
6827
6820
|
}
|
|
6828
6821
|
|
|
6829
6822
|
// src/viewer/utils/export-video.ts
|
|
@@ -6854,7 +6847,7 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6854
6847
|
}
|
|
6855
6848
|
setActiveSlide(currentSlideIndex);
|
|
6856
6849
|
if (slideCanvases.length === 0) {
|
|
6857
|
-
throw new Error(
|
|
6850
|
+
throw new Error(chunkMVKRI3CZ_js.translationsEn["pptx.export.errorNoSlidesVideo"]);
|
|
6858
6851
|
}
|
|
6859
6852
|
const firstCanvas = slideCanvases[0];
|
|
6860
6853
|
const recordingCanvas = document.createElement("canvas");
|
|
@@ -6862,12 +6855,12 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6862
6855
|
recordingCanvas.height = firstCanvas.height;
|
|
6863
6856
|
const ctx = recordingCanvas.getContext("2d");
|
|
6864
6857
|
if (!ctx) {
|
|
6865
|
-
throw new Error(
|
|
6858
|
+
throw new Error(chunkMVKRI3CZ_js.translationsEn["pptx.export.errorNo2dContext"]);
|
|
6866
6859
|
}
|
|
6867
6860
|
const fps = 30;
|
|
6868
6861
|
const stream = recordingCanvas.captureStream(fps);
|
|
6869
6862
|
const recorder = new MediaRecorder(stream, {
|
|
6870
|
-
mimeType:
|
|
6863
|
+
mimeType: chunkT7BIRNE4_js.pickSupportedMimeType([...chunkT7BIRNE4_js.WEBM_MIME_CANDIDATES]),
|
|
6871
6864
|
videoBitsPerSecond: 5e6
|
|
6872
6865
|
});
|
|
6873
6866
|
const chunks = [];
|
|
@@ -6890,8 +6883,8 @@ async function exportAllSlidesAsVideo(slideStageRef, totalSlides, setActiveSlide
|
|
|
6890
6883
|
const duration = slideTimingsMs?.[i] ?? slideDurationMs;
|
|
6891
6884
|
ctx.clearRect(0, 0, recordingCanvas.width, recordingCanvas.height);
|
|
6892
6885
|
ctx.drawImage(slideCanvases[i], 0, 0);
|
|
6893
|
-
const frameInterval =
|
|
6894
|
-
const framesNeeded =
|
|
6886
|
+
const frameInterval = chunkT7BIRNE4_js.fpsToFrameIntervalMs(fps);
|
|
6887
|
+
const framesNeeded = chunkT7BIRNE4_js.segmentFrameCount(duration, fps);
|
|
6895
6888
|
for (let f = 0; f < framesNeeded; f++) {
|
|
6896
6889
|
if (signal?.aborted) {
|
|
6897
6890
|
recorder.stop();
|
|
@@ -6938,9 +6931,9 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
6938
6931
|
}
|
|
6939
6932
|
setActiveSlide(currentSlideIndex);
|
|
6940
6933
|
if (frames.length === 0) {
|
|
6941
|
-
throw new Error(
|
|
6934
|
+
throw new Error(chunkMVKRI3CZ_js.translationsEn["pptx.export.errorNoSlidesGif"]);
|
|
6942
6935
|
}
|
|
6943
|
-
const gifBytes =
|
|
6936
|
+
const gifBytes = chunkT7BIRNE4_js.encodeGif(frames, Math.round(slideDurationMs / 10));
|
|
6944
6937
|
onProgress?.(totalSlides, totalSlides);
|
|
6945
6938
|
const buf = new ArrayBuffer(gifBytes.length);
|
|
6946
6939
|
new Uint8Array(buf).set(gifBytes);
|
|
@@ -6994,7 +6987,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
6994
6987
|
continue;
|
|
6995
6988
|
}
|
|
6996
6989
|
onProgress?.(processedCount, data.slides.length);
|
|
6997
|
-
let svg =
|
|
6990
|
+
let svg = chunkT7BIRNE4_js.SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
6998
6991
|
if (embedFonts && fontFaces?.length) {
|
|
6999
6992
|
svg = injectFontFaces(svg, fontFaces);
|
|
7000
6993
|
}
|
|
@@ -7052,13 +7045,13 @@ function useExportSaveAs(input) {
|
|
|
7052
7045
|
setExportProgress(10);
|
|
7053
7046
|
setExportStatusMessage("Adding presentation...");
|
|
7054
7047
|
const pptxData = await serializeSlides();
|
|
7055
|
-
const pptxFilename =
|
|
7048
|
+
const pptxFilename = chunkT7BIRNE4_js.savedPresentationFileName(filePath);
|
|
7056
7049
|
if (pptxData) {
|
|
7057
7050
|
pkgFolder.file(pptxFilename, pptxData);
|
|
7058
7051
|
}
|
|
7059
7052
|
setExportProgress(70);
|
|
7060
7053
|
setExportStatusMessage("Writing README...");
|
|
7061
|
-
const readme =
|
|
7054
|
+
const readme = chunkT7BIRNE4_js.generatePackageReadme(pptxFilename);
|
|
7062
7055
|
pkgFolder.file("README.txt", readme);
|
|
7063
7056
|
if (abortCtrl.signal.aborted) {
|
|
7064
7057
|
throw new DOMException("Export cancelled", "AbortError");
|
|
@@ -7068,7 +7061,7 @@ function useExportSaveAs(input) {
|
|
|
7068
7061
|
const zipBlob = await zip.generateAsync({ type: "blob" });
|
|
7069
7062
|
setExportProgress(95);
|
|
7070
7063
|
setExportStatusMessage("Downloading...");
|
|
7071
|
-
|
|
7064
|
+
chunkT7BIRNE4_js.downloadBlob(zipBlob, `${chunkT7BIRNE4_js.presentationBaseName(pptxFilename)}-package.zip`);
|
|
7072
7065
|
setExportProgress(100);
|
|
7073
7066
|
} catch (err) {
|
|
7074
7067
|
if (err.name !== "AbortError") {
|
|
@@ -7084,13 +7077,13 @@ function useExportSaveAs(input) {
|
|
|
7084
7077
|
if (!handler) {
|
|
7085
7078
|
return;
|
|
7086
7079
|
}
|
|
7087
|
-
const downloadName =
|
|
7080
|
+
const downloadName = chunkT7BIRNE4_js.savedPresentationFileName(filePath, format);
|
|
7088
7081
|
try {
|
|
7089
7082
|
const data = await buildSaveAsData(handler, format);
|
|
7090
7083
|
const blob = new Blob([data], {
|
|
7091
7084
|
type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
7092
7085
|
});
|
|
7093
|
-
|
|
7086
|
+
chunkT7BIRNE4_js.downloadBlob(blob, downloadName);
|
|
7094
7087
|
} catch (err) {
|
|
7095
7088
|
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
7096
7089
|
}
|
|
@@ -7103,18 +7096,18 @@ function useExportSaveAs(input) {
|
|
|
7103
7096
|
const pptxGuides = guides.map((g) => ({
|
|
7104
7097
|
id: g.id,
|
|
7105
7098
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
7106
|
-
positionEmu:
|
|
7099
|
+
positionEmu: chunkT7BIRNE4_js.guidePxToEmu(g.position)
|
|
7107
7100
|
}));
|
|
7108
7101
|
return {
|
|
7109
7102
|
...slide,
|
|
7110
7103
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
7111
7104
|
};
|
|
7112
7105
|
});
|
|
7113
|
-
const slidesToSave =
|
|
7106
|
+
const slidesToSave = chunkT7BIRNE4_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
7114
7107
|
const saveOptions = {
|
|
7115
7108
|
// Save As shares Save's slide-size decision; leaving it out here is how
|
|
7116
7109
|
// a preset picked in the inspector reached one save path and not the other.
|
|
7117
|
-
slideSize:
|
|
7110
|
+
slideSize: chunkT7BIRNE4_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
7118
7111
|
headerFooter,
|
|
7119
7112
|
presentationProperties,
|
|
7120
7113
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -7128,13 +7121,13 @@ function useExportSaveAs(input) {
|
|
|
7128
7121
|
handoutMaster,
|
|
7129
7122
|
outputFormat: format
|
|
7130
7123
|
};
|
|
7131
|
-
return
|
|
7124
|
+
return chunkT7BIRNE4_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
|
|
7132
7125
|
};
|
|
7133
7126
|
const handleExportJson = () => {
|
|
7134
7127
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
7135
|
-
const slideSize =
|
|
7128
|
+
const slideSize = chunkT7BIRNE4_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size;
|
|
7136
7129
|
const data = {
|
|
7137
|
-
slides:
|
|
7130
|
+
slides: chunkT7BIRNE4_js.buildSaveSlides(slides, templateElementsBySlideId),
|
|
7138
7131
|
width: canvasSize.width,
|
|
7139
7132
|
height: canvasSize.height,
|
|
7140
7133
|
widthEmu: slideSize.widthEmu,
|
|
@@ -7153,7 +7146,7 @@ function useExportSaveAs(input) {
|
|
|
7153
7146
|
handoutMaster
|
|
7154
7147
|
};
|
|
7155
7148
|
try {
|
|
7156
|
-
|
|
7149
|
+
chunkT7BIRNE4_js.exportDeckJson(data, sourceName);
|
|
7157
7150
|
} catch (err) {
|
|
7158
7151
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7159
7152
|
}
|
|
@@ -7193,7 +7186,7 @@ function safeConfirm(message) {
|
|
|
7193
7186
|
}
|
|
7194
7187
|
}
|
|
7195
7188
|
function downloadBlob2(blob, filename) {
|
|
7196
|
-
|
|
7189
|
+
chunkT7BIRNE4_js.downloadBlob(blob, chunkT7BIRNE4_js.sanitizeDownloadFilename(filename));
|
|
7197
7190
|
}
|
|
7198
7191
|
|
|
7199
7192
|
// src/viewer/hooks/useExportHandlers.ts
|
|
@@ -7303,21 +7296,21 @@ function useExportHandlers(input) {
|
|
|
7303
7296
|
{
|
|
7304
7297
|
scale: 2,
|
|
7305
7298
|
onProgress: (current, total) => {
|
|
7306
|
-
setExportProgress(
|
|
7307
|
-
setExportStatusMessage(
|
|
7299
|
+
setExportProgress(chunkT7BIRNE4_js.slideProgressPercent(current, total));
|
|
7300
|
+
setExportStatusMessage(chunkT7BIRNE4_js.slideStatusLabel("Rendering", current, total));
|
|
7308
7301
|
},
|
|
7309
7302
|
signal: abortCtrl.signal
|
|
7310
7303
|
}
|
|
7311
7304
|
);
|
|
7312
|
-
setExportProgress(
|
|
7305
|
+
setExportProgress(chunkT7BIRNE4_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7313
7306
|
setExportStatusMessage("Building PDF...");
|
|
7314
7307
|
await new Promise((r) => {
|
|
7315
7308
|
setTimeout(r, 100);
|
|
7316
7309
|
});
|
|
7317
|
-
setExportProgress(
|
|
7310
|
+
setExportProgress(chunkT7BIRNE4_js.EXPORT_DONE_PERCENT);
|
|
7318
7311
|
setExportStatusMessage("Done!");
|
|
7319
7312
|
} catch (err) {
|
|
7320
|
-
if (!
|
|
7313
|
+
if (!chunkT7BIRNE4_js.isExportAbortError(err)) {
|
|
7321
7314
|
console.error("[PowerPointViewer] PDF export failed:", err);
|
|
7322
7315
|
}
|
|
7323
7316
|
} finally {
|
|
@@ -7347,21 +7340,21 @@ function useExportHandlers(input) {
|
|
|
7347
7340
|
{
|
|
7348
7341
|
scale: 2,
|
|
7349
7342
|
onProgress: (current, total) => {
|
|
7350
|
-
setExportProgress(
|
|
7351
|
-
setExportStatusMessage(
|
|
7343
|
+
setExportProgress(chunkT7BIRNE4_js.slideProgressPercent(current, total));
|
|
7344
|
+
setExportStatusMessage(chunkT7BIRNE4_js.slideStatusLabel("Rendering", current, total));
|
|
7352
7345
|
},
|
|
7353
7346
|
signal: abortCtrl.signal
|
|
7354
7347
|
}
|
|
7355
7348
|
);
|
|
7356
|
-
setExportProgress(
|
|
7349
|
+
setExportProgress(chunkT7BIRNE4_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7357
7350
|
setExportStatusMessage("Building PDF...");
|
|
7358
7351
|
await new Promise((r) => {
|
|
7359
7352
|
setTimeout(r, 100);
|
|
7360
7353
|
});
|
|
7361
|
-
setExportProgress(
|
|
7354
|
+
setExportProgress(chunkT7BIRNE4_js.EXPORT_DONE_PERCENT);
|
|
7362
7355
|
setExportStatusMessage("Done!");
|
|
7363
7356
|
} catch (err) {
|
|
7364
|
-
if (!
|
|
7357
|
+
if (!chunkT7BIRNE4_js.isExportAbortError(err)) {
|
|
7365
7358
|
console.error("[PowerPointViewer] Notes PDF export failed:", err);
|
|
7366
7359
|
}
|
|
7367
7360
|
} finally {
|
|
@@ -7402,22 +7395,22 @@ function useExportHandlers(input) {
|
|
|
7402
7395
|
scale: 1,
|
|
7403
7396
|
slideDurationMs: 3e3,
|
|
7404
7397
|
onProgress: (current, total) => {
|
|
7405
|
-
setExportProgress(
|
|
7406
|
-
setExportStatusMessage(
|
|
7398
|
+
setExportProgress(chunkT7BIRNE4_js.slideProgressPercent(current, total, 45));
|
|
7399
|
+
setExportStatusMessage(chunkT7BIRNE4_js.slideStatusLabel("Capturing", current, total));
|
|
7407
7400
|
},
|
|
7408
7401
|
onRecordProgress: (current, total) => {
|
|
7409
|
-
setExportProgress(
|
|
7410
|
-
setExportStatusMessage(
|
|
7402
|
+
setExportProgress(chunkT7BIRNE4_js.recordProgressPercent(current, total));
|
|
7403
|
+
setExportStatusMessage(chunkT7BIRNE4_js.slideStatusLabel("Recording", current, total));
|
|
7411
7404
|
},
|
|
7412
7405
|
signal: abortCtrl.signal
|
|
7413
7406
|
}
|
|
7414
7407
|
);
|
|
7415
|
-
setExportProgress(
|
|
7408
|
+
setExportProgress(chunkT7BIRNE4_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7416
7409
|
setExportStatusMessage("Saving file...");
|
|
7417
7410
|
downloadBlob2(blob, "presentation.webm");
|
|
7418
|
-
setExportProgress(
|
|
7411
|
+
setExportProgress(chunkT7BIRNE4_js.EXPORT_DONE_PERCENT);
|
|
7419
7412
|
} catch (err) {
|
|
7420
|
-
if (!
|
|
7413
|
+
if (!chunkT7BIRNE4_js.isExportAbortError(err)) {
|
|
7421
7414
|
console.error("[PowerPointViewer] Video export failed:", err);
|
|
7422
7415
|
}
|
|
7423
7416
|
} finally {
|
|
@@ -7445,18 +7438,18 @@ function useExportHandlers(input) {
|
|
|
7445
7438
|
scale: 0.5,
|
|
7446
7439
|
slideDurationMs: 2e3,
|
|
7447
7440
|
onProgress: (current, total) => {
|
|
7448
|
-
setExportProgress(
|
|
7449
|
-
setExportStatusMessage(
|
|
7441
|
+
setExportProgress(chunkT7BIRNE4_js.slideProgressPercent(current, total));
|
|
7442
|
+
setExportStatusMessage(chunkT7BIRNE4_js.slideStatusLabel("Encoding", current, total));
|
|
7450
7443
|
},
|
|
7451
7444
|
signal: abortCtrl.signal
|
|
7452
7445
|
}
|
|
7453
7446
|
);
|
|
7454
|
-
setExportProgress(
|
|
7447
|
+
setExportProgress(chunkT7BIRNE4_js.EXPORT_ASSEMBLING_PERCENT);
|
|
7455
7448
|
setExportStatusMessage("Saving file...");
|
|
7456
7449
|
downloadBlob2(blob, "presentation.gif");
|
|
7457
|
-
setExportProgress(
|
|
7450
|
+
setExportProgress(chunkT7BIRNE4_js.EXPORT_DONE_PERCENT);
|
|
7458
7451
|
} catch (err) {
|
|
7459
|
-
if (!
|
|
7452
|
+
if (!chunkT7BIRNE4_js.isExportAbortError(err)) {
|
|
7460
7453
|
console.error("[PowerPointViewer] GIF export failed:", err);
|
|
7461
7454
|
}
|
|
7462
7455
|
} finally {
|
|
@@ -7497,7 +7490,7 @@ function openPrintWindow(title, bodyHtml, orientation, colorFilter, frameSlides)
|
|
|
7497
7490
|
}
|
|
7498
7491
|
printWindow.document.open();
|
|
7499
7492
|
printWindow.document.write(
|
|
7500
|
-
|
|
7493
|
+
chunkT7BIRNE4_js.buildPrintHtmlDocument({ title, bodyHtml, orientation, colorFilter, frameSlides })
|
|
7501
7494
|
);
|
|
7502
7495
|
printWindow.document.close();
|
|
7503
7496
|
printWindow.focus();
|
|
@@ -7558,7 +7551,7 @@ function usePrintHandlers(input) {
|
|
|
7558
7551
|
if (svgs.length === 0) {
|
|
7559
7552
|
return;
|
|
7560
7553
|
}
|
|
7561
|
-
const printDoc =
|
|
7554
|
+
const printDoc = chunkT7BIRNE4_js.buildPrintDocument(svgs, pptxData.width, pptxData.height, {
|
|
7562
7555
|
title: "Slides (Vector)",
|
|
7563
7556
|
orientation: settings.orientation,
|
|
7564
7557
|
colorFilter
|
|
@@ -7594,7 +7587,7 @@ function usePrintHandlers(input) {
|
|
|
7594
7587
|
if (settings.printWhat === "outline") {
|
|
7595
7588
|
openPrintWindow(
|
|
7596
7589
|
"Outline",
|
|
7597
|
-
`<div class="outline-page">${
|
|
7590
|
+
`<div class="outline-page">${chunkT7BIRNE4_js.buildOutlineHtml(slideIndices, slides)}</div>`,
|
|
7598
7591
|
settings.orientation,
|
|
7599
7592
|
colorFilter,
|
|
7600
7593
|
settings.frameSlides
|
|
@@ -7619,7 +7612,7 @@ function usePrintHandlers(input) {
|
|
|
7619
7612
|
if (settings.printWhat === "slides") {
|
|
7620
7613
|
openPrintWindow(
|
|
7621
7614
|
"Slides",
|
|
7622
|
-
|
|
7615
|
+
chunkT7BIRNE4_js.buildSlidesHtml(slideImages, slideIndices),
|
|
7623
7616
|
settings.orientation,
|
|
7624
7617
|
colorFilter,
|
|
7625
7618
|
settings.frameSlides
|
|
@@ -7629,7 +7622,7 @@ function usePrintHandlers(input) {
|
|
|
7629
7622
|
if (settings.printWhat === "notes") {
|
|
7630
7623
|
openPrintWindow(
|
|
7631
7624
|
"Notes Pages",
|
|
7632
|
-
|
|
7625
|
+
chunkT7BIRNE4_js.buildNotesHtml(slideImages, slideIndices, slides),
|
|
7633
7626
|
"portrait",
|
|
7634
7627
|
colorFilter,
|
|
7635
7628
|
settings.frameSlides
|
|
@@ -7640,7 +7633,7 @@ function usePrintHandlers(input) {
|
|
|
7640
7633
|
const spp = settings.slidesPerPage;
|
|
7641
7634
|
openPrintWindow(
|
|
7642
7635
|
`Handout ${spp} per page`,
|
|
7643
|
-
|
|
7636
|
+
chunkT7BIRNE4_js.buildHandoutsHtml(slideImages, slideIndices, spp),
|
|
7644
7637
|
"portrait",
|
|
7645
7638
|
colorFilter,
|
|
7646
7639
|
settings.frameSlides
|
|
@@ -7704,8 +7697,8 @@ function useThemeHandlers(input) {
|
|
|
7704
7697
|
return;
|
|
7705
7698
|
}
|
|
7706
7699
|
await handler.updateThemeColorScheme(colorScheme);
|
|
7707
|
-
const previousMap = theme?.colorScheme ?
|
|
7708
|
-
setSlides((prev) =>
|
|
7700
|
+
const previousMap = theme?.colorScheme ? chunkT7BIRNE4_js.buildThemeColorMap(theme.colorScheme) : {};
|
|
7701
|
+
setSlides((prev) => chunkT7BIRNE4_js.reResolveSlideColors(prev, previousMap, colorScheme));
|
|
7709
7702
|
setTheme((prev) => prev ? { ...prev, colorScheme } : { colorScheme });
|
|
7710
7703
|
bumpHistory();
|
|
7711
7704
|
history.markDirty();
|
|
@@ -7810,7 +7803,7 @@ function useThemeSwitching(input) {
|
|
|
7810
7803
|
}
|
|
7811
7804
|
try {
|
|
7812
7805
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
7813
|
-
const newData =
|
|
7806
|
+
const newData = chunkT7BIRNE4_js.applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
7814
7807
|
onDataChange(newData);
|
|
7815
7808
|
onThemeChanged?.(preset);
|
|
7816
7809
|
} catch (error) {
|
|
@@ -7827,7 +7820,7 @@ function useThemeSwitching(input) {
|
|
|
7827
7820
|
}
|
|
7828
7821
|
try {
|
|
7829
7822
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
7830
|
-
const newData =
|
|
7823
|
+
const newData = chunkT7BIRNE4_js.applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
7831
7824
|
onDataChange(newData);
|
|
7832
7825
|
} catch (error) {
|
|
7833
7826
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -7839,12 +7832,12 @@ function useThemeSwitching(input) {
|
|
|
7839
7832
|
if (!data?.theme?.colorScheme) {
|
|
7840
7833
|
return void 0;
|
|
7841
7834
|
}
|
|
7842
|
-
return
|
|
7843
|
-
(p) =>
|
|
7835
|
+
return chunkT7BIRNE4_js.THEME_PRESETS.find(
|
|
7836
|
+
(p) => chunkT7BIRNE4_js.themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
7844
7837
|
);
|
|
7845
7838
|
}, [data?.theme?.colorScheme]);
|
|
7846
7839
|
return {
|
|
7847
|
-
presets:
|
|
7840
|
+
presets: chunkT7BIRNE4_js.THEME_PRESETS,
|
|
7848
7841
|
switchToPreset,
|
|
7849
7842
|
switchToCustom,
|
|
7850
7843
|
currentPreset
|
|
@@ -7919,7 +7912,7 @@ function usePropertyHandlers(input) {
|
|
|
7919
7912
|
}
|
|
7920
7913
|
try {
|
|
7921
7914
|
const ab = await file.arrayBuffer();
|
|
7922
|
-
const h = new
|
|
7915
|
+
const h = new chunkT7BIRNE4_js.PptxHandler();
|
|
7923
7916
|
const other = await h.load(ab);
|
|
7924
7917
|
if (!other) {
|
|
7925
7918
|
return;
|
|
@@ -7929,7 +7922,7 @@ function usePropertyHandlers(input) {
|
|
|
7929
7922
|
width: canvasSize.width,
|
|
7930
7923
|
height: canvasSize.height
|
|
7931
7924
|
};
|
|
7932
|
-
setCompareResult(
|
|
7925
|
+
setCompareResult(chunkT7BIRNE4_js.comparePresentation(cur, other));
|
|
7933
7926
|
setIsComparePanelOpen(true);
|
|
7934
7927
|
} catch (err) {
|
|
7935
7928
|
console.warn("Compare failed:", err);
|
|
@@ -7946,7 +7939,7 @@ function usePropertyHandlers(input) {
|
|
|
7946
7939
|
if (!diff || diff.status === "unchanged") {
|
|
7947
7940
|
return;
|
|
7948
7941
|
}
|
|
7949
|
-
setSlides((prev) =>
|
|
7942
|
+
setSlides((prev) => chunkT7BIRNE4_js.applyAcceptSlide(prev, diff));
|
|
7950
7943
|
setIsDirty(true);
|
|
7951
7944
|
},
|
|
7952
7945
|
[compareResult, setSlides, setIsDirty]
|
|
@@ -7957,10 +7950,10 @@ function usePropertyHandlers(input) {
|
|
|
7957
7950
|
if (!compareResult) {
|
|
7958
7951
|
return;
|
|
7959
7952
|
}
|
|
7960
|
-
setSlides((prev) =>
|
|
7953
|
+
setSlides((prev) => chunkT7BIRNE4_js.applyAcceptAllSlides(prev, compareResult));
|
|
7961
7954
|
setIsDirty(true);
|
|
7962
7955
|
}, [compareResult, setSlides, setIsDirty]);
|
|
7963
|
-
const usedFontFamilies = react.useMemo(() =>
|
|
7956
|
+
const usedFontFamilies = react.useMemo(() => chunkT7BIRNE4_js.collectUsedFonts(slides), [slides]);
|
|
7964
7957
|
return {
|
|
7965
7958
|
handleUpdateNotes,
|
|
7966
7959
|
handleUpdateSlide,
|
|
@@ -8079,7 +8072,7 @@ function useIsMobile(input) {
|
|
|
8079
8072
|
const containerRef = input?.containerRef;
|
|
8080
8073
|
const isTouchDevice = react.useSyncExternalStore(
|
|
8081
8074
|
subscribeTouchCapability,
|
|
8082
|
-
|
|
8075
|
+
chunkT7BIRNE4_js.detectTouchDevice,
|
|
8083
8076
|
() => false
|
|
8084
8077
|
// server snapshot
|
|
8085
8078
|
);
|
|
@@ -8095,7 +8088,7 @@ function useIsMobile(input) {
|
|
|
8095
8088
|
}
|
|
8096
8089
|
return containerRef?.current?.clientHeight ?? window.innerHeight;
|
|
8097
8090
|
});
|
|
8098
|
-
const [orientation, setOrientation] = react.useState(
|
|
8091
|
+
const [orientation, setOrientation] = react.useState(chunkT7BIRNE4_js.detectOrientation);
|
|
8099
8092
|
const [isVirtualKeyboardOpen, setIsVirtualKeyboardOpen] = react.useState(false);
|
|
8100
8093
|
const [initialViewportHeight] = react.useState(
|
|
8101
8094
|
() => typeof window !== "undefined" ? window.innerHeight : 800
|
|
@@ -8139,7 +8132,7 @@ function useIsMobile(input) {
|
|
|
8139
8132
|
return;
|
|
8140
8133
|
}
|
|
8141
8134
|
const handleOrientationChange = () => {
|
|
8142
|
-
setOrientation(
|
|
8135
|
+
setOrientation(chunkT7BIRNE4_js.detectOrientation());
|
|
8143
8136
|
};
|
|
8144
8137
|
if (screen.orientation) {
|
|
8145
8138
|
screen.orientation.addEventListener("change", handleOrientationChange);
|
|
@@ -8169,9 +8162,9 @@ function useIsMobile(input) {
|
|
|
8169
8162
|
window.addEventListener("resize", handleResize);
|
|
8170
8163
|
return () => window.removeEventListener("resize", handleResize);
|
|
8171
8164
|
}, [isTouchDevice, initialViewportHeight]);
|
|
8172
|
-
const isMobile =
|
|
8173
|
-
const isTablet = !isMobile && containerWidth >=
|
|
8174
|
-
const isDesktop = !isMobile && containerWidth >=
|
|
8165
|
+
const isMobile = chunkT7BIRNE4_js.isMobileViewport(containerWidth, containerHeight, isTouchDevice);
|
|
8166
|
+
const isTablet = !isMobile && containerWidth >= chunkT7BIRNE4_js.MOBILE_BREAKPOINT && containerWidth < chunkT7BIRNE4_js.TABLET_BREAKPOINT;
|
|
8167
|
+
const isDesktop = !isMobile && containerWidth >= chunkT7BIRNE4_js.TABLET_BREAKPOINT;
|
|
8175
8168
|
return {
|
|
8176
8169
|
isMobile,
|
|
8177
8170
|
isTablet,
|
|
@@ -8233,7 +8226,7 @@ function useViewerDialogs(input) {
|
|
|
8233
8226
|
);
|
|
8234
8227
|
const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
|
|
8235
8228
|
const fontEmbedding = react.useMemo(
|
|
8236
|
-
() =>
|
|
8229
|
+
() => chunkT7BIRNE4_js.describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
|
|
8237
8230
|
[embeddedFontKey]
|
|
8238
8231
|
);
|
|
8239
8232
|
const [embedFontsEnabled, setEmbedFontsEnabled] = react.useState(fontEmbedding.initialEnabled);
|
|
@@ -8241,11 +8234,11 @@ function useViewerDialogs(input) {
|
|
|
8241
8234
|
setEmbedFontsEnabled(fontEmbedding.initialEnabled);
|
|
8242
8235
|
}, [fontEmbedding]);
|
|
8243
8236
|
const [isNarrowViewport, setIsNarrowViewport] = react.useState(
|
|
8244
|
-
() => typeof window !== "undefined" ?
|
|
8237
|
+
() => typeof window !== "undefined" ? chunkT7BIRNE4_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8245
8238
|
);
|
|
8246
8239
|
react.useEffect(() => {
|
|
8247
8240
|
const handleWindow = () => setIsNarrowViewport(
|
|
8248
|
-
|
|
8241
|
+
chunkT7BIRNE4_js.isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch())
|
|
8249
8242
|
);
|
|
8250
8243
|
let observer = null;
|
|
8251
8244
|
let raf = 0;
|
|
@@ -8259,12 +8252,12 @@ function useViewerDialogs(input) {
|
|
|
8259
8252
|
const entry = entries[0];
|
|
8260
8253
|
if (entry) {
|
|
8261
8254
|
setIsNarrowViewport(
|
|
8262
|
-
|
|
8255
|
+
chunkT7BIRNE4_js.isMobileViewport(entry.contentRect.width, entry.contentRect.height, viewportIsTouch())
|
|
8263
8256
|
);
|
|
8264
8257
|
}
|
|
8265
8258
|
});
|
|
8266
8259
|
observer.observe(el);
|
|
8267
|
-
setIsNarrowViewport(
|
|
8260
|
+
setIsNarrowViewport(chunkT7BIRNE4_js.isMobileViewport(el.clientWidth, el.clientHeight, viewportIsTouch()));
|
|
8268
8261
|
};
|
|
8269
8262
|
attach();
|
|
8270
8263
|
window.addEventListener("resize", handleWindow);
|
|
@@ -8423,20 +8416,20 @@ function useViewerDialogs(input) {
|
|
|
8423
8416
|
}
|
|
8424
8417
|
function computeGridSpacingPx(presentationGridSpacing) {
|
|
8425
8418
|
if (presentationGridSpacing) {
|
|
8426
|
-
const px = Math.round(presentationGridSpacing.cx /
|
|
8419
|
+
const px = Math.round(presentationGridSpacing.cx / chunkPIJAFM4B_js.EMU_PER_PX);
|
|
8427
8420
|
if (px > 0) {
|
|
8428
8421
|
return px;
|
|
8429
8422
|
}
|
|
8430
8423
|
}
|
|
8431
|
-
return
|
|
8424
|
+
return chunkPIJAFM4B_js.GRID_SIZE;
|
|
8432
8425
|
}
|
|
8433
8426
|
function computeVisibleSlideIndexes(slides, activeCustomShowId, customShows) {
|
|
8434
8427
|
const activeShow = activeCustomShowId ? customShows.find((show) => show.id === activeCustomShowId) : void 0;
|
|
8435
|
-
return
|
|
8428
|
+
return chunkT7BIRNE4_js.resolveShowSlideIndexes(slides, activeShow);
|
|
8436
8429
|
}
|
|
8437
8430
|
function computeSlideSectionGroups(slides, sections) {
|
|
8438
|
-
return
|
|
8439
|
-
id: group.section?.id ?? (sections.length > 0 ?
|
|
8431
|
+
return chunkT7BIRNE4_js.groupSlidesBySection(sections, slides).map((group) => ({
|
|
8432
|
+
id: group.section?.id ?? (sections.length > 0 ? chunkPIJAFM4B_js.UNGROUPED_SECTION_ID : chunkPIJAFM4B_js.DEFAULT_SECTION_GROUP_ID),
|
|
8440
8433
|
label: group.section?.name ?? (sections.length > 0 ? "Ungrouped Slides" : "Slides"),
|
|
8441
8434
|
slideIndexes: group.slideIndexes,
|
|
8442
8435
|
...group.section?.color !== void 0 ? { color: group.section.color } : {},
|
|
@@ -8448,7 +8441,7 @@ function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
|
8448
8441
|
return void 0;
|
|
8449
8442
|
}
|
|
8450
8443
|
const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
|
|
8451
|
-
return
|
|
8444
|
+
return chunkT7BIRNE4_js.masterViewPseudoSlide(document2, {
|
|
8452
8445
|
tab: "slides",
|
|
8453
8446
|
masterIndex: 0,
|
|
8454
8447
|
layoutIndex: activeLayout ? 0 : null
|
|
@@ -8476,10 +8469,10 @@ function useDerivedSlideState(input) {
|
|
|
8476
8469
|
);
|
|
8477
8470
|
const slideSectionGroups = react.useMemo(
|
|
8478
8471
|
() => computeSlideSectionGroups(slides, sections).map((group) => {
|
|
8479
|
-
if (group.id ===
|
|
8472
|
+
if (group.id === chunkPIJAFM4B_js.UNGROUPED_SECTION_ID && group.label === "Ungrouped Slides") {
|
|
8480
8473
|
return { ...group, label: t("pptx.slides.ungroupedSlides") };
|
|
8481
8474
|
}
|
|
8482
|
-
if (group.id ===
|
|
8475
|
+
if (group.id === chunkPIJAFM4B_js.DEFAULT_SECTION_GROUP_ID && group.label === "Slides") {
|
|
8483
8476
|
return { ...group, label: t("pptx.sections.slides") };
|
|
8484
8477
|
}
|
|
8485
8478
|
return group;
|
|
@@ -8579,13 +8572,13 @@ function useAnnotationHandlers(input) {
|
|
|
8579
8572
|
}, [annotations, setMode, setSlides, history]);
|
|
8580
8573
|
const handleSetMode = react.useCallback(
|
|
8581
8574
|
(nextMode) => {
|
|
8582
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8575
|
+
if (mode === "present" && nextMode !== "present" && !chunkT7BIRNE4_js.mayLeaveSlideShow()) {
|
|
8583
8576
|
return;
|
|
8584
8577
|
}
|
|
8585
8578
|
if (nextMode === "present") {
|
|
8586
8579
|
presentation.enterPresentMode();
|
|
8587
8580
|
} else if (mode === "present" && annotations.hasAnyAnnotations) {
|
|
8588
|
-
|
|
8581
|
+
chunkT7BIRNE4_js.stopAllPersistentAudio();
|
|
8589
8582
|
pendingModeAfterAnnotationsRef.current = nextMode;
|
|
8590
8583
|
if (promptKeepInkAnnotations) {
|
|
8591
8584
|
setShowKeepAnnotationsDialog(true);
|
|
@@ -8594,7 +8587,7 @@ function useAnnotationHandlers(input) {
|
|
|
8594
8587
|
}
|
|
8595
8588
|
} else {
|
|
8596
8589
|
if (mode === "present") {
|
|
8597
|
-
|
|
8590
|
+
chunkT7BIRNE4_js.stopAllPersistentAudio();
|
|
8598
8591
|
}
|
|
8599
8592
|
setMode(nextMode);
|
|
8600
8593
|
}
|
|
@@ -8665,13 +8658,13 @@ function useSerialize(input) {
|
|
|
8665
8658
|
let processedSlide = slide;
|
|
8666
8659
|
if (pendingEditId) {
|
|
8667
8660
|
const updatedElements = slide.elements.map((el) => {
|
|
8668
|
-
if (el.id !== pendingEditId || !
|
|
8661
|
+
if (el.id !== pendingEditId || !chunkT7BIRNE4_js.hasTextProperties(el)) {
|
|
8669
8662
|
return el;
|
|
8670
8663
|
}
|
|
8671
8664
|
return {
|
|
8672
8665
|
...el,
|
|
8673
8666
|
text: pendingEditText,
|
|
8674
|
-
textSegments:
|
|
8667
|
+
textSegments: chunkT7BIRNE4_js.remapTextToSegments(pendingEditText, el.textSegments, el.textStyle)
|
|
8675
8668
|
};
|
|
8676
8669
|
});
|
|
8677
8670
|
if (updatedElements.some((el, i) => el !== slide.elements[i])) {
|
|
@@ -8684,19 +8677,19 @@ function useSerialize(input) {
|
|
|
8684
8677
|
const pptxGuides = guides.map((g) => ({
|
|
8685
8678
|
id: g.id,
|
|
8686
8679
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
8687
|
-
positionEmu:
|
|
8680
|
+
positionEmu: chunkT7BIRNE4_js.guidePxToEmu(g.position)
|
|
8688
8681
|
}));
|
|
8689
8682
|
return {
|
|
8690
8683
|
...processedSlide,
|
|
8691
8684
|
guides: pptxGuides.length > 0 ? pptxGuides : void 0
|
|
8692
8685
|
};
|
|
8693
8686
|
});
|
|
8694
|
-
const slidesToSave =
|
|
8687
|
+
const slidesToSave = chunkT7BIRNE4_js.buildSaveSlides(slidesWithGuides, templateElementsBySlideId);
|
|
8695
8688
|
const saveOptions = {
|
|
8696
8689
|
// Without this the Slide Size card edited a viewer-only pixel value and
|
|
8697
8690
|
// the saved `p:sldSz` never moved: passing `slideSize` is the only way a
|
|
8698
8691
|
// slide-size edit reaches the file.
|
|
8699
|
-
slideSize:
|
|
8692
|
+
slideSize: chunkT7BIRNE4_js.resolveSlideSizeSelection({ current: slideSizeEmu, canvas: canvasSize }).size,
|
|
8700
8693
|
headerFooter,
|
|
8701
8694
|
presentationProperties,
|
|
8702
8695
|
customShows: customShows.length > 0 ? customShows : void 0,
|
|
@@ -8708,9 +8701,9 @@ function useSerialize(input) {
|
|
|
8708
8701
|
slideMasters,
|
|
8709
8702
|
notesMaster,
|
|
8710
8703
|
handoutMaster,
|
|
8711
|
-
...
|
|
8704
|
+
...chunkT7BIRNE4_js.embeddedFontSaveOptions(embedFonts)
|
|
8712
8705
|
};
|
|
8713
|
-
return
|
|
8706
|
+
return chunkT7BIRNE4_js.saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
|
|
8714
8707
|
}, [
|
|
8715
8708
|
slides,
|
|
8716
8709
|
templateElementsBySlideId,
|
|
@@ -8737,102 +8730,52 @@ function useSerialize(input) {
|
|
|
8737
8730
|
purpose
|
|
8738
8731
|
]);
|
|
8739
8732
|
}
|
|
8740
|
-
|
|
8741
|
-
// src/viewer/hooks/useRecoveryDetection-helpers.ts
|
|
8742
|
-
function shouldCheckRecovery(input) {
|
|
8743
|
-
const { alreadyChecked, filePath, loading, error, slideCount } = input;
|
|
8744
|
-
if (alreadyChecked) {
|
|
8745
|
-
return false;
|
|
8746
|
-
}
|
|
8747
|
-
if (!filePath) {
|
|
8748
|
-
return false;
|
|
8749
|
-
}
|
|
8750
|
-
if (loading) {
|
|
8751
|
-
return false;
|
|
8752
|
-
}
|
|
8753
|
-
if (error) {
|
|
8754
|
-
return false;
|
|
8755
|
-
}
|
|
8756
|
-
if (slideCount === 0) {
|
|
8757
|
-
return false;
|
|
8758
|
-
}
|
|
8759
|
-
return true;
|
|
8760
|
-
}
|
|
8761
|
-
var RECOVERY_WINDOW_MS = 24 * 60 * 60 * 1e3;
|
|
8762
|
-
function isRecentRecovery(timestamp, now) {
|
|
8763
|
-
return now - timestamp < RECOVERY_WINDOW_MS;
|
|
8764
|
-
}
|
|
8765
|
-
function hasRecentRecoveryVersion(versions, now) {
|
|
8766
|
-
if (versions.length === 0) {
|
|
8767
|
-
return false;
|
|
8768
|
-
}
|
|
8769
|
-
return isRecentRecovery(versions[0].timestamp, now);
|
|
8770
|
-
}
|
|
8771
|
-
|
|
8772
|
-
// src/viewer/hooks/useRecoveryDetection.ts
|
|
8773
|
-
var DB_NAME = "pptx-viewer-autosave";
|
|
8774
|
-
var DB_VERSION = 1;
|
|
8775
|
-
var STORE_NAME = "recoveryVersions";
|
|
8776
|
-
function openAutosaveDb() {
|
|
8777
|
-
return new Promise((resolve, reject) => {
|
|
8778
|
-
const req = indexedDB.open(DB_NAME, DB_VERSION);
|
|
8779
|
-
req.onupgradeneeded = () => {
|
|
8780
|
-
const db = req.result;
|
|
8781
|
-
if (!db.objectStoreNames.contains(STORE_NAME)) {
|
|
8782
|
-
db.createObjectStore(STORE_NAME, { keyPath: "key" });
|
|
8783
|
-
}
|
|
8784
|
-
};
|
|
8785
|
-
req.onsuccess = () => resolve(req.result);
|
|
8786
|
-
req.onerror = () => reject(req.error);
|
|
8787
|
-
});
|
|
8788
|
-
}
|
|
8789
|
-
async function getRecoveryVersion(filePath) {
|
|
8790
|
-
try {
|
|
8791
|
-
const db = await openAutosaveDb();
|
|
8792
|
-
return new Promise((resolve) => {
|
|
8793
|
-
const tx = db.transaction(STORE_NAME, "readonly");
|
|
8794
|
-
const store = tx.objectStore(STORE_NAME);
|
|
8795
|
-
const req = store.get(filePath);
|
|
8796
|
-
req.onsuccess = () => {
|
|
8797
|
-
db.close();
|
|
8798
|
-
resolve(req.result);
|
|
8799
|
-
};
|
|
8800
|
-
req.onerror = () => {
|
|
8801
|
-
db.close();
|
|
8802
|
-
resolve(void 0);
|
|
8803
|
-
};
|
|
8804
|
-
});
|
|
8805
|
-
} catch {
|
|
8806
|
-
return void 0;
|
|
8807
|
-
}
|
|
8808
|
-
}
|
|
8809
8733
|
function useRecoveryDetection(input) {
|
|
8810
|
-
const { filePath, loading, error, slideCount,
|
|
8734
|
+
const { filePath, loading, error, slideCount, autosaveAllowed = true } = input;
|
|
8811
8735
|
const recoveryCheckedRef = react.useRef(false);
|
|
8736
|
+
const recordRef = react.useRef(null);
|
|
8737
|
+
const [prompt, setPrompt] = react.useState(null);
|
|
8738
|
+
const onRestore = input.onRestore;
|
|
8739
|
+
const openVersionHistory = input.openVersionHistory;
|
|
8812
8740
|
react.useEffect(() => {
|
|
8813
|
-
if (!
|
|
8741
|
+
if (!chunkT7BIRNE4_js.shouldProbeAutosaveRecovery({
|
|
8814
8742
|
alreadyChecked: recoveryCheckedRef.current,
|
|
8815
8743
|
filePath,
|
|
8816
8744
|
loading,
|
|
8817
8745
|
error,
|
|
8818
|
-
slideCount
|
|
8746
|
+
slideCount,
|
|
8747
|
+
autosaveAllowed
|
|
8819
8748
|
})) {
|
|
8820
8749
|
return;
|
|
8821
8750
|
}
|
|
8822
8751
|
recoveryCheckedRef.current = true;
|
|
8823
|
-
if (typeof indexedDB === "undefined") {
|
|
8824
|
-
return;
|
|
8825
|
-
}
|
|
8826
8752
|
void (async () => {
|
|
8827
|
-
|
|
8828
|
-
|
|
8829
|
-
|
|
8830
|
-
openVersionHistory();
|
|
8831
|
-
}
|
|
8832
|
-
} catch {
|
|
8753
|
+
const offer = await chunkT7BIRNE4_js.probeAutosaveRecovery(filePath);
|
|
8754
|
+
if (!offer) {
|
|
8755
|
+
return;
|
|
8833
8756
|
}
|
|
8757
|
+
recordRef.current = offer.record;
|
|
8758
|
+
setPrompt(offer.prompt);
|
|
8759
|
+
openVersionHistory?.();
|
|
8834
8760
|
})();
|
|
8835
|
-
}, [filePath, loading, error, slideCount, openVersionHistory]);
|
|
8761
|
+
}, [filePath, loading, error, slideCount, autosaveAllowed, openVersionHistory]);
|
|
8762
|
+
const restore = react.useCallback(() => {
|
|
8763
|
+
const record = recordRef.current;
|
|
8764
|
+
setPrompt(null);
|
|
8765
|
+
if (record && onRestore) {
|
|
8766
|
+
onRestore(chunkT7BIRNE4_js.acceptAutosaveRecovery(record));
|
|
8767
|
+
}
|
|
8768
|
+
recordRef.current = null;
|
|
8769
|
+
}, [onRestore]);
|
|
8770
|
+
const discard = react.useCallback(() => {
|
|
8771
|
+
const record = recordRef.current;
|
|
8772
|
+
setPrompt(null);
|
|
8773
|
+
recordRef.current = null;
|
|
8774
|
+
if (record) {
|
|
8775
|
+
void chunkT7BIRNE4_js.discardAutosaveRecovery(record);
|
|
8776
|
+
}
|
|
8777
|
+
}, []);
|
|
8778
|
+
return { prompt, restore, discard };
|
|
8836
8779
|
}
|
|
8837
8780
|
function usePresentationSetup(input) {
|
|
8838
8781
|
const {
|
|
@@ -8869,7 +8812,7 @@ function usePresentationSetup(input) {
|
|
|
8869
8812
|
containerRef,
|
|
8870
8813
|
content,
|
|
8871
8814
|
onSetMode: (nextMode) => {
|
|
8872
|
-
if (mode === "present" && nextMode !== "present" && !
|
|
8815
|
+
if (mode === "present" && nextMode !== "present" && !chunkT7BIRNE4_js.mayLeaveSlideShow()) {
|
|
8873
8816
|
return;
|
|
8874
8817
|
}
|
|
8875
8818
|
if (mode === "present" && nextMode !== "present" && annotations.hasAnyAnnotations && promptKeepInkAnnotations) {
|
|
@@ -8877,7 +8820,7 @@ function usePresentationSetup(input) {
|
|
|
8877
8820
|
setShowKeepAnnotationsDialog(true);
|
|
8878
8821
|
} else {
|
|
8879
8822
|
if (mode === "present" && nextMode !== "present") {
|
|
8880
|
-
|
|
8823
|
+
chunkT7BIRNE4_js.stopAllPersistentAudio();
|
|
8881
8824
|
stopAnimationSound();
|
|
8882
8825
|
}
|
|
8883
8826
|
setMode(nextMode);
|
|
@@ -8932,10 +8875,10 @@ function usePresentationSetup(input) {
|
|
|
8932
8875
|
onToggleToolbar: () => annotations.setToolbarVisible(!annotations.toolbarVisible),
|
|
8933
8876
|
onToggleSubtitles,
|
|
8934
8877
|
onSaveRehearsalTimings: (timings) => {
|
|
8935
|
-
setSlides((prev) =>
|
|
8878
|
+
setSlides((prev) => chunkT7BIRNE4_js.applyRehearsalTimings(prev, timings));
|
|
8936
8879
|
history.markDirty();
|
|
8937
8880
|
},
|
|
8938
|
-
loopContinuously:
|
|
8881
|
+
loopContinuously: chunkT7BIRNE4_js.shouldLoopContinuously(presentationProperties),
|
|
8939
8882
|
showWithAnimation: presentationProperties.showWithAnimation,
|
|
8940
8883
|
useTimings: presentationProperties.advanceMode !== "manual",
|
|
8941
8884
|
endWithBlackSlide
|
|
@@ -9128,7 +9071,7 @@ function useEditorOperations(input) {
|
|
|
9128
9071
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
9129
9072
|
react.useEffect(() => {
|
|
9130
9073
|
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9131
|
-
copiedFormatRef.current =
|
|
9074
|
+
copiedFormatRef.current = chunkT7BIRNE4_js.copyFormatFromElement(selectedElement);
|
|
9132
9075
|
} else if (!formatPainterActive) {
|
|
9133
9076
|
copiedFormatRef.current = null;
|
|
9134
9077
|
}
|
|
@@ -9154,12 +9097,12 @@ function useEditorOperations(input) {
|
|
|
9154
9097
|
e.stopPropagation();
|
|
9155
9098
|
const element = elementLookup.get(elementId);
|
|
9156
9099
|
if (element) {
|
|
9157
|
-
const updated =
|
|
9100
|
+
const updated = chunkT7BIRNE4_js.applyFormatToElement(element, copiedFormatRef.current);
|
|
9158
9101
|
const updates = {};
|
|
9159
|
-
if (
|
|
9102
|
+
if (chunkT7BIRNE4_js.hasShapeProperties(updated)) {
|
|
9160
9103
|
updates.shapeStyle = updated.shapeStyle;
|
|
9161
9104
|
}
|
|
9162
|
-
if (
|
|
9105
|
+
if (chunkT7BIRNE4_js.hasTextProperties(updated)) {
|
|
9163
9106
|
updates.textStyle = updated.textStyle;
|
|
9164
9107
|
}
|
|
9165
9108
|
ops.updateElementById(elementId, updates);
|
|
@@ -9313,7 +9256,7 @@ function collectReferencedFontFamilies(slides) {
|
|
|
9313
9256
|
const families = /* @__PURE__ */ new Set();
|
|
9314
9257
|
for (const slide of slides) {
|
|
9315
9258
|
for (const el of slide.elements) {
|
|
9316
|
-
if (
|
|
9259
|
+
if (chunkT7BIRNE4_js.hasTextProperties(el) && el.textSegments) {
|
|
9317
9260
|
for (const seg of el.textSegments) {
|
|
9318
9261
|
if (seg.style.fontFamily) {
|
|
9319
9262
|
families.add(seg.style.fontFamily);
|
|
@@ -9443,7 +9386,7 @@ function useContentLifecycle(input) {
|
|
|
9443
9386
|
content,
|
|
9444
9387
|
filePath,
|
|
9445
9388
|
autosaveEnabled = true,
|
|
9446
|
-
|
|
9389
|
+
autosaveIntervalMs,
|
|
9447
9390
|
embedFonts = true,
|
|
9448
9391
|
slides,
|
|
9449
9392
|
state,
|
|
@@ -9527,7 +9470,7 @@ function useContentLifecycle(input) {
|
|
|
9527
9470
|
filePath,
|
|
9528
9471
|
serializeSlides: serializeForRecovery,
|
|
9529
9472
|
enabled: autosaveEnabled,
|
|
9530
|
-
...
|
|
9473
|
+
...autosaveIntervalMs === void 0 ? {} : { intervalMs: autosaveIntervalMs },
|
|
9531
9474
|
// Everything `serializeForRecovery` reads that changes by REASSIGNMENT,
|
|
9532
9475
|
// so a poll that finds all of them unchanged can skip re-serializing a
|
|
9533
9476
|
// deck it has already snapshotted. The two refs are read by `.current`
|
|
@@ -9560,7 +9503,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9560
9503
|
inputRef.current = input;
|
|
9561
9504
|
const handleKeyDown = react.useCallback((e) => {
|
|
9562
9505
|
const current = inputRef.current;
|
|
9563
|
-
const { action, dx, dy } =
|
|
9506
|
+
const { action, dx, dy } = chunkT7BIRNE4_js.mapEditorKey(e, {
|
|
9564
9507
|
canEdit: current.canEdit,
|
|
9565
9508
|
// The Slide Master view is an editing surface, not a viewing one.
|
|
9566
9509
|
// Gating on `mode !== 'edit'` alone made `mapEditorKey` return
|
|
@@ -9573,7 +9516,7 @@ function useKeyboardShortcuts(input) {
|
|
|
9573
9516
|
hasSelection: current.hasSelection,
|
|
9574
9517
|
isEditingText: Boolean(current.inlineEditingElementId || current.tableEditorState?.isEditing),
|
|
9575
9518
|
isDrawing: current.activeTool !== "select",
|
|
9576
|
-
isTextInputTarget:
|
|
9519
|
+
isTextInputTarget: chunkT7BIRNE4_js.isEditorTextInputTarget(e.target)
|
|
9577
9520
|
});
|
|
9578
9521
|
if (action === null) {
|
|
9579
9522
|
return;
|
|
@@ -9727,7 +9670,8 @@ function useViewerIntegration(input) {
|
|
|
9727
9670
|
content,
|
|
9728
9671
|
filePath,
|
|
9729
9672
|
autosaveEnabled,
|
|
9730
|
-
|
|
9673
|
+
autosaveAllowed = true,
|
|
9674
|
+
autosaveIntervalMs,
|
|
9731
9675
|
canEdit,
|
|
9732
9676
|
mode,
|
|
9733
9677
|
slides,
|
|
@@ -9783,7 +9727,7 @@ function useViewerIntegration(input) {
|
|
|
9783
9727
|
content,
|
|
9784
9728
|
filePath,
|
|
9785
9729
|
autosaveEnabled,
|
|
9786
|
-
|
|
9730
|
+
autosaveIntervalMs,
|
|
9787
9731
|
// The File > Fonts toggle, finally reaching a save call.
|
|
9788
9732
|
embedFonts: dialogs.embedFontsEnabled,
|
|
9789
9733
|
slides,
|
|
@@ -9827,12 +9771,13 @@ function useViewerIntegration(input) {
|
|
|
9827
9771
|
setMode: state.setMode,
|
|
9828
9772
|
setSlides: state.setSlides
|
|
9829
9773
|
});
|
|
9830
|
-
useRecoveryDetection({
|
|
9774
|
+
const recovery = useRecoveryDetection({
|
|
9831
9775
|
filePath,
|
|
9832
9776
|
loading,
|
|
9833
9777
|
error,
|
|
9834
9778
|
slideCount: slides.length,
|
|
9835
|
-
|
|
9779
|
+
autosaveAllowed,
|
|
9780
|
+
onRestore: setContent
|
|
9836
9781
|
});
|
|
9837
9782
|
react.useImperativeHandle(
|
|
9838
9783
|
ref,
|
|
@@ -9877,7 +9822,7 @@ function useViewerIntegration(input) {
|
|
|
9877
9822
|
return zoom.scale;
|
|
9878
9823
|
},
|
|
9879
9824
|
setZoom(level) {
|
|
9880
|
-
zoom.setScale(
|
|
9825
|
+
zoom.setScale(chunkT7BIRNE4_js.clampZoomScale(level));
|
|
9881
9826
|
},
|
|
9882
9827
|
zoomIn() {
|
|
9883
9828
|
zoom.handleZoomIn();
|
|
@@ -10040,6 +9985,7 @@ function useViewerIntegration(input) {
|
|
|
10040
9985
|
handleEnterPresenterView,
|
|
10041
9986
|
handleEnterRehearsalMode,
|
|
10042
9987
|
autosaveStatus,
|
|
9988
|
+
recovery,
|
|
10043
9989
|
isEncryptedDialogOpen,
|
|
10044
9990
|
setIsEncryptedDialogOpen,
|
|
10045
9991
|
handlerRef,
|
|
@@ -10092,7 +10038,7 @@ function useReducedMotion() {
|
|
|
10092
10038
|
}
|
|
10093
10039
|
function useViewerOptions() {
|
|
10094
10040
|
const storeRef = react.useRef(null);
|
|
10095
|
-
storeRef.current ??=
|
|
10041
|
+
storeRef.current ??= chunkT7BIRNE4_js.createViewerOptionsStore();
|
|
10096
10042
|
const store = storeRef.current;
|
|
10097
10043
|
const options = react.useSyncExternalStore(
|
|
10098
10044
|
(onStoreChange) => store.subscribe(onStoreChange),
|
|
@@ -10101,9 +10047,9 @@ function useViewerOptions() {
|
|
|
10101
10047
|
);
|
|
10102
10048
|
return { optionsStore: store, options };
|
|
10103
10049
|
}
|
|
10104
|
-
var KNOWN_TAB_IDS = new Set(
|
|
10050
|
+
var KNOWN_TAB_IDS = new Set(chunkT7BIRNE4_js.TOOLBAR_TABS.map((tab) => tab.id));
|
|
10105
10051
|
function computeToolbarVisibility(hiddenActions) {
|
|
10106
|
-
const isHidden = (id) =>
|
|
10052
|
+
const isHidden = (id) => chunkT7BIRNE4_js.isActionHidden(id, hiddenActions);
|
|
10107
10053
|
const isTabVisible = (id) => !KNOWN_TAB_IDS.has(id) || !isHidden(id);
|
|
10108
10054
|
return { isHidden, isTabVisible };
|
|
10109
10055
|
}
|
|
@@ -10188,12 +10134,12 @@ function useYjsDocumentSync({
|
|
|
10188
10134
|
return;
|
|
10189
10135
|
}
|
|
10190
10136
|
try {
|
|
10191
|
-
const handler = new
|
|
10137
|
+
const handler = new chunkT7BIRNE4_js.PptxHandler();
|
|
10192
10138
|
await handler.load(sourceBytes.buffer);
|
|
10193
|
-
const currentSlides =
|
|
10139
|
+
const currentSlides = chunkT7BIRNE4_js.readSlidesFromYDoc(
|
|
10194
10140
|
doc
|
|
10195
10141
|
);
|
|
10196
|
-
const slidesToSave =
|
|
10142
|
+
const slidesToSave = chunkT7BIRNE4_js.buildSaveSlides(currentSlides, templateElementsBySlideId);
|
|
10197
10143
|
const bytes = await handler.save(slidesToSave);
|
|
10198
10144
|
config.onWriteBack(bytes);
|
|
10199
10145
|
} catch {
|
|
@@ -10208,7 +10154,7 @@ function useYjsDocumentSync({
|
|
|
10208
10154
|
if (!doc || !isConnected) {
|
|
10209
10155
|
return;
|
|
10210
10156
|
}
|
|
10211
|
-
const docSlides =
|
|
10157
|
+
const docSlides = chunkT7BIRNE4_js.readSlidesFromYDoc(
|
|
10212
10158
|
doc
|
|
10213
10159
|
);
|
|
10214
10160
|
if (docSlides.length === 0) {
|
|
@@ -10230,11 +10176,11 @@ function useYjsDocumentSync({
|
|
|
10230
10176
|
lastSyncedRef.current = serialized;
|
|
10231
10177
|
void (async () => {
|
|
10232
10178
|
const factories = await getFactories();
|
|
10233
|
-
|
|
10179
|
+
chunkT7BIRNE4_js.reconcileSlidesInYDoc(
|
|
10234
10180
|
slides,
|
|
10235
10181
|
doc,
|
|
10236
10182
|
factories,
|
|
10237
|
-
|
|
10183
|
+
chunkT7BIRNE4_js.LOCAL_SYNC_ORIGIN
|
|
10238
10184
|
);
|
|
10239
10185
|
scheduleWriteBack();
|
|
10240
10186
|
})();
|
|
@@ -10248,10 +10194,10 @@ function useYjsDocumentSync({
|
|
|
10248
10194
|
return;
|
|
10249
10195
|
}
|
|
10250
10196
|
const handleChange = (_events, transaction) => {
|
|
10251
|
-
if (transaction?.origin ===
|
|
10197
|
+
if (transaction?.origin === chunkT7BIRNE4_js.LOCAL_SYNC_ORIGIN) {
|
|
10252
10198
|
return;
|
|
10253
10199
|
}
|
|
10254
|
-
const remoteSlides =
|
|
10200
|
+
const remoteSlides = chunkT7BIRNE4_js.readSlidesFromYDoc(
|
|
10255
10201
|
doc
|
|
10256
10202
|
);
|
|
10257
10203
|
if (remoteSlides.length === 0) {
|
|
@@ -10267,7 +10213,7 @@ function useYjsDocumentSync({
|
|
|
10267
10213
|
isApplyingRemoteRef.current = false;
|
|
10268
10214
|
scheduleWriteBack();
|
|
10269
10215
|
};
|
|
10270
|
-
const unobserve =
|
|
10216
|
+
const unobserve = chunkT7BIRNE4_js.observeYDocSlides(
|
|
10271
10217
|
doc,
|
|
10272
10218
|
handleChange
|
|
10273
10219
|
);
|
|
@@ -10305,7 +10251,7 @@ function useBroadcastFollower({
|
|
|
10305
10251
|
if (!broadcaster) {
|
|
10306
10252
|
return;
|
|
10307
10253
|
}
|
|
10308
|
-
if (!
|
|
10254
|
+
if (!chunkT7BIRNE4_js.shouldAutoFollowBroadcaster({
|
|
10309
10255
|
localRole: collab.config.role,
|
|
10310
10256
|
broadcasterRole: broadcaster.role
|
|
10311
10257
|
})) {
|
|
@@ -10476,10 +10422,10 @@ function useTouchGestures(input) {
|
|
|
10476
10422
|
if (!el || !enabled) {
|
|
10477
10423
|
return;
|
|
10478
10424
|
}
|
|
10479
|
-
const recognizer =
|
|
10425
|
+
const recognizer = chunkT7BIRNE4_js.createTouchGestureRecognizer({
|
|
10480
10426
|
getScale: () => scaleRef.current,
|
|
10481
|
-
minScale:
|
|
10482
|
-
maxScale:
|
|
10427
|
+
minScale: chunkT7BIRNE4_js.MIN_ZOOM_SCALE,
|
|
10428
|
+
maxScale: chunkT7BIRNE4_js.MAX_ZOOM_SCALE,
|
|
10483
10429
|
callbacks: {
|
|
10484
10430
|
onPinchZoom: (newScale) => callbacksRef.current.onPinchZoom?.(newScale),
|
|
10485
10431
|
onSwipe: (direction) => callbacksRef.current.onSwipe?.(direction),
|
|
@@ -10519,7 +10465,7 @@ function scrollFocusedIntoView(keyboardInset) {
|
|
|
10519
10465
|
return;
|
|
10520
10466
|
}
|
|
10521
10467
|
const rect = active.getBoundingClientRect();
|
|
10522
|
-
const delta =
|
|
10468
|
+
const delta = chunkT7BIRNE4_js.computeScrollDelta(
|
|
10523
10469
|
{ top: rect.top, bottom: rect.bottom },
|
|
10524
10470
|
window.innerHeight,
|
|
10525
10471
|
keyboardInset
|
|
@@ -10539,8 +10485,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10539
10485
|
return;
|
|
10540
10486
|
}
|
|
10541
10487
|
const update = () => {
|
|
10542
|
-
const metrics =
|
|
10543
|
-
const inset = metrics ?
|
|
10488
|
+
const metrics = chunkT7BIRNE4_js.readViewportMetrics(window);
|
|
10489
|
+
const inset = metrics ? chunkT7BIRNE4_js.computeKeyboardInset(metrics) : 0;
|
|
10544
10490
|
setKeyboardInset(inset);
|
|
10545
10491
|
if (inset > 0) {
|
|
10546
10492
|
window.requestAnimationFrame(() => scrollFocusedIntoView(inset));
|
|
@@ -10551,8 +10497,8 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10551
10497
|
vv.addEventListener("scroll", update);
|
|
10552
10498
|
const onFocusIn = () => {
|
|
10553
10499
|
window.requestAnimationFrame(() => {
|
|
10554
|
-
const metrics =
|
|
10555
|
-
const inset = metrics ?
|
|
10500
|
+
const metrics = chunkT7BIRNE4_js.readViewportMetrics(window);
|
|
10501
|
+
const inset = metrics ? chunkT7BIRNE4_js.computeKeyboardInset(metrics) : 0;
|
|
10556
10502
|
if (inset > 0) {
|
|
10557
10503
|
scrollFocusedIntoView(inset);
|
|
10558
10504
|
}
|
|
@@ -10565,7 +10511,7 @@ function useKeyboardInsets(enabled = true) {
|
|
|
10565
10511
|
document.removeEventListener("focusin", onFocusIn);
|
|
10566
10512
|
};
|
|
10567
10513
|
}, [enabled]);
|
|
10568
|
-
return { keyboardInset, isKeyboardOpen:
|
|
10514
|
+
return { keyboardInset, isKeyboardOpen: chunkT7BIRNE4_js.isKeyboardOpen(keyboardInset) };
|
|
10569
10515
|
}
|
|
10570
10516
|
|
|
10571
10517
|
// src/viewer/hooks/useViewerBuildingBlocks-canvas-props.ts
|
|
@@ -10592,7 +10538,7 @@ function buildCanvasProps(input) {
|
|
|
10592
10538
|
} = input;
|
|
10593
10539
|
const effectiveSlide = mode === "master" ? masterPseudoSlide : activeSlide;
|
|
10594
10540
|
const effectiveTemplateElements = mode === "master" ? s.activeLayout ? s.activeMaster?.elements ?? [] : [] : templateElements;
|
|
10595
|
-
const fieldContext =
|
|
10541
|
+
const fieldContext = chunkT7BIRNE4_js.buildFieldSubstitutionContext({
|
|
10596
10542
|
headerFooter: s.headerFooter,
|
|
10597
10543
|
customProperties: s.customProperties,
|
|
10598
10544
|
slide: activeSlide
|
|
@@ -10602,13 +10548,13 @@ function buildCanvasProps(input) {
|
|
|
10602
10548
|
if (mode === "present") {
|
|
10603
10549
|
presentation.handlePresentationAction(action);
|
|
10604
10550
|
} else if (action.url) {
|
|
10605
|
-
|
|
10551
|
+
chunkT7BIRNE4_js.safeOpenUrl(action.url);
|
|
10606
10552
|
}
|
|
10607
10553
|
};
|
|
10608
10554
|
const handleHyperlinkClick = (url) => {
|
|
10609
|
-
if (
|
|
10555
|
+
if (chunkT7BIRNE4_js.isPpactionUrl(url)) {
|
|
10610
10556
|
if (mode === "present") {
|
|
10611
|
-
const parsed =
|
|
10557
|
+
const parsed = chunkT7BIRNE4_js.parsePpactionUrl(url);
|
|
10612
10558
|
if (parsed) {
|
|
10613
10559
|
presentation.handlePresentationAction({
|
|
10614
10560
|
action: parsed.action,
|
|
@@ -10618,7 +10564,7 @@ function buildCanvasProps(input) {
|
|
|
10618
10564
|
}
|
|
10619
10565
|
return;
|
|
10620
10566
|
}
|
|
10621
|
-
|
|
10567
|
+
chunkT7BIRNE4_js.safeOpenUrl(url);
|
|
10622
10568
|
};
|
|
10623
10569
|
return {
|
|
10624
10570
|
activeSlide: effectiveSlide,
|
|
@@ -10714,7 +10660,7 @@ function buildCanvasProps(input) {
|
|
|
10714
10660
|
|
|
10715
10661
|
// src/viewer/hooks/useScopedLayoutOptions.ts
|
|
10716
10662
|
function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
|
|
10717
|
-
return
|
|
10663
|
+
return chunkT7BIRNE4_js.scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
|
|
10718
10664
|
}
|
|
10719
10665
|
|
|
10720
10666
|
// src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
|
|
@@ -10727,7 +10673,7 @@ function buildToolbarAnimationHandlers(input) {
|
|
|
10727
10673
|
const current = activeSlide.animations ?? [];
|
|
10728
10674
|
if (group === "motionPath") {
|
|
10729
10675
|
propertyHandlers.handleUpdateSlide({
|
|
10730
|
-
animations:
|
|
10676
|
+
animations: chunkT7BIRNE4_js.applyMotionPathPreset(current, selectedElement.id, preset)
|
|
10731
10677
|
});
|
|
10732
10678
|
return;
|
|
10733
10679
|
}
|
|
@@ -10922,7 +10868,7 @@ function buildToolbarProps(input) {
|
|
|
10922
10868
|
onOpenFile,
|
|
10923
10869
|
onOpenRecentFile,
|
|
10924
10870
|
onCreatePresentation: (templateId) => {
|
|
10925
|
-
s.setSlides(
|
|
10871
|
+
s.setSlides(chunkT7BIRNE4_js.createBackstagePresentation(templateId));
|
|
10926
10872
|
s.setActiveSlideIndex(0);
|
|
10927
10873
|
s.setSelectedElementId(null);
|
|
10928
10874
|
s.setSelectedElementIds([]);
|
|
@@ -10951,7 +10897,7 @@ function buildToolbarProps(input) {
|
|
|
10951
10897
|
loadLayoutPreviews: input.loadLayoutPreviews,
|
|
10952
10898
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
10953
10899
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
10954
|
-
templateScheme:
|
|
10900
|
+
templateScheme: chunkT7BIRNE4_js.templateSchemeFromTheme(s.theme?.colorScheme),
|
|
10955
10901
|
customShows: s.customShows,
|
|
10956
10902
|
activeCustomShowId: s.activeCustomShowId,
|
|
10957
10903
|
onSetActiveCustomShowId: s.setActiveCustomShowId,
|
|
@@ -10992,7 +10938,7 @@ function buildToolbarProps(input) {
|
|
|
10992
10938
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
10993
10939
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
10994
10940
|
formatPainterActive: s.formatPainterActive,
|
|
10995
|
-
canActivateFormatPainter:
|
|
10941
|
+
canActivateFormatPainter: chunkT7BIRNE4_js.hasCopyableFormat(selectedElement),
|
|
10996
10942
|
onToggleFormatPainter: () => s.setFormatPainterActive((p) => !p),
|
|
10997
10943
|
isSelectionPaneOpen: s.isSelectionPaneOpen,
|
|
10998
10944
|
onToggleSelectionPane: () => s.setIsSelectionPaneOpen((p) => !p),
|
|
@@ -11280,7 +11226,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11280
11226
|
}, [incomingContent]);
|
|
11281
11227
|
const onOpenFile = react.useCallback(() => {
|
|
11282
11228
|
void (async () => {
|
|
11283
|
-
const picked = await
|
|
11229
|
+
const picked = await chunkT7BIRNE4_js.openPptxFile();
|
|
11284
11230
|
if (picked) {
|
|
11285
11231
|
setContent(picked.buffer);
|
|
11286
11232
|
}
|
|
@@ -11288,7 +11234,7 @@ function useViewerBuildingBlocks(input) {
|
|
|
11288
11234
|
}, []);
|
|
11289
11235
|
const onOpenRecentFile = react.useCallback((key) => {
|
|
11290
11236
|
void (async () => {
|
|
11291
|
-
const bytes = await
|
|
11237
|
+
const bytes = await chunkT7BIRNE4_js.readBackstageRecentFile(key);
|
|
11292
11238
|
if (bytes) {
|
|
11293
11239
|
setContent(bytes);
|
|
11294
11240
|
}
|